diff --git a/etc/eslint/.eslintrc.markdown.js b/etc/eslint/.eslintrc.markdown.js index 3c2648c862ad..2119487492e6 100644 --- a/etc/eslint/.eslintrc.markdown.js +++ b/etc/eslint/.eslintrc.markdown.js @@ -146,6 +146,13 @@ eslint.rules[ 'no-unused-vars' ] = 'off'; */ eslint.rules[ 'node/no-unpublished-require' ] = 'off'; +/** +* Allow modern ECMAScript syntax. +* +* @private +*/ +eslint.rules[ 'node/no-unsupported-features/es-syntax' ] = 'off'; + // EXPORTS // diff --git a/etc/eslint/overrides/index.js b/etc/eslint/overrides/index.js index cb86b7a1f720..07a4b5616706 100644 --- a/etc/eslint/overrides/index.js +++ b/etc/eslint/overrides/index.js @@ -158,7 +158,8 @@ var overrides = [ 'stdlib/return-annotations-values': 'off', 'strict': 'off', 'vars-on-top': 'off', - 'node/no-unpublished-require': 'off' + 'node/no-unpublished-require': 'off', + 'node/no-unsupported-features/es-syntax': 'off' } }, { diff --git a/etc/eslint/rules/spellcheck.js b/etc/eslint/rules/spellcheck.js index 8070c80b8c00..b8fc9bacf4ae 100644 --- a/etc/eslint/rules/spellcheck.js +++ b/etc/eslint/rules/spellcheck.js @@ -83,15 +83,21 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'exponentiated', 'evalpoly', 'evalrational', + 'gmean', + 'hmean', 'hommel', 'iget', + 'indegree', + 'indegrees', 'iset', + 'isnan', 'logcdf', 'logit', 'logpdf', 'logpmf', 'lpad', 'ltrim', + 'memberof', 'napi', 'nargs', 'ncols', @@ -102,12 +108,14 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'ndarrays', 'nrows', 'nsubmodes', + 'numel', 'pvalues', 'randn', 'randu', 'rpad', 'rtrim', 'significand', + 'significands', 'stdev', 'strided', 'stringifying', diff --git a/lib/node_modules/@stdlib/_tools/benchmarks/browser-build/README.md b/lib/node_modules/@stdlib/_tools/benchmarks/browser-build/README.md index 29512653502f..c54e9427b5cb 100644 --- a/lib/node_modules/@stdlib/_tools/benchmarks/browser-build/README.md +++ b/lib/node_modules/@stdlib/_tools/benchmarks/browser-build/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/benchmarks/browser-build' ); +const build = require( '@stdlib/_tools/benchmarks/browser-build' ); ``` #### build( root, output, \[options,] clbk ) @@ -47,10 +47,10 @@ Given a `root` directory from which to search for benchmarks and an output direc ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; build( root, out, clbk ); @@ -79,12 +79,12 @@ To provide an alternative glob pattern, set the `pattern` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; -var opts = { +const opts = { 'pattern': '**/bench.js' }; @@ -107,12 +107,12 @@ To mount a bundle on a URL path, set the `mount`option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; -var opts = { +const opts = { 'mount': '/www/public/' }; @@ -153,17 +153,17 @@ function clbk( error, bool ) { ```javascript -var join = require( 'path' ).join; -var resolve = require( 'path' ).resolve; -var mkdirp = require( 'mkdirp' ).sync; -var build = require( '@stdlib/_tools/benchmarks/browser-build' ); +const join = require( 'path' ).join; +const resolve = require( 'path' ).resolve; +const mkdirp = require( 'mkdirp' ).sync; +const build = require( '@stdlib/_tools/benchmarks/browser-build' ); -var root = join( __dirname, 'fixtures' ); -var out = resolve( __dirname, '../build' ); +const root = join( __dirname, 'fixtures' ); +const out = resolve( __dirname, '../build' ); mkdirp( out ); -var opts = { +const opts = { 'pattern': 'index.js', 'bundle': 'benchmark_bundle.js', 'html': 'benchmarks.html' diff --git a/lib/node_modules/@stdlib/_tools/benchmarks/bundle/README.md b/lib/node_modules/@stdlib/_tools/benchmarks/bundle/README.md index 72a550869c88..5b00c004a5f0 100644 --- a/lib/node_modules/@stdlib/_tools/benchmarks/bundle/README.md +++ b/lib/node_modules/@stdlib/_tools/benchmarks/bundle/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bundle = require( '@stdlib/_tools/benchmarks/bundle' ); +const bundle = require( '@stdlib/_tools/benchmarks/bundle' ); ``` #### bundle( root, \[options,] clbk ) @@ -45,7 +45,7 @@ var bundle = require( '@stdlib/_tools/benchmarks/bundle' ); Given a `root` directory from which to search for benchmarks, bundle benchmarks into a single file using [browserify][browserify]. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); bundle( cwd(), clbk ); @@ -65,9 +65,9 @@ The function accepts the following `options`: To specify an output file path, set the `out` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var opts = { +const opts = { 'out': '/foo/bar/bundle.js' }; @@ -88,9 +88,9 @@ function clbk( error, bool ) { To provide an alternative glob pattern, set the `pattern` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var opts = { +const opts = { 'pattern': '**/bench.js' }; @@ -127,12 +127,12 @@ function clbk( error, bundle ) { ```javascript -var join = require( 'path' ).join; -var bundle = require( '@stdlib/_tools/benchmarks/bundle' ); +const join = require( 'path' ).join; +const bundle = require( '@stdlib/_tools/benchmarks/bundle' ); -var root = join( __dirname, 'fixtures' ); +const root = join( __dirname, 'fixtures' ); -var opts = { +const opts = { 'pattern': '*.js' }; diff --git a/lib/node_modules/@stdlib/_tools/benchmarks/html/README.md b/lib/node_modules/@stdlib/_tools/benchmarks/html/README.md index ff5e510ca286..525e250bce93 100644 --- a/lib/node_modules/@stdlib/_tools/benchmarks/html/README.md +++ b/lib/node_modules/@stdlib/_tools/benchmarks/html/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/benchmarks/html' ); +const build = require( '@stdlib/_tools/benchmarks/html' ); ``` #### build( bundle, \[options,] clbk ) @@ -45,7 +45,7 @@ var build = require( '@stdlib/_tools/benchmarks/html' ); Given a `bundle` URL from which to load a benchmarks bundle, returns an HTML file for running benchmarks. ```javascript -var bundle = '/foo/bar/bundle.js'; +const bundle = '/foo/bar/bundle.js'; build( bundle, clbk ); @@ -65,9 +65,9 @@ The function accepts the following `options`: To specify an output file path, set the `out` option. ```javascript -var bundle = '/foo/bar/bundle.js'; +const bundle = '/foo/bar/bundle.js'; -var opts = { +const opts = { 'out': '/foo/bar/benchmarks.html' }; @@ -101,7 +101,7 @@ function clbk( error ) { ```javascript -var build = require( '@stdlib/_tools/benchmarks/html' ); +const build = require( '@stdlib/_tools/benchmarks/html' ); build( '/foo/bar/bundle.js', onBuild ); diff --git a/lib/node_modules/@stdlib/_tools/bib/citation-reference/README.md b/lib/node_modules/@stdlib/_tools/bib/citation-reference/README.md index 067c073f0d9b..ce254718359d 100644 --- a/lib/node_modules/@stdlib/_tools/bib/citation-reference/README.md +++ b/lib/node_modules/@stdlib/_tools/bib/citation-reference/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var toReference = require( '@stdlib/_tools/bib/citation-reference' ); +const toReference = require( '@stdlib/_tools/bib/citation-reference' ); ``` @@ -65,7 +65,7 @@ To use a specific bibliographic database, set the `database` option. ```javascript -var opts = { +const opts = { 'database': '/foo/bar/baz/bib.bib' }; @@ -84,7 +84,7 @@ To use a particular [Citation Style Language][csl] (CSL), set the `csl` option. ```javascript -var opts = { +const opts = { 'csl': '/foo/bar/baz/style.csl' }; @@ -105,7 +105,7 @@ Synchronously returns a reference corresponding to a citation identifier. ```javascript -var ref = toReference.sync( '@press:1992' ); +const ref = toReference.sync( '@press:1992' ); // returns '...' ``` @@ -139,7 +139,7 @@ The method accepts the same `options` as [`toReference()`](#to-reference) above. ```javascript -var toReference = require( '@stdlib/_tools/bib/citation-reference' ); +const toReference = require( '@stdlib/_tools/bib/citation-reference' ); /* bib.bib @book{press:1992, @@ -152,7 +152,7 @@ var toReference = require( '@stdlib/_tools/bib/citation-reference' ); } */ -var opts = { +const opts = { 'database': 'bib.bib', 'csl': 'chicago-author-date.csl' }; diff --git a/lib/node_modules/@stdlib/_tools/browserify/file-list/README.md b/lib/node_modules/@stdlib/_tools/browserify/file-list/README.md index fac966675a5e..0f5805955771 100644 --- a/lib/node_modules/@stdlib/_tools/browserify/file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/browserify/file-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bundle = require( '@stdlib/_tools/browserify/file-list' ); +const bundle = require( '@stdlib/_tools/browserify/file-list' ); ``` #### bundle( files, \[dest,] clbk ) @@ -45,7 +45,7 @@ var bundle = require( '@stdlib/_tools/browserify/file-list' ); Bundles files into a single file using [browserify][browserify]. ```javascript -var files = [ +const files = [ '/foo/bar.js', '/beep/boop.js' ]; @@ -63,7 +63,7 @@ function clbk( error, bundle ) { To specify an output file path, provide a `dest` argument. ```javascript -var files = [ +const files = [ '/foo/bar.js', '/beep/boop.js' ]; @@ -102,11 +102,11 @@ function clbk( error ) { ```javascript -var join = require( 'path' ).join; -var bundle = require( '@stdlib/_tools/browserify/file-list' ); +const join = require( 'path' ).join; +const bundle = require( '@stdlib/_tools/browserify/file-list' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'index.js' ); -var files = [ fpath ]; +const fpath = join( __dirname, 'examples', 'fixtures', 'index.js' ); +const files = [ fpath ]; bundle( files, onBundle ); diff --git a/lib/node_modules/@stdlib/_tools/browserify/string/README.md b/lib/node_modules/@stdlib/_tools/browserify/string/README.md index 541945ba8e23..3b806156739f 100644 --- a/lib/node_modules/@stdlib/_tools/browserify/string/README.md +++ b/lib/node_modules/@stdlib/_tools/browserify/string/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bundle = require( '@stdlib/_tools/browserify/string' ); +const bundle = require( '@stdlib/_tools/browserify/string' ); ``` #### bundle( str, \[dest,] \[options,] clbk ) @@ -45,7 +45,7 @@ var bundle = require( '@stdlib/_tools/browserify/string' ); Generates a bundle from a `string` using [browserify][browserify]. ```javascript -var str = 'module.exports = require( "url" );'; +const str = 'module.exports = require( "url" );'; bundle( str, clbk ); @@ -60,7 +60,7 @@ function clbk( error, bundle ) { To specify an output file path, provide a `dest` argument. ```javascript -var str = 'module.exports = require( "url" );'; +const str = 'module.exports = require( "url" );'; bundle( str, './bundle.js', clbk ); @@ -106,11 +106,11 @@ The function accepts any [browserify][browserify] `option`, as well as the follo ```javascript -var bundle = require( '@stdlib/_tools/browserify/string' ); +const bundle = require( '@stdlib/_tools/browserify/string' ); -var str = 'module.exports = require( "path" ).join;'; +const str = 'module.exports = require( "path" ).join;'; -var opts = { +const opts = { 'exportName': 'beep' }; diff --git a/lib/node_modules/@stdlib/_tools/bundle/pkg-list/README.md b/lib/node_modules/@stdlib/_tools/bundle/pkg-list/README.md index ca6bae3ccc8e..bb58e9b20f9d 100644 --- a/lib/node_modules/@stdlib/_tools/bundle/pkg-list/README.md +++ b/lib/node_modules/@stdlib/_tools/bundle/pkg-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bundle = require( '@stdlib/_tools/bundle/pkg-list' ); +const bundle = require( '@stdlib/_tools/bundle/pkg-list' ); ``` #### bundle( pkgs, \[options,] clbk ) @@ -45,12 +45,12 @@ var bundle = require( '@stdlib/_tools/bundle/pkg-list' ); Bundles a list of packages into a single file. ```javascript -var pkgs = [ +const pkgs = [ '@stdlib/math/base/special/erf', '@stdlib/math/base/special/gamma' ]; -var opts = { +const opts = { 'bundler': 'browserify', 'paths': [ '/path/to/stdlib/packages' @@ -108,16 +108,16 @@ The function accepts the following `options` which are specific to [browserify][ ```javascript -var pkgNames = require( '@stdlib/_tools/pkgs/names' ); -var bundle = require( '@stdlib/_tools/bundle/pkg-list' ); +const pkgNames = require( '@stdlib/_tools/pkgs/names' ); +const bundle = require( '@stdlib/_tools/bundle/pkg-list' ); -var fopts = { +const fopts = { 'pattern': '**/assert/**/package.json', 'ignore': [ '**/_**/**' // ignore "private" packages ] }; -var bopts = { +const bopts = { 'namespace': 'tree', 'exportName': '@stdlib' }; diff --git a/lib/node_modules/@stdlib/_tools/changelog/generate/README.md b/lib/node_modules/@stdlib/_tools/changelog/generate/README.md index 007011a6cb82..20f0207b1408 100644 --- a/lib/node_modules/@stdlib/_tools/changelog/generate/README.md +++ b/lib/node_modules/@stdlib/_tools/changelog/generate/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var generate = require( '@stdlib/_tools/changelog/generate' ); +const generate = require( '@stdlib/_tools/changelog/generate' ); ``` #### generate( pkg\[, releaseType] ) @@ -35,7 +35,7 @@ var generate = require( '@stdlib/_tools/changelog/generate' ); Generates a Markdown formatted changelog for a specified package. ```javascript -var changelog = generate( '@stdlib/assert/contains' ); +const changelog = generate( '@stdlib/assert/contains' ); // returns {...} ``` @@ -47,7 +47,7 @@ The function returns an object with the following properties: To generate a changelog for an upcoming release, provide a valid release type as the second argument. ```javascript -var changelog = generate( '@stdlib/assert/contains', 'patch' ); +let changelog = generate( '@stdlib/assert/contains', 'patch' ); // returns {...} changelog = generate( '@stdlib/assert/contains', 'minor' ); @@ -81,14 +81,14 @@ The following release types are supported: ## Examples ```javascript -var generate = require( '@stdlib/_tools/changelog/generate' ); +const generate = require( '@stdlib/_tools/changelog/generate' ); // Generate a changelog for a non-namespace package: -var changelog = generate( '@stdlib/utils/curry' ); -var content = changelog.content; +let changelog = generate( '@stdlib/utils/curry' ); +let content = changelog.content; // returns '...' -var releaseType = changelog.releaseType; +let releaseType = changelog.releaseType; // returns null // Generate a changelog for a new release: diff --git a/lib/node_modules/@stdlib/_tools/changelog/parse-commits/README.md b/lib/node_modules/@stdlib/_tools/changelog/parse-commits/README.md index 9a6ea4f2dd0b..a1ec1fa210ac 100644 --- a/lib/node_modules/@stdlib/_tools/changelog/parse-commits/README.md +++ b/lib/node_modules/@stdlib/_tools/changelog/parse-commits/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); +const parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); ``` #### parseCommits( \[options] ) @@ -35,7 +35,7 @@ var parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); Parses commit messages into conventional changelog objects. ```javascript -var commits = parseCommits(); +const commits = parseCommits(); // returns [...] ``` @@ -60,9 +60,9 @@ The function accepts the following `options`: ## Examples ```javascript -var parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); +const parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); -var commits = parseCommits(); +let commits = parseCommits(); // returns [...] commits = parseCommits({ diff --git a/lib/node_modules/@stdlib/_tools/changelog/recommend-version-bump/README.md b/lib/node_modules/@stdlib/_tools/changelog/recommend-version-bump/README.md index d59f051ff7f5..365319b1c4a8 100644 --- a/lib/node_modules/@stdlib/_tools/changelog/recommend-version-bump/README.md +++ b/lib/node_modules/@stdlib/_tools/changelog/recommend-version-bump/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var recommendVersionBump = require( '@stdlib/_tools/changelog/recommend-version-bump' ); +const recommendVersionBump = require( '@stdlib/_tools/changelog/recommend-version-bump' ); ``` #### recommendVersionBump( commits ) @@ -35,7 +35,7 @@ var recommendVersionBump = require( '@stdlib/_tools/changelog/recommend-version- Recommends a version bump based on [parsed commit messages][@stdlib/_tools/changelog/parse-commits]. ```javascript -var commits = [ +let commits = [ { 'type': 'fix', 'notes': [] @@ -48,7 +48,7 @@ var commits = [ }] } ]; -var version = recommendVersionBump( commits ); +let version = recommendVersionBump( commits ); // returns 'major' commits = [ @@ -83,11 +83,11 @@ The function returns a string indicating the recommended version bump or `null` ## Examples ```javascript -var parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); -var recommendVersionBump = require( '@stdlib/_tools/changelog/recommend-version-bump' ); +const parseCommits = require( '@stdlib/_tools/changelog/parse-commits' ); +const recommendVersionBump = require( '@stdlib/_tools/changelog/recommend-version-bump' ); -var commits = parseCommits(); -var version = recommendVersionBump( commits ); +let commits = parseCommits(); +let version = recommendVersionBump( commits ); // returns commits = []; diff --git a/lib/node_modules/@stdlib/_tools/docs/www/benchmark-bundles/README.md b/lib/node_modules/@stdlib/_tools/docs/www/benchmark-bundles/README.md index 28dfb223e5df..352f7ceca1c0 100644 --- a/lib/node_modules/@stdlib/_tools/docs/www/benchmark-bundles/README.md +++ b/lib/node_modules/@stdlib/_tools/docs/www/benchmark-bundles/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/docs/www/benchmark-bundles' ); +const build = require( '@stdlib/_tools/docs/www/benchmark-bundles' ); ``` #### build( dest, \[options,] clbk ) @@ -61,7 +61,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -78,7 +78,7 @@ function done( error ) { To provide an alternative package inclusion filter, set the `packages_pattern` option. ```javascript -var opts = { +const opts = { 'packages_pattern': '**/foo/**/package.json' }; @@ -97,7 +97,7 @@ To exclude package matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -138,14 +138,14 @@ function done( error ) { ```javascript -var mkdir = require( 'fs' ).mkdirSync; -var resolve = require( 'path' ).resolve; -var exists = require( '@stdlib/fs/exists' ).sync; -var build = require( '@stdlib/_tools/docs/www/benchmark-bundles' ); +const mkdir = require( 'fs' ).mkdirSync; +const resolve = require( 'path' ).resolve; +const exists = require( '@stdlib/fs/exists' ).sync; +const build = require( '@stdlib/_tools/docs/www/benchmark-bundles' ); -var dpath = resolve( __dirname, 'build' ); +const dpath = resolve( __dirname, 'build' ); -var opts = { +const opts = { 'dir': './lib/node_modules', 'packages_pattern': '**/base/special/sin/package.json', 'ignore': [ diff --git a/lib/node_modules/@stdlib/_tools/docs/www/readme-database/README.md b/lib/node_modules/@stdlib/_tools/docs/www/readme-database/README.md index d811ae50b7c0..fb44875616d3 100644 --- a/lib/node_modules/@stdlib/_tools/docs/www/readme-database/README.md +++ b/lib/node_modules/@stdlib/_tools/docs/www/readme-database/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var create = require( '@stdlib/_tools/docs/www/readme-database' ); +const create = require( '@stdlib/_tools/docs/www/readme-database' ); ``` #### create( \[options,] clbk ) @@ -59,7 +59,7 @@ To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -78,7 +78,7 @@ To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -97,7 +97,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -120,7 +120,7 @@ To have internal URLs of the READMEs link to relative (or absolute) documentatio ```javascript -var opts = { +const opts = { 'base': '/docs/api/v0.0.90/' }; @@ -157,9 +157,9 @@ function done( error, db ) { ```javascript -var create = require( '@stdlib/_tools/docs/www/readme-database' ); +const create = require( '@stdlib/_tools/docs/www/readme-database' ); -var opts = { +const opts = { 'dir': './lib/node_modules', 'ignore': [ 'benchmark/**', diff --git a/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/README.md b/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/README.md index 98d62bcf77b9..208abfc80a04 100644 --- a/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/README.md +++ b/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/docs/www/readme-fragment-file-tree' ); +const build = require( '@stdlib/_tools/docs/www/readme-fragment-file-tree' ); ``` #### build( dest, \[options,] clbk ) @@ -59,7 +59,7 @@ To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -78,7 +78,7 @@ To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -97,7 +97,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -120,7 +120,7 @@ To have internal URLs of the READMEs link to relative (or absolute) documentatio ```javascript -var opts = { +const opts = { 'base': '/docs/api/v0.0.90/' }; @@ -158,14 +158,14 @@ function done( error ) { ```javascript -var mkdir = require( 'fs' ).mkdirSync; -var resolve = require( 'path' ).resolve; -var exists = require( '@stdlib/fs/exists' ).sync; -var build = require( '@stdlib/_tools/docs/www/readme-fragment-file-tree' ); +const mkdir = require( 'fs' ).mkdirSync; +const resolve = require( 'path' ).resolve; +const exists = require( '@stdlib/fs/exists' ).sync; +const build = require( '@stdlib/_tools/docs/www/readme-fragment-file-tree' ); -var dpath = resolve( __dirname, 'build' ); +const dpath = resolve( __dirname, 'build' ); -var opts = { +const opts = { 'dir': './lib/node_modules', 'ignore': [ 'benchmark/**', diff --git a/lib/node_modules/@stdlib/_tools/docs/www/test-bundles/README.md b/lib/node_modules/@stdlib/_tools/docs/www/test-bundles/README.md index 66ccbedaf18f..637b927e9cd7 100644 --- a/lib/node_modules/@stdlib/_tools/docs/www/test-bundles/README.md +++ b/lib/node_modules/@stdlib/_tools/docs/www/test-bundles/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/docs/www/test-bundles' ); +const build = require( '@stdlib/_tools/docs/www/test-bundles' ); ``` #### build( dest, \[options,] clbk ) @@ -61,7 +61,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -78,7 +78,7 @@ function done( error ) { To provide an alternative package inclusion filter, set the `packages_pattern` option. ```javascript -var opts = { +const opts = { 'packages_pattern': '**/foo/**/package.json' }; @@ -97,7 +97,7 @@ To exclude package matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -138,14 +138,14 @@ function done( error ) { ```javascript -var mkdir = require( 'fs' ).mkdirSync; -var resolve = require( 'path' ).resolve; -var exists = require( '@stdlib/fs/exists' ).sync; -var build = require( '@stdlib/_tools/docs/www/test-bundles' ); +const mkdir = require( 'fs' ).mkdirSync; +const resolve = require( 'path' ).resolve; +const exists = require( '@stdlib/fs/exists' ).sync; +const build = require( '@stdlib/_tools/docs/www/test-bundles' ); -var dpath = resolve( __dirname, 'build' ); +const dpath = resolve( __dirname, 'build' ); -var opts = { +const opts = { 'dir': './lib/node_modules', 'packages_pattern': '**/base/special/sin/package.json', 'ignore': [ diff --git a/lib/node_modules/@stdlib/_tools/doctest/compare-values/README.md b/lib/node_modules/@stdlib/_tools/doctest/compare-values/README.md index 5e1166a387e1..05dc3f680e39 100644 --- a/lib/node_modules/@stdlib/_tools/doctest/compare-values/README.md +++ b/lib/node_modules/@stdlib/_tools/doctest/compare-values/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var compareValues = require( '@stdlib/_tools/doctest/compare-values' ); +const compareValues = require( '@stdlib/_tools/doctest/compare-values' ); ``` #### compareValues( actual, expected ) @@ -35,7 +35,7 @@ var compareValues = require( '@stdlib/_tools/doctest/compare-values' ); Checks whether a return value is equal to the value of a return annotation. In case of a mismatch, the function returns an error message; otherwise, it returns `null`. ```javascript -var out = compareValues( 4.126, '~4.13' ); +let out = compareValues( 4.126, '~4.13' ); // returns null out = compareValues( 4.126e-13, '~4.13e-13' ); @@ -65,7 +65,7 @@ out = compareValues( 'Hello World', '"Hello World"' ); ```javascript -var compareValues = require( '@stdlib/_tools/doctest/compare-values' ); +const compareValues = require( '@stdlib/_tools/doctest/compare-values' ); console.log( compareValues( true, 'false' ) ); // => 'Displayed return value is `false`, but function returns `true` instead' diff --git a/lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/README.md b/lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/README.md index f647f76db214..fbf8fcf5d02d 100644 --- a/lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/README.md +++ b/lib/node_modules/@stdlib/_tools/doctest/create-annotation-value/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var createAnnotationValue = require( '@stdlib/_tools/doctest/create-annotation-value' ); +const createAnnotationValue = require( '@stdlib/_tools/doctest/create-annotation-value' ); ``` #### createAnnotationValue( actual\[, options] ) @@ -35,7 +35,7 @@ var createAnnotationValue = require( '@stdlib/_tools/doctest/create-annotation-v Creates a doctest return annotation value. ```javascript -var out = createAnnotationValue( 1/3 ); +const out = createAnnotationValue( 1/3 ); // returns '~0.333' ``` @@ -49,7 +49,7 @@ The function accepts the following `options`: By default, the function does not include a decimal point for integer-valued return annotation values. To include a decimal point, set the `decimal` option. ```javascript -var out = createAnnotationValue( 2 ); +let out = createAnnotationValue( 2 ); // returns '2' out = createAnnotationValue( 2, { @@ -61,11 +61,11 @@ out = createAnnotationValue( 2, { By default, the function displays up to four elements for arrays. To include a decimal point, set the `decimal` option. For longer arrays, it uses `...` notation to skip over array elements. To change the number of array elements to be displayed, set the `numel` option. ```javascript -var arr = [ 1, 2, 3, 4, 5, 6, 7 ]; -var out = createAnnotationValue( arr ); +const arr = [ 1, 2, 3, 4, 5, 6, 7 ]; +let out = createAnnotationValue( arr ); // returns '[ 1, 2, ..., 6, 7 ]' -var opts = { +const opts = { 'numel': 6 }; out = createAnnotationValue( arr, opts ); @@ -75,22 +75,22 @@ out = createAnnotationValue( arr, opts ); Real-valued numbers are by default rounded to up to three decimal points. To round to a different number of decimal digits, set the `precision` option. ```javascript -var opts = { +const opts = { 'precision': 5 }; -var out = createAnnotationValue( 1/3, opts ); +const out = createAnnotationValue( 1/3, opts ); // returns '~0.33333' ``` To only include the type in the created annotation, set the `type` option. ```javascript -var opts = { +const opts = { 'type': true }; -var out = createAnnotationValue( 1/3, opts ); +const out = createAnnotationValue( 1/3, opts ); // returns '' ``` @@ -111,9 +111,9 @@ var out = createAnnotationValue( 1/3, opts ); ```javascript -var createAnnotationValue = require( '@stdlib/_tools/doctest/create-annotation-value' ); +const createAnnotationValue = require( '@stdlib/_tools/doctest/create-annotation-value' ); -var out = createAnnotationValue( true ); +let out = createAnnotationValue( true ); // returns 'true' out = createAnnotationValue( 1/3 ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/README.md index c7932bdbad6d..fa9bf5a643e4 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rules = require( '@stdlib/_tools/eslint/rules' ); +const rules = require( '@stdlib/_tools/eslint/rules' ); ``` #### rules @@ -41,7 +41,7 @@ var rules = require( '@stdlib/_tools/eslint/rules' ); Project-specific [ESLint rules][eslint-rules]. ```javascript -var eslint = rules; +const eslint = rules; // returns {...} ``` @@ -188,8 +188,8 @@ var eslint = rules; ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var rules = require( '@stdlib/_tools/eslint/rules' ); +const getKeys = require( '@stdlib/utils/keys' ); +const rules = require( '@stdlib/_tools/eslint/rules' ); console.log( getKeys( rules ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/README.md index 1b0fadb72b6c..b0fd2e611926 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/capitalized-comments' ); +const rule = require( '@stdlib/_tools/eslint/rules/capitalized-comments' ); ``` #### rule @@ -46,10 +46,8 @@ var rule = require( '@stdlib/_tools/eslint/rules/capitalized-comments' ); ```javascript function square( x ) { - var out; - // square the number: - out = x*x; + const out = x*x; return out; } ``` @@ -58,10 +56,8 @@ function square( x ) { ```javascript function square( x ) { - var out; - // Square the number: - out = x*x; // x^2 + const out = x*x; // x^2 return out; } ``` @@ -79,14 +75,12 @@ To allow uncapitalized words at the beginning of a comment, set the `whitelist` ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/capitalized-comments' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/capitalized-comments' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'function pow2( x ) {', ' var out;', '', @@ -98,7 +92,7 @@ code = [ linter.defineRule( 'capitalized-comments', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'capitalized-comments': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/README.md index 12efb048cb1d..9822fda4d501 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/doctest-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/doctest-marker' ); ``` #### rule @@ -45,7 +45,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/doctest-marker' ); ```javascript -var x = 3.0; +const x = 3.0; // => 3.0 console.log( 'Hello World' ); @@ -57,7 +57,7 @@ console.log( 'Hello World' ); **Good**: ```javascript -var x = 3.0; +const x = 3.0; // returns 3.0 console.log( 'Hello World' ); @@ -75,14 +75,12 @@ console.log( 'Hello World' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/doctest-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/doctest-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'var isLowercase = require( \'./../lib\' );', '', 'console.log( isLowercase( \'hello\' ) );', @@ -94,7 +92,7 @@ code = [ linter.defineRule( 'doctest-marker', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'doctest-marker': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/README.md index 2c4d5c305fc8..b2f44f304abe 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/doctest-quote-props' ); +const rule = require( '@stdlib/_tools/eslint/rules/doctest-quote-props' ); ``` #### rule @@ -45,14 +45,14 @@ var rule = require( '@stdlib/_tools/eslint/rules/doctest-quote-props' ); ```javascript -var copy = require( '@stdlib/utils/copy' ); +const copy = require( '@stdlib/utils/copy' ); -var value = { +const value = { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] }; -var out = copy( value ); +const out = copy( value ); /* returns { a: 1, @@ -65,14 +65,14 @@ var out = copy( value ); **Good**: ```javascript -var copy = require( '@stdlib/utils/copy' ); +const copy = require( '@stdlib/utils/copy' ); -var value = { +const value = { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] }; -var out = copy( value ); +const out = copy( value ); /* returns { 'a': 1, @@ -93,14 +93,12 @@ var out = copy( value ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/doctest-quote-props' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/doctest-quote-props' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ ' var target = {', ' \'a\': \'beep\'', ' };', @@ -115,7 +113,7 @@ code = [ linter.defineRule( 'doctest-quote-props', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'doctest-quote-props': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/README.md index 67ce39f7dc68..5526f3dd502e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/doctest' ); +const rule = require( '@stdlib/_tools/eslint/rules/doctest' ); ``` #### rule @@ -45,7 +45,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/doctest' ); ```javascript -var x = 3.0; +const x = 3.0; // returns 2.0 console.log( 'Hello World' ); @@ -55,7 +55,7 @@ console.log( 'Hello World' ); **Good**: ```javascript -var x = 3.0; +const x = 3.0; // returns 3.0 console.log( 'Hello World' ); @@ -75,14 +75,12 @@ Node.js script files, detected by looking for the appropriate shebang at the beg ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/doctest' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/doctest' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'var isLowercase = require( \'@stdlib/assert/is-lowercase\' );', '', 'console.log( isLowercase( \'hello\' ) );', @@ -94,7 +92,7 @@ code = [ linter.defineRule( 'doctest', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'doctest': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js index 6cc2a3389b69..7cb3d42b1c53 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js @@ -127,6 +127,9 @@ function main( context ) { } sourceCode = replace( source.text, RE_JSDOC, '' ); sourceCode = replace( sourceCode, RE_ESLINT_INLINE, '\n' ); + + // Replace variable declarations to avoid redeclaration errors: + sourceCode = replace( sourceCode, /(const|let) /g, 'var ' ); filename = context.getFilename(); dir = dirname( filename ); /** diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/README.md index dac81c4ccb68..1dc48ce98d20 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/empty-line-before-comment' ); +const rule = require( '@stdlib/_tools/eslint/rules/empty-line-before-comment' ); ``` #### rule @@ -76,14 +76,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/empty-line-before-comment' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/empty-line-before-comment' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'function square( x ) {', ' var out;', ' // Square the number:', @@ -94,7 +92,7 @@ code = [ linter.defineRule( 'empty-line-before-comment', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'empty-line-before-comment': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/first-unit-test/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/first-unit-test/README.md index 3911c773788d..c6d954c54805 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/first-unit-test/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/first-unit-test/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/first-unit-test' ); +const rule = require( '@stdlib/_tools/eslint/rules/first-unit-test' ); ``` #### rule @@ -45,8 +45,8 @@ var rule = require( '@stdlib/_tools/eslint/rules/first-unit-test' ); ```javascript -var tape = require( 'tape' ); -var identity = require( '@stdlib/utils/identity-function' ); +const tape = require( 'tape' ); +const identity = require( '@stdlib/utils/identity-function' ); tape( 'the function works correctly', function test( t ) { t.strictEqual( identity( true ), true, 'returns true' ); @@ -59,8 +59,8 @@ tape( 'the function works correctly', function test( t ) { ```javascript -var tape = require( 'tape' ); -var identity = require( '@stdlib/utils/identity-function' ); +const tape = require( 'tape' ); +const identity = require( '@stdlib/utils/identity-function' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); @@ -82,15 +82,12 @@ tape( 'main export is a function', function test( t ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/first-unit-test' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/first-unit-test' ); -var linter = new Linter(); -var result; -var config; -var code; +const linter = new Linter(); -code = [ +const code = [ '// MODULES //', '', 'var tape = require( \'tape\' );', @@ -107,12 +104,12 @@ code = [ linter.defineRule( 'first-unit-test', rule ); -config = { +const config = { 'rules': { 'first-unit-test': 'error' } }; -result = linter.verify( code, config, { +const result = linter.verify( code, config, { 'filename': 'test.factory.js' }); console.log( result ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/README.md index 14d5c46aa35f..79fda28cd16c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation' ); ``` #### rule @@ -93,15 +93,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -124,7 +122,7 @@ code = [ linter.defineRule( 'jsdoc-blockquote-indentation', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-blockquote-indentation': [ 'error', 2 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/README.md index f67782316635..8809fecf99cc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style' ); ``` #### rule @@ -101,15 +101,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -133,7 +131,7 @@ code = [ linter.defineRule( 'jsdoc-checkbox-character-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-checkbox-character-style': [ 'error', diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/README.md index 9b457b85fe0d..1138b88e9688 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -122,7 +120,7 @@ code = [ linter.defineRule( 'jsdoc-checkbox-content-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-checkbox-content-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/README.md index 8dc0dc0f71ab..73da6bd014d6 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-code-block-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-code-block-style' ); ``` #### rule @@ -95,15 +95,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-code-block-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-code-block-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -126,7 +124,7 @@ code = [ linter.defineRule( 'jsdoc-code-block-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-code-block-style': [ 'error', 'fenced' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/README.md index 318f2349152d..75717609baec 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-case' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-case' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-case' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-case' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop][Boop].', '*', @@ -122,7 +120,7 @@ code = [ linter.defineRule( 'jsdoc-definition-case', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-definition-case': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/README.md index 3884a15c6a7d..4fb0099ebe4c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-spacing' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-spacing' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-spacing' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-definition-spacing' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop][beep boop].', '*', @@ -122,7 +120,7 @@ code = [ linter.defineRule( 'jsdoc-definition-spacing', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-definition-spacing': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/README.md index e86923fa9923..419a5e6c2073 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point' ); ``` #### rule @@ -63,7 +63,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point' ); * var v = round( NaN ); * // returns NaN */ -var round = Math.round; +const round = Math.round; ``` **Good**: @@ -89,7 +89,7 @@ var round = Math.round; * var v = round( NaN ); * // returns NaN */ -var round = Math.round; +const round = Math.round; ``` @@ -103,14 +103,12 @@ var round = Math.round; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -131,7 +129,7 @@ code = [ linter.defineRule( 'jsdoc-doctest-decimal-point', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-doctest-decimal-point': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/README.md index 9286713162a1..b83b4af51624 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-marker' ); ``` #### rule @@ -97,14 +97,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -125,7 +123,7 @@ code = [ linter.defineRule( 'jsdoc-doctest-marker', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-doctest-marker': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/README.md index 083c19901693..401e83637c4e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props' ); ``` #### rule @@ -45,7 +45,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props' ); ```javascript -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +const hasOwnProp = require( '@stdlib/assert/has-own-property' ); /** * Converts the first letter of each object key to uppercase. @@ -84,7 +84,7 @@ function capitalizeKeys( obj ) { **Good**: ```javascript -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +const hasOwnProp = require( '@stdlib/assert/has-own-property' ); /** * Converts the first letter of each object key to uppercase. @@ -131,14 +131,12 @@ function capitalizeKeys( obj ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Copies or deep clones a value to an arbitrary depth.', '*', @@ -176,7 +174,7 @@ code = [ linter.defineRule( 'jsdoc-doctest-quote-props', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-doctest-quote-props': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/README.md index aa44f21c0841..142d8a085595 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest' ); ``` #### rule @@ -95,14 +95,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-doctest' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -123,7 +121,7 @@ code = [ linter.defineRule( 'jsdoc-doctest', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-doctest': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/README.md index 17b76c1ed555..94dba3bfa197 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker' ); ``` #### rule @@ -89,15 +89,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep *boop*.', '*', @@ -117,7 +115,7 @@ code = [ linter.defineRule( 'jsdoc-emphasis-marker', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-emphasis-marker': [ 'error', '_' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/README.md index 3d70b612a8c4..ac095179869c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example' ); ``` #### rule @@ -57,7 +57,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example * var v = ceil( 9.99999 ); * // returns 10.0 */ -var ceil = require( '@stdlib/math/base/special/ceil' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); ``` **Good**: @@ -77,7 +77,7 @@ var ceil = require( '@stdlib/math/base/special/ceil' ); * var v = ceil( 9.99999 ); * // returns 10.0 */ -var ceil = require( '@stdlib/math/base/special/ceil' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); ``` @@ -91,14 +91,12 @@ var ceil = require( '@stdlib/math/base/special/ceil' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Rounds a numeric value toward negative infinity.', '*', @@ -119,7 +117,7 @@ code = [ linter.defineRule( 'jsdoc-empty-line-before-example', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-empty-line-before-example': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/README.md index e4b8a30d8a6e..6ee4ed919262 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag' ); ``` #### rule @@ -97,15 +97,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ````javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -129,7 +127,7 @@ code = [ linter.defineRule( 'jsdoc-fenced-code-flag', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-fenced-code-flag': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/README.md index d02527570eab..a96fb6fac8d0 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker' ); ``` #### rule @@ -97,15 +97,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep *boop*.', '*', @@ -129,7 +127,7 @@ code = [ linter.defineRule( 'jsdoc-fenced-code-marker', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-fenced-code-marker': [ 'error', '`' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/README.md index d43f759796cc..cc2556845944 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-final-definition' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-final-definition' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-final-definition' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-final-definition' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop][boop].', '*', @@ -128,7 +126,7 @@ code = [ linter.defineRule( 'jsdoc-final-definition', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-final-definition': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/README.md index 7de7d3615535..a00aa52d2829 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-first-heading-level' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-first-heading-level' ); ``` #### rule @@ -99,15 +99,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-first-heading-level' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-first-heading-level' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -131,7 +129,7 @@ code = [ linter.defineRule( 'jsdoc-first-heading-level', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-first-heading-level': [ 'error', 2 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/README.md index 5c79853374fd..76339de12335 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces' ); ``` #### rule @@ -93,15 +93,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -124,7 +122,7 @@ code = [ linter.defineRule( 'jsdoc-hard-break-spaces', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-hard-break-spaces': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/README.md index 0052e19d7dbc..8281de6a7b18 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-increment' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-increment' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-increment' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-increment' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-heading-increment', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-heading-increment': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/README.md index e9188ebc3c9d..ec8b244a7831 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-style' ); ``` #### rule @@ -98,15 +98,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-heading-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -136,7 +134,7 @@ code = [ linter.defineRule( 'jsdoc-heading-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-heading-style': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/README.md index 3b5f00243d32..7c66e423ef3e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence' ); ``` #### rule @@ -89,14 +89,12 @@ To allow uncapitalized words at the beginning of a JSDoc description, set the `w ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* squares a number.', '* ', @@ -114,7 +112,7 @@ code = [ linter.defineRule( 'jsdoc-leading-description-sentence', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-leading-description-sentence': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/README.md index 4cb98dbd196c..cb1a0f10de39 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-license-header-year' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-license-header-year' ); ``` #### rule @@ -51,15 +51,14 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-license-header-year' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-license-header-year' ); +const join = require( 'path' ).join; +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-license-header-year' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* @license Apache-2.0', '*', @@ -83,12 +82,12 @@ code = [ linter.defineRule( 'jsdoc-license-header-year', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-license-header-year': 'error' } }, { - 'filename': join( __dirname, '..', '..', 'README.md' ) + 'filename': join( __dirname, '..', '..', 'README.md' ) }); console.log( result ); /* => diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/README.md index cf8a1129c0ba..c2391866cf6b 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-linebreak-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-linebreak-style' ); ``` #### rule @@ -101,15 +101,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-linebreak-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-linebreak-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-linebreak-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-linebreak-style': [ 'error', 'unix' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/README.md index f4bad8b29a1f..671862e0230e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-link-title-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-link-title-style' ); ``` #### rule @@ -97,15 +97,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-link-title-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-link-title-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -130,7 +128,7 @@ code = [ linter.defineRule( 'jsdoc-link-title-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-link-title-style': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/README.md index af179c7007f0..cc5b7d8d86a4 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -122,7 +120,7 @@ code = [ linter.defineRule( 'jsdoc-list-item-bullet-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-list-item-bullet-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/README.md index ec17e98c2920..bd48ad690acf 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent' ); ``` #### rule @@ -97,15 +97,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -130,7 +128,7 @@ code = [ linter.defineRule( 'jsdoc-list-item-content-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-list-item-content-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/README.md index eca86b8fae80..d645328b9bcd 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-indent' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -128,7 +126,7 @@ code = [ linter.defineRule( 'jsdoc-list-item-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-list-item-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/README.md index 618a8ec3f222..c88339ec35ee 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing' ); ``` #### rule @@ -121,15 +121,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -154,7 +152,7 @@ code = [ linter.defineRule( 'jsdoc-list-item-spacing', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-list-item-spacing': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/README.md index 5bca8a94dd87..36cdd7cdf039 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-main-export' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-main-export' ); ``` #### rule @@ -87,14 +87,12 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-main-export' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-main-export' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-main-export' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Tests if a value is an array.', '*', @@ -113,7 +111,7 @@ code = [ linter.defineRule( 'jsdoc-main-export', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-main-export': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/README.md index 43dea465621b..68059b554799 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-markdown-remark' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-markdown-remark' ); ``` #### rule @@ -91,18 +91,15 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var remarkLint = require( 'remark-lint' ); -var noDuplicateHeadings = require( 'remark-lint-no-duplicate-headings' ); -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-markdown-remark' ); +const Linter = require( 'eslint' ).Linter; +const remarkLint = require( 'remark-lint' ); +const noDuplicateHeadings = require( 'remark-lint-no-duplicate-headings' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-markdown-remark' ); -var linter = new Linter(); -var config; -var result; -var code; +const linter = new Linter(); // Generate our source code containing a single lint error (a duplicate heading): -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -150,7 +147,7 @@ code = [ ].join( '\n' ); // Create a remark configuration: -config = { +const config = { 'plugins': [ [ remarkLint ], [ noDuplicateHeadings, [ 'error' ] ] @@ -161,7 +158,7 @@ config = { linter.defineRule( 'jsdoc-markdown-remark', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-markdown-remark': [ 'error', { 'config': config diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/README.md index 7ac966b0e05c..49b2e1bcd955 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ); ``` #### rule @@ -42,7 +42,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ) **Bad**: - + ```javascript /** @@ -50,7 +50,6 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ) * * ## Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula * -* * @returns {string} a value * * @example @@ -64,13 +63,14 @@ function beep() { **Good**: + + ```javascript /** * Beep boop. * * ## Lorem ipsum dolor sit amet, consectetuer adipiscing elit * -* * @returns {string} a value * * @example @@ -95,15 +95,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -131,7 +129,7 @@ code = [ linter.defineRule( 'jsdoc-maximum-heading-length', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-maximum-heading-length': [ 'error', 30 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/README.md index f58eab6261d3..b4e0a0b5d461 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length' ); ``` #### rule @@ -42,7 +42,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length' ); **Bad**: - + ```javascript /** @@ -61,6 +61,8 @@ function beep() { **Good**: + + ```javascript /** * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. @@ -89,15 +91,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Too long when rule is configured with a maximum line width of `10`...', '*', @@ -118,7 +118,7 @@ code = [ linter.defineRule( 'jsdoc-maximum-line-length', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-maximum-line-length': [ 'error', 10 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/README.md index 970002ddf814..60e628b37fd5 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -122,7 +120,7 @@ code = [ linter.defineRule( 'jsdoc-no-auto-link-without-protocol', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-auto-link-without-protocol': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/README.md index c7025181b39c..2003a851cbfc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -128,7 +126,7 @@ code = [ linter.defineRule( 'jsdoc-no-blockquote-without-marker', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-blockquote-without-marker': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/README.md index ca97f8ea2b52..9d6a16319d23 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines' ); ``` #### rule @@ -96,15 +96,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -129,7 +127,7 @@ code = [ linter.defineRule( 'jsdoc-no-consecutive-blank-lines', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-consecutive-blank-lines': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/README.md index a4ce2c9cedfc..14c466034c9d 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions' ); ``` #### rule @@ -92,15 +92,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* [Beep][beep] [boop][beep].', '*', @@ -124,7 +122,7 @@ code = [ linter.defineRule( 'jsdoc-no-duplicate-definitions', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-duplicate-definitions': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/README.md index 61cad0499382..c5829a277d44 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section' ); ``` #### rule @@ -103,15 +103,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -137,7 +135,7 @@ code = [ linter.defineRule( 'jsdoc-no-duplicate-headings-in-section', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-duplicate-headings-in-section': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/README.md index 19d56fd88830..e5edda47c2ad 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings' ); ``` #### rule @@ -103,15 +103,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -140,7 +138,7 @@ code = [ linter.defineRule( 'jsdoc-no-duplicate-headings', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-duplicate-headings': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/README.md index be266d679010..078bdc213682 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags' ); ``` #### rule @@ -89,7 +89,7 @@ function square( x ) { * * @param {number} x - input number * @returns {number} x squared - * +* * @example * var y = square( 2.0 ); * // returns 4.0 @@ -114,14 +114,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '* ', @@ -140,7 +138,7 @@ code = [ linter.defineRule( 'jsdoc-no-duplicate-tags', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-duplicate-tags': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/README.md index 2bb4c9bca5b3..04a7381f87dc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-no-emphasis-as-heading', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-emphasis-as-heading': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/README.md index c7b10260b940..1ddb488ee468 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-empty-url' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-empty-url' ); ``` #### rule @@ -87,15 +87,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-empty-url' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-empty-url' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop]().', '*', @@ -115,7 +113,7 @@ code = [ linter.defineRule( 'jsdoc-no-empty-url', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-empty-url': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/README.md index 5b854c3cdc03..50011adf9cce 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-no-heading-content-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-heading-content-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/README.md index 494e0e5a91a2..e54c487d3be5 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-no-heading-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-heading-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/README.md index 9d030aae9aba..082279e47dff 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -127,7 +125,7 @@ code = [ linter.defineRule( 'jsdoc-no-heading-like-paragraph', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-heading-like-paragraph': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/README.md index 9a6ccbb9e930..c4a46beb8b5b 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation' ); ``` #### rule @@ -97,15 +97,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -134,7 +132,7 @@ code = [ linter.defineRule( 'jsdoc-no-heading-punctuation', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-heading-punctuation': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/README.md index b90ac045063c..2788bfa50018 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-html' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-html' ); ``` #### rule @@ -93,15 +93,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-html' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-html' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -123,7 +121,7 @@ code = [ linter.defineRule( 'jsdoc-no-html', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-html': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/README.md index 11dc8712e89d..013850ad0556 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding' ); ``` #### rule @@ -87,15 +87,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep: _ boop _.', '*', @@ -115,7 +113,7 @@ code = [ linter.defineRule( 'jsdoc-no-inline-padding', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-inline-padding': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/README.md index 19acd2a415bd..c3a202e76eb5 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -127,7 +125,7 @@ code = [ linter.defineRule( 'jsdoc-no-literal-urls', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-literal-urls': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/README.md index 115803527f34..5005418616a4 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines' ); ``` #### rule @@ -113,15 +113,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -144,7 +142,7 @@ code = [ linter.defineRule( 'jsdoc-no-missing-blank-lines', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-missing-blank-lines': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/README.md index 8f7a427d47e5..224171e22692 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines' ); ``` #### rule @@ -89,15 +89,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -123,7 +121,7 @@ code = [ linter.defineRule( 'jsdoc-no-multiple-blank-lines', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-multiple-blank-lines': [ 'error', 2 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/README.md index 0738a67d30ef..34aa934c6897 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings' ); ``` #### rule @@ -107,15 +107,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -139,7 +137,7 @@ code = [ linter.defineRule( 'jsdoc-no-multiple-toplevel-headings', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-multiple-toplevel-headings': [ 'error', 2 ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/README.md index e8be21fe68c7..4360ed8946cb 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -132,7 +130,7 @@ code = [ linter.defineRule( 'jsdoc-no-paragraph-content-indent', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-paragraph-content-indent': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/README.md index 43c974e4481d..d4c8a6c1e13f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop](beep).', '*', @@ -121,7 +119,7 @@ code = [ linter.defineRule( 'jsdoc-no-reference-like-url', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-reference-like-url': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/README.md index 62836848ac4d..446ef994485a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars' ); ``` #### rule @@ -97,15 +97,13 @@ function beep() { ````javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -130,7 +128,7 @@ code = [ linter.defineRule( 'jsdoc-no-shell-dollars', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-shell-dollars': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/README.md index 7b605502995e..92f44ecfa7b0 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep ![boop].', '*', @@ -121,7 +119,7 @@ code = [ linter.defineRule( 'jsdoc-no-shortcut-reference-image', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-shortcut-reference-image': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/README.md index 49b76381a67c..8d97fecfc43e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop].', '*', @@ -121,7 +119,7 @@ code = [ linter.defineRule( 'jsdoc-no-shortcut-reference-link', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-shortcut-reference-link': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/README.md index c3fc38e8ebb7..3aab5d6da882 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks' ); ``` #### rule @@ -87,15 +87,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', ' * Beep boop.', ' *', @@ -115,7 +113,7 @@ code = [ linter.defineRule( 'jsdoc-no-space-aligned-asterisks', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-space-aligned-asterisks': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/README.md index c5433e2f5d08..30be31d0467a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation' ); ``` #### rule @@ -93,15 +93,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -125,7 +123,7 @@ code = [ linter.defineRule( 'jsdoc-no-table-indentation', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-table-indentation': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/README.md index 7c89fdb131b2..65efe911970e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-tabs' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-tabs' ); ``` #### rule @@ -95,15 +95,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-tabs' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-tabs' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -126,7 +124,7 @@ code = [ linter.defineRule( 'jsdoc-no-tabs', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-tabs': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/README.md index 525b3929b162..1a7c29514976 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references' ); ``` #### rule @@ -89,15 +89,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep [boop][boop].', '*', @@ -117,7 +115,7 @@ code = [ linter.defineRule( 'jsdoc-no-undefined-references', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-undefined-references': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/README.md index d8ebcf7c3e55..23863b132b35 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions' ); ``` #### rule @@ -91,15 +91,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -121,7 +119,7 @@ code = [ linter.defineRule( 'jsdoc-no-unused-definitions', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-no-unused-definitions': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/README.md index 4615ba9e041b..6ed6a6ce4528 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style' ); ``` #### rule @@ -97,15 +97,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -136,7 +134,7 @@ code = [ linter.defineRule( 'jsdoc-ordered-list-marker-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-ordered-list-marker-style': [ 'error', '.' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/README.md index e6e712d6ba13..30c2c9f0b0ad 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value' ); ``` #### rule @@ -99,15 +99,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep *boop*.', '*', @@ -130,7 +128,7 @@ code = [ linter.defineRule( 'jsdoc-ordered-list-marker-value', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-ordered-list-marker-value': [ 'error', 'ordered' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/README.md index 99a067667814..cc67bb41aa58 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-private-annotation' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-private-annotation' ); ``` #### rule @@ -122,13 +122,12 @@ module.exports = wrap; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-private-annotation' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-private-annotation' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = [ +const code = [ '/**', '* Comparator function for sorting characters in ascending order.', '*', @@ -153,7 +152,7 @@ var code = [ linter.defineRule( 'jsdoc-private-annotation', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-private-annotation': [ 'error' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/README.md index 118bcb7062a9..46579d6e2c1e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags' ); ``` #### rule @@ -142,13 +142,12 @@ function incrspace( x1, x2 ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = [ +const code = [ ' /**', ' * Attempts to parse a string as JSON.', ' *', @@ -179,7 +178,7 @@ var code = [ linter.defineRule( 'jsdoc-require-throws-tags', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-require-throws-tags': [ 'error' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/README.md index 08dfe99dea2e..60ca87570c94 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-rule-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-rule-style' ); ``` #### rule @@ -56,7 +56,6 @@ var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-rule-style' ); * * Asterisks * -* * @returns {string} a value * * @example @@ -84,7 +83,6 @@ function beep() { * * Asterisks * -* * @returns {string} a value * * @example @@ -109,15 +107,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-rule-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-rule-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep boop.', '*', @@ -141,7 +137,7 @@ code = [ linter.defineRule( 'jsdoc-rule-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-rule-style': [ 'error', '***' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/README.md index 5f03a5be0d27..05bf053b19b3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-strong-marker' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-strong-marker' ); ``` #### rule @@ -89,15 +89,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-strong-marker' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-strong-marker' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep __boop__.', '*', @@ -117,7 +115,7 @@ code = [ linter.defineRule( 'jsdoc-strong-marker', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-strong-marker': [ 'error', '*' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/README.md index 173b4f42ac63..0eccfa988480 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding' ); ``` #### rule @@ -99,15 +99,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -131,7 +129,7 @@ code = [ linter.defineRule( 'jsdoc-table-cell-padding', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-table-cell-padding': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/README.md index 2844383272cd..8b4ab6b8e4f9 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment' ); ``` #### rule @@ -93,15 +93,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -125,7 +123,7 @@ code = [ linter.defineRule( 'jsdoc-table-pipe-alignment', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-table-pipe-alignment': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/README.md index a4e5ad6ca8da..949aa85504eb 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipes' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipes' ); ``` #### rule @@ -93,15 +93,13 @@ function beep() { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipes' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-table-pipes' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Squares a number.', '*', @@ -125,7 +123,7 @@ code = [ linter.defineRule( 'jsdoc-table-pipes', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-table-pipes': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/README.md index 8153ef43e37d..88475109cd6a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-names' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-names' ); ``` #### rule @@ -110,14 +110,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-names' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-names' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '* ', @@ -135,7 +133,7 @@ code = [ linter.defineRule( 'jsdoc-tag-names', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-tag-names': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/README.md index 33ae8e85e165..386fb5a6099c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-order' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-order' ); ``` #### rule @@ -116,14 +116,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-order' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-order' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '* ', @@ -141,7 +139,7 @@ code = [ linter.defineRule( 'jsdoc-tag-order', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-tag-order': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/README.md index 9e7afe61b4e4..f4be66af67ec 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-spacing' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-spacing' ); ``` #### rule @@ -91,14 +91,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-spacing' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-tag-spacing' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '* ', @@ -116,7 +114,7 @@ code = [ linter.defineRule( 'jsdoc-tag-spacing', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-tag-spacing': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/README.md index a6b229783d36..480b3b11b182 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-typedef-typos' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-typedef-typos' ); ``` #### rule @@ -89,14 +89,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-typedef-typos' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-typedef-typos' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/**', '* Squares a number.', '* ', @@ -114,7 +112,7 @@ code = [ linter.defineRule( 'jsdoc-typedef-typos', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-typedef-typos': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/README.md index d63b717b2dd3..0efa97e733e2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' ); +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' ); ``` #### rule @@ -95,15 +95,13 @@ The [rule][eslint-rules] may be configured using the same options as supported b ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); // Generate our source code: -code = [ +const code = [ '/**', '* Beep *boop*.', '*', @@ -126,7 +124,7 @@ code = [ linter.defineRule( 'jsdoc-unordered-list-marker-style', rule ); // Lint the code: -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'jsdoc-unordered-list-marker-style': [ 'error', '-' ] } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/module-exports-last/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/module-exports-last/README.md index 343675f791ef..ef61d8d6e076 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/module-exports-last/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/module-exports-last/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/module-exports-last' ); +const rule = require( '@stdlib/_tools/eslint/rules/module-exports-last' ); ``` #### rule @@ -42,25 +42,27 @@ var rule = require( '@stdlib/_tools/eslint/rules/module-exports-last' ); **Bad**: - + ```javascript -var gammaln = require( '@stdlib/math/base/special/gammaln' ); +const gammaln = require( '@stdlib/math/base/special/gammaln' ); module.exports = exports = { 'gammaln': gammaln }; -var beta = require( '@stdlib/math/base/special/beta' ); +const beta = require( '@stdlib/math/base/special/beta' ); exports.beta = beta; ``` **Good**: + + ```javascript -var gammaln = require( '@stdlib/math/base/special/gammaln' ); -var betainc = require( '@stdlib/math/base/special/betainc' ); +const gammaln = require( '@stdlib/math/base/special/gammaln' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); exports.gammaln = gammaln; exports.betainc = betainc; @@ -77,14 +79,12 @@ exports.betainc = betainc; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/module-exports-last' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/module-exports-last' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'var betainc = require( \'./betainc.js\' );', '', 'module.exports = betainc;', @@ -96,7 +96,7 @@ code = [ linter.defineRule( 'module-exports-last', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'module-exports-last': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/README.md index 3c71c94624dc..eda1f6d96120 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/namespace-export-all' ); +const rule = require( '@stdlib/_tools/eslint/rules/namespace-export-all' ); ``` #### rule @@ -53,12 +53,12 @@ Assuming a `@stdlib/constants/array` folder with `max-array-length` and `max-typ // MODULES // -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); // MAIN // -var ns = {}; +const ns = {}; /** * @name MAX_ARRAY_LENGTH @@ -80,12 +80,12 @@ setReadOnly( ns, 'MAX_ARRAY_LENGTH', require( '@stdlib/constants/array/max-array // MODULES // -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); // MAIN // -var ns = {}; +const ns = {}; /** * @name MAX_ARRAY_LENGTH @@ -119,16 +119,13 @@ setReadOnly( ns, 'MAX_TYPED_ARRAY_LENGTH', require( '@stdlib/constants/array/max ```javascript -var join = require( 'path' ).join; -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/namespace-export-all' ); +const join = require( 'path' ).join; +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/namespace-export-all' ); -var linter = new Linter(); -var result; -var config; -var code; +const linter = new Linter(); -code = [ +const code = [ '/*', '* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.', '*/', @@ -159,12 +156,12 @@ code = [ linter.defineRule( 'namespace-export-all', rule ); -config = { +const config = { 'rules': { 'namespace-export-all': 'error' } }; -result = linter.verify( code, config, { +const result = linter.verify( code, config, { 'filename': join( __dirname, 'fixtures', 'lib', 'index.js' ) }); console.log( result ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/README.md index cf1dacc2b390..bf4bc6908875 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/namespace-index-order' ); +const rule = require( '@stdlib/_tools/eslint/rules/namespace-index-order' ); ``` #### rule @@ -53,12 +53,12 @@ var rule = require( '@stdlib/_tools/eslint/rules/namespace-index-order' ); // MODULES // -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); // MAIN // -var ns = {}; +const ns = {}; /** * @name MAX_TYPED_ARRAY_LENGTH @@ -90,12 +90,12 @@ setReadOnly( ns, 'MAX_ARRAY_LENGTH', require( '@stdlib/constants/array/max-array // MODULES // -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); // MAIN // -var ns = {}; +const ns = {}; /** * @name MAX_ARRAY_LENGTH @@ -129,14 +129,12 @@ setReadOnly( ns, 'MAX_TYPED_ARRAY_LENGTH', require( '@stdlib/constants/array/max ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/namespace-index-order' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/namespace-index-order' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/*', '* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.', '*/', @@ -176,7 +174,7 @@ code = [ linter.defineRule( 'namespace-index-order', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'namespace-index-order': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-array/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-array/README.md index 8562903e4423..bac234875332 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-array/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-array/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-array' ); +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-array' ); ``` #### rule @@ -45,13 +45,13 @@ var rule = require( '@stdlib/_tools/eslint/rules/new-cap-array' ); ```javascript -var arr = Array( 101 ); +const arr = Array( 101 ); ``` **Good**: ```javascript -var arr = new Array( 101 ); +const arr = new Array( 101 ); ``` @@ -65,17 +65,16 @@ var arr = new Array( 101 ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-array' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-array' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var arr = Array( 10 );'; +const code = 'var arr = Array( 10 );'; linter.defineRule( 'new-cap-array', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'new-cap-array': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-error/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-error/README.md index 6c24636612b8..77adba0964ea 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-error/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-error/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-error' ); +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-error' ); ``` #### rule @@ -45,13 +45,13 @@ var rule = require( '@stdlib/_tools/eslint/rules/new-cap-error' ); ```javascript -var err = Error( 'error message' ); +const err = Error( 'error message' ); ``` **Good**: ```javascript -var err = new Error( 'error message' ); +const err = new Error( 'error message' ); ``` @@ -65,17 +65,16 @@ var err = new Error( 'error message' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-error' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-error' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var err = Error( \'invoked without new\' );'; +const code = 'var err = Error( \'invoked without new\' );'; linter.defineRule( 'new-cap-error', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'new-cap-error': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-regexp/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-regexp/README.md index b4268c3b3891..2ab290bb8d3c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-regexp/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-regexp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-regexp' ); +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-regexp' ); ``` #### rule @@ -42,16 +42,18 @@ var rule = require( '@stdlib/_tools/eslint/rules/new-cap-regexp' ); **Bad**: - + ```javascript -var re = RegExp( '[0-9]' ); +const re = RegExp( '[0-9]' ); ``` **Good**: + + ```javascript -var re = new RegExp( '[0-9]' ); +const re = new RegExp( '[0-9]' ); ``` @@ -65,17 +67,16 @@ var re = new RegExp( '[0-9]' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/new-cap-regexp' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/new-cap-regexp' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var re = RegExp( \'ab+c\', \'i\' );'; +const code = 'var re = RegExp( \'ab+c\', \'i\' );'; linter.defineRule( 'new-cap-regexp', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'new-cap-regexp': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/README.md index e0aa92681458..2d7683c396bf 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-builtin-math' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-builtin-math' ); ``` #### rule @@ -45,15 +45,15 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-builtin-math' ); ```javascript -var out = Math.exp( 2.0 ); +const out = Math.exp( 2.0 ); // returns ~7.389 ``` **Good**: ```javascript -var exp = require( '@stdlib/math/base/special/exp' ); -var out = exp( 2.0 ); +const exp = require( '@stdlib/math/base/special/exp' ); +const out = exp( 2.0 ); // returns ~7.389 ``` @@ -68,18 +68,16 @@ var out = exp( 2.0 ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-builtin-math' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-builtin-math' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = 'var y = Math.sqrt( 9.0 );'; +const code = 'var y = Math.sqrt( 9.0 );'; linter.defineRule( 'no-builtin-math', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-builtin-math': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-exports/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-exports/README.md index 0fe9ac69c3d3..3cf699d0f683 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-exports/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-exports/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-exports' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-exports' ); ``` #### rule @@ -45,8 +45,8 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-exports' ); ```javascript -var normal = require( '@stdlib/random/base/normal' ); -var beta = require( '@stdlib/random/base/beta' ); +const normal = require( '@stdlib/random/base/normal' ); +const beta = require( '@stdlib/random/base/beta' ); // EXPORTS // @@ -60,13 +60,13 @@ module.exports = { **Good**: ```javascript -var normal = require( '@stdlib/random/base/normal' ); -var beta = require( '@stdlib/random/base/beta' ); +const normal = require( '@stdlib/random/base/normal' ); +const beta = require( '@stdlib/random/base/beta' ); // VARIABLES // -var ns = { +const ns = { 'normal': normal, 'beta': beta }; @@ -88,14 +88,12 @@ module.exports = ns; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-exports' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-exports' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'function fun() {', ' return 3.14;', '}', @@ -104,7 +102,7 @@ code = [ linter.defineRule( 'no-dynamic-exports', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-dynamic-exports': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-require/README.md index 46d86c16d0a8..f951a3c1811d 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-dynamic-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-require' ); ``` #### rule @@ -45,14 +45,14 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-require' ); ```javascript -var pkg = '@stdlib/math/base/special/betainc'; -var betainc = require( pkg ); +const pkg = '@stdlib/math/base/special/betainc'; +const betainc = require( pkg ); ``` **Good**: ```javascript -var betainc = require( '@stdlib/math/base/special/betainc' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); ``` @@ -66,21 +66,19 @@ var betainc = require( '@stdlib/math/base/special/betainc' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-require' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-dynamic-require' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'var pkg = \'@stdlib/math/base/special/betainc\';', 'var betainc = require( pkg );' ].join( '\n' ); linter.defineRule( 'no-dynamic-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-dynamic-require': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/README.md index f35be1d3a153..add13b4b5a8a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-empty-comments' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-empty-comments' ); ``` #### rule @@ -87,14 +87,12 @@ function square( x ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-empty-comments' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-empty-comments' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ 'function pow2( x ) {', ' var out;', '', @@ -106,7 +104,7 @@ code = [ linter.defineRule( 'no-empty-comments', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-empty-comments': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-immediate-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-immediate-require/README.md index 74c5f7687430..b1f463ea3d5c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-immediate-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-immediate-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-immediate-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-immediate-require' ); ``` #### rule @@ -45,15 +45,15 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-immediate-require' ); ```javascript -var debug = require( 'debug' )( 'stdlib' ); +const debug = require( 'debug' )( 'stdlib' ); ``` **Good**: ```javascript -var logger = require( 'debug' ); +const logger = require( 'debug' ); -var debug = logger( 'stdlib' ); +const debug = logger( 'stdlib' ); ``` @@ -67,18 +67,16 @@ var debug = logger( 'stdlib' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-immediate-require' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-immediate-require' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = 'var pdf = require( \'@stdlib/stats/base/dists/normal/pdf\' ).factory( 0.0, 1.0 );'; +const code = 'var pdf = require( \'@stdlib/stats/base/dists/normal/pdf\' ).factory( 0.0, 1.0 );'; linter.defineRule( 'no-immediate-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-immediate-require': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-internal-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-internal-require/README.md index 9cc4b61ef0e0..0c0092306419 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-internal-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-internal-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-internal-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-internal-require' ); ``` #### rule @@ -45,13 +45,13 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-internal-require' ); ```javascript -var betainc = require( '@stdlib/math/base/special/betainc/lib/betainc.js' ); +const betainc = require( '@stdlib/math/base/special/betainc/lib/betainc.js' ); ``` **Good**: ```javascript -var betainc = require( '@stdlib/math/base/special/betainc' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); ``` @@ -65,17 +65,16 @@ var betainc = require( '@stdlib/math/base/special/betainc' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-internal-require' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-internal-require' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var betainc = require( \'@stdlib/math/base/special/betainc/lib/betainc.js\' )'; +const code = 'var betainc = require( \'@stdlib/math/base/special/betainc/lib/betainc.js\' )'; linter.defineRule( 'no-internal-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-internal-require': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/README.md index ddb8f2413c3c..0162f627d2f5 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-multiple-empty-lines' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-multiple-empty-lines' ); ``` #### rule @@ -56,8 +56,6 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-multiple-empty-lines' ); function maxabs( x, y ) { var nargs; var args; - var i; - nargs = arguments.length; if ( nargs === 0 ) { @@ -67,7 +65,7 @@ function maxabs( x, y ) { return max( abs( x ), abs( y ) ); } args = new Array( nargs ); - for ( i = 0; i < nargs; i++ ) { + for ( let i = 0; i < nargs; i++ ) { args[ i ] = abs( arguments[ i ] ); } @@ -90,7 +88,6 @@ function maxabs( x, y ) { function maxabs( x, y ) { var nargs; var args; - var i; nargs = arguments.length; if ( nargs === 0 ) { @@ -100,7 +97,7 @@ function maxabs( x, y ) { return max( abs( x ), abs( y ) ); } args = new Array( nargs ); - for ( i = 0; i < nargs; i++ ) { + for ( let i = 0; i < nargs; i++ ) { args[ i ] = abs( arguments[ i ] ); } return max.apply( null, args ); @@ -118,21 +115,19 @@ function maxabs( x, y ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-multiple-empty-lines' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-multiple-empty-lines' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -var opts = { +const opts = { 'rules': { 'no-multiple-empty-lines': 'error' } }; linter.defineRule( 'no-multiple-empty-lines', rule ); -code = [ +const code = [ '\'use strict\';', '', '// MODULES //', @@ -165,7 +160,7 @@ code = [ 'module.exports = numCPUs();' ].join( '\n' ); -result = linter.verify( code, opts ); +const result = linter.verify( code, opts ); console.log( result ); /* => [ diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/README.md index b9701ff6ccab..23269cae06ff 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-nested-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-nested-require' ); ``` #### rule @@ -45,13 +45,13 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-nested-require' ); ```javascript -var special = require( '@stdlib' ).math.base.special; +const special = require( '@stdlib' ).math.base.special; ``` **Good**: ```javascript -var special = require( '@stdlib/math/base' ).special; +let special = require( '@stdlib/math/base' ).special; special = require( '@stdlib/math/base/special' ); ``` @@ -67,23 +67,21 @@ special = require( '@stdlib/math/base/special' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-nested-require' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-nested-require' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = 'var special = require( \'@stdlib/math\' ).base.special;'; +const code = 'var special = require( \'@stdlib/math\' ).base.special;'; linter.defineRule( 'no-nested-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-nested-require': 'error' } }); -/* => +/* returns [ { 'ruleId': 'no-nested-require', diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/README.md index 1512fcc5936b..ce0b1c6ec94e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-redeclare' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-redeclare' ); ``` #### rule @@ -73,17 +73,16 @@ a = 'boop'; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-redeclare' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-redeclare' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var Object = 0'; +const code = 'var Object = 0'; linter.defineRule( 'no-redeclare', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-redeclare': [ 'error', { 'builtinGlobals': true diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-absolute-path/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-absolute-path/README.md index f46311634ac9..d874d0bcde75 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-absolute-path/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-absolute-path/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-require-absolute-path' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-require-absolute-path' ); ``` #### rule @@ -44,16 +44,16 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-require-absolute-path' ); - + ```javascript -var stdlib = require( '/path/to/stdlib' ); +const stdlib = require( '/path/to/stdlib' ); ``` **Good**: ```javascript -var stdlib = require( '@stdlib' ); +const stdlib = require( '@stdlib' ); ``` @@ -67,17 +67,16 @@ var stdlib = require( '@stdlib' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-require-absolute-path' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-require-absolute-path' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var stdlib = require( \'/path/to/stdlib/\' );'; +const code = 'var stdlib = require( \'/path/to/stdlib/\' );'; linter.defineRule( 'no-require-absolute-path', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-require-absolute-path': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-index/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-index/README.md index 08f95383b47b..b4e38e777d8e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-index/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-require-index/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-require-index' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-require-index' ); ``` #### rule @@ -44,16 +44,16 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-require-index' ); - + ```javascript -var debug = require( 'debug/index.js' ); +const debug = require( 'debug/index.js' ); ``` **Good**: ```javascript -var debug = require( 'debug' ); +const debug = require( 'debug' ); ``` @@ -67,17 +67,16 @@ var debug = require( 'debug' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-require-index' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-require-index' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var browserify = require( \'browserify/index.js\' );'; +const code = 'var browserify = require( \'browserify/index.js\' );'; linter.defineRule( 'no-require-index', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-require-index': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-self-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-self-require/README.md index a94cde47ae8b..fa325c3b2601 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-self-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-self-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-self-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-self-require' ); ``` #### rule @@ -47,15 +47,17 @@ var rule = require( '@stdlib/_tools/eslint/rules/no-self-require' ); ```javascript -var myself = require( __filename ); +const myself = require( __filename ); ``` **Good**: + + ```javascript -var other = require( './other.js' ); +const other = require( './other.js' ); ``` @@ -66,22 +68,22 @@ var other = require( './other.js' ); ## Examples + + ```javascript -var resolve = require( 'path' ).resolve; -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-self-require' ); +const resolve = require( 'path' ).resolve; +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-self-require' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = 'var myself = require( \'./index.js\' );'; +const code = 'var myself = require( \'./index.js\' );'; linter.defineRule( 'no-self-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-self-require': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-unassigned-require/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-unassigned-require/README.md index 1367d7f0c755..7fc09d407b3a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-unassigned-require/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-unassigned-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/no-unassigned-require' ); +const rule = require( '@stdlib/_tools/eslint/rules/no-unassigned-require' ); ``` #### rule @@ -51,7 +51,7 @@ require( 'tape' ); **Good**: ```javascript -var tape = require( 'tape' ); +const tape = require( 'tape' ); ``` @@ -65,17 +65,16 @@ var tape = require( 'tape' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/no-unassigned-require' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/no-unassigned-require' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'require( \'@stdlib/math\' );'; +const code = 'require( \'@stdlib/math\' );'; linter.defineRule( 'no-unassigned-require', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'no-unassigned-require': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/README.md index c6bc1a2448a0..34ab84e3a598 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/repl-namespace-order' ); +const rule = require( '@stdlib/_tools/eslint/rules/repl-namespace-order' ); ``` #### rule @@ -43,7 +43,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/repl-namespace-order' ); **Bad**: ```javascript -var ns = []; +const ns = []; ns.push({ 'alias': 'pop', @@ -72,7 +72,7 @@ ns.push({ **Good**: ```javascript -var ns = []; +const ns = []; ns.push({ 'alias': 'pluck', @@ -109,14 +109,12 @@ ns.push({ ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/repl-namespace-order' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/repl-namespace-order' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -code = [ +const code = [ '/* eslint-enable stdlib/repl-namespace-order */', '', '/* When adding names to the namespace, ensure that they are added in alphabetical order according to alias (namespace key). */', @@ -148,7 +146,7 @@ code = [ linter.defineRule( 'repl-namespace-order', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'repl-namespace-order': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-file-extensions/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/require-file-extensions/README.md index 8d59aea3f7ab..b64da73b2156 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-file-extensions/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-file-extensions/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/require-file-extensions' ); +const rule = require( '@stdlib/_tools/eslint/rules/require-file-extensions' ); ``` #### rule @@ -48,18 +48,18 @@ var rule = require( '@stdlib/_tools/eslint/rules/require-file-extensions' ); ```javascript // Missing file extension: -var debug = require( 'debug/src/browser' ); +const debug = require( 'debug/src/browser' ); // Invalid file extension: -var readme = require( '@stdlib/array/int32/README.md' ); +const readme = require( '@stdlib/array/int32/README.md' ); ``` **Good**: ```javascript -var debug = require( 'debug/src/browser.js' ); +const debug = require( 'debug/src/browser.js' ); -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); ``` @@ -73,14 +73,12 @@ var Int32Array = require( '@stdlib/array/int32' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/require-file-extensions' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/require-file-extensions' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -var opts = { +const opts = { 'rules': { 'require-file-extensions': 'error' } @@ -88,8 +86,8 @@ var opts = { linter.defineRule( 'require-file-extensions', rule ); -code = 'var readme = require( \'debug/README.md\' )'; -result = linter.verify( code, opts ); +let code = 'var readme = require( \'debug/README.md\' )'; +let result = linter.verify( code, opts ); /* returns [ { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/README.md index 865389d6dc91..3580c8fa73bc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/require-globals' ); +const rule = require( '@stdlib/_tools/eslint/rules/require-globals' ); ``` #### rule @@ -52,7 +52,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/require-globals' ); ] }] */ -var arr = new Float32Array(); +const arr = new Float32Array(); ``` **Good**: @@ -67,9 +67,9 @@ var arr = new Float32Array(); ] }] */ -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr = new Float32Array(); +let arr = new Float32Array(); arr = new Int32Array(); ``` @@ -85,17 +85,16 @@ arr = new Int32Array(); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/require-globals' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/require-globals' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var arr = new Int32Array( [1,2,3] );'; +const code = 'var arr = new Int32Array( [1,2,3] );'; linter.defineRule( 'require-globals', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'require-globals': [ 'error', { 'globals': [ diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/README.md index 63955ccba3a4..e28e3cadaaf1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/require-leading-slash' ); +const rule = require( '@stdlib/_tools/eslint/rules/require-leading-slash' ); ``` #### rule @@ -44,16 +44,18 @@ var rule = require( '@stdlib/_tools/eslint/rules/require-leading-slash' ); - + ```javascript -var stdlib = require( '../lib/index.js' ); +const stdlib = require( '../lib/index.js' ); ``` **Good**: + + ```javascript -var stdlib = require( './../lib/index.js' ); +const stdlib = require( './../lib/index.js' ); ``` @@ -67,17 +69,16 @@ var stdlib = require( './../lib/index.js' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/require-leading-slash' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/require-leading-slash' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var stdlib = require( \'../lib/index.js\' );'; +const code = 'var stdlib = require( \'../lib/index.js\' );'; linter.defineRule( 'require-leading-slash', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'require-leading-slash': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/README.md index 8a7405db4745..0b3dcdd58373 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/require-order' ); +const rule = require( '@stdlib/_tools/eslint/rules/require-order' ); ``` #### rule @@ -48,26 +48,28 @@ var rule = require( '@stdlib/_tools/eslint/rules/require-order' ); - + ```javascript // 'order': [ 'builtin', 'external', '/^@stdlib/', 'path' ] -var validate = require( './validate.js' ); -var math = require( '@stdlib/math' ); -var debug = require( 'debug' ); -var fs = require( 'fs' ); +const validate = require( './validate.js' ); +const math = require( '@stdlib/math' ); +const debug = require( 'debug' ); +const fs = require( 'fs' ); ``` **Good**: + + ```javascript // 'order': [ 'builtin', 'external', '/^@stdlib/', 'path' ] -var fs = require( 'fs' ); -var debug = require( 'debug' ); -var math = require( '@stdlib/math' ); -var validate = require( './validate.js' ); +const fs = require( 'fs' ); +const debug = require( 'debug' ); +const math = require( '@stdlib/math' ); +const validate = require( './validate.js' ); ``` To enforce a custom ordering, set the `order` option. In addition to `builtin`, `external`, and `path`, the `order` option supports regular expression strings such as `'/^@stdlib/'`. @@ -83,20 +85,19 @@ To enforce a custom ordering, set the `order` option. In addition to `builtin`, ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/require-order' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/require-order' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = [ +const code = [ 'var validate = require( \'./validate.js\' )', 'var fs = require( \'fs\' )' ].join( '\n' ); linter.defineRule( 'require-order', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'require-order': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/README.md index 3f064dfa695f..a403f48c3991 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/require-spaces' ); +const rule = require( '@stdlib/_tools/eslint/rules/require-spaces' ); ``` #### rule @@ -43,7 +43,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/require-spaces' ); **Good**: ```javascript -var betainc = require( '@stdlib/math/base/special/betainc' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); ``` **Bad**: @@ -51,9 +51,9 @@ var betainc = require( '@stdlib/math/base/special/betainc' ); ```javascript -var betainc = require('@stdlib/math/base/special/betainc'); -var zip = require( '@stdlib/utils/zip'); -var noop = require('@stdlib/utils/noop' ); +const betainc = require('@stdlib/math/base/special/betainc'); +const zip = require( '@stdlib/utils/zip'); +const noop = require('@stdlib/utils/noop' ); ``` @@ -67,16 +67,16 @@ var noop = require('@stdlib/utils/noop' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/require-spaces' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/require-spaces' ); -var linter = new Linter(); +const linter = new Linter(); -var code = 'var betainc = require(\'@stdlib/math/base/special/betainc\');'; +const code = 'var betainc = require(\'@stdlib/math/base/special/betainc\');'; linter.defineRule( 'require-spaces', rule ); -var result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'require-spaces': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/README.md index 5cc314d80677..cc0d44eb5ec1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/section-header-empty-lines' ); +const rule = require( '@stdlib/_tools/eslint/rules/section-header-empty-lines' ); ``` #### rule @@ -52,7 +52,7 @@ function add( x, y ) { } // VARIABLES // -var TWO_PI = 2.0 * 3.141592653589793; +const TWO_PI = 2.0 * 3.141592653589793; // EXPORTS // @@ -72,7 +72,7 @@ function add( x, y ) { // VARIABLES // -var TWO_PI = 2.0 * 3.141592653589793; +const TWO_PI = 2.0 * 3.141592653589793; // EXPORTS // @@ -91,21 +91,19 @@ module.exports = TWO_PI; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/section-header-empty-lines' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/section-header-empty-lines' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -var opts = { +const opts = { 'rules': { 'section-header-empty-lines': 'error' } }; linter.defineRule( 'section-header-empty-lines', rule ); -code = [ +const code = [ '\'use strict\';', '', '// MODULES //', @@ -133,7 +131,7 @@ code = [ 'module.exports = numCPUs();' ].join( '\n' ); -result = linter.verify( code, opts ); +const result = linter.verify( code, opts ); console.log( result ); /* => [ diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/README.md index b02648e22d16..51a684124a94 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/section-headers' ); +const rule = require( '@stdlib/_tools/eslint/rules/section-headers' ); ``` #### rule @@ -63,7 +63,7 @@ function add( x, y ) { // CONSTANTS // -var TWO_PI = 2.0 * 3.141592653589793; +const TWO_PI = 2.0 * 3.141592653589793; // EXPORTS @@ -76,7 +76,7 @@ module.exports = TWO_PI; ```javascript // VARIABLES // -var TWO_PI = 2.0 * 3.141592653589793; +const TWO_PI = 2.0 * 3.141592653589793; // EXPORTS // @@ -95,22 +95,20 @@ module.exports = TWO_PI; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/section-headers' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/section-headers' ); -var linter = new Linter(); -var result; -var code; +const linter = new Linter(); -var opts = { +const opts = { 'rules': { 'section-headers': 'error' } }; linter.defineRule( 'section-headers', rule ); -code = '// EXPORTS '; -result = linter.verify( code, opts ); +let code = '// EXPORTS '; +let result = linter.verify( code, opts ); console.log( result ); /* => [ diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/README.md index 6640ef2433ed..f050cbdf75ec 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/ternary-condition-parentheses' ); +const rule = require( '@stdlib/_tools/eslint/rules/ternary-condition-parentheses' ); ``` #### rule @@ -45,17 +45,17 @@ var rule = require( '@stdlib/_tools/eslint/rules/ternary-condition-parentheses' ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); -var bool = randu() > 0.5 ? 1 : 0; +const bool = randu() > 0.5 ? 1 : 0; ``` **Good**: ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); -var bool = ( randu() > 0.5 ) ? 1 : 0; +const bool = ( randu() > 0.5 ) ? 1 : 0; ``` @@ -69,17 +69,16 @@ var bool = ( randu() > 0.5 ) ? 1 : 0; ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/ternary-condition-parentheses' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/ternary-condition-parentheses' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var bool = randu() > 0.5 ? 1 : 0;'; +const code = 'var bool = randu() > 0.5 ? 1 : 0;'; linter.defineRule( 'ternary-condition-parentheses', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'ternary-condition-parentheses': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/README.md index 6e61aa555212..0bbe7ac8f846 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/uppercase-required-constants' ); +const rule = require( '@stdlib/_tools/eslint/rules/uppercase-required-constants' ); ``` #### rule @@ -45,13 +45,13 @@ var rule = require( '@stdlib/_tools/eslint/rules/uppercase-required-constants' ) ```javascript -var float64SqrtEpsilon = require( '@stdlib/constants/float64/sqrt-eps' ); +const float64SqrtEpsilon = require( '@stdlib/constants/float64/sqrt-eps' ); ``` **Good**: ```javascript -var FLOAT64_SQRT_EPSILON = require( '@stdlib/constants/float64/sqrt-eps' ); +const FLOAT64_SQRT_EPSILON = require( '@stdlib/constants/float64/sqrt-eps' ); ``` @@ -65,17 +65,16 @@ var FLOAT64_SQRT_EPSILON = require( '@stdlib/constants/float64/sqrt-eps' ); ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/uppercase-required-constants' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/uppercase-required-constants' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = 'var pi = require( \'@stdlib/constants/float64/pi\' );'; +const code = 'var pi = require( \'@stdlib/constants/float64/pi\' );'; linter.defineRule( 'uppercase-required-constants', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'uppercase-required-constants': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/README.md index 9597337c3e9b..cfcffe1bf483 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var rule = require( '@stdlib/_tools/eslint/rules/vars-order' ); +const rule = require( '@stdlib/_tools/eslint/rules/vars-order' ); ``` #### rule @@ -109,13 +109,12 @@ function triangular( rand, a, b, c ) { ```javascript -var Linter = require( 'eslint' ).Linter; -var rule = require( '@stdlib/_tools/eslint/rules/vars-order' ); +const Linter = require( 'eslint' ).Linter; +const rule = require( '@stdlib/_tools/eslint/rules/vars-order' ); -var linter = new Linter(); -var result; +const linter = new Linter(); -var code = [ +const code = [ 'function fizzBuzz() {', ' var i;', ' var out;', @@ -129,7 +128,7 @@ var code = [ linter.defineRule( 'vars-order', rule ); -result = linter.verify( code, { +const result = linter.verify( code, { 'rules': { 'vars-order': 'error' } diff --git a/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/README.md b/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/README.md index 75da5f58ff3b..e086aba4c76a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); +const findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); ``` #### findJSDoc( source, node ) @@ -51,14 +51,13 @@ Retrieves a JSDoc comment associated with a given AST `node`, provided a `source ```javascript -var Linter = require( 'eslint' ).Linter; -var findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); +const Linter = require( 'eslint' ).Linter; +const findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); -var linter = new Linter(); -var code; +const linter = new Linter(); function rule( context ) { - var source = context.getSourceCode(); + const source = context.getSourceCode(); return { 'FunctionExpression:exit': log, @@ -68,14 +67,14 @@ function rule( context ) { }; function log( node ) { - var jsdoc = findJSDoc( source, node ); + const jsdoc = findJSDoc( source, node ); if ( jsdoc ) { console.log( jsdoc ); } } } -code = [ +const code = [ '/**', '* Squares a number.', '* ', diff --git a/lib/node_modules/@stdlib/_tools/github/create-issue/README.md b/lib/node_modules/@stdlib/_tools/github/create-issue/README.md index f4596a6e8daa..90663d3db211 100644 --- a/lib/node_modules/@stdlib/_tools/github/create-issue/README.md +++ b/lib/node_modules/@stdlib/_tools/github/create-issue/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createIssue = require( '@stdlib/_tools/github/create-issue' ); +const createIssue = require( '@stdlib/_tools/github/create-issue' ); ``` #### createIssue( slug, title, options, clbk ) @@ -47,7 +47,7 @@ var createIssue = require( '@stdlib/_tools/github/create-issue' ); ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -88,7 +88,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -142,9 +142,9 @@ function clbk( error, data, info ) { ```javascript -var createIssue = require( '@stdlib/_tools/github/create-issue' ); +const createIssue = require( '@stdlib/_tools/github/create-issue' ); -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'my-unique-agent', 'body': 'Beep boop.' diff --git a/lib/node_modules/@stdlib/_tools/github/create-repo/README.md b/lib/node_modules/@stdlib/_tools/github/create-repo/README.md index 93b5c62eb8a8..73ddffdc7f9c 100644 --- a/lib/node_modules/@stdlib/_tools/github/create-repo/README.md +++ b/lib/node_modules/@stdlib/_tools/github/create-repo/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createRepo = require( '@stdlib/_tools/github/create-repo' ); +const createRepo = require( '@stdlib/_tools/github/create-repo' ); ``` #### createRepo( name, options, clbk ) @@ -47,7 +47,7 @@ var createRepo = require( '@stdlib/_tools/github/create-repo' ); ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -93,7 +93,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -105,7 +105,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -118,7 +118,7 @@ By default, the `function` [creates][github-create-repo] a repository for the au ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'org': 'math-io' }; @@ -133,7 +133,7 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'org': 'math-io', 'private': false, @@ -143,7 +143,7 @@ var opts = { 'init': false }; -var create = createRepo.factory( opts, clbk ); +const create = createRepo.factory( opts, clbk ); create( 'beep' ); create( 'boop' ); @@ -181,9 +181,9 @@ The factory method accepts the same `options` as [`createRepo()`](#create-repo). ```javascript -var createRepo = require( '@stdlib/_tools/github/create-repo' ); +const createRepo = require( '@stdlib/_tools/github/create-repo' ); -var opts = { +const opts = { 'token': '', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/create-token/README.md b/lib/node_modules/@stdlib/_tools/github/create-token/README.md index e7f51eb038d5..9a5d51359693 100644 --- a/lib/node_modules/@stdlib/_tools/github/create-token/README.md +++ b/lib/node_modules/@stdlib/_tools/github/create-token/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createToken = require( '@stdlib/_tools/github/create-token' ); +const createToken = require( '@stdlib/_tools/github/create-token' ); ``` @@ -49,7 +49,7 @@ var createToken = require( '@stdlib/_tools/github/create-token' ); ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'scopes': [ 'public_repo', 'read:org' ], @@ -113,7 +113,7 @@ The `function` **only** supports basic authentication using a `username` and `pa ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'scopes': [ 'public_repo' ], @@ -128,7 +128,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'scopes': [ 'public_repo' ], @@ -144,7 +144,7 @@ If a user has [two-factor authentication][github-two-factor] enabled, set the `o ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'otp': '1234', @@ -181,9 +181,9 @@ createToken( opts, clbk ); ## Examples ```javascript -var createToken = require( '@stdlib/_tools/github/create-token' ); +const createToken = require( '@stdlib/_tools/github/create-token' ); -var opts = { +const opts = { 'username': '', 'password': '', 'otp': '', diff --git a/lib/node_modules/@stdlib/_tools/github/delete-token/README.md b/lib/node_modules/@stdlib/_tools/github/delete-token/README.md index 1bdbd683fd55..8737bf608451 100644 --- a/lib/node_modules/@stdlib/_tools/github/delete-token/README.md +++ b/lib/node_modules/@stdlib/_tools/github/delete-token/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var deleteToken = require( '@stdlib/_tools/github/delete-token' ); +const deleteToken = require( '@stdlib/_tools/github/delete-token' ); ``` @@ -49,9 +49,9 @@ var deleteToken = require( '@stdlib/_tools/github/delete-token' ); ```javascript -var tokenID = 1; +const tokenID = 1; -var opts = { +const opts = { 'username': 'beep', 'password': 'boop' }; @@ -84,7 +84,7 @@ The `function` **only** supports basic authentication using a `username` and `pa ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop' }; @@ -97,7 +97,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'useragent': 'hello-github!' @@ -111,7 +111,7 @@ If a user has [two-factor authentication][github-two-factor] enabled, set the `o ```javascript -var opts = { +const opts = { 'username': 'beep', 'password': 'boop', 'otp': '1234' @@ -146,11 +146,11 @@ deleteToken( tokenID, opts, clbk ); ## Examples ```javascript -var deleteToken = require( '@stdlib/_tools/github/delete-token' ); +const deleteToken = require( '@stdlib/_tools/github/delete-token' ); -var tokenID = 1; +const tokenID = 1; -var opts = { +const opts = { 'username': '', 'password': '', 'otp': '', diff --git a/lib/node_modules/@stdlib/_tools/github/dependents-count/README.md b/lib/node_modules/@stdlib/_tools/github/dependents-count/README.md index ce0c019a5178..c35d6f126d93 100644 --- a/lib/node_modules/@stdlib/_tools/github/dependents-count/README.md +++ b/lib/node_modules/@stdlib/_tools/github/dependents-count/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dependentsCount = require( '@stdlib/_tools/github/dependents-count' ); +const dependentsCount = require( '@stdlib/_tools/github/dependents-count' ); ``` @@ -87,7 +87,7 @@ The function accepts the following `options`: ```javascript -var dependentsCount = require( '@stdlib/_tools/github/dependents-count' ); +const dependentsCount = require( '@stdlib/_tools/github/dependents-count' ); dependentsCount( 'stdlib-js/random-base-mt19937', onResponse ); diff --git a/lib/node_modules/@stdlib/_tools/github/dependents/README.md b/lib/node_modules/@stdlib/_tools/github/dependents/README.md index a98357a7f237..414f11937ac7 100644 --- a/lib/node_modules/@stdlib/_tools/github/dependents/README.md +++ b/lib/node_modules/@stdlib/_tools/github/dependents/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dependents = require( '@stdlib/_tools/github/dependents' ); +const dependents = require( '@stdlib/_tools/github/dependents' ); ``` @@ -65,7 +65,7 @@ The function accepts the following `options`: By default, the function returns the list of repository dependents. To return the list of package dependents, set the `type` option. ```javascript -var opts = { +const opts = { 'type': 'package' }; @@ -112,7 +112,7 @@ Each element of the returned array is an object having the following properties: ```javascript -var dependents = require( '@stdlib/_tools/github/dependents' ); +const dependents = require( '@stdlib/_tools/github/dependents' ); dependents( 'stdlib-js/random-base-mt19937', onResponse ); diff --git a/lib/node_modules/@stdlib/_tools/github/dispatch-workflow/README.md b/lib/node_modules/@stdlib/_tools/github/dispatch-workflow/README.md index 1412a914d124..248eb0ee807b 100644 --- a/lib/node_modules/@stdlib/_tools/github/dispatch-workflow/README.md +++ b/lib/node_modules/@stdlib/_tools/github/dispatch-workflow/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/_tools/github/dispatch-workflow' ); +const dispatch = require( '@stdlib/_tools/github/dispatch-workflow' ); ``` #### dispatch( slug, id, options, clbk ) @@ -47,7 +47,7 @@ var dispatch = require( '@stdlib/_tools/github/dispatch-workflow' ); ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -86,7 +86,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -137,9 +137,9 @@ function clbk( error, info ) { ```javascript -var dispatch = require( '@stdlib/_tools/github/dispatch-workflow' ); +const dispatch = require( '@stdlib/_tools/github/dispatch-workflow' ); -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'my-unique-agent' }; diff --git a/lib/node_modules/@stdlib/_tools/github/fetch-file/README.md b/lib/node_modules/@stdlib/_tools/github/fetch-file/README.md index d8576fe26673..a3a9d62cb8ce 100644 --- a/lib/node_modules/@stdlib/_tools/github/fetch-file/README.md +++ b/lib/node_modules/@stdlib/_tools/github/fetch-file/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fetchFile = require( '@stdlib/_tools/github/fetch-file' ); +const fetchFile = require( '@stdlib/_tools/github/fetch-file' ); ``` @@ -50,7 +50,7 @@ Fetches a `file` from one or more **public** GitHub repositories. ```javascript // List of repository slugs (username|org/repo): -var repos = [ +const repos = [ 'kgryte/utils-copy', 'dstructs/matrix', 'math-io/gamma', @@ -92,14 +92,14 @@ Creates a reusable `function`. ```javascript -var repos = [ +const repos = [ 'kgryte/utils-copy', 'dstructs/matrix', 'math-io/gamma', 'unknown_user/repo' ]; -var get = fetchFile.factory( 'README.md', repos, clbk ); +const get = fetchFile.factory( 'README.md', repos, clbk ); get(); get(); @@ -133,9 +133,9 @@ The factory method accepts the same `arguments` as [`fetchFile()`](#fetchFile). ## Examples ```javascript -var fetchFile = require( '@stdlib/_tools/github/fetch-file' ); +const fetchFile = require( '@stdlib/_tools/github/fetch-file' ); -var repos = [ +const repos = [ 'kgryte/utils-copy', 'math-io/gamma', 'dstructs/matrix' diff --git a/lib/node_modules/@stdlib/_tools/github/followers/README.md b/lib/node_modules/@stdlib/_tools/github/followers/README.md index 2ed403be6972..a28a22fc9554 100644 --- a/lib/node_modules/@stdlib/_tools/github/followers/README.md +++ b/lib/node_modules/@stdlib/_tools/github/followers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var followers = require( '@stdlib/_tools/github/followers' ); +const followers = require( '@stdlib/_tools/github/followers' ); ``` @@ -49,7 +49,7 @@ Gets a user's [followers][github-followers]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -81,7 +81,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -93,7 +93,7 @@ To get the [followers][github-followers] of a particular user, set the `username ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -105,7 +105,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -119,12 +119,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = followers.factory( opts, onFollowers ); +const get = followers.factory( opts, onFollowers ); get(); get(); @@ -164,9 +164,9 @@ The factory method accepts the same `options` as [`followers()`](#followers). ```javascript -var followers = require( '@stdlib/_tools/github/followers' ); +const followers = require( '@stdlib/_tools/github/followers' ); -var opts = { +const opts = { 'useragent': 'beep-boop-bop', 'token': 'tkjorjk34ek3nj4!' }; diff --git a/lib/node_modules/@stdlib/_tools/github/following/README.md b/lib/node_modules/@stdlib/_tools/github/following/README.md index c7e98b62eded..83bdffdcd0f7 100644 --- a/lib/node_modules/@stdlib/_tools/github/following/README.md +++ b/lib/node_modules/@stdlib/_tools/github/following/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var following = require( '@stdlib/_tools/github/following' ); +const following = require( '@stdlib/_tools/github/following' ); ``` @@ -49,7 +49,7 @@ Gets a list of users a user is [following][github-following]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -81,7 +81,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -93,7 +93,7 @@ To get a list of users a particular user is [following][github-following], set t ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -105,7 +105,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -119,12 +119,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = following.factory( opts, clbk ); +const get = following.factory( opts, clbk ); get(); get(); @@ -164,9 +164,9 @@ The factory method accepts the same `options` as [`following()`](#following). ```javascript -var following = require( '@stdlib/_tools/github/following' ); +const following = require( '@stdlib/_tools/github/following' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/get/README.md b/lib/node_modules/@stdlib/_tools/github/get/README.md index ff0ee0f3e491..7d10f2ab0cc9 100644 --- a/lib/node_modules/@stdlib/_tools/github/get/README.md +++ b/lib/node_modules/@stdlib/_tools/github/get/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var get = require( '@stdlib/_tools/github/get' ); +const get = require( '@stdlib/_tools/github/get' ); ``` @@ -84,7 +84,7 @@ The function accepts the following `options`: To specify a particular resource [endpoint][github-api], set the `pathname` option. ```javascript -var opts = { +const opts = { 'pathname': '/user/repos' }; @@ -111,7 +111,7 @@ function onResponse( error, data, info ) { To [authenticate][github-oauth2] with an endpoint, set the [`token`][github-token] option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -139,7 +139,7 @@ By default, the function only requests a single [page][github-pagination] of res ```javascript // Resolves pages 2-5... -var opts = { +const opts = { 'page': 2, 'last_page': 5 }; @@ -168,7 +168,7 @@ To specify that all [pages][github-pagination] beginning from `page` be resolved ```javascript // Resolve all pages... -var opts = { +const opts = { 'last_page': 'last' }; @@ -195,7 +195,7 @@ function onResponse( error, data, info ) { To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -241,13 +241,13 @@ function onResponse( error, data, info ) { } } -var opts = { +const opts = { 'pathname': '/user/repos', 'last_page': 'last', 'token': 'tkjorjk34ek3nj4!' }; -var getRepos = get.factory( opts, onResponse ); +const getRepos = get.factory( opts, onResponse ); getRepos(); getRepos(); @@ -292,9 +292,9 @@ The method accepts the same `options` as [`get()`](#get) above. ```javascript -var get = require( '@stdlib/_tools/github/get' ); +const get = require( '@stdlib/_tools/github/get' ); -var opts = { +const opts = { 'hostname': 'api.github.com', 'pathname': '/user/repos', 'useragent': 'my-unique-agent', diff --git a/lib/node_modules/@stdlib/_tools/github/org-repos/README.md b/lib/node_modules/@stdlib/_tools/github/org-repos/README.md index 208f656adea6..5414ad52ea7b 100644 --- a/lib/node_modules/@stdlib/_tools/github/org-repos/README.md +++ b/lib/node_modules/@stdlib/_tools/github/org-repos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var repos = require( '@stdlib/_tools/github/org-repos' ); +const repos = require( '@stdlib/_tools/github/org-repos' ); ``` @@ -49,7 +49,7 @@ Gets meta data for all [repositories][github-repos] belonging to an organization ```javascript -var opts = { +const opts = { 'org': 'stdlib-js' }; @@ -82,7 +82,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'org': 'stdlib-js', 'token': 'tkjorjk34ek3nj4!' }; @@ -95,7 +95,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'org': 'stdlib-js', 'useragent': 'hello-github!' }; @@ -108,7 +108,7 @@ To return repositories of a particular [type][github-org-repos], set the `type` ```javascript -var opts = { +const opts = { 'org': 'stdlib-js', 'type': 'forks' }; @@ -123,12 +123,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'org': 'stdlib-js', 'token': 'tkjorjk34ek3nj4!' }; -var get = repos.factory( opts, clbk ); +const get = repos.factory( opts, clbk ); get(); get(); @@ -164,9 +164,9 @@ The factory method accepts the same `options` as [`repos()`](#repos). ## Examples ```javascript -var repos = require( '@stdlib/_tools/github/org-repos' ); +const repos = require( '@stdlib/_tools/github/org-repos' ); -var opts = { +const opts = { 'org': 'stdlib-js', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/rank-followers/README.md b/lib/node_modules/@stdlib/_tools/github/rank-followers/README.md index 4d7972a209b4..7704ecb5e515 100644 --- a/lib/node_modules/@stdlib/_tools/github/rank-followers/README.md +++ b/lib/node_modules/@stdlib/_tools/github/rank-followers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rank = require( '@stdlib/_tools/github/rank-followers' ); +const rank = require( '@stdlib/_tools/github/rank-followers' ); ``` @@ -49,7 +49,7 @@ Ranks a user's [followers][github-followers]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -101,7 +101,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -113,7 +113,7 @@ To analyze the [followers][github-followers] of a particular user, set the `user ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -125,7 +125,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -137,7 +137,7 @@ To specify an analysis method, set the `method` option. ```javascript -var opts = { +const opts = { 'method': 'ffratio' }; @@ -151,12 +151,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var run = rank.factory( opts, clbk ); +const run = rank.factory( opts, clbk ); run(); run(); @@ -196,9 +196,9 @@ The factory method accepts the same `options` as [`rank()`](#rank). ```javascript -var rank = require( '@stdlib/_tools/github/rank-followers' ); +const rank = require( '@stdlib/_tools/github/rank-followers' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop', 'method': 'ffratio' diff --git a/lib/node_modules/@stdlib/_tools/github/rank-users/README.md b/lib/node_modules/@stdlib/_tools/github/rank-users/README.md index 82cdd14c3549..77d8381c9dc4 100644 --- a/lib/node_modules/@stdlib/_tools/github/rank-users/README.md +++ b/lib/node_modules/@stdlib/_tools/github/rank-users/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rank = require( '@stdlib/_tools/github/rank-users' ); +const rank = require( '@stdlib/_tools/github/rank-users' ); ``` @@ -49,7 +49,7 @@ Ranks users provided a [user detail][github-user-details] input data `array`. ```javascript -var data = [ +const data = [ { 'login': 'beep', 'followers': 9 @@ -64,7 +64,7 @@ var data = [ } ]; -var opts = { +const opts = { 'method': 'followers' }; @@ -117,7 +117,7 @@ During analysis, the module may need to request resources from the GitHub [API][ ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -129,7 +129,7 @@ To specify a [user agent][github-user-agent] when interacting with the GitHub [A ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -141,7 +141,7 @@ To specify an analysis method, set the `method` option. ```javascript -var opts = { +const opts = { 'method': 'ffratio' }; @@ -155,12 +155,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'method': 'following', 'token': 'tkjorjk34ek3nj4!' }; -var run = rank.factory( opts, clbk ); +const run = rank.factory( opts, clbk ); run( data ); run( data ); @@ -198,10 +198,10 @@ The factory method accepts the same `options` as [`rank()`](#rank). ## Examples ```javascript -var rank = require( '@stdlib/_tools/github/rank-users' ); -var data = require( './data.json' ); +const rank = require( '@stdlib/_tools/github/rank-users' ); +const data = require( './data.json' ); -var opts = { +const opts = { 'method': 'ffratio' }; diff --git a/lib/node_modules/@stdlib/_tools/github/set-topics/README.md b/lib/node_modules/@stdlib/_tools/github/set-topics/README.md index 15ac23ca9f1f..0f9a23470beb 100644 --- a/lib/node_modules/@stdlib/_tools/github/set-topics/README.md +++ b/lib/node_modules/@stdlib/_tools/github/set-topics/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var setTopics = require( '@stdlib/_tools/github/set-topics' ); +const setTopics = require( '@stdlib/_tools/github/set-topics' ); ``` @@ -49,7 +49,7 @@ var setTopics = require( '@stdlib/_tools/github/set-topics' ); ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -79,7 +79,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -91,7 +91,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -106,12 +106,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; -var topics = setTopics.factory( opts, clbk ); +const topics = setTopics.factory( opts, clbk ); topics( 'math-io/erf', [ 'math', 'special' ] ); // ... @@ -140,9 +140,9 @@ The factory method accepts the same `options` as [`setTopics()`](#topics). ```javascript -var setTopics = require( '@stdlib/_tools/github/set-topics' ); +const setTopics = require( '@stdlib/_tools/github/set-topics' ); -var opts = { +const opts = { 'token': '', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/star-repo/README.md b/lib/node_modules/@stdlib/_tools/github/star-repo/README.md index 6dc78670038c..02076c21ca30 100644 --- a/lib/node_modules/@stdlib/_tools/github/star-repo/README.md +++ b/lib/node_modules/@stdlib/_tools/github/star-repo/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var star = require( '@stdlib/_tools/github/star-repo' ); +const star = require( '@stdlib/_tools/github/star-repo' ); ``` @@ -49,7 +49,7 @@ var star = require( '@stdlib/_tools/github/star-repo' ); ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -79,7 +79,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -91,7 +91,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -106,12 +106,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; -var like = star.factory( opts, clbk ); +const like = star.factory( opts, clbk ); like( 'stdlib-js/stdlib' ); // ... @@ -140,9 +140,9 @@ The factory method accepts the same `options` as [`star()`](#star). ```javascript -var star = require( '@stdlib/_tools/github/star-repo' ); +const star = require( '@stdlib/_tools/github/star-repo' ); -var opts = { +const opts = { 'token': '', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/starred/README.md b/lib/node_modules/@stdlib/_tools/github/starred/README.md index dc8239091d85..8c93541bc9dc 100644 --- a/lib/node_modules/@stdlib/_tools/github/starred/README.md +++ b/lib/node_modules/@stdlib/_tools/github/starred/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var starred = require( '@stdlib/_tools/github/starred' ); +const starred = require( '@stdlib/_tools/github/starred' ); ``` @@ -49,7 +49,7 @@ Gets a list of repositories a user has [starred][github-starred]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -83,7 +83,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -95,7 +95,7 @@ To get a list of repositories a particular user has [starred][github-starred], s ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -107,7 +107,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -121,12 +121,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = starred.factory( opts, clbk ); +const get = starred.factory( opts, clbk ); get(); get(); @@ -166,9 +166,9 @@ The factory method accepts the same `options` as [`starred()`](#starred). ```javascript -var starred = require( '@stdlib/_tools/github/starred' ); +const starred = require( '@stdlib/_tools/github/starred' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/subscriptions/README.md b/lib/node_modules/@stdlib/_tools/github/subscriptions/README.md index 8e7317b6aa58..158559dbad36 100644 --- a/lib/node_modules/@stdlib/_tools/github/subscriptions/README.md +++ b/lib/node_modules/@stdlib/_tools/github/subscriptions/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var subscriptions = require( '@stdlib/_tools/github/subscriptions' ); +const subscriptions = require( '@stdlib/_tools/github/subscriptions' ); ``` #### subscriptions( opts, clbk ) @@ -47,7 +47,7 @@ Gets a user's list of repository [subscriptions][github-watching]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -79,7 +79,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -91,7 +91,7 @@ To get a list of repositories a particular user is [watching][github-watching], ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -103,7 +103,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -117,12 +117,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = subscriptions.factory( opts, clbk ); +const get = subscriptions.factory( opts, clbk ); get(); get(); @@ -162,9 +162,9 @@ The factory method accepts the same `options` as [`subscriptions()`](#subscripti ```javascript -var subscriptions = require( '@stdlib/_tools/github/subscriptions' ); +const subscriptions = require( '@stdlib/_tools/github/subscriptions' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/user-details/README.md b/lib/node_modules/@stdlib/_tools/github/user-details/README.md index 8b51dcad0549..ef3cdea9217d 100644 --- a/lib/node_modules/@stdlib/_tools/github/user-details/README.md +++ b/lib/node_modules/@stdlib/_tools/github/user-details/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var userinfo = require( 'github-user-details' ); +const userinfo = require( 'github-user-details' ); ``` @@ -47,7 +47,7 @@ var userinfo = require( 'github-user-details' ); Gets user [details][github-user-details] for one or more users. ```javascript -var opts = { +const opts = { 'usernames': [ 'kgryte', 'planeshifter', @@ -96,7 +96,7 @@ The `function` accepts the following `options`: To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] option. ```javascript -var opts = { +const opts = { 'usernames': ['kgryte'], 'token': 'tkjorjk34ek3nj4!' }; @@ -107,7 +107,7 @@ userinfo( opts, clbk ); To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'usernames': [ 'kgryte', 'Planeshifter' ], 'useragent': 'hello-github!' }; @@ -120,12 +120,12 @@ userinfo( opts, clbk ); Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'usernames': [ 'kgryte', 'Planeshifter' ], 'token': 'tkjorjk34ek3nj4!' }; -var get = userinfo.factory( opts, clbk ); +const get = userinfo.factory( opts, clbk ); get(); get(); @@ -159,9 +159,9 @@ The factory method accepts the same `options` as [`userinfo()`](#userinfo). ```javascript -var userinfo = require( 'github-user-details' ); +const userinfo = require( 'github-user-details' ); -var opts = { +const opts = { 'usernames': [ 'kgryte', 'planeshifter', diff --git a/lib/node_modules/@stdlib/_tools/github/user-orgs/README.md b/lib/node_modules/@stdlib/_tools/github/user-orgs/README.md index 48fc3db6ab77..c619a05fd2a5 100644 --- a/lib/node_modules/@stdlib/_tools/github/user-orgs/README.md +++ b/lib/node_modules/@stdlib/_tools/github/user-orgs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var orgs = require( '@stdlib/_tools/github/user-orgs' ); +const orgs = require( '@stdlib/_tools/github/user-orgs' ); ``` @@ -49,7 +49,7 @@ Gets a user's [organization memberships][github-user-orgs]. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -82,7 +82,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -94,7 +94,7 @@ To get the [organization memberships][github-user-orgs] of a particular user, se ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -106,7 +106,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'useragent': 'hello-github!' }; @@ -120,12 +120,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = orgs.factory( opts, clbk ); +const get = orgs.factory( opts, clbk ); get(); get(); @@ -167,9 +167,9 @@ The factory method accepts the same `options` as [`orgs()`](#orgs). ```javascript -var orgs = require( '@stdlib/_tools/github/user-orgs' ); +const orgs = require( '@stdlib/_tools/github/user-orgs' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/user-rate-limit/README.md b/lib/node_modules/@stdlib/_tools/github/user-rate-limit/README.md index 8b72ca46aff8..ddf8108180a4 100644 --- a/lib/node_modules/@stdlib/_tools/github/user-rate-limit/README.md +++ b/lib/node_modules/@stdlib/_tools/github/user-rate-limit/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ratelimit = require( '@stdlib/_tools/github/user-rate-limit' ); +const ratelimit = require( '@stdlib/_tools/github/user-rate-limit' ); ``` @@ -49,7 +49,7 @@ Gets a user's [rate limit][github-rate-limit] status. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -87,7 +87,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -99,7 +99,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; @@ -114,12 +114,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'hello-github!' }; -var get = ratelimit.factory( opts, clbk ); +const get = ratelimit.factory( opts, clbk ); get(); get(); @@ -150,9 +150,9 @@ The factory method accepts the same `options` as [`ratelimit()`](#ratelimit). ```javascript -var ratelimit = require( '@stdlib/_tools/github/user-rate-limit' ); +const ratelimit = require( '@stdlib/_tools/github/user-rate-limit' ); -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/user-repos/README.md b/lib/node_modules/@stdlib/_tools/github/user-repos/README.md index c8e37f05b16f..bdd3f0394ee6 100644 --- a/lib/node_modules/@stdlib/_tools/github/user-repos/README.md +++ b/lib/node_modules/@stdlib/_tools/github/user-repos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var repos = require( '@stdlib/_tools/github/user-repos' ); +const repos = require( '@stdlib/_tools/github/user-repos' ); ``` @@ -49,7 +49,7 @@ Gets meta data for [repositories][github-repos] associated with a user. ```javascript -var opts = { +const opts = { 'username': 'kgryte' }; @@ -86,7 +86,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!' }; @@ -98,7 +98,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'hello-github!' }; @@ -111,7 +111,7 @@ To return repositories of a particular [type][github-repos], set the `type` opti ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'type': 'owner' }; @@ -124,7 +124,7 @@ To return repositories of a particular [visibility][github-repos], set the `visi ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'visibility': 'private' }; @@ -137,7 +137,7 @@ To return repositories of a particular [affiliation][github-repos], set the `aff ```javascript -var opts = { +const opts = { 'token': 'tkjorjk34ek3nj4!', 'affiliation': 'collaborator,organization_member' }; @@ -152,12 +152,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'username': 'kgryte', 'token': 'tkjorjk34ek3nj4!' }; -var get = repos.factory( opts, clbk ); +const get = repos.factory( opts, clbk ); get(); get(); @@ -197,9 +197,9 @@ The factory method accepts the same `options` as [`repos()`](#repos). ## Examples ```javascript -var repos = require( '@stdlib/_tools/github/user-repos' ); +const repos = require( '@stdlib/_tools/github/user-repos' ); -var opts = { +const opts = { 'username': 'kgryte', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/github/workflow-runs/README.md b/lib/node_modules/@stdlib/_tools/github/workflow-runs/README.md index 77088d3d9d6d..2137ff89dae5 100644 --- a/lib/node_modules/@stdlib/_tools/github/workflow-runs/README.md +++ b/lib/node_modules/@stdlib/_tools/github/workflow-runs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var workflowRuns = require( '@stdlib/_tools/github/workflow-runs' ); +const workflowRuns = require( '@stdlib/_tools/github/workflow-runs' ); ``` @@ -49,7 +49,7 @@ Gets all [workflow runs][github-workflow-runs] for a repository. ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/utils-noop' }; @@ -85,7 +85,7 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/utils-noop', 'token': 'tkjorjk34ek3nj4!' }; @@ -98,7 +98,7 @@ To specify a [user agent][github-user-agent], set the `useragent` option. ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/utils-noop', 'useragent': 'hello-github!' }; @@ -111,7 +111,7 @@ To only return workflow runs associated with a particular branch, set the `branc ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib', 'branch': 'develop' }; @@ -124,7 +124,7 @@ To only return workflow runs by a certain user (i.e., the user who created the p ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib', 'actor': 'Planeshifter' }; @@ -137,7 +137,7 @@ To only return workflow runs triggered by a certain event, set the `event` optio ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib', 'event': 'workflow_dispatch' }; @@ -150,7 +150,7 @@ To only return workflow runs with the specified check run status or conclusion, ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib', 'status': 'in_progress' }; @@ -165,12 +165,12 @@ Creates a reusable `function`. ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/utils-noop', 'token': 'tkjorjk34ek3nj4!' }; -var get = workflowRuns.factory( opts, clbk ); +const get = workflowRuns.factory( opts, clbk ); get(); get(); @@ -206,9 +206,9 @@ The factory method accepts the same `options` as [`workflowRuns()`](#workflow-ru ## Examples ```javascript -var workflowRuns = require( '@stdlib/_tools/github/workflow-runs' ); +const workflowRuns = require( '@stdlib/_tools/github/workflow-runs' ); -var opts = { +const opts = { 'slug': 'stdlib-js/utils-noop', 'useragent': 'beep-boop-bop' }; diff --git a/lib/node_modules/@stdlib/_tools/licenses/header-regexp-table/README.md b/lib/node_modules/@stdlib/_tools/licenses/header-regexp-table/README.md index 3898a1b4970a..4ab09cee2a66 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/header-regexp-table/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/header-regexp-table/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); +const createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); ``` #### createTable( license\[, types] ) @@ -45,17 +45,17 @@ var createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); Returns an `object` mapping file `types` to [license header][@stdlib/_tools/licenses/header-regexp] regular expressions. ```javascript -var out = createTable( 'Apache-2.0' ); +const out = createTable( 'Apache-2.0' ); // returns {...} ``` By default, the function returns an `object` whose keys are filename extensions of known supported file types. To specify a custom list, provide a `types` argument. ```javascript -var out = createTable( 'Apache-2.0', [ 'js', 'julia' ] ); +const out = createTable( 'Apache-2.0', [ 'js', 'julia' ] ); // returns {...} -var re = out.js; +let re = out.js; // returns re = out.julia; @@ -65,10 +65,10 @@ re = out.julia; If provided the file type value `'default'`, the function generates a regular expression capable of matching multiple file types based on common comment markers. ```javascript -var out = createTable( 'Apache-2.0', [ 'default' ] ); +const out = createTable( 'Apache-2.0', [ 'default' ] ); // returns {...} -var re = out.default; +const re = out.default; // returns ``` @@ -115,21 +115,21 @@ var re = out.default; ```javascript -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var extname = require( '@stdlib/utils/extname' ); -var createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const extname = require( '@stdlib/utils/extname' ); +const createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); // Generate a license header regular expression table: -var table = createTable( 'Apache-2.0' ); +const table = createTable( 'Apache-2.0' ); // Read the current file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var file = readFileSync( __filename, fopts ); +const file = readFileSync( __filename, fopts ); // Determine the filename extension: -var ext = extname( __filename ).substring( 1 ); // omit the leading `.` +const ext = extname( __filename ).substring( 1 ); // omit the leading `.` // Test if the file has a license header: console.log( table[ ext ].test( file ) ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/header-regexp/README.md b/lib/node_modules/@stdlib/_tools/licenses/header-regexp/README.md index 6e414243ada4..93e5dfb76227 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/header-regexp/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/header-regexp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); ``` #### headerRegExp( license, type ) @@ -45,14 +45,14 @@ var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); Returns a [license header][@stdlib/_tools/licenses/header] regular expression provided a `license` SPDX identifier and file `type`. ```javascript -var re = headerRegExp( 'Apache-2.0', 'Julia' ); +const re = headerRegExp( 'Apache-2.0', 'Julia' ); // returns ``` If provided an unsupported file `type`, the function returns `null`. ```javascript -var re = headerRegExp( 'Apache-2.0', 'beepboopbop' ); +const re = headerRegExp( 'Apache-2.0', 'beepboopbop' ); // returns null ``` @@ -77,21 +77,21 @@ var re = headerRegExp( 'Apache-2.0', 'beepboopbop' ); ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); // Read a JavaScript file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var file = readFileSync( join( __dirname, 'examples', 'index.js' ), fopts ); +const file = readFileSync( join( __dirname, 'examples', 'index.js' ), fopts ); // Generate a license header regular expression: -var re = headerRegExp( 'Apache-2.0', 'js' ); +const re = headerRegExp( 'Apache-2.0', 'js' ); // Test if the file has a license header: -var bool = re.test( file ); +const bool = re.test( file ); // returns ``` diff --git a/lib/node_modules/@stdlib/_tools/licenses/header/README.md b/lib/node_modules/@stdlib/_tools/licenses/header/README.md index 30db2c448bce..c62a3dd2c4c8 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/header/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/header/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); ``` #### licenseHeader( license, type\[, options] ) @@ -45,7 +45,7 @@ var licenseHeader = require( '@stdlib/_tools/licenses/header' ); Returns a license header provided a `license` SPDX identifier and file `type`. ```javascript -var h = licenseHeader( 'Apache-2.0', 'Julia' ); +const h = licenseHeader( 'Apache-2.0', 'Julia' ); ``` ```julia @@ -75,12 +75,12 @@ The function supports the following `options`: To set the copyright line, set the relevant options. ```javascript -var opts = { +const opts = { 'year': 2018, 'copyright': 'Jane Doe' }; -var h = licenseHeader( 'Apache-2.0', 'Julia', opts ); +const h = licenseHeader( 'Apache-2.0', 'Julia', opts ); ``` ```julia @@ -105,7 +105,7 @@ var h = licenseHeader( 'Apache-2.0', 'Julia', opts ); If provided an unsupported file `type`, the function returns `null`. ```javascript -var h = licenseHeader( 'Apache-2.0', 'beepboopbop' ); +const h = licenseHeader( 'Apache-2.0', 'beepboopbop' ); // returns null ``` @@ -138,14 +138,14 @@ var h = licenseHeader( 'Apache-2.0', 'beepboopbop' ); ```javascript -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); -var opts = { +const opts = { 'year': 2018, 'copyright': 'The Stdlib Authors' }; -var h = licenseHeader( 'Apache-2.0', 'Fortran', opts ); +const h = licenseHeader( 'Apache-2.0', 'Fortran', opts ); ``` ```fortran diff --git a/lib/node_modules/@stdlib/_tools/licenses/infer/README.md b/lib/node_modules/@stdlib/_tools/licenses/infer/README.md index 77d207d97dab..95a06d48de82 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/infer/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/infer/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var infer = require( '@stdlib/_tools/licenses/infer' ); +const infer = require( '@stdlib/_tools/licenses/infer' ); ``` #### infer( pkgs, pattern, clbk ) @@ -41,9 +41,9 @@ var infer = require( '@stdlib/_tools/licenses/infer' ); Infers license information from the content of files found using a provided glob `pattern`. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); -var pattern = '{readme*,licen[cs]e*,copying*}'; +const pattern = '{readme*,licen[cs]e*,copying*}'; licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/README.md b/lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/README.md index bf7ac4a27570..76d24fdc2b9b 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var insertHeader = require( '@stdlib/_tools/licenses/insert-header-file-list' ); +const insertHeader = require( '@stdlib/_tools/licenses/insert-header-file-list' ); ``` #### insertHeader( files, header, clbk ) @@ -37,13 +37,13 @@ Asynchronously inserts a [license header][@stdlib/_tools/licenses/header] into e ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; insertHeader( files, header, done ); @@ -59,14 +59,14 @@ To insert [license headers][@stdlib/_tools/licenses/header] using an `object` wh ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'README.md' ), join( __dirname, 'examples', 'index.js' ) ]; -var header = { +const header = { // JavaScript files: 'js': '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0', @@ -98,15 +98,15 @@ Synchronously inserts a [license header][@stdlib/_tools/licenses/header] into ea ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; -var err = insertHeader.sync( files, header ); +const err = insertHeader.sync( files, header ); if ( err ) { throw err; } @@ -135,28 +135,28 @@ if ( err ) { ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var writeFile = require( '@stdlib/fs/write-file' ).sync; -var unlink = require( '@stdlib/fs/unlink' ).sync; -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); -var insertHeader = require( '@stdlib/_tools/licenses/insert-header-file-list' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const writeFile = require( '@stdlib/fs/write-file' ).sync; +const unlink = require( '@stdlib/fs/unlink' ).sync; +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const insertHeader = require( '@stdlib/_tools/licenses/insert-header-file-list' ); // Create a temporary file: -var src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); -var tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); -var err = writeFile( tmp, readFile( src ) ); +const src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); +const tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); +let err = writeFile( tmp, readFile( src ) ); if ( err ) { throw err; } // Specify a list of files in which to insert headers: -var files = [ +const files = [ tmp ]; // Create a header object containing license headers: -var headers = { +const headers = { 'txt': licenseHeader( 'Apache-2.0', 'js', { 'year': 2018, 'copyright': 'The Stdlib Authors' diff --git a/lib/node_modules/@stdlib/_tools/licenses/insert-header/README.md b/lib/node_modules/@stdlib/_tools/licenses/insert-header/README.md index cbd9525a65aa..734e6afcde82 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/insert-header/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/insert-header/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var insertHeader = require( '@stdlib/_tools/licenses/insert-header' ); +const insertHeader = require( '@stdlib/_tools/licenses/insert-header' ); ``` #### insertHeader( src, header ) @@ -45,10 +45,10 @@ var insertHeader = require( '@stdlib/_tools/licenses/insert-header' ); Inserts a provided [license `header`][@stdlib/_tools/licenses/header] into a source code `string` (or [`Buffer`][@stdlib/buffer/ctor]). ```javascript -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); // Source code string: -var src = [ +let src = [ '#!/usr/bin/env bash', '', 'echo "beep"', @@ -57,11 +57,11 @@ var src = [ src = src.join( '\n' ); // Generate a license header: -var opts = { +const opts = { 'year': 2018, 'copyright': 'The Stdlib Authors' }; -var h = licenseHeader( 'Apache-2.0', 'bash', opts ); +const h = licenseHeader( 'Apache-2.0', 'bash', opts ); // Insert the header: src = insertHeader( src, h ); @@ -94,11 +94,11 @@ echo "beep" If provided a source code [`Buffer`][@stdlib/buffer/ctor], the function returns a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); // Source code buffer: -var src = [ +let src = [ '#!/usr/bin/env bash', '', 'echo "beep"', @@ -107,11 +107,11 @@ var src = [ src = string2buffer( src.join( '\n' ) ); // Generate a license header: -var opts = { +const opts = { 'year': 2018, 'copyright': 'The Stdlib Authors' }; -var h = licenseHeader( 'Apache-2.0', 'bash', opts ); +const h = licenseHeader( 'Apache-2.0', 'bash', opts ); // Insert the header: src = insertHeader( src, h ); @@ -163,26 +163,26 @@ echo "beep" ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); -var insertHeader = require( '@stdlib/_tools/licenses/insert-header' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const insertHeader = require( '@stdlib/_tools/licenses/insert-header' ); // Generate a license header: -var opts = { +const opts = { 'year': 2018, 'copyright': 'The Stdlib Authors' }; -var h = licenseHeader( 'Apache-2.0', 'fortran', opts ); +const h = licenseHeader( 'Apache-2.0', 'fortran', opts ); // Load a Fortran file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); -var file = readFileSync( fpath, fopts ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); +let file = readFileSync( fpath, fopts ); // Insert the license header: file = insertHeader( file, h ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md b/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md index 969238412f3b..ce944281d44c 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); ``` #### licenses( \[options], clbk ) @@ -60,7 +60,7 @@ The function accepts the following `options`: By default, the function searches the entire dependency tree. To limit the search depth, set the `depth` option. ```javascript -var opts = { +const opts = { 'depth': 0 // search only top-level installed packages }; @@ -77,7 +77,7 @@ function onResults( error, results ) { To exclude development dependencies, set the `dev` option to `false`. ```javascript -var opts = { +const opts = { 'dev': false }; diff --git a/lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/README.md b/lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/README.md index 56f697014f8d..2f3063eff679 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeHeader = require( '@stdlib/_tools/licenses/remove-header-file-list' ); +const removeHeader = require( '@stdlib/_tools/licenses/remove-header-file-list' ); ``` #### removeHeader( files, header, clbk ) @@ -37,13 +37,13 @@ Asynchronously [removes][@stdlib/_tools/licenses/remove-header] a [license heade ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; removeHeader( files, header, done ); @@ -59,14 +59,14 @@ To remove [license headers][@stdlib/_tools/licenses/header] using an `object` wh ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'README.md' ), join( __dirname, 'examples', 'index.js' ) ]; -var header = { +const header = { // JavaScript files: 'js': '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0', @@ -98,15 +98,15 @@ Synchronously [removes][@stdlib/_tools/licenses/remove-header] a [license header ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; -var err = removeHeader.sync( files, header ); +const err = removeHeader.sync( files, header ); if ( err ) { throw err; } @@ -134,28 +134,28 @@ if ( err ) { ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var writeFile = require( '@stdlib/fs/write-file' ).sync; -var unlink = require( '@stdlib/fs/unlink' ).sync; -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); -var removeHeader = require( '@stdlib/_tools/licenses/remove-header-file-list' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const writeFile = require( '@stdlib/fs/write-file' ).sync; +const unlink = require( '@stdlib/fs/unlink' ).sync; +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const removeHeader = require( '@stdlib/_tools/licenses/remove-header-file-list' ); // Create a temporary file: -var src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); -var tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); -var err = writeFile( tmp, readFile( src ) ); +const src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); +const tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); +let err = writeFile( tmp, readFile( src ) ); if ( err ) { throw err; } // Specify a list of files in which to remove headers: -var files = [ +const files = [ tmp ]; // Generate a header regular expression: -var headers = { +const headers = { 'txt': headerRegExp( 'Apache-2.0', 'js' ) }; diff --git a/lib/node_modules/@stdlib/_tools/licenses/remove-header/README.md b/lib/node_modules/@stdlib/_tools/licenses/remove-header/README.md index 89983b4496b6..2b828905b8a8 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/remove-header/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/remove-header/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var removeHeader = require( '@stdlib/_tools/licenses/remove-header' ); +const removeHeader = require( '@stdlib/_tools/licenses/remove-header' ); ``` #### removeHeader( src, header ) @@ -46,7 +46,7 @@ Removes a provided [license `header`][@stdlib/_tools/licenses/header] from a sou ```javascript // Source code string: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -57,7 +57,7 @@ var src = [ src = src.join( '\n' ); // Header string: -var h = '#\n# @license Apache-2.0'; +const h = '#\n# @license Apache-2.0'; // Remove the header: src = removeHeader( src, h ); @@ -74,10 +74,10 @@ echo "beep" If provided a source code [`Buffer`][@stdlib/buffer/ctor], the function returns a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); // Source code buffer: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -88,7 +88,7 @@ var src = [ src = string2buffer( src.join( '\n' ) ); // Header string: -var h = '#\n# @license Apache-2.0'; +const h = '#\n# @license Apache-2.0'; // Remove the header: src = removeHeader( src, h ); @@ -107,7 +107,7 @@ If provided a `header` argument which is either a `string` or [`Buffer`][@stdlib ```javascript // Source code string: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -118,7 +118,7 @@ var src = [ src = src.join( '\n' ); // Header regular expression: -var re = /#\n# @license Apache-2\.0\n\n/; +const re = /#\n# @license Apache-2\.0\n\n/; // Remove the header: src = removeHeader( src, re ); @@ -152,24 +152,24 @@ echo "beep" ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); -var removeHeader = require( '@stdlib/_tools/licenses/remove-header' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const removeHeader = require( '@stdlib/_tools/licenses/remove-header' ); // Generate a license header regular expression: -var re = headerRegExp( 'Apache-2.0', 'fortran' ); +let re = headerRegExp( 'Apache-2.0', 'fortran' ); // Modify the regular expression to remove an additional padded line: re = new RegExp( re.source+'\n' ); // Load a Fortran file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); -var file = readFileSync( fpath, fopts ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); +let file = readFileSync( fpath, fopts ); // Remove license header: file = removeHeader( file, re ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/ambiguous/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/ambiguous/README.md index 84376718f754..b5f5423a468c 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/ambiguous/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/ambiguous/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/ambiguous' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/ambiguous' ); ``` #### reporter( results ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/ambiguous' ); Filters licenses results for packages having ambiguous license information. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/basic/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/basic/README.md index 5b6fd40ea4fd..eeaac86d3c8d 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/basic/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/basic/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/basic' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/basic' ); ``` #### reporter( results ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/basic' ); Returns (unfiltered) license results. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/group/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/group/README.md index 52aa9f04e18d..e9a7d0e7fdcd 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/group/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/group/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/group' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/group' ); ``` #### reporter( results ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/group' ); Groups license results by license type. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/no-license/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/no-license/README.md index 92aab91c9c44..5229d3168508 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/no-license/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/no-license/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/no-license' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/no-license' ); ``` #### reporter( results ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/no-license' ); Filters licenses results for packages not having a license. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/root-deps/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/root-deps/README.md index 5902ad92605a..1c912f0569e7 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/root-deps/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/root-deps/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/root-deps' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/root-deps' ); ``` #### reporter( results, bool ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/root-deps' ); Reporter which filters license results for packages directly depended on by the root package. To include dev dependencies, set `bool` to `true`. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/summary/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/summary/README.md index efa41d6fb52b..d7e9e148da3f 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/summary/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/summary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/summary' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/summary' ); ``` #### reporter( results ) @@ -41,7 +41,7 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/summary' ); Summarizes license results. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); licenses( onResults ); diff --git a/lib/node_modules/@stdlib/_tools/licenses/reporters/whitelist/README.md b/lib/node_modules/@stdlib/_tools/licenses/reporters/whitelist/README.md index a3436144be4d..afbc6baeef98 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/reporters/whitelist/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/reporters/whitelist/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var reporter = require( '@stdlib/_tools/licenses/reporters/whitelist' ); +const reporter = require( '@stdlib/_tools/licenses/reporters/whitelist' ); ``` #### reporter( results, exclude ) @@ -41,9 +41,9 @@ var reporter = require( '@stdlib/_tools/licenses/reporters/whitelist' ); Excludes licenses results for packages having a license matching an SPDX identifier in a provided `exclude` list. ```javascript -var licenses = require( '@stdlib/_tools/licenses/licenses' ); +const licenses = require( '@stdlib/_tools/licenses/licenses' ); -var whitelist = [ +const whitelist = [ 'Apache-2.0', 'Artistic-2.0', 'BSD-2-Clause', diff --git a/lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/README.md b/lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/README.md index f5315aa14fdc..3181048b744c 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var updateHeader = require( '@stdlib/_tools/licenses/update-header-file-list' ); +const updateHeader = require( '@stdlib/_tools/licenses/update-header-file-list' ); ``` #### updateHeader( files, old, header, clbk ) @@ -37,14 +37,14 @@ Asynchronously [updates][@stdlib/_tools/licenses/update-header] a [license heade ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var old = '// @license Apache-2.0'; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const old = '// @license Apache-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; updateHeader( files, old, header, done ); @@ -60,14 +60,14 @@ Both `old` and `header` arguments may be objects whose keys are filename extensi ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'README.md' ), join( __dirname, 'examples', 'index.js' ) ]; -var old = { +const old = { // JavaScript files: 'js': '// @license MIT', @@ -81,7 +81,7 @@ var old = { 'default': /(?:#|\/\*|\/\/| ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ) ]; -var old = '// @license MIT'; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const old = '// @license MIT'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; -var err = updateHeader.sync( files, old, header ); +const err = updateHeader.sync( files, old, header ); if ( err ) { throw err; } @@ -150,29 +150,29 @@ if ( err ) { ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var writeFile = require( '@stdlib/fs/write-file' ).sync; -var unlink = require( '@stdlib/fs/unlink' ).sync; -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); -var licenseHeader = require( '@stdlib/_tools/licenses/header' ); -var updateHeader = require( '@stdlib/_tools/licenses/update-header-file-list' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const writeFile = require( '@stdlib/fs/write-file' ).sync; +const unlink = require( '@stdlib/fs/unlink' ).sync; +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const licenseHeader = require( '@stdlib/_tools/licenses/header' ); +const updateHeader = require( '@stdlib/_tools/licenses/update-header-file-list' ); // Create a temporary file: -var src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); -var tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); -var err = writeFile( tmp, readFile( src ) ); +const src = join( __dirname, 'examples', 'fixtures', 'file.js.txt' ); +const tmp = join( __dirname, 'examples', 'fixtures', 'tmp.js.txt' ); +let err = writeFile( tmp, readFile( src ) ); if ( err ) { throw err; } // Specify a list of files in which to update headers: -var files = [ +const files = [ tmp ]; // Generate a header regular expression: -var old = { +const old = { 'txt': headerRegExp( 'Apache-2.0', 'js' ) }; @@ -180,7 +180,7 @@ var old = { old.txt = new RegExp( old.txt.source+'\n' ); // Generate a license header: -var header = { +const header = { 'txt': licenseHeader( 'Apache-2.0', 'js', { 'year': 2018, 'copyright': 'Jane Doe' diff --git a/lib/node_modules/@stdlib/_tools/licenses/update-header/README.md b/lib/node_modules/@stdlib/_tools/licenses/update-header/README.md index 90ba09e8faf8..08585257f4e8 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/update-header/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/update-header/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var updateHeader = require( '@stdlib/_tools/licenses/update-header' ); +const updateHeader = require( '@stdlib/_tools/licenses/update-header' ); ``` #### updateHeader( src, old, header ) @@ -46,7 +46,7 @@ Replaces an existing [license header][@stdlib/_tools/licenses/header] with a new ```javascript // Source code string: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -57,10 +57,10 @@ var src = [ src = src.join( '\n' ); // Old header string: -var old = '#\n# @license Apache-2.0'; +const old = '#\n# @license Apache-2.0'; // New header string: -var h = '#\n# @license MIT'; +const h = '#\n# @license MIT'; // Update the header: src = updateHeader( src, old, h ); @@ -79,10 +79,10 @@ echo "beep" If provided a source code [`Buffer`][@stdlib/buffer/ctor], the function returns a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); // Source code buffer: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -93,10 +93,10 @@ var src = [ src = string2buffer( src.join( '\n' ) ); // Old header string: -var old = '#\n# @license Apache-2.0'; +const old = '#\n# @license Apache-2.0'; // New header string: -var h = '#\n# @license MIT'; +const h = '#\n# @license MIT'; // Update the header: src = updateHeader( src, old, h ); @@ -117,7 +117,7 @@ If provided a second argument which is either a `string` or [`Buffer`][@stdlib/b ```javascript // Source code string: -var src = [ +let src = [ '#!/usr/bin/env bash', '#', '# @license Apache-2.0', @@ -128,10 +128,10 @@ var src = [ src = src.join( '\n' ); // Header regular expression: -var re = /#\n# @license Apache-2\.0\n\n/; +const re = /#\n# @license Apache-2\.0\n\n/; // New header (empty): -var h = ''; +const h = ''; // Update the header: src = updateHeader( src, re, h ); @@ -165,24 +165,24 @@ echo "beep" ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); -var updateHeader = require( '@stdlib/_tools/licenses/update-header' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const updateHeader = require( '@stdlib/_tools/licenses/update-header' ); // Generate a license header regular expression: -var re = headerRegExp( 'Apache-2.0', 'fortran' ); +const re = headerRegExp( 'Apache-2.0', 'fortran' ); // Specify a new license header: -var h = '!> @license Apache-2.0'; +const h = '!> @license Apache-2.0'; // Load a Fortran file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); -var file = readFileSync( fpath, fopts ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.f.txt' ); +let file = readFileSync( fpath, fopts ); // Update license header: file = updateHeader( file, re, h ); diff --git a/lib/node_modules/@stdlib/_tools/links/create/README.md b/lib/node_modules/@stdlib/_tools/links/create/README.md index ae6306ce6588..049e3d0370f2 100644 --- a/lib/node_modules/@stdlib/_tools/links/create/README.md +++ b/lib/node_modules/@stdlib/_tools/links/create/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var create = require( '@stdlib/_tools/links/create' ); +const create = require( '@stdlib/_tools/links/create' ); ``` @@ -49,7 +49,7 @@ Creates a link entry in a link database. ```javascript -var opts = { +const opts = { 'uri': 'https://stdlib.io', 'id': 'stdlib', 'description': 'A standard library for JavaScript and Node.js.' @@ -78,7 +78,7 @@ To specify keywords which pertain to the link, set the `keywords` option. ```javascript -var opts = { +const opts = { 'uri': 'https://stdlib.io', 'id': 'stdlib', 'description': 'A standard library for JavaScript and Node.js.', @@ -107,7 +107,7 @@ To insert the link into a particular link database, set the `database` option. ```javascript -var opts = { +const opts = { 'uri': 'https://stdlib.io', 'id': 'stdlib', 'description': 'A standard library for JavaScript and Node.js.', @@ -131,13 +131,13 @@ Synchronously inserts a link into a link database. ```javascript -var opts = { +const opts = { 'uri': 'https://stdlib.io', 'id': 'stdlib', 'description': 'A standard library for JavaScript and Node.js.' }; -var err = create.sync( opts ); +const err = create.sync( opts ); if ( err ) { throw err; } @@ -173,9 +173,9 @@ The method accepts the same `options` as [`create()`](#create-async) above. ```javascript -var create = require( '@stdlib/_tools/links/create' ); +const create = require( '@stdlib/_tools/links/create' ); -var opts = { +const opts = { 'uri': 'https://stdlib.io', 'id': 'stdlib', 'description': 'A standard library for JavaScript and Node.js.', diff --git a/lib/node_modules/@stdlib/_tools/links/id2uri/README.md b/lib/node_modules/@stdlib/_tools/links/id2uri/README.md index 742b013bea3f..f3ff915ebb1e 100644 --- a/lib/node_modules/@stdlib/_tools/links/id2uri/README.md +++ b/lib/node_modules/@stdlib/_tools/links/id2uri/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var id2uri = require( '@stdlib/_tools/links/id2uri' ); +const id2uri = require( '@stdlib/_tools/links/id2uri' ); ``` @@ -67,7 +67,7 @@ To use an alternative link database, set the `database` option. ```javascript -var opts = { +const opts = { 'database': './path/to/link/database/json' }; @@ -86,7 +86,7 @@ function clbk( error, uri ) { Synchronously returns the `URI` which corresponds to a provided `id`. ```javascript -var uri = id2uri.sync( 'bibtex' ); +const uri = id2uri.sync( 'bibtex' ); if ( uri instanceof Error ) { throw id; } @@ -122,7 +122,7 @@ The method accepts the same `options` as [`id2uri()`](#async) above. ```javascript -var id2uri = require( '@stdlib/_tools/links/id2uri' ); +const id2uri = require( '@stdlib/_tools/links/id2uri' ); id2uri( 'stdlib', clbk ); diff --git a/lib/node_modules/@stdlib/_tools/links/uri2id/README.md b/lib/node_modules/@stdlib/_tools/links/uri2id/README.md index 92504db863d4..ded1b57e60c7 100644 --- a/lib/node_modules/@stdlib/_tools/links/uri2id/README.md +++ b/lib/node_modules/@stdlib/_tools/links/uri2id/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var uri2id = require( '@stdlib/_tools/links/uri2id' ); +const uri2id = require( '@stdlib/_tools/links/uri2id' ); ``` @@ -67,7 +67,7 @@ To use an alternative link database, set the `database` option. ```javascript -var opts = { +const opts = { 'database': './path/to/link/database/json' }; @@ -86,7 +86,7 @@ function clbk( error, id ) { Synchronously returns the `id` which corresponds to a provided `URI`. ```javascript -var id = uri2id.sync( 'http://www.bibtex.org/' ); +const id = uri2id.sync( 'http://www.bibtex.org/' ); if ( id instanceof Error ) { throw id; } @@ -122,7 +122,7 @@ The method accepts the same `options` as [`uri2id()`](#async) above. ```javascript -var uri2id = require( '@stdlib/_tools/links/uri2id' ); +const uri2id = require( '@stdlib/_tools/links/uri2id' ); uri2id( 'https://github.com/stdlib-js/stdlib', clbk ); diff --git a/lib/node_modules/@stdlib/_tools/links/validate/README.md b/lib/node_modules/@stdlib/_tools/links/validate/README.md index d1993c9152a4..832ac9eeba56 100644 --- a/lib/node_modules/@stdlib/_tools/links/validate/README.md +++ b/lib/node_modules/@stdlib/_tools/links/validate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var validateLinks = require( '@stdlib/_tools/links/validate' ); +const validateLinks = require( '@stdlib/_tools/links/validate' ); ``` @@ -57,7 +57,7 @@ The function returns an `array` of validation errors, where each result is an `o - `expected`: expected identifier (if applicable). ```javascript -var links = [ +const links = [ { 'url': 'https://www.r-project.org/', 'id': 'r' @@ -83,10 +83,10 @@ To use an alternative link database, set the `database` option. ```javascript -var opts = { +const opts = { 'database': './path/to/link/database/json' }; -var links = [ +const links = [ { 'url': 'https://www.r-project.org/', 'id': 'r' @@ -108,7 +108,7 @@ function clbk( error, validationErrors ) { Synchronously validates an array of link objects and returns an `array` of validation errors. ```javascript -var links = [ +const links = [ { 'url': 'https://www.r-project.org/', 'id': 'r' @@ -118,7 +118,7 @@ var links = [ 'id': 'r-project' } ]; -var out = validateLinks.sync( links ); +const out = validateLinks.sync( links ); if ( out instanceof Error ) { throw out; } @@ -153,9 +153,9 @@ The method accepts the same `options` as [`validateLinks()`](#async) above. ```javascript -var validateLinks = require( '@stdlib/_tools/links/validate' ); +const validateLinks = require( '@stdlib/_tools/links/validate' ); -var links = [ +const links = [ { 'id': 'gumbel-distribution', 'url': 'https://en.wikipedia.org/wiki/Gumbel_distribution' diff --git a/lib/node_modules/@stdlib/_tools/lint/filenames/README.md b/lib/node_modules/@stdlib/_tools/lint/filenames/README.md index f38520c90fbc..f3694a6c8194 100644 --- a/lib/node_modules/@stdlib/_tools/lint/filenames/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/filenames/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/filenames' ); +const lint = require( '@stdlib/_tools/lint/filenames' ); ``` #### lint( \[options,] clbk ) @@ -53,7 +53,7 @@ The function accepts the following `options`: To search from a specific directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './' }; @@ -70,7 +70,7 @@ function onLint( error, errs ) { To limit the filename search to a subset of files, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/*.js' }; @@ -89,7 +89,7 @@ function onLint( error, errs ) { Synchronously lints filenames. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); // returns [...] ``` @@ -130,7 +130,7 @@ The function accepts the same `options` as `lint()` above. ```javascript -var lint = require( '@stdlib/_tools/lint/filenames' ); +const lint = require( '@stdlib/_tools/lint/filenames' ); lint( onLint ); diff --git a/lib/node_modules/@stdlib/_tools/lint/header-filenames/README.md b/lib/node_modules/@stdlib/_tools/lint/header-filenames/README.md index 9c83a25dc1ac..e7516a0beb69 100644 --- a/lib/node_modules/@stdlib/_tools/lint/header-filenames/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/header-filenames/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/header-filenames' ); +const lint = require( '@stdlib/_tools/lint/header-filenames' ); ``` #### lint( \[options,] clbk ) @@ -52,7 +52,7 @@ The function accepts the following `options`: To search from a specific directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './' }; @@ -71,7 +71,7 @@ function onLint( error, errs ) { Synchronously lints header filenames. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); // returns [...] ``` @@ -112,7 +112,7 @@ The function accepts the same `options` as `lint()` above. ```javascript -var lint = require( '@stdlib/_tools/lint/header-filenames' ); +const lint = require( '@stdlib/_tools/lint/header-filenames' ); lint( onLint ); diff --git a/lib/node_modules/@stdlib/_tools/lint/license-header-file-list/README.md b/lib/node_modules/@stdlib/_tools/lint/license-header-file-list/README.md index 71bb63d4f579..bff06be20d73 100644 --- a/lib/node_modules/@stdlib/_tools/lint/license-header-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/license-header-file-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/license-header-file-list' ); +const lint = require( '@stdlib/_tools/lint/license-header-file-list' ); ``` #### lint( files, \[header,] clbk ) @@ -35,7 +35,7 @@ var lint = require( '@stdlib/_tools/lint/license-header-file-list' ); Asynchronously lints the [license header][@stdlib/_tools/licenses/header] for each file in a provided file list. ```javascript -var files = [ +const files = [ __filename ]; @@ -52,11 +52,11 @@ function onLint( error, errs ) { By default, the linter lints against an Apache-2.0 [license header][@stdlib/_tools/licenses/header] tailored to common filename extensions. To lint against an alternative [license header][@stdlib/_tools/licenses/header] or list of filename extensions, provide a `header` argument, which may be a `string`, [regular expression][mdn-regexp], or an `object` whose keys are filename extensions and whose values are [license header][@stdlib/_tools/licenses/header] `strings` or [regular expressions][mdn-regexp]. For example, to lint against a particular [license header][@stdlib/_tools/licenses/header] `string`, ```javascript -var files = [ +const files = [ __filename ]; -var header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; +const header = '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0'; lint( files, header, onLint ); @@ -71,11 +71,11 @@ function onLint( error, errs ) { To lint against a license header [regular expression][mdn-regexp], ```javascript -var files = [ +const files = [ __filename ]; -var header = /\/\/ This file is a part of stdlib\. License is Apache-2\.0: http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0/; +const header = /\/\/ This file is a part of stdlib\. License is Apache-2\.0: http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0/; lint( files, header, onLint ); @@ -90,11 +90,11 @@ function onLint( error, errs ) { To lint against an `object` containing license header `strings` and/or [regular expressions][mdn-regexp], ```javascript -var files = [ +const files = [ __filename ]; -var header = { +const header = { // JavaScript files: 'js': '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0', @@ -125,11 +125,11 @@ If a provided `header` object includes a `default` property, the value assigned Synchronously lints the [license header][@stdlib/_tools/licenses/header] for each file in a provided file list. ```javascript -var files = [ +const files = [ __filename ]; -var errs = lint.sync( files ); +const errs = lint.sync( files ); // returns [...] ``` @@ -172,14 +172,14 @@ var errs = lint.sync( files ); ```javascript -var createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); -var lint = require( '@stdlib/_tools/lint/license-header-file-list' ); +const createTable = require( '@stdlib/_tools/licenses/header-regexp-table' ); +const lint = require( '@stdlib/_tools/lint/license-header-file-list' ); // Create an object mapping filename extensions to license header regular expressions: -var headers = createTable( 'Apache-2.0', [ 'js', 'md' ] ); +const headers = createTable( 'Apache-2.0', [ 'js', 'md' ] ); // Generate a list of files to lint: -var files = [ +const files = [ __filename ]; diff --git a/lib/node_modules/@stdlib/_tools/lint/license-header-glob/README.md b/lib/node_modules/@stdlib/_tools/lint/license-header-glob/README.md index 5157851038cf..0e394ca00703 100644 --- a/lib/node_modules/@stdlib/_tools/lint/license-header-glob/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/license-header-glob/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/license-header-glob' ); +const lint = require( '@stdlib/_tools/lint/license-header-glob' ); ``` #### lint( \[options,] clbk ) @@ -55,7 +55,7 @@ The function accepts the following `options`: To search from a specific directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': __dirname }; @@ -72,7 +72,7 @@ function onLint( error, errs ) { To limit the file search to a subset of files, set the `pattern` option. ```javascript -var opts = { +const opts = { 'dir': __dirname, 'pattern': '**/*.js' // JavaScript files }; @@ -90,7 +90,7 @@ function onLint( error, errs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'pattern': '**/*.jl', 'ignore': [ 'node_modules/**', @@ -112,7 +112,7 @@ function onLint( error, errs ) { To lint against a particular [license header][@stdlib/_tools/licenses/header], set the `header` option. ```javascript -var opts = { +const opts = { 'dir': __dirname, 'pattern': '**/*.js', 'header': '// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0' @@ -131,7 +131,7 @@ function onLint( error, errs ) { To lint against a license header [regular expression][@stdlib/_tools/licenses/header-regexp], ```javascript -var opts = { +const opts = { 'dir': __dirname, 'pattern': '**/*.js', 'header': /\/\/ This file is a part of stdlib\. License is Apache-2\.0: http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0/ @@ -150,7 +150,7 @@ function onLint( error, errs ) { To lint against an `object` containing license header [`strings`][@stdlib/_tools/licenses/header] and/or [regular expressions][@stdlib/_tools/licenses/header-regexp], ```javascript -var opts = { +const opts = { 'dir': __dirname, 'header': { // JavaScript files: @@ -181,7 +181,7 @@ If a provided `header` option object includes a `default` property, the value as Synchronously lints [license headers][@stdlib/_tools/licenses/header] for a file glob. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); // returns [...] ``` @@ -228,9 +228,9 @@ The function accepts the same `options` as `lint()` above. ```javascript -var lint = require( '@stdlib/_tools/lint/license-header-glob' ); +const lint = require( '@stdlib/_tools/lint/license-header-glob' ); -var opts = { +const opts = { 'dir': __dirname }; diff --git a/lib/node_modules/@stdlib/_tools/lint/license-header/README.md b/lib/node_modules/@stdlib/_tools/lint/license-header/README.md index 33b4aa828f37..6bce7579aa4d 100644 --- a/lib/node_modules/@stdlib/_tools/lint/license-header/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/license-header/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/license-header' ); +const lint = require( '@stdlib/_tools/lint/license-header' ); ``` #### lint( blob, header ) @@ -35,7 +35,7 @@ var lint = require( '@stdlib/_tools/lint/license-header' ); Lints a file `blob` against a specified [license header][@stdlib/_tools/licenses/header]. ```javascript -var str = [ +let str = [ '// This file is licensed under Apache-2.0.', '', '"use strict";', @@ -45,18 +45,18 @@ var str = [ ]; str = str.join( '\n' ); -var header = '// This file is licensed under MIT.'; +const header = '// This file is licensed under MIT.'; -var err = lint( str, header ); +const err = lint( str, header ); // returns {...} ``` The `blob` argument may be either a `string` or [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); -var str = [ +let str = [ '// This file is licensed under Apache-2.0.', '', '"use strict";', @@ -66,16 +66,16 @@ var str = [ ]; str = str.join( '\n' ); -var header = '// This file is licensed under MIT.'; +const header = '// This file is licensed under MIT.'; -var err = lint( string2buffer( str ), header ); +const err = lint( string2buffer( str ), header ); // returns {...} ``` The `header` argument may be either a `string` or [regular expression][mdn-regexp]. ```javascript -var str = [ +let str = [ '// This file is licensed under Apache-2.0.', '', '"use strict";', @@ -85,9 +85,9 @@ var str = [ ]; str = str.join( '\n' ); -var header = /^(?:\/\/ |# |\/\* |)This file is licensed under Apache-2\.0\.(?: \*\/|)/; +const header = /^(?:\/\/ |# |\/\* |)This file is licensed under Apache-2\.0\.(?: \*\/|)/; -var err = lint( str, header ); +const err = lint( str, header ); // returns null ``` @@ -114,21 +114,21 @@ var err = lint( str, header ); ```javascript -var headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); -var readFile = require( '@stdlib/fs/read-file' ).sync; -var lint = require( '@stdlib/_tools/lint/license-header' ); +const headerRegExp = require( '@stdlib/_tools/licenses/header-regexp' ); +const readFile = require( '@stdlib/fs/read-file' ).sync; +const lint = require( '@stdlib/_tools/lint/license-header' ); // Generate a header RegExp: -var header = headerRegExp( 'Apache-2.0', 'js' ); +const header = headerRegExp( 'Apache-2.0', 'js' ); // Read the current file: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var file = readFile( __filename, fopts ); +const file = readFile( __filename, fopts ); // Lint the file license header: -var err = lint( file, header ); +const err = lint( file, header ); if ( err ) { console.error( err.error ); } else { diff --git a/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/README.md b/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/README.md index 44c27a12be3f..4eceea957e7d 100644 --- a/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/namespace-aliases' ); +const lint = require( '@stdlib/_tools/lint/namespace-aliases' ); ``` #### lint( \[options,] clbk ) @@ -63,7 +63,7 @@ Each lint error is represented by an `object` having the following fields: To lint starting from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -86,7 +86,7 @@ function onLint( error, errs ) { Synchronously lints stdlib namespace aliases to ensure that each namespace alias for a package matches the package's global alias. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); if ( errs.length ) { console.error( JSON.stringify( errs ) ); } else { @@ -117,9 +117,9 @@ The function accepts the same `options` as `lint()` above. ```javascript -var lint = require( '@stdlib/_tools/lint/namespace-aliases' ); +const lint = require( '@stdlib/_tools/lint/namespace-aliases' ); -var opts = { +const opts = { 'dir': './' }; diff --git a/lib/node_modules/@stdlib/_tools/lint/pkg-json/README.md b/lib/node_modules/@stdlib/_tools/lint/pkg-json/README.md index e44edcc12f95..538b89a2e178 100644 --- a/lib/node_modules/@stdlib/_tools/lint/pkg-json/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/pkg-json/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/pkg-json' ); +const lint = require( '@stdlib/_tools/lint/pkg-json' ); ``` #### lint( \[options,] clbk ) @@ -58,7 +58,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -79,7 +79,7 @@ function done( error, errs ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -100,7 +100,7 @@ function done( error, errs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -127,7 +127,7 @@ function done( error, errs ) { Synchronously lints `package.json` files. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); if ( errs ) { console.dir( errs ); } else { @@ -154,7 +154,7 @@ The function accepts the same `options` as `lint()` above. ```javascript -var lint = require( '@stdlib/_tools/lint/pkg-json' ); +const lint = require( '@stdlib/_tools/lint/pkg-json' ); lint( done ); diff --git a/lib/node_modules/@stdlib/_tools/lint/repl-txt/README.md b/lib/node_modules/@stdlib/_tools/lint/repl-txt/README.md index 572134fff336..bfeec88c42f3 100644 --- a/lib/node_modules/@stdlib/_tools/lint/repl-txt/README.md +++ b/lib/node_modules/@stdlib/_tools/lint/repl-txt/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/lint/repl-txt' ); +const lint = require( '@stdlib/_tools/lint/repl-txt' ); ``` #### lint( \[options,] clbk ) @@ -58,7 +58,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -79,7 +79,7 @@ function done( error, errs ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/repl.txt' }; @@ -100,7 +100,7 @@ function done( error, errs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -127,7 +127,7 @@ function done( error, errs ) { Synchronously lints `repl.txt` files. ```javascript -var errs = lint.sync(); +const errs = lint.sync(); if ( errs ) { console.dir( errs ); } else { @@ -154,10 +154,10 @@ The function accepts the same `options` as `lint()` above. ```javascript -var join = require( 'path' ).join; -var lint = require( '@stdlib/_tools/lint/repl-txt' ); +const join = require( 'path' ).join; +const lint = require( '@stdlib/_tools/lint/repl-txt' ); -var opts = { +const opts = { 'dir': join( __dirname, 'test' ), 'pattern': '**/repl.txt' }; diff --git a/lib/node_modules/@stdlib/_tools/makie/makie/README.md b/lib/node_modules/@stdlib/_tools/makie/makie/README.md index 99e1ca9e5b51..b2417e660405 100644 --- a/lib/node_modules/@stdlib/_tools/makie/makie/README.md +++ b/lib/node_modules/@stdlib/_tools/makie/makie/README.md @@ -60,7 +60,7 @@ When executing a command, the current working directory is used as a filter. Thu ## Usage ```javascript -var makie = require( '@stdlib/_tools/makie/makie' ); +const makie = require( '@stdlib/_tools/makie/makie' ); ``` #### makie( dirpath, options, target ) @@ -68,13 +68,13 @@ var makie = require( '@stdlib/_tools/makie/makie' ); Executes a Makefile command where the command is identified by a `target` and the Makefile containing the `target` is located in directory `dirpath`. ```javascript -var spawn = require( 'child_process' ).spawn; +const spawn = require( 'child_process' ).spawn; function plugin( dirpath, cwd, subpath ) { - var proc = spawn( 'make', [], 'test' ); + const proc = spawn( 'make', [], 'test' ); } -var opts = { +const opts = { 'plugins': { 'test': plugin } @@ -101,18 +101,14 @@ Executes a Makefile target. A plugin is provided the following arguments: - **subpath**: subdirectory path, if `makie` is called in a subdirectory; otherwise, an empty `string`. ```javascript -var spawn = require( 'child_process' ).spawn; +const spawn = require( 'child_process' ).spawn; function plugin( dir, cwd ) { - var opts; - var args; - var proc; - - opts = {}; + const opts = {}; opts.cwd = dir; opts.stdio = 'inherit'; - args = new Array( 2 ); + const args = new Array( 2 ); // Environment variables: args[ 0 ] = 'REPL_DIR='+cwd; @@ -120,7 +116,7 @@ function plugin( dir, cwd ) { // Target: args[ 1 ] = 'repl'; - proc = spawn( 'make', args, opts ); + const proc = spawn( 'make', args, opts ); } ``` diff --git a/lib/node_modules/@stdlib/_tools/manifest-json/schema/README.md b/lib/node_modules/@stdlib/_tools/manifest-json/schema/README.md index a15cd014624b..f28491058d48 100644 --- a/lib/node_modules/@stdlib/_tools/manifest-json/schema/README.md +++ b/lib/node_modules/@stdlib/_tools/manifest-json/schema/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var schema = require( '@stdlib/_tools/manifest-json/schema' ); +const schema = require( '@stdlib/_tools/manifest-json/schema' ); ``` #### schema() @@ -45,7 +45,7 @@ var schema = require( '@stdlib/_tools/manifest-json/schema' ); Returns a [JSON schema][json-schema] for `manifest.json`. ```javascript -var json = schema(); +const json = schema(); // returns ``` @@ -70,16 +70,16 @@ var json = schema(); ```javascript -var join = require( 'path' ).join; -var Ajv = require( 'ajv' ); -var readJSON = require( '@stdlib/fs/read-json' ).sync; -var schema = require( '@stdlib/_tools/manifest-json/schema' ); +const join = require( 'path' ).join; +const Ajv = require( 'ajv' ); +const readJSON = require( '@stdlib/fs/read-json' ).sync; +const schema = require( '@stdlib/_tools/manifest-json/schema' ); -var manifest = readJSON( join( __dirname, 'fixtures', 'manifest.json' ) ); -var ajv = new Ajv(); +const manifest = readJSON( join( __dirname, 'fixtures', 'manifest.json' ) ); +const ajv = new Ajv(); -var bool = ajv.validate( schema(), manifest ); -var errs = ajv.errors; +const bool = ajv.validate( schema(), manifest ); +const errs = ajv.errors; ``` diff --git a/lib/node_modules/@stdlib/_tools/markdown/img-svg-equation/README.md b/lib/node_modules/@stdlib/_tools/markdown/img-svg-equation/README.md index 992cbc0f0ef6..cdc234740d93 100644 --- a/lib/node_modules/@stdlib/_tools/markdown/img-svg-equation/README.md +++ b/lib/node_modules/@stdlib/_tools/markdown/img-svg-equation/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); +const createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); ``` #### createElement( \[options] ) @@ -45,7 +45,7 @@ var createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); Generates an HTML `string` for displaying an SVG equation as an image in a GitHub Markdown file. ```javascript -var html = createElement(); +const html = createElement(); // returns '
\n \n
\n
' ``` @@ -61,23 +61,23 @@ The function accepts the following `options`: Each `option` corresponds an HTML attribute. For example, to set the image source URL, set the `src` option. ```javascript -var opts = { +const opts = { 'src': 'https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@master/docs/img/eqn1.svg' }; -var html = createElement( opts ); +const html = createElement( opts ); // returns '
\n \n
\n
' ``` To include a raw equation [TeX][tex] or [LaTeX][latex] `string` in the element, set the `raw` option. ```javascript -var opts = { +const opts = { 'raw': '\\Gamma ( n ) = (n-1)!', 'src': 'https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@master/docs/img/eqn1.svg' }; -var html = createElement( opts ); +const html = createElement( opts ); // returns '
\n \n
\n
' ``` @@ -102,9 +102,9 @@ var html = createElement( opts ); ```javascript -var createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); +const createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); -var opts = { +const opts = { 'className': 'eqn', 'align': 'left', 'raw': '\\operatorname{erf}(x) = \\frac{2}{\\sqrt\\pi}\\int_0^x e^{-t^2}\\,\\mathrm dt', @@ -113,7 +113,7 @@ var opts = { 'alt': 'Error function.' }; -var html = createElement( opts ); +const html = createElement( opts ); console.log( html ); // => '
\n Error function.\n
\n
' diff --git a/lib/node_modules/@stdlib/_tools/markdown/inline-svg-equation/README.md b/lib/node_modules/@stdlib/_tools/markdown/inline-svg-equation/README.md index 45542c13dbc9..d4da58af4d6e 100644 --- a/lib/node_modules/@stdlib/_tools/markdown/inline-svg-equation/README.md +++ b/lib/node_modules/@stdlib/_tools/markdown/inline-svg-equation/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createElement = require( '@stdlib/_tools/markdown/inline-svg-equation' ); +const createElement = require( '@stdlib/_tools/markdown/inline-svg-equation' ); ``` #### createElement( \[options,] clbk ) @@ -66,7 +66,7 @@ The function accepts the following `options`: To include a raw equation [TeX][tex] or [LaTeX][latex] `string` in the element, set the `raw` option. ```javascript -var opts = { +const opts = { 'raw': '\\Gamma ( n ) = (n-1)!' }; @@ -102,9 +102,9 @@ function done( error, out ) { ```javascript -var createElement = require( '@stdlib/_tools/markdown/inline-svg-equation' ); +const createElement = require( '@stdlib/_tools/markdown/inline-svg-equation' ); -var opts = { +const opts = { 'className': 'eqn', 'align': 'left', 'raw': '\\operatorname{erf}(x) = \\frac{2}{\\sqrt\\pi}\\int_0^x e^{-t^2}\\,\\mathrm dt', diff --git a/lib/node_modules/@stdlib/_tools/markdown/namespace-toc/README.md b/lib/node_modules/@stdlib/_tools/markdown/namespace-toc/README.md index 1df2167f6a60..f436e5af595d 100644 --- a/lib/node_modules/@stdlib/_tools/markdown/namespace-toc/README.md +++ b/lib/node_modules/@stdlib/_tools/markdown/namespace-toc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var createTOC = require( '@stdlib/_tools/markdown/namespace-toc' ); +const createTOC = require( '@stdlib/_tools/markdown/namespace-toc' ); ``` #### createTOC( \[options,] clbk ) @@ -70,7 +70,7 @@ The function accepts the following `options`: To search from a specific directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './' }; @@ -91,7 +91,7 @@ function onCreate( error, res ) { To limit the packages included into the table of contents, you may use the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '*' }; @@ -112,7 +112,7 @@ function onCreate( error, res ) { To include or exclude packages with certain `package.json` keywords from the table of contents, set the `keywords` option to a string of comma-separated keywords (preceded by `+` or `-` to indicate inclusion or exclusion). ```javascript -var opts = { +const opts = { 'keywords': '+tools,-math' }; @@ -133,7 +133,7 @@ function onCreate( error, res ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ '**/assert/is-**', '**/assert/has-**-support' @@ -157,7 +157,7 @@ function onCreate( error, res ) { To exclude a list of packages from table of contents, set the `blacklist` option. ```javascript -var opts = { +const opts = { 'blacklist': [ '@stdlib/assert/contains', '@stdlib/assert/deep-has-own-property', @@ -184,7 +184,7 @@ function onCreate( error, res ) { Synchronously creates a table of contents. ```javascript -var out = createTOC.sync(); +const out = createTOC.sync(); // returns {...} ``` @@ -211,10 +211,10 @@ The function accepts the same `options` as `createTOC()` above. ```javascript -var resolve = require( 'path' ).resolve; -var createTOC = require( '@stdlib/_tools/markdown/namespace-toc' ); +const resolve = require( 'path' ).resolve; +const createTOC = require( '@stdlib/_tools/markdown/namespace-toc' ); -var opts = { +const opts = { 'dir': resolve( __dirname, './../../../string' ), 'pattern': '*' }; diff --git a/lib/node_modules/@stdlib/_tools/markdown/to-html/README.md b/lib/node_modules/@stdlib/_tools/markdown/to-html/README.md index 4de111aa1748..624471bf6714 100644 --- a/lib/node_modules/@stdlib/_tools/markdown/to-html/README.md +++ b/lib/node_modules/@stdlib/_tools/markdown/to-html/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toHTML = require( '@stdlib/_tools/markdown/to-html' ); +const toHTML = require( '@stdlib/_tools/markdown/to-html' ); ``` #### toHTML( markdown\[, base], done ) @@ -91,11 +91,11 @@ function done( error, html ) { ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var toHTML = require( '@stdlib/_tools/markdown/to-html' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const toHTML = require( '@stdlib/_tools/markdown/to-html' ); -var file = join( __dirname, 'examples', 'fixtures', 'fixture.md' ); +let file = join( __dirname, 'examples', 'fixtures', 'fixture.md' ); file = readFileSync( file, { 'encoding': 'utf8' diff --git a/lib/node_modules/@stdlib/_tools/markdown/to-vdom/README.md b/lib/node_modules/@stdlib/_tools/markdown/to-vdom/README.md index 6755637a9617..616236e88a58 100644 --- a/lib/node_modules/@stdlib/_tools/markdown/to-vdom/README.md +++ b/lib/node_modules/@stdlib/_tools/markdown/to-vdom/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toVirtualDOM = require( '@stdlib/_tools/markdown/to-vdom' ); +const toVirtualDOM = require( '@stdlib/_tools/markdown/to-vdom' ); ``` #### toVirtualDOM( markdown ) @@ -45,7 +45,7 @@ var toVirtualDOM = require( '@stdlib/_tools/markdown/to-vdom' ); Converts a Markdown `string` or [`Buffer`][node-buffer] to a [Virtual DOM][virtual-dom] tree. ```javascript -var vtree = toVirtualDOM( '# Beep\n\n> Boop!' ); +const vtree = toVirtualDOM( '# Beep\n\n> Boop!' ); // returns ``` @@ -70,12 +70,12 @@ var vtree = toVirtualDOM( '# Beep\n\n> Boop!' ); ```javascript -var join = require( 'path' ).join; -var toHTML = require( 'vdom-to-html' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var toVirtualDOM = require( '@stdlib/_tools/markdown/to-vdom' ); +const join = require( 'path' ).join; +const toHTML = require( 'vdom-to-html' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const toVirtualDOM = require( '@stdlib/_tools/markdown/to-vdom' ); -var file = join( __dirname, 'examples', 'fixtures', 'fixture.md' ); +let file = join( __dirname, 'examples', 'fixtures', 'fixture.md' ); file = readFileSync( file, { 'encoding': 'utf8' @@ -84,7 +84,7 @@ if ( file instanceof Error ) { throw file; } -var vtree = toVirtualDOM( file ); +const vtree = toVirtualDOM( file ); console.log( toHTML( vtree ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/modules/import-require-glob/README.md b/lib/node_modules/@stdlib/_tools/modules/import-require-glob/README.md index ac8bbfa6d762..432cc2cfaf00 100644 --- a/lib/node_modules/@stdlib/_tools/modules/import-require-glob/README.md +++ b/lib/node_modules/@stdlib/_tools/modules/import-require-glob/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/modules/import-require-glob' ); +const ls = require( '@stdlib/_tools/modules/import-require-glob' ); ``` @@ -68,9 +68,9 @@ The function accepts the following `options`: By default, the function will search for files in the current working directory. To specify an alternative directory, set the `dir` option. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var opts = { +const opts = { 'dir': join( __dirname, 'tests', 'fixtures' ) }; @@ -96,7 +96,7 @@ function onList( error, results ) { To specify a file glob pattern, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/*.txt' }; @@ -115,7 +115,7 @@ function onList( error, results ) { Synchronously reads files and lists import and require paths. ```javascript -var results = ls.sync(); +const results = ls.sync(); // returns [{...},{...},...] ``` @@ -132,7 +132,7 @@ The function accepts the same `options` as [`ls()`](#ls) above. ```javascript -var ls = require( '@stdlib/_tools/modules/import-require-glob' ); +const ls = require( '@stdlib/_tools/modules/import-require-glob' ); ls( onList ); diff --git a/lib/node_modules/@stdlib/_tools/modules/import-require-tree/README.md b/lib/node_modules/@stdlib/_tools/modules/import-require-tree/README.md index 5bc82804d44c..f615753a1e37 100644 --- a/lib/node_modules/@stdlib/_tools/modules/import-require-tree/README.md +++ b/lib/node_modules/@stdlib/_tools/modules/import-require-tree/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var walk = require( '@stdlib/_tools/modules/import-require-tree' ); +const walk = require( '@stdlib/_tools/modules/import-require-tree' ); ``` #### walk( file, clbk ) @@ -75,7 +75,7 @@ function clbk( error, tree ) { ```javascript -var walk = require( '@stdlib/_tools/modules/import-require-tree' ); +const walk = require( '@stdlib/_tools/modules/import-require-tree' ); walk(); ``` diff --git a/lib/node_modules/@stdlib/_tools/modules/import-require/README.md b/lib/node_modules/@stdlib/_tools/modules/import-require/README.md index b041d84447c5..37441787e622 100644 --- a/lib/node_modules/@stdlib/_tools/modules/import-require/README.md +++ b/lib/node_modules/@stdlib/_tools/modules/import-require/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/modules/import-require' ); +const ls = require( '@stdlib/_tools/modules/import-require' ); ``` #### ls( src ) @@ -41,10 +41,10 @@ var ls = require( '@stdlib/_tools/modules/import-require' ); Searches for import and require paths in a source `string` or [`Buffer`][node-buffer]. ```javascript -var readFile = require( '@stdlib/fs/read-file' ).sync; +const readFile = require( '@stdlib/fs/read-file' ).sync; -var src = readFile( __filename ); -var results = ls( src ); +const src = readFile( __filename ); +const results = ls( src ); console.dir( results ); ``` @@ -67,11 +67,11 @@ The returned `object` has the following fields: ```javascript - var ls = require( '@stdlib/_tools/modules/import-require' ); - var readFile = require( '@stdlib'+'/fs/read-file' ).sync; + const ls = require( '@stdlib/_tools/modules/import-require' ); + const readFile = require( '@stdlib'+'/fs/read-file' ).sync; - var src = readFile( __filename ); - var results = ls( src ); + const src = readFile( __filename ); + const results = ls( src ); /* returns { 'literals': [ '@stdlib/_tools/modules/import-require' ], @@ -89,11 +89,11 @@ The returned `object` has the following fields: ```javascript -var readFile = require( '@stdlib/fs/read-file' ).sync; -var ls = require( '@stdlib/_tools/modules/import-require' ); +const readFile = require( '@stdlib/fs/read-file' ).sync; +const ls = require( '@stdlib/_tools/modules/import-require' ); -var file = readFile( __filename ); -var results = ls( file ); +const file = readFile( __filename ); +const results = ls( file ); console.log( 'Literals:' ); console.dir( results.literals ); diff --git a/lib/node_modules/@stdlib/_tools/modules/pkg-deps/README.md b/lib/node_modules/@stdlib/_tools/modules/pkg-deps/README.md index c810dd5faebc..2daaec268215 100644 --- a/lib/node_modules/@stdlib/_tools/modules/pkg-deps/README.md +++ b/lib/node_modules/@stdlib/_tools/modules/pkg-deps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pkgDeps = require( '@stdlib/_tools/modules/pkg-deps' ); +const pkgDeps = require( '@stdlib/_tools/modules/pkg-deps' ); ``` @@ -74,7 +74,7 @@ The function accepts the following `options`: By default, the function walks relative module dependencies to resolve both primary and secondary package dependencies. To only resolve a file's direct package dependencies, set the `walk` option to `false`. ```javascript -var opts = { +const opts = { 'walk': false }; @@ -93,7 +93,7 @@ function clbk( error, results ) { Synchronously lists package dependencies. ```javascript -var results = pkgDeps.sync( __filename ); +const results = pkgDeps.sync( __filename ); // returns [...] ``` @@ -110,10 +110,10 @@ The function accepts the same `options` as [`pkgDeps()`](#pkg-deps) above. ```javascript -var join = require( 'path' ).join; -var pkgDeps = require( '@stdlib/_tools/modules/pkg-deps' ); +const join = require( 'path' ).join; +const pkgDeps = require( '@stdlib/_tools/modules/pkg-deps' ); -var file = join( __dirname, 'lib', 'index.js' ); +const file = join( __dirname, 'lib', 'index.js' ); pkgDeps( file, clbk ); diff --git a/lib/node_modules/@stdlib/_tools/npm/pkg-dependents/README.md b/lib/node_modules/@stdlib/_tools/npm/pkg-dependents/README.md index cd302115d381..7eb863a9f2c9 100644 --- a/lib/node_modules/@stdlib/_tools/npm/pkg-dependents/README.md +++ b/lib/node_modules/@stdlib/_tools/npm/pkg-dependents/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dependents = require( '@stdlib/_tools/npm/pkg-dependents' ); +const dependents = require( '@stdlib/_tools/npm/pkg-dependents' ); ``` @@ -82,7 +82,7 @@ The function accepts the following `options`: ```javascript -var dependents = require( '@stdlib/_tools/npm/pkg-dependents' ); +const dependents = require( '@stdlib/_tools/npm/pkg-dependents' ); dependents( '@stdlib/random-base-mt19937', onResponse ); diff --git a/lib/node_modules/@stdlib/_tools/package-json/schema/README.md b/lib/node_modules/@stdlib/_tools/package-json/schema/README.md index 88a7b39e5b48..878a4e3b7d5c 100644 --- a/lib/node_modules/@stdlib/_tools/package-json/schema/README.md +++ b/lib/node_modules/@stdlib/_tools/package-json/schema/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var schema = require( '@stdlib/_tools/package-json/schema' ); +const schema = require( '@stdlib/_tools/package-json/schema' ); ``` #### schema() @@ -45,7 +45,7 @@ var schema = require( '@stdlib/_tools/package-json/schema' ); Returns a [JSON schema][json-schema] for `package.json`. ```javascript -var json = schema(); +const json = schema(); // returns ``` @@ -70,14 +70,14 @@ var json = schema(); ```javascript -var Ajv = require( 'ajv' ); -var schema = require( '@stdlib/_tools/package-json/schema' ); +const Ajv = require( 'ajv' ); +const schema = require( '@stdlib/_tools/package-json/schema' ); -var pkg = require( './package.json' ); -var ajv = new Ajv(); +const pkg = require( './package.json' ); +const ajv = new Ajv(); -var bool = ajv.validate( schema(), pkg ); -var errs = ajv.errors; +const bool = ajv.validate( schema(), pkg ); +const errs = ajv.errors; ``` diff --git a/lib/node_modules/@stdlib/_tools/package-json/standardize/README.md b/lib/node_modules/@stdlib/_tools/package-json/standardize/README.md index 9e6879362c84..0a5af3b41020 100644 --- a/lib/node_modules/@stdlib/_tools/package-json/standardize/README.md +++ b/lib/node_modules/@stdlib/_tools/package-json/standardize/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var standardize = require( '@stdlib/_tools/package-json/standardize' ); +const standardize = require( '@stdlib/_tools/package-json/standardize' ); ``` #### standardize( pkg\[, keys] ) @@ -45,27 +45,27 @@ var standardize = require( '@stdlib/_tools/package-json/standardize' ); Standardizes a `package.json` object. ```javascript -var pkg = { +const pkg = { 'license': 'MIT', 'name': 'beep' }; -var out = standardize( pkg ); +const out = standardize( pkg ); // returns {'name':'beep','license':'MIT'} ``` To specify an alternative key order, provide an array of `keys`. ```javascript -var pkg = { +const pkg = { 'c': 1, 'b': 2, 'a': 3 }; -var keys = [ 'b', 'a', 'c' ]; +const keys = [ 'b', 'a', 'c' ]; -var out = standardize( pkg, keys ); +const out = standardize( pkg, keys ); // returns {'b':2,'a':3,'c':1} ``` @@ -94,10 +94,10 @@ var out = standardize( pkg, keys ); ```javascript -var standardize = require( '@stdlib/_tools/package-json/standardize' ); -var pkg = require( './../package.json' ); +const standardize = require( '@stdlib/_tools/package-json/standardize' ); +const pkg = require( './../package.json' ); -var out = standardize( pkg ); +const out = standardize( pkg ); console.dir( out ); ``` diff --git a/lib/node_modules/@stdlib/_tools/package-json/validate/README.md b/lib/node_modules/@stdlib/_tools/package-json/validate/README.md index 2078b91dcff4..eff8d82d5ba9 100644 --- a/lib/node_modules/@stdlib/_tools/package-json/validate/README.md +++ b/lib/node_modules/@stdlib/_tools/package-json/validate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isValid = require( '@stdlib/_tools/package-json/validate' ); +const isValid = require( '@stdlib/_tools/package-json/validate' ); ``` #### isValid( pkg ) @@ -45,15 +45,15 @@ var isValid = require( '@stdlib/_tools/package-json/validate' ); Validates a `package.json` object. ```javascript -var pkg = { +const pkg = { 'name': 'beep', 'version': '0.0.0' }; -var bool = isValid( pkg ); +const bool = isValid( pkg ); // returns -var errs = isValid.errors; +const errs = isValid.errors; // returns || null ``` @@ -78,12 +78,12 @@ var errs = isValid.errors; ```javascript -var isValid = require( '@stdlib/_tools/package-json/validate' ); +const isValid = require( '@stdlib/_tools/package-json/validate' ); -var pkg = require( './package.json' ); +const pkg = require( './package.json' ); -var bool = isValid( pkg ); -var errs = isValid.errors; +const bool = isValid( pkg ); +const errs = isValid.errors; ``` diff --git a/lib/node_modules/@stdlib/_tools/pkgs/addons/README.md b/lib/node_modules/@stdlib/_tools/pkgs/addons/README.md index ef67d8f192d9..cbaf80694005 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/addons/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/addons/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findAddons = require( '@stdlib/_tools/pkgs/addons' ); +const findAddons = require( '@stdlib/_tools/pkgs/addons' ); ``` #### findAddons( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -71,7 +71,7 @@ function onAddons( error, pkgs ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onAddons( error, pkgs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -111,7 +111,7 @@ function onAddons( error, pkgs ) { Synchronously searches for [add-ons][node-add-ons]. ```javascript -var pkgs = findAddons.sync(); +const pkgs = findAddons.sync(); // returns [...] ``` @@ -139,7 +139,7 @@ The function accepts the same `options` as `findAddons()` above. ```javascript -var findAddons = require( '@stdlib/_tools/pkgs/addons' ); +const findAddons = require( '@stdlib/_tools/pkgs/addons' ); findAddons( onAddons ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/README.md b/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/README.md index bc442a224264..64feaed31224 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/pkgs/browser-compatible' ); +const ls = require( '@stdlib/_tools/pkgs/browser-compatible' ); ``` #### ls( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onList( error, names ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onList( error, names ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onList( error, names ) { Synchronously returns a list of stdlib package names. ```javascript -var names = ls.sync(); +const names = ls.sync(); // returns [...] ``` @@ -140,7 +140,7 @@ The function accepts the same `options` as `ls()` above. ```javascript -var ls = require( '@stdlib/_tools/pkgs/browser-compatible' ); +const ls = require( '@stdlib/_tools/pkgs/browser-compatible' ); ls( onList ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/browser-deps/README.md b/lib/node_modules/@stdlib/_tools/pkgs/browser-deps/README.md index c6572c7dff33..75385e1b83fb 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/browser-deps/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/browser-deps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pkgDeps = require( '@stdlib/_tools/pkgs/browser-deps' ); +const pkgDeps = require( '@stdlib/_tools/pkgs/browser-deps' ); ``` @@ -37,7 +37,7 @@ var pkgDeps = require( '@stdlib/_tools/pkgs/browser-deps' ); Asynchronously resolves package dependencies for use in a browser. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; pkgDeps( pkgs, clbk ); @@ -67,11 +67,11 @@ The function accepts the following `options`: By default, the function resolves packages relative to the current working directory. To resolve relative to an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; pkgDeps( pkgs, opts, clbk ); @@ -88,9 +88,9 @@ function clbk( error, results ) { Synchronously resolves package dependencies for use in a browser. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; -var results = pkgDeps.sync( pkgs ); +const results = pkgDeps.sync( pkgs ); if ( results instanceof Error ) { console.error( results.message ); } else { @@ -111,13 +111,13 @@ The function accepts the same `options` as [`pkgDeps()`](#pkg-deps) above. ```javascript -var resolve = require( 'path' ).resolve; -var pkgDeps = require( '@stdlib/_tools/pkgs/browser-deps' ); +const resolve = require( 'path' ).resolve; +const pkgDeps = require( '@stdlib/_tools/pkgs/browser-deps' ); -var pkg = resolve( __dirname, '../' ); -var pkgs = [ pkg, 'tape' ]; +const pkg = resolve( __dirname, '../' ); +const pkgs = [ pkg, 'tape' ]; -var opts = { +const opts = { 'dev': true }; diff --git a/lib/node_modules/@stdlib/_tools/pkgs/browser-entry-points/README.md b/lib/node_modules/@stdlib/_tools/pkgs/browser-entry-points/README.md index 11d91d64c066..78252c87b60d 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/browser-entry-points/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/browser-entry-points/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var entryPoints = require( '@stdlib/_tools/pkgs/browser-entry-points' ); +const entryPoints = require( '@stdlib/_tools/pkgs/browser-entry-points' ); ``` @@ -37,7 +37,7 @@ var entryPoints = require( '@stdlib/_tools/pkgs/browser-entry-points' ); Asynchronously resolves package browser entry points. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; entryPoints( pkgs, onEntries ); @@ -63,11 +63,11 @@ The function accepts the following `options`: By default, the function resolves packages relative to the current working directory. To resolve relative to an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; entryPoints( pkgs, opts, onEntries ); @@ -84,9 +84,9 @@ function onEntries( error, entries ) { Synchronously resolves package browser entry points. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; -var entries = entryPoints.sync( pkgs ); +const entries = entryPoints.sync( pkgs ); // returns [...] ``` @@ -103,11 +103,11 @@ The function accepts the same `options` as [`entryPoints()`](#entry-points) abov ```javascript -var resolve = require( 'path' ).resolve; -var entryPoints = require( '@stdlib/_tools/pkgs/browser-entry-points' ); +const resolve = require( 'path' ).resolve; +const entryPoints = require( '@stdlib/_tools/pkgs/browser-entry-points' ); -var pkg = resolve( __dirname, '../' ); -var pkgs = [ pkg, 'tape' ]; +const pkg = resolve( __dirname, '../' ); +const pkgs = [ pkg, 'tape' ]; entryPoints( pkgs, onEntries ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/clis/README.md b/lib/node_modules/@stdlib/_tools/pkgs/clis/README.md index a432c1ce0c53..93dcced65812 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/clis/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/clis/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findCLIs = require( '@stdlib/_tools/pkgs/clis' ); +const findCLIs = require( '@stdlib/_tools/pkgs/clis' ); ``` #### findCLIs( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -71,7 +71,7 @@ function onCLIs( error, files ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onCLIs( error, files ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -111,7 +111,7 @@ function onCLIs( error, files ) { Synchronously searches for package command-line interfaces. ```javascript -var files = findCLIs.sync(); +const files = findCLIs.sync(); // returns [...] ``` @@ -140,7 +140,7 @@ The function accepts the same `options` as `findCLIs()` above. ```javascript -var findCLIs = require( '@stdlib/_tools/pkgs/clis' ); +const findCLIs = require( '@stdlib/_tools/pkgs/clis' ); findCLIs( onCLIs ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/cmds/README.md b/lib/node_modules/@stdlib/_tools/pkgs/cmds/README.md index 5486aeee0d1d..ac9f3fbcb318 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/cmds/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/cmds/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findCommands = require( '@stdlib/_tools/pkgs/cmds' ); +const findCommands = require( '@stdlib/_tools/pkgs/cmds' ); ``` #### findCommands( \[options,] clbk ) @@ -58,7 +58,7 @@ To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -77,7 +77,7 @@ To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -96,7 +96,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -121,7 +121,7 @@ Synchronously searches for package command-line interface commands. ```javascript -var files = findCommands.sync(); +const files = findCommands.sync(); // returns [...] ``` @@ -150,10 +150,10 @@ The function accepts the same `options` as `findCommands()` above. ```javascript -var resolve = require( 'path' ).resolve; -var findCommands = require( '@stdlib/_tools/pkgs/cmds' ); +const resolve = require( 'path' ).resolve; +const findCommands = require( '@stdlib/_tools/pkgs/cmds' ); -var opts = { +const opts = { 'dir': resolve( __dirname, '..', '..' ) }; diff --git a/lib/node_modules/@stdlib/_tools/pkgs/dep-list/README.md b/lib/node_modules/@stdlib/_tools/pkgs/dep-list/README.md index 787b599683c1..662bab4ce939 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/dep-list/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/dep-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var depList = require( '@stdlib/_tools/pkgs/dep-list' ); +const depList = require( '@stdlib/_tools/pkgs/dep-list' ); ``` #### depList( pkg\[, options] ) @@ -35,7 +35,7 @@ var depList = require( '@stdlib/_tools/pkgs/dep-list' ); Returns a list of dependencies for a stdlib package. ```javascript -var deps = depList( '@stdlib/assert/is-number' ); +const deps = depList( '@stdlib/assert/is-number' ); // returns [...] ``` @@ -46,11 +46,11 @@ The function accepts the following `options`: To return development dependencies, set the `dev` option to `true`. ```javascript -var opts = { +const opts = { 'dev': true }; -var devDeps = depList( '@stdlib/assert/is-number', opts ); +const devDeps = depList( '@stdlib/assert/is-number', opts ); // returns [...] ``` @@ -71,12 +71,12 @@ var devDeps = depList( '@stdlib/assert/is-number', opts ); ```javascript -var depList = require( '@stdlib/_tools/pkgs/dep-list' ); +const depList = require( '@stdlib/_tools/pkgs/dep-list' ); -var deps = depList( '@stdlib/assert/is-number-array' ); +const deps = depList( '@stdlib/assert/is-number-array' ); // e.g., returns [ '@stdlib/assert/is-number', '@stdlib/assert/tools/array-like-function', '@stdlib/utils/define-nonenumerable-read-only-property' ] -var devDeps = depList( '@stdlib/utils/keys', { +const devDeps = depList( '@stdlib/utils/keys', { 'dev': true }); // e.g., returns [ '@stdlib/assert/has-symbol-support', '@stdlib/assert/is-array', ..., 'proxyquire', 'tape' ] diff --git a/lib/node_modules/@stdlib/_tools/pkgs/deps/README.md b/lib/node_modules/@stdlib/_tools/pkgs/deps/README.md index 5e2b99719c4d..52e929b9aa0b 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/deps/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/deps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pkgDeps = require( '@stdlib/_tools/pkgs/deps' ); +const pkgDeps = require( '@stdlib/_tools/pkgs/deps' ); ``` @@ -37,7 +37,7 @@ var pkgDeps = require( '@stdlib/_tools/pkgs/deps' ); Asynchronously resolves package dependencies. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; pkgDeps( pkgs, clbk ); @@ -66,11 +66,11 @@ The function accepts the following `options`: By default, the function resolves packages relative to the current working directory. To resolve relative to an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; pkgDeps( pkgs, opts, clbk ); @@ -87,9 +87,9 @@ function clbk( error, results ) { Synchronously resolves package dependencies. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; -var results = pkgDeps.sync( pkgs ); +const results = pkgDeps.sync( pkgs ); // returns [...] ``` @@ -106,13 +106,13 @@ The function accepts the same `options` as [`pkgDeps()`](#pkg-deps) above. ```javascript -var resolve = require( 'path' ).resolve; -var pkgDeps = require( '@stdlib/_tools/pkgs/deps' ); +const resolve = require( 'path' ).resolve; +const pkgDeps = require( '@stdlib/_tools/pkgs/deps' ); -var pkg = resolve( __dirname, '../' ); -var pkgs = [ pkg, 'tape' ]; +const pkg = resolve( __dirname, '../' ); +const pkgs = [ pkg, 'tape' ]; -var opts = { +const opts = { 'dev': true }; diff --git a/lib/node_modules/@stdlib/_tools/pkgs/entry-points/README.md b/lib/node_modules/@stdlib/_tools/pkgs/entry-points/README.md index d858d82937f9..238471ecb762 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/entry-points/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/entry-points/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var entryPoints = require( '@stdlib/_tools/pkgs/entry-points' ); +const entryPoints = require( '@stdlib/_tools/pkgs/entry-points' ); ``` @@ -37,7 +37,7 @@ var entryPoints = require( '@stdlib/_tools/pkgs/entry-points' ); Asynchronously resolves package entry points. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; entryPoints( pkgs, onEntries ); @@ -63,11 +63,11 @@ The function accepts the following `options`: By default, the function resolves packages relative to the current working directory. To resolve relative to an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; entryPoints( pkgs, opts, onEntries ); @@ -84,9 +84,9 @@ function onEntries( error, entries ) { Synchronously resolves package entry points. ```javascript -var pkgs = [ 'tape', 'browserify' ]; +const pkgs = [ 'tape', 'browserify' ]; -var entries = entryPoints.sync( pkgs ); +const entries = entryPoints.sync( pkgs ); // returns [...] ``` @@ -103,11 +103,11 @@ The function accepts the same `options` as [`entryPoints()`](#entry-points) abov ```javascript -var resolve = require( 'path' ).resolve; -var entryPoints = require( '@stdlib/_tools/pkgs/entry-points' ); +const resolve = require( 'path' ).resolve; +const entryPoints = require( '@stdlib/_tools/pkgs/entry-points' ); -var pkg = resolve( __dirname, '../' ); -var pkgs = [ pkg, 'tape' ]; +const pkg = resolve( __dirname, '../' ); +const pkgs = [ pkg, 'tape' ]; entryPoints( pkgs, onEntries ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/find/README.md b/lib/node_modules/@stdlib/_tools/pkgs/find/README.md index 036d7d962403..b5b87b1fdc5c 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/find/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/find/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findPkgs = require( '@stdlib/_tools/pkgs/find' ); +const findPkgs = require( '@stdlib/_tools/pkgs/find' ); ``` #### findPkgs( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -71,7 +71,7 @@ function onPkgs( error, pkgs ) { By default, the implementation searches for packages by finding `package.json` files. To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onPkgs( error, pkgs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -111,7 +111,7 @@ function onPkgs( error, pkgs ) { Synchronously searches for packages. ```javascript -var pkgs = findPkgs.sync(); +const pkgs = findPkgs.sync(); // returns [...] ``` @@ -128,7 +128,7 @@ The function accepts the same `options` as `findPkgs()` above. ```javascript -var findPkgs = require( '@stdlib/_tools/pkgs/find' ); +const findPkgs = require( '@stdlib/_tools/pkgs/find' ); findPkgs( onPkgs ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/includes/README.md b/lib/node_modules/@stdlib/_tools/pkgs/includes/README.md index 4e4bb70ccdaf..7c8a57b2813c 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/includes/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/includes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findIncludes = require( '@stdlib/_tools/pkgs/includes' ); +const findIncludes = require( '@stdlib/_tools/pkgs/includes' ); ``` #### findIncludes( \[options,] clbk ) @@ -58,7 +58,7 @@ To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -77,7 +77,7 @@ To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -96,7 +96,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -121,7 +121,7 @@ Synchronously searches for package `include` directories. ```javascript -var dirs = findIncludes.sync(); +const dirs = findIncludes.sync(); // returns [...] ``` @@ -151,7 +151,7 @@ The function accepts the same `options` as `findIncludes()` above. ```javascript -var findIncludes = require( '@stdlib/_tools/pkgs/includes' ); +const findIncludes = require( '@stdlib/_tools/pkgs/includes' ); findIncludes( onDirs ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md index b6e9a3613625..d660ee314896 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var pkgs = require( '@stdlib/_tools/pkgs/installed' ); +const pkgs = require( '@stdlib/_tools/pkgs/installed' ); ``` #### pkgs( \[options], clbk ) @@ -60,7 +60,7 @@ The function accepts the following `options`: By default, the function searches the entire package dependency tree. To limit the search depth, set the `depth` option. ```javascript -var opts = { +const opts = { 'depth': 0 // search only top-level installed packages }; @@ -77,7 +77,7 @@ function onPkgs( error, list ) { To exclude development package dependencies, set the `dev` option to `false`. ```javascript -var opts = { +const opts = { 'dev': false }; diff --git a/lib/node_modules/@stdlib/_tools/pkgs/name2bucket/README.md b/lib/node_modules/@stdlib/_tools/pkgs/name2bucket/README.md index f53e61616995..2169b1704d4d 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/name2bucket/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/name2bucket/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var name2bucket = require( '@stdlib/_tools/pkgs/name2bucket' ); +const name2bucket = require( '@stdlib/_tools/pkgs/name2bucket' ); ``` #### name2bucket( name, buckets ) @@ -35,18 +35,18 @@ var name2bucket = require( '@stdlib/_tools/pkgs/name2bucket' ); Deterministically converts a package `name` (or a list of package names) to a bucket. ```javascript -var out = name2bucket( '@stdlib/math/base/special/sin', 10 ); +const out = name2bucket( '@stdlib/math/base/special/sin', 10 ); // returns ``` To convert more than one package `name`, provide a list of package names. ```javascript -var list = [ +const list = [ '@stdlib/math/base/special/sin', '@stdlib/math/base/special/cos' ]; -var out = name2bucket( list, 10 ); +const out = name2bucket( list, 10 ); // returns [ , ] ``` @@ -61,14 +61,14 @@ var out = name2bucket( list, 10 ); - The function maps standalone and non-standalone `stdlib` packages to the same bucket. ```javascript - var list = [ + const list = [ '@stdlib/math/base/special/sin', '@stdlib/math-base-special-sin' ]; - var out = name2bucket( list, 10 ); + const out = name2bucket( list, 10 ); // returns [...] - var bool = ( out[ 0 ] === out[ 1 ] ); + const bool = ( out[ 0 ] === out[ 1 ] ); // returns true ``` @@ -83,33 +83,33 @@ var out = name2bucket( list, 10 ); ```javascript -var join = require( 'path' ).join; -var pkgNames = require( '@stdlib/_tools/pkgs/names' ).sync; -var rootDir = require( '@stdlib/_tools/utils/root-dir' ); -var chi2gof = require( '@stdlib/stats/chi2gof' ); -var countBy = require( '@stdlib/utils/count-by' ); -var objectValues = require( '@stdlib/utils/values' ); -var identity = require( '@stdlib/utils/identity-function' ); -var name2bucket = require( '@stdlib/_tools/pkgs/name2bucket' ); +const join = require( 'path' ).join; +const pkgNames = require( '@stdlib/_tools/pkgs/names' ).sync; +const rootDir = require( '@stdlib/_tools/utils/root-dir' ); +const chi2gof = require( '@stdlib/stats/chi2gof' ); +const countBy = require( '@stdlib/utils/count-by' ); +const objectValues = require( '@stdlib/utils/values' ); +const identity = require( '@stdlib/utils/identity-function' ); +const name2bucket = require( '@stdlib/_tools/pkgs/name2bucket' ); // Resolve a namespace directory: -var dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); +const dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); // Resolve a list of package names: -var names = pkgNames({ +const names = pkgNames({ 'dir': dir }); // Place the names into 10 buckets: -var out = name2bucket( names, 10 ); +const out = name2bucket( names, 10 ); console.log( out.join( '\n' ) ); // Count the number of names in each bin: -var counts = countBy( out, identity ); +const counts = countBy( out, identity ); console.log( counts ); // Determine whether the names are uniformly distributed: -var o = chi2gof( objectValues( counts ), 'discrete-uniform', 0, 9 ); +const o = chi2gof( objectValues( counts ), 'discrete-uniform', 0, 9 ); console.log( o.toString() ); ``` diff --git a/lib/node_modules/@stdlib/_tools/pkgs/name2standalone/README.md b/lib/node_modules/@stdlib/_tools/pkgs/name2standalone/README.md index 3e2c4a1eeafe..a1e41d8e976f 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/name2standalone/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/name2standalone/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); +const name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); ``` #### name2standalone( name ) @@ -35,18 +35,18 @@ var name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); Converts a stdlib package `name` (or a list of package names) to a standalone package name. ```javascript -var out = name2standalone( '@stdlib/math/base/special/sin' ); +const out = name2standalone( '@stdlib/math/base/special/sin' ); // returns '@stdlib/math-base-special-sin' ``` To convert more than one stdlib package `name`, provide a list of package names. ```javascript -var list = [ +const list = [ '@stdlib/math/base/special/sin', '@stdlib/math/base/special/cos' ]; -var out = name2standalone( list ); +const out = name2standalone( list ); // returns [ '@stdlib/math-base-special-sin', '@stdlib/math-base-special-cos' ] ``` @@ -61,7 +61,7 @@ var out = name2standalone( list ); - Non-stdlib package names are returned unchanged. ```javascript - var out = name2standalone( 'tape' ); + const out = name2standalone( 'tape' ); // returns 'tape' ``` @@ -76,21 +76,21 @@ var out = name2standalone( list ); ```javascript -var join = require( 'path' ).join; -var pkgNames = require( '@stdlib/_tools/pkgs/names' ).sync; -var rootDir = require( '@stdlib/_tools/utils/root-dir' ); -var name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); +const join = require( 'path' ).join; +const pkgNames = require( '@stdlib/_tools/pkgs/names' ).sync; +const rootDir = require( '@stdlib/_tools/utils/root-dir' ); +const name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); // Resolve a namespace directory: -var dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); +const dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); // Resolve a list of package names: -var names = pkgNames({ +const names = pkgNames({ 'dir': dir }); // Convert to standalone package names: -var out = name2standalone( names ); +const out = name2standalone( names ); console.log( out.join( '\n' ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/pkgs/names/README.md b/lib/node_modules/@stdlib/_tools/pkgs/names/README.md index 1efd84719ab0..3afcd54eac47 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/names/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/names/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/pkgs/names' ); +const ls = require( '@stdlib/_tools/pkgs/names' ); ``` #### ls( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onList( error, names ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onList( error, names ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onList( error, names ) { Synchronously returns a list of stdlib package names. ```javascript -var names = ls.sync(); +const names = ls.sync(); // returns [...] ``` @@ -140,7 +140,7 @@ The function accepts the same `options` as `ls()` above. ```javascript -var ls = require( '@stdlib/_tools/pkgs/names' ); +const ls = require( '@stdlib/_tools/pkgs/names' ); ls( onList ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/README.md b/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/README.md index 6a0645fdee2f..81218b3f6021 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); +const namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); ``` #### namespaceDeps( pkg\[, options] ) @@ -35,7 +35,7 @@ var namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); Returns a list of production namespace dependencies for a specified stdlib package. ```javascript -var deps = namespaceDeps( '@stdlib/assert' ); +const deps = namespaceDeps( '@stdlib/assert' ); // returns [...] ``` @@ -47,10 +47,10 @@ The function accepts the following `options`: By default, the package returns top-level stdlib namespace package dependencies. To retrieve namespace dependencies for a different level of the stdlib package tree, set the `level` option. ```javascript -var deps = namespaceDeps( '@stdlib/regexp' ); +let deps = namespaceDeps( '@stdlib/regexp' ); // e.g., returns [ '@stdlib/assert', '@stdlib/utils', ... ] -var opts = { +const opts = { 'level': 20 }; deps = namespaceDeps( '@stdlib/regexp', opts ); @@ -60,11 +60,11 @@ deps = namespaceDeps( '@stdlib/regexp', opts ); To return development dependencies instead of production dependencies, set the `dev` option to `true`. ```javascript -var opts = { +const opts = { 'dev': true }; -var devDeps = namespaceDeps( '@stdlib/assert', opts ); +const devDeps = namespaceDeps( '@stdlib/assert', opts ); // returns [...] ``` @@ -85,12 +85,12 @@ var devDeps = namespaceDeps( '@stdlib/assert', opts ); ```javascript -var namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); +const namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); -var deps = namespaceDeps( '@stdlib/assert' ); +const deps = namespaceDeps( '@stdlib/assert' ); // e.g., returns [ '@stdlib/types', '@stdlib/utils', ..., '@stdlib/ndarray', '@stdlib/number' ] -var devDeps = namespaceDeps( '@stdlib/assert', { +const devDeps = namespaceDeps( '@stdlib/assert', { 'dev': true }); // e.g., returns [ '@stdlib/array', '@stdlib/bench', ..., '@stdlib/symbol', 'proxyquire' ] diff --git a/lib/node_modules/@stdlib/_tools/pkgs/namespace-readmes/README.md b/lib/node_modules/@stdlib/_tools/pkgs/namespace-readmes/README.md index 1c5037fe2be8..ea9cb0395987 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/namespace-readmes/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/namespace-readmes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findREADMEs = require( '@stdlib/_tools/pkgs/namespace-readmes' ); +const findREADMEs = require( '@stdlib/_tools/pkgs/namespace-readmes' ); ``` #### findREADMEs( \[options,] clbk ) @@ -56,7 +56,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -73,7 +73,7 @@ function onFiles( error, files ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -92,7 +92,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -117,7 +117,7 @@ Synchronously searches for namespace package READMEs. ```javascript -var files = findREADMEs.sync(); +const files = findREADMEs.sync(); // returns [...] ``` @@ -149,7 +149,7 @@ The function accepts the same `options` as `findREADMEs()` above. ```javascript -var findREADMEs = require( '@stdlib/_tools/pkgs/namespace-readmes' ); +const findREADMEs = require( '@stdlib/_tools/pkgs/namespace-readmes' ); findREADMEs( onFiles ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/namespaces/README.md b/lib/node_modules/@stdlib/_tools/pkgs/namespaces/README.md index acc52cf11dba..f77f093f1bb7 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/namespaces/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/namespaces/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/pkgs/namespaces' ); +const ls = require( '@stdlib/_tools/pkgs/namespaces' ); ``` #### ls( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onList( error, names ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onList( error, names ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onList( error, names ) { Synchronously returns a list of stdlib namespaces. ```javascript -var names = ls.sync(); +const names = ls.sync(); // returns [...] ``` @@ -141,7 +141,7 @@ The function accepts the same `options` as `ls()` above. ```javascript -var ls = require( '@stdlib/_tools/pkgs/namespaces' ); +const ls = require( '@stdlib/_tools/pkgs/namespaces' ); ls( onList ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/readmes/README.md b/lib/node_modules/@stdlib/_tools/pkgs/readmes/README.md index dd1241995feb..20bd28db9bda 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/readmes/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/readmes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findREADMEs = require( '@stdlib/_tools/pkgs/readmes' ); +const findREADMEs = require( '@stdlib/_tools/pkgs/readmes' ); ``` #### findREADMEs( \[options,] clbk ) @@ -56,7 +56,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -73,7 +73,7 @@ function onFiles( error, files ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -92,7 +92,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -117,7 +117,7 @@ Synchronously searches for package READMEs. ```javascript -var files = findREADMEs.sync(); +const files = findREADMEs.sync(); // returns [...] ``` @@ -146,7 +146,7 @@ The function accepts the same `options` as `findREADMEs()` above. ```javascript -var findREADMEs = require( '@stdlib/_tools/pkgs/readmes' ); +const findREADMEs = require( '@stdlib/_tools/pkgs/readmes' ); findREADMEs( onFiles ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/repl-help/README.md b/lib/node_modules/@stdlib/_tools/pkgs/repl-help/README.md index 421b8067bb34..c8e6b1e08080 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/repl-help/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/repl-help/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findREPLHelp = require( '@stdlib/_tools/pkgs/repl-help' ); +const findREPLHelp = require( '@stdlib/_tools/pkgs/repl-help' ); ``` #### findREPLHelp( \[options,] clbk ) @@ -57,7 +57,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -74,7 +74,7 @@ function onFiles( error, files ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -93,7 +93,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -118,7 +118,7 @@ Synchronously searches for package REPL help files. ```javascript -var files = findREPLHelp.sync(); +const files = findREPLHelp.sync(); // returns [...] ``` @@ -143,7 +143,7 @@ The function accepts the same `options` as `findREPLHelp()` above. ```javascript -var findREPLHelp = require( '@stdlib/_tools/pkgs/repl-help' ); +const findREPLHelp = require( '@stdlib/_tools/pkgs/repl-help' ); findREPLHelp( onFiles ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/standalones/README.md b/lib/node_modules/@stdlib/_tools/pkgs/standalones/README.md index c1f5953323ec..8fd9ab2d4841 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/standalones/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/standalones/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/pkgs/standalones' ); +const ls = require( '@stdlib/_tools/pkgs/standalones' ); ``` #### ls( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onList( error, names ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onList( error, names ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onList( error, names ) { Synchronously returns a list of stdlib standalone package names. ```javascript -var names = ls.sync(); +const names = ls.sync(); // returns [...] ``` @@ -140,7 +140,7 @@ The function accepts the same `options` as `ls()` above. ```javascript -var ls = require( '@stdlib/_tools/pkgs/standalones' ); +const ls = require( '@stdlib/_tools/pkgs/standalones' ); ls( onList ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/toposort/README.md b/lib/node_modules/@stdlib/_tools/pkgs/toposort/README.md index a9fa5cd580c1..2cca964d27fa 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/toposort/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/toposort/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ls = require( '@stdlib/_tools/pkgs/toposort' ); +const ls = require( '@stdlib/_tools/pkgs/toposort' ); ``` #### ls( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onList( error, names ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onList( error, names ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onList( error, names ) { Synchronously topologically sorts stdlib packages. ```javascript -var names = ls.sync(); +const names = ls.sync(); // returns [...] ``` @@ -141,9 +141,9 @@ The function accepts the same `options` as `ls()` above. ```javascript -var ls = require( '@stdlib/_tools/pkgs/toposort' ); +const ls = require( '@stdlib/_tools/pkgs/toposort' ); -var opts = { +const opts = { 'ignore': [ '**/_tools/**' ] diff --git a/lib/node_modules/@stdlib/_tools/pkgs/tree/README.md b/lib/node_modules/@stdlib/_tools/pkgs/tree/README.md index dcb878293837..f82b6974dd0d 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/tree/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/tree/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pkgTree = require( '@stdlib/_tools/pkgs/tree' ); +const pkgTree = require( '@stdlib/_tools/pkgs/tree' ); ``` #### pkgTree( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from a descendant directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': './@stdlib/math/base' }; @@ -71,7 +71,7 @@ function onTree( error, tree ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onTree( error, tree ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -112,7 +112,7 @@ function onTree( error, tree ) { Synchronously generates a package tree. ```javascript -var tree = pkgTree.sync(); +const tree = pkgTree.sync(); // returns {...} ``` @@ -140,7 +140,7 @@ The function accepts the same `options` as `pkgTree()` above. ```javascript -var pkgTree = require( '@stdlib/_tools/pkgs/tree' ); +const pkgTree = require( '@stdlib/_tools/pkgs/tree' ); pkgTree( onTree ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/types/README.md b/lib/node_modules/@stdlib/_tools/pkgs/types/README.md index e729d9ee0609..5836230d51c9 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/types/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/types/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findTypes = require( '@stdlib/_tools/pkgs/types' ); +const findTypes = require( '@stdlib/_tools/pkgs/types' ); ``` #### findTypes( \[options,] clbk ) @@ -56,7 +56,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -73,7 +73,7 @@ function onPkgs( error, pkgs ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -92,7 +92,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -117,7 +117,7 @@ Synchronously searches for packages containing TypeScript declarations. ```javascript -var pkgs = findTypes.sync(); +const pkgs = findTypes.sync(); // returns [...] ``` @@ -145,7 +145,7 @@ The function accepts the same `options` as `findTypes()` above. ```javascript -var findTypes = require( '@stdlib/_tools/pkgs/types' ); +const findTypes = require( '@stdlib/_tools/pkgs/types' ); findTypes( onPkgs ); diff --git a/lib/node_modules/@stdlib/_tools/pkgs/wasm/README.md b/lib/node_modules/@stdlib/_tools/pkgs/wasm/README.md index fe5e2f665a57..158edb0b0461 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/wasm/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var findWASM = require( '@stdlib/_tools/pkgs/wasm' ); +const findWASM = require( '@stdlib/_tools/pkgs/wasm' ); ``` #### findWASM( \[options,] clbk ) @@ -54,7 +54,7 @@ The function accepts the following `options`: To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -71,7 +71,7 @@ function onPkgs( error, pkgs ) { To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -88,7 +88,7 @@ function onPkgs( error, pkgs ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -111,7 +111,7 @@ function onPkgs( error, pkgs ) { Synchronously searches for packages containing [WebAssembly][webassembly]. ```javascript -var pkgs = findWASM.sync(); +const pkgs = findWASM.sync(); // e.g., returns [...] ``` @@ -139,7 +139,7 @@ The function accepts the same `options` as `findWASM()` above. ```javascript -var findWASM = require( '@stdlib/_tools/pkgs/wasm' ); +const findWASM = require( '@stdlib/_tools/pkgs/wasm' ); findWASM( onPkgs ); diff --git a/lib/node_modules/@stdlib/_tools/readme/to-html/README.md b/lib/node_modules/@stdlib/_tools/readme/to-html/README.md index 8d6ca1dab6d5..678f2b74faa5 100644 --- a/lib/node_modules/@stdlib/_tools/readme/to-html/README.md +++ b/lib/node_modules/@stdlib/_tools/readme/to-html/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var convert = require( '@stdlib/_tools/readme/to-html' ); +const convert = require( '@stdlib/_tools/readme/to-html' ); ``` #### convert( filepath, \[options,] clbk ) @@ -45,7 +45,7 @@ var convert = require( '@stdlib/_tools/readme/to-html' ); Converts a package Markdown README file to HTML. ```javascript -var file = '/foo/bar/README.md'; +const file = '/foo/bar/README.md'; convert( file, clbk ); @@ -72,9 +72,9 @@ The function accepts the following `options`: To specify an output file path, set the `out` option. ```javascript -var file = '/foo/bar/README.md'; +const file = '/foo/bar/README.md'; -var opts = { +const opts = { 'out': '/foo/bar/test.html' }; @@ -90,9 +90,9 @@ function clbk( error ) { To generate **only** an HTML fragment (i.e., equivalent of directly converting a Markdown file to HTML), set the `fragment` option to `true`. ```javascript -var file = '/foo/bar/README.md'; +const file = '/foo/bar/README.md'; -var opts = { +const opts = { 'fragment': true }; @@ -129,11 +129,11 @@ To understand how other `options` affect HTML output, see the HTML template in ` ```javascript -var resolve = require( 'path' ).resolve; -var convert = require( '@stdlib/_tools/readme/to-html' ); +const resolve = require( 'path' ).resolve; +const convert = require( '@stdlib/_tools/readme/to-html' ); -var fpath = resolve( __dirname, '..', 'README.md' ); -var opts = { +const fpath = resolve( __dirname, '..', 'README.md' ); +const opts = { 'title': 'Beep', 'source': 'https://github.com/stdlib-js/stdlib/develop/tools/readme/to-html/lib/index.js', 'append': '' diff --git a/lib/node_modules/@stdlib/_tools/release/package-json/README.md b/lib/node_modules/@stdlib/_tools/release/package-json/README.md index 971412e80115..4dd415ad1f36 100644 --- a/lib/node_modules/@stdlib/_tools/release/package-json/README.md +++ b/lib/node_modules/@stdlib/_tools/release/package-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var prepare = require( '@stdlib/_tools/release/package-json' ); +const prepare = require( '@stdlib/_tools/release/package-json' ); ``` #### prepare( pkgName\[, options] ) @@ -45,7 +45,7 @@ var prepare = require( '@stdlib/_tools/release/package-json' ); Prepares the `package.json` of a package for individual release. ```javascript -var out = prepare( '@stdlib/assert/is-object-array' ); +const out = prepare( '@stdlib/assert/is-object-array' ); // returns {...} ``` @@ -56,7 +56,7 @@ The function accepts the following `options`: To specify development dependencie to be added to the generated `package.json`, supply an array of dependency names for the `devDependencies` option: ```javascript -var out = prepare( '@stdlib/assert/is-object-array', { +const out = prepare( '@stdlib/assert/is-object-array', { 'devDependencies': [ 'tape' ] }); // returns {...} @@ -83,9 +83,9 @@ var out = prepare( '@stdlib/assert/is-object-array', { ```javascript -var prepare = require( '@stdlib/_tools/release/package-json' ); +const prepare = require( '@stdlib/_tools/release/package-json' ); -var out = prepare( '@stdlib/plot/ctor', { +const out = prepare( '@stdlib/plot/ctor', { 'devDependencies': [ 'tape' ] diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations-src-urls/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations-src-urls/README.md index ab34c472d496..b6017f9abbd9 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations-src-urls/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations-src-urls/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var insertURLs = require( '@stdlib/_tools/remark/plugins/remark-img-equations-src-urls' ); +const insertURLs = require( '@stdlib/_tools/remark/plugins/remark-img-equations-src-urls' ); ``` #### insertURLs( options ) @@ -35,7 +35,7 @@ var insertURLs = require( '@stdlib/_tools/remark/plugins/remark-img-equations-sr Attaches a plugin to a [remark][remark] processor in order to insert source URLs for equation images into Markdown equation elements. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); remark().use( insertURLs ); ``` @@ -48,9 +48,9 @@ The plugin accepts the following `options`: By default, the plugin attempts to resolve equation images relative to each processed Markdown file. The default directory is `./docs/img/`. To specify an alternative directory, including an absolute directory, set the `dir` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'dir': '/path/to/absolute/dir/with/svg/equations' }; @@ -60,9 +60,9 @@ remark().use( insertURLs, opts ); By default, the plugin assumes equation image files are prefixed with `equation_`. To specify an alternative prefix, set the `prefix` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'prefix': '' // <= no prefix }; @@ -102,23 +102,23 @@ remark().use( insertURLs, opts ); ```javascript -var join = require( 'path' ).join; -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var insertURLs = require( '@stdlib/_tools/remark/plugins/remark-img-equations-src-urls' ); +const join = require( 'path' ).join; +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const insertURLs = require( '@stdlib/_tools/remark/plugins/remark-img-equations-src-urls' ); // Load a Markdown file... -var fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); -var vfile = toVFile.readSync( fpath ); +const fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); +const vfile = toVFile.readSync( fpath ); // Specify the directory containing equation images: -var opts = { +const opts = { 'dir': './docs/img/', // relative to Markdown file, 'prefix': '' // no prefix }; // Insert src URLs: -var out = remark().use( insertURLs, opts ).processSync( vfile ); +const out = remark().use( insertURLs, opts ).processSync( vfile ); // Output the results: console.log( out.contents ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/README.md index aed024d3d2f5..2acc7ba5a2aa 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var insertEquations = require( '@stdlib/_tools/remark/plugins/remark-img-equations' ); +const insertEquations = require( '@stdlib/_tools/remark/plugins/remark-img-equations' ); ``` #### insertEquations() @@ -37,15 +37,15 @@ Attaches a plugin to a [remark][remark] processor in order to insert Markdown im ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var str = 'The absolute value is defined as'; +let str = 'The absolute value is defined as'; str += '\n'; str += '\n'; str += '\n'; str += ''; -var vfile = remark().use( insertEquations ).processSync( str ); +const vfile = remark().use( insertEquations ).processSync( str ); console.log( vfile.contents ); /* => @@ -73,20 +73,20 @@ console.log( vfile.contents ); ```javascript -var join = require( 'path' ).join; -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var insertEquations = require( '@stdlib/_tools/remark/plugins/remark-img-equations' ); +const join = require( 'path' ).join; +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const insertEquations = require( '@stdlib/_tools/remark/plugins/remark-img-equations' ); // Load a Markdown file... -var fpath = join( __dirname, 'fixtures/simple.md' ); -var opts = { +const fpath = join( __dirname, 'fixtures/simple.md' ); +const opts = { 'encoding': 'utf8' }; -var file = readFileSync( fpath, opts ); +const file = readFileSync( fpath, opts ); // Insert equations: -var out = remark().use( insertEquations ).processSync( file ); +const out = remark().use( insertEquations ).processSync( file ); ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-equations/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-equations/README.md index c99bcedef592..15dd9ba41abf 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-equations/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-equations/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lint = require( '@stdlib/_tools/remark/plugins/remark-lint-equations' ); +const lint = require( '@stdlib/_tools/remark/plugins/remark-lint-equations' ); ``` #### lint() @@ -37,18 +37,17 @@ Attaches a [remark][remark] plugin which, when provided a Markdown abstract synt ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var str = '\n\n'; +const str = '\n\n'; remark().use( lint ).process( str, done ); function done( error, file ) { - var i; if ( error ) { throw error; } - for ( i = 0; i < file.messages.length; i++ ) { + for ( let i = 0; i < file.messages.length; i++ ) { console.error( file.messages[ i ].message ); } } @@ -73,24 +72,23 @@ function done( error, file ) { ```javascript -var join = require( 'path' ).join; -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var lint = require( '@stdlib/_tools/remark/plugins/remark-lint-equations' ); +const join = require( 'path' ).join; +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const lint = require( '@stdlib/_tools/remark/plugins/remark-lint-equations' ); // Load a Markdown file: -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var file = readFileSync( fpath ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const file = readFileSync( fpath ); // Lint equations: remark().use( lint ).process( file.toString(), done ); function done( error, file ) { - var i; if ( error ) { throw error; } - for ( i = 0; i < file.messages.length; i++ ) { + for ( let i = 0; i < file.messages.length; i++ ) { console.error( file.messages[ i ].message ); } } diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-eslint/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-eslint/README.md index 097826b6dbb3..a33fd8fdbdbe 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-eslint/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-eslint/README.md @@ -27,35 +27,39 @@ limitations under the License. ## Usage ```javascript -var plugin = require( '@stdlib/_tools/remark/plugins/remark-lint-eslint' ); +const plugin = require( '@stdlib/_tools/remark/plugins/remark-lint-eslint' ); ``` #### plugin() A [remark][remark] plugin which, when provided a Markdown abstract syntax `tree`, lints JavaScript code blocks using the default [ESLint][eslint] configuration. + + ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); // Create a synchronous Markdown text linter: -var linter = remark().use( plugin ).processSync; +const linter = remark().use( plugin ).processSync; // Lint Markdown: -var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); +const vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ``` #### plugin.factory( \[options] ) Returns a configured [remark][remark] plugin for linting JavaScript code blocks. + + ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); // Create a synchronous Markdown text linter: -var linter = remark().use( plugin.factory() ).processSync; +const linter = remark().use( plugin.factory() ).processSync; // Lint Markdown: -var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); +const vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ``` The function recognizes the following `options`: @@ -66,22 +70,24 @@ To specify configuration `options`, set the respective properties. + + ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); // Define options: -var opts = { +const opts = { 'config': '/path/to/.eslintrc' }; // Create a plugin: -var lint = plugin.factory( opts ); +const lint = plugin.factory( opts ); // Create a synchronous Markdown text linter: -var linter = remark().use( lint ).processSync; +const linter = remark().use( lint ).processSync; // Lint Markdown: -var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); +const vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ``` @@ -103,9 +109,9 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); - var arr = [ 1, , , 4, 5 ]; + const arr = [ 1, , , 4, 5 ]; ``` The plugin supports multiple consecutive comments. @@ -119,9 +125,9 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); - var arr = [ 1, , , 4, 5 ]; + const arr = [ 1, , , 4, 5 ]; ``` Prior to linting, the plugin converts the content of each HTML comment to a JavaScript comment and prepends each comment to the content inside the code block. Accordingly, the plugin would transform the above example to @@ -135,9 +141,9 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript /* eslint-disable no-new-wrappers */ /* eslint-disable no-sparse-arrays */ - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); - var arr = [ 1, , , 4, 5 ]; + const arr = [ 1, , , 4, 5 ]; ``` - Configuration comments **only** apply to a code block which follows immediately after. Hence, the plugin does **not** apply the following configuration comment to a subsequent code block. @@ -149,7 +155,7 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); Beep boop. ```javascript - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); ``` - The plugin lints each code block separately, and configuration comments are **not** shared between code blocks. Thus, one must repeat configuration comments for each code block. @@ -161,7 +167,7 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); ``` Boop. @@ -169,7 +175,7 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript - var x = new Number( -3.14 ); + const x = new Number( -3.14 ); ``` - To skip linting for a particular code block, use the **non-standard** comment ``. @@ -181,7 +187,7 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript - var x = new Number( 3.14 ); + const x = new Number( 3.14 ); ``` For skipped code blocks, the plugin reports neither rule nor syntax errors. @@ -201,29 +207,29 @@ var vfile = linter( '```javascript\nvar beep = \'boop\';\n```' ); ```javascript -var join = require( 'path' ).join; -var resolve = require( 'path' ).resolve; -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var factory = require( '@stdlib/_tools/remark/plugins/remark-lint-eslint' ).factory; +const join = require( 'path' ).join; +const resolve = require( 'path' ).resolve; +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const factory = require( '@stdlib/_tools/remark/plugins/remark-lint-eslint' ).factory; // Define path to an ESLint config file: -var config = resolve( __dirname, '..', '..', '..', '..', '..', '..', '..', 'etc', 'eslint', '.eslintrc.markdown.js' ); +const config = resolve( __dirname, '..', '..', '..', '..', '..', '..', '..', 'etc', 'eslint', '.eslintrc.markdown.js' ); // Load a Markdown file: -var fpath = join( __dirname, 'examples', 'fixtures', 'file.md' ); -var file = readFileSync( fpath ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.md' ); +const file = readFileSync( fpath ); // Define plugin options: -var opts = { +const opts = { 'config': config }; // Create a plugin: -var plugin = factory( opts ); +const plugin = factory( opts ); // Lint code blocks: -var out = remark().use( plugin ).processSync( file.toString() ); +const out = remark().use( plugin ).processSync( file.toString() ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/README.md index 8d81b71acb53..4dbd04a3957f 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); +const insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); ``` #### insertTOC() @@ -35,10 +35,10 @@ var insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); Attaches a plugin to a [remark][remark] processor in order to insert a namespace table of contents. ```javascript -var remark = require( 'remark' ); -var insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); +const remark = require( 'remark' ); +const insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); -var transform = remark().use( insertTOC ).processSync; +const transform = remark().use( insertTOC ).processSync; ``` @@ -52,17 +52,17 @@ var transform = remark().use( insertTOC ).processSync; ```javascript -var join = require( 'path' ).join; -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); +const join = require( 'path' ).join; +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const insertTOC = require( '@stdlib/_tools/remark/plugins/remark-namespace-toc' ); // Load a Markdown file... -var fpath = join( __dirname, 'examples', 'fixtures', 'README.md' ); -var vfile = toVFile.readSync( fpath ); +const fpath = join( __dirname, 'examples', 'fixtures', 'README.md' ); +const vfile = toVFile.readSync( fpath ); // Insert table of contents: -var out = remark().use( insertTOC ).processSync( vfile ); +const out = remark().use( insertTOC ).processSync( vfile ); // Print the results: console.log( out.contents ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/README.md index d6d3c00520f0..88dedcfca2ad 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fmath = require( '@stdlib/math/base/special/fast' ); +const fmath = require( '@stdlib/math/base/special/fast' ); ``` #### fmath @@ -35,7 +35,7 @@ var fmath = require( '@stdlib/math/base/special/fast' ); Standard library fast math special functions. ```javascript -var fcns = fmath; +const fcns = fmath; // returns {...} ``` @@ -60,8 +60,8 @@ var fcns = fmath; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var fmath = require( '@stdlib/math/base/special/fast' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const fmath = require( '@stdlib/math/base/special/fast' ); console.log( objectKeys( fmath ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md index ae85e0007f2d..99e5e40bd27b 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var asinh = require( '@stdlib/math/base/special/fast/asinh' ); +const asinh = require( '@stdlib/math/base/special/fast/asinh' ); ``` #### asinh( x ) @@ -39,7 +39,7 @@ Computes the [hyperbolic arcsine][inverse-hyperbolic] of a `number` (in radians) ```javascript -var v = asinh( 0.0 ); +let v = asinh( 0.0 ); // returns 0.0 v = asinh( -0.0 ); @@ -74,7 +74,7 @@ v = asinh( Infinity ); ```javascript - var v = asinh( 1.0e200 ); + const v = asinh( 1.0e200 ); // returns Infinity // (expected 461.2101657793691) ``` @@ -84,7 +84,7 @@ v = asinh( Infinity ); ```javascript - var v = asinh( 1.0e-50 ); + const v = asinh( 1.0e-50 ); // returns 0.0 // (expected 1.0e-50) ``` @@ -100,13 +100,12 @@ v = asinh( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asinh = require( '@stdlib/math/base/special/fast/asinh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asinh = require( '@stdlib/math/base/special/fast/asinh' ); -var x = linspace( -5.0, 5.0, 103 ); +const x = linspace( -5.0, 5.0, 103 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asinh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/atan/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/atan/README.md index 09096c536970..c3ee42124f41 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/atan/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/atan/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var atan = require( '@stdlib/math/base/special/fast/atan' ); +const atan = require( '@stdlib/math/base/special/fast/atan' ); ``` #### atan( x ) @@ -39,7 +39,7 @@ Computes the [arctangent][arctangent] of a `number`. ```javascript -var v = atan( 0.0 ); +let v = atan( 0.0 ); // returns ~0.0 v = atan( -3.141592653589793/4.0 ); @@ -65,13 +65,12 @@ v = atan( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atan = require( '@stdlib/math/base/special/fast/atan' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atan = require( '@stdlib/math/base/special/fast/atan' ); -var x = linspace( -1000.0, 1000.0, 100 ); +const x = linspace( -1000.0, 1000.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atan( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-run-javascript-examples/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-run-javascript-examples/README.md index 6e848bb6d1e1..6db839eb5e24 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-run-javascript-examples/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-run-javascript-examples/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' ); +const run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' ); ``` #### run( options ) @@ -35,9 +35,9 @@ var run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples Attaches a [remark][remark] plugin which, when provided a Markdown abstract syntax `tree`, runs JavaScript examples. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var str = [ +let str = [ '
', '', '## Examples', @@ -81,10 +81,10 @@ The plugin accepts the following `options`: To specify plugin options, provide an `options` object. ```javascript -var remark = require( 'remark' ); -var cwd = require( '@stdlib/process/cwd' ); +const remark = require( 'remark' ); +const cwd = require( '@stdlib/process/cwd' ); -var str = [ +let str = [ '
', '', '## Examples', @@ -99,7 +99,7 @@ var str = [ ]; str = str.join( '\n' ); -var opts = { +const opts = { 'cwd': cwd(), 'silent': true, 'verbose': false @@ -131,13 +131,13 @@ function done( error ) { ## Usage ```javascript - var path = require( "path" ); + const path = require( "path" ); ``` #### path.posix.join( [...paths] ) ```javascript - var p = path.posix.join( "foo", "bar" ); + const p = path.posix.join( "foo", "bar" ); ```
@@ -245,7 +245,7 @@ function done( error ) { ```javascript - var path = require( 'path' ); + const path = require( 'path' ); ``` #### path @@ -282,19 +282,19 @@ function done( error ) { ## Examples - + ```javascript -var join = require( 'path' ).join; -var remark = require( 'remark' ); -var readSync = require( 'to-vfile' ).readSync; -var run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' ); +const join = require( 'path' ).join; +const remark = require( 'remark' ); +const readSync = require( 'to-vfile' ).readSync; +const run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' ); // Load a Markdown file: -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var file = readSync( fpath, 'utf8' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const file = readSync( fpath, 'utf8' ); // Run examples: remark().use( run ).process( file, done ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/README.md index d1291a5b98eb..a713c51d1298 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); +const seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); ``` #### seeAlso() @@ -35,10 +35,10 @@ var seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); Attaches a plugin to a [remark][remark] processor in order to insert a "See Also" section of related `stdlib` packages. ```javascript -var remark = require( 'remark' ); -var seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); +const remark = require( 'remark' ); +const seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); -var transform = remark().use( seeAlso ).processSync; +const transform = remark().use( seeAlso ).processSync; ```
@@ -52,21 +52,17 @@ var transform = remark().use( seeAlso ).processSync; ```javascript -var join = require( 'path' ).join; -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); - -var fpath; -var vfile; -var out; +const join = require( 'path' ).join; +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const seeAlso = require( '@stdlib/_tools/remark/plugins/remark-stdlib-related' ); // Load a Markdown file... -var fpath = join( __dirname, 'fixtures', '@stdlib', 'math', 'base', 'special', 'atan', 'README.md' ); -var vfile = toVFile.readSync( fpath ); +const fpath = join( __dirname, 'fixtures', '@stdlib', 'math', 'base', 'special', 'atan', 'README.md' ); +const vfile = toVFile.readSync( fpath ); // Insert a "See Also" section of related `stdlib` packages: -var out = remark().use( seeAlso ).processSync( vfile ); +const out = remark().use( seeAlso ).processSync( vfile ); // Print the results: console.log( out.contents ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/examples/fixtures/@stdlib/math/base/special/atan/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/examples/fixtures/@stdlib/math/base/special/atan/README.md index a01855414d64..25b62f055c42 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/examples/fixtures/@stdlib/math/base/special/atan/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-related/examples/fixtures/@stdlib/math/base/special/atan/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var atan = require( '@stdlib/math/base/special/atan' ); +const atan = require( '@stdlib/math/base/special/atan' ); ``` #### atan( x ) @@ -39,7 +39,7 @@ Computes the [arctangent][arctangent] of a `number`. ```javascript -var v = atan( 0.0 ); +let v = atan( 0.0 ); // returns ~0.0 v = atan( -3.141592653589793/4.0 ); @@ -65,13 +65,12 @@ v = atan( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atan = require( '@stdlib/math/base/special/atan' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atan = require( '@stdlib/math/base/special/atan' ); -var x = linspace( -1000.0, 1000.0, 100 ); +const x = linspace( -1000.0, 1000.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atan( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-github/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-github/README.md index fe0be3f2819d..77f6d4e19ff0 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-github/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-github/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-github' ); +const links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-github' ); ``` #### links( options ) @@ -35,7 +35,7 @@ var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-github' ) Attaches a plugin to a [remark][remark] processor in order to resolve package identifiers to repository URIs. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); remark().use( links ); ``` @@ -47,9 +47,9 @@ The function accepts the following `options`: By default, the plugin resolves package identifiers to the `develop` branch on GitHub. To specify an alternative branch, set the `branch` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'branch': 'master' }; @@ -73,26 +73,22 @@ remark().use( links, opts ); ```javascript -var join = require( 'path' ).join; -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-github' ); +const join = require( 'path' ).join; +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-github' ); -var fpath; -var opts; -var file; -var out; // Load a Markdown file... -var fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); -var opts = { +const fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); +const opts = { 'encoding': 'utf8' }; -var file = readFileSync( fpath, opts ); +const file = readFileSync( fpath, opts ); // Resolve URIs: -var out = remark().use( links ).processSync( file ); +const out = remark().use( links ).processSync( file ); // Print the results: console.log( out.contents ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-www/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-www/README.md index ab0948c92da2..64cac3e460cf 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-www/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-www/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-www' ); +const links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-www' ); ``` #### links( options ) @@ -35,7 +35,7 @@ var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-www' ); Attaches a plugin to a [remark][remark] processor to resolve package identifiers to website URIs. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); remark().use( links ); ``` @@ -47,9 +47,9 @@ The function accepts the following `options`: By default, the plugin resolves package identifiers to the `develop` documentation via relative URLs starting with `/docs/api/develop/`. To specify an alternative base path, set the `base` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'base': '/docs/api/v0.0.90/' }; @@ -73,26 +73,21 @@ remark().use( links, opts ); ```javascript -var join = require( 'path' ).join; -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-www' ); - -var fpath; -var opts; -var file; -var out; +const join = require( 'path' ).join; +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const links = require( '@stdlib/_tools/remark/plugins/remark-stdlib-urls-www' ); // Load a Markdown file... -var fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); -var opts = { +const fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' ); +const opts = { 'encoding': 'utf8' }; -var file = readFileSync( fpath, opts ); +const file = readFileSync( fpath, opts ); // Resolve URIs: -var out = remark().use( links ).processSync( file ); +const out = remark().use( links ).processSync( file ); // Print the results: console.log( out.contents ); diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations-to-file/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations-to-file/README.md index 31fa47adbcc8..b6d5d02f8270 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations-to-file/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations-to-file/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var createSVGs = require( '@stdlib/_tools/remark/plugins/remark-svg-equations-to-file' ); +const createSVGs = require( '@stdlib/_tools/remark/plugins/remark-svg-equations-to-file' ); ``` #### createSVGs( options ) @@ -35,9 +35,9 @@ var createSVGs = require( '@stdlib/_tools/remark/plugins/remark-svg-equations-to Attaches a plugin to a [remark][remark] processor in order to create SVG equation files from Markdown equation comments. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var transform = remark().use( createSVGs ).process; +const transform = remark().use( createSVGs ).process; ``` The function accepts the following `options`: @@ -48,25 +48,25 @@ The function accepts the following `options`: By default, the plugin attempts to resolve an output directory relative to each processed Markdown file. To specify an alternative directory, including an absolute directory, set the `dir` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'dir': '/path/to/absolute/dir/for/svg/equations' }; -var transform = remark().use( createSVGs, opts ).process; +const transform = remark().use( createSVGs, opts ).process; ``` To specify an alternative filename prefix, set the `prefix` option. ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var opts = { +const opts = { 'prefix': 'eqn_' }; -var transform = remark().use( createSVGs, opts ).process; +const transform = remark().use( createSVGs, opts ).process; ``` @@ -98,17 +98,17 @@ var transform = remark().use( createSVGs, opts ).process; ```javascript -var path = require( 'path' ); -var toVFile = require( 'to-vfile' ); -var remark = require( 'remark' ); -var createSVGs = require( '@stdlib/_tools/remark/plugins/remark-svg-equations-to-file' ); +const path = require( 'path' ); +const toVFile = require( 'to-vfile' ); +const remark = require( 'remark' ); +const createSVGs = require( '@stdlib/_tools/remark/plugins/remark-svg-equations-to-file' ); // Load a Markdown file... -var fpath = path.join( __dirname, 'examples', 'fixtures', 'simple.txt' ); -var vfile = toVFile.readSync( fpath ); +const fpath = path.join( __dirname, 'examples', 'fixtures', 'simple.txt' ); +const vfile = toVFile.readSync( fpath ); // Specify the output directory for SVG equation files... -var opts = { +const opts = { 'dir': './build/docs/img/', 'prefix': '' }; diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations/README.md index 618c2d09b89a..fa9b3afdb0a7 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var insertEquations = require( '@stdlib/_tools/remark/plugins/remark-svg-equations' ); +const insertEquations = require( '@stdlib/_tools/remark/plugins/remark-svg-equations' ); ``` #### insertEquations() @@ -37,9 +37,9 @@ Attaches a plugin to a [remark][remark] processor in order to insert SVG equatio ```javascript -var remark = require( 'remark' ); +const remark = require( 'remark' ); -var str = 'The absolute value is defined as'; +let str = 'The absolute value is defined as'; str += '\n'; str += '\n'; str += '\n'; @@ -81,17 +81,17 @@ The absolute value is defined as ```javascript -var join = require( 'path' ).join; -var remark = require( 'remark' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var insertEquations = require( '@stdlib/_tools/remark/plugins/remark-svg-equations' ); +const join = require( 'path' ).join; +const remark = require( 'remark' ); +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const insertEquations = require( '@stdlib/_tools/remark/plugins/remark-svg-equations' ); // Load a Markdown file... -var fpath = join( __dirname, 'fixtures/simple.md' ); -var opts = { +const fpath = join( __dirname, 'fixtures/simple.md' ); +const opts = { 'encoding': 'utf8' }; -var file = readFileSync( fpath, opts ); +const file = readFileSync( fpath, opts ); // Insert equations: remark().use( insertEquations ).process( file, done ); diff --git a/lib/node_modules/@stdlib/_tools/repl-txt/parse/README.md b/lib/node_modules/@stdlib/_tools/repl-txt/parse/README.md index 2f99d7334c8c..592816c0ce5b 100644 --- a/lib/node_modules/@stdlib/_tools/repl-txt/parse/README.md +++ b/lib/node_modules/@stdlib/_tools/repl-txt/parse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var parse = require( '@stdlib/_tools/repl-txt/parse' ); +const parse = require( '@stdlib/_tools/repl-txt/parse' ); ``` #### parse( repl ) @@ -45,7 +45,7 @@ var parse = require( '@stdlib/_tools/repl-txt/parse' ); Parses the contents of a `repl.txt` file and returns an abstract syntax tree (AST) representation. ```javascript -var repl = [ +const repl = [ '{{alias}}( value )', ' Tests if a value is a number.', '', @@ -74,7 +74,7 @@ var repl = [ ' --------' ].join( '\n' ); -var ast = parse( repl ); +const ast = parse( repl ); /* returns [ { @@ -122,14 +122,14 @@ var ast = parse( repl ); ```javascript -var resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var parse = require( '@stdlib/_tools/repl-txt/parse' ); +const resolve = require( 'path' ).resolve; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const parse = require( '@stdlib/_tools/repl-txt/parse' ); -var repl = readFileSync( resolve( __dirname, './fixtures/repl.txt' ) ).toString(); +const repl = readFileSync( resolve( __dirname, './fixtures/repl.txt' ) ).toString(); console.log( repl ); -var ast = parse( repl ); +const ast = parse( repl ); console.log( ast ); ``` diff --git a/lib/node_modules/@stdlib/_tools/repl-txt/validate/README.md b/lib/node_modules/@stdlib/_tools/repl-txt/validate/README.md index a5d9540a46ca..f1991409b4d3 100644 --- a/lib/node_modules/@stdlib/_tools/repl-txt/validate/README.md +++ b/lib/node_modules/@stdlib/_tools/repl-txt/validate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isValid = require( '@stdlib/_tools/repl-txt/validate' ); +const isValid = require( '@stdlib/_tools/repl-txt/validate' ); ``` #### isValid( repl ) @@ -45,7 +45,7 @@ var isValid = require( '@stdlib/_tools/repl-txt/validate' ); Validates a `repl.txt` file. `errors` and `warnings` arrays are attached to the function after each invocation, which contain the errors and warnings encountered when linting the `repl.txt` file, respectively. ```javascript -var repl = [ +const repl = [ '{{alias}}( x )', 'Tests if a numeric value is `NaN`.', '', @@ -63,13 +63,13 @@ var repl = [ '--------' ].join( '\n' ); -var bool = isValid( repl ); +const bool = isValid( repl ); // returns -var errs = isValid.errors; +const errs = isValid.errors; // returns || null -var warn = isValid.warnings; +const warn = isValid.warnings; // returns || null ``` @@ -96,17 +96,17 @@ var warn = isValid.warnings; ```javascript -var resolve = require( 'path' ).resolve; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var isValid = require( '@stdlib/_tools/repl-txt/validate' ); +const resolve = require( 'path' ).resolve; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const isValid = require( '@stdlib/_tools/repl-txt/validate' ); -var repl = readFileSync( resolve( __dirname, './examples/fixtures/repl.txt' ) ).toString(); +const repl = readFileSync( resolve( __dirname, './examples/fixtures/repl.txt' ) ).toString(); console.log( repl ); -var bool = isValid( repl ); +const bool = isValid( repl ); console.log( bool ); -var errs = isValid.errors; +const errs = isValid.errors; console.log( errs ); ``` diff --git a/lib/node_modules/@stdlib/_tools/scaffold/package-json/README.md b/lib/node_modules/@stdlib/_tools/scaffold/package-json/README.md index 135c5179fd45..8a8bd4259fe1 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/package-json/README.md +++ b/lib/node_modules/@stdlib/_tools/scaffold/package-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var create = require( '@stdlib/_tools/scaffold/package-json' ); +const create = require( '@stdlib/_tools/scaffold/package-json' ); ``` #### create( \[options] ) @@ -45,7 +45,7 @@ var create = require( '@stdlib/_tools/scaffold/package-json' ); Returns a `package.json`. ```javascript -var pkg = create(); +const pkg = create(); // returns ``` @@ -60,7 +60,7 @@ The function accepts the following `options`: To return a valid `package.json`, set the `name`, `desc`, and `keywords` options. ```javascript -var opts = { +const opts = { 'name': '@stdlib/math/base/special/erf', 'desc': 'Error function', 'keywords': [ @@ -72,7 +72,7 @@ var opts = { ] }; -var pkg = create( opts ); +const pkg = create( opts ); /* returns { 'name': '@stdlib/math/base/special/erf', @@ -137,9 +137,9 @@ var pkg = create( opts ); ```javascript -var create = require( '@stdlib/_tools/scaffold/package-json' ); +const create = require( '@stdlib/_tools/scaffold/package-json' ); -var opts = { +const opts = { 'name': '@stdlib/math/base/special/erf', 'desc': 'Error function.', 'keywords': [ @@ -153,7 +153,7 @@ var opts = { 'browser': './lib/browser/index.js' }; -var pkg = create( opts ); +const pkg = create( opts ); console.dir( pkg ); ``` diff --git a/lib/node_modules/@stdlib/_tools/scaffold/test-validate-js/README.md b/lib/node_modules/@stdlib/_tools/scaffold/test-validate-js/README.md index 50e085cf086e..5a79b51d2050 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/test-validate-js/README.md +++ b/lib/node_modules/@stdlib/_tools/scaffold/test-validate-js/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var create = require( '@stdlib/_tools/scaffold/test-validate-js' ); +const create = require( '@stdlib/_tools/scaffold/test-validate-js' ); ``` #### create( code ) @@ -45,7 +45,7 @@ var create = require( '@stdlib/_tools/scaffold/test-validate-js' ); Returns `test.validate.js` contents based on a code `string` or [`Buffer`][@stdlib/buffer/ctor] with options annotations. ```javascript -var code = [ +let const code = [ '/**', '* Validates function options.', '*', @@ -58,7 +58,7 @@ var code = [ ]; code = code.join( '\n' ); -var tests = create( code ); +const tests = create( code ); /* returns 'use strict'; @@ -185,11 +185,11 @@ var tests = create( code ); ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var create = require( '@stdlib/_tools/scaffold/test-validate-js' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const create = require( '@stdlib/_tools/scaffold/test-validate-js' ); -var file = readFile( join( __dirname, 'fixtures', 'validate.js.txt' ) ); +const file = readFile( join( __dirname, 'fixtures', 'validate.js.txt' ) ); console.log( create( file ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/scaffold/validate-js/README.md b/lib/node_modules/@stdlib/_tools/scaffold/validate-js/README.md index dcfbbe3a1628..6549913188de 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/validate-js/README.md +++ b/lib/node_modules/@stdlib/_tools/scaffold/validate-js/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var create = require( '@stdlib/_tools/scaffold/validate-js' ); +const create = require( '@stdlib/_tools/scaffold/validate-js' ); ``` #### create( code ) @@ -45,7 +45,7 @@ var create = require( '@stdlib/_tools/scaffold/validate-js' ); Returns `validate.js` contents based on a code `string` or [`Buffer`][@stdlib/buffer/ctor] with options annotations. ```javascript -var code = [ +let const code = [ '/**', '* Sets a nested property value.', '*', @@ -60,7 +60,7 @@ var code = [ ]; code = code.join( '\n' ); -var validate = create( code ); +const validate = create( code ); /* returns 'use strict'; @@ -143,11 +143,11 @@ var validate = create( code ); ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var create = require( '@stdlib/_tools/scaffold/validate-js' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const create = require( '@stdlib/_tools/scaffold/validate-js' ); -var file = readFile( join( __dirname, 'fixtures', 'pluck.js.txt' ) ); +const file = readFile( join( __dirname, 'fixtures', 'pluck.js.txt' ) ); console.log( create( file ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/search/pkg-index/README.md b/lib/node_modules/@stdlib/_tools/search/pkg-index/README.md index ce080473343a..b8851f743a7f 100644 --- a/lib/node_modules/@stdlib/_tools/search/pkg-index/README.md +++ b/lib/node_modules/@stdlib/_tools/search/pkg-index/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pkgIndex = require( '@stdlib/_tools/search/pkg-index' ); +const pkgIndex = require( '@stdlib/_tools/search/pkg-index' ); ``` #### pkgIndex( \[options,] clbk ) @@ -56,7 +56,7 @@ To search for packages from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -75,7 +75,7 @@ To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/package.json' }; @@ -94,7 +94,7 @@ To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -137,23 +137,21 @@ function clbk( error, idx ) { ```javascript -var join = require( 'path' ).join; -var lunr = require( 'lunr' ); -var rootDir = require( '@stdlib/_tools/utils/root-dir' ); -var pkgIndex = require( '@stdlib/_tools/search/pkg-index' ); +const join = require( 'path' ).join; +const lunr = require( 'lunr' ); +const rootDir = require( '@stdlib/_tools/utils/root-dir' ); +const pkgIndex = require( '@stdlib/_tools/search/pkg-index' ); // Define a directory containing READMEs from which to create a search index: -var dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); +const dir = join( rootDir(), 'lib', 'node_modules', '@stdlib', 'math', 'base', 'special' ); // Create a search index: -var opts = { +const opts = { 'dir': dir }; pkgIndex( opts, onIndex ); function onIndex( error, idx ) { - var store; - var res; if ( error ) { throw error; } @@ -162,10 +160,10 @@ function onIndex( error, idx ) { return; } // Load the serialized index into Lunr: - store = lunr.Index.load( idx ); + const store = lunr.Index.load( idx ); // Perform a search: - res = store.search( 'sine' ); + const res = store.search( 'sine' ); console.log( JSON.stringify( res, null, ' ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/lloc/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/lloc/README.md index 333e8fc38b6b..0c40b10592b3 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/lloc/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/lloc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var incrlloc = require( '@stdlib/_tools/static-analysis/js/incr/lloc' ); +const incrlloc = require( '@stdlib/_tools/static-analysis/js/incr/lloc' ); ``` #### incrlloc() @@ -45,7 +45,7 @@ var incrlloc = require( '@stdlib/_tools/static-analysis/js/incr/lloc' ); Returns an accumulator `function` for incrementally calculating logical lines of code (LLOC). ```javascript -var accumulator = incrlloc(); +const accumulator = incrlloc(); ``` #### accumulator( \[input] ) @@ -53,9 +53,9 @@ var accumulator = incrlloc(); If provided an input program, the accumulator function returns an updated logical lines of code (LLOC) statistical summary. If not provided an input program, the accumulator function returns the current LLOC summary state. The input program may be either a `string` or a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var accumulator = incrlloc(); +const accumulator = incrlloc(); -var lloc = accumulator(); +let lloc = accumulator(); // returns {} lloc = accumulator( 'var x = 5;' ); @@ -97,7 +97,7 @@ lloc = accumulator(); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -131,13 +131,13 @@ lloc = accumulator(); ```javascript -var incrlloc = require( '@stdlib/_tools/static-analysis/js/incr/lloc' ); +const incrlloc = require( '@stdlib/_tools/static-analysis/js/incr/lloc' ); // Initialize an accumulator: -var acc = incrlloc(); +const acc = incrlloc(); // Analyze a series of programs: -var prog = 'var x = 5;\n'; +let prog = 'var x = 5;\n'; acc( prog ); prog = 'var y = "beep";\n'; diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/program-summary/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/program-summary/README.md index bd4218481c0c..6094788edc2b 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/program-summary/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/program-summary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var incrsummary = require( '@stdlib/_tools/static-analysis/js/incr/program-summary' ); +const incrsummary = require( '@stdlib/_tools/static-analysis/js/incr/program-summary' ); ``` #### incrsummary() @@ -45,7 +45,7 @@ var incrsummary = require( '@stdlib/_tools/static-analysis/js/incr/program-summa Returns an accumulator `function` for incrementally generating a program summary. ```javascript -var accumulator = incrsummary(); +const accumulator = incrsummary(); ``` #### accumulator( \[input] ) @@ -53,9 +53,9 @@ var accumulator = incrsummary(); If provided an input program, the accumulator function returns an updated summary. If not provided an input program, the accumulator function returns the current summary. The input program may be either a `string` or a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var accumulator = incrsummary(); +const accumulator = incrsummary(); -var summary = accumulator(); +let summary = accumulator(); // returns {...} summary = accumulator( 'var x = 5;' ); @@ -287,13 +287,13 @@ summary = accumulator(); ```javascript -var incrsummary = require( '@stdlib/_tools/static-analysis/js/incr/program-summary' ); +const incrsummary = require( '@stdlib/_tools/static-analysis/js/incr/program-summary' ); // Initialize an accumulator: -var acc = incrsummary(); +const acc = incrsummary(); // Analyze a series of programs: -var prog = 'var x = 5;\n'; +let prog = 'var x = 5;\n'; acc( prog ); prog = 'var y = "beep";\n'; diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/sloc/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/sloc/README.md index 82291824821c..2a1099533c21 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/sloc/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/incr/sloc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var incrsloc = require( '@stdlib/_tools/static-analysis/js/incr/sloc' ); +const incrsloc = require( '@stdlib/_tools/static-analysis/js/incr/sloc' ); ``` #### incrsloc() @@ -45,7 +45,7 @@ var incrsloc = require( '@stdlib/_tools/static-analysis/js/incr/sloc' ); Returns an accumulator `function` for incrementally calculating source lines of code (SLOC). ```javascript -var accumulator = incrsloc(); +const accumulator = incrsloc(); ``` #### accumulator( \[input] ) @@ -53,9 +53,9 @@ var accumulator = incrsloc(); If provided an input program, the accumulator function returns an updated source lines of code (SLOC) statistical summary. If not provided an input program, the accumulator function returns the current SLOC summary state. The input program may be either a `string` or a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var accumulator = incrsloc(); +const accumulator = incrsloc(); -var sloc = accumulator(); +let sloc = accumulator(); // returns {} sloc = accumulator( 'var x = 5;' ); @@ -97,7 +97,7 @@ sloc = accumulator(); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -129,13 +129,13 @@ sloc = accumulator(); ```javascript -var incrsloc = require( '@stdlib/_tools/static-analysis/js/incr/sloc' ); +const incrsloc = require( '@stdlib/_tools/static-analysis/js/incr/sloc' ); // Initialize an accumulator: -var acc = incrsloc(); +const acc = incrsloc(); // Analyze a series of programs: -var prog = 'var x = 5;\n'; +let prog = 'var x = 5;\n'; acc( prog ); prog = 'var y = "beep";\n'; diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-file-list/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-file-list/README.md index 28228c41977c..9864297b5ff1 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-file-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/lloc-file-list' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/lloc-file-list' ); ``` @@ -47,7 +47,7 @@ var analyze = require( '@stdlib/_tools/static-analysis/js/lloc-file-list' ); Calculates [logical lines of code][@stdlib/_tools/static-analysis/js/incr/lloc] (LLOC) for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; analyze( files, clbk ); @@ -66,19 +66,18 @@ The function accepts the following `options`: By default, the function performs a cumulative analysis. To return a LLOC calculation for each file in `files`, set the `cumulative` option to `false`. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var opts = { +const opts = { 'cumulative': false }; analyze( files, opts, clbk ); function clbk( error, results ) { - var i; if ( error ) { throw error; } - for ( i = 0; i < results.length; i++ ) { + for ( let i = 0; i < results.length; i++ ) { console.log( files[ i ] + ': ' + results[ i ] ); } } @@ -89,9 +88,9 @@ function clbk( error, results ) { Synchronously calculates [logical lines of code][@stdlib/_tools/static-analysis/js/incr/lloc] (LLOC) for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var results = analyze( files ); +const results = analyze( files ); if ( results instanceof Error ) { throw results; } @@ -125,10 +124,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var join = require( 'path' ).join; -var analyze = require( '@stdlib/_tools/static-analysis/js/lloc-file-list' ); +const join = require( 'path' ).join; +const analyze = require( '@stdlib/_tools/static-analysis/js/lloc-file-list' ); -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ), join( __dirname, 'lib', 'index.js' ), join( __dirname, 'lib', 'main.js' ), diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-glob/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-glob/README.md index b18448cbea47..dce9609d9eb2 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-glob/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc-glob/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/lloc-glob' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/lloc-glob' ); ``` @@ -69,7 +69,7 @@ The function accepts the following `options`: By default, the function performs a cumulative analysis. To return a LLOC calculation for each matched file, set the `cumulative` option to `false`. ```javascript -var opts = { +const opts = { 'cumulative': false }; analyze( opts, clbk ); @@ -85,7 +85,7 @@ function clbk( error, results ) { To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -104,7 +104,7 @@ function clbk( error, results ) { By default, the implementation searches for all files with a `.js` file extension. To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/*.js' }; @@ -123,7 +123,7 @@ function clbk( error, results ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -148,7 +148,7 @@ function clbk( error, results ) { Synchronously calculates [logical lines of code][@stdlib/_tools/static-analysis/js/incr/lloc] (LLOC) on a file glob. ```javascript -var results = analyze(); +const results = analyze(); if ( results instanceof Error ) { throw results; } @@ -183,10 +183,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var resolve = require( 'path' ).resolve; -var analyze = require( '@stdlib/_tools/static-analysis/js/lloc-glob' ); +const resolve = require( 'path' ).resolve; +const analyze = require( '@stdlib/_tools/static-analysis/js/lloc-glob' ); -var opts = { +const opts = { 'dir': __dirname }; diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc/README.md index 21fe4659618c..2e89ecc60c81 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/lloc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var lloc = require( '@stdlib/_tools/static-analysis/js/lloc' ); +const lloc = require( '@stdlib/_tools/static-analysis/js/lloc' ); ``` #### lloc( src ) @@ -45,7 +45,7 @@ var lloc = require( '@stdlib/_tools/static-analysis/js/lloc' ); Returns the logical lines of code (LLOC) in a JavaScript program, where `src` may be either an input `string` or [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var n = lloc( 'var beep = "boop";\n' ); +const n = lloc( 'var beep = "boop";\n' ); // returns 1 ``` @@ -66,7 +66,7 @@ var n = lloc( 'var beep = "boop";\n' ); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -94,8 +94,8 @@ var n = lloc( 'var beep = "boop";\n' ); ```javascript -var readFile = require( '@stdlib/fs/read-file' ); -var lloc = require( '@stdlib/_tools/static-analysis/js/lloc' ); +const readFile = require( '@stdlib/fs/read-file' ); +const lloc = require( '@stdlib/_tools/static-analysis/js/lloc' ); readFile( __filename, onFile ); diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/program-summary/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/program-summary/README.md index 375c244e6b57..52214aa8be31 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/program-summary/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/program-summary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/program-summary' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/program-summary' ); ``` #### analyze( src ) @@ -47,7 +47,7 @@ Generates a summary of a JavaScript program, where `src` may be either an input ```javascript -var summary = analyze( 'var beep = "boop";' ); +const summary = analyze( 'var beep = "boop";' ); /* returns { "length": 18, // number of characters, including whitespace @@ -172,7 +172,7 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -188,7 +188,7 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -263,8 +263,8 @@ var summary = analyze( 'var beep = "boop";' ); - An **inline** comment is defined as a comment appearing on the same line as a line of source code. ```javascript - var x = 5.0; // This is an inline comment - var y = 4.0; /* This is an inline comment */ + const x = 5.0; // This is an inline comment + const y = 4.0; /* This is an inline comment */ ``` - With the exception of empty functions, function declarations are **assumed** to have the following form: @@ -284,7 +284,7 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript - var x = 5.0; + const x = 5.0; if ( x !== x ) { // Handle NaN... @@ -298,7 +298,7 @@ var summary = analyze( 'var beep = "boop";' ); - Switch statements are **assumed** to have the following form: ```javascript - var x = 1; + const x = 1; switch ( x ) { case 1: @@ -320,7 +320,7 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript - var x = 5.0; + let x = 5.0; try { x *= 2; @@ -334,7 +334,7 @@ var summary = analyze( 'var beep = "boop";' ); - While statements are **assumed** to have the following form: ```javascript - var i = 0; + let i = 0; while ( i < 5 ) { // Do something... @@ -347,7 +347,7 @@ var summary = analyze( 'var beep = "boop";' ); - DoWhile statements are **assumed** to have the following form: ```javascript - var i = 0; + let i = 0; do { // Do something... @@ -360,9 +360,7 @@ var summary = analyze( 'var beep = "boop";' ); - For statements are **assumed** to have the following form: ```javascript - var i; - - for ( i = 0; i < 5; i++ ) { + for ( let i = 0; i < 5; i++ ) { // Do something... } ``` @@ -372,7 +370,7 @@ var summary = analyze( 'var beep = "boop";' ); - All expression statements are counted as `1` SLOC, including ternary conditions and function expressions. For example, ```javascript - var obj = { + const obj = { 'x': 5.0 }; ``` @@ -382,7 +380,7 @@ var summary = analyze( 'var beep = "boop";' ); - `if`/`else if` chains are interpreted as nested `if` statements. For example, ```javascript - var x = 5.0; + const x = 5.0; if ( x < 3.0 ) { // Do something... @@ -400,7 +398,7 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript - var x = 5.0; + const x = 5.0; if ( x < 3.0 ) { // Do something... @@ -534,18 +532,18 @@ var summary = analyze( 'var beep = "boop";' ); ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var analyze = require( '@stdlib/_tools/static-analysis/js/program-summary' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const analyze = require( '@stdlib/_tools/static-analysis/js/program-summary' ); // Load a JavaScript file: -var fpath = join( __dirname, 'examples', 'fixtures', 'index.txt' ); -var code = readFileSync( fpath, { +const fpath = join( __dirname, 'examples', 'fixtures', 'index.txt' ); +const code = readFileSync( fpath, { 'encoding': 'utf8' }); // Generate a summary: -var out = analyze( code ); +const out = analyze( code ); console.log( JSON.stringify( out ) ); ``` diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-file-list/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-file-list/README.md index e7921934e271..cc675dced34b 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-file-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/sloc-file-list' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/sloc-file-list' ); ``` @@ -47,7 +47,7 @@ var analyze = require( '@stdlib/_tools/static-analysis/js/sloc-file-list' ); Calculates [source lines of code][@stdlib/_tools/static-analysis/js/incr/sloc] (SLOC) for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; analyze( files, clbk ); @@ -66,19 +66,18 @@ The function accepts the following `options`: By default, the function performs a cumulative analysis. To return a SLOC calculation for each file in `files`, set the `cumulative` option to `false`. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var opts = { +const opts = { 'cumulative': false }; analyze( files, opts, clbk ); function clbk( error, results ) { - var i; if ( error ) { throw error; } - for ( i = 0; i < results.length; i++ ) { + for ( let i = 0; i < results.length; i++ ) { console.log( files[ i ] + ': ' + results[ i ] ); } } @@ -89,9 +88,9 @@ function clbk( error, results ) { Synchronously calculates [source lines of code][@stdlib/_tools/static-analysis/js/incr/sloc] (SLOC) for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var results = analyze( files ); +const results = analyze( files ); if ( results instanceof Error ) { throw results; } @@ -125,10 +124,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var join = require( 'path' ).join; -var analyze = require( '@stdlib/_tools/static-analysis/js/sloc-file-list' ); +const join = require( 'path' ).join; +const analyze = require( '@stdlib/_tools/static-analysis/js/sloc-file-list' ); -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ), join( __dirname, 'lib', 'index.js' ), join( __dirname, 'lib', 'main.js' ), diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-glob/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-glob/README.md index afa6cd888448..5305312dc04c 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-glob/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc-glob/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/sloc-glob' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/sloc-glob' ); ``` @@ -69,7 +69,7 @@ The function accepts the following `options`: By default, the function performs a cumulative analysis. To return a SLOC calculation for each matched file, set the `cumulative` option to `false`. ```javascript -var opts = { +const opts = { 'cumulative': false }; analyze( opts, clbk ); @@ -85,7 +85,7 @@ function clbk( error, results ) { To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -104,7 +104,7 @@ function clbk( error, results ) { By default, the implementation searches for all files with a `.js` file extension. To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/*.js' }; @@ -123,7 +123,7 @@ function clbk( error, results ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -148,7 +148,7 @@ function clbk( error, results ) { Synchronously calculates [source lines of code][@stdlib/_tools/static-analysis/js/incr/sloc] (SLOC) on a file glob. ```javascript -var results = analyze(); +const results = analyze(); if ( results instanceof Error ) { throw results; } @@ -183,10 +183,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var resolve = require( 'path' ).resolve; -var analyze = require( '@stdlib/_tools/static-analysis/js/sloc-glob' ); +const resolve = require( 'path' ).resolve; +const analyze = require( '@stdlib/_tools/static-analysis/js/sloc-glob' ); -var opts = { +const opts = { 'dir': __dirname }; diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc/README.md index b0a7f8ac342f..0fbcac8fb9af 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/sloc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sloc = require( '@stdlib/_tools/static-analysis/js/sloc' ); +const sloc = require( '@stdlib/_tools/static-analysis/js/sloc' ); ``` #### sloc( src ) @@ -45,7 +45,7 @@ var sloc = require( '@stdlib/_tools/static-analysis/js/sloc' ); Returns the source lines of code (SLOC) in a JavaScript program, where `src` may be either an input `string` or [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var n = sloc( 'var beep = "boop";\n' ); +const n = sloc( 'var beep = "boop";\n' ); // returns 1 ``` @@ -66,7 +66,7 @@ var n = sloc( 'var beep = "boop";\n' ); ```javascript - var x = -5.0; + let x = -5.0; // Shorthand: if ( x < 0.0 ) x *= -1; @@ -92,8 +92,8 @@ var n = sloc( 'var beep = "boop";\n' ); ```javascript -var readFile = require( '@stdlib/fs/read-file' ); -var sloc = require( '@stdlib/_tools/static-analysis/js/sloc' ); +const readFile = require( '@stdlib/fs/read-file' ); +const sloc = require( '@stdlib/_tools/static-analysis/js/sloc' ); readFile( __filename, onFile ); diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list/README.md index 0da1f69c2aef..0ff82db062db 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' ); ``` @@ -47,7 +47,7 @@ var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' ) Performs a static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary] for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; analyze( files, clbk ); @@ -66,9 +66,9 @@ The function accepts the following `options`: By default, the function performs a cumulative static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary]. To return a separate [program summary][@stdlib/_tools/static-analysis/js/program-summary] for each file in `files`, set the `cumulative` option to `false`. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var opts = { +const opts = { 'cumulative': false }; analyze( files, opts, clbk ); @@ -86,9 +86,9 @@ function clbk( error, results ) { Synchronously performs a static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary] for a list of JavaScript files. ```javascript -var files = [ './beep.js', './boop.js' ]; +const files = [ './beep.js', './boop.js' ]; -var results = analyze( files ); +const results = analyze( files ); if ( results instanceof Error ) { throw results; } @@ -122,10 +122,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var join = require( 'path' ).join; -var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' ); +const join = require( 'path' ).join; +const analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' ); -var files = [ +const files = [ join( __dirname, 'examples', 'index.js' ), join( __dirname, 'lib', 'index.js' ), join( __dirname, 'lib', 'main.js' ), diff --git a/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-glob/README.md b/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-glob/README.md index fd95be1e303e..53dc53bcb58e 100644 --- a/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-glob/README.md +++ b/lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-glob/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-glob' ); +const analyze = require( '@stdlib/_tools/static-analysis/js/summarize-glob' ); ``` @@ -69,7 +69,7 @@ The function accepts the following `options`: By default, the function performs a cumulative static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary]. To return a separate [program summary][@stdlib/_tools/static-analysis/js/program-summary] for each matched file, set the `cumulative` option to `false`. ```javascript -var opts = { +const opts = { 'cumulative': false }; analyze( opts, clbk ); @@ -85,7 +85,7 @@ function clbk( error, results ) { To search from an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': '/foo/bar/baz' }; @@ -104,7 +104,7 @@ function clbk( error, results ) { By default, the implementation searches for all files with a `.js` file extension. To provide an alternative include filter, set the `pattern` option. ```javascript -var opts = { +const opts = { 'pattern': '**/foo/**/*.js' }; @@ -123,7 +123,7 @@ function clbk( error, results ) { To exclude matches, set the `ignore` option. ```javascript -var opts = { +const opts = { 'ignore': [ 'node_modules/**', 'build/**', @@ -148,7 +148,7 @@ function clbk( error, results ) { Synchronously performs a static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary] on a file glob. ```javascript -var results = analyze(); +const results = analyze(); if ( results instanceof Error ) { throw results; } @@ -183,10 +183,10 @@ The function accepts the same `options` as [`analyze()`](#analyze-async) above. ```javascript -var resolve = require( 'path' ).resolve; -var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-glob' ); +const resolve = require( 'path' ).resolve; +const analyze = require( '@stdlib/_tools/static-analysis/js/summarize-glob' ); -var opts = { +const opts = { 'dir': __dirname }; diff --git a/lib/node_modules/@stdlib/_tools/test-cov/tape-istanbul/README.md b/lib/node_modules/@stdlib/_tools/test-cov/tape-istanbul/README.md index 56e11673ac39..99d542b9dfc6 100644 --- a/lib/node_modules/@stdlib/_tools/test-cov/tape-istanbul/README.md +++ b/lib/node_modules/@stdlib/_tools/test-cov/tape-istanbul/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var runner = require( '@stdlib/_tools/test-cov/tape-istanbul' ); +const runner = require( '@stdlib/_tools/test-cov/tape-istanbul' ); ``` #### runner( pattern, \[options,] clbk ) @@ -53,7 +53,7 @@ The function accepts the following `options`: By default, the function looks for coverage information in a `__coverage__` global variable. To specify an alternative variable, set the `global` option. ```javascript -var opts = { +const opts = { 'global': '$$coverage$$' }; @@ -80,7 +80,7 @@ runner( 'test*.js', opts, done ); ```javascript -var runner = require( '@stdlib/_tools/test-cov/tape-istanbul' ); +const runner = require( '@stdlib/_tools/test-cov/tape-istanbul' ); function done( error, coverage ) { if ( error ) { @@ -89,9 +89,9 @@ function done( error, coverage ) { console.log( JSON.stringify( coverage ) ); } -var pattern = __dirname+'/fixtures/**/test*.js'; +const pattern = __dirname+'/fixtures/**/test*.js'; -var opts = { +const opts = { 'dir': __dirname }; diff --git a/lib/node_modules/@stdlib/_tools/tests/browser-build/README.md b/lib/node_modules/@stdlib/_tools/tests/browser-build/README.md index d4ae17b829a1..80886d55a72b 100644 --- a/lib/node_modules/@stdlib/_tools/tests/browser-build/README.md +++ b/lib/node_modules/@stdlib/_tools/tests/browser-build/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/tests/browser-build' ); +const build = require( '@stdlib/_tools/tests/browser-build' ); ``` #### build( root, output, \[options,] clbk ) @@ -47,10 +47,10 @@ Given a `root` directory from which to search for tests and an output directory, ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; build( root, out, clbk ); @@ -79,12 +79,12 @@ To provide an alternative glob pattern, set the `pattern` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; -var opts = { +const opts = { 'pattern': '**/test.js' }; @@ -107,12 +107,12 @@ To mount a bundle on a URL path, set the `mount`option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var root = cwd(); -var out = root; +const root = cwd(); +const out = root; -var opts = { +const opts = { 'mount': '/www/public/' }; @@ -153,16 +153,16 @@ function clbk( error, bool ) { ```javascript -var join = require( 'path' ).join; -var mkdirp = require( 'mkdirp' ).sync; -var build = require( '@stdlib/_tools/tests/browser-build' ); +const join = require( 'path' ).join; +const mkdirp = require( 'mkdirp' ).sync; +const build = require( '@stdlib/_tools/tests/browser-build' ); -var root = join( __dirname, 'examples', 'fixtures' ); -var out = join( __dirname, 'build' ); +const root = join( __dirname, 'examples', 'fixtures' ); +const out = join( __dirname, 'build' ); mkdirp( out ); -var opts = { +const opts = { 'pattern': 'index.js', 'bundle': 'test_bundle.js', 'html': 'tests.html' diff --git a/lib/node_modules/@stdlib/_tools/tests/bundle/README.md b/lib/node_modules/@stdlib/_tools/tests/bundle/README.md index 2b71e99227b8..090c8d15ad07 100644 --- a/lib/node_modules/@stdlib/_tools/tests/bundle/README.md +++ b/lib/node_modules/@stdlib/_tools/tests/bundle/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bundle = require( '@stdlib/_tools/tests/bundle' ); +const bundle = require( '@stdlib/_tools/tests/bundle' ); ``` #### bundle( root, \[options,] clbk ) @@ -45,7 +45,7 @@ var bundle = require( '@stdlib/_tools/tests/bundle' ); Given a `root` directory from which to search for tests, bundles tests into a single file using [browserify][browserify]. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); bundle( cwd(), clbk ); @@ -65,9 +65,9 @@ The function accepts the following `options`: To specify an output file path, set the `out` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var opts = { +const opts = { 'out': '/foo/bar/bundle.js' }; @@ -88,9 +88,9 @@ function clbk( error, bool ) { To provide an alternative glob pattern, set the `pattern` option. ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); -var opts = { +const opts = { 'pattern': '**/t.js' }; @@ -127,12 +127,12 @@ function clbk( error, bundle ) { ```javascript -var join = require( 'path' ).join; -var bundle = require( '@stdlib/_tools/tests/bundle' ); +const join = require( 'path' ).join; +const bundle = require( '@stdlib/_tools/tests/bundle' ); -var root = join( __dirname, 'fixtures' ); +const root = join( __dirname, 'fixtures' ); -var opts = { +const opts = { 'pattern': '*.js' }; diff --git a/lib/node_modules/@stdlib/_tools/tests/html/README.md b/lib/node_modules/@stdlib/_tools/tests/html/README.md index 28aa43ffd69b..860bbfead49b 100644 --- a/lib/node_modules/@stdlib/_tools/tests/html/README.md +++ b/lib/node_modules/@stdlib/_tools/tests/html/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var build = require( '@stdlib/_tools/tests/html' ); +const build = require( '@stdlib/_tools/tests/html' ); ``` #### build( bundle, \[options,] clbk ) @@ -45,7 +45,7 @@ var build = require( '@stdlib/_tools/tests/html' ); Given a `bundle` URL from which to load a test bundle, returns an HTML file for running tests. ```javascript -var bundle = '/foo/bar/bundle.js'; +const bundle = '/foo/bar/bundle.js'; build( bundle, clbk ); @@ -65,9 +65,9 @@ The function accepts the following `options`: To specify an output file path, set the `out` option. ```javascript -var bundle = '/foo/bar/bundle.js'; +const bundle = '/foo/bar/bundle.js'; -var opts = { +const opts = { 'out': '/foo/bar/test.html' }; @@ -101,7 +101,7 @@ function clbk( error ) { ```javascript -var build = require( '@stdlib/_tools/tests/html' ); +const build = require( '@stdlib/_tools/tests/html' ); build( '/foo/bar/bundle.js', onBuild ); diff --git a/lib/node_modules/@stdlib/_tools/utils/jsdelivr-url/README.md b/lib/node_modules/@stdlib/_tools/utils/jsdelivr-url/README.md index 10f11731982f..d6a061d08db4 100644 --- a/lib/node_modules/@stdlib/_tools/utils/jsdelivr-url/README.md +++ b/lib/node_modules/@stdlib/_tools/utils/jsdelivr-url/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var jsdelivr = require( '@stdlib/_tools/utils/jsdelivr-url' ); +const jsdelivr = require( '@stdlib/_tools/utils/jsdelivr-url' ); ``` #### jsdelivr( opts ) @@ -45,12 +45,12 @@ var jsdelivr = require( '@stdlib/_tools/utils/jsdelivr-url' ); Returns a [jsDelivr][jsdelivr] URL for a file hosted in a public GitHub repository. ```javascript -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib/5c53c78310e7c2cb8b3c166555d0fb81a3723f34', 'file': 'README.md' }; -var url = jsdelivr( opts ); +const url = jsdelivr( opts ); // returns 'https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@5c53c78310e7c2cb8b3c166555d0fb81a3723f34/README.md' ``` @@ -89,14 +89,14 @@ The function accepts the following `options`: ```javascript -var jsdelivr = require( '@stdlib/_tools/utils/jsdelivr-url' ); +const jsdelivr = require( '@stdlib/_tools/utils/jsdelivr-url' ); -var opts = { +const opts = { 'slug': 'stdlib-js/stdlib/5c53c78310e7c2cb8b3c166555d0fb81a3723f34', 'file': 'README.md' }; -var url = jsdelivr( opts ); +const url = jsdelivr( opts ); console.log( url ); // => 'https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@5c53c78310e7c2cb8b3c166555d0fb81a3723f34/README.md' @@ -152,7 +152,7 @@ Options: becomes ```javascript -var slug = 'stdlib-js/stdlib/5c53c78310e7c2cb8b3c166555d0fb81a3723f34'; +const slug = 'stdlib-js/stdlib/5c53c78310e7c2cb8b3c166555d0fb81a3723f34'; ``` diff --git a/lib/node_modules/@stdlib/_tools/utils/root-dir/README.md b/lib/node_modules/@stdlib/_tools/utils/root-dir/README.md index ac36efcda4f3..0ee88b639ed9 100644 --- a/lib/node_modules/@stdlib/_tools/utils/root-dir/README.md +++ b/lib/node_modules/@stdlib/_tools/utils/root-dir/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rootDir = require( '@stdlib/_tools/utils/root-dir' ); +const rootDir = require( '@stdlib/_tools/utils/root-dir' ); ``` #### rootDir() @@ -45,7 +45,7 @@ var rootDir = require( '@stdlib/_tools/utils/root-dir' ); Returns the root project directory. ```javascript -var dir = rootDir(); +const dir = rootDir(); // returns '...' ``` @@ -74,9 +74,9 @@ var dir = rootDir(); ```javascript -var rootDir = require( '@stdlib/_tools/utils/root-dir' ); +const rootDir = require( '@stdlib/_tools/utils/root-dir' ); -var dir = rootDir(); +const dir = rootDir(); // returns '...' console.log( dir ); diff --git a/lib/node_modules/@stdlib/_tools/utils/tex-equation-to-svg/README.md b/lib/node_modules/@stdlib/_tools/utils/tex-equation-to-svg/README.md index e41ab8d54b9c..d3faca60b0eb 100644 --- a/lib/node_modules/@stdlib/_tools/utils/tex-equation-to-svg/README.md +++ b/lib/node_modules/@stdlib/_tools/utils/tex-equation-to-svg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var tex2svg = require( '@stdlib/_tools/utils/tex-equation-to-svg' ); +const tex2svg = require( '@stdlib/_tools/utils/tex-equation-to-svg' ); ``` @@ -47,7 +47,7 @@ var tex2svg = require( '@stdlib/_tools/utils/tex-equation-to-svg' ); Converts a [TeX][tex] or [LaTeX][latex] `string` to an SVG. ```javascript -var eqn = 'y = mx + b'; +const eqn = 'y = mx + b'; tex2svg( eqn, clbk ); @@ -72,9 +72,9 @@ The function accepts the following `options`: By default, the function formats an input `string` as a displayed equation. To format the `string` as a text (inline) equation, set the `inline` option to `true`. ```javascript -var eqn = 'y = mx + b'; +const eqn = 'y = mx + b'; -var opts = { +const opts = { 'inline': true }; @@ -100,11 +100,11 @@ function clbk( error, svg ) { console.log( svg ); } -var opts = { +const opts = { 'inline': true }; -var convert = tex2svg.factory( opts ); +const convert = tex2svg.factory( opts ); convert( 'y = mx + b', clbk ); convert( 'z = \\frac{1}{2}', clbk ); @@ -128,7 +128,7 @@ The factory method accepts the same `options` as [`tex2svg()`](#tex2svg). ```javascript // Not escaped: - var eqn = 'x = \frac{1}{2}'; + let eqn = 'x = \frac{1}{2}'; // Escaped: eqn = 'x = \\frac{1}{2}'; @@ -147,9 +147,9 @@ The factory method accepts the same `options` as [`tex2svg()`](#tex2svg). ```javascript -var tex2svg = require( '@stdlib/_tools/utils/tex-equation-to-svg' ); +const tex2svg = require( '@stdlib/_tools/utils/tex-equation-to-svg' ); -var eqn = '\\operatorname{erf}(x) = \\frac{2}{\\sqrt\\pi}\\int_0^x e^{-t^2}\\,\\mathrm dt.'; +const eqn = '\\operatorname{erf}(x) = \\frac{2}{\\sqrt\\pi}\\int_0^x e^{-t^2}\\,\\mathrm dt.'; tex2svg( eqn, done ); diff --git a/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md b/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md index 2a6bd541a1bd..525df7e05aeb 100644 --- a/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md +++ b/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uncapitalizeDescription = require( '@stdlib/_tools/utils/uncapitalize-pkg-description' ); +const uncapitalizeDescription = require( '@stdlib/_tools/utils/uncapitalize-pkg-description' ); ``` #### uncapitalizeDescription( str ) @@ -35,7 +35,7 @@ var uncapitalizeDescription = require( '@stdlib/_tools/utils/uncapitalize-pkg-de Uncapitalizes a `stdlib` package description. ```javascript -var out = uncapitalizeDescription( 'Test for deep equality between two values.' ); +const out = uncapitalizeDescription( 'Test for deep equality between two values.' ); // returns 'test for deep equality between two values.' ``` @@ -50,9 +50,9 @@ var out = uncapitalizeDescription( 'Test for deep equality between two values.' ```javascript -var uncapitalizeDescription = require( '@stdlib/_tools/utils/uncapitalize-pkg-description' ); +const uncapitalizeDescription = require( '@stdlib/_tools/utils/uncapitalize-pkg-description' ); -var out = uncapitalizeDescription( 'Replace search occurrences with a replacement string.' ); +let out = uncapitalizeDescription( 'Replace search occurrences with a replacement string.' ); // returns 'replace search occurrences with a replacement string.' out = uncapitalizeDescription( 'Poisson distribution constructor.' ); diff --git a/lib/node_modules/@stdlib/array/README.md b/lib/node_modules/@stdlib/array/README.md index 5bb8e9bc5fd6..e1e21d80341e 100644 --- a/lib/node_modules/@stdlib/array/README.md +++ b/lib/node_modules/@stdlib/array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/array' ); +const ns = require( '@stdlib/array' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/array' ); Arrays. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -62,7 +62,7 @@ The namespace exports the following array constructors: ```javascript -var arr = new ns.Int32Array( 5 ); +const arr = new ns.Int32Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -79,10 +79,10 @@ Alternatively, use the `typedarray` function to create a typed array of a given ```javascript -var arr1 = ns.typedarray( 5 ); +const arr1 = ns.typedarray( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr2 = ns.typedarray( 5, 'uint8' ); +const arr2 = ns.typedarray( 5, 'uint8' ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -143,7 +143,7 @@ Furthermore, the namespace contains utility functions to retrieve a given constr ```javascript -var ctor = ns.typedarrayCtors( 'float64' ); +let ctor = ns.typedarrayCtors( 'float64' ); // returns ctor = ns.typedarrayCtors( 'int' ); @@ -239,8 +239,8 @@ Lastly, the namespace contains various other functions for dealing with arrays, ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/array' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/array' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/array/base/README.md b/lib/node_modules/@stdlib/array/base/README.md index c3d64121def8..95b7bea04d1d 100644 --- a/lib/node_modules/@stdlib/array/base/README.md +++ b/lib/node_modules/@stdlib/array/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/array/base' ); +const ns = require( '@stdlib/array/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/array/base' ); Array utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -238,27 +238,27 @@ The namespace exports the following: ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ns = require( '@stdlib/array/base' ); +const randu = require( '@stdlib/random/base/randu' ); +const ns = require( '@stdlib/array/base' ); // Create a zero-filled array: -var zeros = ns.zeros( 5 ); +const zeros = ns.zeros( 5 ); // returns [ 0, 0, 0, 0, 0 ] // Create an array filled with a specific value: -var filled = ns.filled( 7, 4 ); +const filled = ns.filled( 7, 4 ); // returns [ 7, 7, 7, 7 ] // Create a linearly spaced array: -var linear = ns.linspace( 0, 1, 5 ); +const linear = ns.linspace( 0, 1, 5 ); // returns [ 0, 0.25, 0.5, 0.75, 1 ] // Create a two-dimensional array: -var arr2d = ns.ones2d( [ 2, 3 ] ); +const arr2d = ns.ones2d( [ 2, 3 ] ); // returns [ [ 1, 1, 1 ], [ 1, 1, 1 ] ] // Map a function over a 2D array: -var squared = ns.map2d( arr2d, [ 2, 3 ], randu ); +const squared = ns.map2d( arr2d, [ 2, 3 ], randu ); // e.g., returns [ [ ~0.123, ~0.789, ~0.456 ], [ ~0.321, ~0.654, ~0.987 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/base/accessor-getter/README.md b/lib/node_modules/@stdlib/array/base/accessor-getter/README.md index 0bb570b4608c..2559dda09879 100644 --- a/lib/node_modules/@stdlib/array/base/accessor-getter/README.md +++ b/lib/node_modules/@stdlib/array/base/accessor-getter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var accessorGetter = require( '@stdlib/array/base/accessor-getter' ); +const accessorGetter = require( '@stdlib/array/base/accessor-getter' ); ``` #### accessorGetter( dtype ) @@ -45,20 +45,20 @@ var accessorGetter = require( '@stdlib/array/base/accessor-getter' ); Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1, 2, 3, 4 ] ); +const arr = new Complex64Array( [ 1, 2, 3, 4 ] ); -var get = accessorGetter( 'complex64' ); -var v = get( arr, 1 ); +const get = accessorGetter( 'complex64' ); +const v = get( arr, 1 ); // returns -var re = realf( v ); +const re = realf( v ); // returns 3.0 -var im = imagf( v ); +const im = imagf( v ); // returns 4.0 ``` @@ -96,14 +96,14 @@ The returned accessor function accepts the following arguments: ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var dtype = require( '@stdlib/array/dtype' ); -var accessorGetter = require( '@stdlib/array/base/accessor-getter' ); - -var arr = new Complex128Array( zeroTo( 10 ) ); -var v = accessorGetter( dtype( arr ) )( arr, 2 ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const dtype = require( '@stdlib/array/dtype' ); +const accessorGetter = require( '@stdlib/array/base/accessor-getter' ); + +let arr = new Complex128Array( zeroTo( 10 ) ); +let v = accessorGetter( dtype( arr ) )( arr, 2 ); // returns console.log( v.toString() ); diff --git a/lib/node_modules/@stdlib/array/base/accessor-setter/README.md b/lib/node_modules/@stdlib/array/base/accessor-setter/README.md index 195554285368..c072b574bc00 100644 --- a/lib/node_modules/@stdlib/array/base/accessor-setter/README.md +++ b/lib/node_modules/@stdlib/array/base/accessor-setter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var accessorSetter = require( '@stdlib/array/base/accessor-setter' ); +const accessorSetter = require( '@stdlib/array/base/accessor-setter' ); ``` #### accessorSetter( dtype ) @@ -45,23 +45,23 @@ var accessorSetter = require( '@stdlib/array/base/accessor-setter' ); Returns an accessor function for setting an element in an array-like object supporting the get/set protocol. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1, 2, 3, 4 ] ); +const arr = new Complex64Array( [ 1, 2, 3, 4 ] ); -var set = accessorSetter( 'complex64' ); +const set = accessorSetter( 'complex64' ); set( arr, 1, new Complex64( 10.0, 11.0 ) ); -var v = arr.get( 1 ); +const v = arr.get( 1 ); // returns -var re = realf( v ); +const re = realf( v ); // returns 10.0 -var im = imagf( v ); +const im = imagf( v ); // returns 11.0 ``` @@ -101,18 +101,18 @@ The returned accessor function accepts the following arguments: ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var dtype = require( '@stdlib/array/dtype' ); -var accessorSetter = require( '@stdlib/array/base/accessor-setter' ); - -var arr = new Complex128Array( zeroTo( 10 ) ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const dtype = require( '@stdlib/array/dtype' ); +const accessorSetter = require( '@stdlib/array/base/accessor-setter' ); + +let arr = new Complex128Array( zeroTo( 10 ) ); accessorSetter( dtype( arr ) )( arr, 2, new Complex128( 100.0, 101.0 ) ); -var v = arr.get( 2 ); +let v = arr.get( 2 ); // returns console.log( '%s', v.toString() ); diff --git a/lib/node_modules/@stdlib/array/base/accessor/README.md b/lib/node_modules/@stdlib/array/base/accessor/README.md index d42557ef7cdb..21e85442fe5f 100644 --- a/lib/node_modules/@stdlib/array/base/accessor/README.md +++ b/lib/node_modules/@stdlib/array/base/accessor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var AccessorArray = require( '@stdlib/array/base/accessor' ); +const AccessorArray = require( '@stdlib/array/base/accessor' ); ``` @@ -47,7 +47,7 @@ var AccessorArray = require( '@stdlib/array/base/accessor' ); Creates a minimal array-like object supporting the accessor protocol from another array-like object. ```javascript -var arr = new AccessorArray( [ 1, 2, 3 ] ); +const arr = new AccessorArray( [ 1, 2, 3 ] ); // returns ``` @@ -62,10 +62,10 @@ var arr = new AccessorArray( [ 1, 2, 3 ] ); Number of array elements. ```javascript -var arr = new AccessorArray( [ 1, 2, 3 ] ); +const arr = new AccessorArray( [ 1, 2, 3 ] ); // returns -var len = arr.length; +const len = arr.length; // returns 3 ``` @@ -80,10 +80,10 @@ var len = arr.length; Returns an array element located at position (index) `i`. ```javascript -var arr = new AccessorArray( [ 1, 2, 3 ] ); +const arr = new AccessorArray( [ 1, 2, 3 ] ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1 ``` @@ -94,10 +94,10 @@ var v = arr.get( 0 ); Sets an array element. ```javascript -var arr = new AccessorArray( [ 1, 2, 3 ] ); +const arr = new AccessorArray( [ 1, 2, 3 ] ); // Get the first element: -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1 // Set the first element: @@ -111,10 +111,10 @@ v = arr.get( 0 ); By default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`. ```javascript -var arr = new AccessorArray( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const arr = new AccessorArray( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); // Get the fifth element: -var v = arr.get( 4 ); +let v = arr.get( 4 ); // returns 5 // Set the fifth element: @@ -150,7 +150,7 @@ v = arr.get( 4 ); ```javascript -var AccessorArray = require( '@stdlib/array/base/accessor' ); +const AccessorArray = require( '@stdlib/array/base/accessor' ); // Define a class for creating a minimal sparse array-like object... function SparseArray( len, values ) { @@ -160,7 +160,7 @@ function SparseArray( len, values ) { } SparseArray.prototype.get = function get( i ) { - var v = this._data[ i ]; + const v = this._data[ i ]; if ( v === void 0 ) { return 0; } @@ -173,24 +173,23 @@ SparseArray.prototype.set = function set( v, i ) { // Define a function for printing the contents of an array and which assumes accessor protocol support: function printArray( name, x ) { - var i; - for ( i = 0; i < x.length; i++ ) { + for ( let i = 0; i < x.length; i++ ) { console.log( '%s[%d] = %d', name, i, x.get( i ) ); } } // Create a sparse array-like object: -var sparse = new SparseArray( 10, { +const sparse = new SparseArray( 10, { '2': 1, '3': 2, '8': 3 }); // Create a dense array: -var arr = [ 0, 0, 1, 2, 0, 0, 0, 0, 3, 0 ]; +const arr = [ 0, 0, 1, 2, 0, 0, 0, 0, 3, 0 ]; // Convert the dense array to an accessor array to allow for uniform iteration: -var dense = new AccessorArray( arr ); +const dense = new AccessorArray( arr ); // Print the contents of each array... printArray( 'sparse', sparse ); diff --git a/lib/node_modules/@stdlib/array/base/accessors/README.md b/lib/node_modules/@stdlib/array/base/accessors/README.md index 5cd2c86c5be8..5610cb999355 100644 --- a/lib/node_modules/@stdlib/array/base/accessors/README.md +++ b/lib/node_modules/@stdlib/array/base/accessors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var accessors = require( '@stdlib/array/base/accessors' ); +const accessors = require( '@stdlib/array/base/accessors' ); ``` #### accessors( x ) @@ -45,13 +45,13 @@ var accessors = require( '@stdlib/array/base/accessors' ); Returns element accessors for a provided array-like object. ```javascript -var obj = accessors( [ 1, 2, 3, 4 ] ); +const obj = accessors( [ 1, 2, 3, 4 ] ); // returns {...} -var bool = obj.accessorProtocol; +const bool = obj.accessorProtocol; // returns false -var fcns = obj.accessors; +const fcns = obj.accessors; // returns [ , ] ``` @@ -96,25 +96,25 @@ var fcns = obj.accessors; ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var accessors = require( '@stdlib/array/base/accessors' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const accessors = require( '@stdlib/array/base/accessors' ); // Create an array: -var x = new Complex64Array( zeroTo( 10 ) ); +const x = new Complex64Array( zeroTo( 10 ) ); // Get accessor functions for retrieving array elements: -var obj = accessors( x ); +const obj = accessors( x ); // returns {...} // Check whether the array supports the accessor protocol: -var bool = obj.accessorProtocol; +const bool = obj.accessorProtocol; // returns true console.log( 'Accessor protocol: %s', bool ); // Retrieve an array element: -var v = obj.accessors[ 0 ]( x, 1 ); +const v = obj.accessors[ 0 ]( x, 1 ); // returns console.log( 'x[1] = %s', v.toString() ); diff --git a/lib/node_modules/@stdlib/array/base/any-by-right/README.md b/lib/node_modules/@stdlib/array/base/any-by-right/README.md index fbf87377ccb6..f41ad72264e8 100644 --- a/lib/node_modules/@stdlib/array/base/any-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/any-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyByRight = require( '@stdlib/array/base/any-by-right' ); +const anyByRight = require( '@stdlib/array/base/any-by-right' ); ``` #### anyByRight( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; -var bool = anyByRight( x, isPositive ); +const bool = anyByRight( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ -1, -2, -3, -4 ]; +const x = [ -1, -2, -3, -4 ]; -var bool = anyByRight( x, isPositive ); +const bool = anyByRight( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ -1, -2, 3, -4 ]; +const x = [ -1, -2, 3, -4 ]; -var context = { +const context = { 'count': 0 }; -var bool = anyByRight( x, predicate, context ); +const bool = anyByRight( x, predicate, context ); // returns true -var cnt = context.count; +const cnt = context.count; // returns 2 ``` @@ -121,17 +121,17 @@ var cnt = context.count; ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var anyByRight = require( '@stdlib/array/base/any-by-right' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const anyByRight = require( '@stdlib/array/base/any-by-right' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = anyByRight( x, naryFunction( isPositiveInteger, 1 ) ); +const out = anyByRight( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/any-by/README.md b/lib/node_modules/@stdlib/array/base/any-by/README.md index eb2db5f67c03..5d6d74248fa2 100644 --- a/lib/node_modules/@stdlib/array/base/any-by/README.md +++ b/lib/node_modules/@stdlib/array/base/any-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyBy = require( '@stdlib/array/base/any-by' ); +const anyBy = require( '@stdlib/array/base/any-by' ); ``` #### anyBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; -var bool = anyBy( x, isPositive ); +const bool = anyBy( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ -1, -2, -3, -4 ]; +const x = [ -1, -2, -3, -4 ]; -var bool = anyBy( x, isPositive ); +const bool = anyBy( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ -1, -2, 3, -4 ]; +const x = [ -1, -2, 3, -4 ]; -var context = { +const context = { 'count': 0 }; -var bool = anyBy( x, predicate, context ); +const bool = anyBy( x, predicate, context ); // returns true -var cnt = context.count; +const cnt = context.count; // returns 3 ``` @@ -128,17 +128,17 @@ var cnt = context.count; ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var anyBy = require( '@stdlib/array/base/any-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const anyBy = require( '@stdlib/array/base/any-by' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = anyBy( x, naryFunction( isPositiveInteger, 1 ) ); +const out = anyBy( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/any/README.md b/lib/node_modules/@stdlib/array/base/any/README.md index 68be44a19c41..c25a6142f044 100644 --- a/lib/node_modules/@stdlib/array/base/any/README.md +++ b/lib/node_modules/@stdlib/array/base/any/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var any = require( '@stdlib/array/base/any' ); +const any = require( '@stdlib/array/base/any' ); ``` #### any( x ) @@ -45,9 +45,9 @@ var any = require( '@stdlib/array/base/any' ); Tests whether at least one element in an array is truthy. ```javascript -var x = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; -var bool = any( x ); +const bool = any( x ); // returns true ``` @@ -77,15 +77,15 @@ var bool = any( x ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var any = require( '@stdlib/array/base/any' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const any = require( '@stdlib/array/base/any' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = any( x ); +const out = any( x ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/arraylike2object/README.md b/lib/node_modules/@stdlib/array/base/arraylike2object/README.md index 979ec60a8df0..4caf28efe0d4 100644 --- a/lib/node_modules/@stdlib/array/base/arraylike2object/README.md +++ b/lib/node_modules/@stdlib/array/base/arraylike2object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +const arraylike2object = require( '@stdlib/array/base/arraylike2object' ); ``` #### arraylike2object( x ) @@ -45,7 +45,7 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); Converts an array-like object to an object likely to have the same "shape". ```javascript -var obj = arraylike2object( [ 1, 2, 3, 4 ] ); +const obj = arraylike2object( [ 1, 2, 3, 4 ] ); // returns {...} ``` @@ -92,14 +92,14 @@ var obj = arraylike2object( [ 1, 2, 3, 4 ] ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const arraylike2object = require( '@stdlib/array/base/arraylike2object' ); // Create an array: -var x = new Complex64Array( 10 ); +const x = new Complex64Array( 10 ); // Convert to a standardized object: -var obj = arraylike2object( x ); +const obj = arraylike2object( x ); // returns {...} console.log( obj ); diff --git a/lib/node_modules/@stdlib/array/base/assert/README.md b/lib/node_modules/@stdlib/array/base/assert/README.md index a5407b5b4ae1..b444af86e635 100644 --- a/lib/node_modules/@stdlib/array/base/assert/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/array/base/assert' ); +const ns = require( '@stdlib/array/base/assert' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/array/base/assert' ); Assertion utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -86,24 +86,24 @@ The namespace exports the following: ```javascript -var ns = require( '@stdlib/array/base/assert' ); -var dtype = require( '@stdlib/array/dtype' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Complex128Array = require( '@stdlib/array/complex128' ); +const ns = require( '@stdlib/array/base/assert' ); +const dtype = require( '@stdlib/array/dtype' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Complex128Array = require( '@stdlib/array/complex128' ); // Create various arrays: -var arr1 = new Float64Array( [ 1.1, 2.2, 3.3 ] ); -var arr2 = new Int32Array( [ 1, 2, 3 ] ); -var arr3 = new Uint8Array( [ 1, 2, 3 ] ); -var arr4 = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0 ] ); // two complex numbers: 1+1i, 2+2i +const arr1 = new Float64Array( [ 1.1, 2.2, 3.3 ] ); +const arr2 = new Int32Array( [ 1, 2, 3 ] ); +const arr3 = new Uint8Array( [ 1, 2, 3 ] ); +const arr4 = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0 ] ); // two complex numbers: 1+1i, 2+2i // Get data types: -var dt1 = dtype( arr1 ); -var dt2 = dtype( arr2 ); -var dt3 = dtype( arr3 ); -var dt4 = dtype( arr4 ); +const dt1 = dtype( arr1 ); +const dt2 = dtype( arr2 ); +const dt3 = dtype( arr3 ); +const dt4 = dtype( arr4 ); // Check data types: console.log( dt1 + ' is floating-point data type: ' + ns.isFloatingPointDataType( dt1 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/contains/README.md b/lib/node_modules/@stdlib/array/base/assert/contains/README.md index b4ab728d04c8..2c2b03a875c7 100644 --- a/lib/node_modules/@stdlib/array/base/assert/contains/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/contains/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ); +const contains = require( '@stdlib/array/base/assert/contains' ); ``` #### contains( x, value ) @@ -45,9 +45,9 @@ var contains = require( '@stdlib/array/base/assert/contains' ); Tests if an array contains a provided search value. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var out = contains( x, 2 ); +const out = contains( x, 2 ); // returns true ``` @@ -56,12 +56,12 @@ var out = contains( x, 2 ); Returns a function which tests if an array contains a provided search value. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var fcn = contains.factory( x ); +const fcn = contains.factory( x ); // returns -var out = fcn( 2 ); +let out = fcn( 2 ); // returns true out = fcn( 4 ); @@ -89,14 +89,14 @@ out = fcn( 4 ); ```javascript -var AccessorArray = require( '@stdlib/array/base/accessor' ); -var contains = require( '@stdlib/array/base/assert/contains' ); +const AccessorArray = require( '@stdlib/array/base/accessor' ); +const contains = require( '@stdlib/array/base/assert/contains' ); // Create an accessor array: -var arr = new AccessorArray( [ 1, 2, 3, 4 ] ); +const arr = new AccessorArray( [ 1, 2, 3, 4 ] ); // Check whether the array contains various values... -var bool = contains( arr, 2 ); +let bool = contains( arr, 2 ); // returns true bool = contains( arr, 4 ); diff --git a/lib/node_modules/@stdlib/array/base/assert/has-equal-values-indexed/README.md b/lib/node_modules/@stdlib/array/base/assert/has-equal-values-indexed/README.md index 1c873473766a..deb7156443bc 100644 --- a/lib/node_modules/@stdlib/array/base/assert/has-equal-values-indexed/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/has-equal-values-indexed/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' ); +const hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' ); ``` #### hasEqualValuesIndexed( x, y ) @@ -45,10 +45,10 @@ var hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values Tests if two indexed arrays have equal values. ```javascript -var x = [ 0, 0, 1, 0 ]; -var y = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; +const y = [ 0, 0, 1, 0 ]; -var bool = hasEqualValuesIndexed( x, y ); +const bool = hasEqualValuesIndexed( x, y ); // returns true ``` @@ -80,20 +80,20 @@ var bool = hasEqualValuesIndexed( x, y ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' ); -var buf = discreteUniform( 10, 0, 10 ); +const buf = discreteUniform( 10, 0, 10 ); // returns -var x = new Float64Array( buf ); +const x = new Float64Array( buf ); // returns -var y = new Float64Array( buf ); +const y = new Float64Array( buf ); // returns -var out = hasEqualValuesIndexed( x, y ); +const out = hasEqualValuesIndexed( x, y ); // returns true ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/has-equal-values/README.md b/lib/node_modules/@stdlib/array/base/assert/has-equal-values/README.md index de060ec879c7..eada656ebc6e 100644 --- a/lib/node_modules/@stdlib/array/base/assert/has-equal-values/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/has-equal-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); +const hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); ``` #### hasEqualValues( x, y ) @@ -45,10 +45,10 @@ var hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); Tests if two arrays have equal values. ```javascript -var x = [ 0, 0, 1, 0 ]; -var y = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; +const y = [ 0, 0, 1, 0 ]; -var bool = hasEqualValues( x, y ); +const bool = hasEqualValues( x, y ); // returns true ``` @@ -79,20 +79,20 @@ var bool = hasEqualValues( x, y ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); -var buf = discreteUniform( 10, 0, 10 ); +const buf = discreteUniform( 10, 0, 10 ); // returns -var x = new Complex128Array( buf ); +const x = new Complex128Array( buf ); // returns -var y = new Complex128Array( buf ); +const y = new Complex128Array( buf ); // returns -var out = hasEqualValues( x, y ); +const out = hasEqualValues( x, y ); // returns true ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/has-same-values/README.md b/lib/node_modules/@stdlib/array/base/assert/has-same-values/README.md index 120a9652af10..67de2b143bd7 100644 --- a/lib/node_modules/@stdlib/array/base/assert/has-same-values/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/has-same-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); +const hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); ``` #### hasSameValues( x, y ) @@ -45,10 +45,10 @@ var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); Tests if two arrays have the same values. ```javascript -var x = [ 0, 0, 1, 0 ]; -var y = [ 0, 0, 1, 0 ]; +const x = [ 0, 0, 1, 0 ]; +const y = [ 0, 0, 1, 0 ]; -var bool = hasSameValues( x, y ); +const bool = hasSameValues( x, y ); // returns true ``` @@ -78,20 +78,20 @@ var bool = hasSameValues( x, y ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); -var buf = discreteUniform( 10, 0, 10 ); +const buf = discreteUniform( 10, 0, 10 ); // returns -var x = new Complex128Array( buf ); +const x = new Complex128Array( buf ); // returns -var y = new Complex128Array( buf ); +const y = new Complex128Array( buf ); // returns -var out = hasSameValues( x, y ); +const out = hasSameValues( x, y ); // returns true ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md index 225cc6d06c96..e2765a87c4cc 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md @@ -35,7 +35,7 @@ An accessor array is defined as either an [`Array`][mdn-array], [`Typed Array`][ ## Usage ```javascript -var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); +const isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); ``` #### isAccessorArray( value ) @@ -43,14 +43,14 @@ var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); Tests if an array-like object supports the accessor (get/set) protocol. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); // Create a new complex number array: -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Retrieve a complex number element: -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns // Set a complex number element: @@ -59,7 +59,7 @@ arr.set( new Complex128( 1.0, 1.0 ), 0 ); // ... // Check whether an array is an accessor array: -var bool = isAccessorArray( arr ); +const bool = isAccessorArray( arr ); // returns true ``` @@ -76,20 +76,20 @@ var bool = isAccessorArray( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); - -var bool = isAccessorArray( new Complex128Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); + +let bool = isAccessorArray( new Complex128Array( 10 ) ); // returns true bool = isAccessorArray( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-boolean-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-boolean-data-type/README.md index 58a3e3c6c2a7..8a29ebc27207 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-boolean-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-boolean-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); +const isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); ``` #### isBooleanDataType( value ) @@ -45,7 +45,7 @@ var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type Tests if an input `value` is a supported array boolean data type. ```javascript -var bool = isBooleanDataType( 'bool' ); +let bool = isBooleanDataType( 'bool' ); // returns true bool = isBooleanDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isBooleanDataType( 'uint32' ); ```javascript -var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); +const isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' ); -var bool = isBooleanDataType( 'bool' ); +let bool = isBooleanDataType( 'bool' ); // returns true bool = isBooleanDataType( 'complex64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md index 33f266db84c1..d2ac3616bf46 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' ); +const isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' ); ``` #### isBooleanArray( value ) @@ -41,10 +41,10 @@ var isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' ); Tests if a value is a [`BooleanArray`][@stdlib/array/bool]. ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); -var arr = new BooleanArray( 10 ); -var bool = isBooleanArray( arr ); +const arr = new BooleanArray( 10 ); +const bool = isBooleanArray( arr ); // returns true ``` @@ -71,21 +71,21 @@ var bool = isBooleanArray( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var BooleanArray = require( '@stdlib/array/bool' ); -var isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' ); - -var bool = isBooleanArray( new BooleanArray( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' ); + +let bool = isBooleanArray( new BooleanArray( 10 ) ); // returns true bool = isBooleanArray( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-byte-order/README.md b/lib/node_modules/@stdlib/array/base/assert/is-byte-order/README.md index e7f2bfe14300..69df2d67bfea 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-byte-order/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-byte-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isByteOrder = require( '@stdlib/array/base/assert/is-byte-order' ); +const isByteOrder = require( '@stdlib/array/base/assert/is-byte-order' ); ``` #### isByteOrder( value ) @@ -45,7 +45,7 @@ var isByteOrder = require( '@stdlib/array/base/assert/is-byte-order' ); Tests if an input `value` is a supported array byte order. ```javascript -var bool = isByteOrder( 'little-endian' ); +let bool = isByteOrder( 'little-endian' ); // returns true bool = isByteOrder( 'big-endian' ); @@ -73,9 +73,9 @@ bool = isByteOrder( 'big-endian' ); ```javascript -var isByteOrder = require( '@stdlib/array/base/assert/is-byte-order' ); +const isByteOrder = require( '@stdlib/array/base/assert/is-byte-order' ); -var bool = isByteOrder( 'little-endian' ); +let bool = isByteOrder( 'little-endian' ); // returns true bool = isByteOrder( 'big-endian' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex-floating-point-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex-floating-point-data-type/README.md index 1d5200d2fbcc..64ca3aa68d35 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex-floating-point-data-type/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var isComplexFloatingPointDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' ); +const isComplexFloatingPointDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' ); ``` #### isComplexFloatingPointDataType( value ) @@ -49,7 +49,7 @@ Tests if an input `value` is a supported array complex-valued floating-point dat ```javascript -var bool = isComplexFloatingPointDataType( 'complex128' ); +let bool = isComplexFloatingPointDataType( 'complex128' ); // returns true bool = isComplexFloatingPointDataType( 'uint32' ); @@ -79,9 +79,9 @@ bool = isComplexFloatingPointDataType( 'uint32' ); ```javascript -var isComplexFloatingPointDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' ); +const isComplexFloatingPointDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' ); -var bool = isComplexFloatingPointDataType( 'complex128' ); +let bool = isComplexFloatingPointDataType( 'complex128' ); // returns true bool = isComplexFloatingPointDataType( 'complex64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md index 4c339ffb6e36..0691b6fcf136 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' ); +const isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' ); ``` #### isComplexTypedArray( value ) @@ -41,10 +41,10 @@ var isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-a Tests if a value is a complex typed array. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var arr = new Complex128Array( 10 ); -var bool = isComplexTypedArray( arr ); +const arr = new Complex128Array( 10 ); +const bool = isComplexTypedArray( arr ); // returns true ``` @@ -71,20 +71,20 @@ var bool = isComplexTypedArray( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' ); - -var bool = isComplexTypedArray( new Complex128Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' ); + +let bool = isComplexTypedArray( new Complex128Array( 10 ) ); // returns true bool = isComplexTypedArray( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md index 14e26c1cbd34..806249a178a7 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' ); +const isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' ); ``` #### isComplex128Array( value ) @@ -41,10 +41,10 @@ var isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' Tests if a value is a [`Complex128Array`][@stdlib/array/complex128]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var arr = new Complex128Array( 10 ); -var bool = isComplex128Array( arr ); +const arr = new Complex128Array( 10 ); +const bool = isComplex128Array( arr ); // returns true ``` @@ -71,20 +71,20 @@ var bool = isComplex128Array( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' ); - -var bool = isComplex128Array( new Complex128Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' ); + +let bool = isComplex128Array( new Complex128Array( 10 ) ); // returns true bool = isComplex128Array( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md index c28d06cb3655..6944f23f3706 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); +const isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); ``` #### isComplex64Array( value ) @@ -41,10 +41,10 @@ var isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); Tests if a value is a [`Complex64Array`][@stdlib/array/complex64]. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var arr = new Complex64Array( 10 ); -var bool = isComplex64Array( arr ); +const arr = new Complex64Array( 10 ); +const bool = isComplex64Array( arr ); // returns true ``` @@ -71,20 +71,20 @@ var bool = isComplex64Array( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); - -var bool = isComplex64Array( new Complex64Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); + +let bool = isComplex64Array( new Complex64Array( 10 ) ); // returns true bool = isComplex64Array( new Complex128Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-data-type/README.md index 3545a9048e64..90e4f555a072 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isDataType = require( '@stdlib/array/base/assert/is-data-type' ); +const isDataType = require( '@stdlib/array/base/assert/is-data-type' ); ``` #### isDataType( value ) @@ -45,7 +45,7 @@ var isDataType = require( '@stdlib/array/base/assert/is-data-type' ); Tests if an input `value` is a supported array data type. ```javascript -var bool = isDataType( 'float32' ); +let bool = isDataType( 'float32' ); // returns true bool = isDataType( 'int32' ); @@ -73,9 +73,9 @@ bool = isDataType( 'int32' ); ```javascript -var isDataType = require( '@stdlib/array/base/assert/is-data-type' ); +const isDataType = require( '@stdlib/array/base/assert/is-data-type' ); -var bool = isDataType( 'float32' ); +let bool = isDataType( 'float32' ); // returns true bool = isDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-floating-point-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-floating-point-data-type/README.md index 16dbe7a98148..2a0abcdad1ad 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-floating-point-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isFloatingPointDataType = require( '@stdlib/array/base/assert/is-floating-point-data-type' ); +const isFloatingPointDataType = require( '@stdlib/array/base/assert/is-floating-point-data-type' ); ``` #### isFloatingPointDataType( value ) @@ -45,7 +45,7 @@ var isFloatingPointDataType = require( '@stdlib/array/base/assert/is-floating-po Tests if an input `value` is a supported array floating-point data type. ```javascript -var bool = isFloatingPointDataType( 'float32' ); +let bool = isFloatingPointDataType( 'float32' ); // returns true bool = isFloatingPointDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isFloatingPointDataType( 'uint32' ); ```javascript -var isFloatingPointDataType = require( '@stdlib/array/base/assert/is-floating-point-data-type' ); +const isFloatingPointDataType = require( '@stdlib/array/base/assert/is-floating-point-data-type' ); -var bool = isFloatingPointDataType( 'float32' ); +let bool = isFloatingPointDataType( 'float32' ); // returns true bool = isFloatingPointDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-integer-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-integer-data-type/README.md index cc5173f7976e..e1fecd044bd3 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type' ); +const isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type' ); ``` #### isIntegerDataType( value ) @@ -45,7 +45,7 @@ var isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type Tests if an input `value` is a supported array integer (i.e., signed or unsigned integer) data type. ```javascript -var bool = isIntegerDataType( 'float32' ); +let bool = isIntegerDataType( 'float32' ); // returns false bool = isIntegerDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isIntegerDataType( 'uint32' ); ```javascript -var isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type' ); +const isIntegerDataType = require( '@stdlib/array/base/assert/is-integer-data-type' ); -var bool = isIntegerDataType( 'float32' ); +let bool = isIntegerDataType( 'float32' ); // returns false bool = isIntegerDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-mostly-safe-data-type-cast/README.md b/lib/node_modules/@stdlib/array/base/assert/is-mostly-safe-data-type-cast/README.md index 89d8dde43028..f948d7ba863e 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-mostly-safe-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-mostly-safe-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isMostlySafeCast = require( '@stdlib/array/base/assert/is-mostly-safe-data-type-cast' ); +const isMostlySafeCast = require( '@stdlib/array/base/assert/is-mostly-safe-data-type-cast' ); ``` #### isMostlySafeCast( from, to ) @@ -45,7 +45,7 @@ var isMostlySafeCast = require( '@stdlib/array/base/assert/is-mostly-safe-data-t Returns a `boolean` indicating whether an array [data type][@stdlib/array/dtypes] can be safely cast or, for floating-point data types, downcast to another array [data type][@stdlib/array/dtypes]. ```javascript -var bool = isMostlySafeCast( 'float32', 'float64' ); +let bool = isMostlySafeCast( 'float32', 'float64' ); // returns true bool = isMostlySafeCast( 'float64', 'int32' ); @@ -73,16 +73,15 @@ bool = isMostlySafeCast( 'float64', 'int32' ); ```javascript -var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var isMostlySafeCast = require( '@stdlib/array/base/assert/is-mostly-safe-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const isMostlySafeCast = require( '@stdlib/array/base/assert/is-mostly-safe-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can cast to another data type... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Can cast? %s.', dt[i].join( ' => ' ), isMostlySafeCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/is-numeric-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-numeric-data-type/README.md index ca4e07e41f83..d61a4b913a9f 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-numeric-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-numeric-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isNumericDataType = require( '@stdlib/array/base/assert/is-numeric-data-type' ); +const isNumericDataType = require( '@stdlib/array/base/assert/is-numeric-data-type' ); ``` #### isNumericDataType( value ) @@ -45,7 +45,7 @@ var isNumericDataType = require( '@stdlib/array/base/assert/is-numeric-data-type Tests if an input `value` is a supported array numeric data type. ```javascript -var bool = isNumericDataType( 'float32' ); +let bool = isNumericDataType( 'float32' ); // returns true bool = isNumericDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isNumericDataType( 'uint32' ); ```javascript -var isNumericDataType = require( '@stdlib/array/base/assert/is-numeric-data-type' ); +const isNumericDataType = require( '@stdlib/array/base/assert/is-numeric-data-type' ); -var bool = isNumericDataType( 'float32' ); +let bool = isNumericDataType( 'float32' ); // returns true bool = isNumericDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-real-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-real-data-type/README.md index 72a4a5269adb..8273a5a24f44 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-real-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-real-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isRealDataType = require( '@stdlib/array/base/assert/is-real-data-type' ); +const isRealDataType = require( '@stdlib/array/base/assert/is-real-data-type' ); ``` #### isRealDataType( value ) @@ -45,7 +45,7 @@ var isRealDataType = require( '@stdlib/array/base/assert/is-real-data-type' ); Tests if an input `value` is a supported array real-valued data type. ```javascript -var bool = isRealDataType( 'float32' ); +let bool = isRealDataType( 'float32' ); // returns true bool = isRealDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isRealDataType( 'uint32' ); ```javascript -var isRealDataType = require( '@stdlib/array/base/assert/is-real-data-type' ); +const isRealDataType = require( '@stdlib/array/base/assert/is-real-data-type' ); -var bool = isRealDataType( 'float32' ); +let bool = isRealDataType( 'float32' ); // returns true bool = isRealDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-real-floating-point-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-real-floating-point-data-type/README.md index 6153812406e3..feee87dbc7d5 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-real-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-real-floating-point-data-type/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var isRealFloatingPointDataType = require( '@stdlib/array/base/assert/is-real-floating-point-data-type' ); +const isRealFloatingPointDataType = require( '@stdlib/array/base/assert/is-real-floating-point-data-type' ); ``` #### isRealFloatingPointDataType( value ) @@ -49,7 +49,7 @@ Tests if an input `value` is a supported array real-valued floating-point data t ```javascript -var bool = isRealFloatingPointDataType( 'float32' ); +let bool = isRealFloatingPointDataType( 'float32' ); // returns true bool = isRealFloatingPointDataType( 'uint32' ); @@ -79,9 +79,9 @@ bool = isRealFloatingPointDataType( 'uint32' ); ```javascript -var isRealFloatingPointDataType = require( '@stdlib/array/base/assert/is-real-floating-point-data-type' ); +const isRealFloatingPointDataType = require( '@stdlib/array/base/assert/is-real-floating-point-data-type' ); -var bool = isRealFloatingPointDataType( 'float32' ); +let bool = isRealFloatingPointDataType( 'float32' ); // returns true bool = isRealFloatingPointDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-safe-data-type-cast/README.md b/lib/node_modules/@stdlib/array/base/assert/is-safe-data-type-cast/README.md index 6814ef3c1bbf..2fc52cc16cef 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-safe-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-safe-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSafeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ); +const isSafeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ); ``` #### isSafeCast( from, to ) @@ -45,7 +45,7 @@ var isSafeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ); Returns a `boolean` indicating whether an array [data type][@stdlib/array/dtypes] can be safely cast to another array [data type][@stdlib/array/dtypes]. ```javascript -var bool = isSafeCast( 'float32', 'float64' ); +let bool = isSafeCast( 'float32', 'float64' ); // returns true bool = isSafeCast( 'float64', 'int32' ); @@ -73,16 +73,15 @@ bool = isSafeCast( 'float64', 'int32' ); ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var isSafeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const isSafeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can safely cast from one data type to another... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Safe? %s.', dt[i].join( ' => ' ), isSafeCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/is-same-kind-data-type-cast/README.md b/lib/node_modules/@stdlib/array/base/assert/is-same-kind-data-type-cast/README.md index f7afa4c024d4..54a0934c213f 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-same-kind-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-same-kind-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameKindCast = require( '@stdlib/array/base/assert/is-same-kind-data-type-cast' ); +const isSameKindCast = require( '@stdlib/array/base/assert/is-same-kind-data-type-cast' ); ``` #### isSameKindCast( from, to ) @@ -45,7 +45,7 @@ var isSameKindCast = require( '@stdlib/array/base/assert/is-same-kind-data-type- Returns a `boolean` indicating whether an array [data type][@stdlib/array/dtypes] can be safely cast to, or is of the same "kind" as, another array [data type][@stdlib/array/dtypes] (e.g., casting between signed integers or between floats). ```javascript -var bool = isSameKindCast( 'float32', 'float64' ); +let bool = isSameKindCast( 'float32', 'float64' ); // returns true bool = isSameKindCast( 'uint16', 'int16' ); @@ -73,16 +73,15 @@ bool = isSameKindCast( 'uint16', 'int16' ); ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var isSameKindCast = require( '@stdlib/array/base/assert/is-same-kind-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const isSameKindCast = require( '@stdlib/array/base/assert/is-same-kind-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can cast from one data type to another... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Allowed cast? %s.', dt[i].join( ' => ' ), isSameKindCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/assert/is-signed-integer-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-signed-integer-data-type/README.md index 2b60ae0abf66..e4e5d90fbe54 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-signed-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-signed-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-integer-data-type' ); +const isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-integer-data-type' ); ``` #### isSignedIntegerDataType( value ) @@ -45,7 +45,7 @@ var isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-inte Tests if an input `value` is a supported array signed integer data type. ```javascript -var bool = isSignedIntegerDataType( 'float32' ); +let bool = isSignedIntegerDataType( 'float32' ); // returns false bool = isSignedIntegerDataType( 'int32' ); @@ -73,9 +73,9 @@ bool = isSignedIntegerDataType( 'int32' ); ```javascript -var isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-integer-data-type' ); +const isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-integer-data-type' ); -var bool = isSignedIntegerDataType( 'float32' ); +let bool = isSignedIntegerDataType( 'float32' ); // returns false bool = isSignedIntegerDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/assert/is-unsigned-integer-data-type/README.md b/lib/node_modules/@stdlib/array/base/assert/is-unsigned-integer-data-type/README.md index 5036775c3503..2724c4b01196 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-unsigned-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-unsigned-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned-integer-data-type' ); +const isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned-integer-data-type' ); ``` #### isUnsignedIntegerDataType( value ) @@ -45,7 +45,7 @@ var isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned- Tests if an input `value` is a supported array unsigned integer data type. ```javascript -var bool = isUnsignedIntegerDataType( 'float32' ); +let bool = isUnsignedIntegerDataType( 'float32' ); // returns false bool = isUnsignedIntegerDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isUnsignedIntegerDataType( 'uint32' ); ```javascript -var isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned-integer-data-type' ); +const isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned-integer-data-type' ); -var bool = isUnsignedIntegerDataType( 'float32' ); +let bool = isUnsignedIntegerDataType( 'float32' ); // returns false bool = isUnsignedIntegerDataType( 'float64' ); diff --git a/lib/node_modules/@stdlib/array/base/at/README.md b/lib/node_modules/@stdlib/array/base/at/README.md index 7f89c3c04016..ec086e96949e 100644 --- a/lib/node_modules/@stdlib/array/base/at/README.md +++ b/lib/node_modules/@stdlib/array/base/at/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at = require( '@stdlib/array/base/at' ); +const at = require( '@stdlib/array/base/at' ); ``` #### at( x, index ) @@ -45,9 +45,9 @@ var at = require( '@stdlib/array/base/at' ); Returns an element from an array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = at( x, 0 ); +let out = at( x, 0 ); // returns 1 out = at( x, 1 ); @@ -97,18 +97,16 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var at = require( '@stdlib/array/base/at' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const at = require( '@stdlib/array/base/at' ); // Define an array: -var x = discreteUniform( 10, -100, 100 ); +const x = discreteUniform( 10, -100, 100 ); // Define an array containing random index values: -var indices = discreteUniform( 100, -x.length, x.length-1 ); +const indices = discreteUniform( 100, -x.length, x.length-1 ); -// Randomly selected values from the input array: -var i; -for ( i = 0; i < indices.length; i++ ) { +for ( let i = 0; i < indices.length; i++ ) { console.log( 'x[%d] = %d', indices[ i ], at( x, indices[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/at2d/README.md b/lib/node_modules/@stdlib/array/base/at2d/README.md index 6ced92e9888e..83763e14720e 100644 --- a/lib/node_modules/@stdlib/array/base/at2d/README.md +++ b/lib/node_modules/@stdlib/array/base/at2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at2d = require( '@stdlib/array/base/at2d' ); +const at2d = require( '@stdlib/array/base/at2d' ); ``` #### at2d( x, i0, i1 ) @@ -45,9 +45,9 @@ var at2d = require( '@stdlib/array/base/at2d' ); Returns an element from a two-dimensional nested array. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = at2d( x, 0, 1 ); +let out = at2d( x, 0, 1 ); // returns 2 out = at2d( x, 1, 0 ); @@ -86,28 +86,28 @@ The function accepts the following arguments: ```javascript -var papply = require( '@stdlib/utils/papply' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var binary2d = require( '@stdlib/array/base/binary2d' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var at2d = require( '@stdlib/array/base/at2d' ); +const papply = require( '@stdlib/utils/papply' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const binary2d = require( '@stdlib/array/base/binary2d' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const at2d = require( '@stdlib/array/base/at2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; // Define a nested input array: -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); // Define arrays containing random index values: -var i0 = filled2dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); +const i0 = filled2dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); console.log( i0 ); -var i1 = filled2dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); +const i1 = filled2dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); console.log( i1 ); // Define an output array: -var out = zeros2d( shape ); +const out = zeros2d( shape ); console.log( out ); // Fill the output array with randomly selected values from the input array: diff --git a/lib/node_modules/@stdlib/array/base/at3d/README.md b/lib/node_modules/@stdlib/array/base/at3d/README.md index a883f54b5f38..445a1c9bd805 100644 --- a/lib/node_modules/@stdlib/array/base/at3d/README.md +++ b/lib/node_modules/@stdlib/array/base/at3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at3d = require( '@stdlib/array/base/at3d' ); +const at3d = require( '@stdlib/array/base/at3d' ); ``` #### at3d( x, i0, i1, i2 ) @@ -45,9 +45,9 @@ var at3d = require( '@stdlib/array/base/at3d' ); Returns an element from a three-dimensional nested array. ```javascript -var x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; -var out = at3d( x, 0, 0, 1 ); +let out = at3d( x, 0, 0, 1 ); // returns 2 out = at3d( x, 0, 1, 0 ); @@ -87,31 +87,31 @@ The function accepts the following arguments: ```javascript -var papply = require( '@stdlib/utils/papply' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var ternary3d = require( '@stdlib/array/base/ternary3d' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var at3d = require( '@stdlib/array/base/at3d' ); +const papply = require( '@stdlib/utils/papply' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const ternary3d = require( '@stdlib/array/base/ternary3d' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const at3d = require( '@stdlib/array/base/at3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; // Define a nested input array: -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); // Define arrays containing random index values: -var i0 = filled3dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); +const i0 = filled3dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); console.log( i0 ); -var i1 = filled3dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); +const i1 = filled3dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); console.log( i1 ); -var i2 = filled3dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); +const i2 = filled3dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); console.log( i2 ); // Define an output array: -var out = zeros3d( shape ); +const out = zeros3d( shape ); console.log( out ); // Fill the output array with randomly selected values from the input array: diff --git a/lib/node_modules/@stdlib/array/base/at4d/README.md b/lib/node_modules/@stdlib/array/base/at4d/README.md index 6e72bd42039a..319aeaa1a8d3 100644 --- a/lib/node_modules/@stdlib/array/base/at4d/README.md +++ b/lib/node_modules/@stdlib/array/base/at4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at4d = require( '@stdlib/array/base/at4d' ); +const at4d = require( '@stdlib/array/base/at4d' ); ``` #### at4d( x, i0, i1, i2, i3 ) @@ -45,9 +45,9 @@ var at4d = require( '@stdlib/array/base/at4d' ); Returns an element from a four-dimensional nested array. ```javascript -var x = [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ]; +const x = [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ]; -var out = at4d( x, 0, 0, 0, 1 ); +let out = at4d( x, 0, 0, 0, 1 ); // returns 2 out = at4d( x, 0, 0, 1, 0 ); @@ -88,34 +88,34 @@ The function accepts the following arguments: ```javascript -var papply = require( '@stdlib/utils/papply' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var quaternary4d = require( '@stdlib/array/base/quaternary4d' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var at4d = require( '@stdlib/array/base/at4d' ); +const papply = require( '@stdlib/utils/papply' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const quaternary4d = require( '@stdlib/array/base/quaternary4d' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const at4d = require( '@stdlib/array/base/at4d' ); -var shape = [ 2, 2, 4, 4 ]; +const shape = [ 2, 2, 4, 4 ]; // Define a nested input array: -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); // Define arrays containing random index values: -var i0 = filled4dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); +const i0 = filled4dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); console.log( i0 ); -var i1 = filled4dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); +const i1 = filled4dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); console.log( i1 ); -var i2 = filled4dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); +const i2 = filled4dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); console.log( i2 ); -var i3 = filled4dBy( shape, discreteUniform( -shape[3], shape[3]-1 ) ); +const i3 = filled4dBy( shape, discreteUniform( -shape[3], shape[3]-1 ) ); console.log( i3 ); // Define an output array: -var out = zeros4d( shape ); +const out = zeros4d( shape ); console.log( out ); // Fill the output array with randomly selected values from the input array: diff --git a/lib/node_modules/@stdlib/array/base/at5d/README.md b/lib/node_modules/@stdlib/array/base/at5d/README.md index 4e45b6d069e4..a215f6a36e4a 100644 --- a/lib/node_modules/@stdlib/array/base/at5d/README.md +++ b/lib/node_modules/@stdlib/array/base/at5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at5d = require( '@stdlib/array/base/at5d' ); +const at5d = require( '@stdlib/array/base/at5d' ); ``` #### at5d( x, i0, i1, i2, i3, i4 ) @@ -45,9 +45,9 @@ var at5d = require( '@stdlib/array/base/at5d' ); Returns an element from a five-dimensional nested array. ```javascript -var x = [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ]; +const x = [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ]; -var out = at5d( x, 0, 0, 0, 0, 1 ); +let out = at5d( x, 0, 0, 0, 0, 1 ); // returns 2 out = at5d( x, 0, 0, 0, 1, 0 ); @@ -89,37 +89,37 @@ The function accepts the following arguments: ```javascript -var papply = require( '@stdlib/utils/papply' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var quinary5d = require( '@stdlib/array/base/quinary5d' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var at5d = require( '@stdlib/array/base/at5d' ); +const papply = require( '@stdlib/utils/papply' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const quinary5d = require( '@stdlib/array/base/quinary5d' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const at5d = require( '@stdlib/array/base/at5d' ); -var shape = [ 2, 2, 2, 2, 2 ]; +const shape = [ 2, 2, 2, 2, 2 ]; // Define a nested input array: -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); // Define arrays containing random index values: -var i0 = filled5dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); +const i0 = filled5dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); console.log( i0 ); -var i1 = filled5dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); +const i1 = filled5dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); console.log( i1 ); -var i2 = filled5dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); +const i2 = filled5dBy( shape, discreteUniform( -shape[2], shape[2]-1 ) ); console.log( i2 ); -var i3 = filled5dBy( shape, discreteUniform( -shape[3], shape[3]-1 ) ); +const i3 = filled5dBy( shape, discreteUniform( -shape[3], shape[3]-1 ) ); console.log( i3 ); -var i4 = filled5dBy( shape, discreteUniform( -shape[4], shape[4]-1 ) ); +const i4 = filled5dBy( shape, discreteUniform( -shape[4], shape[4]-1 ) ); console.log( i4 ); // Define an output array: -var out = zeros5d( shape ); +const out = zeros5d( shape ); console.log( out ); // Fill the output array with randomly selected values from the input array: diff --git a/lib/node_modules/@stdlib/array/base/atnd/README.md b/lib/node_modules/@stdlib/array/base/atnd/README.md index dd02cc8170a5..1797d3d47f1e 100644 --- a/lib/node_modules/@stdlib/array/base/atnd/README.md +++ b/lib/node_modules/@stdlib/array/base/atnd/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var atnd = require( '@stdlib/array/base/atnd' ); +const atnd = require( '@stdlib/array/base/atnd' ); ``` #### atnd( x, i0\[, ...indices] ) @@ -45,9 +45,9 @@ var atnd = require( '@stdlib/array/base/atnd' ); Returns an element from an n-dimensional nested array. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = atnd( x, 0, 1 ); +let out = atnd( x, 0, 1 ); // returns 2 out = atnd( x, 1, 0 ); @@ -86,28 +86,28 @@ The function accepts the following arguments: ```javascript -var papply = require( '@stdlib/utils/papply' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var binary2d = require( '@stdlib/array/base/binary2d' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var atnd = require( '@stdlib/array/base/atnd' ); +const papply = require( '@stdlib/utils/papply' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const binary2d = require( '@stdlib/array/base/binary2d' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const atnd = require( '@stdlib/array/base/atnd' ); -var shape = [ 5, 5 ]; +const shape = [ 5, 5 ]; // Define a nested input array: -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); // Define arrays containing random index values: -var i0 = filled2dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); +const i0 = filled2dBy( shape, discreteUniform( -shape[0], shape[0]-1 ) ); console.log( i0 ); -var i1 = filled2dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); +const i1 = filled2dBy( shape, discreteUniform( -shape[1], shape[1]-1 ) ); console.log( i1 ); // Define an output array: -var out = zeros2d( shape ); +const out = zeros2d( shape ); console.log( out ); // Fill the output array with randomly selected values from the input array: diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-entries-by/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-entries-by/README.md index fd538b90a57b..47b8596d1a73 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-entries-by/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-entries-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateEntriesBy = require( '@stdlib/array/base/bifurcate-entries-by' ); +const bifurcateEntriesBy = require( '@stdlib/array/base/bifurcate-entries-by' ); ``` #### bifurcateEntriesBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateEntriesBy( x, predicate ); +const out = bifurcateEntriesBy( x, predicate ); // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ] ``` @@ -69,15 +69,15 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = bifurcateEntriesBy( x, predicate, context ); +const out = bifurcateEntriesBy( x, predicate, context ); // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -102,9 +102,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateEntriesBy = require( '@stdlib/array/base/bifurcate-entries-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateEntriesBy = require( '@stdlib/array/base/bifurcate-entries-by' ); function predicate( v ) { // Use the first letter of each element to define groups: @@ -112,17 +112,17 @@ function predicate( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Split the values: -var out = bifurcateEntriesBy( x, predicate ); +const out = bifurcateEntriesBy( x, predicate ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-entries/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-entries/README.md index a97d93dc9691..47870b872bfa 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-entries/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' ); +const bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' ); ``` #### bifurcateEntries( x, filter ) @@ -45,10 +45,10 @@ var bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' ); Splits array element entries into two groups. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var out = bifurcateEntries( x, filter ); +const out = bifurcateEntries( x, filter ); // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ] ``` @@ -77,27 +77,27 @@ var out = bifurcateEntries( x, filter ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, 1, { +const groups = discreteUniform( x.length, 0, 1, { 'dtype': 'generic' }); // Group the values: -var out = bifurcateEntries( x, groups ); +const out = bifurcateEntries( x, groups ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-indices-by/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-indices-by/README.md index e4433eefa0e6..07662bad0882 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-indices-by/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-indices-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateIndicesBy = require( '@stdlib/array/base/bifurcate-indices-by' ); +const bifurcateIndicesBy = require( '@stdlib/array/base/bifurcate-indices-by' ); ``` #### bifurcateIndicesBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateIndicesBy( x, predicate ); +const out = bifurcateIndicesBy( x, predicate ); // returns [ [ 0, 1, 3 ], [ 2 ] ] ``` @@ -69,15 +69,15 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = bifurcateIndicesBy( x, predicate, context ); +const out = bifurcateIndicesBy( x, predicate, context ); // returns [ [ 0, 1, 3 ], [ 2 ] ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -102,9 +102,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateIndicesBy = require( '@stdlib/array/base/bifurcate-indices-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateIndicesBy = require( '@stdlib/array/base/bifurcate-indices-by' ); function predicate( v ) { // Use the first letter of each element to define groups: @@ -112,17 +112,17 @@ function predicate( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Split the values: -var out = bifurcateIndicesBy( x, predicate ); +const out = bifurcateIndicesBy( x, predicate ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-indices/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-indices/README.md index e1f85ad2ae55..019a8693f779 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-indices/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-indices/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' ); +const bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' ); ``` #### bifurcateIndices( x, filter ) @@ -45,10 +45,10 @@ var bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' ); Splits array element indices into two groups. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var out = bifurcateIndices( x, filter ); +const out = bifurcateIndices( x, filter ); // returns [ [ 0, 1, 3 ], [ 2 ] ] ``` @@ -77,27 +77,27 @@ var out = bifurcateIndices( x, filter ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, 1, { +const groups = discreteUniform( x.length, 0, 1, { 'dtype': 'generic' }); // Group the values: -var out = bifurcateIndices( x, groups ); +const out = bifurcateIndices( x, groups ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-values-by/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-values-by/README.md index 86ed195ce3bf..00fdf41cec7b 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-values-by/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-values-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateValuesBy = require( '@stdlib/array/base/bifurcate-values-by' ); +const bifurcateValuesBy = require( '@stdlib/array/base/bifurcate-values-by' ); ``` #### bifurcateValuesBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateValuesBy( x, predicate ); +const out = bifurcateValuesBy( x, predicate ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -69,15 +69,15 @@ function predicate( v ) { return v[ 0 ] === 'b'; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = bifurcateValuesBy( x, predicate, context ); +const out = bifurcateValuesBy( x, predicate, context ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -102,9 +102,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateValuesBy = require( '@stdlib/array/base/bifurcate-values-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateValuesBy = require( '@stdlib/array/base/bifurcate-values-by' ); function predicate( v ) { // Use the first letter of each element to define groups: @@ -112,17 +112,17 @@ function predicate( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Split the values: -var out = bifurcateValuesBy( x, predicate ); +const out = bifurcateValuesBy( x, predicate ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/bifurcate-values/README.md b/lib/node_modules/@stdlib/array/base/bifurcate-values/README.md index c56c4f01ea58..b53e46b8c6d4 100644 --- a/lib/node_modules/@stdlib/array/base/bifurcate-values/README.md +++ b/lib/node_modules/@stdlib/array/base/bifurcate-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateValues = require( '@stdlib/array/base/bifurcate-values' ); +const bifurcateValues = require( '@stdlib/array/base/bifurcate-values' ); ``` #### bifurcateValues( x, filter ) @@ -45,10 +45,10 @@ var bifurcateValues = require( '@stdlib/array/base/bifurcate-values' ); Splits array element values into two groups. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var out = bifurcateValues( x, filter ); +const out = bifurcateValues( x, filter ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -77,27 +77,27 @@ var out = bifurcateValues( x, filter ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var bifurcateValues = require( '@stdlib/array/base/bifurcate-values' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const bifurcateValues = require( '@stdlib/array/base/bifurcate-values' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, 1, { +const groups = discreteUniform( x.length, 0, 1, { 'dtype': 'generic' }); // Group the values: -var out = bifurcateValues( x, groups ); +const out = bifurcateValues( x, groups ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/binary2d/README.md b/lib/node_modules/@stdlib/array/base/binary2d/README.md index 1db4cbbbd21e..6906b527cd00 100644 --- a/lib/node_modules/@stdlib/array/base/binary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/binary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binary2d = require( '@stdlib/array/base/binary2d' ); +const binary2d = require( '@stdlib/array/base/binary2d' ); ``` #### binary2d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var binary2d = require( '@stdlib/array/base/binary2d' ); Applies a binary callback to elements in two two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var z = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const z = zeros2d( [ 2, 2 ] ); -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; binary2d( [ x, x, z ], shape, add ); // z => [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] @@ -80,21 +80,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var binary2d = require( '@stdlib/array/base/binary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const binary2d = require( '@stdlib/array/base/binary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros2d( shape ); +const z = zeros2d( shape ); console.log( z ); binary2d( [ x, y, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/binary3d/README.md b/lib/node_modules/@stdlib/array/base/binary3d/README.md index 85785c110234..32afb8dafedd 100644 --- a/lib/node_modules/@stdlib/array/base/binary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/binary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binary3d = require( '@stdlib/array/base/binary3d' ); +const binary3d = require( '@stdlib/array/base/binary3d' ); ``` #### binary3d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var binary3d = require( '@stdlib/array/base/binary3d' ); Applies a binary callback to elements in two three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); -var x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; -var z = zeros3d( [ 1, 2, 2 ] ); +const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; +const z = zeros3d( [ 1, 2, 2 ] ); -var shape = [ 1, 2, 2 ]; +const shape = [ 1, 2, 2 ]; binary3d( [ x, x, z ], shape, add ); // z => [ [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] ] @@ -80,21 +80,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var binary3d = require( '@stdlib/array/base/binary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const binary3d = require( '@stdlib/array/base/binary3d' ); -var shape = [ 2, 3, 3 ]; +const shape = [ 2, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros3d( shape ); +const z = zeros3d( shape ); console.log( z ); binary3d( [ x, y, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/binary4d/README.md b/lib/node_modules/@stdlib/array/base/binary4d/README.md index c32ec998c55a..834e377815cc 100644 --- a/lib/node_modules/@stdlib/array/base/binary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/binary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binary4d = require( '@stdlib/array/base/binary4d' ); +const binary4d = require( '@stdlib/array/base/binary4d' ); ``` #### binary4d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var binary4d = require( '@stdlib/array/base/binary4d' ); Applies a binary callback to elements in two four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); -var x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; -var z = zeros4d( [ 1, 1, 2, 2 ] ); +const x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; +const z = zeros4d( [ 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 2, 2 ]; +const shape = [ 1, 1, 2, 2 ]; binary4d( [ x, x, z ], shape, add ); // z => [ [ [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] ] ] @@ -80,21 +80,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var binary4d = require( '@stdlib/array/base/binary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const binary4d = require( '@stdlib/array/base/binary4d' ); -var shape = [ 2, 2, 3, 3 ]; +const shape = [ 2, 2, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros4d( shape ); +const z = zeros4d( shape ); console.log( z ); binary4d( [ x, y, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/binary5d/README.md b/lib/node_modules/@stdlib/array/base/binary5d/README.md index 57754ab7250c..e8d4970a8433 100644 --- a/lib/node_modules/@stdlib/array/base/binary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/binary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binary5d = require( '@stdlib/array/base/binary5d' ); +const binary5d = require( '@stdlib/array/base/binary5d' ); ``` #### binary5d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var binary5d = require( '@stdlib/array/base/binary5d' ); Applies a binary callback to elements in two five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); -var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; -var z = zeros5d( [ 1, 1, 1, 2, 2 ] ); +const x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; +const z = zeros5d( [ 1, 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 1, 2, 2 ]; +const shape = [ 1, 1, 1, 2, 2 ]; binary5d( [ x, x, z ], shape, add ); // z => [ [ [ [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] ] ] ] @@ -80,21 +80,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var binary5d = require( '@stdlib/array/base/binary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const binary5d = require( '@stdlib/array/base/binary5d' ); -var shape = [ 1, 2, 2, 3, 3 ]; +const shape = [ 1, 2, 2, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros5d( shape ); +const z = zeros5d( shape ); console.log( z ); binary5d( [ x, y, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/binarynd/README.md b/lib/node_modules/@stdlib/array/base/binarynd/README.md index 6c412af33752..e311775f8862 100644 --- a/lib/node_modules/@stdlib/array/base/binarynd/README.md +++ b/lib/node_modules/@stdlib/array/base/binarynd/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binarynd = require( '@stdlib/array/base/binarynd' ); +const binarynd = require( '@stdlib/array/base/binarynd' ); ``` #### binarynd( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var binarynd = require( '@stdlib/array/base/binarynd' ); Applies a binary callback to elements in two n-dimensional nested input arrays and assigns results to elements in an n-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const shape = [ 2, 2 ]; binarynd( [ x, x, x ], shape, add ); // x => [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] @@ -77,21 +77,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledndBy = require( '@stdlib/array/base/fillednd-by' ); -var zerosnd = require( '@stdlib/array/base/zerosnd' ); -var add = require( '@stdlib/math/base/ops/add' ); -var binarynd = require( '@stdlib/array/base/binarynd' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledndBy = require( '@stdlib/array/base/fillednd-by' ); +const zerosnd = require( '@stdlib/array/base/zerosnd' ); +const add = require( '@stdlib/math/base/ops/add' ); +const binarynd = require( '@stdlib/array/base/binarynd' ); -var shape = [ 3, 3 ]; +let shape = [ 3, 3 ]; -var x = filledndBy( shape, discreteUniform( -100, 100 ) ); +let x = filledndBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledndBy( shape, discreteUniform( -100, 100 ) ); +let y = filledndBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = zerosnd( shape ); +let z = zerosnd( shape ); console.log( z ); binarynd( [ x, y, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcast-array/README.md b/lib/node_modules/@stdlib/array/base/broadcast-array/README.md index 665d2169a655..ba4fb9d1779c 100644 --- a/lib/node_modules/@stdlib/array/base/broadcast-array/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcast-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastArray = require( '@stdlib/array/base/broadcast-array' ); +const broadcastArray = require( '@stdlib/array/base/broadcast-array' ); ``` #### broadcastArray( x, inShape, outShape ) @@ -45,24 +45,24 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' ); Broadcasts an array to a specified shape. ```javascript -var x = [ 1, 2 ]; +const x = [ 1, 2 ]; -var out = broadcastArray( x, [ 2 ], [ 2, 2 ] ); +const out = broadcastArray( x, [ 2 ], [ 2, 2 ] ); // returns {...} -var shape = out.shape; +const shape = out.shape; // returns [ 2, 2 ] -var strides = out.strides; +const strides = out.strides; // returns [ 0, 1 ] -var ref = out.ref; +const ref = out.ref; // returns [ 1, 2 ] -var bool = ( x === ref ); +const bool = ( x === ref ); // returns true -var data = out.data; +const data = out.data; // returns [ [ 1, 2 ] ] ``` @@ -99,46 +99,43 @@ The function returns an object having the following properties: ```javascript -var broadcastArray = require( '@stdlib/array/base/broadcast-array' ); +const broadcastArray = require( '@stdlib/array/base/broadcast-array' ); // Create a 2x1 array: -var x = [ +const x = [ [ 1 ], [ 2 ] ]; // Broadcast the array to 3x2x4: -var o = broadcastArray( x, [ 2, 1 ], [ 3, 2, 4 ] ); +const o = broadcastArray( x, [ 2, 1 ], [ 3, 2, 4 ] ); // returns {...} // Retrieve the shape: -var sh = o.shape; +const sh = o.shape; // returns [ 3, 2, 4 ] // Retrieve the array "strides": -var st = o.strides; +const st = o.strides; // returns [...] // Initialize loop indices: -var i0 = 0; -var i1 = 0; -var i2 = 0; +let i0 = 0; +let i1 = 0; +let i2 = 0; // Iterate over elements in the broadcasted array... -var i; -var j; -var k; -for ( i = 0; i < sh[ 0 ]; i++ ) { +for ( let i = 0; i < sh[ 0 ]; i++ ) { i1 = 0; - for ( j = 0; j < sh[ 1 ]; j++ ) { + for ( let j = 0; j < sh[ 1 ]; j++ ) { i2 = 0; - for ( k = 0; k < sh[ 2 ]; k++ ) { + for ( let k = 0; k < sh[ 2 ]; k++ ) { console.log( 'y[%s] = %d', [ i, j, k ].join( ',' ), o.data[ i0 ][ i1 ][ i2 ] ); i2 += st[ 2 ]; } i1 += st[ 1 ]; } - i0 += st[ 0 ]; + i0 = st[ 0 ]; } ``` diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-binary2d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-binary2d/README.md index 52c560ef0549..10f8cdddfc0f 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-binary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-binary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' ); +const bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' ); ``` #### bbinary2d( arrays, shapes, fcn ) @@ -41,14 +41,14 @@ var bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' ); Applies a binary callback to elements in two [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = zeros2d( [ 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] @@ -85,25 +85,25 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' ); -var shapes = [ +const shapes = [ [ 1, 3 ], [ 3, 1 ], [ 3, 3 ] ]; -var x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros2d( shapes[ 2 ] ); +const z = zeros2d( shapes[ 2 ] ); console.log( z ); bbinary2d( [ x, y, z ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-binary3d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-binary3d/README.md index 6dd6a1124686..df3218bf0cf2 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-binary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-binary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' ); +const bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' ); ``` #### bbinary3d( arrays, shapes, fcn ) @@ -41,14 +41,14 @@ var bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' ); Applies a binary callback to elements in two [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a three-dimensional nested output array. ```javascript -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var add = require( '@stdlib/math/base/ops/add' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = zeros3d( [ 2, 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = zeros3d( [ 2, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 2, 2, 2 ] @@ -85,25 +85,25 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' ); -var shapes = [ +const shapes = [ [ 1, 1, 3 ], [ 3, 1, 1 ], [ 3, 3, 3 ] ]; -var x = filled3dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled3dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled3dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled3dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros3d( shapes[ 2 ] ); +const z = zeros3d( shapes[ 2 ] ); console.log( z ); bbinary3d( [ x, y, z ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-binary4d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-binary4d/README.md index ffc48d5529fc..bc901f5b4191 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-binary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-binary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' ); +const bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' ); ``` #### bbinary4d( arrays, shapes, fcn ) @@ -41,14 +41,14 @@ var bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' ); Applies a binary callback to elements in two [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a four-dimensional nested output array. ```javascript -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = zeros4d( [ 1, 2, 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = zeros4d( [ 1, 2, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 1, 2, 2, 2 ] @@ -85,25 +85,25 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 3 ], [ 1, 3, 1, 1 ], [ 1, 3, 3, 3 ] ]; -var x = filled4dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled4dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled4dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled4dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros4d( shapes[ 2 ] ); +const z = zeros4d( shapes[ 2 ] ); console.log( z ); bbinary4d( [ x, y, z ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-binary5d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-binary5d/README.md index bdf2f6c9a466..412c774c680b 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-binary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-binary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' ); +const bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' ); ``` #### bbinary5d( arrays, shapes, fcn ) @@ -41,14 +41,14 @@ var bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' ); Applies a binary callback to elements in two [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a five-dimensional nested output array. ```javascript -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = zeros5d( [ 1, 1, 2, 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = zeros5d( [ 1, 1, 2, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 1, 1, 2, 2, 2 ] @@ -85,25 +85,25 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 1, 3 ], [ 1, 1, 3, 1, 1 ], [ 1, 1, 3, 3, 3 ] ]; -var x = filled5dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled5dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled5dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled5dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = zeros5d( shapes[ 2 ] ); +const z = zeros5d( shapes[ 2 ] ); console.log( z ); bbinary5d( [ x, y, z ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-quaternary2d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-quaternary2d/README.md index 26ef29689294..9b020ad84b1e 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-quaternary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-quaternary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' ); +const bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' ); ``` #### bquaternary2d( arrays, shapes, fcn ) @@ -41,16 +41,16 @@ var bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' ); Applies a quaternary callback to elements in four [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = [ [ 5.0 ] ]; -var w = [ [ 2.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = [ [ 5.0 ] ]; +const w = [ [ 2.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 1, 1 ], @@ -89,13 +89,13 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' ); -var shapes = [ +const shapes = [ [ 1, 3 ], [ 3, 1 ], [ 1, 1 ], @@ -103,19 +103,19 @@ var shapes = [ [ 3, 3 ] ]; -var x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); +const z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled2dBy( shapes[ 3 ], discreteUniform( -100, 100 ) ); +const w = filled2dBy( shapes[ 3 ], discreteUniform( -100, 100 ) ); console.log( w ); -var out = zeros2d( shapes[ 4 ] ); +const out = zeros2d( shapes[ 4 ] ); console.log( out ); bquaternary2d( [ x, y, z, w, out ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/README.md index e84593fb46f4..be0c0576c964 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' ); +const bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' ); ``` #### bquinary2d( arrays, shapes, fcn ) @@ -41,20 +41,20 @@ var bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' ); Applies a quinary callback to elements in four [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); function add( x, y, z, w, v ) { return x + y + z + w + v; } -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = [ [ 5.0 ] ]; -var w = [ [ 2.0 ] ]; -var v = [ [ 1.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = [ [ 5.0 ] ]; +const w = [ [ 2.0 ] ]; +const v = [ [ 1.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 1, 1 ], @@ -94,16 +94,16 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' ); function add( x, y, z, w, v ) { return x + y + z + w + v; } -var shapes = [ +const shapes = [ [ 1, 3 ], [ 3, 1 ], [ 1, 1 ], @@ -112,22 +112,22 @@ var shapes = [ [ 3, 3 ] ]; -var x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); +const z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled2dBy( shapes[ 3 ], discreteUniform( -100, 100 ) ); +const w = filled2dBy( shapes[ 3 ], discreteUniform( -100, 100 ) ); console.log( w ); -var v = filled2dBy( shapes[ 4 ], discreteUniform( -100, 100 ) ); +const v = filled2dBy( shapes[ 4 ], discreteUniform( -100, 100 ) ); console.log( v ); -var out = zeros2d( shapes[ 5 ] ); +const out = zeros2d( shapes[ 5 ] ); console.log( out ); bquinary2d( [ x, y, z, w, v, out ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-ternary2d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-ternary2d/README.md index 23d59ab4e766..b486017545e6 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-ternary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-ternary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' ); +const bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' ); ``` #### bternary2d( arrays, shapes, fcn ) @@ -41,15 +41,15 @@ var bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' ); Applies a ternary callback to elements in three [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ] ]; -var y = [ [ 3.0 ], [ 4.0 ] ]; -var z = [ [ 5.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ] ]; +const y = [ [ 3.0 ], [ 4.0 ] ]; +const z = [ [ 5.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 1 ], [ 1, 1 ], @@ -87,29 +87,29 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' ); -var shapes = [ +const shapes = [ [ 1, 3 ], [ 3, 1 ], [ 1, 1 ], [ 3, 3 ] ]; -var x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); +const y = filled2dBy( shapes[ 1 ], discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); +const z = filled2dBy( shapes[ 2 ], discreteUniform( -100, 100 ) ); console.log( z ); -var out = zeros2d( shapes[ 3 ] ); +const out = zeros2d( shapes[ 3 ] ); console.log( out ); bternary2d( [ x, y, z, out ], shapes, add ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-unary2d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-unary2d/README.md index 3c867e6c4be7..f3daa13f6e58 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-unary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-unary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' ); +const bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' ); ``` #### bunary2d( arrays, shapes, fcn ) @@ -41,13 +41,13 @@ var bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' ); Applies a unary callback to elements in a [broadcasted][@stdlib/array/base/broadcast-array] nested input array and assigns results to elements in a two-dimensional nested output array. ```javascript -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ] ]; -var y = zeros2d( [ 2, 2 ] ); +const x = [ [ -1.0, -2.0 ] ]; +const y = zeros2d( [ 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 2 ], [ 2, 2 ] ]; @@ -84,21 +84,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' ); -var shapes = [ +const shapes = [ [ 1, 3 ], [ 3, 3 ] ]; -var x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled2dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros2d( shapes[ 1 ] ); +const y = zeros2d( shapes[ 1 ] ); console.log( y ); bunary2d( [ x, y ], shapes, abs ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-unary3d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-unary3d/README.md index 9443f471de2e..8d86e61c580e 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-unary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-unary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' ); +const bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' ); ``` #### bunary3d( arrays, shapes, fcn ) @@ -41,13 +41,13 @@ var bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' ); Applies a unary callback to elements in a [broadcasted][@stdlib/array/base/broadcast-array] nested input array and assigns results to elements in a three-dimensional nested output array. ```javascript -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ -1.0, -2.0 ] ] ]; -var y = zeros3d( [ 1, 2, 2 ] ); +const x = [ [ [ -1.0, -2.0 ] ] ]; +const y = zeros3d( [ 1, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 1, 2 ], [ 1, 2, 2 ] ]; @@ -84,21 +84,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' ); -var shapes = [ +const shapes = [ [ 1, 1, 3 ], [ 3, 1, 3 ] ]; -var x = filled3dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled3dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros3d( shapes[ 1 ] ); +const y = zeros3d( shapes[ 1 ] ); console.log( y ); bunary3d( [ x, y ], shapes, abs ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-unary4d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-unary4d/README.md index a69dd9b936f3..625d24b88b97 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-unary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-unary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' ); +const bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' ); ``` #### bunary4d( arrays, shapes, fcn ) @@ -41,13 +41,13 @@ var bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' ); Applies a unary callback to elements in a [broadcasted][@stdlib/array/base/broadcast-array] nested input array and assigns results to elements in a four-dimensional nested output array. ```javascript -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ -1.0, -2.0 ] ] ] ]; -var y = zeros4d( [ 1, 1, 2, 2 ] ); +const x = [ [ [ [ -1.0, -2.0 ] ] ] ]; +const y = zeros4d( [ 1, 1, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 2 ], [ 1, 1, 2, 2 ] ]; @@ -84,21 +84,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 3 ], [ 2, 3, 1, 3 ] ]; -var x = filled4dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled4dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros4d( shapes[ 1 ] ); +const y = zeros4d( shapes[ 1 ] ); console.log( y ); bunary4d( [ x, y ], shapes, abs ); diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-unary5d/README.md b/lib/node_modules/@stdlib/array/base/broadcasted-unary5d/README.md index 7c41ff2ce146..0ee34c7e500c 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-unary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/broadcasted-unary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' ); +const bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' ); ``` #### bunary5d( arrays, shapes, fcn ) @@ -41,13 +41,13 @@ var bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' ); Applies a unary callback to elements in a [broadcasted][@stdlib/array/base/broadcast-array] nested input array and assigns results to elements in a five-dimensional nested output array. ```javascript -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ [ -1.0, -2.0 ] ] ] ] ]; -var y = zeros5d( [ 1, 1, 1, 2, 2 ] ); +const x = [ [ [ [ [ -1.0, -2.0 ] ] ] ] ]; +const y = zeros5d( [ 1, 1, 1, 2, 2 ] ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 1, 2 ], [ 1, 1, 1, 2, 2 ] ]; @@ -84,21 +84,21 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' ); -var shapes = [ +const shapes = [ [ 1, 1, 1, 1, 3 ], [ 2, 2, 3, 1, 3 ] ]; -var x = filled5dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); +const x = filled5dBy( shapes[ 0 ], discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros5d( shapes[ 1 ] ); +const y = zeros5d( shapes[ 1 ] ); console.log( y ); bunary5d( [ x, y ], shapes, abs ); diff --git a/lib/node_modules/@stdlib/array/base/cartesian-power/README.md b/lib/node_modules/@stdlib/array/base/cartesian-power/README.md index 6d2f0a1fa8cf..26548779ca78 100644 --- a/lib/node_modules/@stdlib/array/base/cartesian-power/README.md +++ b/lib/node_modules/@stdlib/array/base/cartesian-power/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianPower = require( '@stdlib/array/base/cartesian-power' ); +const cartesianPower = require( '@stdlib/array/base/cartesian-power' ); ``` #### cartesianPower( x, n ) @@ -35,23 +35,23 @@ var cartesianPower = require( '@stdlib/array/base/cartesian-power' ); Returns the [Cartesian power][cartesian-product]. ```javascript -var x = [ 1, 2 ]; +const x = [ 1, 2 ]; -var out = cartesianPower( x, 2 ); +const out = cartesianPower( x, 2 ); // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] ``` If provided an empty array, the function returns an empty array. ```javascript -var out = cartesianPower( [], 2 ); +const out = cartesianPower( [], 2 ); // returns [] ``` If `n` is less than or equal to zero, the function returns an empty array. ```javascript -var out = cartesianPower( [ 1, 2 ], 0 ); +const out = cartesianPower( [ 1, 2 ], 0 ); // returns [] ``` @@ -72,12 +72,12 @@ var out = cartesianPower( [ 1, 2 ], 0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cartesianPower = require( '@stdlib/array/base/cartesian-power' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cartesianPower = require( '@stdlib/array/base/cartesian-power' ); -var x = linspace( 0, 5, 6 ); +const x = linspace( 0, 5, 6 ); -var out = cartesianPower( x, 3 ); +const out = cartesianPower( x, 3 ); // returns [ [ 0, 0, 0 ], [ 0, 0, 1 ], ..., [ 5, 5, 4 ], [ 5, 5, 5 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/base/cartesian-product/README.md b/lib/node_modules/@stdlib/array/base/cartesian-product/README.md index bab5d422de11..e7098fbf4d66 100644 --- a/lib/node_modules/@stdlib/array/base/cartesian-product/README.md +++ b/lib/node_modules/@stdlib/array/base/cartesian-product/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); +const cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); ``` #### cartesianProduct( x1, x2 ) @@ -35,20 +35,20 @@ var cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); Returns the [Cartesian product][cartesian-product]. ```javascript -var x1 = [ 1, 2, 3 ]; -var x2 = [ 4, 5 ]; +const x1 = [ 1, 2, 3 ]; +const x2 = [ 4, 5 ]; -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ] ``` If provided one or more empty arrays, the function returns an empty array. ```javascript -var x1 = [ 1, 2, 3, 4 ]; -var x2 = []; +const x1 = [ 1, 2, 3, 4 ]; +const x2 = []; -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [] ``` @@ -69,13 +69,13 @@ var out = cartesianProduct( x1, x2 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); -var x1 = linspace( 0, 5, 6 ); -var x2 = linspace( 10, 15, 6 ); +const x1 = linspace( 0, 5, 6 ); +const x2 = linspace( 10, 15, 6 ); -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [ [ 0, 10 ], [ 0, 11 ], ..., [ 5, 14 ], [ 5, 15 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/base/cartesian-square/README.md b/lib/node_modules/@stdlib/array/base/cartesian-square/README.md index 634d004c7bc2..e2e12aaff0cb 100644 --- a/lib/node_modules/@stdlib/array/base/cartesian-square/README.md +++ b/lib/node_modules/@stdlib/array/base/cartesian-square/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); +const cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); ``` #### cartesianSquare( x ) @@ -35,16 +35,16 @@ var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); Returns the [Cartesian square][cartesian-product]. ```javascript -var x = [ 1, 2 ]; +const x = [ 1, 2 ]; -var out = cartesianSquare( x ); +const out = cartesianSquare( x ); // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] ``` If provided an empty array, the function returns an empty array. ```javascript -var out = cartesianSquare( [] ); +const out = cartesianSquare( [] ); // returns [] ``` @@ -65,12 +65,12 @@ var out = cartesianSquare( [] ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); -var x = linspace( 0, 5, 6 ); +const x = linspace( 0, 5, 6 ); -var out = cartesianSquare( x ); +const out = cartesianSquare( x ); // returns [ [ 0, 0 ], [ 0, 1 ], ..., [ 5, 4 ], [ 5, 5 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/base/copy-indexed/README.md b/lib/node_modules/@stdlib/array/base/copy-indexed/README.md index e46e482ea79e..7a1a59c7a094 100644 --- a/lib/node_modules/@stdlib/array/base/copy-indexed/README.md +++ b/lib/node_modules/@stdlib/array/base/copy-indexed/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var copyIndexed = require( '@stdlib/array/base/copy-indexed' ); +const copyIndexed = require( '@stdlib/array/base/copy-indexed' ); ``` #### copyIndexed( x ) @@ -45,12 +45,12 @@ var copyIndexed = require( '@stdlib/array/base/copy-indexed' ); Copies the elements of an indexed array-like object to a new "generic" array. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var out = copyIndexed( x ); +const out = copyIndexed( x ); // returns [ 1, 2, 3 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -79,18 +79,18 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/filled-by' ); -var randu = require( '@stdlib/random/base/randu' ); -var copyIndexed = require( '@stdlib/array/base/copy-indexed' ); +const filledBy = require( '@stdlib/array/filled-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const copyIndexed = require( '@stdlib/array/base/copy-indexed' ); // Create a Float64Array: -var arr = filledBy( 10, 'float64', randu ); +const arr = filledBy( 10, 'float64', randu ); // Copy elements to a generic array: -var out = copyIndexed( arr ); +const out = copyIndexed( arr ); // Retrieve the first element: -var x = out[ 0 ]; +const x = out[ 0 ]; // returns console.log( '%d', x ); diff --git a/lib/node_modules/@stdlib/array/base/copy/README.md b/lib/node_modules/@stdlib/array/base/copy/README.md index 74ca12a829fd..b2e644a13352 100644 --- a/lib/node_modules/@stdlib/array/base/copy/README.md +++ b/lib/node_modules/@stdlib/array/base/copy/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var copy = require( '@stdlib/array/base/copy' ); +const copy = require( '@stdlib/array/base/copy' ); ``` #### copy( x ) @@ -45,12 +45,12 @@ var copy = require( '@stdlib/array/base/copy' ); Copies the elements of an array-like object to a new "generic" array. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var out = copy( x ); +const out = copy( x ); // returns [ 1, 2, 3 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -75,25 +75,25 @@ var bool = ( out === x ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var copy = require( '@stdlib/array/base/copy' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const copy = require( '@stdlib/array/base/copy' ); // Create a complex number array: -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Copy elements to a generic array: -var out = copy( arr ); +const out = copy( arr ); // Retrieve the first element: -var z = out[ 0 ]; +const z = out[ 0 ]; // returns -var re = realf( z ); +const re = realf( z ); // returns 0.0 -var im = imagf( z ); +const im = imagf( z ); // returns 0.0 console.log( '%d + %di', re, im ); diff --git a/lib/node_modules/@stdlib/array/base/count-falsy/README.md b/lib/node_modules/@stdlib/array/base/count-falsy/README.md index a831e9fccfe3..a28fff3655d9 100644 --- a/lib/node_modules/@stdlib/array/base/count-falsy/README.md +++ b/lib/node_modules/@stdlib/array/base/count-falsy/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countFalsy = require( '@stdlib/array/base/count-falsy' ); +const countFalsy = require( '@stdlib/array/base/count-falsy' ); ``` #### countFalsy( x ) @@ -45,9 +45,9 @@ var countFalsy = require( '@stdlib/array/base/count-falsy' ); Counts the number of falsy elements in an array. ```javascript -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var out = countFalsy( x ); +const out = countFalsy( x ); // returns 2 ``` @@ -72,15 +72,15 @@ var out = countFalsy( x ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var countFalsy = require( '@stdlib/array/base/count-falsy' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const countFalsy = require( '@stdlib/array/base/count-falsy' ); -var x = bernoulli( 100, 0.5, { +const x = bernoulli( 100, 0.5, { 'dtype': 'generic' }); console.log( x ); -var n = countFalsy( x ); +const n = countFalsy( x ); console.log( n ); ``` diff --git a/lib/node_modules/@stdlib/array/base/count-if/README.md b/lib/node_modules/@stdlib/array/base/count-if/README.md index 67ce597936d9..4eae95531de0 100644 --- a/lib/node_modules/@stdlib/array/base/count-if/README.md +++ b/lib/node_modules/@stdlib/array/base/count-if/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countIf = require( '@stdlib/array/base/count-if' ); +const countIf = require( '@stdlib/array/base/count-if' ); ``` #### countIf( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var out = countIf( x, predicate ); +const out = countIf( x, predicate ); // returns 3 ``` @@ -69,16 +69,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var context = { +const context = { 'count': 0 }; -var out = countIf( x, predicate, context ); +const out = countIf( x, predicate, context ); // returns 3 -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -103,17 +103,17 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var countIf = require( '@stdlib/array/base/count-if' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const countIf = require( '@stdlib/array/base/count-if' ); -var x = discreteUniform( 10, -5, 5, { +const x = discreteUniform( 10, -5, 5, { 'dtype': 'int32' }); // returns -var out = countIf( x, naryFunction( isPositiveInteger, 1 ) ); +const out = countIf( x, naryFunction( isPositiveInteger, 1 ) ); // returns console.log( x ); diff --git a/lib/node_modules/@stdlib/array/base/count-same-value-zero/README.md b/lib/node_modules/@stdlib/array/base/count-same-value-zero/README.md index 5e68b041e2e5..4970ab245fad 100644 --- a/lib/node_modules/@stdlib/array/base/count-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/array/base/count-same-value-zero/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' ); +const countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' ); ``` #### countSameValueZero( x, value ) @@ -45,27 +45,27 @@ var countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' ); Counts the number of elements in an array that are equal to a specified value. ```javascript -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var out = countSameValueZero( x, 1 ); +const out = countSameValueZero( x, 1 ); // returns 2 ``` In contrast to an implementation using the strict equality operator `===`, the function treats `NaNs` as the same value. ```javascript -var x = [ NaN, NaN, NaN ]; +const x = [ NaN, NaN, NaN ]; -var out = countSameValueZero( x, NaN ); +const out = countSameValueZero( x, NaN ); // returns 3 ``` In contrast to an implementation using the [SameValue Algorithm][@stdlib/array/base/count-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. ```javascript -var x = [ 0.0, -0.0, 0.0 ]; +const x = [ 0.0, -0.0, 0.0 ]; -var out = countSameValueZero( x, 0.0 ); +const out = countSameValueZero( x, 0.0 ); // returns 3 ``` @@ -90,15 +90,15 @@ var out = countSameValueZero( x, 0.0 ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' ); -var x = bernoulli( 10, 0.5, { +const x = bernoulli( 10, 0.5, { 'dtype': 'generic' }); console.log( x ); -var n = countSameValueZero( x, 1 ); +const n = countSameValueZero( x, 1 ); console.log( n ); ``` diff --git a/lib/node_modules/@stdlib/array/base/count-same-value/README.md b/lib/node_modules/@stdlib/array/base/count-same-value/README.md index 9fea78d76138..1a08899700c3 100644 --- a/lib/node_modules/@stdlib/array/base/count-same-value/README.md +++ b/lib/node_modules/@stdlib/array/base/count-same-value/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countSameValue = require( '@stdlib/array/base/count-same-value' ); +const countSameValue = require( '@stdlib/array/base/count-same-value' ); ``` #### countSameValue( x, value ) @@ -45,18 +45,18 @@ var countSameValue = require( '@stdlib/array/base/count-same-value' ); Counts the number of elements in an array that are equal to a specified value. ```javascript -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var out = countSameValue( x, 1 ); +const out = countSameValue( x, 1 ); // returns 2 ``` In contrast to an implementation using the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. ```javascript -var x = [ NaN, NaN, NaN ]; +const x = [ NaN, NaN, NaN ]; -var out = countSameValue( x, NaN ); +const out = countSameValue( x, NaN ); // returns 3 ``` @@ -85,15 +85,15 @@ var out = countSameValue( x, NaN ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var countSameValue = require( '@stdlib/array/base/count-same-value' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const countSameValue = require( '@stdlib/array/base/count-same-value' ); -var x = bernoulli( 10, 0.5, { +const x = bernoulli( 10, 0.5, { 'dtype': 'generic' }); console.log( x ); -var n = countSameValue( x, 1 ); +const n = countSameValue( x, 1 ); console.log( n ); ``` diff --git a/lib/node_modules/@stdlib/array/base/count-truthy/README.md b/lib/node_modules/@stdlib/array/base/count-truthy/README.md index 77e075d46af0..21f4871943dd 100644 --- a/lib/node_modules/@stdlib/array/base/count-truthy/README.md +++ b/lib/node_modules/@stdlib/array/base/count-truthy/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countTruthy = require( '@stdlib/array/base/count-truthy' ); +const countTruthy = require( '@stdlib/array/base/count-truthy' ); ``` #### countTruthy( x ) @@ -45,9 +45,9 @@ var countTruthy = require( '@stdlib/array/base/count-truthy' ); Counts the number of truthy elements in an array. ```javascript -var x = [ 0, 1, 0, 1, 2 ]; +const x = [ 0, 1, 0, 1, 2 ]; -var out = countTruthy( x ); +const out = countTruthy( x ); // returns 3 ``` @@ -72,15 +72,15 @@ var out = countTruthy( x ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var countTruthy = require( '@stdlib/array/base/count-truthy' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const countTruthy = require( '@stdlib/array/base/count-truthy' ); -var x = bernoulli( 100, 0.5, { +const x = bernoulli( 100, 0.5, { 'dtype': 'generic' }); console.log( x ); -var n = countTruthy( x ); +const n = countTruthy( x ); console.log( n ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuany-by-right/README.md b/lib/node_modules/@stdlib/array/base/cuany-by-right/README.md index e17d5b78c49a..bc3857ff4e08 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/cuany-by-right/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cuanyByRight = require( '@stdlib/array/base/cuany-by-right' ); +const cuanyByRight = require( '@stdlib/array/base/cuany-by-right' ); ``` #### cuanyByRight( x, predicate\[, thisArg] ) @@ -39,9 +39,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; +const x = [ 0, 0, 0, 1, 0 ]; -var y = cuanyByRight( x, isPositive ); +const y = cuanyByRight( x, isPositive ); // returns [ false, true, true, true, true ] ``` @@ -59,16 +59,16 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 1, 0, 0, 0 ]; +const x = [ 0, 1, 0, 0, 0 ]; -var context = { +const context = { 'count': 0 }; -var out = cuanyByRight( x, isPositive, context ); +const out = cuanyByRight( x, isPositive, context ); // returns [ false, false, false, true, true ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -81,13 +81,13 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 1, 0, 0, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 0, 1, 0, 0, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cuanyByRight.assign( x, y, 2, 0, isPositive ); +const out = cuanyByRight.assign( x, y, 2, 0, isPositive ); // returns [ false, null, false, null, false, null, true, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -116,18 +116,18 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cuanyByRight = require( '@stdlib/array/base/cuany-by-right' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cuanyByRight = require( '@stdlib/array/base/cuany-by-right' ); function isPositive( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); -var out = cuanyByRight( x, isPositive ); +const out = cuanyByRight( x, isPositive ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuany-by/README.md b/lib/node_modules/@stdlib/array/base/cuany-by/README.md index f1030a97878f..ac016fd54291 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by/README.md +++ b/lib/node_modules/@stdlib/array/base/cuany-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cuanyBy = require( '@stdlib/array/base/cuany-by' ); +const cuanyBy = require( '@stdlib/array/base/cuany-by' ); ``` #### cuanyBy( x, predicate\[, thisArg] ) @@ -39,9 +39,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; +const x = [ 0, 0, 0, 1, 0 ]; -var y = cuanyBy( x, isPositive ); +const y = cuanyBy( x, isPositive ); // returns [ false, false, false, true, true ] ``` @@ -59,16 +59,16 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; +const x = [ 0, 0, 0, 1, 0 ]; -var context = { +const context = { 'count': 0 }; -var out = cuanyBy( x, isPositive, context ); +const out = cuanyBy( x, isPositive, context ); // returns [ false, false, false, true, true ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -81,13 +81,13 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 0, 0, 0, 1, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cuanyBy.assign( x, y, 2, 0, isPositive ); +const out = cuanyBy.assign( x, y, 2, 0, isPositive ); // returns [ false, null, false, null, false, null, true, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -116,19 +116,19 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cuanyBy = require( '@stdlib/array/base/cuany-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cuanyBy = require( '@stdlib/array/base/cuany-by' ); function isPositive( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); // Cumulatively determine whether at least one element is positive: -var out = cuanyBy( x, isPositive ); +const out = cuanyBy( x, isPositive ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuany/README.md b/lib/node_modules/@stdlib/array/base/cuany/README.md index 39053f03339f..2ac45990cc55 100644 --- a/lib/node_modules/@stdlib/array/base/cuany/README.md +++ b/lib/node_modules/@stdlib/array/base/cuany/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cuany = require( '@stdlib/array/base/cuany' ); +const cuany = require( '@stdlib/array/base/cuany' ); ``` #### cuany( x ) @@ -35,9 +35,9 @@ var cuany = require( '@stdlib/array/base/cuany' ); Cumulatively tests whether at least one element in a provided array is truthy. ```javascript -var x = [ false, false, true, false, false ]; +const x = [ false, false, true, false, false ]; -var y = cuany( x ); +const y = cuany( x ); // returns [ false, false, true, true, true ]; ``` @@ -46,13 +46,13 @@ var y = cuany( x ); Cumulatively tests whether at least one element in a provided array is truthy and assigns results to a provided output array. ```javascript -var x = [ false, false, true, false, false ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ false, false, true, false, false ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cuany.assign( x, y, 2, 0 ); +const out = cuany.assign( x, y, 2, 0 ); // returns [ false, null, false, null, true, null, true, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -80,15 +80,15 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cuany = require( '@stdlib/array/base/cuany' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cuany = require( '@stdlib/array/base/cuany' ); // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); // Cumulatively determine whether values are truthy: -var out = cuany( x ); +const out = cuany( x ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuevery-by-right/README.md b/lib/node_modules/@stdlib/array/base/cuevery-by-right/README.md index 17dca3bf05b6..a6b531d8568f 100644 --- a/lib/node_modules/@stdlib/array/base/cuevery-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/cuevery-by-right/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cueveryByRight = require( '@stdlib/array/base/cuevery-by-right' ); +const cueveryByRight = require( '@stdlib/array/base/cuevery-by-right' ); ``` #### cueveryByRight( x, predicate\[, thisArg ] ) @@ -39,9 +39,9 @@ function fcn( value ) { return value > 0; } -var x = [ 0, 0, 1, 1, 1 ]; +const x = [ 0, 0, 1, 1, 1 ]; -var y = cueveryByRight( x, fcn ); +const y = cueveryByRight( x, fcn ); // returns [ true, true, true, false, false ]; ``` @@ -54,13 +54,13 @@ function fcn( v ) { return v > 0; } -var x = [ 0, 0, 1, 1, 1 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 0, 0, 1, 1, 1 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cueveryByRight.assign( x, y, 2, 0, fcn ); +const out = cueveryByRight.assign( x, y, 2, 0, fcn ); // returns [ true, null, true, null, true, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -78,16 +78,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 0, 0, 1, 1, 1 ]; +const x = [ 0, 0, 1, 1, 1 ]; -var context = { +const context = { 'count': 0 }; -var bool = cueveryByRight( x, fcn, context ); +const bool = cueveryByRight( x, fcn, context ); // returns [ true, true, true, false, false ] -var count = context.count; +const count = context.count; // returns 4 ``` @@ -108,19 +108,19 @@ var count = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var cueveryByRight = require( '@stdlib/array/base/cuevery-by-right' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const cueveryByRight = require( '@stdlib/array/base/cuevery-by-right' ); function isPositive( value ) { return ( value > 0 ); } // Create an array of random values: -var x = discreteUniform( 10, -10, 10 ); +const x = discreteUniform( 10, -10, 10 ); console.log( x ); // Cumulatively test whether every array element passes a test, while iterating from right-to-left: -var out = cueveryByRight( x, isPositive ); +const out = cueveryByRight( x, isPositive ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuevery-by/README.md b/lib/node_modules/@stdlib/array/base/cuevery-by/README.md index 346246a63270..ef84734a5ec4 100644 --- a/lib/node_modules/@stdlib/array/base/cuevery-by/README.md +++ b/lib/node_modules/@stdlib/array/base/cuevery-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cueveryBy = require( '@stdlib/array/base/cuevery-by' ); +const cueveryBy = require( '@stdlib/array/base/cuevery-by' ); ``` #### cueveryBy( x, predicate\[, thisArg ] ) @@ -39,9 +39,9 @@ function fcn( value) { return ( value > 0 ); } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var y = cueveryBy( x, fcn ); +const y = cueveryBy( x, fcn ); // returns [ true, true, false, false, false ] ``` @@ -59,16 +59,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var context = { +const context = { 'count': 0 }; -var bool = cueveryBy( x, fcn, context ); +const bool = cueveryBy( x, fcn, context ); // returns [ true, true, false, false, false ] -var count = context.count; +const count = context.count; // returns 3 ``` @@ -81,13 +81,13 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 1, 1, 0, 0, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 1, 1, 0, 0, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cueveryBy.assign( x, y, 2, 0, fcn ); +const out = cueveryBy.assign( x, y, 2, 0, fcn ); // returns [ true, null, true, null, false, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -108,19 +108,19 @@ var bool = ( out === y ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cueveryBy = require( '@stdlib/array/base/cuevery-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cueveryBy = require( '@stdlib/array/base/cuevery-by' ); function fcn( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.8 ); +const x = bernoulli( 10, 0.8 ); console.log( x ); // Cumulatively tests whether every array element passes a test: -var y = cueveryBy( x, fcn ); +const y = cueveryBy( x, fcn ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cuevery/README.md b/lib/node_modules/@stdlib/array/base/cuevery/README.md index 5ce4595c8ab5..895925bedba0 100644 --- a/lib/node_modules/@stdlib/array/base/cuevery/README.md +++ b/lib/node_modules/@stdlib/array/base/cuevery/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cuevery = require( '@stdlib/array/base/cuevery' ); +const cuevery = require( '@stdlib/array/base/cuevery' ); ``` #### cuevery( x ) @@ -35,9 +35,9 @@ var cuevery = require( '@stdlib/array/base/cuevery' ); Cumulatively tests whether every element in a provided array is truthy. ```javascript -var x = [ true, true, true, false, true ]; +const x = [ true, true, true, false, true ]; -var y = cuevery( x ); +const y = cuevery( x ); // returns [ true, true, true, false, false ]; ``` @@ -46,13 +46,13 @@ var y = cuevery( x ); Cumulatively tests whether every element in a provided array is truthy and assigns results to a provided output array. ```javascript -var x = [ true, true, true, false, true ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ true, true, true, false, true ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cuevery.assign( x, y, 2, 0 ); +const out = cuevery.assign( x, y, 2, 0 ); // returns [ true, null, true, null, true, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -80,15 +80,15 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cuevery = require( '@stdlib/array/base/cuevery' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cuevery = require( '@stdlib/array/base/cuevery' ); // Create an array of random values: -var x = bernoulli( 10, 0.9 ); +const x = bernoulli( 10, 0.9 ); console.log( x ); // Cumulatively determine whether values are truthy: -var out = cuevery( x ); +const out = cuevery( x ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cunone-by-right/README.md b/lib/node_modules/@stdlib/array/base/cunone-by-right/README.md index 4c2920358c99..bf1ec8f4d668 100644 --- a/lib/node_modules/@stdlib/array/base/cunone-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/cunone-by-right/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cunoneByRight = require( '@stdlib/array/base/cunone-by-right' ); +const cunoneByRight = require( '@stdlib/array/base/cunone-by-right' ); ``` #### cunoneByRight( x, predicate\[, thisArg ] ) @@ -39,9 +39,9 @@ function fcn( value ) { return value > 0; } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var y = cunoneByRight( x, fcn ); +const y = cunoneByRight( x, fcn ); // returns [ true, true, true, false, false ]; ``` @@ -59,16 +59,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var context = { +const context = { 'count': 0 }; -var bool = cunoneByRight( x, fcn, context ); +const bool = cunoneByRight( x, fcn, context ); // returns [ true, true, true, false, false ] -var count = context.count; +const count = context.count; // returns 4 ``` @@ -81,13 +81,13 @@ function fcn( v ) { return v > 0; } -var x = [ 1, 1, 0, 0, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 1, 1, 0, 0, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cunoneByRight.assign( x, y, 2, 0, fcn ); +const out = cunoneByRight.assign( x, y, 2, 0, fcn ); // returns [ true, null, true, null, true, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -108,19 +108,19 @@ var bool = ( out === y ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cunoneByRight = require( '@stdlib/array/base/cunone-by-right' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cunoneByRight = require( '@stdlib/array/base/cunone-by-right' ); function fcn( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); // Cumulatively test whether no array element passes a test, while iterating from right-to-left: -var out = cunoneByRight( x, fcn ); +const out = cunoneByRight( x, fcn ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cunone-by/README.md b/lib/node_modules/@stdlib/array/base/cunone-by/README.md index 36b8188e96a0..04beb5f3669d 100644 --- a/lib/node_modules/@stdlib/array/base/cunone-by/README.md +++ b/lib/node_modules/@stdlib/array/base/cunone-by/README.md @@ -28,7 +28,7 @@ limitations under the License. ## Usage ```javascript -var cunoneBy = require( '@stdlib/array/base/cunone-by' ); +const cunoneBy = require( '@stdlib/array/base/cunone-by' ); ``` #### cunoneBy( x, predicate\[, thisArg ] ) @@ -40,9 +40,9 @@ function fcn( value) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; +const x = [ 0, 0, 0, 1, 0 ]; -var y = cunoneBy( x, fcn ); +const y = cunoneBy( x, fcn ); // returns [ true, true, true, false, false ] ``` @@ -60,16 +60,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 0, 0, 1, 0, 0 ]; +const x = [ 0, 0, 1, 0, 0 ]; -var context = { +const context = { 'count': 0 }; -var bool = cunoneBy( x, fcn, context ); +const bool = cunoneBy( x, fcn, context ); // returns [ true, true, false, false, false ] -var count = context.count; +const count = context.count; // returns 3 ``` @@ -82,13 +82,13 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 0, 0, 0, 1, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 0, 0, 0, 1, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cunoneBy.assign( x, y, 2, 0, fcn ); +const out = cunoneBy.assign( x, y, 2, 0, fcn ); // returns [ true, null, true, null, true, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -109,19 +109,19 @@ var bool = ( out === y ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cunoneBy = require( '@stdlib/array/base/cunone-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cunoneBy = require( '@stdlib/array/base/cunone-by' ); function fcn( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); // Cumulatively tests whether every array element fails a test: -var y = cunoneBy( x, fcn ); +const y = cunoneBy( x, fcn ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cunone/README.md b/lib/node_modules/@stdlib/array/base/cunone/README.md index 8a9677340c9c..a1a61a41bf06 100644 --- a/lib/node_modules/@stdlib/array/base/cunone/README.md +++ b/lib/node_modules/@stdlib/array/base/cunone/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cunone = require( '@stdlib/array/base/cunone' ); +const cunone = require( '@stdlib/array/base/cunone' ); ``` #### cunone( x ) @@ -35,9 +35,9 @@ var cunone = require( '@stdlib/array/base/cunone' ); Cumulatively tests whether every element in a provided array is falsy. ```javascript -var x = [ false, false, false, true, false ]; +const x = [ false, false, false, true, false ]; -var y = cunone( x ); +const y = cunone( x ); // returns [ true, true, true, false, false ]; ``` @@ -46,13 +46,13 @@ var y = cunone( x ); Cumulatively tests whether every element in a provided array is falsy and assigns results to a provided output array. ```javascript -var x = [ false, false, false, true, false ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ false, false, false, true, false ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cunone.assign( x, y, 2, 0 ); +const out = cunone.assign( x, y, 2, 0 ); // returns [ true, null, true, null, true, null, false, null, false, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -80,15 +80,15 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cunone = require( '@stdlib/array/base/cunone' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cunone = require( '@stdlib/array/base/cunone' ); // Create an array of random values: -var x = bernoulli( 10, 0.1 ); +const x = bernoulli( 10, 0.1 ); console.log( x ); // Cumulatively determine whether values are falsy: -var out = cunone( x ); +const out = cunone( x ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cusome-by-right/README.md b/lib/node_modules/@stdlib/array/base/cusome-by-right/README.md index 4480a1158bb2..affecd3e52fd 100644 --- a/lib/node_modules/@stdlib/array/base/cusome-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/cusome-by-right/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cusomeByRight = require( '@stdlib/array/base/cusome-by-right' ); +const cusomeByRight = require( '@stdlib/array/base/cusome-by-right' ); ``` #### cusomeByRight( x, n, predicate\[, thisArg ] ) @@ -39,9 +39,9 @@ function fcn( value ) { return value > 0; } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var y = cusomeByRight( x, 2, fcn ); +const y = cusomeByRight( x, 2, fcn ); // returns [ false, false, false, false, true ]; ``` @@ -59,16 +59,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 1, 1, 0, 0, 0 ]; +const x = [ 1, 1, 0, 0, 0 ]; -var context = { +const context = { 'count': 0 }; -var bool = cusomeByRight( x, 2, fcn, context ); +const bool = cusomeByRight( x, 2, fcn, context ); // returns [ false, false, false, false, true ] -var count = context.count; +const count = context.count; // returns 5 ``` @@ -81,13 +81,13 @@ function fcn( v ) { return v > 0; } -var x = [ 1, 1, 0, 0, 0 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 1, 1, 0, 0, 0 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cusomeByRight.assign( x, 2, y, 2, 0, fcn ); +const out = cusomeByRight.assign( x, 2, y, 2, 0, fcn ); // returns [ false, null, false, null, false, null, false, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -108,22 +108,22 @@ var bool = ( out === y ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cusomeByRight = require( '@stdlib/array/base/cusome-by-right' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cusomeByRight = require( '@stdlib/array/base/cusome-by-right' ); function fcn( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.3 ); +const x = bernoulli( 10, 0.3 ); console.log( x ); // Minimum number of required positive array elements: -var n = 2; +const n = 2; // Cumulatively test whether at least `n` array elements pass a test, while iterating from right-to-left: -var out = cusomeByRight( x, n, fcn ); +const out = cusomeByRight( x, n, fcn ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cusome-by/README.md b/lib/node_modules/@stdlib/array/base/cusome-by/README.md index 60784e802c8d..3b1904f7b8a8 100644 --- a/lib/node_modules/@stdlib/array/base/cusome-by/README.md +++ b/lib/node_modules/@stdlib/array/base/cusome-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cusomeBy = require( '@stdlib/array/base/cusome-by' ); +const cusomeBy = require( '@stdlib/array/base/cusome-by' ); ``` #### cusomeBy( x, n, predicate\[, thisArg ] ) @@ -39,9 +39,9 @@ function fcn( value) { return ( value > 0 ); } -var x = [ 0, 0, 0, 1, 1 ]; +const x = [ 0, 0, 0, 1, 1 ]; -var y = cusomeBy( x, 2, fcn ); +const y = cusomeBy( x, 2, fcn ); // returns [ false, false, false , false, true ] ``` @@ -59,16 +59,16 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 0, 0, 0, 1, 1 ]; +const x = [ 0, 0, 0, 1, 1 ]; -var context = { +const context = { 'count': 0 }; -var bool = cusomeBy( x, 1, fcn, context ); +const bool = cusomeBy( x, 1, fcn, context ); // returns [ false, false, false, true, true ] -var count = context.count; +const count = context.count; // returns 4 ``` @@ -81,13 +81,13 @@ function fcn( v ) { return ( v > 0 ); } -var x = [ 0, 0, 0, 1, 1 ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ 0, 0, 0, 1, 1 ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cusomeBy.assign( x, 2, y, 2, 0, fcn ); +const out = cusomeBy.assign( x, 2, y, 2, 0, fcn ); // returns [ false, null, false, null, false, null, false, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -108,19 +108,19 @@ var bool = ( out === y ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cusomeBy = require( '@stdlib/array/base/cusome-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cusomeBy = require( '@stdlib/array/base/cusome-by' ); function fcn( value ) { return ( value > 0 ); } // Create an array of random values: -var x = bernoulli( 10, 0.8 ); +const x = bernoulli( 10, 0.8 ); console.log( x ); // Cumulatively test whether at least three array elements are positive: -var y = cusomeBy( x, 3, fcn ); +const y = cusomeBy( x, 3, fcn ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/cusome/README.md b/lib/node_modules/@stdlib/array/base/cusome/README.md index cbc394963f44..4381e8baed6f 100644 --- a/lib/node_modules/@stdlib/array/base/cusome/README.md +++ b/lib/node_modules/@stdlib/array/base/cusome/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cusome = require( '@stdlib/array/base/cusome' ); +const cusome = require( '@stdlib/array/base/cusome' ); ``` #### cusome( x, n ) @@ -35,9 +35,9 @@ var cusome = require( '@stdlib/array/base/cusome' ); Cumulatively tests whether at least `n` array elements in a provided array are truthy. ```javascript -var x = [ false, false, false, true, true ]; +const x = [ false, false, false, true, true ]; -var y = cusome( x, 2 ); +const y = cusome( x, 2 ); // returns [ false, false, false, false, true ]; ``` @@ -46,13 +46,13 @@ var y = cusome( x, 2 ); Cumulatively tests whether at least `n` array elements in a provided array are truthy and assigns results to a provided output array. ```javascript -var x = [ false, false, false, true, true ]; -var y = [ false, null, false, null, false, null, false, null, false, null ]; +const x = [ false, false, false, true, true ]; +const y = [ false, null, false, null, false, null, false, null, false, null ]; -var out = cusome.assign( x, 2, y, 2, 0 ); +const out = cusome.assign( x, 2, y, 2, 0 ); // returns [ false, null, false, null, false, null, false, null, true, null ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -81,15 +81,15 @@ The function supports the following parameters: ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var cusome = require( '@stdlib/array/base/cusome' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const cusome = require( '@stdlib/array/base/cusome' ); // Create an array of random values: -var x = bernoulli( 10, 0.3 ); +const x = bernoulli( 10, 0.3 ); console.log( x ); // Cumulatively test whether at least two array elements are truthy: -var out = cusome( x, 2 ); +const out = cusome( x, 2 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/dedupe/README.md b/lib/node_modules/@stdlib/array/base/dedupe/README.md index b25a7de5a179..78cf15823288 100644 --- a/lib/node_modules/@stdlib/array/base/dedupe/README.md +++ b/lib/node_modules/@stdlib/array/base/dedupe/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dedupe = require( '@stdlib/array/base/dedupe' ); +const dedupe = require( '@stdlib/array/base/dedupe' ); ``` #### dedupe( x, limit, equalNaNs ) @@ -45,33 +45,33 @@ var dedupe = require( '@stdlib/array/base/dedupe' ); Removes consecutive duplicated values. ```javascript -var x = [ 1, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 3, 3 ]; -var y = dedupe( x, 1, false ); +const y = dedupe( x, 1, false ); // returns [ 1, 2, 3 ] -var bool = ( x === y ); +const bool = ( x === y ); // returns true ``` When `equalNaNs` is `false`, `NaN` values are considered distinct, and, when `equalNaNs` is `true`, `NaN` values are considered equal. ```javascript -var x = [ NaN, NaN, 2, NaN, NaN ]; +const x = [ NaN, NaN, 2, NaN, NaN ]; -var y1 = dedupe( x, 1, false ); +const y1 = dedupe( x, 1, false ); // returns [ NaN, NaN, 2, NaN, NaN ] -var y2 = dedupe( x, 1, true ); +const y2 = dedupe( x, 1, true ); // returns [ NaN, 2, NaN ] ``` To allow consecutive duplicate values up to a specified limit, provide a `limit` argument greater than one. ```javascript -var x = [ 1, 1, 1, 2, 2, 3, 3, 3 ]; +const x = [ 1, 1, 1, 2, 2, 3, 3, 3 ]; -var y = dedupe( x, 2, false ); +const y = dedupe( x, 2, false ); // returns [ 1, 1, 2, 2, 3, 3 ] ``` @@ -100,17 +100,17 @@ var y = dedupe( x, 2, false ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dedupe = require( '@stdlib/array/base/dedupe' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dedupe = require( '@stdlib/array/base/dedupe' ); // Create an array of random numbers: -var x = discreteUniform( 30, 0, 5, { +const x = discreteUniform( 30, 0, 5, { 'dtype': 'generic' }); // returns [...] // Remove consecutive duplicates: -var y = dedupe( x, 1, false ); +const y = dedupe( x, 1, false ); // returns [...] console.log( y ); diff --git a/lib/node_modules/@stdlib/array/base/every-by-right/README.md b/lib/node_modules/@stdlib/array/base/every-by-right/README.md index 373056069435..f8a55642e9e9 100644 --- a/lib/node_modules/@stdlib/array/base/every-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/every-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyByRight = require( '@stdlib/array/base/every-by-right' ); +const everyByRight = require( '@stdlib/array/base/every-by-right' ); ``` #### everyByRight( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var bool = everyByRight( x, isPositive ); +const bool = everyByRight( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, -2, 3, 4 ]; +const x = [ 1, -2, 3, 4 ]; -var bool = everyByRight( x, isPositive ); +const bool = everyByRight( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 1, -2, 3, 4 ]; +const x = [ 1, -2, 3, 4 ]; -var context = { +const context = { 'count': 0 }; -var bool = everyByRight( x, predicate, context ); +const bool = everyByRight( x, predicate, context ); // returns false -var cnt = context.count; +const cnt = context.count; // returns 3 ``` @@ -121,17 +121,17 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var everyByRight = require( '@stdlib/array/base/every-by-right' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const everyByRight = require( '@stdlib/array/base/every-by-right' ); -var x = discreteUniform( 10, 0, 10, { +const x = discreteUniform( 10, 0, 10, { 'dtype': 'int32' }); // returns -var out = everyByRight( x, naryFunction( isPositiveInteger, 1 ) ); +const out = everyByRight( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/every-by/README.md b/lib/node_modules/@stdlib/array/base/every-by/README.md index f39acb5910ed..10070615b09d 100644 --- a/lib/node_modules/@stdlib/array/base/every-by/README.md +++ b/lib/node_modules/@stdlib/array/base/every-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyBy = require( '@stdlib/array/base/every-by' ); +const everyBy = require( '@stdlib/array/base/every-by' ); ``` #### everyBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var bool = everyBy( x, isPositive ); +const bool = everyBy( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, -2, 3, 4 ]; +const x = [ 1, -2, 3, 4 ]; -var bool = everyBy( x, isPositive ); +const bool = everyBy( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 1, 2, -3, 4 ]; +const x = [ 1, 2, -3, 4 ]; -var context = { +const context = { 'count': 0 }; -var bool = everyBy( x, predicate, context ); +const bool = everyBy( x, predicate, context ); // returns false -var cnt = context.count; +const cnt = context.count; // returns 3 ``` @@ -128,17 +128,17 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var everyBy = require( '@stdlib/array/base/every-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const everyBy = require( '@stdlib/array/base/every-by' ); -var x = discreteUniform( 10, 0, 10, { +const x = discreteUniform( 10, 0, 10, { 'dtype': 'int32' }); // returns -var out = everyBy( x, naryFunction( isPositiveInteger, 1 ) ); +const out = everyBy( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/every/README.md b/lib/node_modules/@stdlib/array/base/every/README.md index 183aeff7afcf..3bae4ce140da 100644 --- a/lib/node_modules/@stdlib/array/base/every/README.md +++ b/lib/node_modules/@stdlib/array/base/every/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var every = require( '@stdlib/array/base/every' ); +const every = require( '@stdlib/array/base/every' ); ``` #### every( x ) @@ -45,9 +45,9 @@ var every = require( '@stdlib/array/base/every' ); Tests whether all elements in an array are truthy. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var bool = every( x ); +const bool = every( x ); // returns true ``` @@ -77,15 +77,15 @@ var bool = every( x ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var every = require( '@stdlib/array/base/every' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const every = require( '@stdlib/array/base/every' ); -var x = discreteUniform( 10, 0, 10, { +const x = discreteUniform( 10, 0, 10, { 'dtype': 'int32' }); // returns -var out = every( x ); +const out = every( x ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/fancy-slice-assign/README.md b/lib/node_modules/@stdlib/array/base/fancy-slice-assign/README.md index 7e73d0b68bf0..301451384f10 100644 --- a/lib/node_modules/@stdlib/array/base/fancy-slice-assign/README.md +++ b/lib/node_modules/@stdlib/array/base/fancy-slice-assign/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); +const sliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); ``` #### slice( x, y, s, strict ) @@ -45,18 +45,18 @@ var sliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); Assigns element values from a broadcasted input array to corresponding elements in an output array. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var x = [ 1, 2, 3, 4 ]; -var y = [ 0, 0, 0, 0, 0, 0, 0, 0 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 0, 0, 0, 0, 0, 0, 0, 0 ]; -var s = new Slice( null, null, -2 ); +const s = new Slice( null, null, -2 ); // returns -var out = sliceAssign( x, y, s, false ); +const out = sliceAssign( x, y, s, false ); // returns [ 0, 4, 0, 3, 0, 2, 0, 1 ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -93,19 +93,19 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/zero-to' ); -var zeros = require( '@stdlib/array/zeros' ); -var Slice = require( '@stdlib/slice/ctor' ); -var sliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const zeros = require( '@stdlib/array/zeros' ); +const Slice = require( '@stdlib/slice/ctor' ); +const sliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); -var x = zeroTo( 10, 'generic' ); +let x = zeroTo( 10, 'generic' ); // returns [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] -var y = zeros( 10, 'generic' ); +let y = zeros( 10, 'generic' ); // returns [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] -var s = new Slice(); -var out = sliceAssign( x, y, s, false ); +let s = new Slice(); +let out = sliceAssign( x, y, s, false ); // returns [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] x = zeroTo( 5, 'generic' ); diff --git a/lib/node_modules/@stdlib/array/base/fancy-slice/README.md b/lib/node_modules/@stdlib/array/base/fancy-slice/README.md index c8e4b0e1fc76..0347c385b04d 100644 --- a/lib/node_modules/@stdlib/array/base/fancy-slice/README.md +++ b/lib/node_modules/@stdlib/array/base/fancy-slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice = require( '@stdlib/array/base/fancy-slice' ); +const slice = require( '@stdlib/array/base/fancy-slice' ); ``` #### slice( x, s, strict ) @@ -45,15 +45,15 @@ var slice = require( '@stdlib/array/base/fancy-slice' ); Returns a shallow copy of a portion of an array. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var s = new Slice( 1, 4 ); -var out = slice( x, s, false ); +const s = new Slice( 1, 4 ); +const out = slice( x, s, false ); // returns [ 2, 3, 4 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -88,15 +88,15 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/zero-to' ); -var Slice = require( '@stdlib/slice/ctor' ); -var slice = require( '@stdlib/array/base/fancy-slice' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const Slice = require( '@stdlib/slice/ctor' ); +const slice = require( '@stdlib/array/base/fancy-slice' ); -var x = zeroTo( 10, 'generic' ); +const x = zeroTo( 10, 'generic' ); // returns [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] -var s = new Slice(); -var y = slice( x, s, false ); +let s = new Slice(); +let y = slice( x, s, false ); // returns [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] s = new Slice( null, null, -2 ); diff --git a/lib/node_modules/@stdlib/array/base/filled-by/README.md b/lib/node_modules/@stdlib/array/base/filled-by/README.md index 53d3f2c6478b..3cbbb522080d 100644 --- a/lib/node_modules/@stdlib/array/base/filled-by/README.md +++ b/lib/node_modules/@stdlib/array/base/filled-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); ``` #### filledBy( len, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk( i ) { return i; } -var out = filledBy( 3, clbk ); +const out = filledBy( 3, clbk ); // returns [ 0, 1, 2 ] ``` @@ -67,14 +67,14 @@ function clbk( i ) { return i; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filledBy( 3, clbk, ctx ); +const out = filledBy( 3, clbk, ctx ); // returns [ 0, 1, 2 ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 3 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); -var out = filledBy( 3, constantFunction( 0.0 ) ); +let out = filledBy( 3, constantFunction( 0.0 ) ); // returns [ 0.0, 0.0, 0.0 ] out = filledBy( 3, constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/filled/README.md b/lib/node_modules/@stdlib/array/base/filled/README.md index b3f546215422..d90fd4b3ba32 100644 --- a/lib/node_modules/@stdlib/array/base/filled/README.md +++ b/lib/node_modules/@stdlib/array/base/filled/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled = require( '@stdlib/array/base/filled' ); +const filled = require( '@stdlib/array/base/filled' ); ``` #### filled( value, len ) @@ -45,7 +45,7 @@ var filled = require( '@stdlib/array/base/filled' ); Returns a filled "generic" array. ```javascript -var out = filled( 0.0, 3 ); +const out = filled( 0.0, 3 ); // returns [ 0.0, 0.0, 0.0 ] ``` @@ -70,9 +70,9 @@ var out = filled( 0.0, 3 ); ```javascript -var filled = require( '@stdlib/array/base/filled' ); +const filled = require( '@stdlib/array/base/filled' ); -var out = filled( 0.0, 3 ); +let out = filled( 0.0, 3 ); // returns [ 0.0, 0.0, 0.0 ] out = filled( 'beep', 3 ); diff --git a/lib/node_modules/@stdlib/array/base/filled2d-by/README.md b/lib/node_modules/@stdlib/array/base/filled2d-by/README.md index 76b364b36eb4..f69df33dde11 100644 --- a/lib/node_modules/@stdlib/array/base/filled2d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/filled2d-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); ``` #### filled2dBy( shape, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk() { return 1.0; } -var out = filled2dBy( [ 1, 3 ], clbk ); +const out = filled2dBy( [ 1, 3 ], clbk ); // returns [ [ 1.0, 1.0, 1.0 ] ] ``` @@ -67,14 +67,14 @@ function clbk() { return 1.0; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filled2dBy( [ 2, 3 ], clbk, ctx ); +const out = filled2dBy( [ 2, 3 ], clbk, ctx ); // returns [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var out = filled2dBy( [ 1, 3 ], constantFunction( 0.0 ) ); +let out = filled2dBy( [ 1, 3 ], constantFunction( 0.0 ) ); // returns [ [ 0.0, 0.0, 0.0 ] ] out = filled2dBy( [ 3, 1 ], constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/filled2d/README.md b/lib/node_modules/@stdlib/array/base/filled2d/README.md index 41b8f0ae0be3..54e7a4363378 100644 --- a/lib/node_modules/@stdlib/array/base/filled2d/README.md +++ b/lib/node_modules/@stdlib/array/base/filled2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled2d = require( '@stdlib/array/base/filled2d' ); +const filled2d = require( '@stdlib/array/base/filled2d' ); ``` #### filled2d( value, shape ) @@ -45,7 +45,7 @@ var filled2d = require( '@stdlib/array/base/filled2d' ); Returns a filled two-dimensional nested array. ```javascript -var out = filled2d( 0.0, [ 2, 3 ] ); +const out = filled2d( 0.0, [ 2, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ``` @@ -70,9 +70,9 @@ var out = filled2d( 0.0, [ 2, 3 ] ); ```javascript -var filled2d = require( '@stdlib/array/base/filled2d' ); +const filled2d = require( '@stdlib/array/base/filled2d' ); -var out = filled2d( 0.0, [ 1, 3 ] ); +let out = filled2d( 0.0, [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] out = filled2d( 'beep', [ 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/filled3d-by/README.md b/lib/node_modules/@stdlib/array/base/filled3d-by/README.md index 6d70dba2a097..73fb8de4aa4b 100644 --- a/lib/node_modules/@stdlib/array/base/filled3d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/filled3d-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); ``` #### filled3dBy( shape, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk() { return 1.0; } -var out = filled3dBy( [ 2, 1, 3 ], clbk ); +const out = filled3dBy( [ 2, 1, 3 ], clbk ); // returns [ [ [ 1.0, 1.0, 1.0 ] ], [ [ 1.0, 1.0, 1.0 ] ] ] ``` @@ -67,14 +67,14 @@ function clbk() { return 1.0; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filled3dBy( [ 1, 2, 3 ], clbk, ctx ); +const out = filled3dBy( [ 1, 2, 3 ], clbk, ctx ); // returns [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var out = filled3dBy( [ 1, 1, 3 ], constantFunction( 0.0 ) ); +let out = filled3dBy( [ 1, 1, 3 ], constantFunction( 0.0 ) ); // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] out = filled3dBy( [ 1, 3, 1 ], constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/filled3d/README.md b/lib/node_modules/@stdlib/array/base/filled3d/README.md index b9de5bcb7f69..c0ee1a4bfbb9 100644 --- a/lib/node_modules/@stdlib/array/base/filled3d/README.md +++ b/lib/node_modules/@stdlib/array/base/filled3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled3d = require( '@stdlib/array/base/filled3d' ); +const filled3d = require( '@stdlib/array/base/filled3d' ); ``` #### filled3d( value, shape ) @@ -45,7 +45,7 @@ var filled3d = require( '@stdlib/array/base/filled3d' ); Returns a filled three-dimensional nested array. ```javascript -var out = filled3d( 0.0, [ 1, 2, 3 ] ); +const out = filled3d( 0.0, [ 1, 2, 3 ] ); // returns [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ``` @@ -70,9 +70,9 @@ var out = filled3d( 0.0, [ 1, 2, 3 ] ); ```javascript -var filled3d = require( '@stdlib/array/base/filled3d' ); +const filled3d = require( '@stdlib/array/base/filled3d' ); -var out = filled3d( 0.0, [ 1, 1, 3 ] ); +let out = filled3d( 0.0, [ 1, 1, 3 ] ); // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] out = filled3d( 'beep', [ 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/filled4d-by/README.md b/lib/node_modules/@stdlib/array/base/filled4d-by/README.md index 4729e4b0f677..469f539b4df8 100644 --- a/lib/node_modules/@stdlib/array/base/filled4d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/filled4d-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); ``` #### filled4dBy( shape, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk() { return 1.0; } -var out = filled4dBy( [ 1, 2, 1, 3 ], clbk ); +const out = filled4dBy( [ 1, 2, 1, 3 ], clbk ); // returns [ [ [ [ 1.0, 1.0, 1.0 ] ], [ [ 1.0, 1.0, 1.0 ] ] ] ] ``` @@ -67,14 +67,14 @@ function clbk() { return 1.0; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filled4dBy( [ 1, 1, 2, 3 ], clbk, ctx ); +const out = filled4dBy( [ 1, 1, 2, 3 ], clbk, ctx ); // returns [ [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 0.0 ) ); +let out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 0.0 ) ); // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] out = filled4dBy( [ 1, 1, 3, 1 ], constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/filled4d/README.md b/lib/node_modules/@stdlib/array/base/filled4d/README.md index 98742fa7029b..a8fd16e5ceee 100644 --- a/lib/node_modules/@stdlib/array/base/filled4d/README.md +++ b/lib/node_modules/@stdlib/array/base/filled4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled4d = require( '@stdlib/array/base/filled4d' ); +const filled4d = require( '@stdlib/array/base/filled4d' ); ``` #### filled4d( value, shape ) @@ -45,7 +45,7 @@ var filled4d = require( '@stdlib/array/base/filled4d' ); Returns a filled four-dimensional nested array. ```javascript -var out = filled4d( 0.0, [ 1, 1, 2, 3 ] ); +const out = filled4d( 0.0, [ 1, 1, 2, 3 ] ); // returns [ [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = filled4d( 0.0, [ 1, 1, 2, 3 ] ); ```javascript -var filled4d = require( '@stdlib/array/base/filled4d' ); +const filled4d = require( '@stdlib/array/base/filled4d' ); -var out = filled4d( 0.0, [ 1, 1, 1, 3 ] ); +let out = filled4d( 0.0, [ 1, 1, 1, 3 ] ); // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] out = filled4d( 'beep', [ 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/filled5d-by/README.md b/lib/node_modules/@stdlib/array/base/filled5d-by/README.md index 047280e04ae8..c4d44ebbb94d 100644 --- a/lib/node_modules/@stdlib/array/base/filled5d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/filled5d-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); ``` #### filled5dBy( shape, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk() { return 1.0; } -var out = filled5dBy( [ 1, 1, 2, 1, 3 ], clbk ); +const out = filled5dBy( [ 1, 1, 2, 1, 3 ], clbk ); // returns [ [ [ [ [ 1.0, 1.0, 1.0 ] ], [ [ 1.0, 1.0, 1.0 ] ] ] ] ] ``` @@ -67,14 +67,14 @@ function clbk() { return 1.0; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filled5dBy( [ 1, 1, 1, 2, 3 ], clbk, ctx ); +const out = filled5dBy( [ 1, 1, 1, 2, 3 ], clbk, ctx ); // returns [ [ [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ] ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 0.0 ) ); +let out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 0.0 ) ); // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] out = filled5dBy( [ 1, 1, 1, 3, 1 ], constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/filled5d/README.md b/lib/node_modules/@stdlib/array/base/filled5d/README.md index c996bae2b345..c787d8b106ef 100644 --- a/lib/node_modules/@stdlib/array/base/filled5d/README.md +++ b/lib/node_modules/@stdlib/array/base/filled5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filled5d = require( '@stdlib/array/base/filled5d' ); +const filled5d = require( '@stdlib/array/base/filled5d' ); ``` #### filled5d( value, shape ) @@ -45,7 +45,7 @@ var filled5d = require( '@stdlib/array/base/filled5d' ); Returns a filled five-dimensional nested array. ```javascript -var out = filled5d( 0.0, [ 1, 1, 1, 2, 3 ] ); +const out = filled5d( 0.0, [ 1, 1, 1, 2, 3 ] ); // returns [ [ [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = filled5d( 0.0, [ 1, 1, 1, 2, 3 ] ); ```javascript -var filled5d = require( '@stdlib/array/base/filled5d' ); +const filled5d = require( '@stdlib/array/base/filled5d' ); -var out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] ); +let out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] ); // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] out = filled5d( 'beep', [ 1, 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/fillednd-by/README.md b/lib/node_modules/@stdlib/array/base/fillednd-by/README.md index 2230f1b555d4..36b808431088 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd-by/README.md +++ b/lib/node_modules/@stdlib/array/base/fillednd-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filledndBy = require( '@stdlib/array/base/fillednd-by' ); +const filledndBy = require( '@stdlib/array/base/fillednd-by' ); ``` #### filledndBy( shape, clbk\[, thisArg] ) @@ -49,7 +49,7 @@ function clbk() { return 1.0; } -var out = filledndBy( [ 2, 3 ], clbk ); +const out = filledndBy( [ 2, 3 ], clbk ); // returns [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ``` @@ -67,14 +67,14 @@ function clbk() { return 1.0; } -var ctx = { +const ctx = { 'count': 0 }; -var out = filledndBy( [ 1, 1, 1, 2, 3 ], clbk, ctx ); +const out = filledndBy( [ 1, 1, 1, 2, 3 ], clbk, ctx ); // returns [ [ [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ] ]; -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -99,10 +99,10 @@ var cnt = ctx.count; ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); -var filledndBy = require( '@stdlib/array/base/fillednd-by' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); +const filledndBy = require( '@stdlib/array/base/fillednd-by' ); -var out = filledndBy( [ 1, 3 ], constantFunction( 0.0 ) ); +let out = filledndBy( [ 1, 3 ], constantFunction( 0.0 ) ); // returns [ [ 0.0, 0.0, 0.0 ] ] out = filledndBy( [ 3, 1 ], constantFunction( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/array/base/fillednd/README.md b/lib/node_modules/@stdlib/array/base/fillednd/README.md index f1b9e1471e0c..45be5c4b9f3e 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd/README.md +++ b/lib/node_modules/@stdlib/array/base/fillednd/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fillednd = require( '@stdlib/array/base/fillednd' ); +const fillednd = require( '@stdlib/array/base/fillednd' ); ``` #### fillednd( value, shape ) @@ -45,7 +45,7 @@ var fillednd = require( '@stdlib/array/base/fillednd' ); Returns a filled n-dimensional nested array. ```javascript -var out = fillednd( 0.0, [ 2, 3 ] ); +const out = fillednd( 0.0, [ 2, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ``` @@ -70,9 +70,9 @@ var out = fillednd( 0.0, [ 2, 3 ] ); ```javascript -var fillednd = require( '@stdlib/array/base/fillednd' ); +const fillednd = require( '@stdlib/array/base/fillednd' ); -var out = fillednd( 0.0, [ 1, 3 ] ); +let out = fillednd( 0.0, [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] out = fillednd( 'beep', [ 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/filter/README.md b/lib/node_modules/@stdlib/array/base/filter/README.md index c9bd7ded2e71..7a043f6871be 100644 --- a/lib/node_modules/@stdlib/array/base/filter/README.md +++ b/lib/node_modules/@stdlib/array/base/filter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filter = require( '@stdlib/array/base/filter' ); +const filter = require( '@stdlib/array/base/filter' ); ``` #### filter( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, -2, -3, 4 ]; +const x = [ 1, -2, -3, 4 ]; -var out = filter( x, isPositive ); +const out = filter( x, isPositive ); // returns [ 1, 4 ] ``` @@ -69,16 +69,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 1, 2, -3, 4 ]; +const x = [ 1, 2, -3, 4 ]; -var context = { +const context = { 'count': 0 }; -var out = filter( x, predicate, context ); +const out = filter( x, predicate, context ); // returns [ 1, 2, 4 ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -113,17 +113,17 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var filter = require( '@stdlib/array/base/filter' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const filter = require( '@stdlib/array/base/filter' ); -var x = discreteUniform( 10, -5, 5, { +const x = discreteUniform( 10, -5, 5, { 'dtype': 'int32' }); // returns -var out = filter( x, naryFunction( isPositiveInteger, 1 ) ); +const out = filter( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/first/README.md b/lib/node_modules/@stdlib/array/base/first/README.md index db35be7b822b..7b0ddd635c7b 100644 --- a/lib/node_modules/@stdlib/array/base/first/README.md +++ b/lib/node_modules/@stdlib/array/base/first/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var first = require( '@stdlib/array/base/first' ); +const first = require( '@stdlib/array/base/first' ); ``` #### first( x ) @@ -45,9 +45,9 @@ var first = require( '@stdlib/array/base/first' ); Returns the first element of an array-like object. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var out = first( x ); +const out = first( x ); // returns 1 ``` @@ -72,22 +72,22 @@ var out = first( x ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var first = require( '@stdlib/array/base/first' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const first = require( '@stdlib/array/base/first' ); // Create a complex number array: -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Return the first element: -var out = first( arr ); +const out = first( arr ); // returns -var re = realf( out ); +const re = realf( out ); // returns 1.0 -var im = imagf( out ); +const im = imagf( out ); // returns 2.0 console.log( '%d + %di', re, im ); diff --git a/lib/node_modules/@stdlib/array/base/flatten-by/README.md b/lib/node_modules/@stdlib/array/base/flatten-by/README.md index b28631f0e4b7..b2b189aba0dc 100644 --- a/lib/node_modules/@stdlib/array/base/flatten-by/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten-by/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var flattenBy = require( '@stdlib/array/base/flatten-by' ); +const flattenBy = require( '@stdlib/array/base/flatten-by' ); ``` #### flattenBy( x, shape, colexicographic, clbk\[, thisArg] ) @@ -41,9 +41,9 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flattenBy( x, [ 2, 2 ], false, scale ); +const out = flattenBy( x, [ 2, 2 ], false, scale ); // returns [ 2, 4, 6, 8 ] ``` @@ -54,9 +54,9 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flattenBy( x, [ 2, 2 ], true, scale ); +const out = flattenBy( x, [ 2, 2 ], true, scale ); // returns [ 2, 6, 4, 8 ] ``` @@ -70,15 +70,15 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var ctx = { +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const ctx = { 'count': 0 }; -var out = flattenBy( x, [ 2, 2 ], false, scale, ctx ); +const out = flattenBy( x, [ 2, 2 ], false, scale, ctx ); // returns [ 2, 4, 6, 8 ] -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var count = ctx.count; Flattens an n-dimensional nested array according to a callback function and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = new Float64Array( 4 ); +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const out = new Float64Array( 4 ); -var y = flattenBy.assign( x, [ 2, 2 ], false, out, 1, 0, scale ); +let y = flattenBy.assign( x, [ 2, 2 ], false, out, 1, 0, scale ); // returns [ 2, 4, 6, 8 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flattenBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale ); @@ -133,14 +133,14 @@ y = flattenBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var flattenBy = require( '@stdlib/array/base/flatten-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const flattenBy = require( '@stdlib/array/base/flatten-by' ); -var fcn = naryFunction( abs, 1 ); +const fcn = naryFunction( abs, 1 ); // Define a 2x2x1x2x2 array: -var x = [ +const x = [ [ [ [ @@ -167,7 +167,7 @@ var x = [ ] ]; -var out = flattenBy( x, [ 0, 0, 0, 0, 0 ], false, fcn ); +let out = flattenBy( x, [ 0, 0, 0, 0, 0 ], false, fcn ); // returns [] out = flattenBy( x, [ 0, 0, 0, 0, 0 ], true, fcn ); diff --git a/lib/node_modules/@stdlib/array/base/flatten/README.md b/lib/node_modules/@stdlib/array/base/flatten/README.md index 266ffe81fe44..a09e332914db 100644 --- a/lib/node_modules/@stdlib/array/base/flatten/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flatten = require( '@stdlib/array/base/flatten' ); +const flatten = require( '@stdlib/array/base/flatten' ); ``` #### flatten( x, shape, colexicographic ) @@ -35,18 +35,18 @@ var flatten = require( '@stdlib/array/base/flatten' ); Flattens an n-dimensional nested array. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten( x, [ 2, 2 ], false ); +const out = flatten( x, [ 2, 2 ], false ); // returns [ 1, 2, 3, 4 ] ``` To flatten in colexicographic order, provide a third argument equal to `true`. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten( x, [ 2, 2 ], true ); +const out = flatten( x, [ 2, 2 ], true ); // returns [ 1, 3, 2, 4 ] ``` @@ -55,15 +55,15 @@ var out = flatten( x, [ 2, 2 ], true ); Flattens an n-dimensional nested array and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = new Float64Array( 4 ); +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const out = new Float64Array( 4 ); -var y = flatten.assign( x, [ 2, 2 ], false, out, 1, 0 ); +let y = flatten.assign( x, [ 2, 2 ], false, out, 1, 0 ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten.assign( x, [ 2, 2 ], true, out, 1, 0 ); @@ -91,10 +91,10 @@ y = flatten.assign( x, [ 2, 2 ], true, out, 1, 0 ); ```javascript -var flatten = require( '@stdlib/array/base/flatten' ); +const flatten = require( '@stdlib/array/base/flatten' ); // Define a 2x2x1x2x2 array: -var x = [ +const x = [ [ [ [ @@ -121,7 +121,7 @@ var x = [ ] ]; -var out = flatten( x, [ 0, 0, 0, 0, 0 ], false ); +let out = flatten( x, [ 0, 0, 0, 0, 0 ], false ); // returns [] out = flatten( x, [ 0, 0, 0, 0, 0 ], true ); diff --git a/lib/node_modules/@stdlib/array/base/flatten2d-by/README.md b/lib/node_modules/@stdlib/array/base/flatten2d-by/README.md index 1184476ef47a..7f0e4c1f2f87 100644 --- a/lib/node_modules/@stdlib/array/base/flatten2d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten2d-by/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var flatten2dBy = require( '@stdlib/array/base/flatten2d-by' ); +const flatten2dBy = require( '@stdlib/array/base/flatten2d-by' ); ``` #### flatten2dBy( x, shape, colexicographic, clbk\[, thisArg] ) @@ -41,9 +41,9 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten2dBy( x, [ 2, 2 ], false, scale ); +const out = flatten2dBy( x, [ 2, 2 ], false, scale ); // returns [ 2, 4, 6, 8 ] ``` @@ -54,9 +54,9 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten2dBy( x, [ 2, 2 ], true, scale ); +const out = flatten2dBy( x, [ 2, 2 ], true, scale ); // returns [ 2, 6, 4, 8 ] ``` @@ -70,15 +70,15 @@ function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var ctx = { +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const ctx = { 'count': 0 }; -var out = flatten2dBy( x, [ 2, 2 ], false, scale, ctx ); +const out = flatten2dBy( x, [ 2, 2 ], false, scale, ctx ); // returns [ 2, 4, 6, 8 ] -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var count = ctx.count; Flattens a two-dimensional nested array according to a callback function and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( v ) { return v * 2; } -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = new Float64Array( 4 ); +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const out = new Float64Array( 4 ); -var y = flatten2dBy.assign( x, [ 2, 2 ], false, out, 1, 0, scale ); +let y = flatten2dBy.assign( x, [ 2, 2 ], false, out, 1, 0, scale ); // returns [ 2, 4, 6, 8 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten2dBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale ); @@ -133,20 +133,20 @@ y = flatten2dBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var flatten2dBy = require( '@stdlib/array/base/flatten2d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const flatten2dBy = require( '@stdlib/array/base/flatten2d-by' ); -var fcn = naryFunction( abs, 1 ); +const fcn = naryFunction( abs, 1 ); -var x = [ +const x = [ [ -1, -2, -3, -4 ], [ -5, -6, -7, -8 ], [ -9, -10, -11, -12 ], [ -13, -14, -15, -16 ] ]; -var out = flatten2dBy( x, [ 0, 0 ], false, fcn ); +let out = flatten2dBy( x, [ 0, 0 ], false, fcn ); // returns [] out = flatten2dBy( x, [ 0, 0 ], true, fcn ); diff --git a/lib/node_modules/@stdlib/array/base/flatten2d/README.md b/lib/node_modules/@stdlib/array/base/flatten2d/README.md index fadaa81818f5..ee4ad08cd9e6 100644 --- a/lib/node_modules/@stdlib/array/base/flatten2d/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten2d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flatten2d = require( '@stdlib/array/base/flatten2d' ); +const flatten2d = require( '@stdlib/array/base/flatten2d' ); ``` #### flatten2d( x, shape, colexicographic ) @@ -35,18 +35,18 @@ var flatten2d = require( '@stdlib/array/base/flatten2d' ); Flattens a two-dimensional nested array. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten2d( x, [ 2, 2 ], false ); +const out = flatten2d( x, [ 2, 2 ], false ); // returns [ 1, 2, 3, 4 ] ``` To flatten in colexicographic order, provide a third argument equal to `true`. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = flatten2d( x, [ 2, 2 ], true ); +const out = flatten2d( x, [ 2, 2 ], true ); // returns [ 1, 3, 2, 4 ] ``` @@ -55,15 +55,15 @@ var out = flatten2d( x, [ 2, 2 ], true ); Flattens a two-dimensional nested array and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var out = new Float64Array( 4 ); +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const out = new Float64Array( 4 ); -var y = flatten2d.assign( x, [ 2, 2 ], false, out, 1, 0 ); +let y = flatten2d.assign( x, [ 2, 2 ], false, out, 1, 0 ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten2d.assign( x, [ 2, 2 ], true, out, 1, 0 ); @@ -91,16 +91,16 @@ y = flatten2d.assign( x, [ 2, 2 ], true, out, 1, 0 ); ```javascript -var flatten2d = require( '@stdlib/array/base/flatten2d' ); +const flatten2d = require( '@stdlib/array/base/flatten2d' ); -var x = [ +const x = [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ], [ 9, 10, 11, 12 ], [ 13, 14, 15, 16 ] ]; -var out = flatten2d( x, [ 0, 0 ], false ); +let out = flatten2d( x, [ 0, 0 ], false ); // returns [] out = flatten2d( x, [ 0, 0 ], true ); diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md b/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md index d61670b91dfe..0d271005bfcc 100644 --- a/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' ); +const flatten3dBy = require( '@stdlib/array/base/flatten3d-by' ); ``` #### flatten3dBy( x, shape, colexicographic, clbk\[, thisArg] ) @@ -41,9 +41,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale ); +const out = flatten3dBy( x, [ 2, 1, 2 ], false, scale ); // returns [ 2, 4, 6, 8 ] ``` @@ -54,9 +54,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale ); +const out = flatten3dBy( x, [ 2, 1, 2 ], true, scale ); // returns [ 2, 6, 4, 8 ] ``` @@ -70,15 +70,15 @@ function scale( v ) { return v * 2; } -var x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; -var ctx = { +const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; +const ctx = { 'count': 0 }; -var out = flatten3dBy( x, [ 1, 2, 2 ], false, scale, ctx ); +const out = flatten3dBy( x, [ 1, 2, 2 ], false, scale, ctx ); // returns [ 2, 4, 6, 8 ] -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var count = ctx.count; Flattens a three-dimensional nested array according to a callback function and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( v ) { return v * 2; } -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, scale ); +let y = flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, scale ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten3dBy.assign( x, [ 2, 1, 2 ], true, out, 1, 0, scale ); @@ -133,20 +133,20 @@ y = flatten3dBy.assign( x, [ 2, 1, 2 ], true, out, 1, 0, scale ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const flatten3dBy = require( '@stdlib/array/base/flatten3d-by' ); -var fcn = naryFunction( abs, 1 ); +const fcn = naryFunction( abs, 1 ); -var x = [ +const x = [ [ [ -1, -2 ], [ -3, -4 ] ], [ [ -5, -6 ], [ -7, -8 ] ], [ [ -9, -10 ], [ -11, -12 ] ], [ [ -13, -14 ], [ -15, -16 ] ] ]; -var out = flatten3dBy( x, [ 0, 0, 0 ], false, fcn ); +let out = flatten3dBy( x, [ 0, 0, 0 ], false, fcn ); // returns [] out = flatten3dBy( x, [ 0, 0, 0 ], true, fcn ); diff --git a/lib/node_modules/@stdlib/array/base/flatten3d/README.md b/lib/node_modules/@stdlib/array/base/flatten3d/README.md index 48621b257b37..d6cef5b31b9e 100644 --- a/lib/node_modules/@stdlib/array/base/flatten3d/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten3d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flatten3d = require( '@stdlib/array/base/flatten3d' ); +const flatten3d = require( '@stdlib/array/base/flatten3d' ); ``` #### flatten3d( x, shape, colexicographic ) @@ -35,18 +35,18 @@ var flatten3d = require( '@stdlib/array/base/flatten3d' ); Flattens a three-dimensional nested array. ```javascript -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = flatten3d( x, [ 2, 1, 2 ], false ); +const out = flatten3d( x, [ 2, 1, 2 ], false ); // returns [ 1, 2, 3, 4 ] ``` To flatten in colexicographic order, provide a third argument equal to `true`. ```javascript -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = flatten3d( x, [ 2, 1, 2 ], true ); +const out = flatten3d( x, [ 2, 1, 2 ], true ); // returns [ 1, 3, 2, 4 ] ``` @@ -55,15 +55,15 @@ var out = flatten3d( x, [ 2, 1, 2 ], true ); Flattens a three-dimensional nested array and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten3d.assign( x, [ 2, 1, 2 ], false, out, 1, 0 ); +let y = flatten3d.assign( x, [ 2, 1, 2 ], false, out, 1, 0 ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten3d.assign( x, [ 2, 1, 2 ], true, out, 1, 0 ); @@ -91,16 +91,16 @@ y = flatten3d.assign( x, [ 2, 1, 2 ], true, out, 1, 0 ); ```javascript -var flatten3d = require( '@stdlib/array/base/flatten3d' ); +const flatten3d = require( '@stdlib/array/base/flatten3d' ); -var x = [ +const x = [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ], [ [ 9, 10 ], [ 11, 12 ] ], [ [ 13, 14 ], [ 15, 16 ] ] ]; -var out = flatten3d( x, [ 0, 0, 0 ], false ); +let out = flatten3d( x, [ 0, 0, 0 ], false ); // returns [] out = flatten3d( x, [ 0, 0, 0 ], true ); diff --git a/lib/node_modules/@stdlib/array/base/flatten4d-by/README.md b/lib/node_modules/@stdlib/array/base/flatten4d-by/README.md index afb799faf9b2..e45c523489aa 100644 --- a/lib/node_modules/@stdlib/array/base/flatten4d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten4d-by/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var flatten4dBy = require( '@stdlib/array/base/flatten4d-by' ); +const flatten4dBy = require( '@stdlib/array/base/flatten4d-by' ); ``` #### flatten4dBy( x, shape, colexicographic, clbk\[, thisArg] ) @@ -41,9 +41,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale ); +const out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale ); // returns [ 2, 4, 6, 8 ] ``` @@ -54,9 +54,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = flatten4dBy( x, [ 2, 1, 1, 2 ], true, scale ); +const out = flatten4dBy( x, [ 2, 1, 1, 2 ], true, scale ); // returns [ 2, 6, 4, 8 ] ``` @@ -70,15 +70,15 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var ctx = { +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const ctx = { 'count': 0 }; -var out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale, ctx ); +const out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale, ctx ); // returns [ 2, 4, 6, 8 ] -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var count = ctx.count; Flattens a four-dimensional nested array according to a callback function and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( v ) { return v * 2; } -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten4dBy.assign( x, [ 2, 1, 1, 2 ], false, out, 1, 0, scale ); +let y = flatten4dBy.assign( x, [ 2, 1, 1, 2 ], false, out, 1, 0, scale ); // returns [ 2, 4, 6, 8 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten4dBy.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0, scale ); @@ -133,14 +133,14 @@ y = flatten4dBy.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0, scale ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var flatten4dBy = require( '@stdlib/array/base/flatten4d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const flatten4dBy = require( '@stdlib/array/base/flatten4d-by' ); -var fcn = naryFunction( abs, 1 ); +const fcn = naryFunction( abs, 1 ); // Define a 2x2x2x2 array: -var x = [ +const x = [ [ [ [ -1, -2 ], [ -3, -4 ] ], [ [ -5, -6 ], [ -7, -8 ] ] @@ -151,7 +151,7 @@ var x = [ ] ]; -var out = flatten4dBy( x, [ 0, 0, 0, 0 ], false, fcn ); +let out = flatten4dBy( x, [ 0, 0, 0, 0 ], false, fcn ); // returns [] out = flatten4dBy( x, [ 0, 0, 0, 0 ], true, fcn ); diff --git a/lib/node_modules/@stdlib/array/base/flatten4d/README.md b/lib/node_modules/@stdlib/array/base/flatten4d/README.md index 1781b0188541..9e00e0c88fcb 100644 --- a/lib/node_modules/@stdlib/array/base/flatten4d/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten4d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flatten4d = require( '@stdlib/array/base/flatten4d' ); +const flatten4d = require( '@stdlib/array/base/flatten4d' ); ``` #### flatten4d( x, shape, colexicographic ) @@ -35,18 +35,18 @@ var flatten4d = require( '@stdlib/array/base/flatten4d' ); Flattens a four-dimensional nested array. ```javascript -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = flatten4d( x, [ 2, 1, 1, 2 ], false ); +const out = flatten4d( x, [ 2, 1, 1, 2 ], false ); // returns [ 1, 2, 3, 4 ] ``` To flatten in colexicographic order, provide a third argument equal to `true`. ```javascript -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = flatten4d( x, [ 2, 1, 1, 2 ], true ); +const out = flatten4d( x, [ 2, 1, 1, 2 ], true ); // returns [ 1, 3, 2, 4 ] ``` @@ -55,15 +55,15 @@ var out = flatten4d( x, [ 2, 1, 1, 2 ], true ); Flattens a four-dimensional nested array and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten4d.assign( x, [ 2, 1, 1, 2 ], false, out, 1, 0 ); +let y = flatten4d.assign( x, [ 2, 1, 1, 2 ], false, out, 1, 0 ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten4d.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0 ); @@ -91,10 +91,10 @@ y = flatten4d.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0 ); ```javascript -var flatten4d = require( '@stdlib/array/base/flatten4d' ); +const flatten4d = require( '@stdlib/array/base/flatten4d' ); // Define a 2x2x2x2 array: -var x = [ +const x = [ [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] @@ -105,7 +105,7 @@ var x = [ ] ]; -var out = flatten4d( x, [ 0, 0, 0, 0 ], false ); +let out = flatten4d( x, [ 0, 0, 0, 0 ], false ); // returns [] out = flatten4d( x, [ 0, 0, 0, 0 ], true ); diff --git a/lib/node_modules/@stdlib/array/base/flatten5d-by/README.md b/lib/node_modules/@stdlib/array/base/flatten5d-by/README.md index 01ca09da3952..11b3900607af 100644 --- a/lib/node_modules/@stdlib/array/base/flatten5d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten5d-by/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var flatten5dBy = require( '@stdlib/array/base/flatten5d-by' ); +const flatten5dBy = require( '@stdlib/array/base/flatten5d-by' ); ``` #### flatten5dBy( x, shape, colexicographic, clbk\[, thisArg] ) @@ -41,9 +41,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], false, scale ); +const out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], false, scale ); // returns [ 2, 4, 6, 8 ] ``` @@ -54,9 +54,9 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], true, scale ); +const out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], true, scale ); // returns [ 2, 6, 4, 8 ] ``` @@ -70,15 +70,15 @@ function scale( v ) { return v * 2; } -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var ctx = { +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const ctx = { 'count': 0 }; -var out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], false, scale, ctx ); +const out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], false, scale, ctx ); // returns [ 2, 4, 6, 8 ] -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var count = ctx.count; Flattens a five-dimensional nested array according to a callback function and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( v ) { return v * 2; } -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten5dBy.assign( x, [ 2, 1, 1, 1, 2 ], false, out, 1, 0, scale ); +let y = flatten5dBy.assign( x, [ 2, 1, 1, 1, 2 ], false, out, 1, 0, scale ); // returns [ 2, 4, 6, 8 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten5dBy.assign( x, [ 2, 1, 1, 1, 2 ], true, out, 1, 0, scale ); @@ -133,14 +133,14 @@ y = flatten5dBy.assign( x, [ 2, 1, 1, 1, 2 ], true, out, 1, 0, scale ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var flatten5dBy = require( '@stdlib/array/base/flatten5d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const flatten5dBy = require( '@stdlib/array/base/flatten5d-by' ); -var fcn = naryFunction( abs, 1 ); +const fcn = naryFunction( abs, 1 ); // Define a 2x2x1x2x2 array: -var x = [ +const x = [ [ [ [ @@ -167,7 +167,7 @@ var x = [ ] ]; -var out = flatten5dBy( x, [ 0, 0, 0, 0, 0 ], false, fcn ); +let out = flatten5dBy( x, [ 0, 0, 0, 0, 0 ], false, fcn ); // returns [] out = flatten5dBy( x, [ 0, 0, 0, 0, 0 ], true, fcn ); diff --git a/lib/node_modules/@stdlib/array/base/flatten5d/README.md b/lib/node_modules/@stdlib/array/base/flatten5d/README.md index 1c35eb60fb8e..6e8947130ea2 100644 --- a/lib/node_modules/@stdlib/array/base/flatten5d/README.md +++ b/lib/node_modules/@stdlib/array/base/flatten5d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flatten5d = require( '@stdlib/array/base/flatten5d' ); +const flatten5d = require( '@stdlib/array/base/flatten5d' ); ``` #### flatten5d( x, shape, colexicographic ) @@ -35,18 +35,18 @@ var flatten5d = require( '@stdlib/array/base/flatten5d' ); Flattens a five-dimensional nested array. ```javascript -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], false ); +const out = flatten5d( x, [ 2, 1, 1, 1, 2 ], false ); // returns [ 1, 2, 3, 4 ] ``` To flatten in colexicographic order, provide a third argument equal to `true`. ```javascript -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], true ); +const out = flatten5d( x, [ 2, 1, 1, 1, 2 ], true ); // returns [ 1, 3, 2, 4 ] ``` @@ -55,15 +55,15 @@ var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], true ); Flattens a five-dimensional nested array and assigns elements to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; -var out = new Float64Array( 4 ); +const x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ]; +const out = new Float64Array( 4 ); -var y = flatten5d.assign( x, [ 2, 1, 1, 1, 2 ], false, out, 1, 0 ); +let y = flatten5d.assign( x, [ 2, 1, 1, 1, 2 ], false, out, 1, 0 ); // returns [ 1, 2, 3, 4 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true y = flatten5d.assign( x, [ 2, 1, 1, 1, 2 ], true, out, 1, 0 ); @@ -91,10 +91,10 @@ y = flatten5d.assign( x, [ 2, 1, 1, 1, 2 ], true, out, 1, 0 ); ```javascript -var flatten5d = require( '@stdlib/array/base/flatten5d' ); +const flatten5d = require( '@stdlib/array/base/flatten5d' ); // Define a 2x2x1x2x2 array: -var x = [ +const x = [ [ [ [ @@ -121,7 +121,7 @@ var x = [ ] ]; -var out = flatten5d( x, [ 0, 0, 0, 0, 0 ], false ); +let out = flatten5d( x, [ 0, 0, 0, 0, 0 ], false ); // returns [] out = flatten5d( x, [ 0, 0, 0, 0, 0 ], true ); diff --git a/lib/node_modules/@stdlib/array/base/fliplr2d/README.md b/lib/node_modules/@stdlib/array/base/fliplr2d/README.md index 96bc88c3ba5a..65fb01bbc2a0 100644 --- a/lib/node_modules/@stdlib/array/base/fliplr2d/README.md +++ b/lib/node_modules/@stdlib/array/base/fliplr2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fliplr2d = require( '@stdlib/array/base/fliplr2d' ); +const fliplr2d = require( '@stdlib/array/base/fliplr2d' ); ``` #### fliplr2d( x ) @@ -45,7 +45,7 @@ var fliplr2d = require( '@stdlib/array/base/fliplr2d' ); Reverses the order of elements along the last dimension of a two-dimensional nested input array. ```javascript -var out = fliplr2d( [ [ 1, 2 ], [ 3, 4 ] ] ); +const out = fliplr2d( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns [ [ 2, 1 ], [ 4, 3 ] ] ``` @@ -70,14 +70,14 @@ var out = fliplr2d( [ [ 1, 2 ], [ 3, 4 ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var fliplr2d = require( '@stdlib/array/base/fliplr2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const fliplr2d = require( '@stdlib/array/base/fliplr2d' ); -var x = filled2dBy( [ 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled2dBy( [ 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = fliplr2d( x ); +const y = fliplr2d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/fliplr3d/README.md b/lib/node_modules/@stdlib/array/base/fliplr3d/README.md index 21eebf5e4566..79e18bbbf803 100644 --- a/lib/node_modules/@stdlib/array/base/fliplr3d/README.md +++ b/lib/node_modules/@stdlib/array/base/fliplr3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fliplr3d = require( '@stdlib/array/base/fliplr3d' ); +const fliplr3d = require( '@stdlib/array/base/fliplr3d' ); ``` #### fliplr3d( x ) @@ -45,7 +45,7 @@ var fliplr3d = require( '@stdlib/array/base/fliplr3d' ); Reverses the order of elements along the last dimension of a three-dimensional nested input array. ```javascript -var out = fliplr3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); +const out = fliplr3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); // returns [ [ [ 2, 1 ], [ 4, 3 ] ] ] ``` @@ -70,14 +70,14 @@ var out = fliplr3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var fliplr3d = require( '@stdlib/array/base/fliplr3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const fliplr3d = require( '@stdlib/array/base/fliplr3d' ); -var x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = fliplr3d( x ); +const y = fliplr3d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/fliplr4d/README.md b/lib/node_modules/@stdlib/array/base/fliplr4d/README.md index 93318b4ab372..b7cbb2355508 100644 --- a/lib/node_modules/@stdlib/array/base/fliplr4d/README.md +++ b/lib/node_modules/@stdlib/array/base/fliplr4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fliplr4d = require( '@stdlib/array/base/fliplr4d' ); +const fliplr4d = require( '@stdlib/array/base/fliplr4d' ); ``` #### fliplr4d( x ) @@ -45,7 +45,7 @@ var fliplr4d = require( '@stdlib/array/base/fliplr4d' ); Reverses the order of elements along the last dimension of a four-dimensional nested input array. ```javascript -var out = fliplr4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); +const out = fliplr4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); // returns [ [ [ [ 2, 1 ], [ 4, 3 ] ] ] ] ``` @@ -70,14 +70,14 @@ var out = fliplr4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var fliplr4d = require( '@stdlib/array/base/fliplr4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const fliplr4d = require( '@stdlib/array/base/fliplr4d' ); -var x = filled4dBy( [ 1, 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled4dBy( [ 1, 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = fliplr4d( x ); +const y = fliplr4d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/fliplr5d/README.md b/lib/node_modules/@stdlib/array/base/fliplr5d/README.md index 04c45a1f76c9..8f51079905c5 100644 --- a/lib/node_modules/@stdlib/array/base/fliplr5d/README.md +++ b/lib/node_modules/@stdlib/array/base/fliplr5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fliplr5d = require( '@stdlib/array/base/fliplr5d' ); +const fliplr5d = require( '@stdlib/array/base/fliplr5d' ); ``` #### fliplr5d( x ) @@ -45,7 +45,7 @@ var fliplr5d = require( '@stdlib/array/base/fliplr5d' ); Reverses the order of elements along the last dimension of a five-dimensional nested input array. ```javascript -var out = fliplr5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); +const out = fliplr5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); // returns [ [ [ [ [ 2, 1 ], [ 4, 3 ] ] ] ] ] ``` @@ -70,14 +70,14 @@ var out = fliplr5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var fliplr5d = require( '@stdlib/array/base/fliplr5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const fliplr5d = require( '@stdlib/array/base/fliplr5d' ); -var x = filled5dBy( [ 1, 1, 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled5dBy( [ 1, 1, 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = fliplr5d( x ); +const y = fliplr5d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/flipud2d/README.md b/lib/node_modules/@stdlib/array/base/flipud2d/README.md index 2dd854c1e40f..eebd7cc7fe38 100644 --- a/lib/node_modules/@stdlib/array/base/flipud2d/README.md +++ b/lib/node_modules/@stdlib/array/base/flipud2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flipud2d = require( '@stdlib/array/base/flipud2d' ); +const flipud2d = require( '@stdlib/array/base/flipud2d' ); ``` #### flipud2d( x ) @@ -45,7 +45,7 @@ var flipud2d = require( '@stdlib/array/base/flipud2d' ); Reverses the order of elements along the first dimension of a two-dimensional nested input array. ```javascript -var out = flipud2d( [ [ 1, 2 ], [ 3, 4 ] ] ); +const out = flipud2d( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns [ [ 3, 4 ], [ 1, 2 ] ] ``` @@ -70,14 +70,14 @@ var out = flipud2d( [ [ 1, 2 ], [ 3, 4 ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var flipud2d = require( '@stdlib/array/base/flipud2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const flipud2d = require( '@stdlib/array/base/flipud2d' ); -var x = filled2dBy( [ 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled2dBy( [ 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = flipud2d( x ); +const y = flipud2d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/flipud3d/README.md b/lib/node_modules/@stdlib/array/base/flipud3d/README.md index 2cf27c6acbb6..d1207e373426 100644 --- a/lib/node_modules/@stdlib/array/base/flipud3d/README.md +++ b/lib/node_modules/@stdlib/array/base/flipud3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flipud3d = require( '@stdlib/array/base/flipud3d' ); +const flipud3d = require( '@stdlib/array/base/flipud3d' ); ``` #### flipud3d( x ) @@ -45,7 +45,7 @@ var flipud3d = require( '@stdlib/array/base/flipud3d' ); Reverses the order of elements along the second-to-last dimension of a three-dimensional nested input array. ```javascript -var out = flipud3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); +const out = flipud3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); // returns [ [ [ 3, 4 ], [ 1, 2 ] ] ] ``` @@ -70,14 +70,14 @@ var out = flipud3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var flipud3d = require( '@stdlib/array/base/flipud3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const flipud3d = require( '@stdlib/array/base/flipud3d' ); -var x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = flipud3d( x ); +const y = flipud3d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/flipud4d/README.md b/lib/node_modules/@stdlib/array/base/flipud4d/README.md index 4effc87b101f..a7e555fcd7f8 100644 --- a/lib/node_modules/@stdlib/array/base/flipud4d/README.md +++ b/lib/node_modules/@stdlib/array/base/flipud4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flipud4d = require( '@stdlib/array/base/flipud4d' ); +const flipud4d = require( '@stdlib/array/base/flipud4d' ); ``` #### flipud4d( x ) @@ -45,7 +45,7 @@ var flipud4d = require( '@stdlib/array/base/flipud4d' ); Reverses the order of elements along the second-to-last dimension of a four-dimensional nested input array. ```javascript -var out = flipud4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); +const out = flipud4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); // returns [ [ [ [ 3, 4 ], [ 1, 2 ] ] ] ] ``` @@ -70,14 +70,14 @@ var out = flipud4d( [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var flipud4d = require( '@stdlib/array/base/flipud4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const flipud4d = require( '@stdlib/array/base/flipud4d' ); -var x = filled4dBy( [ 2, 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled4dBy( [ 2, 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = flipud4d( x ); +const y = flipud4d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/flipud5d/README.md b/lib/node_modules/@stdlib/array/base/flipud5d/README.md index 41b47aad93e8..a2b775c14df1 100644 --- a/lib/node_modules/@stdlib/array/base/flipud5d/README.md +++ b/lib/node_modules/@stdlib/array/base/flipud5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flipud5d = require( '@stdlib/array/base/flipud5d' ); +const flipud5d = require( '@stdlib/array/base/flipud5d' ); ``` #### flipud5d( x ) @@ -45,7 +45,7 @@ var flipud5d = require( '@stdlib/array/base/flipud5d' ); Reverses the order of elements along the second-to-last dimension of a five-dimensional nested input array. ```javascript -var out = flipud5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); +const out = flipud5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); // returns [ [ [ [ [ 3, 4 ], [ 1, 2 ] ] ] ] ] ``` @@ -70,14 +70,14 @@ var out = flipud5d( [ [ [ [ [ 1, 2 ], [ 3, 4 ] ] ] ] ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var flipud5d = require( '@stdlib/array/base/flipud5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const flipud5d = require( '@stdlib/array/base/flipud5d' ); -var x = filled5dBy( [ 1, 2, 3, 3, 3 ], discreteUniform( -50, 50 ) ); +const x = filled5dBy( [ 1, 2, 3, 3, 3 ], discreteUniform( -50, 50 ) ); console.log( x ); -var y = flipud5d( x ); +const y = flipud5d( x ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/from-strided/README.md b/lib/node_modules/@stdlib/array/base/from-strided/README.md index 1bb0498bdb2c..74e281cef650 100644 --- a/lib/node_modules/@stdlib/array/base/from-strided/README.md +++ b/lib/node_modules/@stdlib/array/base/from-strided/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strided2array = require( '@stdlib/array/base/from-strided' ); +const strided2array = require( '@stdlib/array/base/from-strided' ); ``` #### strided2array( N, x, stride, offset ) @@ -41,9 +41,9 @@ var strided2array = require( '@stdlib/array/base/from-strided' ); Converts a strided array to a non-strided generic array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var arr = strided2array( 3, x, 2, 0 ); +const arr = strided2array( 3, x, 2, 0 ); // returns [ 1, 3, 5 ] ``` @@ -75,13 +75,13 @@ The function accepts the following arguments: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var strided2array = require( '@stdlib/array/base/from-strided' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const strided2array = require( '@stdlib/array/base/from-strided' ); -var x = zeroTo( 10 ); +const x = zeroTo( 10 ); console.log( x ); -var y = strided2array( 5, x, -2, x.length-1 ); +const y = strided2array( 5, x, -2, x.length-1 ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/getter/README.md b/lib/node_modules/@stdlib/array/base/getter/README.md index ec18b72452a9..a818a486cbd2 100644 --- a/lib/node_modules/@stdlib/array/base/getter/README.md +++ b/lib/node_modules/@stdlib/array/base/getter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var getter = require( '@stdlib/array/base/getter' ); +const getter = require( '@stdlib/array/base/getter' ); ``` #### getter( dtype ) @@ -45,10 +45,10 @@ var getter = require( '@stdlib/array/base/getter' ); Returns an accessor function for retrieving an element from an indexed array-like object. ```javascript -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var get = getter( 'generic' ); -var v = get( arr, 2 ); +const get = getter( 'generic' ); +const v = get( arr, 2 ); // returns 3 ``` @@ -85,12 +85,12 @@ The returned accessor function accepts the following arguments: ```javascript -var filled = require( '@stdlib/array/filled' ); -var dtype = require( '@stdlib/array/dtype' ); -var getter = require( '@stdlib/array/base/getter' ); +const filled = require( '@stdlib/array/filled' ); +const dtype = require( '@stdlib/array/dtype' ); +const getter = require( '@stdlib/array/base/getter' ); -var arr = filled( 1.0, 10, 'float64' ); -var v = getter( dtype( arr ) )( arr, 2 ); +let arr = filled( 1.0, 10, 'float64' ); +let v = getter( dtype( arr ) )( arr, 2 ); // returns 1.0 arr = filled( 2.0, 10, 'float32' ); diff --git a/lib/node_modules/@stdlib/array/base/group-entries-by/README.md b/lib/node_modules/@stdlib/array/base/group-entries-by/README.md index 3ea2b7e11a70..303ec3b59b4e 100644 --- a/lib/node_modules/@stdlib/array/base/group-entries-by/README.md +++ b/lib/node_modules/@stdlib/array/base/group-entries-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupEntriesBy = require( '@stdlib/array/base/group-entries-by' ); +const groupEntriesBy = require( '@stdlib/array/base/group-entries-by' ); ``` #### groupEntriesBy( x, indicator\[, thisArg] ) @@ -49,9 +49,9 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupEntriesBy( x, indicator ); +const out = groupEntriesBy( x, indicator ); // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] } ``` @@ -69,15 +69,15 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = groupEntriesBy( x, indicator, context ); +const out = groupEntriesBy( x, indicator, context ); // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] } -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -97,9 +97,9 @@ var cnt = context.count; function indicator( v ) { return {}; } - var x = [ 'beep', 'boop', 'foo', 'bar' ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; - var out = groupEntriesBy( x, indicator ); + const out = groupEntriesBy( x, indicator ); // returns { '[object Object]': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 2, 'foo' ], [ 3, 'bar' ] ] } ``` @@ -118,9 +118,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupEntriesBy = require( '@stdlib/array/base/group-entries-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupEntriesBy = require( '@stdlib/array/base/group-entries-by' ); function indicator( v ) { // Use the first letter of each element to define groups: @@ -128,17 +128,17 @@ function indicator( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Group the values: -var out = groupEntriesBy( x, indicator ); +const out = groupEntriesBy( x, indicator ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/group-entries/README.md b/lib/node_modules/@stdlib/array/base/group-entries/README.md index a96910f4c52c..9a9ff902b9b2 100644 --- a/lib/node_modules/@stdlib/array/base/group-entries/README.md +++ b/lib/node_modules/@stdlib/array/base/group-entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupEntries = require( '@stdlib/array/base/group-entries' ); +const groupEntries = require( '@stdlib/array/base/group-entries' ); ``` #### groupEntries( x, groups ) @@ -45,10 +45,10 @@ var groupEntries = require( '@stdlib/array/base/group-entries' ); Groups element entries as arrays associated with distinct keys. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var out = groupEntries( x, groups ); +const out = groupEntries( x, groups ); // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] } ``` @@ -65,10 +65,10 @@ var out = groupEntries( x, groups ); - Each value in `groups` should resolve to a value which can be serialized as an object key. As a counterexample, ```javascript - var x = [ 'beep', 'boop', 'foo', 'bar' ]; - var groups = [ {}, {}, {}, {} ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; + const groups = [ {}, {}, {}, {} ]; - var out = groupEntries( x, groups ); + const out = groupEntries( x, groups ); // returns { '[object Object]': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 2, 'foo' ], [ 3, 'bar' ] ] } ``` @@ -87,27 +87,27 @@ var out = groupEntries( x, groups ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupEntries = require( '@stdlib/array/base/group-entries' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupEntries = require( '@stdlib/array/base/group-entries' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, values.length, { +const groups = discreteUniform( x.length, 0, values.length, { 'dtype': 'generic' }); // Group the values: -var out = groupEntries( x, groups ); +const out = groupEntries( x, groups ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/group-indices-by/README.md b/lib/node_modules/@stdlib/array/base/group-indices-by/README.md index 2cbad4ce8039..14ee714ceadc 100644 --- a/lib/node_modules/@stdlib/array/base/group-indices-by/README.md +++ b/lib/node_modules/@stdlib/array/base/group-indices-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupIndicesBy = require( '@stdlib/array/base/group-indices-by' ); +const groupIndicesBy = require( '@stdlib/array/base/group-indices-by' ); ``` #### groupIndicesBy( x, indicator\[, thisArg] ) @@ -49,9 +49,9 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupIndicesBy( x, indicator ); +const out = groupIndicesBy( x, indicator ); // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] } ``` @@ -69,15 +69,15 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = groupIndicesBy( x, indicator, context ); +const out = groupIndicesBy( x, indicator, context ); // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] } -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -97,9 +97,9 @@ var cnt = context.count; function indicator( v ) { return {}; } - var x = [ 'beep', 'boop', 'foo', 'bar' ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; - var out = groupIndicesBy( x, indicator ); + const out = groupIndicesBy( x, indicator ); // returns { '[object Object]': [ 0, 1, 2, 3 ] } ``` @@ -118,9 +118,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupIndicesBy = require( '@stdlib/array/base/group-indices-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupIndicesBy = require( '@stdlib/array/base/group-indices-by' ); function indicator( v ) { // Use the first letter of each element to define groups: @@ -128,17 +128,17 @@ function indicator( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Group the values: -var out = groupIndicesBy( x, indicator ); +const out = groupIndicesBy( x, indicator ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/group-indices/README.md b/lib/node_modules/@stdlib/array/base/group-indices/README.md index 1870374600db..b07cb2da221a 100644 --- a/lib/node_modules/@stdlib/array/base/group-indices/README.md +++ b/lib/node_modules/@stdlib/array/base/group-indices/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupIndices = require( '@stdlib/array/base/group-indices' ); +const groupIndices = require( '@stdlib/array/base/group-indices' ); ``` #### groupIndices( x, groups ) @@ -45,10 +45,10 @@ var groupIndices = require( '@stdlib/array/base/group-indices' ); Groups element indices as arrays associated with distinct keys. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var out = groupIndices( x, groups ); +const out = groupIndices( x, groups ); // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] } ``` @@ -65,10 +65,10 @@ var out = groupIndices( x, groups ); - Each value in `groups` should resolve to a value which can be serialized as an object key. As a counterexample, ```javascript - var x = [ 'beep', 'boop', 'foo', 'bar' ]; - var groups = [ {}, {}, {}, {} ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; + const groups = [ {}, {}, {}, {} ]; - var out = groupIndices( x, groups ); + const out = groupIndices( x, groups ); // returns { '[object Object]': [ 0, 1, 2, 3 ] } ``` @@ -87,27 +87,27 @@ var out = groupIndices( x, groups ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupIndices = require( '@stdlib/array/base/group-indices' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupIndices = require( '@stdlib/array/base/group-indices' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, values.length, { +const groups = discreteUniform( x.length, 0, values.length, { 'dtype': 'generic' }); // Group the values: -var out = groupIndices( x, groups ); +const out = groupIndices( x, groups ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/group-values-by/README.md b/lib/node_modules/@stdlib/array/base/group-values-by/README.md index ee14a57bc1de..dff47e2909ac 100644 --- a/lib/node_modules/@stdlib/array/base/group-values-by/README.md +++ b/lib/node_modules/@stdlib/array/base/group-values-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupValuesBy = require( '@stdlib/array/base/group-values-by' ); +const groupValuesBy = require( '@stdlib/array/base/group-values-by' ); ``` #### groupValuesBy( x, indicator\[, thisArg] ) @@ -49,9 +49,9 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupValuesBy( x, indicator ); +const out = groupValuesBy( x, indicator ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -69,15 +69,15 @@ function indicator( v ) { return v[ 0 ]; } -var x = [ 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; -var context = { +const context = { 'count': 0 }; -var out = groupValuesBy( x, indicator, context ); +const out = groupValuesBy( x, indicator, context ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -97,9 +97,9 @@ var cnt = context.count; function indicator( v ) { return {}; } - var x = [ 'beep', 'boop', 'foo', 'bar' ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; - var out = groupValuesBy( x, indicator ); + const out = groupValuesBy( x, indicator ); // returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -118,9 +118,9 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupValuesBy = require( '@stdlib/array/base/group-values-by' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupValuesBy = require( '@stdlib/array/base/group-values-by' ); function indicator( v ) { // Use the first letter of each element to define groups: @@ -128,17 +128,17 @@ function indicator( v ) { } // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Group the values: -var out = groupValuesBy( x, indicator ); +const out = groupValuesBy( x, indicator ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/group-values/README.md b/lib/node_modules/@stdlib/array/base/group-values/README.md index bd228e1a9386..451b813629aa 100644 --- a/lib/node_modules/@stdlib/array/base/group-values/README.md +++ b/lib/node_modules/@stdlib/array/base/group-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupValues = require( '@stdlib/array/base/group-values' ); +const groupValues = require( '@stdlib/array/base/group-values' ); ``` #### groupValues( x, groups ) @@ -45,10 +45,10 @@ var groupValues = require( '@stdlib/array/base/group-values' ); Groups elements as arrays associated with distinct keys. ```javascript -var x = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const x = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var out = groupValues( x, groups ); +const out = groupValues( x, groups ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -65,10 +65,10 @@ var out = groupValues( x, groups ); - Each value in `groups` should resolve to a value which can be serialized as an object key. As a counterexample, ```javascript - var x = [ 'beep', 'boop', 'foo', 'bar' ]; - var groups = [ {}, {}, {}, {} ]; + const x = [ 'beep', 'boop', 'foo', 'bar' ]; + const groups = [ {}, {}, {}, {} ]; - var out = groupValues( x, groups ); + const out = groupValues( x, groups ); // returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -87,27 +87,27 @@ var out = groupValues( x, groups ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var take = require( '@stdlib/array/base/take-indexed' ); -var groupValues = require( '@stdlib/array/base/group-values' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const take = require( '@stdlib/array/base/take-indexed' ); +const groupValues = require( '@stdlib/array/base/group-values' ); // Define an initial array of values: -var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Sample from the initial array to generate a random collection: -var indices = discreteUniform( 100, 0, values.length-1, { +const indices = discreteUniform( 100, 0, values.length-1, { 'dtype': 'generic' }); -var x = take( values, indices ); +const x = take( values, indices ); // returns [...] // Randomly assign collection values to groups: -var groups = discreteUniform( x.length, 0, values.length, { +const groups = discreteUniform( x.length, 0, values.length, { 'dtype': 'generic' }); // Group the values: -var out = groupValues( x, groups ); +const out = groupValues( x, groups ); // returns {...} console.log( out ); diff --git a/lib/node_modules/@stdlib/array/base/incrspace/README.md b/lib/node_modules/@stdlib/array/base/incrspace/README.md index 55683c30909b..6db13995872c 100644 --- a/lib/node_modules/@stdlib/array/base/incrspace/README.md +++ b/lib/node_modules/@stdlib/array/base/incrspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); ``` #### incrspace( start, stop, increment ) @@ -35,7 +35,7 @@ var incrspace = require( '@stdlib/array/base/incrspace' ); Generates a linearly spaced numeric `array` according to a provided `increment`. ```javascript -var arr = incrspace( 0, 11, 2 ); +const arr = incrspace( 0, 11, 2 ); // returns [ 0, 2, 4, 6, 8, 10 ] ``` @@ -50,7 +50,7 @@ var arr = incrspace( 0, 11, 2 ); - The output `array` is guaranteed to include the `start` value but does **not** include the `stop` value. Beware that values subsequent to the `start` value are subject to floating-point errors. Hence, ```javascript - var arr = incrspace( 0.1, 0.5, 0.2 ); + const arr = incrspace( 0.1, 0.5, 0.2 ); // returns [ 0.1, ~0.3 ] ``` @@ -59,14 +59,13 @@ var arr = incrspace( 0, 11, 2 ); If you desire more control over element precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); // Create an array subject to floating-point errors: - var arr = incrspace( 0, 1.01, 0.02 ); + const arr = incrspace( 0, 1.01, 0.02 ); // Round each value to the nearest hundredth: - var i; - for ( i = 0; i < arr.length; i++ ) { + for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = roundn( arr[ i ], -2 ); } @@ -84,9 +83,9 @@ var arr = incrspace( 0, 11, 2 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); -var out = incrspace( 0, 10, 2 ); +let out = incrspace( 0, 10, 2 ); console.log( out.join( '\n' ) ); out = incrspace( 0, 11, 2 ); diff --git a/lib/node_modules/@stdlib/array/base/index-of/README.md b/lib/node_modules/@stdlib/array/base/index-of/README.md index bf2b5dec8588..d76eb65cb9a5 100644 --- a/lib/node_modules/@stdlib/array/base/index-of/README.md +++ b/lib/node_modules/@stdlib/array/base/index-of/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var indexOf = require( '@stdlib/array/base/index-of' ); +const indexOf = require( '@stdlib/array/base/index-of' ); ``` #### indexOf( x, searchElement, fromIndex, equalNaNs ) @@ -45,45 +45,45 @@ var indexOf = require( '@stdlib/array/base/index-of' ); Returns the index of the first element which equals a provided search element. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var idx = indexOf( x, 3, 0, false ); +const idx = indexOf( x, 3, 0, false ); // returns 2 ``` If the function is unable to find an element which equals a provided search element, the function returns `-1`. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var idx = indexOf( x, 7, 0, false ); +const idx = indexOf( x, 7, 0, false ); // returns -1 ``` To begin searching from specific index, provide a non-zero `fromIndex` argument. ```javascript -var x = [ 1, 1, 2, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 1, 2, 3, 3 ]; -var idx = indexOf( x, 2, 3, false ); +const idx = indexOf( x, 2, 3, false ); // returns 4 ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`. ```javascript -var x = [ 1, 1, 2, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 1, 2, 3, 3 ]; -var idx = indexOf( x, 2, -4, false ); +const idx = indexOf( x, 2, -4, false ); // returns 4 ``` When searching for a search element, the function checks for strict equality. As a consequence, `NaN` values are considered distinct. In order to resolve the first element which is `NaN`, set the `equalNaNs` argument to `true`. ```javascript -var x = [ 1, 2, 3, NaN, 5, 6 ]; +const x = [ 1, 2, 3, NaN, 5, 6 ]; -var idx = indexOf( x, NaN, 0, false ); +let idx = indexOf( x, NaN, 0, false ); // returns -1 idx = indexOf( x, NaN, 0, true ); @@ -121,11 +121,11 @@ idx = indexOf( x, NaN, 0, true ); ```javascript -var indexOf = require( '@stdlib/array/base/index-of' ); +const indexOf = require( '@stdlib/array/base/index-of' ); -var x = [ 'foo', 'bar', 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'foo', 'bar', 'beep', 'boop', 'foo', 'bar' ]; -var idx = indexOf( x, 'beep', 0, false ); +let idx = indexOf( x, 'beep', 0, false ); // returns 2 idx = indexOf( x, 'bop', 0, false ); diff --git a/lib/node_modules/@stdlib/array/base/join/README.md b/lib/node_modules/@stdlib/array/base/join/README.md index 4396cac0d232..dde98dfcdc8a 100644 --- a/lib/node_modules/@stdlib/array/base/join/README.md +++ b/lib/node_modules/@stdlib/array/base/join/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var join = require( '@stdlib/array/base/join' ); +const join = require( '@stdlib/array/base/join' ); ``` #### join( x, separator ) @@ -45,9 +45,9 @@ var join = require( '@stdlib/array/base/join' ); Returns a string created by joining array elements using a specified separator. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = join( x, ',' ); +const out = join( x, ',' ); // returns '1,2,3,4,5,6' ``` @@ -84,14 +84,14 @@ var out = join( x, ',' ); ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var AccessorArray = require( '@stdlib/array/base/accessor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var join = require( '@stdlib/array/base/join' ); - -var x = [ 0, 1, 2, 3, 4, 5 ]; -var s = join( x, ',' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const AccessorArray = require( '@stdlib/array/base/accessor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const join = require( '@stdlib/array/base/join' ); + +let x = [ 0, 1, 2, 3, 4, 5 ]; +let s = join( x, ',' ); // returns '0,1,2,3,4,5' x = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); diff --git a/lib/node_modules/@stdlib/array/base/last-index-of/README.md b/lib/node_modules/@stdlib/array/base/last-index-of/README.md index e6348697f753..1b5d207dfbd1 100644 --- a/lib/node_modules/@stdlib/array/base/last-index-of/README.md +++ b/lib/node_modules/@stdlib/array/base/last-index-of/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var lastIndexOf = require( '@stdlib/array/base/last-index-of' ); +const lastIndexOf = require( '@stdlib/array/base/last-index-of' ); ``` #### lastIndexOf( x, searchElement, fromIndex, equalNaNs ) @@ -45,45 +45,45 @@ var lastIndexOf = require( '@stdlib/array/base/last-index-of' ); Returns the index of the last element which equals a provided search element. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var idx = lastIndexOf( x, 3, 5, false ); +const idx = lastIndexOf( x, 3, 5, false ); // returns 2 ``` If the function is unable to find an element which equals a provided search element, the function returns `-1`. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var idx = lastIndexOf( x, 7, 5, false ); +const idx = lastIndexOf( x, 7, 5, false ); // returns -1 ``` To begin searching from a specific index, provide a corresponding `fromIndex` argument. ```javascript -var x = [ 1, 1, 2, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 1, 2, 3, 3 ]; -var idx = lastIndexOf( x, 2, 3, false ); +const idx = lastIndexOf( x, 2, 3, false ); // returns 2 ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`. ```javascript -var x = [ 1, 1, 2, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 1, 2, 3, 3 ]; -var idx = lastIndexOf( x, 2, -4, false ); +const idx = lastIndexOf( x, 2, -4, false ); // returns 2 ``` When searching for a search element, the function checks for strict equality. As a consequence, `NaN` values are considered distinct. In order to resolve the last element which is `NaN`, set the `equalNaNs` argument to `true`. ```javascript -var x = [ 1, 2, 3, NaN, 5, 6 ]; +const x = [ 1, 2, 3, NaN, 5, 6 ]; -var idx = lastIndexOf( x, NaN, 5, false ); +let idx = lastIndexOf( x, NaN, 5, false ); // returns -1 idx = lastIndexOf( x, NaN, 5, true ); @@ -123,11 +123,11 @@ idx = lastIndexOf( x, NaN, 5, true ); ```javascript -var lastIndexOf = require( '@stdlib/array/base/last-index-of' ); +const lastIndexOf = require( '@stdlib/array/base/last-index-of' ); -var x = [ 'foo', 'bar', 'beep', 'boop', 'foo', 'bar' ]; +const x = [ 'foo', 'bar', 'beep', 'boop', 'foo', 'bar' ]; -var idx = lastIndexOf( x, 'beep', 5, false ); +let idx = lastIndexOf( x, 'beep', 5, false ); // returns 2 idx = lastIndexOf( x, 'bop', 5, false ); diff --git a/lib/node_modules/@stdlib/array/base/last/README.md b/lib/node_modules/@stdlib/array/base/last/README.md index e1e89b8ab997..8065a2e8a5a1 100644 --- a/lib/node_modules/@stdlib/array/base/last/README.md +++ b/lib/node_modules/@stdlib/array/base/last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var last = require( '@stdlib/array/base/last' ); +const last = require( '@stdlib/array/base/last' ); ``` #### last( x ) @@ -45,9 +45,9 @@ var last = require( '@stdlib/array/base/last' ); Returns the last element of an array-like object. ```javascript -var x = [ 1, 2, 3 ]; +const x = [ 1, 2, 3 ]; -var out = last( x ); +const out = last( x ); // returns 3 ``` @@ -72,22 +72,22 @@ var out = last( x ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var last = require( '@stdlib/array/base/last' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const last = require( '@stdlib/array/base/last' ); // Create a complex number array: -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Return the last element: -var out = last( arr ); +const out = last( arr ); // returns -var re = realf( out ); +const re = realf( out ); // returns 5.0 -var im = imagf( out ); +const im = imagf( out ); // returns 6.0 console.log( '%d + %di', re, im ); diff --git a/lib/node_modules/@stdlib/array/base/linspace/README.md b/lib/node_modules/@stdlib/array/base/linspace/README.md index 8ae21d80d23e..42eb72995834 100644 --- a/lib/node_modules/@stdlib/array/base/linspace/README.md +++ b/lib/node_modules/@stdlib/array/base/linspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); +const linspace = require( '@stdlib/array/base/linspace' ); ``` #### linspace( start, stop, length ) @@ -35,7 +35,7 @@ var linspace = require( '@stdlib/array/base/linspace' ); Generates a linearly spaced numeric `array`. ```javascript -var arr = linspace( 0, 100, 6 ); +const arr = linspace( 0, 100, 6 ); // returns [ 0, 20, 40, 60, 80, 100 ] ``` @@ -52,21 +52,20 @@ var arr = linspace( 0, 100, 6 ); - The output `array` is guaranteed to include the `start` and `stop` values. Beware, however, that values between `start` and `stop` are subject to floating-point rounding errors. Hence, ```javascript - var arr = linspace( 0, 1, 3 ); + const arr = linspace( 0, 1, 3 ); // returns [ 0, ~0.5, 1 ] ``` where `arr[1]` is only guaranteed to be approximately equal to `0.5`. If you desire more control over element precision, consider using [`roundn`][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); // Create an array subject to floating-point rounding errors: - var arr = linspace( 0, 1, 21 ); + const arr = linspace( 0, 1, 21 ); // Round each value to the nearest hundredth: - var i; - for ( i = 0; i < arr.length; i++ ) { + for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = roundn( arr[ i ], -2 ); } console.log( arr.join( '\n' ) ); @@ -83,10 +82,10 @@ var arr = linspace( 0, 100, 6 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); +const linspace = require( '@stdlib/array/base/linspace' ); // Create arrays of varying lengths: -var out = linspace( 0, 10, 10 ); +let out = linspace( 0, 10, 10 ); console.log( out ); out = linspace( 0, 10, 11 ); diff --git a/lib/node_modules/@stdlib/array/base/logspace/README.md b/lib/node_modules/@stdlib/array/base/logspace/README.md index 9b3f9de33f9a..699bfabacd4f 100644 --- a/lib/node_modules/@stdlib/array/base/logspace/README.md +++ b/lib/node_modules/@stdlib/array/base/logspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logspace = require( '@stdlib/array/base/logspace' ); +const logspace = require( '@stdlib/array/base/logspace' ); ``` #### logspace( a, b, length ) @@ -35,7 +35,7 @@ var logspace = require( '@stdlib/array/base/logspace' ); Generates a logarithmically spaced numeric `array` between `10^a` and `10^b`. ```javascript -var arr = logspace( 0, 2, 6 ); +const arr = logspace( 0, 2, 6 ); // returns [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ] ``` @@ -60,9 +60,9 @@ var arr = logspace( 0, 2, 6 ); ```javascript -var logspace = require( '@stdlib/array/base/logspace' ); +const logspace = require( '@stdlib/array/base/logspace' ); -var out = logspace( 0, 3, 100 ); +let out = logspace( 0, 3, 100 ); console.log( out.join( '\n' ) ); // Create an array with decremented values: diff --git a/lib/node_modules/@stdlib/array/base/map2d/README.md b/lib/node_modules/@stdlib/array/base/map2d/README.md index 692a63724a50..651f55279351 100644 --- a/lib/node_modules/@stdlib/array/base/map2d/README.md +++ b/lib/node_modules/@stdlib/array/base/map2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var map2d = require( '@stdlib/array/base/map2d' ); +const map2d = require( '@stdlib/array/base/map2d' ); ``` #### map2d( x, shape, fcn\[, thisArg] ) @@ -41,13 +41,13 @@ var map2d = require( '@stdlib/array/base/map2d' ); Applies a function to elements in a two-dimensional nested input array and assigns results to elements in a new two-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const shape = [ 2, 2 ]; -var y = map2d( x, shape, naryFunction( abs, 1 ) ); +const y = map2d( x, shape, naryFunction( abs, 1 ) ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ``` @@ -68,17 +68,17 @@ function fcn( x ) { return x; } -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const shape = [ 2, 2 ]; -var ctx = { +const ctx = { 'count': 0 }; -var y = map2d( x, shape, fcn, ctx ); +const y = map2d( x, shape, fcn, ctx ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] -var v = ctx.count; +const v = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var v = ctx.count; Applies a function to elements in a two-dimensional nested input array and assigns results to elements in a two-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const shape = [ 2, 2 ]; -var y = zeros2d( shape ); +const y = zeros2d( shape ); -var out = map2d.assign( x, y, shape, naryFunction( abs, 1 ) ); +const out = map2d.assign( x, y, shape, naryFunction( abs, 1 ) ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -130,18 +130,18 @@ The function assumes that the input and output arrays have the same shape. ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var map2d = require( '@stdlib/array/base/map2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const map2d = require( '@stdlib/array/base/map2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = map2d( x, shape, naryFunction( abs, 1 ) ); +const y = map2d( x, shape, naryFunction( abs, 1 ) ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/map3d/README.md b/lib/node_modules/@stdlib/array/base/map3d/README.md index 8075cea371d8..cdd5ea2e9879 100644 --- a/lib/node_modules/@stdlib/array/base/map3d/README.md +++ b/lib/node_modules/@stdlib/array/base/map3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var map3d = require( '@stdlib/array/base/map3d' ); +const map3d = require( '@stdlib/array/base/map3d' ); ``` #### map3d( x, shape, fcn\[, thisArg] ) @@ -41,13 +41,13 @@ var map3d = require( '@stdlib/array/base/map3d' ); Applies a function to elements in a three-dimensional nested input array and assigns results to elements in a new three-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; -var shape = [ 1, 2, 2 ]; +const x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; +const shape = [ 1, 2, 2 ]; -var y = map3d( x, shape, naryFunction( abs, 1 ) ); +const y = map3d( x, shape, naryFunction( abs, 1 ) ); // returns [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ``` @@ -68,17 +68,17 @@ function fcn( x ) { return x; } -var x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; -var shape = [ 1, 2, 2 ]; +const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; +const shape = [ 1, 2, 2 ]; -var ctx = { +const ctx = { 'count': 0 }; -var y = map3d( x, shape, fcn, ctx ); +const y = map3d( x, shape, fcn, ctx ); // returns [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] -var v = ctx.count; +const v = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var v = ctx.count; Applies a function to elements in a three-dimensional nested input array and assigns results to elements in a three-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; -var shape = [ 1, 2, 2 ]; +const x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; +const shape = [ 1, 2, 2 ]; -var y = zeros3d( shape ); +const y = zeros3d( shape ); -var out = map3d.assign( x, y, shape, naryFunction( abs, 1 ) ); +const out = map3d.assign( x, y, shape, naryFunction( abs, 1 ) ); // returns [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -130,18 +130,18 @@ The function assumes that the input and output arrays have the same shape. ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var map3d = require( '@stdlib/array/base/map3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const map3d = require( '@stdlib/array/base/map3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = map3d( x, shape, naryFunction( abs, 1 ) ); +const y = map3d( x, shape, naryFunction( abs, 1 ) ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/map4d/README.md b/lib/node_modules/@stdlib/array/base/map4d/README.md index b6b90dd506c0..3cf46df8280e 100644 --- a/lib/node_modules/@stdlib/array/base/map4d/README.md +++ b/lib/node_modules/@stdlib/array/base/map4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var map4d = require( '@stdlib/array/base/map4d' ); +const map4d = require( '@stdlib/array/base/map4d' ); ``` #### map4d( x, shape, fcn\[, thisArg] ) @@ -41,13 +41,13 @@ var map4d = require( '@stdlib/array/base/map4d' ); Applies a function to elements in a four-dimensional nested input array and assigns results to elements in a new four-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; -var shape = [ 1, 1, 2, 2 ]; +const x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; +const shape = [ 1, 1, 2, 2 ]; -var y = map4d( x, shape, naryFunction( abs, 1 ) ); +const y = map4d( x, shape, naryFunction( abs, 1 ) ); // returns [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ``` @@ -68,17 +68,17 @@ function fcn( x ) { return x; } -var x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; -var shape = [ 1, 1, 2, 2 ]; +const x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; +const shape = [ 1, 1, 2, 2 ]; -var ctx = { +const ctx = { 'count': 0 }; -var y = map4d( x, shape, fcn, ctx ); +const y = map4d( x, shape, fcn, ctx ); // returns [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] -var v = ctx.count; +const v = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var v = ctx.count; Applies a function to elements in a four-dimensional nested input array and assigns results to elements in a four-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; -var shape = [ 1, 1, 2, 2 ]; +const x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; +const shape = [ 1, 1, 2, 2 ]; -var y = zeros4d( shape ); +const y = zeros4d( shape ); -var out = map4d.assign( x, y, shape, naryFunction( abs, 1 ) ); +const out = map4d.assign( x, y, shape, naryFunction( abs, 1 ) ); // returns [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -130,18 +130,18 @@ The function assumes that the input and output arrays have the same shape. ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var map4d = require( '@stdlib/array/base/map4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const map4d = require( '@stdlib/array/base/map4d' ); -var shape = [ 1, 3, 3, 3 ]; +const shape = [ 1, 3, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = map4d( x, shape, naryFunction( abs, 1 ) ); +const y = map4d( x, shape, naryFunction( abs, 1 ) ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/map5d/README.md b/lib/node_modules/@stdlib/array/base/map5d/README.md index 7f27c3cc407f..b3888367eb45 100644 --- a/lib/node_modules/@stdlib/array/base/map5d/README.md +++ b/lib/node_modules/@stdlib/array/base/map5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var map5d = require( '@stdlib/array/base/map5d' ); +const map5d = require( '@stdlib/array/base/map5d' ); ``` #### map5d( x, shape, fcn\[, thisArg] ) @@ -41,13 +41,13 @@ var map5d = require( '@stdlib/array/base/map5d' ); Applies a function to elements in a five-dimensional nested input array and assigns results to elements in a new five-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; -var shape = [ 1, 1, 1, 2, 2 ]; +const x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; +const shape = [ 1, 1, 1, 2, 2 ]; -var y = map5d( x, shape, naryFunction( abs, 1 ) ); +const y = map5d( x, shape, naryFunction( abs, 1 ) ); // returns [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ] ``` @@ -68,17 +68,17 @@ function fcn( x ) { return x; } -var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; -var shape = [ 1, 1, 1, 2, 2 ]; +const x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; +const shape = [ 1, 1, 1, 2, 2 ]; -var ctx = { +const ctx = { 'count': 0 }; -var y = map5d( x, shape, fcn, ctx ); +const y = map5d( x, shape, fcn, ctx ); // returns [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ] -var v = ctx.count; +const v = ctx.count; // returns 4 ``` @@ -87,19 +87,19 @@ var v = ctx.count; Applies a function to elements in a five-dimensional nested input array and assigns results to elements in a five-dimensional nested output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; -var shape = [ 1, 1, 1, 2, 2 ]; +const x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; +const shape = [ 1, 1, 1, 2, 2 ]; -var y = zeros5d( shape ); +const y = zeros5d( shape ); -var out = map5d.assign( x, y, shape, naryFunction( abs, 1 ) ); +const out = map5d.assign( x, y, shape, naryFunction( abs, 1 ) ); // returns [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -130,18 +130,18 @@ The function assumes that the input and output arrays have the same shape. ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var map5d = require( '@stdlib/array/base/map5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const map5d = require( '@stdlib/array/base/map5d' ); -var shape = [ 1, 1, 3, 3, 3 ]; +const shape = [ 1, 1, 3, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = map5d( x, shape, naryFunction( abs, 1 ) ); +const y = map5d( x, shape, naryFunction( abs, 1 ) ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/min-signed-integer-dtype/README.md b/lib/node_modules/@stdlib/array/base/min-signed-integer-dtype/README.md index f8585d9e16a2..46e5aa5a0605 100644 --- a/lib/node_modules/@stdlib/array/base/min-signed-integer-dtype/README.md +++ b/lib/node_modules/@stdlib/array/base/min-signed-integer-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-dtype' ); +const minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-dtype' ); ``` #### minSignedIntegerDataType( value ) @@ -45,7 +45,7 @@ var minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-d Returns the minimum array [data type][@stdlib/array/dtypes] for storing a provided signed integer value. ```javascript -var dt = minSignedIntegerDataType( 9999 ); +let dt = minSignedIntegerDataType( 9999 ); // returns 'int16' dt = minSignedIntegerDataType( -3 ); @@ -83,20 +83,17 @@ dt = minSignedIntegerDataType( 1e100 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var exp2 = require( '@stdlib/math/base/special/exp2' ); -var minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-dtype' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const exp2 = require( '@stdlib/math/base/special/exp2' ); +const minSignedIntegerDataType = require( '@stdlib/array/base/min-signed-integer-dtype' ); // Generate random powers: -var exp = discreteUniform( 100, 0, 40, { +const exp = discreteUniform( 100, 0, 40, { 'dtype': 'generic' }); -// Determine the minimum data type for each generated value... -var v; -var i; -for ( i = 0; i < exp.length; i++ ) { - v = exp2( exp[ i ] ); +for ( let i = 0; i < exp.length; i++ ) { + const v = exp2( exp[ i ] ); console.log( 'min(%d) => %s', v, minSignedIntegerDataType( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/min-unsigned-integer-dtype/README.md b/lib/node_modules/@stdlib/array/base/min-unsigned-integer-dtype/README.md index a3d842c61066..064a31332211 100644 --- a/lib/node_modules/@stdlib/array/base/min-unsigned-integer-dtype/README.md +++ b/lib/node_modules/@stdlib/array/base/min-unsigned-integer-dtype/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' ); +const minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' ); ``` #### minUnsignedIntegerDataType( value ) @@ -49,7 +49,7 @@ Returns the minimum array [data type][@stdlib/array/dtypes] for storing a provid ```javascript -var dt = minUnsignedIntegerDataType( 9999 ); +let dt = minUnsignedIntegerDataType( 9999 ); // returns 'uint16' dt = minUnsignedIntegerDataType( 3 ); @@ -86,20 +86,17 @@ dt = minUnsignedIntegerDataType( 1e100 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var exp2 = require( '@stdlib/math/base/special/exp2' ); -var minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const exp2 = require( '@stdlib/math/base/special/exp2' ); +const minUnsignedIntegerDataType = require( '@stdlib/array/base/min-unsigned-integer-dtype' ); // Generate random powers: -var exp = discreteUniform( 100, 0, 40, { +const exp = discreteUniform( 100, 0, 40, { 'dtype': 'generic' }); -// Determine the minimum data type for each generated value... -var v; -var i; -for ( i = 0; i < exp.length; i++ ) { - v = exp2( exp[ i ] ); +for ( let i = 0; i < exp.length; i++ ) { + const v = exp2( exp[ i ] ); console.log( 'min(%d) => %s', v, minUnsignedIntegerDataType( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/mskbinary2d/README.md b/lib/node_modules/@stdlib/array/base/mskbinary2d/README.md index 28b248826477..cf5c86201708 100644 --- a/lib/node_modules/@stdlib/array/base/mskbinary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/mskbinary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskbinary2d = require( '@stdlib/array/base/mskbinary2d' ); +const mskbinary2d = require( '@stdlib/array/base/mskbinary2d' ); ``` #### mskbinary2d( arrays, shape, fcn ) @@ -41,15 +41,15 @@ var mskbinary2d = require( '@stdlib/array/base/mskbinary2d' ); Applies a binary callback to elements in two two-dimensional nested input arrays according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var z = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const z = zeros2d( [ 2, 2 ] ); -var mask = [ [ 0, 1 ], [ 0, 0 ] ]; +const mask = [ [ 0, 1 ], [ 0, 0 ] ]; -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; mskbinary2d( [ x, x, mask, z ], shape, add ); // z => [ [ 2.0, 0.0 ], [ 6.0, 8.0 ] ] @@ -82,25 +82,25 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add' ); -var mskbinary2d = require( '@stdlib/array/base/mskbinary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add' ); +const mskbinary2d = require( '@stdlib/array/base/mskbinary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var mask = filled2dBy( shape, bernoulli( 0.5 ) ); +const mask = filled2dBy( shape, bernoulli( 0.5 ) ); console.log( mask ); -var z = zeros2d( shape ); +const z = zeros2d( shape ); console.log( z ); mskbinary2d( [ x, y, mask, z ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/mskfilter-map/README.md b/lib/node_modules/@stdlib/array/base/mskfilter-map/README.md index 07368993beef..66cd4414b6ed 100644 --- a/lib/node_modules/@stdlib/array/base/mskfilter-map/README.md +++ b/lib/node_modules/@stdlib/array/base/mskfilter-map/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskfilterMap = require( '@stdlib/array/base/mskfilter-map' ); +const mskfilterMap = require( '@stdlib/array/base/mskfilter-map' ); ``` #### mskfilterMap( x, mask, clbk\[, thisArg] ) @@ -39,10 +39,10 @@ function clbk( value ) { return value * 2; } -var x = [ 1, 2, 3, 4 ]; -var m = [ 0, 1, 0, 1 ]; +const x = [ 1, 2, 3, 4 ]; +const m = [ 0, 1, 0, 1 ]; -var y = mskfilterMap( x, m, clbk ); +const y = mskfilterMap( x, m, clbk ); // returns [ 4, 8 ] ``` @@ -63,17 +63,17 @@ function clbk( x ) { return x; } -var x = [ 1, 2, 3, 4 ]; -var m = [ 1, 1, 0, 1 ]; +const x = [ 1, 2, 3, 4 ]; +const m = [ 1, 1, 0, 1 ]; -var ctx = { +const ctx = { 'count': 0 }; -var y = mskfilterMap( x, m, clbk, ctx ); +const y = mskfilterMap( x, m, clbk, ctx ); // returns [ 1, 2, 4 ] -var v = ctx.count; +const v = ctx.count; // returns 3 ``` @@ -88,14 +88,14 @@ function clbk( value ) { return value * 2; } -var x = [ 1, 2, 3, 4 ]; -var m = [ 0, 1, 0, 1 ]; +const x = [ 1, 2, 3, 4 ]; +const m = [ 0, 1, 0, 1 ]; -var out = [ 0, 0, 0, 0 ]; -var arr = mskfilterMap.assign( x, m, out, -2, out.length-1, clbk ); +const out = [ 0, 0, 0, 0 ]; +const arr = mskfilterMap.assign( x, m, out, -2, out.length-1, clbk ); // returns [ 0, 8, 0, 4 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -130,23 +130,23 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var mskfilterMap = require( '@stdlib/array/base/mskfilter-map' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const mskfilterMap = require( '@stdlib/array/base/mskfilter-map' ); // Generate a linearly spaced array: -var x = zeroTo( 20 ); +const x = zeroTo( 20 ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); // Filter an array using the mask: -var y = mskfilterMap( x, mask, abs2 ); +const y = mskfilterMap( x, mask, abs2 ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/mskfilter/README.md b/lib/node_modules/@stdlib/array/base/mskfilter/README.md index 38d44af378eb..e33e1f21d0d3 100644 --- a/lib/node_modules/@stdlib/array/base/mskfilter/README.md +++ b/lib/node_modules/@stdlib/array/base/mskfilter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskfilter = require( '@stdlib/array/base/mskfilter' ); +const mskfilter = require( '@stdlib/array/base/mskfilter' ); ``` #### mskfilter( x, mask ) @@ -35,9 +35,9 @@ var mskfilter = require( '@stdlib/array/base/mskfilter' ); Returns a new array by applying a mask to a provided input array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = mskfilter( x, [ 0, 1, 0, 1 ] ); +const y = mskfilter( x, [ 0, 1, 0, 1 ] ); // returns [ 2, 4 ] ``` @@ -53,15 +53,15 @@ The function **always** returns a new "generic" array. Applies a mask to a provided input array and assigns unmasked values to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; -var mask = [ 0, 1, 0, 1 ]; +const x = [ 1, 2, 3, 4 ]; +const mask = [ 0, 1, 0, 1 ]; -var out = [ 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0 ]; -var arr = mskfilter.assign( x, mask, out, -2, out.length-1 ); +const arr = mskfilter.assign( x, mask, out, -2, out.length-1 ); // returns [ 0, 4, 0, 2 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -94,22 +94,22 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var mskfilter = require( '@stdlib/array/base/mskfilter' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const mskfilter = require( '@stdlib/array/base/mskfilter' ); // Generate a linearly spaced array: -var x = zeroTo( 20 ); +const x = zeroTo( 20 ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); // Filter an array using the mask: -var y = mskfilter( x, mask ); +const y = mskfilter( x, mask ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/mskput/README.md b/lib/node_modules/@stdlib/array/base/mskput/README.md index c291825ed655..59c1e34e1ce6 100644 --- a/lib/node_modules/@stdlib/array/base/mskput/README.md +++ b/lib/node_modules/@stdlib/array/base/mskput/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskput = require( '@stdlib/array/base/mskput' ); +const mskput = require( '@stdlib/array/base/mskput' ); ``` #### mskput( x, mask, values, mode ) @@ -35,12 +35,12 @@ var mskput = require( '@stdlib/array/base/mskput' ); Replaces elements of an array with provided values according to a provided mask array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 1, 0, 1, 0 ], [ 20, 40 ], 'strict' ); +const out = mskput( x, [ 1, 0, 1, 0 ], [ 20, 40 ], 'strict' ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -62,24 +62,24 @@ The function supports the following modes: In broadcasting modes, the function supports broadcasting a `values` array containing a single element against the number of falsy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 1, 0, 1, 0 ], [ 20 ], 'strict_broadcast' ); +const out = mskput( x, [ 1, 0, 1, 0 ], [ 20 ], 'strict_broadcast' ); // returns [ 1, 20, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` In repeat mode, the function supports recycling elements in a `values` array to satisfy the number of falsy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 0, 0, 1, 0 ], [ 20, 40 ], 'repeat' ); +const out = mskput( x, [ 0, 0, 1, 0 ], [ 20, 40 ], 'repeat' ); // returns [ 20, 40, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -105,27 +105,27 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var mskput = require( '@stdlib/array/base/mskput' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const mskput = require( '@stdlib/array/base/mskput' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate a random mask array: -var N = discreteUniform( 5, 15 ); -var mask = filledBy( N, bernoulli.factory( 0.3 ) ); +const N = discreteUniform( 5, 15 ); +const mask = filledBy( N, bernoulli.factory( 0.3 ) ); console.log( mask ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = mskput( x, mask, values, 'non_strict' ); +const out = mskput( x, mask, values, 'non_strict' ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/mskreject-map/README.md b/lib/node_modules/@stdlib/array/base/mskreject-map/README.md index ececbf936e90..94c466f7de8d 100644 --- a/lib/node_modules/@stdlib/array/base/mskreject-map/README.md +++ b/lib/node_modules/@stdlib/array/base/mskreject-map/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskrejectMap = require( '@stdlib/array/base/mskreject-map' ); +const mskrejectMap = require( '@stdlib/array/base/mskreject-map' ); ``` #### mskrejectMap( x, mask, clbk\[, thisArg ] ) @@ -35,13 +35,13 @@ var mskrejectMap = require( '@stdlib/array/base/mskreject-map' ); Returns a new array by applying a mask and mapping the unmasked values according to a callback function. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; function clbk( val ) { return val * 2; } -var y = mskrejectMap( x, [ 0, 1, 0, 1 ], clbk ); +const y = mskrejectMap( x, [ 0, 1, 0, 1 ], clbk ); // returns [ 2, 6 ] ``` @@ -61,17 +61,17 @@ The `clbk` function is provided three arguments: To set the `clbk` function execution context, provide a `thisArg`. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var mask = [ 0, 1, 0, 1 ]; +const mask = [ 0, 1, 0, 1 ]; -var increase = 3; +const increase = 3; function clbk( value ) { return value + this; } -var out = mskrejectMap( x, mask, clbk, increase ); +const out = mskrejectMap( x, mask, clbk, increase ); // returns [ 4, 6 ] ``` @@ -82,20 +82,20 @@ The function **always** returns a new "generic" array. Applies a mask to a provided input array, maps the unmasked values according to a callback function, and assigns to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var mask = [ 1, 0, 1, 0 ]; +const mask = [ 1, 0, 1, 0 ]; -var out = [ 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0 ]; function clbk( val ) { return val * 2; } -var arr = mskrejectMap.assign( x, mask, out, -2, out.length-1, clbk ); +const arr = mskrejectMap.assign( x, mask, out, -2, out.length-1, clbk ); // returns [ 0, 8, 0, 4 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -130,16 +130,16 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var mskrejectMap = require( '@stdlib/array/base/mskreject-map' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const mskrejectMap = require( '@stdlib/array/base/mskreject-map' ); // Generate a linearly spaced array: -var x = zeroTo( 20 ); +const x = zeroTo( 20 ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); @@ -149,7 +149,7 @@ function clbk( val ) { } // Filter an array using the mask: -var y = mskrejectMap( x, mask, clbk ); +const y = mskrejectMap( x, mask, clbk ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/mskreject/README.md b/lib/node_modules/@stdlib/array/base/mskreject/README.md index 6f2d9e40d0bb..0d65a1576465 100644 --- a/lib/node_modules/@stdlib/array/base/mskreject/README.md +++ b/lib/node_modules/@stdlib/array/base/mskreject/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskreject = require( '@stdlib/array/base/mskreject' ); +const mskreject = require( '@stdlib/array/base/mskreject' ); ``` #### mskreject( x, mask ) @@ -35,9 +35,9 @@ var mskreject = require( '@stdlib/array/base/mskreject' ); Returns a new array by applying a mask to a provided input array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = mskreject( x, [ 0, 1, 0, 1 ] ); +const y = mskreject( x, [ 0, 1, 0, 1 ] ); // returns [ 1, 3 ] ``` @@ -53,15 +53,15 @@ The function **always** returns a new "generic" array. Applies a mask to a provided input array and assigns unmasked values to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; -var mask = [ 1, 0, 1, 0 ]; +const x = [ 1, 2, 3, 4 ]; +const mask = [ 1, 0, 1, 0 ]; -var out = [ 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0 ]; -var arr = mskreject.assign( x, mask, out, -2, out.length-1 ); +const arr = mskreject.assign( x, mask, out, -2, out.length-1 ); // returns [ 0, 4, 0, 2 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -94,22 +94,22 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var mskreject = require( '@stdlib/array/base/mskreject' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const mskreject = require( '@stdlib/array/base/mskreject' ); // Generate a linearly spaced array: -var x = zeroTo( 20 ); +const x = zeroTo( 20 ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); // Filter an array using the mask: -var y = mskreject( x, mask ); +const y = mskreject( x, mask ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/mskunary2d/README.md b/lib/node_modules/@stdlib/array/base/mskunary2d/README.md index 2d1305a2c7d9..40f0488ba5cb 100644 --- a/lib/node_modules/@stdlib/array/base/mskunary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/mskunary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskunary2d = require( '@stdlib/array/base/mskunary2d' ); +const mskunary2d = require( '@stdlib/array/base/mskunary2d' ); ``` #### mskunary2d( arrays, shape, fcn ) @@ -41,12 +41,12 @@ var mskunary2d = require( '@stdlib/array/base/mskunary2d' ); Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var mask = [ [ 0, 1 ], [ 0, 0 ] ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const mask = [ [ 0, 1 ], [ 0, 0 ] ]; -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Compute the absolute values in-place: mskunary2d( [ x, mask, x ], shape, abs ); @@ -81,22 +81,22 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var mskunary2d = require( '@stdlib/array/base/mskunary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const mskunary2d = require( '@stdlib/array/base/mskunary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var mask = filled2dBy( shape, bernoulli( 0.5 ) ); +const mask = filled2dBy( shape, bernoulli( 0.5 ) ); console.log( mask ); -var y = zeros2d( shape ); +const y = zeros2d( shape ); console.log( y ); mskunary2d( [ x, mask, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/mskunary3d/README.md b/lib/node_modules/@stdlib/array/base/mskunary3d/README.md index 4448cbba133a..0d992f8ac9f1 100644 --- a/lib/node_modules/@stdlib/array/base/mskunary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/mskunary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskunary3d = require( '@stdlib/array/base/mskunary3d' ); +const mskunary3d = require( '@stdlib/array/base/mskunary3d' ); ``` #### mskunary3d( arrays, shape, fcn ) @@ -41,12 +41,12 @@ var mskunary3d = require( '@stdlib/array/base/mskunary3d' ); Applies a unary callback to elements in a three-dimensional nested input array according to elements in a three-dimensional nested mask array and assigns results to elements in a three-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; -var mask = [ [ [ 0, 1 ], [ 0, 0 ] ] ]; +const x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; +const mask = [ [ [ 0, 1 ], [ 0, 0 ] ] ]; -var shape = [ 1, 2, 2 ]; +const shape = [ 1, 2, 2 ]; // Compute the absolute values in-place: mskunary3d( [ x, mask, x ], shape, abs ); @@ -81,22 +81,22 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var mskunary3d = require( '@stdlib/array/base/mskunary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const mskunary3d = require( '@stdlib/array/base/mskunary3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var mask = filled3dBy( shape, bernoulli( 0.5 ) ); +const mask = filled3dBy( shape, bernoulli( 0.5 ) ); console.log( mask ); -var y = zeros3d( shape ); +const y = zeros3d( shape ); console.log( y ); mskunary3d( [ x, mask, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/n-cartesian-product/README.md b/lib/node_modules/@stdlib/array/base/n-cartesian-product/README.md index 8692710275c1..1914c0e3040a 100644 --- a/lib/node_modules/@stdlib/array/base/n-cartesian-product/README.md +++ b/lib/node_modules/@stdlib/array/base/n-cartesian-product/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' ); +const nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' ); ``` #### nCartesianProduct( x1, x2\[, ...xN] ) @@ -35,20 +35,20 @@ var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' ); Returns the n-fold [Cartesian product][cartesian-product]. ```javascript -var x1 = [ 1, 2, 3 ]; -var x2 = [ 4, 5 ]; +const x1 = [ 1, 2, 3 ]; +const x2 = [ 4, 5 ]; -var out = nCartesianProduct( x1, x2 ); +const out = nCartesianProduct( x1, x2 ); // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ] ``` If provided one or more empty arrays, the function returns an empty array. ```javascript -var x1 = [ 1, 2, 3, 4 ]; -var x2 = []; +const x1 = [ 1, 2, 3, 4 ]; +const x2 = []; -var out = nCartesianProduct( x1, x2 ); +const out = nCartesianProduct( x1, x2 ); // returns [] ``` @@ -69,14 +69,14 @@ var out = nCartesianProduct( x1, x2 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' ); -var x1 = linspace( 0, 5, 6 ); -var x2 = linspace( 10, 15, 6 ); -var x3 = linspace( 20, 25, 6 ); +const x1 = linspace( 0, 5, 6 ); +const x2 = linspace( 10, 15, 6 ); +const x3 = linspace( 20, 25, 6 ); -var out = nCartesianProduct( x1, x2, x3 ); +const out = nCartesianProduct( x1, x2, x3 ); // returns [ [ 0, 10, 20 ], [ 0, 10, 21 ], ... ] ``` diff --git a/lib/node_modules/@stdlib/array/base/none-by-right/README.md b/lib/node_modules/@stdlib/array/base/none-by-right/README.md index 375137769cd9..561f55fae242 100644 --- a/lib/node_modules/@stdlib/array/base/none-by-right/README.md +++ b/lib/node_modules/@stdlib/array/base/none-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneByRight = require( '@stdlib/array/base/none-by-right' ); +const noneByRight = require( '@stdlib/array/base/none-by-right' ); ``` #### noneByRight( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 0 ]; +const x = [ 0, 0, 0, 0 ]; -var bool = noneByRight( x, isPositive ); +const bool = noneByRight( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ -1, -2, 3, -4 ]; +const x = [ -1, -2, 3, -4 ]; -var bool = noneByRight( x, isPositive ); +const bool = noneByRight( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value < 0 ); } -var x = [ 1, 2, -3, 4 ]; +const x = [ 1, 2, -3, 4 ]; -var context = { +const context = { 'count': 0 }; -var bool = noneByRight( x, predicate, context ); +const bool = noneByRight( x, predicate, context ); // returns false -var cnt = context.count; +const cnt = context.count; // returns 2 ``` @@ -121,17 +121,17 @@ var cnt = context.count; ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var noneByRight = require( '@stdlib/array/base/none-by-right' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const noneByRight = require( '@stdlib/array/base/none-by-right' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = noneByRight( x, naryFunction( isPositiveInteger, 1 ) ); +const out = noneByRight( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/none-by/README.md b/lib/node_modules/@stdlib/array/base/none-by/README.md index c598f78fbb60..eca45f383f83 100644 --- a/lib/node_modules/@stdlib/array/base/none-by/README.md +++ b/lib/node_modules/@stdlib/array/base/none-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneBy = require( '@stdlib/array/base/none-by' ); +const noneBy = require( '@stdlib/array/base/none-by' ); ``` #### noneBy( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 0, 0, 0, 0 ]; +const x = [ 0, 0, 0, 0 ]; -var bool = noneBy( x, isPositive ); +const bool = noneBy( x, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ -1, -2, 3, -4 ]; +const x = [ -1, -2, 3, -4 ]; -var bool = noneBy( x, isPositive ); +const bool = noneBy( x, isPositive ); // returns false ``` @@ -82,16 +82,16 @@ function predicate( value ) { return ( value < 0 ); } -var x = [ 1, 2, -3, 4 ]; +const x = [ 1, 2, -3, 4 ]; -var context = { +const context = { 'count': 0 }; -var bool = noneBy( x, predicate, context ); +const bool = noneBy( x, predicate, context ); // returns false -var cnt = context.count; +const cnt = context.count; // returns 3 ``` @@ -121,17 +121,17 @@ var cnt = context.count; ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var noneBy = require( '@stdlib/array/base/none-by' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const noneBy = require( '@stdlib/array/base/none-by' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = noneBy( x, naryFunction( isPositiveInteger, 1 ) ); +const out = noneBy( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/none/README.md b/lib/node_modules/@stdlib/array/base/none/README.md index fc79b7c11cfe..e47359710c67 100644 --- a/lib/node_modules/@stdlib/array/base/none/README.md +++ b/lib/node_modules/@stdlib/array/base/none/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var none = require( '@stdlib/array/base/none' ); +const none = require( '@stdlib/array/base/none' ); ``` #### none( x ) @@ -45,9 +45,9 @@ var none = require( '@stdlib/array/base/none' ); Tests whether all elements in an array are falsy. ```javascript -var x = [ 0, 0, 0, 0 ]; +const x = [ 0, 0, 0, 0 ]; -var bool = none( x ); +const bool = none( x ); // returns true ``` @@ -77,15 +77,15 @@ var bool = none( x ); ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var none = require( '@stdlib/array/base/none' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const none = require( '@stdlib/array/base/none' ); -var x = bernoulli( 10, 0.1, { +const x = bernoulli( 10, 0.1, { 'dtype': 'int8' }); // returns -var out = none( x ); +const out = none( x ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/nulls/README.md b/lib/node_modules/@stdlib/array/base/nulls/README.md index 0659f9c0c22b..b986abd6e102 100644 --- a/lib/node_modules/@stdlib/array/base/nulls/README.md +++ b/lib/node_modules/@stdlib/array/base/nulls/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nulls = require( '@stdlib/array/base/nulls' ); +const nulls = require( '@stdlib/array/base/nulls' ); ``` #### nulls( len ) @@ -45,7 +45,7 @@ var nulls = require( '@stdlib/array/base/nulls' ); Returns a "generic" array filled with `null` values. ```javascript -var out = nulls( 3 ); +const out = nulls( 3 ); // returns [ null, null, null ] ``` @@ -70,10 +70,10 @@ var out = nulls( 3 ); ```javascript -var nulls = require( '@stdlib/array/base/nulls' ); +const nulls = require( '@stdlib/array/base/nulls' ); // Create a null value array: -var arr = nulls( 10 ); +const arr = nulls( 10 ); console.log( arr ); // => [ null, null, null, null, null, null, null, null, null, null ] diff --git a/lib/node_modules/@stdlib/array/base/one-to/README.md b/lib/node_modules/@stdlib/array/base/one-to/README.md index 0edee3988148..646a7936d9d6 100644 --- a/lib/node_modules/@stdlib/array/base/one-to/README.md +++ b/lib/node_modules/@stdlib/array/base/one-to/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var oneTo = require( '@stdlib/array/base/one-to' ); +const oneTo = require( '@stdlib/array/base/one-to' ); ``` #### oneTo( n ) @@ -35,14 +35,14 @@ var oneTo = require( '@stdlib/array/base/one-to' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from one. ```javascript -var arr = oneTo( 6 ); +const arr = oneTo( 6 ); // returns [ 1, 2, 3, 4, 5, 6 ] ``` If `n <= 0`, the function returns an empty array. ```javascript -var arr = oneTo( 0 ); +let arr = oneTo( 0 ); // returns [] arr = oneTo( -1 ); @@ -52,7 +52,7 @@ arr = oneTo( -1 ); If `n` is a non-integer value greater than zero, the function returns an array having `ceil(n)` elements. ```javascript -var arr = oneTo( 5.1 ); +const arr = oneTo( 5.1 ); // returns [ 1, 2, 3, 4, 5, 6 ] ``` @@ -61,12 +61,12 @@ var arr = oneTo( 5.1 ); Fills an array with linearly spaced numeric elements which increment by 1 starting from one. ```javascript -var out = [ 0, 0, 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; -var arr = oneTo.assign( out, -1, out.length-1 ); +const arr = oneTo.assign( out, -1, out.length-1 ); // returns [ 6, 5, 4, 3, 2, 1 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -87,19 +87,19 @@ var bool = ( arr === out ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var randu = require( '@stdlib/random/base/randu' ); -var oneTo = require( '@stdlib/array/base/one-to' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const oneTo = require( '@stdlib/array/base/one-to' ); // Generate an array of random numbers: -var x = filledBy( 10, randu ); +const x = filledBy( 10, randu ); // Generate a linearly-spaced array: -var y = oneTo( x.length ); +const y = oneTo( x.length ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort `y` according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, y, 1 ); diff --git a/lib/node_modules/@stdlib/array/base/ones/README.md b/lib/node_modules/@stdlib/array/base/ones/README.md index 1fd7cb3eea27..5aca5919c1df 100644 --- a/lib/node_modules/@stdlib/array/base/ones/README.md +++ b/lib/node_modules/@stdlib/array/base/ones/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones = require( '@stdlib/array/base/ones' ); +const ones = require( '@stdlib/array/base/ones' ); ``` #### ones( len ) @@ -45,7 +45,7 @@ var ones = require( '@stdlib/array/base/ones' ); Returns a "generic" array filled with ones. ```javascript -var out = ones( 3 ); +const out = ones( 3 ); // returns [ 1.0, 1.0, 1.0 ] ``` @@ -70,11 +70,11 @@ var out = ones( 3 ); ```javascript -var gscal = require( '@stdlib/blas/base/gscal' ).ndarray; -var ones = require( '@stdlib/array/base/ones' ); +const gscal = require( '@stdlib/blas/base/gscal' ).ndarray; +const ones = require( '@stdlib/array/base/ones' ); // Create a ones array: -var arr = ones( 10 ); +const arr = ones( 10 ); // Scale element pairs... gscal( 2, 2.0, arr, 1, 0 ); diff --git a/lib/node_modules/@stdlib/array/base/ones2d/README.md b/lib/node_modules/@stdlib/array/base/ones2d/README.md index b6fe8de555b3..2f5ac4326c66 100644 --- a/lib/node_modules/@stdlib/array/base/ones2d/README.md +++ b/lib/node_modules/@stdlib/array/base/ones2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones2d = require( '@stdlib/array/base/ones2d' ); +const ones2d = require( '@stdlib/array/base/ones2d' ); ``` #### ones2d( shape ) @@ -45,7 +45,7 @@ var ones2d = require( '@stdlib/array/base/ones2d' ); Returns a two-dimensional nested array filled with ones. ```javascript -var out = ones2d( [ 2, 3 ] ); +const out = ones2d( [ 2, 3 ] ); // returns [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ``` @@ -70,11 +70,11 @@ var out = ones2d( [ 2, 3 ] ); ```javascript -var gscal = require( '@stdlib/blas/base/gscal' ); -var ones2d = require( '@stdlib/array/base/ones2d' ); +const gscal = require( '@stdlib/blas/base/gscal' ); +const ones2d = require( '@stdlib/array/base/ones2d' ); // Create a ones-filled array: -var arr = ones2d( [ 5, 10 ] ); +const arr = ones2d( [ 5, 10 ] ); // Scale element values... gscal( arr[ 0 ].length, 2.0, arr[ 0 ], 1 ); diff --git a/lib/node_modules/@stdlib/array/base/ones3d/README.md b/lib/node_modules/@stdlib/array/base/ones3d/README.md index 73f70f810960..4d58143b0617 100644 --- a/lib/node_modules/@stdlib/array/base/ones3d/README.md +++ b/lib/node_modules/@stdlib/array/base/ones3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones3d = require( '@stdlib/array/base/ones3d' ); +const ones3d = require( '@stdlib/array/base/ones3d' ); ``` #### ones3d( shape ) @@ -45,7 +45,7 @@ var ones3d = require( '@stdlib/array/base/ones3d' ); Returns a three-dimensional nested array filled with ones. ```javascript -var out = ones3d( [ 1, 2, 3 ] ); +const out = ones3d( [ 1, 2, 3 ] ); // returns [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ``` @@ -70,9 +70,9 @@ var out = ones3d( [ 1, 2, 3 ] ); ```javascript -var ones3d = require( '@stdlib/array/base/ones3d' ); +const ones3d = require( '@stdlib/array/base/ones3d' ); -var out = ones3d( [ 1, 1, 3 ] ); +let out = ones3d( [ 1, 1, 3 ] ); // returns [ [ [ 1.0, 1.0, 1.0 ] ] ] out = ones3d( [ 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/ones4d/README.md b/lib/node_modules/@stdlib/array/base/ones4d/README.md index 6c9020181acf..acc0230348c5 100644 --- a/lib/node_modules/@stdlib/array/base/ones4d/README.md +++ b/lib/node_modules/@stdlib/array/base/ones4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones4d = require( '@stdlib/array/base/ones4d' ); +const ones4d = require( '@stdlib/array/base/ones4d' ); ``` #### ones4d( shape ) @@ -45,7 +45,7 @@ var ones4d = require( '@stdlib/array/base/ones4d' ); Returns a four-dimensional nested array filled with ones. ```javascript -var out = ones4d( [ 1, 1, 2, 3 ] ); +const out = ones4d( [ 1, 1, 2, 3 ] ); // returns [ [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = ones4d( [ 1, 1, 2, 3 ] ); ```javascript -var ones4d = require( '@stdlib/array/base/ones4d' ); +const ones4d = require( '@stdlib/array/base/ones4d' ); -var out = ones4d( [ 1, 1, 1, 3 ] ); +let out = ones4d( [ 1, 1, 1, 3 ] ); // returns [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] out = ones4d( [ 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/ones5d/README.md b/lib/node_modules/@stdlib/array/base/ones5d/README.md index b2c678616fa8..21c9a0ca9a5d 100644 --- a/lib/node_modules/@stdlib/array/base/ones5d/README.md +++ b/lib/node_modules/@stdlib/array/base/ones5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones5d = require( '@stdlib/array/base/ones5d' ); +const ones5d = require( '@stdlib/array/base/ones5d' ); ``` #### ones5d( shape ) @@ -45,7 +45,7 @@ var ones5d = require( '@stdlib/array/base/ones5d' ); Returns a five-dimensional nested array filled with ones. ```javascript -var out = ones5d( [ 1, 1, 1, 2, 3 ] ); +const out = ones5d( [ 1, 1, 1, 2, 3 ] ); // returns [ [ [ [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = ones5d( [ 1, 1, 1, 2, 3 ] ); ```javascript -var ones5d = require( '@stdlib/array/base/ones5d' ); +const ones5d = require( '@stdlib/array/base/ones5d' ); -var out = ones5d( [ 1, 1, 1, 1, 3 ] ); +let out = ones5d( [ 1, 1, 1, 1, 3 ] ); // returns [ [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] ] out = ones5d( [ 1, 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/onesnd/README.md b/lib/node_modules/@stdlib/array/base/onesnd/README.md index 51c70bf7cabc..b95144e1bc6a 100644 --- a/lib/node_modules/@stdlib/array/base/onesnd/README.md +++ b/lib/node_modules/@stdlib/array/base/onesnd/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var onesnd = require( '@stdlib/array/base/onesnd' ); +const onesnd = require( '@stdlib/array/base/onesnd' ); ``` #### onesnd( shape ) @@ -45,7 +45,7 @@ var onesnd = require( '@stdlib/array/base/onesnd' ); Returns an n-dimensional nested array filled with ones. ```javascript -var out = onesnd( [ 2, 3 ] ); +const out = onesnd( [ 2, 3 ] ); // returns [ [ 1.0, 1.0, 1.0 ], [ 1.0, 1.0, 1.0 ] ] ``` @@ -70,9 +70,9 @@ var out = onesnd( [ 2, 3 ] ); ```javascript -var onesnd = require( '@stdlib/array/base/onesnd' ); +const onesnd = require( '@stdlib/array/base/onesnd' ); -var out = onesnd( [ 1, 3 ] ); +let out = onesnd( [ 1, 3 ] ); // returns [ [ 1.0, 1.0, 1.0 ] ] out = onesnd( [ 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/place/README.md b/lib/node_modules/@stdlib/array/base/place/README.md index 713469bc3329..bc9e2093e482 100644 --- a/lib/node_modules/@stdlib/array/base/place/README.md +++ b/lib/node_modules/@stdlib/array/base/place/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var place = require( '@stdlib/array/base/place' ); +const place = require( '@stdlib/array/base/place' ); ``` #### place( x, mask, values, mode ) @@ -35,12 +35,12 @@ var place = require( '@stdlib/array/base/place' ); Replaces elements of an array with provided values according to a provided mask array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 0, 1, 0, 1 ], [ 20, 40 ], 'strict' ); +const out = place( x, [ 0, 1, 0, 1 ], [ 20, 40 ], 'strict' ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -62,24 +62,24 @@ The function supports the following modes: In broadcasting modes, the function supports broadcasting a `values` array containing a single element against the number of truthy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 0, 1, 0, 1 ], [ 20 ], 'strict_broadcast' ); +const out = place( x, [ 0, 1, 0, 1 ], [ 20 ], 'strict_broadcast' ); // returns [ 1, 20, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` In repeat mode, the function supports recycling elements in a `values` array to satisfy the number of truthy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 1, 1, 0, 1 ], [ 20, 40 ], 'repeat' ); +const out = place( x, [ 1, 1, 0, 1 ], [ 20, 40 ], 'repeat' ); // returns [ 20, 40, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -105,27 +105,27 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var place = require( '@stdlib/array/base/place' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const place = require( '@stdlib/array/base/place' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate a random mask array: -var N = discreteUniform( 5, 15 ); -var mask = filledBy( N, bernoulli.factory( 0.3 ) ); +const N = discreteUniform( 5, 15 ); +const mask = filledBy( N, bernoulli.factory( 0.3 ) ); console.log( mask ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = place( x, mask, values, 'non_strict' ); +const out = place( x, mask, values, 'non_strict' ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/put/README.md b/lib/node_modules/@stdlib/array/base/put/README.md index 41a2e605423d..36637f82d0d3 100644 --- a/lib/node_modules/@stdlib/array/base/put/README.md +++ b/lib/node_modules/@stdlib/array/base/put/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var put = require( '@stdlib/array/base/put' ); +const put = require( '@stdlib/array/base/put' ); ``` #### put( x, indices, values, mode ) @@ -35,12 +35,12 @@ var put = require( '@stdlib/array/base/put' ); Replaces specified elements of an array with provided values. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ 1, 3 ], [ 20, 40 ], 'throw' ); +const out = put( x, [ 1, 3 ], [ 20, 40 ], 'throw' ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -54,21 +54,21 @@ The function supports the following parameters: If `indices` is an empty array, the function returns the input array unchanged. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [], [ 20, 40 ], 'throw' ); +const out = put( x, [], [ 20, 40 ], 'throw' ); // returns [ 1, 2, 3, 4 ] ``` The function supports broadcasting a `values` array containing a single element against an `indices` array containing one or more elements. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ 1, 3 ], [ 20 ], 'throw' ); +const out = put( x, [ 1, 3 ], [ 20 ], 'throw' ); // returns [ 1, 20, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -94,26 +94,26 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var put = require( '@stdlib/array/base/put' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const put = require( '@stdlib/array/base/put' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); console.log( indices ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = put( x, indices, values, 'throw' ); +const out = put( x, indices, values, 'throw' ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/base/quaternary2d/README.md b/lib/node_modules/@stdlib/array/base/quaternary2d/README.md index f568c8dd071a..e6632300c963 100644 --- a/lib/node_modules/@stdlib/array/base/quaternary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/quaternary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quaternary2d = require( '@stdlib/array/base/quaternary2d' ); +const quaternary2d = require( '@stdlib/array/base/quaternary2d' ); ``` #### quaternary2d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quaternary2d = require( '@stdlib/array/base/quaternary2d' ); Applies a quaternary callback to elements in four two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; quaternary2d( [ x, x, x, x, out ], shape, add ); // out => [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] @@ -80,27 +80,27 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var quaternary2d = require( '@stdlib/array/base/quaternary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const quaternary2d = require( '@stdlib/array/base/quaternary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var out = zeros2d( shape ); +const out = zeros2d( shape ); console.log( out ); quaternary2d( [ x, y, z, w, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quaternary3d/README.md b/lib/node_modules/@stdlib/array/base/quaternary3d/README.md index 5eab94ea90c7..2b9b71af5cf3 100644 --- a/lib/node_modules/@stdlib/array/base/quaternary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/quaternary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quaternary3d = require( '@stdlib/array/base/quaternary3d' ); +const quaternary3d = require( '@stdlib/array/base/quaternary3d' ); ``` #### quaternary3d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quaternary3d = require( '@stdlib/array/base/quaternary3d' ); Applies a quaternary callback to elements in four three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); -var x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; -var out = zeros3d( [ 1, 2, 2 ] ); +const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; +const out = zeros3d( [ 1, 2, 2 ] ); -var shape = [ 1, 2, 2 ]; +const shape = [ 1, 2, 2 ]; quaternary3d( [ x, x, x, x, out ], shape, add ); // out => [ [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] ] @@ -80,27 +80,27 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var quaternary3d = require( '@stdlib/array/base/quaternary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const quaternary3d = require( '@stdlib/array/base/quaternary3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var out = zeros3d( shape ); +const out = zeros3d( shape ); console.log( out ); quaternary3d( [ x, y, z, w, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quaternary4d/README.md b/lib/node_modules/@stdlib/array/base/quaternary4d/README.md index f3e5f92635e1..09f9bd25f02f 100644 --- a/lib/node_modules/@stdlib/array/base/quaternary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/quaternary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quaternary4d = require( '@stdlib/array/base/quaternary4d' ); +const quaternary4d = require( '@stdlib/array/base/quaternary4d' ); ``` #### quaternary4d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quaternary4d = require( '@stdlib/array/base/quaternary4d' ); Applies a quaternary callback to elements in four four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); -var x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; -var out = zeros4d( [ 1, 1, 2, 2 ] ); +const x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; +const out = zeros4d( [ 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 2, 2 ]; +const shape = [ 1, 1, 2, 2 ]; quaternary4d( [ x, x, x, x, out ], shape, add ); // out => [ [ [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] ] ] @@ -80,27 +80,27 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var quaternary4d = require( '@stdlib/array/base/quaternary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const quaternary4d = require( '@stdlib/array/base/quaternary4d' ); -var shape = [ 1, 3, 3, 3 ]; +const shape = [ 1, 3, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var out = zeros4d( shape ); +const out = zeros4d( shape ); console.log( out ); quaternary4d( [ x, y, z, w, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quaternary5d/README.md b/lib/node_modules/@stdlib/array/base/quaternary5d/README.md index d64ded6aa940..449098d6654c 100644 --- a/lib/node_modules/@stdlib/array/base/quaternary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/quaternary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quaternary5d = require( '@stdlib/array/base/quaternary5d' ); +const quaternary5d = require( '@stdlib/array/base/quaternary5d' ); ``` #### quaternary5d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quaternary5d = require( '@stdlib/array/base/quaternary5d' ); Applies a quaternary callback to elements in four five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); -var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; -var out = zeros5d( [ 1, 1, 1, 2, 2 ] ); +const x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; +const out = zeros5d( [ 1, 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 1, 2, 2 ]; +const shape = [ 1, 1, 1, 2, 2 ]; quaternary5d( [ x, x, x, x, out ], shape, add ); // out => [ [ [ [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] ] ] ] @@ -80,27 +80,27 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var quaternary5d = require( '@stdlib/array/base/quaternary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const quaternary5d = require( '@stdlib/array/base/quaternary5d' ); -var shape = [ 1, 1, 3, 3, 3 ]; +const shape = [ 1, 1, 3, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var out = zeros5d( shape ); +const out = zeros5d( shape ); console.log( out ); quaternary5d( [ x, y, z, w, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quinary2d/README.md b/lib/node_modules/@stdlib/array/base/quinary2d/README.md index 91a9aab25f85..3c7a0e532f51 100644 --- a/lib/node_modules/@stdlib/array/base/quinary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/quinary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quinary2d = require( '@stdlib/array/base/quinary2d' ); +const quinary2d = require( '@stdlib/array/base/quinary2d' ); ``` #### quinary2d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quinary2d = require( '@stdlib/array/base/quinary2d' ); Applies a quinary callback to elements in five two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; quinary2d( [ x, x, x, x, x, out ], shape, add ); // out => [ [ 5.0, 10.0 ], [ 15.0, 20.0 ] ] @@ -80,30 +80,30 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add5' ); -var quinary2d = require( '@stdlib/array/base/quinary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const quinary2d = require( '@stdlib/array/base/quinary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var v = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const v = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( v ); -var out = zeros2d( shape ); +const out = zeros2d( shape ); console.log( out ); quinary2d( [ x, y, z, w, v, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quinary3d/README.md b/lib/node_modules/@stdlib/array/base/quinary3d/README.md index 32ce3a3840b0..5ca7b76b96d2 100644 --- a/lib/node_modules/@stdlib/array/base/quinary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/quinary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quinary3d = require( '@stdlib/array/base/quinary3d' ); +const quinary3d = require( '@stdlib/array/base/quinary3d' ); ``` #### quinary3d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quinary3d = require( '@stdlib/array/base/quinary3d' ); Applies a quinary callback to elements in five three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); -var x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; -var out = zeros3d( [ 1, 2, 2 ] ); +const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; +const out = zeros3d( [ 1, 2, 2 ] ); -var shape = [ 1, 2, 2 ]; +const shape = [ 1, 2, 2 ]; quinary3d( [ x, x, x, x, x, out ], shape, add ); // out => [ [ [ 5.0, 10.0 ], [ 15.0, 20.0 ] ] ] @@ -80,30 +80,30 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var add = require( '@stdlib/math/base/ops/add5' ); -var quinary3d = require( '@stdlib/array/base/quinary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const quinary3d = require( '@stdlib/array/base/quinary3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var v = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const v = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( v ); -var out = zeros3d( shape ); +const out = zeros3d( shape ); console.log( out ); quinary3d( [ x, y, z, w, v, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quinary4d/README.md b/lib/node_modules/@stdlib/array/base/quinary4d/README.md index 24b17f62a583..91117c779b10 100644 --- a/lib/node_modules/@stdlib/array/base/quinary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/quinary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quinary4d = require( '@stdlib/array/base/quinary4d' ); +const quinary4d = require( '@stdlib/array/base/quinary4d' ); ``` #### quinary4d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quinary4d = require( '@stdlib/array/base/quinary4d' ); Applies a quinary callback to elements in five four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); -var x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; -var out = zeros4d( [ 1, 1, 2, 2 ] ); +const x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; +const out = zeros4d( [ 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 2, 2 ]; +const shape = [ 1, 1, 2, 2 ]; quinary4d( [ x, x, x, x, x, out ], shape, add ); // out => [ [ [ [ 5.0, 10.0 ], [ 15.0, 20.0 ] ] ] ] @@ -80,30 +80,30 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add5' ); -var quinary4d = require( '@stdlib/array/base/quinary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const quinary4d = require( '@stdlib/array/base/quinary4d' ); -var shape = [ 1, 3, 3, 3 ]; +const shape = [ 1, 3, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var v = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const v = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( v ); -var out = zeros4d( shape ); +const out = zeros4d( shape ); console.log( out ); quinary4d( [ x, y, z, w, v, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/quinary5d/README.md b/lib/node_modules/@stdlib/array/base/quinary5d/README.md index 52bee7840eb8..00f116ab9dc9 100644 --- a/lib/node_modules/@stdlib/array/base/quinary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/quinary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quinary5d = require( '@stdlib/array/base/quinary5d' ); +const quinary5d = require( '@stdlib/array/base/quinary5d' ); ``` #### quinary5d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var quinary5d = require( '@stdlib/array/base/quinary5d' ); Applies a quinary callback to elements in five five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); -var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; -var out = zeros5d( [ 1, 1, 1, 2, 2 ] ); +const x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; +const out = zeros5d( [ 1, 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 1, 2, 2 ]; +const shape = [ 1, 1, 1, 2, 2 ]; quinary5d( [ x, x, x, x, x, out ], shape, add ); // out => [ [ [ [ [ 5.0, 10.0 ], [ 15.0, 20.0 ] ] ] ] ] @@ -80,30 +80,30 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add5' ); -var quinary5d = require( '@stdlib/array/base/quinary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const quinary5d = require( '@stdlib/array/base/quinary5d' ); -var shape = [ 1, 1, 3, 3, 3 ]; +const shape = [ 1, 1, 3, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var w = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const w = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( w ); -var v = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const v = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( v ); -var out = zeros5d( shape ); +const out = zeros5d( shape ); console.log( out ); quinary5d( [ x, y, z, w, v, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/reject/README.md b/lib/node_modules/@stdlib/array/base/reject/README.md index a94c2488c0f5..7a927531c4bf 100644 --- a/lib/node_modules/@stdlib/array/base/reject/README.md +++ b/lib/node_modules/@stdlib/array/base/reject/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reject = require( '@stdlib/array/base/reject' ); +const reject = require( '@stdlib/array/base/reject' ); ``` #### reject( x, predicate\[, thisArg] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var x = [ 1, -2, -3, 4 ]; +const x = [ 1, -2, -3, 4 ]; -var out = reject( x, isPositive ); +const out = reject( x, isPositive ); // returns [ -2, -3 ] ``` @@ -69,16 +69,16 @@ function predicate( value ) { return ( value > 0 ); } -var x = [ 1, 2, -3, 4 ]; +const x = [ 1, 2, -3, 4 ]; -var context = { +const context = { 'count': 0 }; -var out = reject( x, predicate, context ); +const out = reject( x, predicate, context ); // returns [ -3 ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -107,17 +107,17 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var reject = require( '@stdlib/array/base/reject' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const reject = require( '@stdlib/array/base/reject' ); -var x = discreteUniform( 10, -5, 5, { +const x = discreteUniform( 10, -5, 5, { 'dtype': 'int32' }); // returns -var out = reject( x, naryFunction( isPositiveInteger, 1 ) ); +const out = reject( x, naryFunction( isPositiveInteger, 1 ) ); // returns ``` diff --git a/lib/node_modules/@stdlib/array/base/remove-at/README.md b/lib/node_modules/@stdlib/array/base/remove-at/README.md index bb711dafffff..70d90d81603e 100644 --- a/lib/node_modules/@stdlib/array/base/remove-at/README.md +++ b/lib/node_modules/@stdlib/array/base/remove-at/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var removeAt = require( '@stdlib/array/base/remove-at' ); +const removeAt = require( '@stdlib/array/base/remove-at' ); ``` #### removeAt( x, index ) @@ -45,12 +45,12 @@ var removeAt = require( '@stdlib/array/base/remove-at' ); Removes an element from an array. ```javascript -var x = [ 1, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 3, 3 ]; -var y = removeAt( x, -3 ); +const y = removeAt( x, -3 ); // returns [ 1, 1, 3, 3 ] -var bool = ( x === y ); +const bool = ( x === y ); // returns true ``` @@ -85,12 +85,12 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var randi = require( '@stdlib/random/base/discrete-uniform' ); -var removeAt = require( '@stdlib/array/base/remove-at' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const randi = require( '@stdlib/random/base/discrete-uniform' ); +const removeAt = require( '@stdlib/array/base/remove-at' ); // Create an array of random numbers: -var x = discreteUniform( 10, 0, 5, { +const x = discreteUniform( 10, 0, 5, { 'dtype': 'generic' }); // returns [...] @@ -98,7 +98,7 @@ var x = discreteUniform( 10, 0, 5, { console.log( x ); // Remove a random element: -var y = removeAt( x, randi( 0, x.length-1 ) ); +const y = removeAt( x, randi( 0, x.length-1 ) ); // returns [...] console.log( y ); diff --git a/lib/node_modules/@stdlib/array/base/resolve-getter/README.md b/lib/node_modules/@stdlib/array/base/resolve-getter/README.md index 91e255d66b15..35cf7479dc6f 100644 --- a/lib/node_modules/@stdlib/array/base/resolve-getter/README.md +++ b/lib/node_modules/@stdlib/array/base/resolve-getter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolveGetter = require( '@stdlib/array/base/resolve-getter' ); +const resolveGetter = require( '@stdlib/array/base/resolve-getter' ); ``` #### resolveGetter( x ) @@ -45,10 +45,10 @@ var resolveGetter = require( '@stdlib/array/base/resolve-getter' ); Returns an accessor function for retrieving an element from an array-like object. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var get = resolveGetter( x ); -var v = get( x, 2 ); +const get = resolveGetter( x ); +const v = get( x, 2 ); // returns 3 ``` @@ -86,11 +86,11 @@ The returned accessor function accepts the following arguments: ```javascript -var filled = require( '@stdlib/array/filled' ); -var resolveGetter = require( '@stdlib/array/base/resolve-getter' ); +const filled = require( '@stdlib/array/filled' ); +const resolveGetter = require( '@stdlib/array/base/resolve-getter' ); -var arr = filled( 1.0, 10, 'float64' ); -var v = resolveGetter( arr )( arr, 2 ); +let arr = filled( 1.0, 10, 'float64' ); +let v = resolveGetter( arr )( arr, 2 ); // returns 1.0 arr = filled( 2.0, 10, 'float32' ); diff --git a/lib/node_modules/@stdlib/array/base/resolve-setter/README.md b/lib/node_modules/@stdlib/array/base/resolve-setter/README.md index e39fad1a70eb..e44986825d9a 100644 --- a/lib/node_modules/@stdlib/array/base/resolve-setter/README.md +++ b/lib/node_modules/@stdlib/array/base/resolve-setter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolveSetter = require( '@stdlib/array/base/resolve-setter' ); +const resolveSetter = require( '@stdlib/array/base/resolve-setter' ); ``` #### resolveSetter( x ) @@ -45,14 +45,14 @@ var resolveSetter = require( '@stdlib/array/base/resolve-setter' ); Returns an accessor function for setting an element in an array-like object. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var set = resolveSetter( x ); +const set = resolveSetter( x ); // returns set( x, 2, 10 ); -var v = x[ 2 ]; +const v = x[ 2 ]; // returns 10 ``` @@ -91,10 +91,10 @@ The returned accessor function accepts the following arguments: ```javascript -var filled = require( '@stdlib/array/filled' ); -var resolveSetter = require( '@stdlib/array/base/resolve-setter' ); +const filled = require( '@stdlib/array/filled' ); +const resolveSetter = require( '@stdlib/array/base/resolve-setter' ); -var arr = filled( 1.0, 10, 'float64' ); +let arr = filled( 1.0, 10, 'float64' ); resolveSetter( arr )( arr, 2, 100.0 ); console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/base/reverse/README.md b/lib/node_modules/@stdlib/array/base/reverse/README.md index 7cf2c6e6f861..08a34f135647 100644 --- a/lib/node_modules/@stdlib/array/base/reverse/README.md +++ b/lib/node_modules/@stdlib/array/base/reverse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reverse = require( '@stdlib/array/base/reverse' ); +const reverse = require( '@stdlib/array/base/reverse' ); ``` #### reverse( x ) @@ -45,12 +45,12 @@ var reverse = require( '@stdlib/array/base/reverse' ); Reverses an array in-place. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = reverse( x ); +const out = reverse( x ); // returns [ 6, 5, 4, 3, 2, 1 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -85,17 +85,17 @@ var bool = ( out === x ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var reverse = require( '@stdlib/array/base/reverse' ); +const Float64Array = require( '@stdlib/array/float64' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const reverse = require( '@stdlib/array/base/reverse' ); -var x = new Float64Array( zeroTo( 6 ) ); +const x = new Float64Array( zeroTo( 6 ) ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] -var y = reverse( x ); +const y = reverse( x ); // returns [ 5.0, 4.0, 3.0, 2.0, 1.0, 0.0 ] -var z = reverse( y ); +const z = reverse( y ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ``` diff --git a/lib/node_modules/@stdlib/array/base/setter/README.md b/lib/node_modules/@stdlib/array/base/setter/README.md index f068ec8d32db..3e06e3d42248 100644 --- a/lib/node_modules/@stdlib/array/base/setter/README.md +++ b/lib/node_modules/@stdlib/array/base/setter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var setter = require( '@stdlib/array/base/setter' ); +const setter = require( '@stdlib/array/base/setter' ); ``` #### setter( dtype ) @@ -45,12 +45,12 @@ var setter = require( '@stdlib/array/base/setter' ); Returns an accessor function for setting an element in an indexed array-like object. ```javascript -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var set = setter( 'generic' ); +const set = setter( 'generic' ); set( arr, 2, 10 ); -var v = arr[ 2 ]; +const v = arr[ 2 ]; // returns 10 ``` @@ -89,11 +89,11 @@ The returned accessor function accepts the following arguments: ```javascript -var filled = require( '@stdlib/array/filled' ); -var dtype = require( '@stdlib/array/dtype' ); -var setter = require( '@stdlib/array/base/setter' ); +const filled = require( '@stdlib/array/filled' ); +const dtype = require( '@stdlib/array/dtype' ); +const setter = require( '@stdlib/array/base/setter' ); -var arr = filled( 1.0, 10, 'float64' ); +let arr = filled( 1.0, 10, 'float64' ); setter( dtype( arr ) )( arr, 2, 100.0 ); console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/base/slice/README.md b/lib/node_modules/@stdlib/array/base/slice/README.md index afd13b19c108..b08244ca19c6 100644 --- a/lib/node_modules/@stdlib/array/base/slice/README.md +++ b/lib/node_modules/@stdlib/array/base/slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice = require( '@stdlib/array/base/slice' ); +const slice = require( '@stdlib/array/base/slice' ); ``` #### slice( x, start, end ) @@ -45,12 +45,12 @@ var slice = require( '@stdlib/array/base/slice' ); Returns a shallow copy of a portion of an array from an inclusive `start` index to an exclusive `end` index. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = slice( x, 1, 4 ); +const out = slice( x, 1, 4 ); // returns [ 2, 3, 4 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -85,14 +85,14 @@ var bool = ( out === x ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var slice = require( '@stdlib/array/base/slice' ); +const Float64Array = require( '@stdlib/array/float64' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const slice = require( '@stdlib/array/base/slice' ); -var x = new Float64Array( zeroTo( 6 ) ); +const x = new Float64Array( zeroTo( 6 ) ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] -var s = slice( x, 0, 6 ); +let s = slice( x, 0, 6 ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] s = slice( x, 0, 4 ); diff --git a/lib/node_modules/@stdlib/array/base/strided2array2d/README.md b/lib/node_modules/@stdlib/array/base/strided2array2d/README.md index 91d37072853c..2ae6d4b0188d 100644 --- a/lib/node_modules/@stdlib/array/base/strided2array2d/README.md +++ b/lib/node_modules/@stdlib/array/base/strided2array2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strided2array2d = require( '@stdlib/array/base/strided2array2d' ); +const strided2array2d = require( '@stdlib/array/base/strided2array2d' ); ``` #### strided2array2d( x, shape, strides, offset ) @@ -41,9 +41,9 @@ var strided2array2d = require( '@stdlib/array/base/strided2array2d' ); Converts a strided array to a two-dimensional nested array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var arr = strided2array2d( x, [ 3, 2 ], [ 2, 1 ], 0 ); +let arr = strided2array2d( x, [ 3, 2 ], [ 2, 1 ], 0 ); // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] arr = strided2array2d( x, [ 3, 2 ], [ 1, 3 ], 0 ); @@ -78,17 +78,17 @@ The function accepts the following arguments: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strided2array2d = require( '@stdlib/array/base/strided2array2d' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strided2array2d = require( '@stdlib/array/base/strided2array2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = zeroTo( numel( shape ) ); +const x = zeroTo( numel( shape ) ); console.log( x ); -var y = strided2array2d( x, shape, shape2strides( shape, 'row-major' ), 0 ); +let y = strided2array2d( x, shape, shape2strides( shape, 'row-major' ), 0 ); console.log( y ); y = strided2array2d( x, shape, shape2strides( shape, 'column-major' ), 0 ); diff --git a/lib/node_modules/@stdlib/array/base/strided2array3d/README.md b/lib/node_modules/@stdlib/array/base/strided2array3d/README.md index e14d1a631bdf..d16831ec4b23 100644 --- a/lib/node_modules/@stdlib/array/base/strided2array3d/README.md +++ b/lib/node_modules/@stdlib/array/base/strided2array3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strided2array3d = require( '@stdlib/array/base/strided2array3d' ); +const strided2array3d = require( '@stdlib/array/base/strided2array3d' ); ``` #### strided2array3d( x, shape, strides, offset ) @@ -41,9 +41,9 @@ var strided2array3d = require( '@stdlib/array/base/strided2array3d' ); Converts a strided array to a three-dimensional nested array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var arr = strided2array3d( x, [ 1, 3, 2 ], [ 6, 2, 1 ], 0 ); +let arr = strided2array3d( x, [ 1, 3, 2 ], [ 6, 2, 1 ], 0 ); // returns [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ] arr = strided2array3d( x, [ 1, 3, 2 ], [ 1, 1, 3 ], 0 ); @@ -78,17 +78,17 @@ The function accepts the following arguments: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strided2array3d = require( '@stdlib/array/base/strided2array3d' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strided2array3d = require( '@stdlib/array/base/strided2array3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = zeroTo( numel( shape ) ); +const x = zeroTo( numel( shape ) ); console.log( x ); -var y = strided2array3d( x, shape, shape2strides( shape, 'row-major' ), 0 ); +let y = strided2array3d( x, shape, shape2strides( shape, 'row-major' ), 0 ); console.log( y ); y = strided2array3d( x, shape, shape2strides( shape, 'column-major' ), 0 ); diff --git a/lib/node_modules/@stdlib/array/base/strided2array4d/README.md b/lib/node_modules/@stdlib/array/base/strided2array4d/README.md index 4121068fc61d..e5df06e034b5 100644 --- a/lib/node_modules/@stdlib/array/base/strided2array4d/README.md +++ b/lib/node_modules/@stdlib/array/base/strided2array4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strided2array4d = require( '@stdlib/array/base/strided2array4d' ); +const strided2array4d = require( '@stdlib/array/base/strided2array4d' ); ``` #### strided2array4d( x, shape, strides, offset ) @@ -41,9 +41,9 @@ var strided2array4d = require( '@stdlib/array/base/strided2array4d' ); Converts a strided array to a four-dimensional nested array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var arr = strided2array4d( x, [ 1, 1, 3, 2 ], [ 6, 6, 2, 1 ], 0 ); +let arr = strided2array4d( x, [ 1, 1, 3, 2 ], [ 6, 6, 2, 1 ], 0 ); // returns [ [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ] ] arr = strided2array4d( x, [ 1, 1, 3, 2 ], [ 1, 1, 1, 3 ], 0 ); @@ -78,17 +78,17 @@ The function accepts the following arguments: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strided2array4d = require( '@stdlib/array/base/strided2array4d' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strided2array4d = require( '@stdlib/array/base/strided2array4d' ); -var shape = [ 1, 3, 3, 3 ]; +const shape = [ 1, 3, 3, 3 ]; -var x = zeroTo( numel( shape ) ); +const x = zeroTo( numel( shape ) ); console.log( x ); -var y = strided2array4d( x, shape, shape2strides( shape, 'row-major' ), 0 ); +let y = strided2array4d( x, shape, shape2strides( shape, 'row-major' ), 0 ); console.log( y ); y = strided2array4d( x, shape, shape2strides( shape, 'column-major' ), 0 ); diff --git a/lib/node_modules/@stdlib/array/base/strided2array5d/README.md b/lib/node_modules/@stdlib/array/base/strided2array5d/README.md index 660e9fb085a0..3f3dae373b5a 100644 --- a/lib/node_modules/@stdlib/array/base/strided2array5d/README.md +++ b/lib/node_modules/@stdlib/array/base/strided2array5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strided2array5d = require( '@stdlib/array/base/strided2array5d' ); +const strided2array5d = require( '@stdlib/array/base/strided2array5d' ); ``` #### strided2array5d( x, shape, strides, offset ) @@ -41,9 +41,9 @@ var strided2array5d = require( '@stdlib/array/base/strided2array5d' ); Converts a strided array to a five-dimensional nested array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var arr = strided2array5d( x, [ 1, 1, 1, 3, 2 ], [ 6, 6, 6, 2, 1 ], 0 ); +let arr = strided2array5d( x, [ 1, 1, 1, 3, 2 ], [ 6, 6, 6, 2, 1 ], 0 ); // returns [ [ [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ] ] ] arr = strided2array5d( x, [ 1, 1, 1, 3, 2 ], [ 1, 1, 1, 1, 3 ], 0 ); @@ -78,17 +78,17 @@ The function accepts the following arguments: ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strided2array5d = require( '@stdlib/array/base/strided2array5d' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strided2array5d = require( '@stdlib/array/base/strided2array5d' ); -var shape = [ 1, 1, 3, 3, 3 ]; +const shape = [ 1, 1, 3, 3, 3 ]; -var x = zeroTo( numel( shape ) ); +const x = zeroTo( numel( shape ) ); console.log( x ); -var y = strided2array5d( x, shape, shape2strides( shape, 'row-major' ), 0 ); +let y = strided2array5d( x, shape, shape2strides( shape, 'row-major' ), 0 ); console.log( y ); y = strided2array5d( x, shape, shape2strides( shape, 'column-major' ), 0 ); diff --git a/lib/node_modules/@stdlib/array/base/take-indexed/README.md b/lib/node_modules/@stdlib/array/base/take-indexed/README.md index 90450f918536..ce4b0eceb619 100644 --- a/lib/node_modules/@stdlib/array/base/take-indexed/README.md +++ b/lib/node_modules/@stdlib/array/base/take-indexed/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var takeIndexed = require( '@stdlib/array/base/take-indexed' ); +const takeIndexed = require( '@stdlib/array/base/take-indexed' ); ``` #### takeIndexed( x, indices ) @@ -35,18 +35,18 @@ var takeIndexed = require( '@stdlib/array/base/take-indexed' ); Takes elements from an indexed array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = takeIndexed( x, [ 1, 3 ] ); +const y = takeIndexed( x, [ 1, 3 ] ); // returns [ 2, 4 ] ``` If `indices` is an empty array, the function returns an empty array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = takeIndexed( x, [] ); +const y = takeIndexed( x, [] ); // returns [] ``` @@ -72,20 +72,20 @@ var y = takeIndexed( x, [] ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var takeIndexed = require( '@stdlib/array/base/take-indexed' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const takeIndexed = require( '@stdlib/array/base/take-indexed' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); // Take a random sample of elements from `x`: -var y = takeIndexed( x, indices ); +const y = takeIndexed( x, indices ); console.log( x ); console.log( indices ); diff --git a/lib/node_modules/@stdlib/array/base/take-map/README.md b/lib/node_modules/@stdlib/array/base/take-map/README.md index 5d426e425772..86a9d197a08b 100644 --- a/lib/node_modules/@stdlib/array/base/take-map/README.md +++ b/lib/node_modules/@stdlib/array/base/take-map/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var takeMap = require( '@stdlib/array/base/take-map' ); +const takeMap = require( '@stdlib/array/base/take-map' ); ``` ### takeMap( x, indices, mode, clbk ) @@ -35,13 +35,13 @@ var takeMap = require( '@stdlib/array/base/take-map' ); Takes elements from an array and returns a new array after applying a mapping function. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; function customMapping( value ) { return value * 2; } -var y = takeMap( x, [ 1, 3 ], 'throw', customMapping ); +const y = takeMap( x, [ 1, 3 ], 'throw', customMapping ); // returns [ 4, 8 ] ``` @@ -57,19 +57,19 @@ The function supports the following parameters: > Takes elements from an array and assigns the values to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; -var indices = [ 0, 0, 1, 1, 3, 3 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; +const indices = [ 0, 0, 1, 1, 3, 3 ]; function clbk( val ) { return val * 2; } -var arr = takeMap.assign( x, indices, 'throw', out, -1, out.length-1, clbk ); +const arr = takeMap.assign( x, indices, 'throw', out, -1, out.length-1, clbk ); // returns [ 8, 8, 4, 4, 2, 2 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -100,18 +100,18 @@ The function supports the following parameters: ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var takeMap = require( '@stdlib/array/base/take-map' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const takeMap = require( '@stdlib/array/base/take-map' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); console.log( indices ); // Define a mapping function (e.g., square the value): @@ -120,7 +120,7 @@ function square( val ) { } // Take a random sample of elements from `x` and apply the mapping function: -var y = takeMap( x, indices, 'throw', square ); +const y = takeMap( x, indices, 'throw', square ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/take/README.md b/lib/node_modules/@stdlib/array/base/take/README.md index 4acf80798a96..f3bebc26a624 100644 --- a/lib/node_modules/@stdlib/array/base/take/README.md +++ b/lib/node_modules/@stdlib/array/base/take/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var take = require( '@stdlib/array/base/take' ); +const take = require( '@stdlib/array/base/take' ); ``` #### take( x, indices, mode ) @@ -35,9 +35,9 @@ var take = require( '@stdlib/array/base/take' ); Takes elements from an array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = take( x, [ 1, 3 ], 'throw' ); +const y = take( x, [ 1, 3 ], 'throw' ); // returns [ 2, 4 ] ``` @@ -50,9 +50,9 @@ The function supports the following parameters: If `indices` is an empty array, the function returns an empty array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = take( x, [], 'throw' ); +const y = take( x, [], 'throw' ); // returns [] ``` @@ -61,15 +61,15 @@ var y = take( x, [], 'throw' ); Takes elements from an array and assigns the values to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; -var indices = [ 0, 0, 1, 1, 3, 3 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; +const indices = [ 0, 0, 1, 1, 3, 3 ]; -var arr = take.assign( x, indices, 'throw', out, -1, out.length-1 ); +const arr = take.assign( x, indices, 'throw', out, -1, out.length-1 ); // returns [ 4, 4, 2, 2, 1, 1 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -99,22 +99,22 @@ The function supports the following parameters: ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var take = require( '@stdlib/array/base/take' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const take = require( '@stdlib/array/base/take' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); console.log( indices ); // Take a random sample of elements from `x`: -var y = take( x, indices, 'throw' ); +const y = take( x, indices, 'throw' ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/take2d/README.md b/lib/node_modules/@stdlib/array/base/take2d/README.md index 04bd7ea948c0..d4c69a55d09d 100644 --- a/lib/node_modules/@stdlib/array/base/take2d/README.md +++ b/lib/node_modules/@stdlib/array/base/take2d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var take2d = require( '@stdlib/array/base/take2d' ); +const take2d = require( '@stdlib/array/base/take2d' ); ``` #### take2d( x, indices, dimension, mode ) @@ -35,10 +35,10 @@ var take2d = require( '@stdlib/array/base/take2d' ); Takes elements along a specified `dimension` from a two-dimensional nested array according to a specified [index `mode`][@stdlib/ndarray/index-modes]. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; -var indices = [ 1, 1, 0, 0, -1, -1 ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; +const indices = [ 1, 1, 0, 0, -1, -1 ]; -var y = take2d( x, indices, 1, 'normalize' ); +const y = take2d( x, indices, 1, 'normalize' ); // returns [ [ 2, 2, 1, 1, 2, 2 ], [ 4, 4, 3, 3, 4, 4 ] ] ``` @@ -52,12 +52,12 @@ The function accepts the following arguments: If `indices` is an empty array, the function returns empty arrays along the specified `dimension`. ```javascript -var x = [ [ 1, 2 ], [ 3, 4 ] ]; +const x = [ [ 1, 2 ], [ 3, 4 ] ]; -var y = take2d( x, [], 1, 'throw' ); +const y = take2d( x, [], 1, 'throw' ); // returns [ [], [] ] -var z = take2d( x, [], 0, 'throw' ); +const z = take2d( x, [], 0, 'throw' ); // returns [] ``` @@ -82,23 +82,23 @@ var z = take2d( x, [], 0, 'throw' ); ```javascript -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var take2d = require( '@stdlib/array/base/take2d' ); +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const take2d = require( '@stdlib/array/base/take2d' ); // Generate a random array: -var shape = [ 5, 5 ]; -var x = filled2dBy( shape, discreteUniform.factory( 0, 100 ) ); +const shape = [ 5, 5 ]; +const x = filled2dBy( shape, discreteUniform.factory( 0, 100 ) ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, shape[1]-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, shape[1]-1 ) ); console.log( indices ); // Take a random sample of elements from `x`: -var y = take2d( x, indices, 1, 'throw' ); +const y = take2d( x, indices, 1, 'throw' ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/take3d/README.md b/lib/node_modules/@stdlib/array/base/take3d/README.md index 4357a0f9becf..ca9972229c58 100644 --- a/lib/node_modules/@stdlib/array/base/take3d/README.md +++ b/lib/node_modules/@stdlib/array/base/take3d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var take3d = require( '@stdlib/array/base/take3d' ); +const take3d = require( '@stdlib/array/base/take3d' ); ``` #### take3d( x, indices, dimension, mode ) @@ -35,10 +35,10 @@ var take3d = require( '@stdlib/array/base/take3d' ); Takes elements along a specified `dimension` from a three-dimensional nested array according to a specified [index `mode`][@stdlib/ndarray/index-modes]. ```javascript -var x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; -var indices = [ 1, 1, 0, 0, -1, -1 ]; +const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; +const indices = [ 1, 1, 0, 0, -1, -1 ]; -var y = take3d( x, indices, 2, 'normalize' ); +const y = take3d( x, indices, 2, 'normalize' ); // returns [ [ [ 2, 2, 1, 1, 2, 2 ], [ 4, 4, 3, 3, 4, 4 ] ] ] ``` @@ -52,15 +52,15 @@ The function accepts the following arguments: If `indices` is an empty array, the function returns empty arrays along the specified `dimension`. ```javascript -var x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; +const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ]; -var y = take3d( x, [], 0, 'throw' ); +const y = take3d( x, [], 0, 'throw' ); // returns [] -var z = take3d( x, [], 1, 'throw' ); +const z = take3d( x, [], 1, 'throw' ); // returns [ [] ] -var w = take3d( x, [], 2, 'throw' ); +const w = take3d( x, [], 2, 'throw' ); // returns [ [ [], [] ] ] ``` @@ -85,23 +85,23 @@ var w = take3d( x, [], 2, 'throw' ); ```javascript -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var take3d = require( '@stdlib/array/base/take3d' ); +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const take3d = require( '@stdlib/array/base/take3d' ); // Generate a random array: -var shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform.factory( 0, 100 ) ); +const shape = [ 3, 3, 3 ]; +const x = filled3dBy( shape, discreteUniform.factory( 0, 100 ) ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 1, 5 ); -var indices = filledBy( N, discreteUniform.factory( 0, shape[2]-1 ) ); +const N = discreteUniform( 1, 5 ); +const indices = filledBy( N, discreteUniform.factory( 0, shape[2]-1 ) ); console.log( indices ); // Take a random sample of elements from `x`: -var y = take3d( x, indices, 2, 'throw' ); +const y = take3d( x, indices, 2, 'throw' ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/base/ternary2d/README.md b/lib/node_modules/@stdlib/array/base/ternary2d/README.md index b88940fff1ff..b7896a4958c2 100644 --- a/lib/node_modules/@stdlib/array/base/ternary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/ternary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ternary2d = require( '@stdlib/array/base/ternary2d' ); +const ternary2d = require( '@stdlib/array/base/ternary2d' ); ``` #### ternary2d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var ternary2d = require( '@stdlib/array/base/ternary2d' ); Applies a ternary callback to elements in three two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); -var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; -var out = zeros2d( [ 2, 2 ] ); +const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const out = zeros2d( [ 2, 2 ] ); -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; ternary2d( [ x, x, x, out ], shape, add ); // out => [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ] @@ -80,24 +80,24 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var ternary2d = require( '@stdlib/array/base/ternary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const ternary2d = require( '@stdlib/array/base/ternary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var out = zeros2d( shape ); +const out = zeros2d( shape ); console.log( out ); ternary2d( [ x, y, z, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/ternary3d/README.md b/lib/node_modules/@stdlib/array/base/ternary3d/README.md index 4f0d3bf9dc09..9bca110ce511 100644 --- a/lib/node_modules/@stdlib/array/base/ternary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/ternary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ternary3d = require( '@stdlib/array/base/ternary3d' ); +const ternary3d = require( '@stdlib/array/base/ternary3d' ); ``` #### ternary3d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var ternary3d = require( '@stdlib/array/base/ternary3d' ); Applies a ternary callback to elements in three three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); -var x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; -var out = zeros3d( [ 1, 2, 2 ] ); +const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ]; +const out = zeros3d( [ 1, 2, 2 ] ); -var shape = [ 1, 2, 2 ]; +const shape = [ 1, 2, 2 ]; ternary3d( [ x, x, x, out ], shape, add ); // out => [ [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ] ] @@ -80,24 +80,24 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var ternary3d = require( '@stdlib/array/base/ternary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const ternary3d = require( '@stdlib/array/base/ternary3d' ); -var shape = [ 3, 3, 3 ]; +const shape = [ 3, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var out = zeros3d( shape ); +const out = zeros3d( shape ); console.log( out ); ternary3d( [ x, y, z, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/ternary4d/README.md b/lib/node_modules/@stdlib/array/base/ternary4d/README.md index ba5e6cf5eece..2251386b4c9a 100644 --- a/lib/node_modules/@stdlib/array/base/ternary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/ternary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ternary4d = require( '@stdlib/array/base/ternary4d' ); +const ternary4d = require( '@stdlib/array/base/ternary4d' ); ``` #### ternary4d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var ternary4d = require( '@stdlib/array/base/ternary4d' ); Applies a ternary callback to elements in three four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); -var x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; -var out = zeros4d( [ 1, 1, 2, 2 ] ); +const x = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ]; +const out = zeros4d( [ 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 2, 2 ]; +const shape = [ 1, 1, 2, 2 ]; ternary4d( [ x, x, x, out ], shape, add ); // out => [ [ [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ] ] ] @@ -80,24 +80,24 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var ternary4d = require( '@stdlib/array/base/ternary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const ternary4d = require( '@stdlib/array/base/ternary4d' ); -var shape = [ 1, 3, 3, 3 ]; +const shape = [ 1, 3, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var out = zeros4d( shape ); +const out = zeros4d( shape ); console.log( out ); ternary4d( [ x, y, z, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/ternary5d/README.md b/lib/node_modules/@stdlib/array/base/ternary5d/README.md index 9fa8b5f6ecdb..dea7f584ba18 100644 --- a/lib/node_modules/@stdlib/array/base/ternary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/ternary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ternary5d = require( '@stdlib/array/base/ternary5d' ); +const ternary5d = require( '@stdlib/array/base/ternary5d' ); ``` #### ternary5d( arrays, shape, fcn ) @@ -41,13 +41,13 @@ var ternary5d = require( '@stdlib/array/base/ternary5d' ); Applies a ternary callback to elements in three five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); -var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; -var out = zeros5d( [ 1, 1, 1, 2, 2 ] ); +const x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; +const out = zeros5d( [ 1, 1, 1, 2, 2 ] ); -var shape = [ 1, 1, 1, 2, 2 ]; +const shape = [ 1, 1, 1, 2, 2 ]; ternary5d( [ x, x, x, out ], shape, add ); // out => [ [ [ [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ] ] ] ] @@ -80,24 +80,24 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var ternary5d = require( '@stdlib/array/base/ternary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const ternary5d = require( '@stdlib/array/base/ternary5d' ); -var shape = [ 1, 1, 3, 3, 3 ]; +const shape = [ 1, 1, 3, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const y = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( y ); -var z = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const z = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( z ); -var out = zeros5d( shape ); +const out = zeros5d( shape ); console.log( out ); ternary5d( [ x, y, z, out ], shape, add ); diff --git a/lib/node_modules/@stdlib/array/base/to-accessor-array/README.md b/lib/node_modules/@stdlib/array/base/to-accessor-array/README.md index 7eb1b55db90d..f12cee2a4a8b 100644 --- a/lib/node_modules/@stdlib/array/base/to-accessor-array/README.md +++ b/lib/node_modules/@stdlib/array/base/to-accessor-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +const toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); ``` #### toAccessorArray( arr ) @@ -45,30 +45,30 @@ var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); Converts an array-like object to a minimal array-like object supporting the accessor protocol. ```javascript -var arr1 = [ 1, 2, 3 ]; +const arr1 = [ 1, 2, 3 ]; -var arr2 = toAccessorArray( arr1 ); +const arr2 = toAccessorArray( arr1 ); // returns -var v = arr2.get( 1 ); +const v = arr2.get( 1 ); // returns 2 -var bool = ( arr2 === arr1 ); +const bool = ( arr2 === arr1 ); // returns false ``` If the provided array-like object already supports the accessor protocol, the function returns the input array unchanged. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var arr1 = new Complex128Array( 10 ); +const arr1 = new Complex128Array( 10 ); // returns -var arr2 = toAccessorArray( arr1 ); +const arr2 = toAccessorArray( arr1 ); // returns -var bool = ( arr2 === arr1 ); +const bool = ( arr2 === arr1 ); // returns true ``` @@ -95,23 +95,22 @@ var bool = ( arr2 === arr1 ); ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); // Define a function for printing the contents of an array and which assumes accessor protocol support: function printArray( name, x ) { - var i; - for ( i = 0; i < x.length; i++ ) { + for ( let i = 0; i < x.length; i++ ) { console.log( '%s[%d] = %s', name, i, x.get( i ).toString() ); } } // Create an array of complex numbers: -var buf = [ 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0 ]; -var cmplx = new Complex128Array( buf ); +const buf = [ 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0 ]; +let cmplx = new Complex128Array( buf ); // Create an array of the real components: -var real = [ 0, 0, 1, 2, 0, 0, 0, 0, 3, 0 ]; +let real = [ 0, 0, 1, 2, 0, 0, 0, 0, 3, 0 ]; // Ensure the arrays support the accessor protocol to allow for uniform iteration: cmplx = toAccessorArray( cmplx ); diff --git a/lib/node_modules/@stdlib/array/base/to-deduped/README.md b/lib/node_modules/@stdlib/array/base/to-deduped/README.md index 73c76aa8f310..6c59daf44d9d 100644 --- a/lib/node_modules/@stdlib/array/base/to-deduped/README.md +++ b/lib/node_modules/@stdlib/array/base/to-deduped/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toDeduped = require( '@stdlib/array/base/to-deduped' ); +const toDeduped = require( '@stdlib/array/base/to-deduped' ); ``` #### toDeduped( x, limit, equalNaNs ) @@ -45,33 +45,33 @@ var toDeduped = require( '@stdlib/array/base/to-deduped' ); Copies elements to a new "generic" array after removing consecutive duplicated values. ```javascript -var x = [ 1, 1, 2, 3, 3 ]; +const x = [ 1, 1, 2, 3, 3 ]; -var y = toDeduped( x, 1, false ); +const y = toDeduped( x, 1, false ); // returns [ 1, 2, 3 ] -var bool = ( x === y ); +const bool = ( x === y ); // returns false ``` When `equalNaNs` is `false`, `NaN` values are considered distinct, and, when `equalNaNs` is `true`, `NaN` values are considered equal. ```javascript -var x = [ NaN, NaN, 2, NaN, NaN ]; +const x = [ NaN, NaN, 2, NaN, NaN ]; -var y1 = toDeduped( x, 1, false ); +const y1 = toDeduped( x, 1, false ); // returns [ NaN, NaN, 2, NaN, NaN ] -var y2 = toDeduped( x, 1, true ); +const y2 = toDeduped( x, 1, true ); // returns [ NaN, 2, NaN ] ``` To allow consecutive duplicate values up to a specified limit, provide a `limit` argument greater than one. ```javascript -var x = [ 1, 1, 1, 2, 2, 3, 3, 3 ]; +const x = [ 1, 1, 1, 2, 2, 3, 3, 3 ]; -var y = toDeduped( x, 2, false ); +const y = toDeduped( x, 2, false ); // returns [ 1, 1, 2, 2, 3, 3 ] ``` @@ -100,17 +100,17 @@ var y = toDeduped( x, 2, false ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var toDeduped = require( '@stdlib/array/base/to-deduped' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const toDeduped = require( '@stdlib/array/base/to-deduped' ); // Create an array of random numbers: -var x = discreteUniform( 30, 0, 5, { +const x = discreteUniform( 30, 0, 5, { 'dtype': 'generic' }); // returns [...] // Remove consecutive duplicates: -var y = toDeduped( x, 1, false ); +const y = toDeduped( x, 1, false ); // returns [...] console.log( x ); diff --git a/lib/node_modules/@stdlib/array/base/to-reversed/README.md b/lib/node_modules/@stdlib/array/base/to-reversed/README.md index fcd880314c63..5f9ea75fa1c9 100644 --- a/lib/node_modules/@stdlib/array/base/to-reversed/README.md +++ b/lib/node_modules/@stdlib/array/base/to-reversed/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toReversed = require( '@stdlib/array/base/to-reversed' ); +const toReversed = require( '@stdlib/array/base/to-reversed' ); ``` #### toReversed( x ) @@ -45,12 +45,12 @@ var toReversed = require( '@stdlib/array/base/to-reversed' ); Returns a new array with elements in reverse order. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = toReversed( x ); +const out = toReversed( x ); // returns [ 6, 5, 4, 3, 2, 1 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -85,16 +85,16 @@ var bool = ( out === x ); ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var toReversed = require( '@stdlib/array/base/to-reversed' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const toReversed = require( '@stdlib/array/base/to-reversed' ); -var x = zeroTo( 6 ); +const x = zeroTo( 6 ); // returns [ 0, 1, 2, 3, 4, 5 ] -var y = toReversed( x ); +const y = toReversed( x ); // returns [ 5, 4, 3, 2, 1, 0 ] -var z = toReversed( y ); +const z = toReversed( y ); // returns [ 0, 1, 2, 3, 4, 5 ] ``` diff --git a/lib/node_modules/@stdlib/array/base/unary2d-by/README.md b/lib/node_modules/@stdlib/array/base/unary2d-by/README.md index e6e3dba55346..1d90ce4aae0e 100644 --- a/lib/node_modules/@stdlib/array/base/unary2d-by/README.md +++ b/lib/node_modules/@stdlib/array/base/unary2d-by/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary2dBy = require( '@stdlib/array/base/unary2d-by' ); +const unary2dBy = require( '@stdlib/array/base/unary2d-by' ); ``` #### unary2dBy( arrays, shape, fcn, clbk\[, thisArg] ) @@ -41,14 +41,14 @@ var unary2dBy = require( '@stdlib/array/base/unary2d-by' ); Applies a unary function to each element retrieved from a two-dimensional nested input array according to a callback function and assigns results to elements in a two-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const shape = [ 2, 2 ]; unary2dBy( [ x, x ], shape, abs, accessor ); // x => [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] @@ -73,26 +73,26 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { this.count += 1; return v * 2.0; } -var context = { +const context = { 'count': 0 }; -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; unary2dBy( [ x, y ], shape, abs, accessor, context ); // y => [ [ 2.0, 4.0 ], [ 6.0, 8.0 ] ] -var cnt = context.count; +const cnt = context.count; // returns 4 ``` @@ -107,16 +107,16 @@ var cnt = context.count; - If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is **ignored**. ```javascript - var abs = require( '@stdlib/math/base/special/abs' ); + const abs = require( '@stdlib/math/base/special/abs' ); function accessor() { // No-op... } - var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; - var y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; + const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; + const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - var shape = [ 2, 2 ]; + const shape = [ 2, 2 ]; unary2dBy( [ x, y ], shape, abs, accessor ); // y => [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] @@ -135,24 +135,24 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unary2dBy = require( '@stdlib/array/base/unary2d-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unary2dBy = require( '@stdlib/array/base/unary2d-by' ); function accessor( v ) { // Randomly determine whether a value should be considered "missing": return ( bernoulli( 0.5 ) > 0 ) ? v : void 0; } -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros2d( shape ); +const y = zeros2d( shape ); console.log( y ); unary2dBy( [ x, y ], shape, abs, accessor ); diff --git a/lib/node_modules/@stdlib/array/base/unary2d/README.md b/lib/node_modules/@stdlib/array/base/unary2d/README.md index e2e31c71ed80..9bfa7c910fac 100644 --- a/lib/node_modules/@stdlib/array/base/unary2d/README.md +++ b/lib/node_modules/@stdlib/array/base/unary2d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary2d = require( '@stdlib/array/base/unary2d' ); +const unary2d = require( '@stdlib/array/base/unary2d' ); ``` #### unary2d( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var unary2d = require( '@stdlib/array/base/unary2d' ); Applies a unary callback to elements in a two-dimensional nested input array and assigns results to elements in a two-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const shape = [ 2, 2 ]; // Compute the absolute values in-place: unary2d( [ x, x ], shape, abs ); @@ -78,18 +78,18 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unary2d = require( '@stdlib/array/base/unary2d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled2dBy = require( '@stdlib/array/base/filled2d-by' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unary2d = require( '@stdlib/array/base/unary2d' ); -var shape = [ 3, 3 ]; +const shape = [ 3, 3 ]; -var x = filled2dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled2dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros2d( shape ); +const y = zeros2d( shape ); console.log( y ); unary2d( [ x, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/unary3d/README.md b/lib/node_modules/@stdlib/array/base/unary3d/README.md index 5acf47da1395..501612680554 100644 --- a/lib/node_modules/@stdlib/array/base/unary3d/README.md +++ b/lib/node_modules/@stdlib/array/base/unary3d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary3d = require( '@stdlib/array/base/unary3d' ); +const unary3d = require( '@stdlib/array/base/unary3d' ); ``` #### unary3d( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var unary3d = require( '@stdlib/array/base/unary3d' ); Applies a unary callback to elements in a three-dimensional nested input array and assigns results to elements in a three-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; -var shape = [ 1, 2, 2 ]; +const x = [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ]; +const shape = [ 1, 2, 2 ]; // Compute the absolute values in-place: unary3d( [ x, x ], shape, abs ); @@ -78,18 +78,18 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled3dBy = require( '@stdlib/array/base/filled3d-by' ); -var zeros3d = require( '@stdlib/array/base/zeros3d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unary3d = require( '@stdlib/array/base/unary3d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled3dBy = require( '@stdlib/array/base/filled3d-by' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unary3d = require( '@stdlib/array/base/unary3d' ); -var shape = [ 2, 3, 3 ]; +const shape = [ 2, 3, 3 ]; -var x = filled3dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled3dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros3d( shape ); +const y = zeros3d( shape ); console.log( y ); unary3d( [ x, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/unary4d/README.md b/lib/node_modules/@stdlib/array/base/unary4d/README.md index 41df07c731c3..209b7fa44976 100644 --- a/lib/node_modules/@stdlib/array/base/unary4d/README.md +++ b/lib/node_modules/@stdlib/array/base/unary4d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary4d = require( '@stdlib/array/base/unary4d' ); +const unary4d = require( '@stdlib/array/base/unary4d' ); ``` #### unary4d( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var unary4d = require( '@stdlib/array/base/unary4d' ); Applies a unary callback to elements in a four-dimensional nested input array and assigns results to elements in a four-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; -var shape = [ 1, 1, 2, 2 ]; +const x = [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ]; +const shape = [ 1, 1, 2, 2 ]; // Compute the absolute values in-place: unary4d( [ x, x ], shape, abs ); @@ -78,18 +78,18 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); -var zeros4d = require( '@stdlib/array/base/zeros4d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unary4d = require( '@stdlib/array/base/unary4d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled4dBy = require( '@stdlib/array/base/filled4d-by' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unary4d = require( '@stdlib/array/base/unary4d' ); -var shape = [ 2, 2, 3, 3 ]; +const shape = [ 2, 2, 3, 3 ]; -var x = filled4dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled4dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros4d( shape ); +const y = zeros4d( shape ); console.log( y ); unary4d( [ x, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/unary5d/README.md b/lib/node_modules/@stdlib/array/base/unary5d/README.md index c20894d5b448..ed81dd9619cc 100644 --- a/lib/node_modules/@stdlib/array/base/unary5d/README.md +++ b/lib/node_modules/@stdlib/array/base/unary5d/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary5d = require( '@stdlib/array/base/unary5d' ); +const unary5d = require( '@stdlib/array/base/unary5d' ); ``` #### unary5d( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var unary5d = require( '@stdlib/array/base/unary5d' ); Applies a unary callback to elements in a five-dimensional nested input array and assigns results to elements in a five-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; -var shape = [ 1, 1, 1, 2, 2 ]; +const x = [ [ [ [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ] ] ]; +const shape = [ 1, 1, 1, 2, 2 ]; // Compute the absolute values in-place: unary5d( [ x, x ], shape, abs ); @@ -78,18 +78,18 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); -var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unary5d = require( '@stdlib/array/base/unary5d' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filled5dBy = require( '@stdlib/array/base/filled5d-by' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unary5d = require( '@stdlib/array/base/unary5d' ); -var shape = [ 2, 1, 2, 3, 3 ]; +const shape = [ 2, 1, 2, 3, 3 ]; -var x = filled5dBy( shape, discreteUniform( -100, 100 ) ); +const x = filled5dBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zeros5d( shape ); +const y = zeros5d( shape ); console.log( y ); unary5d( [ x, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/unarynd/README.md b/lib/node_modules/@stdlib/array/base/unarynd/README.md index 1a801032edf3..d1a6691c2230 100644 --- a/lib/node_modules/@stdlib/array/base/unarynd/README.md +++ b/lib/node_modules/@stdlib/array/base/unarynd/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unarynd = require( '@stdlib/array/base/unarynd' ); +const unarynd = require( '@stdlib/array/base/unarynd' ); ``` #### unarynd( arrays, shape, fcn ) @@ -41,10 +41,10 @@ var unarynd = require( '@stdlib/array/base/unarynd' ); Applies a unary callback to elements in an n-dimensional nested input array and assigns results to elements in an n-dimensional nested output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; -var shape = [ 2, 2 ]; +const x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ]; +const shape = [ 2, 2 ]; // Compute the absolute values in-place: unarynd( [ x, x ], shape, abs ); @@ -78,18 +78,18 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledndBy = require( '@stdlib/array/base/fillednd-by' ); -var zerosnd = require( '@stdlib/array/base/zerosnd' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unarynd = require( '@stdlib/array/base/unarynd' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledndBy = require( '@stdlib/array/base/fillednd-by' ); +const zerosnd = require( '@stdlib/array/base/zerosnd' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unarynd = require( '@stdlib/array/base/unarynd' ); -var shape = [ 3, 3 ]; +let shape = [ 3, 3 ]; -var x = filledndBy( shape, discreteUniform( -100, 100 ) ); +let x = filledndBy( shape, discreteUniform( -100, 100 ) ); console.log( x ); -var y = zerosnd( shape ); +let y = zerosnd( shape ); console.log( y ); unarynd( [ x, y ], shape, abs ); diff --git a/lib/node_modules/@stdlib/array/base/unitspace/README.md b/lib/node_modules/@stdlib/array/base/unitspace/README.md index 880038ef011f..c408bf75bb93 100644 --- a/lib/node_modules/@stdlib/array/base/unitspace/README.md +++ b/lib/node_modules/@stdlib/array/base/unitspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var unitspace = require( '@stdlib/array/base/unitspace' ); +const unitspace = require( '@stdlib/array/base/unitspace' ); ``` #### unitspace( start, stop ) @@ -35,7 +35,7 @@ var unitspace = require( '@stdlib/array/base/unitspace' ); Generates a linearly spaced numeric `array` whose elements increment by `1`. ```javascript -var arr = unitspace( 0, 6 ); +const arr = unitspace( 0, 6 ); // returns [ 0, 1, 2, 3, 4, 5 ] ``` @@ -50,7 +50,7 @@ var arr = unitspace( 0, 6 ); - The output `array` is guaranteed to include the `start` value but does **not** include the `stop` value. Beware that values subsequent to the `start` value are subject to floating-point errors. Hence, ```javascript - var arr = unitspace( -0.7, 1 ); + const arr = unitspace( -0.7, 1 ); // returns [ -0.7, ~0.3 ] ``` @@ -59,14 +59,13 @@ var arr = unitspace( 0, 6 ); If you desire more control over element precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); // Create an array subject to floating-point errors: - var arr = unitspace( -10.7, 11.7 ); + const arr = unitspace( -10.7, 11.7 ); // Round each value to the nearest hundredth: - var i; - for ( i = 0; i < arr.length; i++ ) { + for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = roundn( arr[ i ], -2 ); } @@ -84,19 +83,19 @@ var arr = unitspace( 0, 6 ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var randu = require( '@stdlib/random/base/randu' ); -var unitspace = require( '@stdlib/array/base/unitspace' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const unitspace = require( '@stdlib/array/base/unitspace' ); // Generate an array of random numbers: -var x = filledBy( 10, randu ); +const x = filledBy( 10, randu ); // Generate an array of indices: -var idx = unitspace( 0, x.length ); +const idx = unitspace( 0, x.length ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort the index array according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, idx, 1 ); diff --git a/lib/node_modules/@stdlib/array/base/where/README.md b/lib/node_modules/@stdlib/array/base/where/README.md index e9ea6e47827c..b143575f1982 100644 --- a/lib/node_modules/@stdlib/array/base/where/README.md +++ b/lib/node_modules/@stdlib/array/base/where/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var where = require( '@stdlib/array/base/where' ); +const where = require( '@stdlib/array/base/where' ); ``` #### where( condition, x, y ) @@ -35,12 +35,12 @@ var where = require( '@stdlib/array/base/where' ); Takes elements from either `x` or `y` depending on a condition. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5, 6, 7, 8 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5, 6, 7, 8 ]; -var condition = [ true, false, true, false ]; +const condition = [ true, false, true, false ]; -var z = where( condition, x, y ); +const z = where( condition, x, y ); // returns [ 1, 6, 3, 8 ] ``` @@ -53,12 +53,12 @@ The function supports the following parameters: When all input arrays are non-empty, the function supports broadcasting single-element arrays to the resolved output array length, which is equal to the maximum length of all provided input arrays. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5 ]; -var condition = [ true, false, true, false ]; +const condition = [ true, false, true, false ]; -var z = where( condition, x, y ); +let z = where( condition, x, y ); // returns [ 1, 5, 3, 5 ] z = where( condition, y, x ); @@ -77,12 +77,12 @@ z = where( condition, [ 1 ], y ); If `condition` is an empty array, the function returns an empty array. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5, 6, 7, 8 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5, 6, 7, 8 ]; -var condition = []; +const condition = []; -var z = where( condition, x, y ); +const z = where( condition, x, y ); // returns [] ``` @@ -91,16 +91,16 @@ var z = where( condition, x, y ); Takes elements from either `x` or `y` depending on a condition and assigns the values to elements in a provided output array. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5, 6, 7, 8 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5, 6, 7, 8 ]; -var out = [ 0, 0, 0, 0 ]; -var condition = [ true, false, true, false ]; +const out = [ 0, 0, 0, 0 ]; +const condition = [ true, false, true, false ]; -var arr = where.assign( condition, x, y, out, 1, 0 ); +const arr = where.assign( condition, x, y, out, 1, 0 ); // returns [ 1, 6, 3, 8 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -116,13 +116,13 @@ The function supports the following parameters: The function supports broadcasting single-element arrays to the output array length. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5 ]; -var condition = [ true, false, true, false ]; +const condition = [ true, false, true, false ]; -var out = [ 0, 0, 0, 0 ]; -var arr = where.assign( condition, x, y, out, 1, 0 ); +let out = [ 0, 0, 0, 0 ]; +let arr = where.assign( condition, x, y, out, 1, 0 ); // returns [ 1, 5, 3, 5 ] out = [ 0, 0, 0, 0 ]; @@ -145,16 +145,16 @@ arr = where.assign( condition, [ 1 ], y, out, 1, 0 ); When `condition` is an empty array, the function returns the output array unchanged. ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 5, 6, 7, 8 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 5, 6, 7, 8 ]; -var out = [ 0, 0, 0, 0 ]; -var condition = []; +const out = [ 0, 0, 0, 0 ]; +const condition = []; -var arr = where.assign( condition, x, y, out, 1, 0 ); +const arr = where.assign( condition, x, y, out, 1, 0 ); // returns [ 0, 0, 0, 0 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -175,27 +175,27 @@ var bool = ( arr === out ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var where = require( '@stdlib/array/base/where' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const where = require( '@stdlib/array/base/where' ); -var opts = { +const opts = { 'dtype': 'generic' }; // Generate an array of indicator values: -var condition = bernoulli( 20, 0.9, opts ); +const condition = bernoulli( 20, 0.9, opts ); console.log( condition ); // Generate an array of random values: -var x = discreteUniform( condition.length, 0, 10, opts ); +const x = discreteUniform( condition.length, 0, 10, opts ); console.log( x ); // Define an array containing a broadcasted "missing" value: -var y = [ NaN ]; +const y = [ NaN ]; // Return an array with randomly placed missing values: -var z = where( condition, x, y ); +const z = where( condition, x, y ); console.log( z ); ``` diff --git a/lib/node_modules/@stdlib/array/base/with/README.md b/lib/node_modules/@stdlib/array/base/with/README.md index ac7b68b92bb9..7d0b36dacbe1 100644 --- a/lib/node_modules/@stdlib/array/base/with/README.md +++ b/lib/node_modules/@stdlib/array/base/with/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arrayWith = require( '@stdlib/array/base/with' ); +const arrayWith = require( '@stdlib/array/base/with' ); ``` #### arrayWith( x, index, value ) @@ -45,9 +45,9 @@ var arrayWith = require( '@stdlib/array/base/with' ); Returns a new array with the element at the specified index replaced with a provided value. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = arrayWith( x, 0, 5 ); +let out = arrayWith( x, 0, 5 ); // returns [ 5, 2, 3, 4 ] out = arrayWith( x, -1, 6 ); @@ -65,13 +65,13 @@ The function accepts the following arguments: Copies elements from one array to another array and sets the element at the specified index to a provided value. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = [ 0, 0, 0, 0 ]; -var arr = arrayWith.assign( x, 0, 5, out, 1, 0 ); +const out = [ 0, 0, 0, 0 ]; +const arr = arrayWith.assign( x, 0, 5, out, 1, 0 ); // returns [ 5, 2, 3, 4 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -117,24 +117,22 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var arrayWith = require( '@stdlib/array/base/with' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const arrayWith = require( '@stdlib/array/base/with' ); // Define an array: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 5, -100, 100, opts ); +const x = discreteUniform( 5, -100, 100, opts ); // Define an array containing random index values: -var indices = discreteUniform( 100, -x.length, x.length-1, opts ); +const indices = discreteUniform( 100, -x.length, x.length-1, opts ); // Define an array with random values to set: -var values = discreteUniform( indices.length, -10000, 10000, opts ); +const values = discreteUniform( indices.length, -10000, 10000, opts ); -// Randomly set elements in the input array: -var i; -for ( i = 0; i < indices.length; i++ ) { +for ( let i = 0; i < indices.length; i++ ) { console.log( 'x = [%s]', arrayWith( x, indices[ i ], values[ i ] ).join( ',' ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/without/README.md b/lib/node_modules/@stdlib/array/base/without/README.md index 634900d055ac..a6c784c011df 100644 --- a/lib/node_modules/@stdlib/array/base/without/README.md +++ b/lib/node_modules/@stdlib/array/base/without/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var without = require( '@stdlib/array/base/without' ); +const without = require( '@stdlib/array/base/without' ); ``` #### without( x, index ) @@ -45,9 +45,9 @@ var without = require( '@stdlib/array/base/without' ); Returns a new array containing every element from an input array, except for the element at a specified index. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = without( x, 0 ); +let out = without( x, 0 ); // returns [ 2, 3, 4 ] out = without( x, -1 ); @@ -64,13 +64,13 @@ The function accepts the following arguments: Copies every element from one array to another array, except for the element at a specified index. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = [ 0, 0, 0 ]; -var arr = without.assign( x, 0, out, 1, 0 ); +const out = [ 0, 0, 0 ]; +const arr = without.assign( x, 0, out, 1, 0 ); // returns [ 2, 3, 4 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -107,21 +107,19 @@ The function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var without = require( '@stdlib/array/base/without' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const without = require( '@stdlib/array/base/without' ); // Define an array: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 5, -100, 100, opts ); +const x = discreteUniform( 5, -100, 100, opts ); // Define an array containing random index values: -var indices = discreteUniform( 100, -x.length, x.length-1, opts ); +const indices = discreteUniform( 100, -x.length, x.length-1, opts ); -// Randomly omit elements from the input array: -var i; -for ( i = 0; i < indices.length; i++ ) { +for ( let i = 0; i < indices.length; i++ ) { console.log( 'x = [%s]', without( x, indices[ i ] ).join( ',' ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/base/zero-to/README.md b/lib/node_modules/@stdlib/array/base/zero-to/README.md index 71d91a6d24e6..3dc252578dce 100644 --- a/lib/node_modules/@stdlib/array/base/zero-to/README.md +++ b/lib/node_modules/@stdlib/array/base/zero-to/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zeroTo = require( '@stdlib/array/base/zero-to' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); ``` #### zeroTo( n ) @@ -35,14 +35,14 @@ var zeroTo = require( '@stdlib/array/base/zero-to' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from zero. ```javascript -var arr = zeroTo( 6 ); +const arr = zeroTo( 6 ); // returns [ 0, 1, 2, 3, 4, 5 ] ``` If `n <= 0`, the function returns an empty array. ```javascript -var arr = zeroTo( 0 ); +let arr = zeroTo( 0 ); // returns [] arr = zeroTo( -1 ); @@ -52,7 +52,7 @@ arr = zeroTo( -1 ); If `n` is a non-integer value greater than zero, the function returns an array having `ceil(n)` elements. ```javascript -var arr = zeroTo( 5.1 ); +const arr = zeroTo( 5.1 ); // returns [ 0, 1, 2, 3, 4, 5 ] ``` @@ -61,12 +61,12 @@ var arr = zeroTo( 5.1 ); Fills an array with linearly spaced numeric elements which increment by 1 starting from zero. ```javascript -var out = [ 0, 0, 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; -var arr = zeroTo.assign( out, -1, out.length-1 ); +const arr = zeroTo.assign( out, -1, out.length-1 ); // returns [ 5, 4, 3, 2, 1, 0 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` @@ -87,19 +87,19 @@ var bool = ( arr === out ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var randu = require( '@stdlib/random/base/randu' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); // Generate an array of random numbers: -var x = filledBy( 10, randu ); +const x = filledBy( 10, randu ); // Generate an array of indices: -var idx = zeroTo( x.length ); +const idx = zeroTo( x.length ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort the index array according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, idx, 1 ); diff --git a/lib/node_modules/@stdlib/array/base/zeros/README.md b/lib/node_modules/@stdlib/array/base/zeros/README.md index 63df74148b66..04a8bd35b2c3 100644 --- a/lib/node_modules/@stdlib/array/base/zeros/README.md +++ b/lib/node_modules/@stdlib/array/base/zeros/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros = require( '@stdlib/array/base/zeros' ); +const zeros = require( '@stdlib/array/base/zeros' ); ``` #### zeros( len ) @@ -45,7 +45,7 @@ var zeros = require( '@stdlib/array/base/zeros' ); Returns a zero-filled "generic" array. ```javascript -var out = zeros( 3 ); +const out = zeros( 3 ); // returns [ 0.0, 0.0, 0.0 ] ``` @@ -70,11 +70,11 @@ var out = zeros( 3 ); ```javascript -var gfill = require( '@stdlib/blas/ext/base/gfill' ).ndarray; -var zeros = require( '@stdlib/array/base/zeros' ); +const gfill = require( '@stdlib/blas/ext/base/gfill' ).ndarray; +const zeros = require( '@stdlib/array/base/zeros' ); // Create a zero-filled array: -var arr = zeros( 10 ); +const arr = zeros( 10 ); // Fill element pairs with the same value... gfill( 2, 1.0, arr, 1, 0 ); diff --git a/lib/node_modules/@stdlib/array/base/zeros2d/README.md b/lib/node_modules/@stdlib/array/base/zeros2d/README.md index 45a36caa1513..2920a9ec7ca7 100644 --- a/lib/node_modules/@stdlib/array/base/zeros2d/README.md +++ b/lib/node_modules/@stdlib/array/base/zeros2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); ``` #### zeros2d( shape ) @@ -45,7 +45,7 @@ var zeros2d = require( '@stdlib/array/base/zeros2d' ); Returns a zero-filled two-dimensional nested array. ```javascript -var out = zeros2d( [ 2, 3 ] ); +const out = zeros2d( [ 2, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ``` @@ -70,11 +70,11 @@ var out = zeros2d( [ 2, 3 ] ); ```javascript -var gfill = require( '@stdlib/blas/ext/base/gfill' ); -var zeros2d = require( '@stdlib/array/base/zeros2d' ); +const gfill = require( '@stdlib/blas/ext/base/gfill' ); +const zeros2d = require( '@stdlib/array/base/zeros2d' ); // Create a zero-filled array: -var arr = zeros2d( [ 5, 10 ] ); +const arr = zeros2d( [ 5, 10 ] ); // Fill nested arrays with the same value... gfill( arr[ 0 ].length, 1.0, arr[ 0 ], 1 ); diff --git a/lib/node_modules/@stdlib/array/base/zeros3d/README.md b/lib/node_modules/@stdlib/array/base/zeros3d/README.md index c82e7c1ac869..540ef53755d8 100644 --- a/lib/node_modules/@stdlib/array/base/zeros3d/README.md +++ b/lib/node_modules/@stdlib/array/base/zeros3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); ``` #### zeros3d( shape ) @@ -45,7 +45,7 @@ var zeros3d = require( '@stdlib/array/base/zeros3d' ); Returns a zero-filled three-dimensional nested array. ```javascript -var out = zeros3d( [ 1, 2, 3 ] ); +const out = zeros3d( [ 1, 2, 3 ] ); // returns [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ``` @@ -70,9 +70,9 @@ var out = zeros3d( [ 1, 2, 3 ] ); ```javascript -var zeros3d = require( '@stdlib/array/base/zeros3d' ); +const zeros3d = require( '@stdlib/array/base/zeros3d' ); -var out = zeros3d( [ 1, 1, 3 ] ); +let out = zeros3d( [ 1, 1, 3 ] ); // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] out = zeros3d( [ 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/zeros4d/README.md b/lib/node_modules/@stdlib/array/base/zeros4d/README.md index b5a4e4348087..c94cefc8b85a 100644 --- a/lib/node_modules/@stdlib/array/base/zeros4d/README.md +++ b/lib/node_modules/@stdlib/array/base/zeros4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); ``` #### zeros4d( shape ) @@ -45,7 +45,7 @@ var zeros4d = require( '@stdlib/array/base/zeros4d' ); Returns a zero-filled four-dimensional nested array. ```javascript -var out = zeros4d( [ 1, 1, 2, 3 ] ); +const out = zeros4d( [ 1, 1, 2, 3 ] ); // returns [ [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = zeros4d( [ 1, 1, 2, 3 ] ); ```javascript -var zeros4d = require( '@stdlib/array/base/zeros4d' ); +const zeros4d = require( '@stdlib/array/base/zeros4d' ); -var out = zeros4d( [ 1, 1, 1, 3 ] ); +let out = zeros4d( [ 1, 1, 1, 3 ] ); // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] out = zeros4d( [ 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/zeros5d/README.md b/lib/node_modules/@stdlib/array/base/zeros5d/README.md index 0b934e8ab2dd..3daac3c91f34 100644 --- a/lib/node_modules/@stdlib/array/base/zeros5d/README.md +++ b/lib/node_modules/@stdlib/array/base/zeros5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); ``` #### zeros5d( shape ) @@ -45,7 +45,7 @@ var zeros5d = require( '@stdlib/array/base/zeros5d' ); Returns a zero-filled five-dimensional nested array. ```javascript -var out = zeros5d( [ 1, 1, 1, 2, 3 ] ); +const out = zeros5d( [ 1, 1, 1, 2, 3 ] ); // returns [ [ [ [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ] ] ``` @@ -70,9 +70,9 @@ var out = zeros5d( [ 1, 1, 1, 2, 3 ] ); ```javascript -var zeros5d = require( '@stdlib/array/base/zeros5d' ); +const zeros5d = require( '@stdlib/array/base/zeros5d' ); -var out = zeros5d( [ 1, 1, 1, 1, 3 ] ); +let out = zeros5d( [ 1, 1, 1, 1, 3 ] ); // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] out = zeros5d( [ 1, 1, 1, 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/base/zerosnd/README.md b/lib/node_modules/@stdlib/array/base/zerosnd/README.md index 6259b55ab4ae..79eb446d99db 100644 --- a/lib/node_modules/@stdlib/array/base/zerosnd/README.md +++ b/lib/node_modules/@stdlib/array/base/zerosnd/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zerosnd = require( '@stdlib/array/base/zerosnd' ); +const zerosnd = require( '@stdlib/array/base/zerosnd' ); ``` #### zerosnd( shape ) @@ -45,7 +45,7 @@ var zerosnd = require( '@stdlib/array/base/zerosnd' ); Returns a zero-filled n-dimensional nested array. ```javascript -var out = zerosnd( [ 2, 3 ] ); +const out = zerosnd( [ 2, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ``` @@ -70,9 +70,9 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -var zerosnd = require( '@stdlib/array/base/zerosnd' ); +const zerosnd = require( '@stdlib/array/base/zerosnd' ); -var out = zerosnd( [ 1, 3 ] ); +let out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] out = zerosnd( [ 3, 1 ] ); diff --git a/lib/node_modules/@stdlib/array/bool/README.md b/lib/node_modules/@stdlib/array/bool/README.md index 817eb3111669..ec4899447f25 100644 --- a/lib/node_modules/@stdlib/array/bool/README.md +++ b/lib/node_modules/@stdlib/array/bool/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); ``` @@ -47,7 +47,7 @@ var BooleanArray = require( '@stdlib/array/bool' ); Creates a boolean array. ```javascript -var arr = new BooleanArray(); +const arr = new BooleanArray(); // returns ``` @@ -56,10 +56,10 @@ var arr = new BooleanArray(); Creates a boolean array having a specified `length`. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -68,13 +68,13 @@ var len = arr.length; Creates a boolean array from another boolean array. ```javascript -var arr1 = new BooleanArray( [ true, false, false, true ] ); +const arr1 = new BooleanArray( [ true, false, false, true ] ); // returns -var arr2 = new BooleanArray( arr1 ); +const arr2 = new BooleanArray( arr1 ); // returns -var len = arr2.length; +const len = arr2.length; // returns 4 ``` @@ -83,15 +83,15 @@ var len = arr2.length; Creates a boolean array from a [typed array][@stdlib/array/typed]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var buf = new Uint8Array( [ 1, 0, 0, 1 ] ); +const buf = new Uint8Array( [ 1, 0, 0, 1 ] ); // returns [ 1, 0, 0, 1 ] -var arr = new BooleanArray( buf ); +const arr = new BooleanArray( buf ); // returns -var len = arr.length; +const len = arr.length; // returns 4 ``` @@ -101,14 +101,14 @@ Creates a boolean array from an array-like object or iterable. ```javascript // From an array of booleans: -var arr1 = new BooleanArray( [ true, false, false, true ] ); +const arr1 = new BooleanArray( [ true, false, false, true ] ); // returns -var len = arr1.length; +let len = arr1.length; // returns 4 // From an array containing non-booleans: -var arr2 = new BooleanArray( [ {}, null, '', 4 ] ); +const arr2 = new BooleanArray( [ {}, null, '', 4 ] ); len = arr2.length; // returns 4 @@ -119,22 +119,22 @@ len = arr2.length; Returns a boolean array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 240 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 240 ); -var arr1 = new BooleanArray( buf ); +const arr1 = new BooleanArray( buf ); // returns -var len = arr1.length; +let len = arr1.length; // returns 240 -var arr2 = new BooleanArray( buf, 8 ); +const arr2 = new BooleanArray( buf, 8 ); // returns len = arr2.length; // returns 232 -var arr3 = new BooleanArray( buf, 8, 20 ); +const arr3 = new BooleanArray( buf, 8, 20 ); // returns len = arr3.length; @@ -152,7 +152,7 @@ len = arr3.length; Static property returning the size (in bytes) of each array element. ```javascript -var nbytes = BooleanArray.BYTES_PER_ELEMENT; +const nbytes = BooleanArray.BYTES_PER_ELEMENT; // returns 1 ``` @@ -163,7 +163,7 @@ var nbytes = BooleanArray.BYTES_PER_ELEMENT; Static property returning the constructor name. ```javascript -var str = BooleanArray.name; +const str = BooleanArray.name; // returns 'BooleanArray' ``` @@ -174,10 +174,10 @@ var str = BooleanArray.name; Pointer to the underlying data buffer. ```javascript -var arr = new BooleanArray( 2 ); +const arr = new BooleanArray( 2 ); // returns -var buf = arr.buffer; +const buf = arr.buffer; // returns ``` @@ -188,10 +188,10 @@ var buf = arr.buffer; Size (in bytes) of the array. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // returns -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 10 ``` @@ -202,15 +202,15 @@ var nbytes = arr.byteLength; Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var arr = new BooleanArray( 10 ); +let arr = new BooleanArray( 10 ); // returns -var offset = arr.byteOffset; +let offset = arr.byteOffset; // returns 0 -var buf = new ArrayBuffer( 240 ); +const buf = new ArrayBuffer( 240 ); arr = new BooleanArray( buf, 64 ); // returns @@ -225,10 +225,10 @@ offset = arr.byteOffset; Size (in bytes) of each array element. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // returns -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 1 ``` @@ -239,10 +239,10 @@ var nbytes = arr.BYTES_PER_ELEMENT; Number of array elements. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -257,10 +257,10 @@ var len = arr.length; Creates a new boolean array from an array-like object or an iterable. ```javascript -var arr = BooleanArray.from( [ true, false ] ); +const arr = BooleanArray.from( [ true, false ] ); // returns -var len = arr.length; +const len = arr.length; // returns 2 ``` @@ -272,16 +272,16 @@ function map( v ) { } // Create a source array: -var src = [ true, false ]; +const src = [ true, false ]; // Create a new boolean array by inverting the source array: -var arr = BooleanArray.from( src, map ); +const arr = BooleanArray.from( src, map ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns false v = arr.get( 1 ); @@ -302,21 +302,21 @@ function map( v ) { } // Create a source array: -var src = [ true, false ]; +const src = [ true, false ]; // Define an execution context: -var ctx = { +const ctx = { 'count': 0 }; // Create a new boolean array by inverting the source array: -var arr = BooleanArray.from( src, map, ctx ); +const arr = BooleanArray.from( src, map, ctx ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -327,10 +327,10 @@ var n = ctx.count; Creates a new boolean array from a variable number of arguments. ```javascript -var arr = BooleanArray.of( true, false, false, true ); +const arr = BooleanArray.of( true, false, false, true ); // returns -var len = arr.length; +const len = arr.length; // returns 4 ``` @@ -341,13 +341,13 @@ var len = arr.length; Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var v = arr.at( 0 ); +let v = arr.at( 0 ); // returns true v = arr.at( -1 ); @@ -357,9 +357,9 @@ v = arr.at( -1 ); If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); -var v = arr.at( 100 ); +let v = arr.at( 100 ); // returns undefined v = arr.at( -100 ); @@ -373,14 +373,14 @@ v = arr.at( -100 ); Copies a sequence of elements within the array starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`. ```javascript -var arr = new BooleanArray( 4 ); +const arr = new BooleanArray( 4 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); arr.set( true, 3 ); -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns true v = arr.get( 1 ); @@ -399,14 +399,14 @@ v = arr.get( 1 ); By default, `end` equals the number of array elements (i.e., one more than the last array index). To limit the sequence length, provide an `end` argument. ```javascript -var arr = new BooleanArray( 4 ); +const arr = new BooleanArray( 4 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); arr.set( true, 3 ); -var v = arr.get( 2 ); +let v = arr.get( 2 ); // returns false v = arr.get( 3 ); @@ -425,14 +425,14 @@ v = arr.get( 3 ); When a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last array element. The following example achieves the same behavior as the previous example: ```javascript -var arr = new BooleanArray( 4 ); +const arr = new BooleanArray( 4 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); arr.set( true, 3 ); -var v = arr.get( 2 ); +let v = arr.get( 2 ); // returns false v = arr.get( 3 ); @@ -455,15 +455,15 @@ v = arr.get( 3 ); Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var it = arr.entries(); +const it = arr.entries(); -var v = it.next().value; +let v = it.next().value; // returns [ 0, true ] v = it.next().value; @@ -472,7 +472,7 @@ v = it.next().value; v = it.next().value; // returns [ 2, true ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -492,13 +492,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( true, 1 ); arr.set( true, 2 ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns true ``` @@ -516,9 +516,9 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -526,10 +526,10 @@ arr.set( true, 0 ); arr.set( true, 1 ); arr.set( true, 2 ); -var bool = arr.every( predicate, context ); +const bool = arr.every( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 3 ``` @@ -540,12 +540,12 @@ var count = context.count; Returns a modified typed array filled with a fill value. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); // Set all elements to the same value: arr.fill( true ); -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns true v = arr.get( 1 ); @@ -576,12 +576,12 @@ v = arr.get( 1 ); When a `start` and/or `end` index is negative, the respective index is determined relative to the last array element. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); // Set all array elements, except the last element, to the same value: arr.fill( true, 0, -1 ); -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns true v = arr.get( 2 ); @@ -599,20 +599,20 @@ function predicate( v ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); // Set the first three elements: arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.filter( predicate ); +const out = arr.filter( predicate ); // returns -var len = out.length; +const len = out.length; // returns 2 -var v = out.get( 0 ); +let v = out.get( 0 ); // returns true v = out.get( 1 ); @@ -633,9 +633,9 @@ function predicate( v, i ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -643,13 +643,13 @@ arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.filter( predicate, context ); +const out = arr.filter( predicate, context ); // returns -var len = out.length; +const len = out.length; // returns 2 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -664,13 +664,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns true ``` @@ -688,9 +688,9 @@ function predicate( v ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -698,10 +698,10 @@ arr.set( false, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var z = arr.find( predicate, context ); +const z = arr.find( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 3 ``` @@ -716,13 +716,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var v = arr.findIndex( predicate ); +const v = arr.findIndex( predicate ); // returns 0 ``` @@ -740,9 +740,9 @@ function predicate( v ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -750,10 +750,10 @@ arr.set( false, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var z = arr.findIndex( predicate, context ); +const z = arr.findIndex( predicate, context ); // returns 2 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -768,13 +768,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var v = arr.findLast( predicate ); +const v = arr.findLast( predicate ); // returns true ``` @@ -792,9 +792,9 @@ function predicate( v ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -802,10 +802,10 @@ arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); -var z = arr.findLast( predicate, context ); +const z = arr.findLast( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 3 ``` @@ -820,13 +820,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var v = arr.findLastIndex( predicate ); +const v = arr.findLastIndex( predicate ); // returns 2 ``` @@ -844,9 +844,9 @@ function predicate( v ) { return ( v === true ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -854,10 +854,10 @@ arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); -var z = arr.findLastIndex( predicate, context ); +const z = arr.findLastIndex( predicate, context ); // returns 0 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -872,7 +872,7 @@ function log( v, i ) { console.log( '%s: %s', i.toString(), v.toString() ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -900,9 +900,9 @@ function fcn( v, i ) { console.log( '%s: %s', i.toString(), v.toString() ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -912,7 +912,7 @@ arr.set( true, 2 ); arr.forEach( fcn, context ); -var count = context.count; +const count = context.count; // returns 3 ``` @@ -923,22 +923,22 @@ var count = context.count; Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // Set the first element: arr.set( true, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns true ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -949,7 +949,7 @@ var v = arr.get( 100 ); Returns a boolean indicating whether an array includes a provided value. ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -957,7 +957,7 @@ arr.set( true, 2 ); arr.set( true, 3 ); arr.set( true, 4 ); -var bool = arr.includes( true ); +let bool = arr.includes( true ); // returns true bool = arr.includes( false, 2 ); @@ -971,7 +971,7 @@ bool = arr.includes( false, 2 ); Returns the first index at which a given element can be found. ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -979,7 +979,7 @@ arr.set( true, 2 ); arr.set( true, 3 ); arr.set( true, 4 ); -var idx = arr.indexOf( true ); +let idx = arr.indexOf( true ); // returns 0 idx = arr.indexOf( false, 1 ); @@ -992,13 +992,13 @@ idx = arr.indexOf( true, -3 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( true, 1 ); arr.set( true, 2 ); -var idx = arr.indexOf( false ); +const idx = arr.indexOf( false ); // returns -1 ``` @@ -1009,26 +1009,26 @@ var idx = arr.indexOf( false ); Returns a new string by concatenating all array elements. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var str = arr.join(); +const str = arr.join(); // returns 'true,false,true' ``` By default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns 'true|false|true' ``` @@ -1039,20 +1039,20 @@ var str = arr.join( '|' ); Returns an iterator for iterating over each index key in a typed array. ```javascript -var arr = new BooleanArray( 2 ); +const arr = new BooleanArray( 2 ); arr.set( true, 0 ); arr.set( false, 1 ); -var iter = arr.keys(); +const iter = arr.keys(); -var v = iter.next().value; +let v = iter.next().value; // returns 0 v = iter.next().value; // returns 1 -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -1068,7 +1068,7 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns the last index at which a given element can be found. ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( true, 1 ); @@ -1076,7 +1076,7 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var idx = arr.lastIndexOf( true ); +let idx = arr.lastIndexOf( true ); // returns 4 idx = arr.lastIndexOf( false, 3 ); @@ -1089,13 +1089,13 @@ idx = arr.lastIndexOf( true, -3 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( true, 1 ); arr.set( true, 2 ); -var idx = arr.lastIndexOf( false ); +const idx = arr.lastIndexOf( false ); // returns -1 ``` @@ -1110,16 +1110,16 @@ function invert( v ) { return !v; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.map( invert ); +const out = arr.map( invert ); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns false z = out.get( 1 ); @@ -1143,9 +1143,9 @@ function invert( v, i ) { return !v; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1153,10 +1153,10 @@ arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.map( invert, context ); +const out = arr.map( invert, context ); // returns -var count = context.count; +const count = context.count; // returns 3; ``` @@ -1171,13 +1171,13 @@ function reducer( acc, v ) { return ( acc && v ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.reduce( reducer ); +const out = arr.reduce( reducer ); // returns false ``` @@ -1198,13 +1198,13 @@ function reducer( acc, v ) { return acc; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.reduce( reducer, 0 ); +const out = arr.reduce( reducer, 0 ); // returns 2 ``` @@ -1219,13 +1219,13 @@ function reducer( acc, v ) { return ( acc && v ); } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.reduceRight( reducer ); +const out = arr.reduceRight( reducer ); // returns false ``` @@ -1246,13 +1246,13 @@ function reducer( acc, v ) { return acc; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.reduceRight( reducer, 0 ); +const out = arr.reduceRight( reducer, 0 ); // returns 2 ``` @@ -1263,16 +1263,16 @@ var out = arr.reduceRight( reducer, 0 ); Reverses an array in-place. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); -var out = arr.reverse(); +const out = arr.reverse(); // returns -var v = out.get( 0 ); +let v = out.get( 0 ); // returns false v = out.get( 1 ); @@ -1289,10 +1289,10 @@ v = out.get( 2 ); Sets one or more array elements. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // Get the first element: -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns false // Set the first element: @@ -1306,10 +1306,10 @@ v = arr.get( 0 ); By default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`. ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // Get the fifth element: -var v = arr.get( 4 ); +let v = arr.get( 4 ); // returns false // Set the fifth element: @@ -1323,16 +1323,16 @@ v = arr.get( 4 ); In addition to providing a single value, to set one or more array elements, provide an array-like object containing truthy and falsy values ```javascript -var arr = new BooleanArray( 10 ); +const arr = new BooleanArray( 10 ); // Define an array of values: -var buf = [ '', 1, null ]; +const buf = [ '', 1, null ]; // Set the fifth, sixth, and seventh elements: arr.set( buf, 4 ); // Get the sixth element: -var v = arr.get( 5 ); +const v = arr.get( 5 ); // returns true ``` @@ -1349,7 +1349,7 @@ A few notes: Copies a portion of a typed array to a new typed array. ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1357,13 +1357,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var out = arr.slice(); +const out = arr.slice(); // returns -var len = out.length; +const len = out.length; // returns 5 -var bool = out.get( 0 ); +let bool = out.get( 0 ); // returns true bool = out.get( len-1 ); @@ -1373,7 +1373,7 @@ bool = out.get( len-1 ); By default, the method returns a typed array beginning with the first array element. To specify an alternative array index at which to begin, provide a `start` index (inclusive). ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1381,13 +1381,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var out = arr.slice( 1 ); +const out = arr.slice( 1 ); // returns -var len = out.length; +const len = out.length; // returns 4 -var bool = out.get( 0 ); +let bool = out.get( 0 ); // returns false bool = out.get( len-1 ); @@ -1397,7 +1397,7 @@ bool = out.get( len-1 ); By default, the method returns a typed array which includes all array elements after `start`. To limit the number of array elements after `start`, provide an `end` index (exclusive). ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1405,13 +1405,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var out = arr.slice( 1, -2 ); +const out = arr.slice( 1, -2 ); // returns -var len = out.length; +const len = out.length; // returns 2 -var bool = out.get( 0 ); +let bool = out.get( 0 ); // returns false bool = out.get( len-1 ); @@ -1429,13 +1429,13 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( false, 0 ); arr.set( true, 1 ); arr.set( false, 2 ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1453,9 +1453,9 @@ function predicate( v ) { return v === true; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1463,10 +1463,10 @@ arr.set( false, 0 ); arr.set( true, 1 ); arr.set( false, 2 ); -var bool = arr.some( predicate, context ); +const bool = arr.some( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 2 ``` @@ -1490,7 +1490,7 @@ function compare( a, b ) { return -1; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1498,7 +1498,7 @@ arr.set( true, 2 ); arr.sort( compare ); -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns true v = arr.get( 1 ); @@ -1526,7 +1526,7 @@ The function should return a number where: Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host array. ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1534,13 +1534,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var subarr = arr.subarray(); +const subarr = arr.subarray(); // returns -var len = subarr.length; +const len = subarr.length; // returns 5 -var bool = subarr.get( 0 ); +let bool = subarr.get( 0 ); // returns true bool = subarr.get( len-1 ); @@ -1550,7 +1550,7 @@ bool = subarr.get( len-1 ); By default, the method creates a typed array view beginning with the first array element. To specify an alternative array index at which to begin, provide a `begin` index (inclusive). ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1558,13 +1558,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var subarr = arr.subarray( 1 ); +const subarr = arr.subarray( 1 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 4 -var bool = subarr.get( 0 ); +let bool = subarr.get( 0 ); // returns false bool = subarr.get( len-1 ); @@ -1574,7 +1574,7 @@ bool = subarr.get( len-1 ); By default, the method creates a typed array view which includes all array elements after `begin`. To limit the number of array elements after `begin`, provide an `end` index (exclusive). ```javascript -var arr = new BooleanArray( 5 ); +const arr = new BooleanArray( 5 ); arr.set( true, 0 ); arr.set( false, 1 ); @@ -1582,13 +1582,13 @@ arr.set( true, 2 ); arr.set( false, 3 ); arr.set( true, 4 ); -var subarr = arr.subarray( 1, -2 ); +const subarr = arr.subarray( 1, -2 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 2 -var bool = subarr.get( 0 ); +let bool = subarr.get( 0 ); // returns false bool = subarr.get( len-1 ); @@ -1602,13 +1602,13 @@ bool = subarr.get( len-1 ); Serializes an array as a locale-specific string. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns 'true,false,true' ``` @@ -1624,16 +1624,16 @@ The method supports the following arguments: Returns a new typed array containing the elements in reversed order. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( false, 2 ); -var out = arr.toReversed(); +const out = arr.toReversed(); // returns -var v = out.get( 0 ); +let v = out.get( 0 ); // returns false v = out.get( 1 ); @@ -1663,16 +1663,16 @@ function compare( a, b ) { return -1; } -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var out = arr.sort( compare ); +const out = arr.sort( compare ); // returns -var v = out.get( 0 ); +let v = out.get( 0 ); // returns true v = out.get( 1 ); @@ -1700,13 +1700,13 @@ The function should return a number where: Serializes an array as a string. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 2 ); -var str = arr.toString(); +const str = arr.toString(); // returns 'true,false,true' ``` @@ -1717,20 +1717,20 @@ var str = arr.toString(); Returns an iterator for iterating over each value in a typed array. ```javascript -var arr = new BooleanArray( 2 ); +const arr = new BooleanArray( 2 ); arr.set( true, 0 ); arr.set( false, 1 ); -var iter = arr.values(); +const iter = arr.values(); -var v = iter.next().value; +let v = iter.next().value; // returns true v = iter.next().value; // returns false -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -1746,16 +1746,16 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns a new typed array with the element at a provided index replaced with a provided value. ```javascript -var arr = new BooleanArray( 3 ); +const arr = new BooleanArray( 3 ); arr.set( true, 0 ); arr.set( false, 1 ); arr.set( true, 1 ); -var out = arr.with( 0, false ); +const out = arr.with( 0, false ); // returns -var v = out.get( 0 ); +const v = out.get( 0 ); // returns false ``` @@ -1791,16 +1791,16 @@ var v = out.get( 0 ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var logEach = require( '@stdlib/console/log-each' ); -var BooleanArray = require( '@stdlib/array/bool' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const logEach = require( '@stdlib/console/log-each' ); +const BooleanArray = require( '@stdlib/array/bool' ); // Create a boolean array by specifying a length: -var out = new BooleanArray( 3 ); +let out = new BooleanArray( 3 ); logEach( '%s', out ); // Create a boolean array from an array of booleans: -var arr = [ true, false, true ]; +let arr = [ true, false, true ]; out = new BooleanArray( arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/buffer/README.md b/lib/node_modules/@stdlib/array/buffer/README.md index 5ff8453d9092..d0ac334cee17 100644 --- a/lib/node_modules/@stdlib/array/buffer/README.md +++ b/lib/node_modules/@stdlib/array/buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); ``` #### ArrayBuffer( size ) @@ -47,7 +47,7 @@ Returns an [`ArrayBuffer`][mdn-arraybuffer] having a specified number of bytes. ```javascript -var buf = new ArrayBuffer( 5 ); +const buf = new ArrayBuffer( 5 ); // returns ``` @@ -62,7 +62,7 @@ Number of input arguments the constructor accepts. ```javascript -var len = ArrayBuffer.length; +const len = ArrayBuffer.length; // returns 1 ``` @@ -73,8 +73,8 @@ var len = ArrayBuffer.length; ```javascript -var buf = new ArrayBuffer( 5 ); -var byteLength = buf.byteLength; +const buf = new ArrayBuffer( 5 ); +const byteLength = buf.byteLength; // returns 5 ``` @@ -89,10 +89,10 @@ Static method which returns a `boolean` indicating if provided a buffer view. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var view = new Float64Array( 10 ); +const Float64Array = require( '@stdlib/array/float64' ); +const view = new Float64Array( 10 ); -var bool = ArrayBuffer.isView( view ); +const bool = ArrayBuffer.isView( view ); // returns true ``` @@ -103,12 +103,12 @@ Copies the bytes of an `ArrayBuffer` to a new [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var b1 = new ArrayBuffer( 10 ); +const b1 = new ArrayBuffer( 10 ); -var b2 = b1.slice(); +const b2 = b1.slice(); // returns -var bool = ( b2 === b1 ); +const bool = ( b2 === b1 ); // returns false ``` @@ -117,10 +117,10 @@ By default, the method copies from the beginning of the [`ArrayBuffer`][mdn-arra ```javascript -var b1 = new ArrayBuffer( 10 ); -var b2 = b1.slice( 2 ); +const b1 = new ArrayBuffer( 10 ); +const b2 = b1.slice( 2 ); -var nbytes = b2.byteLength; +const nbytes = b2.byteLength; // returns 8 ``` @@ -129,10 +129,10 @@ If `start < 0`, the index is relative to the end of the [`ArrayBuffer`][mdn-arra ```javascript -var b1 = new ArrayBuffer( 10 ); -var b2 = b1.slice( -2 ); +const b1 = new ArrayBuffer( 10 ); +const b2 = b1.slice( -2 ); -var nbytes = b2.byteLength; +const nbytes = b2.byteLength; // returns 2 ``` @@ -141,10 +141,10 @@ By default, the method copies to the end of the [`ArrayBuffer`][mdn-arraybuffer] ```javascript -var b1 = new ArrayBuffer( 10 ); -var b2 = b1.slice( 2, 6 ); +const b1 = new ArrayBuffer( 10 ); +const b2 = b1.slice( 2, 6 ); -var nbytes = b2.byteLength; +const nbytes = b2.byteLength; // returns 4 ``` @@ -153,10 +153,10 @@ If `end < 0`, the index is relative to the end of the [`ArrayBuffer`][mdn-arrayb ```javascript -var b1 = new ArrayBuffer( 10 ); -var b2 = b1.slice( 2, -2 ); +const b1 = new ArrayBuffer( 10 ); +const b2 = b1.slice( 2, -2 ); -var nbytes = b2.byteLength; +const nbytes = b2.byteLength; // returns 6 ``` @@ -183,31 +183,26 @@ var nbytes = b2.byteLength; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); - -var bytes; -var buf; -var arr; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); // Create a new ArrayBuffer: -buf = new ArrayBuffer( 64 ); +const buf = new ArrayBuffer( 64 ); // Create a Float64 array buffer view: -arr = new Float64Array( buf.byteLength/8 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Float64Array( buf.byteLength/8 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } // Create a "bytes" view of the array buffer: -bytes = new Uint8Array( arr.buffer ); +const bytes = new Uint8Array( arr.buffer ); // Print the bytes: -for ( i = 0; i < bytes.length; i++ ) { +for ( let i = 0; i < bytes.length; i++ ) { console.log( 'byte %d: %s', i, toBinaryString( bytes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/byte-orders/README.md b/lib/node_modules/@stdlib/array/byte-orders/README.md index 7f18a6c05ab2..a9a64be776a8 100644 --- a/lib/node_modules/@stdlib/array/byte-orders/README.md +++ b/lib/node_modules/@stdlib/array/byte-orders/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var byteOrders = require( '@stdlib/array/byte-orders' ); +const byteOrders = require( '@stdlib/array/byte-orders' ); ``` #### byteOrders() @@ -45,7 +45,7 @@ var byteOrders = require( '@stdlib/array/byte-orders' ); Returns a list of byte orders. ```javascript -var out = byteOrders(); +const out = byteOrders(); // e.g., returns [ 'little-endian', 'big-endian' ] ``` @@ -75,12 +75,12 @@ The output array contains the following orders: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var byteOrders = require( '@stdlib/array/byte-orders' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const byteOrders = require( '@stdlib/array/byte-orders' ); -var isByteOrder = contains( byteOrders() ); +const isByteOrder = contains( byteOrders() ); -var bool = isByteOrder( 'little-endian' ); +let bool = isByteOrder( 'little-endian' ); // returns true bool = isByteOrder( 'big-endian' ); diff --git a/lib/node_modules/@stdlib/array/cartesian-power/README.md b/lib/node_modules/@stdlib/array/cartesian-power/README.md index 15671d83afdf..5fd5e2616554 100644 --- a/lib/node_modules/@stdlib/array/cartesian-power/README.md +++ b/lib/node_modules/@stdlib/array/cartesian-power/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianPower = require( '@stdlib/array/cartesian-power' ); +const cartesianPower = require( '@stdlib/array/cartesian-power' ); ``` #### cartesianPower( x, n ) @@ -35,23 +35,23 @@ var cartesianPower = require( '@stdlib/array/cartesian-power' ); Returns the [Cartesian power][cartesian-product]. ```javascript -var x = [ 1, 2 ]; +const x = [ 1, 2 ]; -var out = cartesianPower( x, 2 ); +const out = cartesianPower( x, 2 ); // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] ``` If provided an empty array, the function returns an empty array. ```javascript -var out = cartesianPower( [], 2 ); +const out = cartesianPower( [], 2 ); // returns [] ``` If `n` is less than or equal to zero, the function returns an empty array. ```javascript -var out = cartesianPower( [ 1, 2 ], 0 ); +const out = cartesianPower( [ 1, 2 ], 0 ); // returns [] ``` @@ -72,12 +72,12 @@ var out = cartesianPower( [ 1, 2 ], 0 ); ```javascript -var linspace = require( '@stdlib/array/linspace' ); -var cartesianPower = require( '@stdlib/array/cartesian-power' ); +const linspace = require( '@stdlib/array/linspace' ); +const cartesianPower = require( '@stdlib/array/cartesian-power' ); -var x = linspace( 0, 5, 6 ); +const x = linspace( 0, 5, 6 ); -var out = cartesianPower( x, 3 ); +const out = cartesianPower( x, 3 ); // returns [ [ 0, 0, 0 ], [ 0, 0, 1 ], ..., [ 5, 5, 4 ], [ 5, 5, 5 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/cartesian-product/README.md b/lib/node_modules/@stdlib/array/cartesian-product/README.md index a34d6360b6f6..4dc6dd5286c2 100644 --- a/lib/node_modules/@stdlib/array/cartesian-product/README.md +++ b/lib/node_modules/@stdlib/array/cartesian-product/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianProduct = require( '@stdlib/array/cartesian-product' ); +const cartesianProduct = require( '@stdlib/array/cartesian-product' ); ``` #### cartesianProduct( x1, x2 ) @@ -35,20 +35,20 @@ var cartesianProduct = require( '@stdlib/array/cartesian-product' ); Returns the [Cartesian product][cartesian-product]. ```javascript -var x1 = [ 1, 2, 3 ]; -var x2 = [ 4, 5 ]; +const x1 = [ 1, 2, 3 ]; +const x2 = [ 4, 5 ]; -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ] ``` If provided one or more empty arrays, the function returns an empty array. ```javascript -var x1 = [ 1, 2, 3, 4 ]; -var x2 = []; +const x1 = [ 1, 2, 3, 4 ]; +const x2 = []; -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [] ``` @@ -69,13 +69,13 @@ var out = cartesianProduct( x1, x2 ); ```javascript -var linspace = require( '@stdlib/array/linspace' ); -var cartesianProduct = require( '@stdlib/array/cartesian-product' ); +const linspace = require( '@stdlib/array/linspace' ); +const cartesianProduct = require( '@stdlib/array/cartesian-product' ); -var x1 = linspace( 0, 5, 6 ); -var x2 = linspace( 10, 15, 6 ); +const x1 = linspace( 0, 5, 6 ); +const x2 = linspace( 10, 15, 6 ); -var out = cartesianProduct( x1, x2 ); +const out = cartesianProduct( x1, x2 ); // returns [ [ 0, 10 ], [ 0, 11 ], ..., [ 5, 14 ], [ 5, 15 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/cartesian-square/README.md b/lib/node_modules/@stdlib/array/cartesian-square/README.md index 8b4abb95da4f..2ec3091d8709 100644 --- a/lib/node_modules/@stdlib/array/cartesian-square/README.md +++ b/lib/node_modules/@stdlib/array/cartesian-square/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); ``` #### cartesianSquare( x ) @@ -35,16 +35,16 @@ var cartesianSquare = require( '@stdlib/array/cartesian-square' ); Returns the [Cartesian square][cartesian-product]. ```javascript -var x = [ 1, 2 ]; +const x = [ 1, 2 ]; -var out = cartesianSquare( x ); +const out = cartesianSquare( x ); // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] ``` If provided an empty array, the function returns an empty array. ```javascript -var out = cartesianSquare( [] ); +const out = cartesianSquare( [] ); // returns [] ``` @@ -65,12 +65,12 @@ var out = cartesianSquare( [] ); ```javascript -var linspace = require( '@stdlib/array/linspace' ); -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const linspace = require( '@stdlib/array/linspace' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var x = linspace( 0, 5, 6 ); +const x = linspace( 0, 5, 6 ); -var out = cartesianSquare( x ); +const out = cartesianSquare( x ); // returns [ [ 0, 0 ], [ 0, 1 ], ..., [ 5, 4 ], [ 5, 5 ] ] ``` diff --git a/lib/node_modules/@stdlib/array/complex128/README.md b/lib/node_modules/@stdlib/array/complex128/README.md index 2f1c930424d0..5cbd08c9ca37 100644 --- a/lib/node_modules/@stdlib/array/complex128/README.md +++ b/lib/node_modules/@stdlib/array/complex128/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); ``` @@ -47,7 +47,7 @@ var Complex128Array = require( '@stdlib/array/complex128' ); Creates a 128-bit complex number array. ```javascript -var arr = new Complex128Array(); +const arr = new Complex128Array(); // returns ``` @@ -56,10 +56,10 @@ var arr = new Complex128Array(); Creates a 128-bit complex number array having a specified `length`. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -68,13 +68,13 @@ var len = arr.length; Creates a 128-bit complex number array from another complex number array. ```javascript -var arr1 = new Complex128Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] +const arr1 = new Complex128Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] // returns -var arr2 = new Complex128Array( arr1 ); +const arr2 = new Complex128Array( arr1 ); // returns -var len = arr2.length; +const len = arr2.length; // returns 2 ``` @@ -83,15 +83,15 @@ var len = arr2.length; Creates a 128-bit complex number array from a [typed array][@stdlib/array/typed] containing interleaved real and imaginary components. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var buf = new Float64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] +const buf = new Float64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] // returns [ 1.0, -1.0, 2.0, -2.0 ] -var arr = new Complex128Array( buf ); +const arr = new Complex128Array( buf ); // returns -var len = arr.length; +const len = arr.length; // returns 2 ``` @@ -100,18 +100,18 @@ var len = arr.length; Creates a 128-bit complex number array from an array-like object or iterable. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); // From an array of interleaved real and imaginary components: -var arr1 = new Complex128Array( [ 1.0, -1.0, 2.0, -2.0 ] ); +const arr1 = new Complex128Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // returns -var len = arr1.length; +let len = arr1.length; // returns 2 // From an array containing complex numbers: -var buf = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ) ]; -var arr2 = new Complex128Array( buf ); +const buf = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ) ]; +const arr2 = new Complex128Array( buf ); len = arr2.length; // returns 2 @@ -122,22 +122,22 @@ len = arr2.length; Returns a 128-bit complex number array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 480 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 480 ); -var arr1 = new Complex128Array( buf ); +const arr1 = new Complex128Array( buf ); // returns -var len = arr1.length; +let len = arr1.length; // returns 30 -var arr2 = new Complex128Array( buf, 16 ); +const arr2 = new Complex128Array( buf, 16 ); // returns len = arr2.length; // returns 29 -var arr3 = new Complex128Array( buf, 16, 20 ); +const arr3 = new Complex128Array( buf, 16, 20 ); // returns len = arr3.length; @@ -155,7 +155,7 @@ len = arr3.length; Static property returning the size (in bytes) of each array element. ```javascript -var nbytes = Complex128Array.BYTES_PER_ELEMENT; +const nbytes = Complex128Array.BYTES_PER_ELEMENT; // returns 16 ``` @@ -166,7 +166,7 @@ var nbytes = Complex128Array.BYTES_PER_ELEMENT; Static property returning the constructor name. ```javascript -var str = Complex128Array.name; +const str = Complex128Array.name; // returns 'Complex128Array' ``` @@ -177,10 +177,10 @@ var str = Complex128Array.name; Pointer to the underlying data buffer. ```javascript -var arr = new Complex128Array( 2 ); +const arr = new Complex128Array( 2 ); // returns -var buf = arr.buffer; +const buf = arr.buffer; // returns ``` @@ -191,10 +191,10 @@ var buf = arr.buffer; Size (in bytes) of the array. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // returns -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 160 ``` @@ -205,15 +205,15 @@ var nbytes = arr.byteLength; Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var arr = new Complex128Array( 10 ); +let arr = new Complex128Array( 10 ); // returns -var offset = arr.byteOffset; +let offset = arr.byteOffset; // returns 0 -var buf = new ArrayBuffer( 480 ); +const buf = new ArrayBuffer( 480 ); arr = new Complex128Array( buf, 128 ); // returns @@ -228,10 +228,10 @@ offset = arr.byteOffset; Size (in bytes) of each array element. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // returns -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 16 ``` @@ -242,10 +242,10 @@ var nbytes = arr.BYTES_PER_ELEMENT; Number of array elements. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -260,13 +260,13 @@ var len = arr.length; Creates a new 128-bit complex number array from an array-like object or an iterable. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); // Create an array from interleaved real and imaginary components: -var arr = Complex128Array.from( [ 1.0, -1.0 ] ); +let arr = Complex128Array.from( [ 1.0, -1.0 ] ); // returns -var len = arr.length; +let len = arr.length; // returns 1 // Create an array from an array of complex numbers: @@ -280,22 +280,22 @@ len = arr.length; The iterator returned by an iterable must return either a complex number or an array-like object containing a real and imaginary component. ```javascript -var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); -var Float64Array = require( '@stdlib/array/float64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var iter; -var arr; -var len; -var re; -var im; -var z; +let iter; +let arr; +let len; +let re; +let im; +let z; // Define a function which returns an iterator protocol-compliant object... function iterable() { - var buf = new Float64Array( 2 ); - var i = 0; + const buf = new Float64Array( 2 ); + let i = 0; return { 'next': next }; @@ -344,45 +344,45 @@ if ( ITERATOR_SYMBOL === null ) { To invoke a function for each `src` value, provide a callback function. If `src` is an iterable or an array-like object containing complex numbers, the callback must return either a complex number ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function map( z ) { return new Complex128( real(z)*2.0, imag(z)*2.0 ); } // Create a source array: -var src = [ new Complex128( 1.0, -1.0 ) ]; +const src = [ new Complex128( 1.0, -1.0 ) ]; // Create a new complex number array by scaling the source array: -var arr = Complex128Array.from( src, map ); +const arr = Complex128Array.from( src, map ); // returns -var len = arr.length; +const len = arr.length; // returns 1 -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns -2.0 ``` or an array-like object containing real and imaginary components ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Return a callback which reuses allocated memory... function mapFcn() { - var buf = new Float64Array( 2 ); + const buf = new Float64Array( 2 ); return map; function map( z ) { @@ -393,22 +393,22 @@ function mapFcn() { } // Create a source array: -var src = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ) ]; +const src = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ) ]; // Create a new complex number array by scaling the source array: -var arr = Complex128Array.from( src, mapFcn() ); +const arr = Complex128Array.from( src, mapFcn() ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 2.0 -var im = imag( z ); +let im = imag( z ); // returns -2.0 z = arr.get( 1 ); @@ -424,32 +424,32 @@ im = imag( z ); If `src` is an array-like object containing interleaved real and imaginary components, the callback is invoked for each component and should return the transformed component value. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function map( v ) { return v * 2.0; } // Create a source array: -var src = new Float64Array( [ 1.0, -1.0 ] ); +const src = new Float64Array( [ 1.0, -1.0 ] ); // Create a new complex number array by scaling the source array: -var arr = Complex128Array.from( src, map ); +const arr = Complex128Array.from( src, map ); // returns -var len = arr.length; +const len = arr.length; // returns 1 -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns -2.0 ``` @@ -461,9 +461,9 @@ A callback function is provided two arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function map( z ) { this.count += 1; @@ -471,21 +471,21 @@ function map( z ) { } // Create a source array: -var src = [ new Complex128( 1.0, -1.0 ), new Complex128( 1.0, -1.0 ) ]; +const src = [ new Complex128( 1.0, -1.0 ), new Complex128( 1.0, -1.0 ) ]; // Define an execution context: -var ctx = { +const ctx = { 'count': 0 }; // Create a new complex number array by scaling the source array: -var arr = Complex128Array.from( src, map, ctx ); +const arr = Complex128Array.from( src, map, ctx ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -496,16 +496,16 @@ var n = ctx.count; Creates a new 128-bit complex number array from a variable number of arguments. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = Complex128Array.of( 1.0, -1.0, 2.0, -2.0 ); +let arr = Complex128Array.of( 1.0, -1.0, 2.0, -2.0 ); // returns -var len = arr.length; +let len = arr.length; // returns 2 -var z1 = new Complex128( 1.0, -1.0 ); -var z2 = new Complex128( 2.0, -2.0 ); +const z1 = new Complex128( 1.0, -1.0 ); +const z2 = new Complex128( 2.0, -2.0 ); arr = Complex128Array.of( z1, z2 ); // returns @@ -521,10 +521,10 @@ len = arr.length; Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Set the first, second, and last elements: arr.set( [ 1.0, -1.0 ], 0 ); @@ -532,13 +532,13 @@ arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 9.0, -9.0 ], 9 ); // Get the first element: -var z = arr.at( 0 ); +let z = arr.at( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns -1.0 // Get the last element: @@ -555,9 +555,9 @@ im = imag( z ); If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); -var z = arr.at( 100 ); +let z = arr.at( 100 ); // returns undefined z = arr.at( -100 ); @@ -571,11 +571,11 @@ z = arr.at( -100 ); Copies a sequence of elements within the array starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 4 ); +const arr = new Complex128Array( 4 ); // Set the array elements: arr.set( new Complex128( 1.0, -1.0 ), 0 ); @@ -584,13 +584,13 @@ arr.set( new Complex128( 3.0, -3.0 ), 2 ); arr.set( new Complex128( 4.0, -4.0 ), 3 ); // Get the first array element: -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns -1.0 // Get the second array element: @@ -630,11 +630,11 @@ im = imag( z ); By default, `end` equals the number of array elements (i.e., one more than the last array index). To limit the sequence length, provide an `end` argument. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 4 ); +const arr = new Complex128Array( 4 ); // Set the array elements: arr.set( new Complex128( 1.0, -1.0 ), 0 ); @@ -643,13 +643,13 @@ arr.set( new Complex128( 3.0, -3.0 ), 2 ); arr.set( new Complex128( 4.0, -4.0 ), 3 ); // Get the third array element: -var z = arr.get( 2 ); +let z = arr.get( 2 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns -3.0 // Get the last array element: @@ -689,11 +689,11 @@ im = imag( z ); When a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last array element. The following example achieves the same behavior as the previous example: ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 4 ); +const arr = new Complex128Array( 4 ); // Set the array elements: arr.set( new Complex128( 1.0, -1.0 ), 0 ); @@ -702,13 +702,13 @@ arr.set( new Complex128( 3.0, -3.0 ), 2 ); arr.set( new Complex128( 4.0, -4.0 ), 3 ); // Get the third array element: -var z = arr.get( 2 ); +let z = arr.get( 2 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns -3.0 // Get the last array element: @@ -752,11 +752,11 @@ im = imag( z ); Returns an iterator for iterating over array key-value pairs. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = [ +let arr = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ), new Complex128( 3.0, -3.0 ) @@ -764,16 +764,16 @@ var arr = [ arr = new Complex128Array( arr ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over the key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, ] -var re = real( v[ 1 ] ); +let re = real( v[ 1 ] ); // returns 1.0 -var im = imag( v[ 1 ] ); +let im = imag( v[ 1 ] ); // returns -1.0 v = it.next().value; @@ -794,7 +794,7 @@ re = real( v[ 1 ] ); im = imag( v[ 1 ] ); // returns -3.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -805,14 +805,14 @@ var bool = it.next().done; Returns a boolean indicating whether all elements pass a test. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); @@ -820,7 +820,7 @@ arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); // Check whether all elements pass a test: -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns true ``` @@ -838,9 +838,9 @@ function predicate( v, i ) { return ( i >= 0 ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -849,10 +849,10 @@ arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var bool = arr.every( predicate, context ); +const bool = arr.every( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 3 ``` @@ -863,22 +863,22 @@ var count = context.count; Returns a modified typed array filled with a fill value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set all elements to the same value: arr.fill( new Complex128( 1.0, 1.0 ) ); -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 1.0 z = arr.get( 2 ); @@ -936,22 +936,22 @@ im = imag( z ); When a `start` and/or `end` index is negative, the respective index is determined relative to the last array element. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set all array elements, except the last element, to the same value: arr.fill( new Complex128( 1.0, 1.0 ), 0, -1 ); -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 1.0 z = arr.get( arr.length - 1 ); @@ -971,33 +971,33 @@ im = imag( z ); Returns a new array containing the elements of an array which pass a test implemented by a predicate function. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var out = arr.filter( predicate ); +const out = arr.filter( predicate ); // returns -var len = out.length; +const len = out.length; // returns 1 -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 ``` @@ -1010,17 +1010,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1029,13 +1029,13 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.filter( predicate, context ); +const out = arr.filter( predicate, context ); // returns -var len = out.length; +const len = out.length; // returns 2 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1046,27 +1046,27 @@ var count = context.count; Returns the first element in an array for which a predicate function returns a truthy value. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.find( predicate ); +const z = arr.find( predicate ); // returns -var re = real( z ); +const re = real( z ); // returns 1.0 -var im = imag( z ); +const im = imag( z ); // returns 1.0 ``` @@ -1079,17 +1079,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1098,16 +1098,16 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.find( predicate, context ); +const z = arr.find( predicate, context ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 -var count = context.count; +const count = context.count; // returns 2 ``` @@ -1118,21 +1118,21 @@ var count = context.count; Returns the index of the first element in an array for which a predicate function returns a truthy value. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -1145,17 +1145,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1164,10 +1164,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findIndex( predicate, context ); +const idx = arr.findIndex( predicate, context ); // returns -1 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1178,27 +1178,27 @@ var count = context.count; Returns the last element in an array for which a predicate function returns a truthy value. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.findLast( predicate ); +const z = arr.findLast( predicate ); // returns -var re = real( z ); +const re = real( z ); // returns 3.0 -var im = imag( z ); +const im = imag( z ); // returns 3.0 ``` @@ -1211,17 +1211,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1230,16 +1230,16 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var z = arr.findLast( predicate, context ); +const z = arr.findLast( predicate, context ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 -var count = context.count; +const count = context.count; // returns 2 ``` @@ -1250,21 +1250,21 @@ var count = context.count; Returns the index of the last element in an array for which a predicate function returns a truthy value. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findLastIndex( predicate ); +const idx = arr.findLastIndex( predicate ); // returns 1 ``` @@ -1277,17 +1277,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1296,10 +1296,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findLastIndex( predicate, context ); +const idx = arr.findLastIndex( predicate, context ); // returns -1 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1310,13 +1310,13 @@ var count = context.count; Invokes a function once for each array element. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); function log( v, i ) { console.log( '%s: %s', i, v.toString() ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); @@ -1340,16 +1340,16 @@ The invoked function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); function fcn( v, i ) { this.count += 1; console.log( '%s: %s', i, v.toString() ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1365,7 +1365,7 @@ arr.forEach( fcn, context ); 2: 3 + 3i */ -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1376,31 +1376,31 @@ var count = context.count; Returns an array element located at position (index) `i`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Set the first element: arr.set( [ 1.0, -1.0 ], 0 ); // Get the first element: -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 1.0 -var im = imag( z ); +const im = imag( z ); // returns -1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); -var z = arr.get( 100 ); +const z = arr.get( 100 ); // returns undefined ``` @@ -1411,9 +1411,9 @@ var z = arr.get( 100 ); Returns a boolean indicating whether an array includes a provided value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 5 ); +const arr = new Complex128Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1421,7 +1421,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 5.0, -5.0 ], 4 ); -var bool = arr.includes( new Complex128( 3.0, -3.0 ) ); +let bool = arr.includes( new Complex128( 3.0, -3.0 ) ); // returns true bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 ); @@ -1438,9 +1438,9 @@ bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 ); Returns the first index at which a given element can be found. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 5 ); +const arr = new Complex128Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1448,7 +1448,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 2.0, -2.0 ], 4 ); -var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) ); +let idx = arr.indexOf( new Complex128( 3.0, -3.0 ) ); // returns 2 idx = arr.indexOf( new Complex128( 2.0, -2.0 ), 2 ); @@ -1461,14 +1461,14 @@ idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 5 ); +const arr = new Complex128Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) ); +let idx = arr.indexOf( new Complex128( 3.0, -3.0 ) ); // returns -1 idx = arr.indexOf( new Complex128( 1.0, -1.0 ), 1 ); @@ -1482,26 +1482,26 @@ idx = arr.indexOf( new Complex128( 1.0, -1.0 ), 1 ); Returns a new string by concatenating all array elements. ```javascript -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.join(); +const str = arr.join(); // returns '1 + 1i,2 - 2i,3 + 3i' ``` By default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string. ```javascript -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.join( '/' ); +const str = arr.join( '/' ); // returns '1 + 1i/2 - 2i/3 + 3i' ``` @@ -1512,20 +1512,20 @@ var str = arr.join( '/' ); Returns an iterator for iterating over each index key in a typed array. ```javascript -var arr = new Complex128Array( 2 ); +const arr = new Complex128Array( 2 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var iter = arr.keys(); +const iter = arr.keys(); -var v = iter.next().value; +let v = iter.next().value; // returns 0 v = iter.next().value; // returns 1 -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -1541,9 +1541,9 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns the last index at which a given element can be found. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 5 ); +const arr = new Complex128Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1551,7 +1551,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 2.0, -2.0 ], 4 ); -var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) ); +let idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) ); // returns 2 idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), 2 ); @@ -1564,14 +1564,14 @@ idx = arr.lastIndexOf( new Complex128( 4.0, -4.0 ), -1 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 5 ); +const arr = new Complex128Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) ); +let idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) ); // returns -1 idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), 0 ); @@ -1585,31 +1585,31 @@ idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), 0 ); Returns a new array with each element being the result of a provided callback function. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function scale( v ) { return new Complex128( 2.0*real( v ), 2.0*imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var out = arr.map( scale ); +const out = arr.map( scale ); // returns -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns -2.0 ``` @@ -1622,18 +1622,18 @@ The callback function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function scale( v ) { this.count += 1; return new Complex128( 2.0*real( v ), 2.0*imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1642,10 +1642,10 @@ arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.map( scale, context ); +const out = arr.map( scale, context ); // returns -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1656,23 +1656,23 @@ var count = context.count; Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cadd = require( '@stdlib/complex/float64/base/add' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cadd = require( '@stdlib/complex/float64/base/add' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduce( cadd ); +const z = arr.reduce( cadd ); // returns -var re = real( z ); +const re = real( z ); // returns 6.0 -var im = imag( z ); +const im = imag( z ); // returns 6.0 ``` @@ -1686,20 +1686,20 @@ The reducer function is provided four arguments: By default, the function initializes the accumulated result to the first element in the array and passes the second array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the first array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument. ```javascript -var real = require( '@stdlib/complex/float64/real' ); +const real = require( '@stdlib/complex/float64/real' ); function reducer( acc, v ) { acc += real( v ); return acc; } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduce( reducer, 0.0 ); +const z = arr.reduce( reducer, 0.0 ); // returns 6.0 ``` @@ -1710,23 +1710,23 @@ var z = arr.reduce( reducer, 0.0 ); Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the following element and returning the accumulated result upon completion. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cadd = require( '@stdlib/complex/float64/base/add' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cadd = require( '@stdlib/complex/float64/base/add' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduceRight( cadd ); +const z = arr.reduceRight( cadd ); // returns -var re = real( z ); +const re = real( z ); // returns 6.0 -var im = imag( z ); +const im = imag( z ); // returns 6.0 ``` @@ -1740,20 +1740,20 @@ The reducer function is provided four arguments: By default, the function initializes the accumulated result to the last element in the array and passes the second-last array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the last array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument. ```javascript -var real = require( '@stdlib/complex/float64/real' ); +const real = require( '@stdlib/complex/float64/real' ); function reducer( acc, v ) { acc += real( v ); return acc; } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduceRight( reducer, 0.0 ); +const z = arr.reduceRight( reducer, 0.0 ); // returns 6.0 ``` @@ -1764,25 +1764,25 @@ var z = arr.reduceRight( reducer, 0.0 ); Reverses an array in-place. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.reverse(); +const out = arr.reverse(); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns 3.0 z = out.get( 1 ); @@ -1811,20 +1811,20 @@ im = imag( z ); Sets one or more array elements. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Get the first element: -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 0.0 -var im = imag( z ); +let im = imag( z ); // returns 0.0 // Set the first element: @@ -1844,20 +1844,20 @@ im = imag( z ); By default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Get the fifth element: -var z = arr.get( 4 ); +let z = arr.get( 4 ); // returns -var re = real( z ); +let re = real( z ); // returns 0.0 -var im = imag( z ); +let im = imag( z ); // returns 0.0 // Set the fifth element: @@ -1877,14 +1877,14 @@ im = imag( z ); In addition to providing a complex number, to set one or more array elements, provide an array-like object containing either complex numbers ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Define an array of complex numbers: -var buf = [ +const buf = [ new Complex128( 1.0, -1.0 ), new Complex128( 2.0, -2.0 ), new Complex128( 3.0, -3.0 ) @@ -1894,39 +1894,39 @@ var buf = [ arr.set( buf, 4 ); // Get the sixth element: -var z = arr.get( 5 ); +const z = arr.get( 5 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns -2.0 ``` or interleaved real and imaginary components ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Define an interleaved array of real and imaginary components: -var buf = new Float64Array( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ); +const buf = new Float64Array( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ); // Set the fifth, sixth, and seventh elements: arr.set( buf, 4 ); // Get the sixth element: -var z = arr.get( 5 ); +const z = arr.get( 5 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns -2.0 ``` @@ -1943,24 +1943,24 @@ A few notes: Copies a portion of a typed array to a new typed array. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice(); +const out = arr.slice(); // returns -var len = out.length; +const len = out.length; // returns 4 -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 2.0 z = out.get( len-1 ); @@ -1976,48 +1976,48 @@ im = imag( z ); By default, the method returns a typed array beginning with the first array element. To specify an alternative array index at which to begin, provide a `start` index (inclusive). ```javascript -var imag = require( '@stdlib/complex/float64/imag' ); -var real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice( 1 ); +const out = arr.slice( 1 ); // returns -var len = out.length; +const len = out.length; // returns 3 -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 3.0 -var im = imag( z ); +const im = imag( z ); // returns 4.0 ``` By default, the method returns a typed array which includes all array elements after `start`. To limit the number of array elements after `start`, provide an `end` index (exclusive). ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice( 1, -1 ); +const out = arr.slice( 1, -1 ); // returns -var len = out.length; +const len = out.length; // returns 2 -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns 4.0 z = out.get( len-1 ); @@ -2037,14 +2037,14 @@ im = imag( z ); Returns a boolean indicating whether at least one element passes a test. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v ) { return ( real( v ) === imag( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); @@ -2052,7 +2052,7 @@ arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); // Check whether at least one element passes a test: -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -2065,17 +2065,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function predicate( v, i ) { this.count += 1; return ( imag( v ) === real( v ) ); } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -2084,10 +2084,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var bool = arr.some( predicate, context ); +const bool = arr.some( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 2 ``` @@ -2098,24 +2098,20 @@ var count = context.count; Sorts an array in-place. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function compare( a, b ) { - var re1; - var re2; - var im1; - var im2; - re1 = real( a ); - re2 = real( b ); + const re1 = real( a ); + const re2 = real( b ); if ( re1 < re2 ) { return -1; } if ( re1 > re2 ) { return 1; } - im1 = imag( a ); - im2 = imag( b ); + const im1 = imag( a ); + const im2 = imag( b ); if ( im1 < im2 ) { return -1; } @@ -2125,22 +2121,22 @@ function compare( a, b ) { return 0; } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 3.0, -3.0 ], 0 ); arr.set( [ 1.0, -1.0 ], 1 ); arr.set( [ 2.0, -2.0 ], 2 ); -var out = arr.sort( compare ); +const out = arr.sort( compare ); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns -1.0 z = out.get( 1 ); @@ -2182,24 +2178,24 @@ In contrast to real numbers, one cannot define a default order relation which is Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host array. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray(); +const subarr = arr.subarray(); // returns -var len = subarr.length; +const len = subarr.length; // returns 4 -var z = subarr.get( 0 ); +let z = subarr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 2.0 z = subarr.get( len-1 ); @@ -2215,48 +2211,48 @@ im = imag( z ); By default, the method creates a typed array view beginning with the first array element. To specify an alternative array index at which to begin, provide a `begin` index (inclusive). ```javascript -var imag = require( '@stdlib/complex/float64/imag' ); -var real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray( 1 ); +const subarr = arr.subarray( 1 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 3 -var z = subarr.get( 0 ); +const z = subarr.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 3.0 -var im = imag( z ); +const im = imag( z ); // returns 4.0 ``` By default, the method creates a typed array view which includes all array elements after `begin`. To limit the number of array elements after `begin`, provide an `end` index (exclusive). ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray( 1, -1 ); +const subarr = arr.subarray( 1, -1 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 2 -var z = subarr.get( 0 ); +let z = subarr.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns 4.0 z = subarr.get( len-1 ); @@ -2276,12 +2272,12 @@ im = imag( z ); Serializes an array as a locale-specific string. ```javascript -var arr = new Complex128Array( 2 ); +const arr = new Complex128Array( 2 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1 + 1i,2 + 2i' ``` @@ -2297,25 +2293,25 @@ The method supports the following arguments: Returns a new typed array containing the elements in reversed order. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.toReversed(); +const out = arr.toReversed(); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns 3.0 z = out.get( 1 ); @@ -2344,24 +2340,20 @@ im = imag( z ); Returns a new typed array containing the elements in sorted order. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); function compare( a, b ) { - var re1; - var re2; - var im1; - var im2; - re1 = real( a ); - re2 = real( b ); + const re1 = real( a ); + const re2 = real( b ); if ( re1 < re2 ) { return -1; } if ( re1 > re2 ) { return 1; } - im1 = imag( a ); - im2 = imag( b ); + const im1 = imag( a ); + const im2 = imag( b ); if ( im1 < im2 ) { return -1; } @@ -2371,22 +2363,22 @@ function compare( a, b ) { return 0; } -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 3.0, -3.0 ], 0 ); arr.set( [ 1.0, -1.0 ], 1 ); arr.set( [ 2.0, -2.0 ], 2 ); -var out = arr.toSorted( compare ); +const out = arr.toSorted( compare ); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns -1.0 z = out.get( 1 ); @@ -2428,13 +2420,13 @@ In contrast to real numbers, one cannot define a default order relation which is Serializes an array as a string. ```javascript -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.toString(); +const str = arr.toString(); // returns '1 + 1i,2 - 2i,3 + 3i' ``` @@ -2445,22 +2437,22 @@ var str = arr.toString(); Returns an iterator for iterating over each value in a typed array. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Complex128Array( 2 ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const arr = new Complex128Array( 2 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var iter = arr.values(); +const iter = arr.values(); -var v = iter.next().value; +let v = iter.next().value; // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns -1.0 v = iter.next().value; @@ -2472,7 +2464,7 @@ re = real( v ); im = imag( v ); // returns -2.0 -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -2488,26 +2480,26 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns a new typed array with the element at a provided index replaced with a provided value. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var arr = new Complex128Array( 3 ); +const arr = new Complex128Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 1 ); -var out = arr.with( 0, new Complex128( 4.0, 4.0 ) ); +const out = arr.with( 0, new Complex128( 4.0, 4.0 ) ); // returns -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 4.0 -var im = imag( z ); +const im = imag( z ); // returns 4.0 ``` @@ -2545,17 +2537,17 @@ var im = imag( z ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var logEach = require( '@stdlib/console/log-each' ); -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const logEach = require( '@stdlib/console/log-each' ); +const Complex128Array = require( '@stdlib/array/complex128' ); // Create a complex array by specifying a length: -var out = new Complex128Array( 3 ); +let out = new Complex128Array( 3 ); logEach( '%s', out ); // Create a complex array from an array of complex numbers: -var arr = [ +let arr = [ new Complex128( 1.0, -1.0 ), new Complex128( -3.14, 3.14 ), new Complex128( 0.5, 0.5 ) diff --git a/lib/node_modules/@stdlib/array/complex64/README.md b/lib/node_modules/@stdlib/array/complex64/README.md index d0a652b7aa03..a0eaad888f62 100644 --- a/lib/node_modules/@stdlib/array/complex64/README.md +++ b/lib/node_modules/@stdlib/array/complex64/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); ``` @@ -47,7 +47,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); Creates a 64-bit complex number array. ```javascript -var arr = new Complex64Array(); +const arr = new Complex64Array(); // returns ``` @@ -56,10 +56,10 @@ var arr = new Complex64Array(); Creates a 64-bit complex number array having a specified `length`. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -68,13 +68,13 @@ var len = arr.length; Creates a 64-bit complex number array from another complex number array. ```javascript -var arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] +const arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] // returns -var arr2 = new Complex64Array( arr1 ); +const arr2 = new Complex64Array( arr1 ); // returns -var len = arr2.length; +const len = arr2.length; // returns 2 ``` @@ -83,15 +83,15 @@ var len = arr2.length; Creates a 64-bit complex number array from a [typed array][@stdlib/array/typed] containing interleaved real and imaginary components. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] +const buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ] // returns [ 1.0, -1.0, 2.0, -2.0 ] -var arr = new Complex64Array( buf ); +const arr = new Complex64Array( buf ); // returns -var len = arr.length; +const len = arr.length; // returns 2 ``` @@ -100,18 +100,18 @@ var len = arr.length; Creates a 64-bit complex number array from an array-like object or iterable. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); // From an array of interleaved real and imaginary components: -var arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); +const arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // returns -var len = arr1.length; +let len = arr1.length; // returns 2 // From an array containing complex numbers: -var buf = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ]; -var arr2 = new Complex64Array( buf ); +const buf = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ]; +const arr2 = new Complex64Array( buf ); len = arr2.length; // returns 2 @@ -122,22 +122,22 @@ len = arr2.length; Returns a 64-bit complex number array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 240 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 240 ); -var arr1 = new Complex64Array( buf ); +const arr1 = new Complex64Array( buf ); // returns -var len = arr1.length; +let len = arr1.length; // returns 30 -var arr2 = new Complex64Array( buf, 8 ); +const arr2 = new Complex64Array( buf, 8 ); // returns len = arr2.length; // returns 29 -var arr3 = new Complex64Array( buf, 8, 20 ); +const arr3 = new Complex64Array( buf, 8, 20 ); // returns len = arr3.length; @@ -155,7 +155,7 @@ len = arr3.length; Static property returning the size (in bytes) of each array element. ```javascript -var nbytes = Complex64Array.BYTES_PER_ELEMENT; +const nbytes = Complex64Array.BYTES_PER_ELEMENT; // returns 8 ``` @@ -166,7 +166,7 @@ var nbytes = Complex64Array.BYTES_PER_ELEMENT; Static property returning the constructor name. ```javascript -var str = Complex64Array.name; +const str = Complex64Array.name; // returns 'Complex64Array' ``` @@ -177,10 +177,10 @@ var str = Complex64Array.name; Pointer to the underlying data buffer. ```javascript -var arr = new Complex64Array( 2 ); +const arr = new Complex64Array( 2 ); // returns -var buf = arr.buffer; +const buf = arr.buffer; // returns ``` @@ -191,10 +191,10 @@ var buf = arr.buffer; Size (in bytes) of the array. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // returns -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 80 ``` @@ -205,15 +205,15 @@ var nbytes = arr.byteLength; Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var arr = new Complex64Array( 10 ); +let arr = new Complex64Array( 10 ); // returns -var offset = arr.byteOffset; +let offset = arr.byteOffset; // returns 0 -var buf = new ArrayBuffer( 240 ); +const buf = new ArrayBuffer( 240 ); arr = new Complex64Array( buf, 64 ); // returns @@ -228,10 +228,10 @@ offset = arr.byteOffset; Size (in bytes) of each array element. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // returns -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -242,10 +242,10 @@ var nbytes = arr.BYTES_PER_ELEMENT; Number of array elements. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // returns -var len = arr.length; +const len = arr.length; // returns 10 ``` @@ -260,13 +260,13 @@ var len = arr.length; Creates a new 64-bit complex number array from an array-like object or an iterable. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); // Create an array from interleaved real and imaginary components: -var arr = Complex64Array.from( [ 1.0, -1.0 ] ); +let arr = Complex64Array.from( [ 1.0, -1.0 ] ); // returns -var len = arr.length; +let len = arr.length; // returns 1 // Create an array from an array of complex numbers: @@ -280,22 +280,22 @@ len = arr.length; The iterator returned by an iterable must return either a complex number or an array-like object containing a real and imaginary component. ```javascript -var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); -var Float32Array = require( '@stdlib/array/float32' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +const Float32Array = require( '@stdlib/array/float32' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var iter; -var arr; -var len; -var re; -var im; -var z; +let iter; +let arr; +let len; +let re; +let im; +let z; // Define a function which returns an iterator protocol-compliant object... function iterable() { - var buf = new Float32Array( 2 ); - var i = 0; + const buf = new Float32Array( 2 ); + let i = 0; return { 'next': next }; @@ -344,45 +344,45 @@ if ( ITERATOR_SYMBOL === null ) { To invoke a function for each `src` value, provide a callback function. If `src` is an iterable or an array-like object containing complex numbers, the callback must return either a complex number ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function map( z ) { return new Complex64( realf(z)*2.0, imagf(z)*2.0 ); } // Create a source array: -var src = [ new Complex64( 1.0, -1.0 ) ]; +const src = [ new Complex64( 1.0, -1.0 ) ]; // Create a new complex number array by scaling the source array: -var arr = Complex64Array.from( src, map ); +const arr = Complex64Array.from( src, map ); // returns -var len = arr.length; +const len = arr.length; // returns 1 -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns -2.0 ``` or an array-like object containing real and imaginary components ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Return a callback which reuses allocated memory... function mapFcn() { - var buf = new Float32Array( 2 ); + const buf = new Float32Array( 2 ); return map; function map( z ) { @@ -393,22 +393,22 @@ function mapFcn() { } // Create a source array: -var src = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ]; +const src = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ]; // Create a new complex number array by scaling the source array: -var arr = Complex64Array.from( src, mapFcn() ); +const arr = Complex64Array.from( src, mapFcn() ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 2.0 -var im = imagf( z ); +let im = imagf( z ); // returns -2.0 z = arr.get( 1 ); @@ -424,32 +424,32 @@ im = imagf( z ); If `src` is an array-like object containing interleaved real and imaginary components, the callback is invoked for each component and should return the transformed component value. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function map( v ) { return v * 2.0; } // Create a source array: -var src = new Float32Array( [ 1.0, -1.0 ] ); +const src = new Float32Array( [ 1.0, -1.0 ] ); // Create a new complex number array by scaling the source array: -var arr = Complex64Array.from( src, map ); +const arr = Complex64Array.from( src, map ); // returns -var len = arr.length; +const len = arr.length; // returns 1 -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns -2.0 ``` @@ -461,9 +461,9 @@ A callback function is provided two arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function map( z ) { this.count += 1; @@ -471,21 +471,21 @@ function map( z ) { } // Create a source array: -var src = [ new Complex64( 1.0, -1.0 ), new Complex64( 1.0, -1.0 ) ]; +const src = [ new Complex64( 1.0, -1.0 ), new Complex64( 1.0, -1.0 ) ]; // Define an execution context: -var ctx = { +const ctx = { 'count': 0 }; // Create a new complex number array by scaling the source array: -var arr = Complex64Array.from( src, map, ctx ); +const arr = Complex64Array.from( src, map, ctx ); // returns -var len = arr.length; +const len = arr.length; // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -496,16 +496,16 @@ var n = ctx.count; Creates a new 64-bit complex number array from a variable number of arguments. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = Complex64Array.of( 1.0, -1.0, 2.0, -2.0 ); +let arr = Complex64Array.of( 1.0, -1.0, 2.0, -2.0 ); // returns -var len = arr.length; +let len = arr.length; // returns 2 -var z1 = new Complex64( 1.0, -1.0 ); -var z2 = new Complex64( 2.0, -2.0 ); +const z1 = new Complex64( 1.0, -1.0 ); +const z2 = new Complex64( 2.0, -2.0 ); arr = Complex64Array.of( z1, z2 ); // returns @@ -521,10 +521,10 @@ len = arr.length; Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Set the first, second, and last elements: arr.set( [ 1.0, -1.0 ], 0 ); @@ -532,13 +532,13 @@ arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 9.0, -9.0 ], 9 ); // Get the first element: -var z = arr.at( 0 ); +let z = arr.at( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns -1.0 // Get the last element: @@ -555,9 +555,9 @@ im = imagf( z ); If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); -var z = arr.at( 100 ); +let z = arr.at( 100 ); // returns undefined z = arr.at( -100 ); @@ -571,11 +571,11 @@ z = arr.at( -100 ); Copies a sequence of elements within the array starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 4 ); +const arr = new Complex64Array( 4 ); // Set the array elements: arr.set( new Complex64( 1.0, -1.0 ), 0 ); @@ -584,13 +584,13 @@ arr.set( new Complex64( 3.0, -3.0 ), 2 ); arr.set( new Complex64( 4.0, -4.0 ), 3 ); // Get the first array element: -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns -1.0 // Get the second array element: @@ -630,11 +630,11 @@ im = imagf( z ); By default, `end` equals the number of array elements (i.e., one more than the last array index). To limit the sequence length, provide an `end` argument. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 4 ); +const arr = new Complex64Array( 4 ); // Set the array elements: arr.set( new Complex64( 1.0, -1.0 ), 0 ); @@ -643,13 +643,13 @@ arr.set( new Complex64( 3.0, -3.0 ), 2 ); arr.set( new Complex64( 4.0, -4.0 ), 3 ); // Get the third array element: -var z = arr.get( 2 ); +let z = arr.get( 2 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns -3.0 // Get the last array element: @@ -689,11 +689,11 @@ im = imagf( z ); When a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last array element. The following example achieves the same behavior as the previous example: ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 4 ); +const arr = new Complex64Array( 4 ); // Set the array elements: arr.set( new Complex64( 1.0, -1.0 ), 0 ); @@ -702,13 +702,13 @@ arr.set( new Complex64( 3.0, -3.0 ), 2 ); arr.set( new Complex64( 4.0, -4.0 ), 3 ); // Get the third array element: -var z = arr.get( 2 ); +let z = arr.get( 2 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns -3.0 // Get the last array element: @@ -752,11 +752,11 @@ im = imagf( z ); Returns an iterator for iterating over array key-value pairs. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = [ +let arr = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ), new Complex64( 3.0, -3.0 ) @@ -764,16 +764,16 @@ var arr = [ arr = new Complex64Array( arr ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over the key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, ] -var re = realf( v[ 1 ] ); +let re = realf( v[ 1 ] ); // returns 1.0 -var im = imagf( v[ 1 ] ); +let im = imagf( v[ 1 ] ); // returns -1.0 v = it.next().value; @@ -794,7 +794,7 @@ re = realf( v[ 1 ] ); im = imagf( v[ 1 ] ); // returns -3.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -810,14 +810,14 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns a boolean indicating whether all elements pass a test. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); @@ -825,7 +825,7 @@ arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); // Check whether all elements pass a test: -var z = arr.every( predicate ); +const z = arr.every( predicate ); // returns true ``` @@ -843,9 +843,9 @@ function predicate( v, i ) { return ( i >= 0 ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -854,10 +854,10 @@ arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.every( predicate, context ); +const z = arr.every( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 3 ``` @@ -868,22 +868,22 @@ var count = context.count; Returns a modified typed array filled with a fill value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set all elements to the same value: arr.fill( new Complex64( 1.0, 1.0 ) ); -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 1.0 z = arr.get( 2 ); @@ -941,22 +941,22 @@ im = imagf( z ); When a `start` and/or `end` index is negative, the respective index is determined relative to the last array element. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set all array elements, except the last element, to the same value: arr.fill( new Complex64( 1.0, 1.0 ), 0, -1 ); -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 1.0 z = arr.get( arr.length - 1 ); @@ -976,33 +976,33 @@ im = imagf( z ); Returns a new array containing the elements of an array which pass a test implemented by a predicate function. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var out = arr.filter( predicate ); +const out = arr.filter( predicate ); // returns -var len = out.length; +const len = out.length; // returns 1 -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 ``` @@ -1015,17 +1015,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1034,13 +1034,13 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.filter( predicate, context ); +const out = arr.filter( predicate, context ); // returns -var len = out.length; +const len = out.length; // returns 2 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1051,28 +1051,28 @@ var count = context.count; Returns the first element in an array for which a predicate function returns a truthy value. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.find( predicate ); +const z = arr.find( predicate ); // returns -var re = realf( z ); +const re = realf( z ); // returns 1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 1.0 ``` @@ -1085,17 +1085,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1104,16 +1104,16 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.find( predicate, context ); +const z = arr.find( predicate, context ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 -var count = context.count; +const count = context.count; // returns 2 ``` @@ -1124,21 +1124,21 @@ var count = context.count; Returns the index of the first element in an array for which a predicate function returns a truthy value. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -1151,17 +1151,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1170,10 +1170,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findIndex( predicate, context ); +const idx = arr.findIndex( predicate, context ); // returns -1 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1184,28 +1184,28 @@ var count = context.count; Returns the last element in an array for which a predicate function returns a truthy value. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.findLast( predicate ); +const z = arr.findLast( predicate ); // returns -var re = realf( z ); +const re = realf( z ); // returns 3.0 -var im = imagf( z ); +const im = imagf( z ); // returns 3.0 ``` @@ -1218,17 +1218,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1237,16 +1237,16 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var z = arr.findLast( predicate, context ); +const z = arr.findLast( predicate, context ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 -var count = context.count; +const count = context.count; // returns 2 ``` @@ -1257,21 +1257,21 @@ var count = context.count; Returns the index of the last element in an array for which a predicate function returns a truthy value. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findLastIndex( predicate ); +const idx = arr.findLastIndex( predicate ); // returns 1 ``` @@ -1284,17 +1284,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( i >= 0 && realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1303,10 +1303,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var idx = arr.findLastIndex( predicate, context ); +const idx = arr.findLastIndex( predicate, context ); // returns -1 -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1317,13 +1317,13 @@ var count = context.count; Invokes a function once for each array element. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); function log( v, i ) { console.log( '%s: %s', i, v.toString() ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, 1.0 ], 0 ); @@ -1347,16 +1347,16 @@ The invoked function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); function fcn( v, i ) { this.count += 1; console.log( '%s: %s', i, v.toString() ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1372,7 +1372,7 @@ arr.forEach( fcn, context ); 2: 3 + 3i */ -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1383,31 +1383,31 @@ var count = context.count; Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Set the first element: arr.set( [ 1.0, -1.0 ], 0 ); // Get the first element: -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 1.0 -var im = imagf( z ); +const im = imagf( z ); // returns -1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); -var z = arr.get( 100 ); +const z = arr.get( 100 ); // returns undefined ``` @@ -1418,9 +1418,9 @@ var z = arr.get( 100 ); Returns a boolean indicating whether an array includes a provided value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 5 ); +const arr = new Complex64Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1428,7 +1428,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 5.0, -5.0 ], 4 ); -var bool = arr.includes( new Complex64( 3.0, -3.0 ) ); +let bool = arr.includes( new Complex64( 3.0, -3.0 ) ); // returns true bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 ); @@ -1445,9 +1445,9 @@ bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 ); Returns the first index at which a given element can be found. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 5 ); +const arr = new Complex64Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1455,7 +1455,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 2.0, -2.0 ], 4 ); -var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) ); +let idx = arr.indexOf( new Complex64( 3.0, -3.0 ) ); // returns 2 idx = arr.indexOf( new Complex64( 2.0, -2.0 ), 2 ); @@ -1468,14 +1468,14 @@ idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) ); +let idx = arr.indexOf( new Complex64( 3.0, -3.0 ) ); // returns -1 idx = arr.indexOf( new Complex64( 1.0, -1.0 ), 1 ); @@ -1489,26 +1489,26 @@ idx = arr.indexOf( new Complex64( 1.0, -1.0 ), 1 ); Returns a new string by concatenating all array elements. ```javascript -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.join(); +const str = arr.join(); // returns '1 + 1i,2 - 2i,3 + 3i' ``` By default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string. ```javascript -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.join( '/' ); +const str = arr.join( '/' ); // returns '1 + 1i/2 - 2i/3 + 3i' ``` @@ -1519,20 +1519,20 @@ var str = arr.join( '/' ); Returns an iterator for iterating over each index key in a typed array. ```javascript -var arr = new Complex64Array( 2 ); +const arr = new Complex64Array( 2 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var iter = arr.keys(); +const iter = arr.keys(); -var v = iter.next().value; +let v = iter.next().value; // returns 0 v = iter.next().value; // returns 1 -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -1548,9 +1548,9 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns the last index at which a given element can be found. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 5 ); +const arr = new Complex64Array( 5 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); @@ -1558,7 +1558,7 @@ arr.set( [ 3.0, -3.0 ], 2 ); arr.set( [ 4.0, -4.0 ], 3 ); arr.set( [ 2.0, -2.0 ], 4 ); -var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) ); +let idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) ); // returns 2 idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), 2 ); @@ -1571,14 +1571,14 @@ idx = arr.lastIndexOf( new Complex64( 4.0, -4.0 ), -1 ); If `searchElement` is not present in the array, the method returns `-1`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) ); +let idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) ); // returns -1 idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), 0 ); @@ -1592,31 +1592,31 @@ idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), 0 ); Returns a new array with each element being the result of a provided callback function. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function scale( v ) { return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var out = arr.map( scale ); +const out = arr.map( scale ); // returns -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns -2.0 ``` @@ -1629,18 +1629,18 @@ The callback function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function scale( v ) { this.count += 1; return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -1649,10 +1649,10 @@ arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.map( scale, context ); +const out = arr.map( scale, context ); // returns -var count = context.count; +const count = context.count; // returns 3 ``` @@ -1663,23 +1663,23 @@ var count = context.count; Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduce( caddf ); +const z = arr.reduce( caddf ); // returns -var re = realf( z ); +const re = realf( z ); // returns 6.0 -var im = imagf( z ); +const im = imagf( z ); // returns 6.0 ``` @@ -1693,20 +1693,20 @@ The reducer function is provided four arguments: By default, the function initializes the accumulated result to the first element in the array and passes the second array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the first array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); +const realf = require( '@stdlib/complex/float32/real' ); function reducer( acc, v ) { acc += realf( v ); return acc; } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduce( reducer, 0.0 ); +const z = arr.reduce( reducer, 0.0 ); // returns 6.0 ``` @@ -1717,23 +1717,23 @@ var z = arr.reduce( reducer, 0.0 ); Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the following element and returning the accumulated result upon completion. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduceRight( caddf ); +const z = arr.reduceRight( caddf ); // returns -var re = realf( z ); +const re = realf( z ); // returns 6.0 -var im = imagf( z ); +const im = imagf( z ); // returns 6.0 ``` @@ -1747,20 +1747,20 @@ The reducer function is provided four arguments: By default, the function initializes the accumulated result to the last element in the array and passes the second-last array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the last array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); +const realf = require( '@stdlib/complex/float32/real' ); function reducer( acc, v ) { acc += realf( v ); return acc; } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var z = arr.reduceRight( reducer, 0.0 ); +const z = arr.reduceRight( reducer, 0.0 ); // returns 6.0 ``` @@ -1771,25 +1771,25 @@ var z = arr.reduceRight( reducer, 0.0 ); Reverses an array in-place. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.reverse(); +const out = arr.reverse(); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns 3.0 z = out.get( 1 ); @@ -1818,20 +1818,20 @@ im = imagf( z ); Sets one or more array elements. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Get the first element: -var z = arr.get( 0 ); +let z = arr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 0.0 -var im = imagf( z ); +let im = imagf( z ); // returns 0.0 // Set the first element: @@ -1851,20 +1851,20 @@ im = imagf( z ); By default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Get the fifth element: -var z = arr.get( 4 ); +let z = arr.get( 4 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 0.0 -var im = imagf( z ); +let im = imagf( z ); // returns 0.0 // Set the fifth element: @@ -1884,14 +1884,14 @@ im = imagf( z ); In addition to providing a complex number, to set one or more array elements, provide an array-like object containing either complex numbers ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Define an array of complex numbers: -var buf = [ +const buf = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ), new Complex64( 3.0, -3.0 ) @@ -1901,39 +1901,39 @@ var buf = [ arr.set( buf, 4 ); // Get the sixth element: -var z = arr.get( 5 ); +const z = arr.get( 5 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns -2.0 ``` or interleaved real and imaginary components ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 10 ); +const arr = new Complex64Array( 10 ); // Define an interleaved array of real and imaginary components: -var buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ); +const buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ); // Set the fifth, sixth, and seventh elements: arr.set( buf, 4 ); // Get the sixth element: -var z = arr.get( 5 ); +const z = arr.get( 5 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns -2.0 ``` @@ -1950,24 +1950,24 @@ A few notes: Copies a portion of a typed array to a new typed array. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice(); +const out = arr.slice(); // returns -var len = out.length; +const len = out.length; // returns 4 -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 2.0 z = out.get( len-1 ); @@ -1983,48 +1983,48 @@ im = imagf( z ); By default, the method returns a typed array beginning with the first array element. To specify an alternative array index at which to begin, provide a `start` index (inclusive). ```javascript -var imagf = require( '@stdlib/complex/float32/imag' ); -var realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice( 1 ); +const out = arr.slice( 1 ); // returns -var len = out.length; +const len = out.length; // returns 3 -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 3.0 -var im = imagf( z ); +const im = imagf( z ); // returns 4.0 ``` By default, the method returns a typed array which includes all array elements after `start`. To limit the number of array elements after `start`, provide an `end` index (exclusive). ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var out = arr.slice( 1, -1 ); +const out = arr.slice( 1, -1 ); // returns -var len = out.length; +const len = out.length; // returns 2 -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns 4.0 z = out.get( len-1 ); @@ -2044,14 +2044,14 @@ im = imagf( z ); Returns a boolean indicating whether at least one element passes a test. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v ) { return ( realf( v ) === imagf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); // Set the first three elements: arr.set( [ 1.0, -1.0 ], 0 ); @@ -2059,7 +2059,7 @@ arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); // Check whether at least one element passes a test: -var z = arr.some( predicate ); +const z = arr.some( predicate ); // returns true ``` @@ -2072,17 +2072,17 @@ The `predicate` function is provided three arguments: To set the function execution context, provide a `thisArg`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function predicate( v, i ) { this.count += 1; return ( imagf( v ) === realf( v ) ); } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); -var context = { +const context = { 'count': 0 }; @@ -2091,10 +2091,10 @@ arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, -3.0 ], 2 ); -var z = arr.some( predicate, context ); +const z = arr.some( predicate, context ); // returns true -var count = context.count; +const count = context.count; // returns 2 ``` @@ -2105,24 +2105,20 @@ var count = context.count; Sorts an array in-place. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function compare( a, b ) { - var re1; - var re2; - var im1; - var im2; - re1 = realf( a ); - re2 = realf( b ); + const re1 = realf( a ); + const re2 = realf( b ); if ( re1 < re2 ) { return -1; } if ( re1 > re2 ) { return 1; } - im1 = imagf( a ); - im2 = imagf( b ); + const im1 = imagf( a ); + const im2 = imagf( b ); if ( im1 < im2 ) { return -1; } @@ -2132,22 +2128,22 @@ function compare( a, b ) { return 0; } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 3.0, -3.0 ], 0 ); arr.set( [ 1.0, -1.0 ], 1 ); arr.set( [ 2.0, -2.0 ], 2 ); -var out = arr.sort( compare ); +const out = arr.sort( compare ); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns -1.0 z = out.get( 1 ); @@ -2189,24 +2185,24 @@ In contrast to real numbers, one cannot define a default order relation which is Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host array. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray(); +const subarr = arr.subarray(); // returns -var len = subarr.length; +const len = subarr.length; // returns 4 -var z = subarr.get( 0 ); +let z = subarr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 2.0 z = subarr.get( len-1 ); @@ -2222,48 +2218,48 @@ im = imagf( z ); By default, the method creates a typed array view beginning with the first array element. To specify an alternative array index at which to begin, provide a `begin` index (inclusive). ```javascript -var imagf = require( '@stdlib/complex/float32/imag' ); -var realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray( 1 ); +const subarr = arr.subarray( 1 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 3 -var z = subarr.get( 0 ); +const z = subarr.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 3.0 -var im = imagf( z ); +const im = imagf( z ); // returns 4.0 ``` By default, the method creates a typed array view which includes all array elements after `begin`. To limit the number of array elements after `begin`, provide an `end` index (exclusive). ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var subarr = arr.subarray( 1, -1 ); +const subarr = arr.subarray( 1, -1 ); // returns -var len = subarr.length; +const len = subarr.length; // returns 2 -var z = subarr.get( 0 ); +let z = subarr.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns 4.0 z = subarr.get( len-1 ); @@ -2283,12 +2279,12 @@ im = imagf( z ); Serializes an array as a locale-specific string. ```javascript -var arr = new Complex64Array( 2 ); +const arr = new Complex64Array( 2 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1 + 1i,2 + 2i' ``` @@ -2304,25 +2300,25 @@ The method supports the following arguments: Returns a new typed array containing the elements in reversed order. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var out = arr.toReversed(); +const out = arr.toReversed(); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns 3.0 z = out.get( 1 ); @@ -2351,24 +2347,20 @@ im = imagf( z ); Returns a new typed array containing the elements in sorted order. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); function compare( a, b ) { - var re1; - var re2; - var im1; - var im2; - re1 = realf( a ); - re2 = realf( b ); + const re1 = realf( a ); + const re2 = realf( b ); if ( re1 < re2 ) { return -1; } if ( re1 > re2 ) { return 1; } - im1 = imagf( a ); - im2 = imagf( b ); + const im1 = imagf( a ); + const im2 = imagf( b ); if ( im1 < im2 ) { return -1; } @@ -2378,22 +2370,22 @@ function compare( a, b ) { return 0; } -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 3.0, -3.0 ], 0 ); arr.set( [ 1.0, -1.0 ], 1 ); arr.set( [ 2.0, -2.0 ], 2 ); -var out = arr.toSorted( compare ); +const out = arr.toSorted( compare ); // returns -var z = out.get( 0 ); +let z = out.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns -1.0 z = out.get( 1 ); @@ -2435,13 +2427,13 @@ In contrast to real numbers, one cannot define a default order relation which is Serializes an array as a string. ```javascript -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 2 ); -var str = arr.toString(); +const str = arr.toString(); // returns '1 + 1i,2 - 2i,3 + 3i' ``` @@ -2452,22 +2444,22 @@ var str = arr.toString(); Returns an iterator for iterating over each value in a typed array. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Complex64Array( 2 ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const arr = new Complex64Array( 2 ); arr.set( [ 1.0, -1.0 ], 0 ); arr.set( [ 2.0, -2.0 ], 1 ); -var iter = arr.values(); +const iter = arr.values(); -var v = iter.next().value; +let v = iter.next().value; // returns -var re = realf( v ); +let re = realf( v ); // returns 1.0 -var im = imagf( v ); +let im = imagf( v ); // returns -1.0 v = iter.next().value; @@ -2479,7 +2471,7 @@ re = realf( v ); im = imagf( v ); // returns -2.0 -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -2495,26 +2487,26 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the Returns a new typed array with the element at a provided index replaced with a provided value. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var arr = new Complex64Array( 3 ); +const arr = new Complex64Array( 3 ); arr.set( [ 1.0, 1.0 ], 0 ); arr.set( [ 2.0, 2.0 ], 1 ); arr.set( [ 3.0, 3.0 ], 1 ); -var out = arr.with( 0, new Complex64( 4.0, 4.0 ) ); +const out = arr.with( 0, new Complex64( 4.0, 4.0 ) ); // returns -var z = out.get( 0 ); +const z = out.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 4.0 -var im = imagf( z ); +const im = imagf( z ); // returns 4.0 ``` @@ -2552,17 +2544,17 @@ var im = imagf( z ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var logEach = require( '@stdlib/console/log-each' ); -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const logEach = require( '@stdlib/console/log-each' ); +const Complex64Array = require( '@stdlib/array/complex64' ); // Create a complex array by specifying a length: -var out = new Complex64Array( 3 ); +let out = new Complex64Array( 3 ); logEach( '%s', out ); // Create a complex array from an array of complex numbers: -var arr = [ +let arr = [ new Complex64( 1.0, -1.0 ), new Complex64( -3.14, 3.14 ), new Complex64( 0.5, 0.5 ) diff --git a/lib/node_modules/@stdlib/array/convert-same/README.md b/lib/node_modules/@stdlib/array/convert-same/README.md index 96ae3fcc866c..9a101e1520bd 100644 --- a/lib/node_modules/@stdlib/array/convert-same/README.md +++ b/lib/node_modules/@stdlib/array/convert-same/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var convertSame = require( '@stdlib/array/convert-same' ); +const convertSame = require( '@stdlib/array/convert-same' ); ``` #### convertSame( x, y ) @@ -45,12 +45,12 @@ var convertSame = require( '@stdlib/array/convert-same' ); Converts an array to the same [data type][@stdlib/array/dtypes] as a second input array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = [ 1.0, 2.0, 3.0 ]; -var y = new Float32Array( 0 ); +const x = [ 1.0, 2.0, 3.0 ]; +const y = new Float32Array( 0 ); -var out = convertSame( x, y ); +const out = convertSame( x, y ); // returns [ 1.0, 2.0, 3.0 ] ``` @@ -77,23 +77,20 @@ var out = convertSame( x, y ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var ctors = require( '@stdlib/array/ctors' ); -var convertSame = require( '@stdlib/array/convert-same' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const ctors = require( '@stdlib/array/ctors' ); +const convertSame = require( '@stdlib/array/convert-same' ); // Create a generic array: -var arr = filledarrayBy( 5, 'generic', discreteUniform( -100, 100 ) ); +const arr = filledarrayBy( 5, 'generic', discreteUniform( -100, 100 ) ); // Get a list of array data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Convert the generic array to each array data type: -var out; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - out = convertSame( arr, new ( ctors( DTYPES[ i ] ) )( 0 ) ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const out = convertSame( arr, new ( ctors( DTYPES[ i ] ) )( 0 ) ); console.log( out ); } ``` diff --git a/lib/node_modules/@stdlib/array/convert/README.md b/lib/node_modules/@stdlib/array/convert/README.md index 1ee2f8adcc9c..8c4aa75740fc 100644 --- a/lib/node_modules/@stdlib/array/convert/README.md +++ b/lib/node_modules/@stdlib/array/convert/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var convert = require( '@stdlib/array/convert' ); +const convert = require( '@stdlib/array/convert' ); ``` #### convert( arr, dtype ) @@ -45,8 +45,8 @@ var convert = require( '@stdlib/array/convert' ); Converts an array to an array of a different [data type][@stdlib/array/dtypes]. ```javascript -var arr = [ 1.0, 2.0, 3.0 ]; -var out = convert( arr, 'float32' ); +const arr = [ 1.0, 2.0, 3.0 ]; +const out = convert( arr, 'float32' ); // returns [ 1.0, 2.0, 3.0 ] ``` @@ -71,22 +71,19 @@ var out = convert( arr, 'float32' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var convert = require( '@stdlib/array/convert' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const convert = require( '@stdlib/array/convert' ); // Create a generic array: -var arr = filledarrayBy( 5, 'generic', discreteUniform( -100, 100 ) ); +const arr = filledarrayBy( 5, 'generic', discreteUniform( -100, 100 ) ); // Get a list of array data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Convert the generic array to each array data type: -var out; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - out = convert( arr, DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const out = convert( arr, DTYPES[ i ] ); console.log( out ); } ``` diff --git a/lib/node_modules/@stdlib/array/ctors/README.md b/lib/node_modules/@stdlib/array/ctors/README.md index 88484049019c..51185833f289 100644 --- a/lib/node_modules/@stdlib/array/ctors/README.md +++ b/lib/node_modules/@stdlib/array/ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/ctors' ); +const ctors = require( '@stdlib/array/ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/ctors' ); Returns an array constructor for a specified data type. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` @@ -68,7 +68,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -93,15 +93,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var ctors = require( '@stdlib/array/ctors' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const ctors = require( '@stdlib/array/ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/dataview/README.md b/lib/node_modules/@stdlib/array/dataview/README.md index c6b71fda5103..f63fc1a780c6 100644 --- a/lib/node_modules/@stdlib/array/dataview/README.md +++ b/lib/node_modules/@stdlib/array/dataview/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var DataView = require( '@stdlib/array/dataview' ); +const DataView = require( '@stdlib/array/dataview' ); ``` #### DataView( buffer\[, byteOffset\[, byteLength]] ) @@ -47,12 +47,12 @@ Returns a [`DataView`][mdn-dataview] representing a provided array buffer. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 5 ); +const buf = new ArrayBuffer( 5 ); // returns -var dv = new DataView( buf ); +const dv = new DataView( buf ); // returns ``` @@ -67,15 +67,15 @@ var dv = new DataView( buf ); ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf1 = new ArrayBuffer( 5 ); -var dv = new DataView( buf1 ); +const buf1 = new ArrayBuffer( 5 ); +const dv = new DataView( buf1 ); -var buf2 = dv.buffer; +const buf2 = dv.buffer; // returns -var bool = ( buf1 === buf2 ); +const bool = ( buf1 === buf2 ); // returns true ``` @@ -86,12 +86,12 @@ var bool = ( buf1 === buf2 ); ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 5 ); -var dv = new DataView( buf ); +const buf = new ArrayBuffer( 5 ); +const dv = new DataView( buf ); -var byteLength = dv.byteLength; +const byteLength = dv.byteLength; // returns 5 ``` @@ -102,12 +102,12 @@ var byteLength = dv.byteLength; ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 5 ); -var dv = new DataView( buf, 3 ); +const buf = new ArrayBuffer( 5 ); +const dv = new DataView( buf, 3 ); -var byteOffset = dv.byteOffset; +const byteOffset = dv.byteOffset; // returns 3 ``` @@ -140,30 +140,28 @@ TODO: document methods ```javascript -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); -var randu = require( '@stdlib/random/base/randu' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); +const randu = require( '@stdlib/random/base/randu' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); // Create a new ArrayBuffer: -var buf = new ArrayBuffer( 64 ); +const buf = new ArrayBuffer( 64 ); // Create a new DataView: -var dv = new DataView( buf ); +const dv = new DataView( buf ); -// Set values in the view: -var i; -for ( i = 0; i < dv.byteLength/8; i++ ) { +for ( let i = 0; i < dv.byteLength/8; i++ ) { dv.setFloat64( i*8, randu()*100.0, IS_LITTLE_ENDIAN ); } // Create a "bytes" view of the underlying array buffer: -var bytes = new Uint8Array( dv.buffer ); +const bytes = new Uint8Array( dv.buffer ); // Print the bytes: -for ( i = 0; i < bytes.length; i++ ) { +for ( let i = 0; i < bytes.length; i++ ) { console.log( 'byte %d: %s', i, toBinaryString( bytes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/datespace/README.md b/lib/node_modules/@stdlib/array/datespace/README.md index 35430c56daf7..bc6bb7a6954b 100644 --- a/lib/node_modules/@stdlib/array/datespace/README.md +++ b/lib/node_modules/@stdlib/array/datespace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var datespace = require( '@stdlib/array/datespace' ); +const datespace = require( '@stdlib/array/datespace' ); ``` #### datespace( start, stop\[, length]\[, opts] ) @@ -35,10 +35,10 @@ var datespace = require( '@stdlib/array/datespace' ); Generates an `array` of linearly spaced [`Date`][mdn-date-object] objects. If a `length` is not provided, the default output `array` length is `100`. ```javascript -var end = '2014-12-02T07:00:54.973Z'; -var start = new Date( end ) - 60000; +const end = '2014-12-02T07:00:54.973Z'; +const start = new Date( end ) - 60000; -var arr = datespace( start, end, 6 ); +const arr = datespace( start, end, 6 ); /* returns [ 'Mon Dec 01 2014 22:59:54 GMT-0800 (PST)', 'Mon Dec 01 2014 23:00:06 GMT-0800 (PST)', @@ -58,10 +58,10 @@ The `start` and `stop` times may be either [`Date`][mdn-date-object] objects, da ```javascript // JavaScript timestamps: -var end = 1417503654973; -var start = new Date( end - 60000 ); +let end = 1417503654973; +let start = new Date( end - 60000 ); -var arr = datespace( start, end, 6 ); +let arr = datespace( start, end, 6 ); /* returns [ 'Mon Dec 01 2014 22:59:54 GMT-0800 (PST)', 'Mon Dec 01 2014 23:00:06 GMT-0800 (PST)', @@ -91,7 +91,7 @@ arr = datespace( start, end, 6 ); The output `array` is guaranteed to include the `start` and `end` times. Beware, however, that values between the `start` and `end` are subject to rounding errors. For example, ```javascript -var arr = datespace( 1417503655000, 1417503655001, 3 ); +const arr = datespace( 1417503655000, 1417503655001, 3 ); // returns [ 1417503655000, 1417503655000, 1417503655001 ] ``` @@ -101,7 +101,7 @@ By default, fractional timestamps are floored. To specify that timestamps always ```javascript // Equivalent of Math.ceil(): -var arr = datespace( 1417503655000, 1417503655001, 3, { +let arr = datespace( 1417503655000, 1417503655001, 3, { 'round': 'ceil' }); // returns [ 1417503655000, 1417503655001, 1417503655001 ] @@ -128,16 +128,13 @@ arr = datespace( 1417503655000, 1417503655001, 3, { ## Examples ```javascript -var datespace = require( '@stdlib/array/datespace' ); -var start; -var arr; -var end; +const datespace = require( '@stdlib/array/datespace' ); -end = '2014-12-02T07:00:54.973Z'; -start = new Date( end ) - 100000; +const end = '2014-12-02T07:00:54.973Z'; +const start = new Date( end ) - 100000; // Default behavior: -arr = datespace( start, end ); +let arr = datespace( start, end ); console.log( arr.join( '\n' ) ); // Specify length: diff --git a/lib/node_modules/@stdlib/array/defaults/README.md b/lib/node_modules/@stdlib/array/defaults/README.md index e006ccd37bfe..81ba4680e3a5 100644 --- a/lib/node_modules/@stdlib/array/defaults/README.md +++ b/lib/node_modules/@stdlib/array/defaults/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var defaults = require( '@stdlib/array/defaults' ); +const defaults = require( '@stdlib/array/defaults' ); ``` #### defaults() @@ -45,7 +45,7 @@ var defaults = require( '@stdlib/array/defaults' ); Returns default array settings. ```javascript -var out = defaults(); +const out = defaults(); // returns {...} ``` @@ -69,7 +69,7 @@ The returned object has the following properties: Returns the setting value for a provided setting `name`. ```javascript -var v = defaults.get( 'dtypes.floating_point' ); +const v = defaults.get( 'dtypes.floating_point' ); // returns ``` @@ -96,13 +96,13 @@ The setting `name` corresponds to a flattened object path. For example, the sett ```javascript -var empty = require( '@stdlib/array/empty' ); -var dtype = require( '@stdlib/array/dtype' ); -var defaults = require( '@stdlib/array/defaults' ); +const empty = require( '@stdlib/array/empty' ); +const dtype = require( '@stdlib/array/dtype' ); +const defaults = require( '@stdlib/array/defaults' ); -var o = defaults(); +const o = defaults(); -var x = empty( 10, o.dtypes.default ); +let x = empty( 10, o.dtypes.default ); console.log( dtype( x ) ); x = empty( 10, o.dtypes.floating_point ); diff --git a/lib/node_modules/@stdlib/array/dtype/README.md b/lib/node_modules/@stdlib/array/dtype/README.md index eb5a166ce162..5cc183cd5e78 100644 --- a/lib/node_modules/@stdlib/array/dtype/README.md +++ b/lib/node_modules/@stdlib/array/dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype = require( '@stdlib/array/dtype' ); +const dtype = require( '@stdlib/array/dtype' ); ``` #### dtype( array ) @@ -45,17 +45,17 @@ var dtype = require( '@stdlib/array/dtype' ); Returns the [data type][@stdlib/array/dtypes] of an `array`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arr = new Float64Array( 10 ); +const Float64Array = require( '@stdlib/array/float64' ); +const arr = new Float64Array( 10 ); -var dt = dtype( arr ); +const dt = dtype( arr ); // returns 'float64' ``` If provided an argument having an unknown or unsupported [data type][@stdlib/array/dtypes], the function returns `null`. ```javascript -var dt = dtype( 'beep' ); +const dt = dtype( 'beep' ); // returns null ``` @@ -82,28 +82,21 @@ var dt = dtype( 'beep' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var ctors = require( '@stdlib/array/ctors' ); -var dtype = require( '@stdlib/array/dtype' ); - -var DTYPES; -var ctor; -var arr; -var len; -var dt; -var i; +const dtypes = require( '@stdlib/array/dtypes' ); +const ctors = require( '@stdlib/array/ctors' ); +const dtype = require( '@stdlib/array/dtype' ); // Get a list of supported array data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Array length: -len = 10; +const len = 10; // For each supported data type, create an array and confirm its data type... -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - arr = new ctor( len ); - dt = dtype( arr ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); + const arr = new ctor( len ); + const dt = dtype( arr ); console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt ); } ``` diff --git a/lib/node_modules/@stdlib/array/dtypes/README.md b/lib/node_modules/@stdlib/array/dtypes/README.md index 4225ccbb2078..4f1798cffdc6 100644 --- a/lib/node_modules/@stdlib/array/dtypes/README.md +++ b/lib/node_modules/@stdlib/array/dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); +const dtypes = require( '@stdlib/array/dtypes' ); ``` #### dtypes( \[kind] ) @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/dtypes' ); Returns a list of array data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'float32', 'float64', ... ] ``` @@ -68,7 +68,7 @@ When not provided a data type "kind", the function returns an array containing t To return the subset of data types belonging to a specified data type kind, provide a `kind` argument. ```javascript -var out = dtypes( 'floating_point' ); +const out = dtypes( 'floating_point' ); // returns [...] ``` @@ -89,7 +89,7 @@ The function supports the following data type kinds: Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`). ```javascript -var out = dtypes( 'floating_point_and_generic' ); +const out = dtypes( 'floating_point_and_generic' ); // returns [...] ``` @@ -114,12 +114,12 @@ var out = dtypes( 'floating_point_and_generic' ); ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var dtypes = require( '@stdlib/array/dtypes' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const dtypes = require( '@stdlib/array/dtypes' ); -var isdtype = contains( dtypes() ); +const isdtype = contains( dtypes() ); -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int8' ); diff --git a/lib/node_modules/@stdlib/array/empty-like/README.md b/lib/node_modules/@stdlib/array/empty-like/README.md index fc6db5ab36f1..adea2848cdfe 100644 --- a/lib/node_modules/@stdlib/array/empty-like/README.md +++ b/lib/node_modules/@stdlib/array/empty-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var emptyLike = require( '@stdlib/array/empty-like' ); +const emptyLike = require( '@stdlib/array/empty-like' ); ``` #### emptyLike( x\[, dtype] ) @@ -45,18 +45,18 @@ var emptyLike = require( '@stdlib/array/empty-like' ); Creates an uninitialized array having the same length and [data type][@stdlib/array/dtypes] as a provided array `x`. ```javascript -var x = [ 1, 2, 3, 4, 5 ]; +const x = [ 1, 2, 3, 4, 5 ]; -var arr = emptyLike( x ); +const arr = emptyLike( x ); // returns [ 0, 0, 0, 0, 0 ]; ``` By default, the output array [data type][@stdlib/array/dtypes] is inferred from the provided array `x`. To return an array having a different [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var x = [ 1, 1 ]; +const x = [ 1, 1 ]; -var arr = emptyLike( x, 'int32' ); +const arr = emptyLike( x, 'int32' ); // returns ``` @@ -87,21 +87,18 @@ var arr = emptyLike( x, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); -var emptyLike = require( '@stdlib/array/empty-like' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); +const emptyLike = require( '@stdlib/array/empty-like' ); // Create a zero-filled array: -var x = zeros( 4, 'complex128' ); +const x = zeros( 4, 'complex128' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate empty arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = emptyLike( x, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = emptyLike( x, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/empty/README.md b/lib/node_modules/@stdlib/array/empty/README.md index 1c264d837feb..a513304e29c8 100644 --- a/lib/node_modules/@stdlib/array/empty/README.md +++ b/lib/node_modules/@stdlib/array/empty/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var empty = require( '@stdlib/array/empty' ); +const empty = require( '@stdlib/array/empty' ); ``` #### empty( length\[, dtype] ) @@ -45,14 +45,14 @@ var empty = require( '@stdlib/array/empty' ); Creates an uninitialized array having a specified length. ```javascript -var arr = empty( 2 ); +const arr = empty( 2 ); // returns ``` By default, the output array [data type][@stdlib/array/dtypes] is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var arr = empty( 2, 'int32' ); +const arr = empty( 2, 'int32' ); // returns ``` @@ -83,17 +83,14 @@ var arr = empty( 2, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var empty = require( '@stdlib/array/empty' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const empty = require( '@stdlib/array/empty' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate empty arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = empty( 4, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = empty( 4, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/filled-by/README.md b/lib/node_modules/@stdlib/array/filled-by/README.md index 2d5d9131b6b0..e9a2eabc1319 100644 --- a/lib/node_modules/@stdlib/array/filled-by/README.md +++ b/lib/node_modules/@stdlib/array/filled-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); ``` #### filledarrayBy( \[dtype] ) @@ -45,14 +45,14 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); Creates a filled array having a specified [data type][@stdlib/array/dtypes] `dtype`. ```javascript -var arr = filledarrayBy(); +const arr = filledarrayBy(); // returns ``` By default, the output array [data type][@stdlib/array/dtypes] is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var arr = filledarrayBy( 'int32' ); +const arr = filledarrayBy( 'int32' ); // returns ``` @@ -65,10 +65,10 @@ function constant() { return 1.0; } -var arr1 = filledarrayBy( 5, constant ); +const arr1 = filledarrayBy( 5, constant ); // returns [ 1.0, 1.0, 1.0, 1.0, 1.0 ] -var arr2 = filledarrayBy( 5, 'uint8', constant ); +const arr2 = filledarrayBy( 5, 'uint8', constant ); // returns [ 1, 1, 1, 1, 1 ] ``` @@ -77,7 +77,7 @@ var arr2 = filledarrayBy( 5, 'uint8', constant ); Creates a filled array from another array (or array-like object) according to a provided callback function. ```javascript -var arr0 = { +const arr0 = { '0': 0.5, '1': 0.5, '2': 0.5, @@ -87,19 +87,19 @@ var arr0 = { function clbk1() { return 1.0; } -var arr1 = filledarrayBy( arr0, clbk1 ); +const arr1 = filledarrayBy( arr0, clbk1 ); // returns [ 1.0, 1.0, 1.0 ] function clbk2() { return 2.0; } -var arr2 = filledarrayBy( arr1, clbk2 ); +const arr2 = filledarrayBy( arr1, clbk2 ); // returns [ 2.0, 2.0, 2.0 ] function clbk3() { return 3.0; } -var arr3 = filledarrayBy( arr1, 'int32', clbk3 ); +const arr3 = filledarrayBy( arr1, 'int32', clbk3 ); // returns [ 3, 3, 3 ] ``` @@ -108,20 +108,20 @@ var arr3 = filledarrayBy( arr1, 'int32', clbk3 ); Creates a filled array from an iterable according to a provided callback function. ```javascript -var iterConstant = require( '@stdlib/iter/constant' ); +const iterConstant = require( '@stdlib/iter/constant' ); function clbk() { return 1.0; } -var it = iterConstant( 3.0, { +const it = iterConstant( 3.0, { 'iter': 3 }); -var arr1 = filledarrayBy( it, clbk ); +const arr1 = filledarrayBy( it, clbk ); // returns [ 1.0, 1.0, 1.0 ] -var arr2 = filledarrayBy( it, 'float32', clbk ); +const arr2 = filledarrayBy( it, 'float32', clbk ); // returns [ 1.0, 1.0, 1.0 ] ``` @@ -130,14 +130,14 @@ var arr2 = filledarrayBy( it, 'float32', clbk ); Returns a filled [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer] according to a provided callback function. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); function clbk() { return 1.0; } -var buf = new ArrayBuffer( 32 ); -var arr = filledarrayBy( buf, clbk ); +let buf = new ArrayBuffer( 32 ); +let arr = filledarrayBy( buf, clbk ); // returns [ 1.0, 1.0, 1.0, 1.0 ] buf = new ArrayBuffer( 32 ); @@ -190,21 +190,18 @@ arr = filledarrayBy( buf, 10, 4, 'int16', clbk ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); // Create a pseudorandom number generator: -var rand = discreteUniform( 0, 100 ); +const rand = discreteUniform( 0, 100 ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = filledarrayBy( 10, dt[ i ], rand ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = filledarrayBy( 10, dt[ i ], rand ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/filled/README.md b/lib/node_modules/@stdlib/array/filled/README.md index 79d4611bac80..b90f4abed2bd 100644 --- a/lib/node_modules/@stdlib/array/filled/README.md +++ b/lib/node_modules/@stdlib/array/filled/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filledarray = require( '@stdlib/array/filled' ); +const filledarray = require( '@stdlib/array/filled' ); ``` #### filledarray( \[dtype] ) @@ -45,14 +45,14 @@ var filledarray = require( '@stdlib/array/filled' ); Creates a filled array having a specified [data type][@stdlib/array/dtypes] `dtype`. ```javascript -var arr = filledarray(); +const arr = filledarray(); // returns ``` By default, the output array [data type][@stdlib/array/dtypes] is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var arr = filledarray( 'int32' ); +const arr = filledarray( 'int32' ); // returns ``` @@ -61,10 +61,10 @@ var arr = filledarray( 'int32' ); Returns a filled array having a specified `length`. ```javascript -var arr1 = filledarray( 1.0, 5 ); +const arr1 = filledarray( 1.0, 5 ); // returns [ 1.0, 1.0, 1.0, 1.0, 1.0 ] -var arr2 = filledarray( 1, 5, 'uint8' ); +const arr2 = filledarray( 1, 5, 'uint8' ); // returns [ 1, 1, 1, 1, 1 ] ``` @@ -73,20 +73,20 @@ var arr2 = filledarray( 1, 5, 'uint8' ); Creates a filled array from another array (or array-like object). ```javascript -var arr0 = { +const arr0 = { '0': 0.5, '1': 0.5, '2': 0.5, 'length': 3 }; -var arr1 = filledarray( 1.0, arr0 ); +const arr1 = filledarray( 1.0, arr0 ); // returns [ 1.0, 1.0, 1.0 ] -var arr2 = filledarray( 2.0, arr1 ); +const arr2 = filledarray( 2.0, arr1 ); // returns [ 2.0, 2.0, 2.0 ] -var arr3 = filledarray( 3, arr1, 'int32' ); +const arr3 = filledarray( 3, arr1, 'int32' ); // returns [ 3, 3, 3 ] ``` @@ -95,15 +95,15 @@ var arr3 = filledarray( 3, arr1, 'int32' ); Creates a filled array from an iterable. ```javascript -var iterConstant = require( '@stdlib/iter/constant' ); +const iterConstant = require( '@stdlib/iter/constant' ); -var it = iterConstant( 3.0, { +const it = iterConstant( 3.0, { 'iter': 3 }); -var arr1 = filledarray( 1.0, it ); +const arr1 = filledarray( 1.0, it ); // returns [ 1.0, 1.0, 1.0 ] -var arr2 = filledarray( 1.0, it, 'float32' ); +const arr2 = filledarray( 1.0, it, 'float32' ); // returns [ 1.0, 1.0, 1.0 ] ``` @@ -112,10 +112,10 @@ var arr2 = filledarray( 1.0, it, 'float32' ); Returns a filled [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = filledarray( 1.0, buf ); +let buf = new ArrayBuffer( 32 ); +let arr = filledarray( 1.0, buf ); // returns [ 1.0, 1.0, 1.0, 1.0 ] buf = new ArrayBuffer( 32 ); @@ -164,21 +164,18 @@ arr = filledarray( 1, buf, 10, 4, 'int16' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); -var filledarray = require( '@stdlib/array/filled' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const filledarray = require( '@stdlib/array/filled' ); // Generate a random number: -var r = discreteUniform( 0, 100 ); +const r = discreteUniform( 0, 100 ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = filledarray( r, 10, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = filledarray( r, 10, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md index 985e4560ca9b..dd17fc2f2d47 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md @@ -39,7 +39,7 @@ In contrast to built-in typed array constructors which store values according to ## Usage ```javascript -var fixedEndianFactory = require( '@stdlib/array/fixed-endian-factory' ); +const fixedEndianFactory = require( '@stdlib/array/fixed-endian-factory' ); ``` #### fixedEndianFactory( dtype ) @@ -47,10 +47,10 @@ var fixedEndianFactory = require( '@stdlib/array/fixed-endian-factory' ); Returns a typed array constructor for creating typed arrays having a specified [data type][@stdlib/array/typed-dtypes] and byte order. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); // returns -var Float32ArrayFE = fixedEndianFactory( 'float32' ); +const Float32ArrayFE = fixedEndianFactory( 'float32' ); // returns ``` @@ -63,9 +63,9 @@ var Float32ArrayFE = fixedEndianFactory( 'float32' ); A typed array constructor which returns a typed array representing values stored in a specified byte order. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian' ); +const arr = new Float64ArrayFE( 'little-endian' ); // returns ``` @@ -74,9 +74,9 @@ var arr = new Float64ArrayFE( 'little-endian' ); Returns a typed array having a specified length and byte order. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); +const arr = new Float64ArrayFE( 'little-endian', 5 ); // returns ``` @@ -85,15 +85,15 @@ var arr = new Float64ArrayFE( 'little-endian', 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float64ArrayFE( 'little-endian', arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float64ArrayFE( 'little-endian', arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -102,12 +102,12 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -116,12 +116,12 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); // returns ``` @@ -136,9 +136,9 @@ var arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); Number of bytes per view element. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; +const nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; // returns 8 ``` @@ -149,9 +149,9 @@ var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var str = Float64ArrayFE.name; +const str = Float64ArrayFE.name; // returns 'Float64ArrayFE' ``` @@ -162,10 +162,10 @@ var str = Float64ArrayFE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var buf = arr.buffer; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const buf = arr.buffer; // returns ``` @@ -176,10 +176,10 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var byteLength = arr.byteLength; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const byteLength = arr.byteLength; // returns 40 ``` @@ -190,10 +190,10 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -204,10 +204,10 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -218,10 +218,10 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var len = arr.length; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const len = arr.length; // returns 5 ``` @@ -236,12 +236,12 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -252,12 +252,12 @@ function mapFcn( v ) { return v * 2.0; } -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -274,19 +274,19 @@ function mapFcn( v ) { return v * 2.0; } -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -297,12 +297,12 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = Float64ArrayFE.of( 'little-endian', 1.0, -1.0 ); +const arr = Float64ArrayFE.of( 'little-endian', 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -452,26 +452,26 @@ var count = context.count; Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 10 ); +const arr = new Float64ArrayFE( 'little-endian', 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', 10 ); +const arr = new Float64ArrayFE( 'little-endian', 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -482,12 +482,12 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -506,15 +506,15 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -534,11 +534,11 @@ A few notes: Serializes an array as a string. ```javascript -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -579,18 +579,18 @@ var str = arr.toString(); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var logEach = require( '@stdlib/console/log-each' ); -var fixedEndianFactory = require( '@stdlib/array/fixed-endian-factory' ); +const Float64Array = require( '@stdlib/array/float64' ); +const logEach = require( '@stdlib/console/log-each' ); +const fixedEndianFactory = require( '@stdlib/array/fixed-endian-factory' ); -var Float64ArrayFE = fixedEndianFactory( 'float64' ); +const Float64ArrayFE = fixedEndianFactory( 'float64' ); // Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); +let out = new Float64ArrayFE( 'little-endian', 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float64ArrayFE( 'big-endian', arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/README.md b/lib/node_modules/@stdlib/array/fixed-endian-float32/README.md index e5218ccebff8..a91e9adc9bf1 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/README.md +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/README.md @@ -39,7 +39,7 @@ In contrast to the [`Float32Array`][@stdlib/array/float32] typed array construct ## Usage ```javascript -var Float32ArrayFE = require( '@stdlib/array/fixed-endian-float32' ); +const Float32ArrayFE = require( '@stdlib/array/fixed-endian-float32' ); ``` #### Float32ArrayFE( endianness ) @@ -47,7 +47,7 @@ var Float32ArrayFE = require( '@stdlib/array/fixed-endian-float32' ); A typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in a specified byte order. ```javascript -var arr = new Float32ArrayFE( 'little-endian' ); +const arr = new Float32ArrayFE( 'little-endian' ); // returns ``` @@ -56,7 +56,7 @@ var arr = new Float32ArrayFE( 'little-endian' ); Returns a typed array having a specified length and byte order. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); +const arr = new Float32ArrayFE( 'little-endian', 5 ); // returns ``` @@ -65,13 +65,13 @@ var arr = new Float32ArrayFE( 'little-endian', 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float32ArrayFE( 'little-endian', arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float32ArrayFE( 'little-endian', arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -80,10 +80,10 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var arr = new Float32ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); +const arr = new Float32ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -92,10 +92,10 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float32ArrayFE( 'little-endian', buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float32ArrayFE( 'little-endian', buf, 0, 4 ); // returns ``` @@ -110,7 +110,7 @@ var arr = new Float32ArrayFE( 'little-endian', buf, 0, 4 ); Number of bytes per view element. ```javascript -var nbytes = Float32ArrayFE.BYTES_PER_ELEMENT; +const nbytes = Float32ArrayFE.BYTES_PER_ELEMENT; // returns 4 ``` @@ -121,7 +121,7 @@ var nbytes = Float32ArrayFE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var str = Float32ArrayFE.name; +const str = Float32ArrayFE.name; // returns 'Float32ArrayFE' ``` @@ -132,8 +132,8 @@ var str = Float32ArrayFE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); -var buf = arr.buffer; +const arr = new Float32ArrayFE( 'little-endian', 5 ); +const buf = arr.buffer; // returns ``` @@ -144,8 +144,8 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); -var byteLength = arr.byteLength; +const arr = new Float32ArrayFE( 'little-endian', 5 ); +const byteLength = arr.byteLength; // returns 20 ``` @@ -156,8 +156,8 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float32ArrayFE( 'little-endian', 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -168,8 +168,8 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float32ArrayFE( 'little-endian', 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -180,8 +180,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 5 ); -var len = arr.length; +const arr = new Float32ArrayFE( 'little-endian', 5 ); +const len = arr.length; // returns 5 ``` @@ -196,10 +196,10 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); +const arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -210,10 +210,10 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); +const arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -230,17 +230,17 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float32ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -251,10 +251,10 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float32ArrayFE.of( 'little-endian', 1.0, -1.0 ); +const arr = Float32ArrayFE.of( 'little-endian', 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -265,22 +265,22 @@ var v = arr.get( 0 ); Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 10 ); +const arr = new Float32ArrayFE( 'little-endian', 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Float32ArrayFE( 'little-endian', 10 ); +const arr = new Float32ArrayFE( 'little-endian', 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -291,10 +291,10 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -313,13 +313,13 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -339,9 +339,9 @@ A few notes: Serializes an array as a string. ```javascript -var arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -382,16 +382,16 @@ var str = arr.toString(); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var logEach = require( '@stdlib/console/log-each' ); -var Float32ArrayFE = require( '@stdlib/array/fixed-endian-float32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const logEach = require( '@stdlib/console/log-each' ); +const Float32ArrayFE = require( '@stdlib/array/fixed-endian-float32' ); // Create a typed array by specifying a length: -var out = new Float32ArrayFE( 'little-endian', 3 ); +let out = new Float32ArrayFE( 'little-endian', 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float32ArrayFE( 'big-endian', arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/README.md b/lib/node_modules/@stdlib/array/fixed-endian-float64/README.md index 15f6b978c5eb..e8b1ef342e9d 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/README.md +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/README.md @@ -39,7 +39,7 @@ In contrast to the [`Float64Array`][@stdlib/array/float64] typed array construct ## Usage ```javascript -var Float64ArrayFE = require( '@stdlib/array/fixed-endian-float64' ); +const Float64ArrayFE = require( '@stdlib/array/fixed-endian-float64' ); ``` #### Float64ArrayFE( endianness ) @@ -47,7 +47,7 @@ var Float64ArrayFE = require( '@stdlib/array/fixed-endian-float64' ); A typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. ```javascript -var arr = new Float64ArrayFE( 'little-endian' ); +const arr = new Float64ArrayFE( 'little-endian' ); // returns ``` @@ -56,7 +56,7 @@ var arr = new Float64ArrayFE( 'little-endian' ); Returns a typed array having a specified length and byte order. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); +const arr = new Float64ArrayFE( 'little-endian', 5 ); // returns ``` @@ -65,13 +65,13 @@ var arr = new Float64ArrayFE( 'little-endian', 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float64ArrayFE( 'little-endian', arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float64ArrayFE( 'little-endian', arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -80,10 +80,10 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var arr = new Float64ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -92,10 +92,10 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); // returns ``` @@ -110,7 +110,7 @@ var arr = new Float64ArrayFE( 'little-endian', buf, 0, 4 ); Number of bytes per view element. ```javascript -var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; +const nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; // returns 8 ``` @@ -121,7 +121,7 @@ var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var str = Float64ArrayFE.name; +const str = Float64ArrayFE.name; // returns 'Float64ArrayFE' ``` @@ -132,8 +132,8 @@ var str = Float64ArrayFE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var buf = arr.buffer; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const buf = arr.buffer; // returns ``` @@ -144,8 +144,8 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var byteLength = arr.byteLength; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const byteLength = arr.byteLength; // returns 40 ``` @@ -156,8 +156,8 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -168,8 +168,8 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -180,8 +180,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 5 ); -var len = arr.length; +const arr = new Float64ArrayFE( 'little-endian', 5 ); +const len = arr.length; // returns 5 ``` @@ -196,10 +196,10 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -210,10 +210,10 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -230,17 +230,17 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float64ArrayFE.from( 'little-endian', [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -251,10 +251,10 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float64ArrayFE.of( 'little-endian', 1.0, -1.0 ); +const arr = Float64ArrayFE.of( 'little-endian', 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -265,22 +265,22 @@ var v = arr.get( 0 ); Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 10 ); +const arr = new Float64ArrayFE( 'little-endian', 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Float64ArrayFE( 'little-endian', 10 ); +const arr = new Float64ArrayFE( 'little-endian', 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -291,10 +291,10 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -313,13 +313,13 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -339,9 +339,9 @@ A few notes: Serializes an array as a string. ```javascript -var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -382,16 +382,16 @@ var str = arr.toString(); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var logEach = require( '@stdlib/console/log-each' ); -var Float64ArrayFE = require( '@stdlib/array/fixed-endian-float64' ); +const Float64Array = require( '@stdlib/array/float64' ); +const logEach = require( '@stdlib/console/log-each' ); +const Float64ArrayFE = require( '@stdlib/array/fixed-endian-float64' ); // Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); +let out = new Float64ArrayFE( 'little-endian', 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float64ArrayFE( 'big-endian', arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/float32/README.md b/lib/node_modules/@stdlib/array/float32/README.md index e48de663268f..b52cb77b7a80 100644 --- a/lib/node_modules/@stdlib/array/float32/README.md +++ b/lib/node_modules/@stdlib/array/float32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); ``` #### Float32Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Float32Array(); +const arr = new Float32Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Float32Array( 5 ); +const arr = new Float32Array( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float32Array( arr1 ); +const arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float32Array( arr1 ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr = new Float32Array( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 16 ); -var arr = new Float32Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 16 ); +const arr = new Float32Array( buf, 0, 4 ); // returns [ 0.0, 0.0, 0.0, 0.0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Float32Array.BYTES_PER_ELEMENT; +const nbytes = Float32Array.BYTES_PER_ELEMENT; // returns 4 ``` @@ -127,7 +127,7 @@ var nbytes = Float32Array.BYTES_PER_ELEMENT; ```javascript -var str = Float32Array.name; +const str = Float32Array.name; // returns 'Float32Array' ``` @@ -140,8 +140,8 @@ var str = Float32Array.name; ```javascript -var arr = new Float32Array( 5 ); -var buf = arr.buffer; +const arr = new Float32Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Float32Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Float32Array( 5 ); +const byteLength = arr.byteLength; // returns 20 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Float32Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float32Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Float32Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float32Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Float32Array( 5 ); -var len = arr.length; +const arr = new Float32Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -214,7 +214,7 @@ Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Float32Array.from( [ 1.0, 2.0 ] ); +const arr = Float32Array.from( [ 1.0, 2.0 ] ); // returns [ 1.0, 2.0 ] ``` @@ -227,7 +227,7 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float32Array.from( [ 1.0, 2.0 ], mapFcn ); +const arr = Float32Array.from( [ 1.0, 2.0 ], mapFcn ); // returns [ 2.0, 4.0 ] ``` @@ -246,14 +246,14 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float32Array.from( [ 1.0, 2.0 ], mapFcn, ctx ); +const arr = Float32Array.from( [ 1.0, 2.0 ], mapFcn, ctx ); // returns [ 2.0, 4.0 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -266,7 +266,7 @@ Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float32Array.of( 1.0, 2.0 ); +const arr = Float32Array.of( 1.0, 2.0 ); // returns [ 1.0, 2.0 ] ``` @@ -279,12 +279,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4.0 v = arr[ 1 ]; @@ -296,12 +296,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1.0 v = arr[ 4 ]; @@ -313,12 +313,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1.0 v = arr[ 4 ]; @@ -334,19 +334,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1.0 ] v = it.next().value; // returns [ 1, 2.0 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -363,9 +363,9 @@ function predicate( v ) { return ( v <= 1.0 ); } -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -385,16 +385,16 @@ function predicate( v ) { return ( v >= 1.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -407,12 +407,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Float32Array( 2 ); +const arr = new Float32Array( 2 ); // Set all array elements to the same value: arr.fill( 2.0 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2.0 v = arr[ 1 ]; @@ -442,12 +442,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Float32Array( 2 ); +const arr = new Float32Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2.0, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2.0 v = arr[ 1 ]; @@ -467,9 +467,9 @@ function predicate( v ) { return ( v >= 2.0 ); } -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2.0, 3.0 ] ``` @@ -482,9 +482,9 @@ function predicate( v ) { return ( v >= 10.0 ); } -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -504,15 +504,15 @@ function predicate( v ) { return ( v >= 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -529,9 +529,9 @@ function predicate( v ) { return ( v > 2.0 ); } -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3.0 ``` @@ -544,9 +544,9 @@ function predicate( v ) { return ( v < 1.0 ); } -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -566,16 +566,16 @@ function predicate( v ) { return ( v > 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3.0 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -592,9 +592,9 @@ function predicate( v ) { return ( v >= 3.0 ); } -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -607,9 +607,9 @@ function predicate( v ) { return ( v < 1.0 ); } -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -629,16 +629,16 @@ function predicate( v ) { return ( v >= 3.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -651,9 +651,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -683,15 +683,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -704,9 +704,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 3.0 ); +let bool = arr.includes( 3.0 ); // returns true bool = arr.includes( 0.0 ); @@ -718,9 +718,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 1.0, 1 ); +const bool = arr.includes( 1.0, 1 ); // returns false ``` @@ -729,9 +729,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 1.0, -2 ); +const bool = arr.includes( 1.0, -2 ); // returns false ``` @@ -746,9 +746,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 3.0 ); +let idx = arr.indexOf( 3.0 ); // returns 2 idx = arr.indexOf( 0.0 ); @@ -760,9 +760,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 1.0, 1 ); +const idx = arr.indexOf( 1.0, 1 ); // returns -1 ``` @@ -771,9 +771,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 1.0, -2 ); +const idx = arr.indexOf( 1.0, -2 ); // returns -1 ``` @@ -788,9 +788,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -799,9 +799,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -814,19 +814,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -839,9 +839,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0 ); +let idx = arr.lastIndexOf( 0.0 ); // returns 3 idx = arr.lastIndexOf( 3.0 ); @@ -853,9 +853,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0, 2 ); +const idx = arr.lastIndexOf( 0.0, 2 ); // returns 1 ``` @@ -864,9 +864,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0, -3 ); +const idx = arr.lastIndexOf( 0.0, -3 ); // returns 1 ``` @@ -885,9 +885,9 @@ function fcn( v ) { return v * 2.0; } -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2.0, 4.0, 6.0 ] ``` @@ -907,15 +907,15 @@ function fcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -932,9 +932,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12.0 ``` @@ -949,9 +949,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn, 0.0 ); +const v = arr.reduce( fcn, 0.0 ); // returns 14.0 ``` @@ -975,9 +975,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8.0 ``` @@ -992,9 +992,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float32Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn, 0.0 ); +const v = arr.reduce( fcn, 0.0 ); // returns 14.0 ``` @@ -1014,12 +1014,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Float32Array( [ 2.0, 0.0, 3.0 ] ); +const arr = new Float32Array( [ 2.0, 0.0, 3.0 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3.0 v = arr[ 1 ]; @@ -1038,13 +1038,13 @@ Sets array elements. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); // returns [ 1.0, 2.0, 3.0 ] // Set the first two array elements: arr.set( [ 4.0, 5.0 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4.0 v = arr[ 1 ]; @@ -1056,13 +1056,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); // returns [ 1.0, 2.0, 3.0 ] // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4.0 v = arr[ 2 ]; @@ -1078,17 +1078,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1103,14 +1103,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2.0 v = arr2[ 1 ]; @@ -1122,14 +1122,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1141,14 +1141,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1168,9 +1168,9 @@ function predicate( v ) { return ( v >= 2.0 ); } -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1190,16 +1190,16 @@ function predicate( v ) { return ( v >= 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float32Array( [ 1.0, 1.0 ] ); +const arr = new Float32Array( [ 1.0, 1.0 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1212,12 +1212,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Float32Array( [ 2.0, 3.0, 0.0 ] ); +const arr = new Float32Array( [ 2.0, 3.0, 0.0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0.0 v = arr[ 1 ]; @@ -1236,12 +1236,12 @@ function descending( a, b ) { return b - a; } -var arr = new Float32Array( [ 2.0, 3.0, 0.0 ] ); +const arr = new Float32Array( [ 2.0, 3.0, 0.0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3.0 v = arr[ 1 ]; @@ -1266,12 +1266,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1.0, 2.0, 3.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2.0, 3.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1.0, 2.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,12 +1308,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1.0, 2.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1322,9 +1322,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1337,9 +1337,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1352,9 +1352,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1367,19 +1367,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Float32Array( [ 1.0, 2.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns 2.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1406,14 +1406,11 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ctor = require( '@stdlib/array/float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const ctor = require( '@stdlib/array/float32' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/float64/README.md b/lib/node_modules/@stdlib/array/float64/README.md index 9e2abee7bc66..0c0bb8f1552b 100644 --- a/lib/node_modules/@stdlib/array/float64/README.md +++ b/lib/node_modules/@stdlib/array/float64/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); ``` #### Float64Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Float64Array(); +const arr = new Float64Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Float64Array( 5 ); +const arr = new Float64Array( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float64Array( arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float64Array( arr1 ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Float64Array( [ 0.5, 0.5, 0.5 ] ); +const arr = new Float64Array( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float64Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float64Array( buf, 0, 4 ); // returns [ 0.0, 0.0, 0.0, 0.0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Float64Array.BYTES_PER_ELEMENT; +const nbytes = Float64Array.BYTES_PER_ELEMENT; // returns 8 ``` @@ -127,7 +127,7 @@ var nbytes = Float64Array.BYTES_PER_ELEMENT; ```javascript -var str = Float64Array.name; +const str = Float64Array.name; // returns 'Float64Array' ``` @@ -140,8 +140,8 @@ var str = Float64Array.name; ```javascript -var arr = new Float64Array( 5 ); -var buf = arr.buffer; +const arr = new Float64Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Float64Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Float64Array( 5 ); +const byteLength = arr.byteLength; // returns 40 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Float64Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float64Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Float64Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float64Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Float64Array( 5 ); -var len = arr.length; +const arr = new Float64Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Float64Array.from( [ 1.0, -1.0 ] ); +const arr = Float64Array.from( [ 1.0, -1.0 ] ); // returns [ 1.0, -1.0 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn ); +const arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn ); // returns [ 2.0, -2.0 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn, ctx ); // returns [ 2.0, -2.0 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float64Array.of( 1.0, -1.0 ); +const arr = Float64Array.of( 1.0, -1.0 ); // returns [ 1.0, -1.0 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4.0 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1.0 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1.0 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1.0 ] v = it.next().value; // returns [ 1, 2.0 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1.0 ); } -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Float64Array( 2 ); +const arr = new Float64Array( 2 ); // Set all array elements to the same value: arr.fill( 2.0 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2.0 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Float64Array( 2 ); +const arr = new Float64Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2.0, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2.0 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2.0 ); } -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2.0, 3.0 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10.0 ); } -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2.0 ); } -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3.0 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1.0 ); } -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3.0 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3.0 ); } -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1.0 ); } -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 3.0 ); +let bool = arr.includes( 3.0 ); // returns true bool = arr.includes( 0.0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 1.0, 1 ); +const bool = arr.includes( 1.0, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var bool = arr.includes( 1.0, -2 ); +const bool = arr.includes( 1.0, -2 ); // returns false ``` @@ -738,9 +738,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 3.0 ); +let idx = arr.indexOf( 3.0 ); // returns 2 idx = arr.indexOf( 0.0 ); @@ -752,9 +752,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 1.0, 1 ); +const idx = arr.indexOf( 1.0, 1 ); // returns -1 ``` @@ -763,9 +763,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var idx = arr.indexOf( 1.0, -2 ); +const idx = arr.indexOf( 1.0, -2 ); // returns -1 ``` @@ -780,9 +780,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -791,9 +791,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -806,19 +806,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -831,9 +831,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0 ); +let idx = arr.lastIndexOf( 0.0 ); // returns 3 idx = arr.lastIndexOf( 3.0 ); @@ -845,9 +845,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0, 2 ); +const idx = arr.lastIndexOf( 0.0, 2 ); // returns 1 ``` @@ -856,9 +856,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); +const arr = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 1.0 ] ); -var idx = arr.lastIndexOf( 0.0, -3 ); +const idx = arr.lastIndexOf( 0.0, -3 ); // returns 1 ``` @@ -877,9 +877,9 @@ function fcn( v ) { return v * 2.0; } -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2.0, 4.0, 6.0 ] ``` @@ -899,15 +899,15 @@ function fcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -924,9 +924,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12.0 ``` @@ -941,9 +941,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn, 0.0 ); +const v = arr.reduce( fcn, 0.0 ); // returns 14.0 ``` @@ -967,9 +967,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8.0 ``` @@ -984,9 +984,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); +const arr = new Float64Array( [ 2.0, 1.0, 3.0 ] ); -var v = arr.reduce( fcn, 0.0 ); +const v = arr.reduce( fcn, 0.0 ); // returns 14.0 ``` @@ -1006,12 +1006,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Float64Array( [ 2.0, 0.0, 3.0 ] ); +const arr = new Float64Array( [ 2.0, 0.0, 3.0 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3.0 v = arr[ 1 ]; @@ -1030,13 +1030,13 @@ Sets array elements. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); // returns [ 1.0, 2.0, 3.0 ] // Set the first two array elements: arr.set( [ 4.0, 5.0 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4.0 v = arr[ 1 ]; @@ -1048,13 +1048,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); // returns [ 1.0, 2.0, 3.0 ] // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4.0 v = arr[ 2 ]; @@ -1070,17 +1070,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1095,14 +1095,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2.0 v = arr2[ 1 ]; @@ -1114,14 +1114,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1133,14 +1133,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1.0 v = arr2[ 1 ]; @@ -1160,9 +1160,9 @@ function predicate( v ) { return ( v >= 2.0 ); } -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1182,16 +1182,16 @@ function predicate( v ) { return ( v >= 2.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Float64Array( [ 1.0, 1.0 ] ); +const arr = new Float64Array( [ 1.0, 1.0 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1204,12 +1204,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Float64Array( [ 2.0, 3.0, 0.0 ] ); +const arr = new Float64Array( [ 2.0, 3.0, 0.0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0.0 v = arr[ 1 ]; @@ -1228,12 +1228,12 @@ function descending( a, b ) { return b - a; } -var arr = new Float64Array( [ 2.0, 3.0, 0.0 ] ); +const arr = new Float64Array( [ 2.0, 3.0, 0.0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3.0 v = arr[ 1 ]; @@ -1258,12 +1258,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1.0, 2.0, 3.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1272,12 +1272,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2.0, 3.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1286,12 +1286,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1.0, 2.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1300,12 +1300,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1.0, 2.0 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1314,9 +1314,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr1 = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1329,9 +1329,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1344,9 +1344,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1359,19 +1359,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Float64Array( [ 1.0, 2.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns 2.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1398,14 +1398,11 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ctor = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/base/randu' ); +const ctor = require( '@stdlib/array/float64' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/from-iterator/README.md b/lib/node_modules/@stdlib/array/from-iterator/README.md index fbf7df28cb2d..c040af63a2c2 100644 --- a/lib/node_modules/@stdlib/array/from-iterator/README.md +++ b/lib/node_modules/@stdlib/array/from-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterator2array = require( '@stdlib/array/from-iterator' ); +const iterator2array = require( '@stdlib/array/from-iterator' ); ``` #### iterator2array( iterator\[, out]\[, mapFcn\[, thisArg]] ) @@ -45,41 +45,41 @@ var iterator2array = require( '@stdlib/array/from-iterator' ); Creates (or fills) an array from an `iterator`. ```javascript -var randu = require( '@stdlib/random/iter/randu' ); +const randu = require( '@stdlib/random/iter/randu' ); -var opts = { +const opts = { 'iter': 10 }; -var arr = iterator2array( randu( opts ) ); +const arr = iterator2array( randu( opts ) ); // returns ``` By default, the function creates and fills a generic `array`. To fill an array-like `object`, provide an `out` argument. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); -var arr = iterator2array( randu(), out ); +const arr = iterator2array( randu(), out ); // returns -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` To invoke a function for each iterated value, provide a callback function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v * 10.0; } -var arr = iterator2array( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); +const arr = iterator2array( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); // returns [ 10.0, 20.0, 30.0, 40.0 ] ``` @@ -89,36 +89,36 @@ The invoked function is provided two arguments: - **index**: iterated value index. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); function fcn( v, i ) { return v * (i+1); } -var arr = iterator2array( randu(), new Float64Array( 10 ), fcn ); +const arr = iterator2array( randu(), new Float64Array( 10 ), fcn ); // returns ``` To set the callback function execution context, provide a `thisArg`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); function fcn( v ) { this.count += 1; return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = iterator2array( randu(), new Float64Array( 10 ), fcn, ctx ); +const arr = iterator2array( randu(), new Float64Array( 10 ), fcn, ctx ); // returns -var count = ctx.count; +const count = ctx.count; // returns 10 ``` @@ -149,29 +149,24 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); -var iterator2array = require( '@stdlib/array/from-iterator' ); - -var opts; -var arr; -var it; -var i; +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterator2array = require( '@stdlib/array/from-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an iterator for generating uniformly distributed pseudorandom numbers: -opts = { +const opts = { 'iter': 10 }; -it = randu( opts ); +const it = randu( opts ); // Fill an array with scaled iterator values: -arr = iterator2array( it, new Float64Array( opts.iter ), scale ); +const arr = iterator2array( it, new Float64Array( opts.iter ), scale ); -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); } ``` diff --git a/lib/node_modules/@stdlib/array/from-scalar/README.md b/lib/node_modules/@stdlib/array/from-scalar/README.md index fca2bdcd4e7a..f94f596c6c24 100644 --- a/lib/node_modules/@stdlib/array/from-scalar/README.md +++ b/lib/node_modules/@stdlib/array/from-scalar/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var scalar2array = require( '@stdlib/array/from-scalar' ); +const scalar2array = require( '@stdlib/array/from-scalar' ); ``` #### scalar2array( value\[, dtype] ) @@ -45,7 +45,7 @@ var scalar2array = require( '@stdlib/array/from-scalar' ); Returns a single-element array containing a provided scalar value. ```javascript -var x = scalar2array( 3.0 ); +const x = scalar2array( 3.0 ); // returns [ 3.0 ] ``` @@ -60,7 +60,7 @@ If not provided a `dtype` argument and `value` To explicitly specify the [data type][@stdlib/array/dtypes] of the returned array, provide a `dtype` argument. ```javascript -var x = scalar2array( 3.0, 'float32' ); +const x = scalar2array( 3.0, 'float32' ); // returns [ 3.0 ] ``` @@ -90,10 +90,10 @@ var x = scalar2array( 3.0, 'float32' ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var array2scalar = require( '@stdlib/array/from-scalar' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const array2scalar = require( '@stdlib/array/from-scalar' ); -var x = array2scalar( 3.0 ); +let x = array2scalar( 3.0 ); // returns [ 3.0 ] x = array2scalar( 3, 'int32' ); diff --git a/lib/node_modules/@stdlib/array/full-like/README.md b/lib/node_modules/@stdlib/array/full-like/README.md index dab4e779d603..c0fd02fb997a 100644 --- a/lib/node_modules/@stdlib/array/full-like/README.md +++ b/lib/node_modules/@stdlib/array/full-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fullLike = require( '@stdlib/array/full-like' ); +const fullLike = require( '@stdlib/array/full-like' ); ``` #### fullLike( x, value\[, dtype] ) @@ -45,18 +45,18 @@ var fullLike = require( '@stdlib/array/full-like' ); Creates a filled array having the same length and [data type][@stdlib/array/dtypes] as a provided array `x`. ```javascript -var x = [ 1, 2, 3, 4, 5 ]; +const x = [ 1, 2, 3, 4, 5 ]; -var arr = fullLike( x, 1 ); +const arr = fullLike( x, 1 ); // returns [ 1, 1, 1, 1, 1 ] ``` By default, the output array [data type][@stdlib/array/dtypes] is inferred from the provided array `x`. To return an array having a different [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var x = [ 1, 1 ]; +const x = [ 1, 1 ]; -var arr = fullLike( x, 1, 'int32' ); +const arr = fullLike( x, 1, 'int32' ); // returns [ 1, 1 ] ``` @@ -85,21 +85,18 @@ var arr = fullLike( x, 1, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); -var fullLike = require( '@stdlib/array/full-like' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); +const fullLike = require( '@stdlib/array/full-like' ); // Create a zero-filled array: -var x = zeros( 4, 'complex128' ); +const x = zeros( 4, 'complex128' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - y = fullLike( x, 1.0, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const y = fullLike( x, 1.0, dt[ i ] ); console.log( y ); } ``` diff --git a/lib/node_modules/@stdlib/array/full/README.md b/lib/node_modules/@stdlib/array/full/README.md index b172fdcfdd15..779727973438 100644 --- a/lib/node_modules/@stdlib/array/full/README.md +++ b/lib/node_modules/@stdlib/array/full/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var full = require( '@stdlib/array/full' ); +const full = require( '@stdlib/array/full' ); ``` #### full( length, value\[, dtype] ) @@ -45,14 +45,14 @@ var full = require( '@stdlib/array/full' ); Creates a filled array having a specified length. ```javascript -var arr = full( 2, 1.0 ); +const arr = full( 2, 1.0 ); // returns [ 1.0, 1.0 ] ``` By default, the output array [data type][@stdlib/array/dtypes] is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative [data type][@stdlib/array/dtypes], provide a `dtype` argument. ```javascript -var arr = full( 2, 1, 'int32' ); +const arr = full( 2, 1, 'int32' ); // returns [ 1, 1 ] ``` @@ -77,17 +77,14 @@ var arr = full( 2, 1, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); -var full = require( '@stdlib/array/full' ); +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const full = require( '@stdlib/array/full' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = full( 5, i+1, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = full( 5, i+1, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/incrspace/README.md b/lib/node_modules/@stdlib/array/incrspace/README.md index 7822fcbfbdc9..423082f5ad30 100644 --- a/lib/node_modules/@stdlib/array/incrspace/README.md +++ b/lib/node_modules/@stdlib/array/incrspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrspace = require( '@stdlib/array/incrspace' ); +const incrspace = require( '@stdlib/array/incrspace' ); ``` #### incrspace( start, stop\[, increment] ) @@ -35,7 +35,7 @@ var incrspace = require( '@stdlib/array/incrspace' ); Generates a linearly spaced numeric `array`. If an `increment` is not provided, the default `increment` is `1`. ```javascript -var arr = incrspace( 0, 11, 2 ); +const arr = incrspace( 0, 11, 2 ); // returns [ 0, 2, 4, 6, 8, 10 ] ``` @@ -50,7 +50,7 @@ var arr = incrspace( 0, 11, 2 ); - The output `array` is guaranteed to include the `start` value but does **not** include the `stop` value. Beware that values subsequent to the `start` value are subject to floating-point errors. Hence, ```javascript - var arr = incrspace( 0.1, 0.5, 0.2 ); + const arr = incrspace( 0.1, 0.5, 0.2 ); // returns [ 0.1, ~0.3 ] ``` @@ -59,17 +59,14 @@ var arr = incrspace( 0, 11, 2 ); If you desire more control over element precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); - var arr; - var out; - var i; + const roundn = require( '@stdlib/math/base/special/roundn' ); // Create an array subject to floating-point errors: - arr = incrspace( 0, 1.01, 0.02 ); + const arr = incrspace( 0, 1.01, 0.02 ); // Round each value to the nearest hundredth: - out = []; - for ( i = 0; i < arr.length; i++ ) { + const out = []; + for ( let i = 0; i < arr.length; i++ ) { out.push( roundn( arr[ i ], -2 ) ); } @@ -87,12 +84,11 @@ var arr = incrspace( 0, 11, 2 ); ```javascript -var incrspace = require( '@stdlib/array/incrspace' ); -var out; +const incrspace = require( '@stdlib/array/incrspace' ); // Default behavior: console.log( '\nDefault:' ); -out = incrspace( 0, 10 ); +let out = incrspace( 0, 10 ); console.log( out.join( '\n' ) ); // Specify increment: diff --git a/lib/node_modules/@stdlib/array/index/README.md b/lib/node_modules/@stdlib/array/index/README.md index 7bd412f23cb3..b25866d64064 100644 --- a/lib/node_modules/@stdlib/array/index/README.md +++ b/lib/node_modules/@stdlib/array/index/README.md @@ -30,23 +30,23 @@ In JavaScript, only strings and symbols are valid property names. When providing ```javascript // Create an array: -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; // Define a list of indices for elements we want to retrieve from `x`: -var y = [ 0, 2 ]; +const y = [ 0, 2 ]; // Attempt to retrieve the desired elements: -var v = x[ y ]; // => desired: [ 1, 3 ] +const v = x[ y ]; // => desired: [ 1, 3 ] // returns undefined ``` is equivalent to ```javascript -var x = [ 1, 2, 3, 4 ]; -var y = [ 0, 2 ]; +const x = [ 1, 2, 3, 4 ]; +const y = [ 0, 2 ]; -var v = x[ y.toString() ]; +let v = x[ y.toString() ]; // returns undefined // ...which is equivalent to: @@ -71,7 +71,7 @@ Specifically, instantiated `ArrayIndex` objects are assigned a unique identifier ## Usage ```javascript -var ArrayIndex = require( '@stdlib/array/index' ); +const ArrayIndex = require( '@stdlib/array/index' ); ``` @@ -81,9 +81,9 @@ var ArrayIndex = require( '@stdlib/array/index' ); Wraps a provided array as an array index object. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var idx = new ArrayIndex( x ); +const idx = new ArrayIndex( x ); // returns ``` @@ -101,16 +101,16 @@ By default, an `ArrayIndex` is invalidated and removed from an internal cache im One may, however, want to reuse an `ArrayIndex` instance to avoid additional memory allocation. In order to persist an `ArrayIndex` and prevent automatic cache invalidation, set the `persist` option to `true`. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var idx = new ArrayIndex( x, { +const idx = new ArrayIndex( x, { 'persist': true }); // returns // ... -var o = ArrayIndex.get( idx.id ); +let o = ArrayIndex.get( idx.id ); // returns {...} // ... @@ -137,7 +137,7 @@ In order to **prevent** memory leaks when working with persisted `ArrayIndex` in String value of the `ArrayIndex` constructor name. ```javascript -var str = ArrayIndex.name; +const str = ArrayIndex.name; // returns 'ArrayIndex' ``` @@ -148,12 +148,12 @@ var str = ArrayIndex.name; **Read-only** property returning the underlying array associated with an `ArrayIndex` instance. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var v = idx.data; +const v = idx.data; // returns [ 1, 0, 1, 0 ] ``` @@ -164,12 +164,12 @@ var v = idx.data; **Read-only** property returning the data type of the underlying array associated with an `ArrayIndex` instance. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var dt = idx.dtype; +const dt = idx.dtype; // returns 'uint8' ``` @@ -180,12 +180,12 @@ var dt = idx.dtype; **Read-only** property returning the unique identifier associated with an `ArrayIndex` instance. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var id = idx.id; +const id = idx.id; // returns ``` @@ -198,12 +198,12 @@ The identifier should be used by `ArrayIndex` consumers to resolve the underlyin **Read-only** property returning a boolean indicating whether an `ArrayIndex` instance is actively cached. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var out = idx.isCached; +const out = idx.isCached; // returns true ``` @@ -214,12 +214,12 @@ var out = idx.isCached; **Read-only** property returning the array index type. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var t = idx.type; +const t = idx.type; // returns 'mask' ``` @@ -240,16 +240,16 @@ The following array index types are supported: Frees the `ArrayIndex` associated with a provided identifier. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ), { +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ), { 'persist': true }); // returns // ... -var out = ArrayIndex.free( idx.id ); +const out = ArrayIndex.free( idx.id ); // returns true ``` @@ -262,25 +262,25 @@ Once an `ArrayIndex` is freed, the instance is invalid and can no longer be used Returns the array associated with the `ArrayIndex` having a provided identifier. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ), { +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ), { 'persist': true }); // returns // ... -var o = ArrayIndex.get( idx.id ); +const o = ArrayIndex.get( idx.id ); // returns {...} -var d = o.data; +const d = o.data; // returns [ 1, 0, 1, 0 ] -var t = o.type; +const t = o.type; // returns 'mask' -var dt = o.dtype; +const dt = o.dtype; // returns 'uint8' ``` @@ -299,12 +299,12 @@ If the `ArrayIndex` associated with a provided identifier was not explicitly per Serializes an `ArrayIndex` as a string. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var str = idx.toString(); +const str = idx.toString(); // e.g., 'ArrayIndex<0>' ``` @@ -317,12 +317,12 @@ An `ArrayIndex` is intended to be an opaque object used by objects supporting "f Serializes an `ArrayIndex` as a [JSON][json] object. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); +const idx = new ArrayIndex( new Uint8Array( [ 1, 0, 1, 0 ] ) ); // returns -var o = idx.toJSON(); +const o = idx.toJSON(); // returns { 'type': 'ArrayIndex', 'data': { 'type': 'Uint8Array', 'data': [ 1, 0, 1, 0 ] } } ``` @@ -347,12 +347,12 @@ var o = idx.toJSON(); - Because non-persisted `ArrayIndex` instances are freed after first use, in order to avoid holding onto memory and to allow garbage collection, one should avoid scenarios in which an `ArrayIndex` is never used. For example, ```javascript - var Uint8Array = require( '@stdlib/array/uint8' ); + const Uint8Array = require( '@stdlib/array/uint8' ); - var data = new Uint8Array( [ 1, 0, 0, 0 ] ); - var idx = new ArrayIndex( data ); + const data = new Uint8Array( [ 1, 0, 0, 0 ] ); + const idx = new ArrayIndex( data ); - var o; + let o; if ( data[ 0 ] === 0 ) { // Do something with `idx`... o = ArrayIndex.get( idx.id ); @@ -364,12 +364,12 @@ var o = idx.toJSON(); will leak memory as `idx` is only consumed within an `if` block which never evaluates. In such scenarios, one should either refactor to avoid inadvertently holding onto memory or explicitly free the `ArrayIndex`. ```javascript - var Uint8Array = require( '@stdlib/array/uint8' ); + const Uint8Array = require( '@stdlib/array/uint8' ); - var data = new Uint8Array( [ 1, 0, 0, 0 ] ); - var idx = new ArrayIndex( data ); + const data = new Uint8Array( [ 1, 0, 0, 0 ] ); + const idx = new ArrayIndex( data ); - var o; + let o; if ( data[ 0 ] === 0 ) { // Do something with `idx`... o = ArrayIndex.get( idx.id ); @@ -395,16 +395,16 @@ var o = idx.toJSON(); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var Int32Array = require( '@stdlib/array/int32' ); -var BooleanArray = require( '@stdlib/array/bool' ); -var ArrayIndex = require( '@stdlib/array/index' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Int32Array = require( '@stdlib/array/int32' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const ArrayIndex = require( '@stdlib/array/index' ); -var x = new Uint8Array( [ 1, 0, 1, 0 ] ); -var i = new ArrayIndex( x ); +let x = new Uint8Array( [ 1, 0, 1, 0 ] ); +let i = new ArrayIndex( x ); // returns -var o = ArrayIndex.get( i.id ); +let o = ArrayIndex.get( i.id ); // returns {...} console.log( 'Type: %s. Data type: %s.', o.type, o.dtype ); diff --git a/lib/node_modules/@stdlib/array/int16/README.md b/lib/node_modules/@stdlib/array/int16/README.md index 1a577098baee..b856a04db553 100644 --- a/lib/node_modules/@stdlib/array/int16/README.md +++ b/lib/node_modules/@stdlib/array/int16/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); ``` #### Int16Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Int16Array(); +const arr = new Int16Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Int16Array( 5 ); +const arr = new Int16Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Int16Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Int16Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Int16Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Int16Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 8 ); -var arr = new Int16Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 8 ); +const arr = new Int16Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Int16Array.BYTES_PER_ELEMENT; +const nbytes = Int16Array.BYTES_PER_ELEMENT; // returns 2 ``` @@ -127,7 +127,7 @@ var nbytes = Int16Array.BYTES_PER_ELEMENT; ```javascript -var str = Int16Array.name; +const str = Int16Array.name; // returns 'Int16Array' ``` @@ -140,8 +140,8 @@ var str = Int16Array.name; ```javascript -var arr = new Int16Array( 5 ); -var buf = arr.buffer; +const arr = new Int16Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Int16Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Int16Array( 5 ); +const byteLength = arr.byteLength; // returns 10 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Int16Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Int16Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Int16Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Int16Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 2 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Int16Array( 5 ); -var len = arr.length; +const arr = new Int16Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Int16Array.from( [ 1, 2 ] ); +const arr = Int16Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Int16Array.from( [ 1, 2 ], mapFcn ); +const arr = Int16Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Int16Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Int16Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Int16Array.of( 1, 2 ); +const arr = Int16Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Int16Array( 2 ); +const arr = new Int16Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Int16Array( 2 ); +const arr = new Int16Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int16Array( [ 2, 1, 3 ] ); +const arr = new Int16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int16Array( [ 2, 1, 3 ] ); +const arr = new Int16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int16Array( [ 2, 1, 3 ] ); +const arr = new Int16Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int16Array( [ 2, 1, 3 ] ); +const arr = new Int16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Int16Array( [ 2, 0, 3 ] ); +const arr = new Int16Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int16Array( [ 1, 1 ] ); +const arr = new Int16Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Int16Array( [ 2, 3, 0 ] ); +const arr = new Int16Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Int16Array( [ 2, 3, 0 ] ); +const arr = new Int16Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Int16Array( [ 1, 2, 3 ] ); +const arr1 = new Int16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Int16Array( [ 1, 2, 3 ] ); +const arr = new Int16Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Int16Array( [ 1, 2 ] ); +const arr = new Int16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/int16' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/int16' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/int32/README.md b/lib/node_modules/@stdlib/array/int32/README.md index c9215ea7a37e..c5a937ad3b49 100644 --- a/lib/node_modules/@stdlib/array/int32/README.md +++ b/lib/node_modules/@stdlib/array/int32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); ``` #### Int32Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Int32Array(); +const arr = new Int32Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Int32Array( 5 ); +const arr = new Int32Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Int32Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Int32Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Int32Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Int32Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 16 ); -var arr = new Int32Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 16 ); +const arr = new Int32Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Int32Array.BYTES_PER_ELEMENT; +const nbytes = Int32Array.BYTES_PER_ELEMENT; // returns 4 ``` @@ -127,7 +127,7 @@ var nbytes = Int32Array.BYTES_PER_ELEMENT; ```javascript -var str = Int32Array.name; +const str = Int32Array.name; // returns 'Int32Array' ``` @@ -140,8 +140,8 @@ var str = Int32Array.name; ```javascript -var arr = new Int32Array( 5 ); -var buf = arr.buffer; +const arr = new Int32Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Int32Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Int32Array( 5 ); +const byteLength = arr.byteLength; // returns 20 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Int32Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Int32Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Int32Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Int32Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Int32Array( 5 ); -var len = arr.length; +const arr = new Int32Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Int32Array.from( [ 1, 2 ] ); +const arr = Int32Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Int32Array.from( [ 1, 2 ], mapFcn ); +const arr = Int32Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Int32Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Int32Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Int32Array.of( 1, 2 ); +const arr = Int32Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Int32Array( 2 ); +const arr = new Int32Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Int32Array( 2 ); +const arr = new Int32Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int32Array( [ 2, 1, 3 ] ); +const arr = new Int32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int32Array( [ 2, 1, 3 ] ); +const arr = new Int32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int32Array( [ 2, 1, 3 ] ); +const arr = new Int32Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int32Array( [ 2, 1, 3 ] ); +const arr = new Int32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Int32Array( [ 2, 0, 3 ] ); +const arr = new Int32Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int32Array( [ 1, 1 ] ); +const arr = new Int32Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Int32Array( [ 2, 3, 0 ] ); +const arr = new Int32Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Int32Array( [ 2, 3, 0 ] ); +const arr = new Int32Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Int32Array( [ 1, 2, 3 ] ); +const arr1 = new Int32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Int32Array( [ 1, 2, 3 ] ); +const arr = new Int32Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Int32Array( [ 1, 2 ] ); +const arr = new Int32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/int32' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/int32' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/int8/README.md b/lib/node_modules/@stdlib/array/int8/README.md index 545894ac08e9..82c97a892b77 100644 --- a/lib/node_modules/@stdlib/array/int8/README.md +++ b/lib/node_modules/@stdlib/array/int8/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); ``` #### Int8Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Int8Array(); +const arr = new Int8Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Int8Array( 5 ); +const arr = new Int8Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Int8Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Int8Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Int8Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Int8Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 4 ); -var arr = new Int8Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 4 ); +const arr = new Int8Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Int8Array.BYTES_PER_ELEMENT; +const nbytes = Int8Array.BYTES_PER_ELEMENT; // returns 1 ``` @@ -127,7 +127,7 @@ var nbytes = Int8Array.BYTES_PER_ELEMENT; ```javascript -var str = Int8Array.name; +const str = Int8Array.name; // returns 'Int8Array' ``` @@ -140,8 +140,8 @@ var str = Int8Array.name; ```javascript -var arr = new Int8Array( 5 ); -var buf = arr.buffer; +const arr = new Int8Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Int8Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Int8Array( 5 ); +const byteLength = arr.byteLength; // returns 5 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Int8Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Int8Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Int8Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Int8Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 1 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Int8Array( 5 ); -var len = arr.length; +const arr = new Int8Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Int8Array.from( [ 1, 2 ] ); +const arr = Int8Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Int8Array.from( [ 1, 2 ], mapFcn ); +const arr = Int8Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Int8Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Int8Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Int8Array.of( 1, 2 ); +const arr = Int8Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Int8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Int8Array( 2 ); +const arr = new Int8Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Int8Array( 2 ); +const arr = new Int8Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Int8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int8Array( [ 2, 1, 3 ] ); +const arr = new Int8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int8Array( [ 2, 1, 3 ] ); +const arr = new Int8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int8Array( [ 2, 1, 3 ] ); +const arr = new Int8Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Int8Array( [ 2, 1, 3 ] ); +const arr = new Int8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Int8Array( [ 2, 0, 3 ] ); +const arr = new Int8Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Int8Array( [ 1, 1 ] ); +const arr = new Int8Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Int8Array( [ 2, 3, 0 ] ); +const arr = new Int8Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Int8Array( [ 2, 3, 0 ] ); +const arr = new Int8Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Int8Array( [ 1, 2, 3 ] ); +const arr1 = new Int8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Int8Array( [ 1, 2, 3 ] ); +const arr = new Int8Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Int8Array( [ 1, 2 ] ); +const arr = new Int8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/int8' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/int8' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/linspace/README.md b/lib/node_modules/@stdlib/array/linspace/README.md index 0237ec8356dd..377e99661178 100644 --- a/lib/node_modules/@stdlib/array/linspace/README.md +++ b/lib/node_modules/@stdlib/array/linspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var linspace = require( '@stdlib/array/linspace' ); +const linspace = require( '@stdlib/array/linspace' ); ``` #### linspace( start, stop, length\[, options] ) @@ -35,21 +35,21 @@ var linspace = require( '@stdlib/array/linspace' ); Generates a linearly spaced array over a specified interval. ```javascript -var arr = linspace( 0.0, 100.0, 6 ); +const arr = linspace( 0.0, 100.0, 6 ); // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] ``` If `length` is `0`, the function returns an empty array. ```javascript -var arr = linspace( 0.0, 100.0, 0 ); +const arr = linspace( 0.0, 100.0, 0 ); // returns [] ``` If `length` is `1`, the function returns an array containing `stop`, but not `start`, when `endpoint` is `true`; otherwise, the function returns an array containing `start`, but not `stop`. ```javascript -var arr = linspace( 0.0, 100.0, 1 ); +let arr = linspace( 0.0, 100.0, 1 ); // returns [ 100.0 ] arr = linspace( 0.0, 100.0, 1, { @@ -66,7 +66,7 @@ arr = linspace( 0.0, 100.0, 1, { For real-valued `start` and `stop`, if `start` is less than `stop`, the output array will contain ascending values, and, if `start` is greater than `stop`, the output array will contain descending values. ```javascript -var arr = linspace( 0.0, -100.0, 6 ); +const arr = linspace( 0.0, -100.0, 6 ); // returns [ 0.0, -20.0, -40.0, -60.0, -80.0, -100.0 ] ``` @@ -78,20 +78,20 @@ The function accepts the following `options`: By default, the function generates a linearly spaced array over the closed interval `[start, stop]`. To generate linearly spaced values over the half-open interval `[start, stop)`, set the `endpoint` option to `false`. ```javascript -var opts = { +const opts = { 'endpoint': false }; -var arr = linspace( 0.0, 100.0, 5, opts ); +const arr = linspace( 0.0, 100.0, 5, opts ); // returns [ 0.0, 20.0, 40.0, 60.0, 80.0 ] ``` When both `start` and `stop` are real-valued, the default output array data type is `'float64'`. To return an output array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = linspace( 0, 100, 6, opts ); +const arr = linspace( 0, 100, 6, opts ); // returns [ 0, 20, 40, 60, 80, 100 ] ``` @@ -100,27 +100,27 @@ When either `start` or `stop` is a complex number, the default output array data ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var start = new Complex128( 0.0, 0.0 ); -var stop = new Complex128( 100.0, 10.0 ); +const start = new Complex128( 0.0, 0.0 ); +const stop = new Complex128( 100.0, 10.0 ); -var arr = linspace( start, stop, 6, opts ); +const arr = linspace( start, stop, 6, opts ); // returns [ , , , , , ] -var z = arr[ 0 ]; +let z = arr[ 0 ]; // returns -var re = real( z ); +let re = real( z ); // returns 0.0 -var im = imag( z ); +let im = imag( z ); // returns 0.0 z = arr[ 1 ]; @@ -140,27 +140,27 @@ im = imag( z ); Generates a linearly spaced sequence over a specified interval and assigns the results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 6 ); -var arr = linspace.assign( 0.0, 100.0, out ); +const out = new Float64Array( 6 ); +const arr = linspace.assign( 0.0, 100.0, out ); // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` If the provided output array is empty, the function returns the provided output array unchanged. ```javascript -var arr = linspace.assign( 0.0, 100.0, [] ); +const arr = linspace.assign( 0.0, 100.0, [] ); // returns [] ``` If the provided output array contains a single element, the function writes the `stop` value, but not `start`, when `endpoint` is `true`; otherwise, the function writes the `start` value, but not `stop`. ```javascript -var arr = linspace.assign( 0.0, 100.0, [ -10.0 ] ); +let arr = linspace.assign( 0.0, 100.0, [ -10.0 ] ); // returns [ 100.0 ] arr = linspace.assign( 0.0, 100.0, [ -10.0 ], { @@ -177,10 +177,10 @@ arr = linspace.assign( 0.0, 100.0, [ -10.0 ], { For real-valued `start` and `stop`, if `start` is less than `stop`, the output array will contain ascending values, and, if `start` is greater than `stop`, the output array will contain descending values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 6 ); -var arr = linspace.assign( 0.0, -100.0, out ); +const out = new Float64Array( 6 ); +const arr = linspace.assign( 0.0, -100.0, out ); // returns [ 0.0, -20.0, -40.0, -60.0, -80.0, -100.0 ] ``` @@ -191,14 +191,14 @@ The function accepts the following `options`: By default, the function generates a linearly spaced array over the closed interval `[start, stop]`. To generate linearly spaced values over the half-open interval `[start, stop)`, set the `endpoint` option to `false`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'endpoint': false }; -var out = new Float64Array( 5 ); -var arr = linspace.assign( 0.0, 100.0, out, opts ); +const out = new Float64Array( 5 ); +const arr = linspace.assign( 0.0, 100.0, out, opts ); // returns [ 0.0, 20.0, 40.0, 60.0, 80.0 ] ``` @@ -221,23 +221,21 @@ var arr = linspace.assign( 0.0, 100.0, out, opts ); - When the output array length is greater than `1` and `endpoint` is `true`, the output array is guaranteed to include the `start` and `stop` values. Beware, however, that values between `start` and `stop` are subject to floating-point rounding errors. Hence, ```javascript - var arr = linspace( 0.0, 1.0, 3 ); + const arr = linspace( 0.0, 1.0, 3 ); // returns [ 0.0, ~0.5, 1.0 ] ``` where `arr[1]` is only guaranteed to be approximately equal to `0.5`. If you desire more control over element precision, consider using [`roundn`][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); // Create an array subject to floating-point rounding errors: - var arr = linspace( 0.0, 1.0, 3, { + const arr = linspace( 0.0, 1.0, 3, { 'dtype': 'generic' }); - // Round each value to the nearest hundredth: - var i; - for ( i = 0; i < arr.length; i++ ) { + for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = roundn( arr[ i ], -2 ); } console.log( arr ); @@ -263,15 +261,15 @@ var arr = linspace.assign( 0.0, 100.0, out, opts ); ```javascript -var linspace = require( '@stdlib/array/linspace' ); +const linspace = require( '@stdlib/array/linspace' ); // Define function options: -var opts = { +const opts = { 'dtype': 'generic' }; // Create arrays of varying lengths... -var out = linspace( 0, 10, 10, opts ); +let out = linspace( 0, 10, 10, opts ); console.log( out ); out = linspace( 0, 10, 11, opts ); diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/README.md b/lib/node_modules/@stdlib/array/little-endian-factory/README.md index 12ab8ec7b805..0db610fe1528 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/README.md +++ b/lib/node_modules/@stdlib/array/little-endian-factory/README.md @@ -39,7 +39,7 @@ In contrast to the built-in typed array constructors which store values accordin ## Usage ```javascript -var littleEndianFactory = require( '@stdlib/array/little-endian-factory' ); +const littleEndianFactory = require( '@stdlib/array/little-endian-factory' ); ``` #### littleEndianFactory( dtype ) @@ -47,10 +47,10 @@ var littleEndianFactory = require( '@stdlib/array/little-endian-factory' ); Returns a typed array constructor for creating typed arrays having a specified [data type][@stdlib/array/typed-dtypes] and stored in little-endian byte order. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); // returns -var Float32ArrayLE = littleEndianFactory( 'float32' ); +const Float32ArrayLE = littleEndianFactory( 'float32' ); // returns ``` @@ -63,9 +63,9 @@ var Float32ArrayLE = littleEndianFactory( 'float32' ); A typed array constructor which returns a typed array representing an array of values in little-endian byte order. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE(); +const arr = new Float64ArrayLE(); // returns ``` @@ -74,9 +74,9 @@ var arr = new Float64ArrayLE(); Returns a typed array having a specified length. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); +const arr = new Float64ArrayLE( 5 ); // returns ``` @@ -85,15 +85,15 @@ var arr = new Float64ArrayLE( 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float64ArrayLE( arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float64ArrayLE( arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -102,12 +102,12 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( [ 0.5, 0.5, 0.5 ] ); +const arr = new Float64ArrayLE( [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -116,12 +116,12 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float64ArrayLE( buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float64ArrayLE( buf, 0, 4 ); // returns ``` @@ -136,9 +136,9 @@ var arr = new Float64ArrayLE( buf, 0, 4 ); Number of bytes per view element. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; +const nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; // returns 8 ``` @@ -149,9 +149,9 @@ var nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var str = Float64ArrayLE.name; +const str = Float64ArrayLE.name; // returns 'Float64ArrayLE' ``` @@ -162,10 +162,10 @@ var str = Float64ArrayLE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); -var buf = arr.buffer; +const arr = new Float64ArrayLE( 5 ); +const buf = arr.buffer; // returns ``` @@ -176,10 +176,10 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); -var byteLength = arr.byteLength; +const arr = new Float64ArrayLE( 5 ); +const byteLength = arr.byteLength; // returns 40 ``` @@ -190,10 +190,10 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float64ArrayLE( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -204,10 +204,10 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float64ArrayLE( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -218,10 +218,10 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 5 ); -var len = arr.length; +const arr = new Float64ArrayLE( 5 ); +const len = arr.length; // returns 5 ``` @@ -236,12 +236,12 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ] ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -252,12 +252,12 @@ function mapFcn( v ) { return v * 2.0; } -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -274,19 +274,19 @@ function mapFcn( v ) { return v * 2.0; } -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -297,12 +297,12 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = Float64ArrayLE.of( 1.0, -1.0 ); +const arr = Float64ArrayLE.of( 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -313,26 +313,26 @@ var v = arr.get( 0 ); Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 10 ); +const arr = new Float64ArrayLE( 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( 10 ); +const arr = new Float64ArrayLE( 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -343,12 +343,12 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -367,15 +367,15 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -395,11 +395,11 @@ A few notes: Serializes an array as a string. ```javascript -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -435,18 +435,18 @@ var str = arr.toString(); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var logEach = require( '@stdlib/console/log-each' ); -var littleEndianFactory = require( '@stdlib/array/little-endian-factory' ); +const Float64Array = require( '@stdlib/array/float64' ); +const logEach = require( '@stdlib/console/log-each' ); +const littleEndianFactory = require( '@stdlib/array/little-endian-factory' ); -var Float64ArrayLE = littleEndianFactory( 'float64' ); +const Float64ArrayLE = littleEndianFactory( 'float64' ); // Create a typed array by specifying a length: -var out = new Float64ArrayLE( 3 ); +let out = new Float64ArrayLE( 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float64ArrayLE( arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/little-endian-float32/README.md b/lib/node_modules/@stdlib/array/little-endian-float32/README.md index a4b9d85cdb37..ef449bfda1ba 100644 --- a/lib/node_modules/@stdlib/array/little-endian-float32/README.md +++ b/lib/node_modules/@stdlib/array/little-endian-float32/README.md @@ -39,7 +39,7 @@ In contrast to the [`Float32Array`][@stdlib/array/float32] typed array construct ## Usage ```javascript -var Float32ArrayLE = require( '@stdlib/array/little-endian-float32' ); +const Float32ArrayLE = require( '@stdlib/array/little-endian-float32' ); ``` #### Float32ArrayLE() @@ -47,7 +47,7 @@ var Float32ArrayLE = require( '@stdlib/array/little-endian-float32' ); A typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in little-endian byte order. ```javascript -var arr = new Float32ArrayLE(); +const arr = new Float32ArrayLE(); // returns ``` @@ -56,7 +56,7 @@ var arr = new Float32ArrayLE(); Returns a typed array having a specified length. ```javascript -var arr = new Float32ArrayLE( 5 ); +const arr = new Float32ArrayLE( 5 ); // returns ``` @@ -65,13 +65,13 @@ var arr = new Float32ArrayLE( 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float32ArrayLE( arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float32ArrayLE( arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -80,10 +80,10 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var arr = new Float32ArrayLE( [ 0.5, 0.5, 0.5 ] ); +const arr = new Float32ArrayLE( [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -92,10 +92,10 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float32ArrayLE( buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float32ArrayLE( buf, 0, 4 ); // returns ``` @@ -110,7 +110,7 @@ var arr = new Float32ArrayLE( buf, 0, 4 ); Number of bytes per view element. ```javascript -var nbytes = Float32ArrayLE.BYTES_PER_ELEMENT; +const nbytes = Float32ArrayLE.BYTES_PER_ELEMENT; // returns 4 ``` @@ -121,7 +121,7 @@ var nbytes = Float32ArrayLE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var str = Float32ArrayLE.name; +const str = Float32ArrayLE.name; // returns 'Float32ArrayLE' ``` @@ -132,8 +132,8 @@ var str = Float32ArrayLE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var arr = new Float32ArrayLE( 5 ); -var buf = arr.buffer; +const arr = new Float32ArrayLE( 5 ); +const buf = arr.buffer; // returns ``` @@ -144,8 +144,8 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var arr = new Float32ArrayLE( 5 ); -var byteLength = arr.byteLength; +const arr = new Float32ArrayLE( 5 ); +const byteLength = arr.byteLength; // returns 20 ``` @@ -156,8 +156,8 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var arr = new Float32ArrayLE( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float32ArrayLE( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -168,8 +168,8 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var arr = new Float32ArrayLE( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float32ArrayLE( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -180,8 +180,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var arr = new Float32ArrayLE( 5 ); -var len = arr.length; +const arr = new Float32ArrayLE( 5 ); +const len = arr.length; // returns 5 ``` @@ -196,10 +196,10 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var arr = Float32ArrayLE.from( [ 1.0, -1.0 ] ); +const arr = Float32ArrayLE.from( [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -210,10 +210,10 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float32ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); +const arr = Float32ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -230,17 +230,17 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float32ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float32ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -251,10 +251,10 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float32ArrayLE.of( 1.0, -1.0 ); +const arr = Float32ArrayLE.of( 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -265,22 +265,22 @@ var v = arr.get( 0 ); Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var arr = new Float32ArrayLE( 10 ); +const arr = new Float32ArrayLE( 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Float32ArrayLE( 10 ); +const arr = new Float32ArrayLE( 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -291,10 +291,10 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -313,13 +313,13 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -339,9 +339,9 @@ A few notes: Serializes an array as a string. ```javascript -var arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float32ArrayLE( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -377,16 +377,16 @@ var str = arr.toString(); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var logEach = require( '@stdlib/console/log-each' ); -var Float32ArrayLE = require( '@stdlib/array/little-endian-float32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const logEach = require( '@stdlib/console/log-each' ); +const Float32ArrayLE = require( '@stdlib/array/little-endian-float32' ); // Create a typed array by specifying a length: -var out = new Float32ArrayLE( 3 ); +let out = new Float32ArrayLE( 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float32ArrayLE( arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/little-endian-float64/README.md b/lib/node_modules/@stdlib/array/little-endian-float64/README.md index 47578d011874..14d1a150414b 100644 --- a/lib/node_modules/@stdlib/array/little-endian-float64/README.md +++ b/lib/node_modules/@stdlib/array/little-endian-float64/README.md @@ -39,7 +39,7 @@ In contrast to the [`Float64Array`][@stdlib/array/float64] typed array construct ## Usage ```javascript -var Float64ArrayLE = require( '@stdlib/array/little-endian-float64' ); +const Float64ArrayLE = require( '@stdlib/array/little-endian-float64' ); ``` #### Float64ArrayLE() @@ -47,7 +47,7 @@ var Float64ArrayLE = require( '@stdlib/array/little-endian-float64' ); A typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in little-endian byte order. ```javascript -var arr = new Float64ArrayLE(); +const arr = new Float64ArrayLE(); // returns ``` @@ -56,7 +56,7 @@ var arr = new Float64ArrayLE(); Returns a typed array having a specified length. ```javascript -var arr = new Float64ArrayLE( 5 ); +const arr = new Float64ArrayLE( 5 ); // returns ``` @@ -65,13 +65,13 @@ var arr = new Float64ArrayLE( 5 ); Creates a typed array from another typed array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); -var arr2 = new Float64ArrayLE( arr1 ); +const arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] ); +const arr2 = new Float64ArrayLE( arr1 ); // returns -var v = arr2.get( 0 ); +const v = arr2.get( 0 ); // returns 0.5 ``` @@ -80,10 +80,10 @@ var v = arr2.get( 0 ); Creates a typed array from an array-like object or iterable. ```javascript -var arr = new Float64ArrayLE( [ 0.5, 0.5, 0.5 ] ); +const arr = new Float64ArrayLE( [ 0.5, 0.5, 0.5 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 0.5 ``` @@ -92,10 +92,10 @@ var v = arr.get( 0 ); Returns a typed array view of an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); -var arr = new Float64ArrayLE( buf, 0, 4 ); +const buf = new ArrayBuffer( 32 ); +const arr = new Float64ArrayLE( buf, 0, 4 ); // returns ``` @@ -110,7 +110,7 @@ var arr = new Float64ArrayLE( buf, 0, 4 ); Number of bytes per view element. ```javascript -var nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; +const nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; // returns 8 ``` @@ -121,7 +121,7 @@ var nbytes = Float64ArrayLE.BYTES_PER_ELEMENT; Typed array constructor name. ```javascript -var str = Float64ArrayLE.name; +const str = Float64ArrayLE.name; // returns 'Float64ArrayLE' ``` @@ -132,8 +132,8 @@ var str = Float64ArrayLE.name; **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] referenced by the typed array. ```javascript -var arr = new Float64ArrayLE( 5 ); -var buf = arr.buffer; +const arr = new Float64ArrayLE( 5 ); +const buf = arr.buffer; // returns ``` @@ -144,8 +144,8 @@ var buf = arr.buffer; **Read-only** property which returns the length (in bytes) of the typed array. ```javascript -var arr = new Float64ArrayLE( 5 ); -var byteLength = arr.byteLength; +const arr = new Float64ArrayLE( 5 ); +const byteLength = arr.byteLength; // returns 40 ``` @@ -156,8 +156,8 @@ var byteLength = arr.byteLength; **Read-only** property which returns the offset (in bytes) of the typed array from the start of its [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var arr = new Float64ArrayLE( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Float64ArrayLE( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -168,8 +168,8 @@ var byteOffset = arr.byteOffset; Number of bytes per view element. ```javascript -var arr = new Float64ArrayLE( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Float64ArrayLE( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 8 ``` @@ -180,8 +180,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; **Read-only** property which returns the number of view elements. ```javascript -var arr = new Float64ArrayLE( 5 ); -var len = arr.length; +const arr = new Float64ArrayLE( 5 ); +const len = arr.length; // returns 5 ``` @@ -196,10 +196,10 @@ var len = arr.length; Creates a new typed array from an array-like object or an iterable. ```javascript -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ] ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ] ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -210,10 +210,10 @@ function mapFcn( v ) { return v * 2.0; } -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 ``` @@ -230,17 +230,17 @@ function mapFcn( v ) { return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); +const arr = Float64ArrayLE.from( [ 1.0, -1.0 ], mapFcn, ctx ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 2.0 -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -251,10 +251,10 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Float64ArrayLE.of( 1.0, -1.0 ); +const arr = Float64ArrayLE.of( 1.0, -1.0 ); // returns -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` @@ -265,22 +265,22 @@ var v = arr.get( 0 ); Returns an array element located at a nonnegative integer position (index) `i`. ```javascript -var arr = new Float64ArrayLE( 10 ); +const arr = new Float64ArrayLE( 10 ); // Set the first element: arr.set( 1.0, 0 ); // Get the first element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns 1.0 ``` If provided an out-of-bounds index, the method returns `undefined`. ```javascript -var arr = new Float64ArrayLE( 10 ); +const arr = new Float64ArrayLE( 10 ); -var v = arr.get( 100 ); +const v = arr.get( 100 ); // returns undefined ``` @@ -291,10 +291,10 @@ var v = arr.get( 100 ); Sets array elements. ```javascript -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns -var v = arr.get( 0 ); +let v = arr.get( 0 ); // returns 1.0 v = arr.get( 1 ); @@ -313,13 +313,13 @@ v = arr.get( 1 ); By default, the method starts writing values at the first array index. To specify an alternative index, provide an index `offset`. ```javascript -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); // returns // Set the last two array elements: arr.set( [ 4.0, 5.0 ], 1 ); -var v = arr.get( 1 ); +let v = arr.get( 1 ); // returns 4.0 v = arr.get( 2 ); @@ -339,9 +339,9 @@ A few notes: Serializes an array as a string. ```javascript -var arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); +const arr = new Float64ArrayLE( [ 1.0, 2.0, 3.0 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -377,16 +377,16 @@ var str = arr.toString(); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var logEach = require( '@stdlib/console/log-each' ); -var Float64ArrayLE = require( '@stdlib/array/little-endian-float64' ); +const Float64Array = require( '@stdlib/array/float64' ); +const logEach = require( '@stdlib/console/log-each' ); +const Float64ArrayLE = require( '@stdlib/array/little-endian-float64' ); // Create a typed array by specifying a length: -var out = new Float64ArrayLE( 3 ); +let out = new Float64ArrayLE( 3 ); logEach( '%s', out ); // Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; +let arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; out = new Float64ArrayLE( arr ); logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/array/logspace/README.md b/lib/node_modules/@stdlib/array/logspace/README.md index 243285dc8b41..a5c9e869a69c 100644 --- a/lib/node_modules/@stdlib/array/logspace/README.md +++ b/lib/node_modules/@stdlib/array/logspace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logspace = require( '@stdlib/array/logspace' ); +const logspace = require( '@stdlib/array/logspace' ); ``` #### logspace( a, b\[, length] ) @@ -35,7 +35,7 @@ var logspace = require( '@stdlib/array/logspace' ); Generates a logarithmically spaced numeric `array` between `10^a` and `10^b`. If a `length` is not provided, the default output `array` length is `10`. ```javascript -var arr = logspace( 0, 2, 6 ); +const arr = logspace( 0, 2, 6 ); // returns [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ] ``` @@ -60,8 +60,8 @@ var arr = logspace( 0, 2, 6 ); ```javascript -var logspace = require( '@stdlib/array/logspace' ); -var out; +const logspace = require( '@stdlib/array/logspace' ); +let out; // Default behavior: out = logspace( 0, 3 ); diff --git a/lib/node_modules/@stdlib/array/min-dtype/README.md b/lib/node_modules/@stdlib/array/min-dtype/README.md index c2e706a06a78..c6f9f191a4bd 100644 --- a/lib/node_modules/@stdlib/array/min-dtype/README.md +++ b/lib/node_modules/@stdlib/array/min-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minDataType = require( '@stdlib/array/min-dtype' ); +const minDataType = require( '@stdlib/array/min-dtype' ); ``` #### minDataType( value ) @@ -45,7 +45,7 @@ var minDataType = require( '@stdlib/array/min-dtype' ); Returns the minimum array [data type][@stdlib/array/dtypes] of the closest "kind" necessary for storing a provided scalar value. ```javascript -var dt = minDataType( 3.141592653589793 ); +let dt = minDataType( 3.141592653589793 ); // returns 'float32' dt = minDataType( -3 ); @@ -83,24 +83,20 @@ dt = minDataType( '3' ); ```javascript -var roundn = require( '@stdlib/math/base/special/roundn' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var minDataType = require( '@stdlib/array/min-dtype' ); - -var dt; -var v; -var i; +const roundn = require( '@stdlib/math/base/special/roundn' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const minDataType = require( '@stdlib/array/min-dtype' ); // Generate numbers of varying magnitudes and determine the minimum data type for each value... -for ( i = 0; i < 100; i++ ) { - v = randu() * pow( 2.0, discreteUniform( 0, 40 ) ); +for ( let i = 0; i < 100; i++ ) { + let v = randu() * pow( 2.0, discreteUniform( 0, 40 ) ); if ( randu() < 0.5 ) { v *= -1; } v = roundn( v, discreteUniform( -1, 0 ) ); - dt = minDataType( v ); + const dt = minDataType( v ); console.log( 'min(%d) => %s', v, dt ); } ``` diff --git a/lib/node_modules/@stdlib/array/mostly-safe-casts/README.md b/lib/node_modules/@stdlib/array/mostly-safe-casts/README.md index d6f682fab026..0303b1c21d0f 100644 --- a/lib/node_modules/@stdlib/array/mostly-safe-casts/README.md +++ b/lib/node_modules/@stdlib/array/mostly-safe-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mostlySafeCasts = require( '@stdlib/array/mostly-safe-casts' ); +const mostlySafeCasts = require( '@stdlib/array/mostly-safe-casts' ); ``` #### mostlySafeCasts( \[dtype] ) @@ -45,27 +45,27 @@ var mostlySafeCasts = require( '@stdlib/array/mostly-safe-casts' ); If provided a `dtype` argument, returns a list of array [data types][@stdlib/array/dtypes] to which a provided array [data type][@stdlib/array/dtypes] can be safely cast and, for floating-point data types, can be downcast. ```javascript -var out = mostlySafeCasts( 'float32' ); +const out = mostlySafeCasts( 'float32' ); // e.g., returns [ 'float32', 'float64', ... ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = mostlySafeCasts(); +const out = mostlySafeCasts(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var v = f32[ 'float64' ]; +const v = f32[ 'float64' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = mostlySafeCasts( 'foo' ); +const out = mostlySafeCasts( 'foo' ); // returns null ``` @@ -90,17 +90,14 @@ var out = mostlySafeCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var mostlySafeCasts = require( '@stdlib/array/mostly-safe-casts' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const mostlySafeCasts = require( '@stdlib/array/mostly-safe-casts' ); // Get the list of supported array data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Print the list of array data types to which a data type can be cast... -var list; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - list = mostlySafeCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = mostlySafeCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/mskfilter/README.md b/lib/node_modules/@stdlib/array/mskfilter/README.md index e2ceabf5de14..26b660c70495 100644 --- a/lib/node_modules/@stdlib/array/mskfilter/README.md +++ b/lib/node_modules/@stdlib/array/mskfilter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskfilter = require( '@stdlib/array/mskfilter' ); +const mskfilter = require( '@stdlib/array/mskfilter' ); ``` #### mskfilter( x, mask ) @@ -35,9 +35,9 @@ var mskfilter = require( '@stdlib/array/mskfilter' ); Returns a new array by applying a mask to a provided input array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = mskfilter( x, [ 0, 1, 0, 1 ] ); +const y = mskfilter( x, [ 0, 1, 0, 1 ] ); // returns [ 2, 4 ] ``` @@ -68,22 +68,22 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var mskfilter = require( '@stdlib/array/mskfilter' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const mskfilter = require( '@stdlib/array/mskfilter' ); // Generate a linearly spaced array: -var x = zeroTo( 20, 'generic' ); +const x = zeroTo( 20, 'generic' ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); // Filter an array using the mask: -var y = mskfilter( x, mask ); +const y = mskfilter( x, mask ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/mskput/README.md b/lib/node_modules/@stdlib/array/mskput/README.md index b32a51c31135..e1b0d39f0f1b 100644 --- a/lib/node_modules/@stdlib/array/mskput/README.md +++ b/lib/node_modules/@stdlib/array/mskput/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskput = require( '@stdlib/array/mskput' ); +const mskput = require( '@stdlib/array/mskput' ); ``` #### mskput( x, mask, values\[, options] ) @@ -35,12 +35,12 @@ var mskput = require( '@stdlib/array/mskput' ); Replaces elements of an array with provided values according to a provided mask array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 1, 0, 1, 0 ], [ 20, 40 ] ); +const out = mskput( x, [ 1, 0, 1, 0 ], [ 20, 40 ] ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -66,28 +66,28 @@ The function supports the following modes: In broadcasting modes, the function supports broadcasting a `values` array containing a single element against the number of falsy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 1, 0, 1, 0 ], [ 20 ], { +const out = mskput( x, [ 1, 0, 1, 0 ], [ 20 ], { 'mode': 'strict_broadcast' }); // returns [ 1, 20, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` In repeat mode, the function supports recycling elements in a `values` array to satisfy the number of falsy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = mskput( x, [ 0, 0, 1, 0 ], [ 20, 40 ], { +const out = mskput( x, [ 0, 0, 1, 0 ], [ 20, 40 ], { 'mode': 'repeat' }); // returns [ 20, 40, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -114,27 +114,27 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var mskput = require( '@stdlib/array/mskput' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const mskput = require( '@stdlib/array/mskput' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate a random mask array: -var N = discreteUniform( 5, 15 ); -var mask = filledBy( N, bernoulli.factory( 0.3 ) ); +const N = discreteUniform( 5, 15 ); +const mask = filledBy( N, bernoulli.factory( 0.3 ) ); console.log( mask ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = mskput( x, mask, values ); +const out = mskput( x, mask, values ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/mskreject/README.md b/lib/node_modules/@stdlib/array/mskreject/README.md index 2a7565e534ac..d70db1f7a70d 100644 --- a/lib/node_modules/@stdlib/array/mskreject/README.md +++ b/lib/node_modules/@stdlib/array/mskreject/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mskreject = require( '@stdlib/array/mskreject' ); +const mskreject = require( '@stdlib/array/mskreject' ); ``` #### mskreject( x, mask ) @@ -35,9 +35,9 @@ var mskreject = require( '@stdlib/array/mskreject' ); Returns a new array by applying a mask to a provided input array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = mskreject( x, [ 0, 1, 0, 1 ] ); +const y = mskreject( x, [ 0, 1, 0, 1 ] ); // returns [ 1, 3 ] ``` @@ -68,22 +68,22 @@ The function supports the following parameters: ```javascript -var zeroTo = require( '@stdlib/array/zero-to' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); -var mskreject = require( '@stdlib/array/mskreject' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); +const mskreject = require( '@stdlib/array/mskreject' ); // Generate a linearly spaced array: -var x = zeroTo( 20, 'generic' ); +const x = zeroTo( 20, 'generic' ); console.log( x ); // Generate a random mask: -var mask = bernoulli( x.length, 0.5, { +const mask = bernoulli( x.length, 0.5, { 'dtype': 'generic' }); console.log( mask ); // Filter an array using the mask: -var y = mskreject( x, mask ); +const y = mskreject( x, mask ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/nans-like/README.md b/lib/node_modules/@stdlib/array/nans-like/README.md index 7d6edbfd4c8a..a35b6e6b3855 100644 --- a/lib/node_modules/@stdlib/array/nans-like/README.md +++ b/lib/node_modules/@stdlib/array/nans-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nansLike = require( '@stdlib/array/nans-like' ); +const nansLike = require( '@stdlib/array/nans-like' ); ``` #### nansLike( x\[, dtype] ) @@ -45,9 +45,9 @@ var nansLike = require( '@stdlib/array/nans-like' ); Creates an array filled with NaNs and having the same length and data type as a provided array `x`. ```javascript -var x = [ 1, 2, 3, 4, 5 ]; +const x = [ 1, 2, 3, 4, 5 ]; -var arr = nansLike( x ); +const arr = nansLike( x ); // returns [ NaN, NaN, NaN, NaN, NaN ] ``` @@ -62,9 +62,9 @@ The function supports the following data types: By default, the output array data type is inferred from the provided array `x`. To return an array having a different data type, provide a `dtype` argument. ```javascript -var x = [ 0, 0 ]; +const x = [ 0, 0 ]; -var arr = nansLike( x, 'float32' ); +const arr = nansLike( x, 'float32' ); // returns [ NaN, NaN ] ``` @@ -93,21 +93,18 @@ var arr = nansLike( x, 'float32' ); ```javascript -var dtypes = require( '@stdlib/array/typed-float-dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); -var nansLike = require( '@stdlib/array/nans-like' ); +const dtypes = require( '@stdlib/array/typed-float-dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); +const nansLike = require( '@stdlib/array/nans-like' ); // Create a zero-filled array: -var x = zeros( 4, 'complex128' ); +const x = zeros( 4, 'complex128' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - y = nansLike( x, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const y = nansLike( x, dt[ i ] ); console.log( y ); } ``` diff --git a/lib/node_modules/@stdlib/array/nans/README.md b/lib/node_modules/@stdlib/array/nans/README.md index c54f60f46e30..4f15a30b41c9 100644 --- a/lib/node_modules/@stdlib/array/nans/README.md +++ b/lib/node_modules/@stdlib/array/nans/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nans = require( '@stdlib/array/nans' ); +const nans = require( '@stdlib/array/nans' ); ``` #### nans( length\[, dtype] ) @@ -45,7 +45,7 @@ var nans = require( '@stdlib/array/nans' ); Creates an array filled with NaNs and having a specified length. ```javascript -var arr = nans( 2 ); +const arr = nans( 2 ); // returns [ NaN, NaN ] ``` @@ -60,7 +60,7 @@ The function recognizes the following data types: By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = nans( 2, 'float32' ); +const arr = nans( 2, 'float32' ); // returns [ NaN, NaN ] ``` @@ -89,17 +89,14 @@ var arr = nans( 2, 'float32' ); ```javascript -var dtypes = require( '@stdlib/array/typed-float-dtypes' ); -var nans = require( '@stdlib/array/nans' ); +const dtypes = require( '@stdlib/array/typed-float-dtypes' ); +const nans = require( '@stdlib/array/nans' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = nans( 4, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = nans( 4, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/next-dtype/README.md b/lib/node_modules/@stdlib/array/next-dtype/README.md index 026a8f53f401..81a13537b2c1 100644 --- a/lib/node_modules/@stdlib/array/next-dtype/README.md +++ b/lib/node_modules/@stdlib/array/next-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nextDataType = require( '@stdlib/array/next-dtype' ); +const nextDataType = require( '@stdlib/array/next-dtype' ); ``` #### nextDataType( \[dtype] ) @@ -45,28 +45,28 @@ var nextDataType = require( '@stdlib/array/next-dtype' ); If provided a `dtype` argument, returns the next larger array [data type][@stdlib/array/dtypes] of the same kind. ```javascript -var out = nextDataType( 'float32' ); +const out = nextDataType( 'float32' ); // returns 'float64' ``` If a [data type][@stdlib/array/dtypes] does not have a next larger [data type][@stdlib/array/dtypes] or the next larger data type is not supported, the function returns `-1`. ```javascript -var out = nextDataType( 'complex128' ); +const out = nextDataType( 'complex128' ); // returns -1 ``` If not provided a `dtype` argument, the function returns a table. ```javascript -var out = nextDataType(); +const out = nextDataType(); // returns {...} ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = nextDataType( 'foo' ); +const out = nextDataType( 'foo' ); // returns null ``` @@ -91,19 +91,15 @@ var out = nextDataType( 'foo' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var nextDataType = require( '@stdlib/array/next-dtype' ); - -var DTYPES; -var dt; -var i; +const dtypes = require( '@stdlib/array/dtypes' ); +const nextDataType = require( '@stdlib/array/next-dtype' ); // Get the list of supported array data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the next larger data type for each supported data type... -for ( i = 0; i < DTYPES.length; i++ ) { - dt = nextDataType( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt = nextDataType( DTYPES[ i ] ); console.log( '%s => %s', DTYPES[ i ], dt ); } ``` diff --git a/lib/node_modules/@stdlib/array/one-to-like/README.md b/lib/node_modules/@stdlib/array/one-to-like/README.md index 6b07fcb28a6c..7912b62a9434 100644 --- a/lib/node_modules/@stdlib/array/one-to-like/README.md +++ b/lib/node_modules/@stdlib/array/one-to-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var oneToLike = require( '@stdlib/array/one-to-like' ); +const oneToLike = require( '@stdlib/array/one-to-like' ); ``` #### oneToLike( x\[, dtype] ) @@ -45,7 +45,7 @@ var oneToLike = require( '@stdlib/array/one-to-like' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from one and having the same length and data type as a provided input array `x`. ```javascript -var arr = oneToLike( [ 0, 0, 0, 0, 0 ] ); +const arr = oneToLike( [ 0, 0, 0, 0, 0 ] ); // returns [ 1, 2, 3, 4, 5 ] ``` @@ -67,7 +67,7 @@ The function recognizes the following data types: By default, the output array data type is inferred from the provided array `x`. To return an array having a different data type, provide a `dtype` argument. ```javascript -var arr = oneToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); +const arr = oneToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); // returns [ 1, 2, 3, 4, 5 ] ``` @@ -96,21 +96,21 @@ var arr = oneToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var oneToLike = require( '@stdlib/array/one-to-like' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const oneToLike = require( '@stdlib/array/one-to-like' ); // Generate an array of random numbers: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, 100, 200, opts ); +const x = discreteUniform( 10, 100, 200, opts ); // Generate a linearly-spaced array: -var y = oneToLike( x ); +const y = oneToLike( x ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort `y` according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, y, 1 ); diff --git a/lib/node_modules/@stdlib/array/one-to/README.md b/lib/node_modules/@stdlib/array/one-to/README.md index 741d343684fe..daf560646dab 100644 --- a/lib/node_modules/@stdlib/array/one-to/README.md +++ b/lib/node_modules/@stdlib/array/one-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var oneTo = require( '@stdlib/array/one-to' ); +const oneTo = require( '@stdlib/array/one-to' ); ``` #### oneTo( n\[, dtype] ) @@ -45,14 +45,14 @@ var oneTo = require( '@stdlib/array/one-to' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from one. ```javascript -var arr = oneTo( 5 ); +const arr = oneTo( 5 ); // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ``` If `n == 0`, the function returns an empty array. ```javascript -var arr = oneTo( 0 ); +const arr = oneTo( 0 ); // returns [] ``` @@ -74,7 +74,7 @@ The function recognizes the following data types: By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = oneTo( 5, 'int32' ); +const arr = oneTo( 5, 'int32' ); // returns [ 1, 2, 3, 4, 5 ] ``` @@ -103,21 +103,21 @@ var arr = oneTo( 5, 'int32' ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var oneTo = require( '@stdlib/array/one-to' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const oneTo = require( '@stdlib/array/one-to' ); // Generate an array of random numbers: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, 100, 200, opts ); +const x = discreteUniform( 10, 100, 200, opts ); // Generate a linearly-spaced array: -var y = oneTo( x.length, opts.dtype ); +const y = oneTo( x.length, opts.dtype ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort `y` according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, y, 1 ); diff --git a/lib/node_modules/@stdlib/array/ones-like/README.md b/lib/node_modules/@stdlib/array/ones-like/README.md index f04e3bc6548c..944dcf0c7fb5 100644 --- a/lib/node_modules/@stdlib/array/ones-like/README.md +++ b/lib/node_modules/@stdlib/array/ones-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var onesLike = require( '@stdlib/array/ones-like' ); +const onesLike = require( '@stdlib/array/ones-like' ); ``` #### onesLike( x\[, dtype] ) @@ -45,9 +45,9 @@ var onesLike = require( '@stdlib/array/ones-like' ); Creates an array filled with ones and having the same length and data type as a provided array `x`. ```javascript -var x = [ 1, 2, 3, 4, 5 ]; +const x = [ 1, 2, 3, 4, 5 ]; -var arr = onesLike( x ); +const arr = onesLike( x ); // returns [ 1, 1, 1, 1, 1 ] ``` @@ -69,9 +69,9 @@ The function supports the following data types: By default, the output array data type is inferred from the provided array `x`. To return an array having a different data type, provide a `dtype` argument. ```javascript -var x = [ 0, 0 ]; +const x = [ 0, 0 ]; -var arr = onesLike( x, 'int32' ); +const arr = onesLike( x, 'int32' ); // returns [ 1, 1 ] ``` @@ -100,21 +100,18 @@ var arr = onesLike( x, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); -var onesLike = require( '@stdlib/array/ones-like' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); +const onesLike = require( '@stdlib/array/ones-like' ); // Create a zero-filled array: -var x = zeros( 4, 'complex128' ); +const x = zeros( 4, 'complex128' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - y = onesLike( x, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const y = onesLike( x, dt[ i ] ); console.log( y ); } ``` diff --git a/lib/node_modules/@stdlib/array/ones/README.md b/lib/node_modules/@stdlib/array/ones/README.md index a3fbe0aeadb9..ea0fbc013060 100644 --- a/lib/node_modules/@stdlib/array/ones/README.md +++ b/lib/node_modules/@stdlib/array/ones/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ones = require( '@stdlib/array/ones' ); +const ones = require( '@stdlib/array/ones' ); ``` #### ones( length\[, dtype] ) @@ -45,7 +45,7 @@ var ones = require( '@stdlib/array/ones' ); Creates an array filled with ones and having a specified length. ```javascript -var arr = ones( 2 ); +const arr = ones( 2 ); // returns [ 1.0, 1.0 ] ``` @@ -67,7 +67,7 @@ The function recognizes the following data types: By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = ones( 2, 'int32' ); +const arr = ones( 2, 'int32' ); // returns [ 1, 1 ] ``` @@ -96,17 +96,14 @@ var arr = ones( 2, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var ones = require( '@stdlib/array/ones' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const ones = require( '@stdlib/array/ones' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = ones( 4, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = ones( 4, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/array/place/README.md b/lib/node_modules/@stdlib/array/place/README.md index adf94ca59a19..610605efb92c 100644 --- a/lib/node_modules/@stdlib/array/place/README.md +++ b/lib/node_modules/@stdlib/array/place/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var place = require( '@stdlib/array/place' ); +const place = require( '@stdlib/array/place' ); ``` #### place( x, mask, values\[, options] ) @@ -35,12 +35,12 @@ var place = require( '@stdlib/array/place' ); Replaces elements of an array with provided values according to a provided mask array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 0, 1, 0, 1 ], [ 20, 40 ] ); +const out = place( x, [ 0, 1, 0, 1 ], [ 20, 40 ] ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -66,28 +66,28 @@ The function supports the following modes: In broadcasting modes, the function supports broadcasting a `values` array containing a single element against the number of truthy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 0, 1, 0, 1 ], [ 20 ], { +const out = place( x, [ 0, 1, 0, 1 ], [ 20 ], { 'mode': 'strict_broadcast' }); // returns [ 1, 20, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` In repeat mode, the function supports recycling elements in a `values` array to satisfy the number of truthy values in the `mask` array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = place( x, [ 1, 1, 0, 1 ], [ 20, 40 ], { +const out = place( x, [ 1, 1, 0, 1 ], [ 20, 40 ], { 'mode': 'repeat' }); // returns [ 20, 40, 3, 20 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -114,27 +114,27 @@ var bool = ( out === x ); ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var place = require( '@stdlib/array/place' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const place = require( '@stdlib/array/place' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate a random mask array: -var N = discreteUniform( 5, 15 ); -var mask = filledBy( N, bernoulli.factory( 0.3 ) ); +const N = discreteUniform( 5, 15 ); +const mask = filledBy( N, bernoulli.factory( 0.3 ) ); console.log( mask ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = place( x, mask, values ); +const out = place( x, mask, values ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/pool/README.md b/lib/node_modules/@stdlib/array/pool/README.md index fb4d34beebf3..25d3c51eec8a 100644 --- a/lib/node_modules/@stdlib/array/pool/README.md +++ b/lib/node_modules/@stdlib/array/pool/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typedarraypool = require( '@stdlib/array/pool' ); +const typedarraypool = require( '@stdlib/array/pool' ); ``` #### typedarraypool( \[dtype] ) @@ -45,7 +45,7 @@ var typedarraypool = require( '@stdlib/array/pool' ); Returns an **uninitialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`. ```javascript -var arr = typedarraypool(); +const arr = typedarraypool(); // returns [] // ... @@ -56,7 +56,7 @@ typedarraypool.free( arr ); By default, the output [typed array][mdn-typed-array] is `float64`. To specify an alternative [data type][@stdlib/array/typed-dtypes], set the `dtype` parameter. ```javascript -var arr = typedarraypool( 'int32' ); +const arr = typedarraypool( 'int32' ); // returns [] // ... @@ -69,10 +69,10 @@ typedarraypool.free( arr ); Returns an **uninitialized** [typed array][mdn-typed-array] having a specified `length` from a [typed array][mdn-typed-array] memory pool. ```javascript -var arr1 = typedarraypool( 5 ); +const arr1 = typedarraypool( 5 ); // returns -var arr2 = typedarraypool( 5, 'uint8' ); +const arr2 = typedarraypool( 5, 'uint8' ); // returns // ... @@ -86,13 +86,13 @@ typedarraypool.free( arr2 ); Returns a pooled [typed array][mdn-typed-array] from another [typed array][mdn-typed-array]. ```javascript -var arr1 = typedarraypool( [ 5.0, -3.0, 2.0 ] ); +const arr1 = typedarraypool( [ 5.0, -3.0, 2.0 ] ); // returns [ 5.0, -3.0, 2.0 ] -var arr2 = typedarraypool( arr1 ); +const arr2 = typedarraypool( arr1 ); // returns [ 5.0, -3.0, 2.0 ] -var arr3 = typedarraypool( arr1, 'int32' ); +const arr3 = typedarraypool( arr1, 'int32' ); // returns [ 5, -3, 2 ] // ... @@ -107,10 +107,10 @@ typedarraypool.free( arr3 ); Returns a pooled [typed array][mdn-typed-array] from an array-like `object`. ```javascript -var arr1 = typedarraypool( [ 0.5, 0.5, 0.5 ] ); +const arr1 = typedarraypool( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] -var arr2 = typedarraypool( [ 0.5, 0.5, 0.5 ], 'float32' ); +const arr2 = typedarraypool( [ 0.5, 0.5, 0.5 ], 'float32' ); // returns [ 0.5, 0.5, 0.5 ] // ... @@ -124,10 +124,10 @@ typedarraypool.free( arr2 ); Returns an **uninitialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`. ```javascript -var arr1 = typedarraypool.malloc(); +const arr1 = typedarraypool.malloc(); // returns [] -var arr2 = typedarraypool.malloc( 'int32' ); +const arr2 = typedarraypool.malloc( 'int32' ); // returns [] // ... @@ -141,10 +141,10 @@ typedarraypool.free( arr2 ); Returns an **uninitialized** [typed array][mdn-typed-array] having a specified `length` from a [typed array][mdn-typed-array] memory pool. ```javascript -var arr1 = typedarraypool.malloc( 5 ); +const arr1 = typedarraypool.malloc( 5 ); // returns -var arr2 = typedarraypool.malloc( 5, 'uint8' ); +const arr2 = typedarraypool.malloc( 5, 'uint8' ); // returns // ... @@ -158,13 +158,13 @@ typedarraypool.free( arr2 ); Returns a pooled [typed array][mdn-typed-array] from another [typed array][mdn-typed-array]. ```javascript -var arr1 = typedarraypool.malloc( [ 5.0, -3.0, 2.0 ] ); +const arr1 = typedarraypool.malloc( [ 5.0, -3.0, 2.0 ] ); // returns [ 5.0, -3.0, 2.0 ] -var arr2 = typedarraypool.malloc( arr1 ); +const arr2 = typedarraypool.malloc( arr1 ); // returns [ 5.0, -3.0, 2.0 ] -var arr3 = typedarraypool.malloc( arr1, 'int32' ); +const arr3 = typedarraypool.malloc( arr1, 'int32' ); // returns [ 5, -3, 2 ] // ... @@ -179,10 +179,10 @@ typedarraypool.free( arr3 ); Returns a pooled [typed array][mdn-typed-array] from an array-like `object`. ```javascript -var arr1 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ] ); +const arr1 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] -var arr2 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ], 'float32' ); +const arr2 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ], 'float32' ); // returns [ 0.5, 0.5, 0.5 ] // ... @@ -196,10 +196,10 @@ typedarraypool.free( arr2 ); Returns a **zero-initialized** [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes] `dtype`. ```javascript -var arr1 = typedarraypool.calloc(); +const arr1 = typedarraypool.calloc(); // returns [] -var arr2 = typedarraypool.calloc( 'int32' ); +const arr2 = typedarraypool.calloc( 'int32' ); // returns [] // ... @@ -213,10 +213,10 @@ typedarraypool.free( arr2 ); Returns a **zero-initialized** [typed array][mdn-typed-array] having a specified `length` from a [typed array][mdn-typed-array] memory pool. ```javascript -var arr1 = typedarraypool.calloc( 5 ); +const arr1 = typedarraypool.calloc( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr2 = typedarraypool.calloc( 5, 'uint8' ); +const arr2 = typedarraypool.calloc( 5, 'uint8' ); // returns [ 0, 0, 0, 0, 0 ] // ... @@ -230,7 +230,7 @@ typedarraypool.free( arr2 ); Frees a [typed array][mdn-typed-array] or typed array [buffer][mdn-arraybuffer] for use in a future allocation. ```javascript -var arr = typedarraypool( 10, 'float64' ); +let arr = typedarraypool( 10, 'float64' ); // returns // ... @@ -253,7 +253,7 @@ typedarraypool.free( arr.buffer ); Clears the [typed array][mdn-typed-array] pool allowing garbage collection of previously allocated (and currently free) [array buffers][mdn-arraybuffer]. ```javascript -var arr = typedarraypool( 10, 'float64' ); +const arr = typedarraypool( 10, 'float64' ); // returns // ... @@ -271,7 +271,7 @@ typedarraypool.clear(); **Read-only** property returning the pool's high water mark (in bytes). ```javascript -var limit = typedarraypool.highWaterMark; +const limit = typedarraypool.highWaterMark; // returns ``` @@ -282,9 +282,9 @@ Once a high water mark is reached, [typed array][mdn-typed-array] allocation **f **Read-only** property returning the total number of allocated bytes. ```javascript -var arr = typedarraypool( 5, 'float64' ); +const arr = typedarraypool( 5, 'float64' ); -var nbytes = typedarraypool.nbytes; +const nbytes = typedarraypool.nbytes; // returns ``` @@ -295,9 +295,9 @@ The returned value is the total **accumulated** value. Hence, anytime a pool mus Creates a new [typed array][mdn-typed-array] pool. ```javascript -var pool = typedarraypool.factory(); +const pool = typedarraypool.factory(); -var arr = pool( 5, 'float64' ); +const arr = pool( 5, 'float64' ); // returns // ... @@ -313,11 +313,11 @@ By default, the maximum total memory a pool may allocate is `2^53` bytes (approx ```javascript // Create a new typed array pool which can allocate up to 1MB: -var pool = typedarraypool.factory({ +const pool = typedarraypool.factory({ 'highWaterMark': 1e6 }); -var arr = pool( 5, 'float64' ); +const arr = pool( 5, 'float64' ); // returns // ... @@ -351,11 +351,11 @@ pool.free( arr ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var typedarraypool = require( '@stdlib/array/pool' ); +const randu = require( '@stdlib/random/base/randu' ); +const typedarraypool = require( '@stdlib/array/pool' ); // Create a typed array pool which can allocate at most 1GB: -var typedarray = typedarraypool.factory({ +const typedarray = typedarraypool.factory({ 'highWaterMark': 1e9 }); @@ -364,15 +364,14 @@ console.log( 'Max bytes: %d', typedarray.highWaterMark ); console.log( 'nbytes: %d', typedarray.nbytes ); // Allocate an array for storing double-precision floating-point numbers: -var arr1 = typedarray( 5, 'float64' ); +const arr1 = typedarray( 5, 'float64' ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] // Inspect the pool: console.log( 'nbytes: %d', typedarray.nbytes ); // Fill the array... -var i; -for ( i = 0; i < arr1.length; i++ ) { +for ( let i = 0; i < arr1.length; i++ ) { arr1[ i ] = randu(); } @@ -383,7 +382,7 @@ console.log( arr1 ); typedarray.free( arr1 ); // Allocate another array similar to the previous one: -var arr2 = typedarray( 5, 'float64' ); +const arr2 = typedarray( 5, 'float64' ); // returns // Check that we have been returned a new typed array view: @@ -397,7 +396,7 @@ console.log( arr2 ); typedarray.free( arr2 ); // Allocate an initialized array: -var arr3 = typedarray.calloc( 5, 'float64' ); +const arr3 = typedarray.calloc( 5, 'float64' ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] // Inspect array contents: diff --git a/lib/node_modules/@stdlib/array/promotion-rules/README.md b/lib/node_modules/@stdlib/array/promotion-rules/README.md index fd8abede283c..14093854ce1d 100644 --- a/lib/node_modules/@stdlib/array/promotion-rules/README.md +++ b/lib/node_modules/@stdlib/array/promotion-rules/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var promotionRules = require( '@stdlib/array/promotion-rules' ); +const promotionRules = require( '@stdlib/array/promotion-rules' ); ``` #### promotionRules( \[dtype1, dtype2] ) @@ -45,27 +45,27 @@ var promotionRules = require( '@stdlib/array/promotion-rules' ); If provided [data types][@stdlib/array/dtypes], returns the array [data type][@stdlib/array/dtypes] with the smallest size and closest "kind" to which array [data types][@stdlib/array/dtypes] can be **safely** cast. ```javascript -var out = promotionRules( 'float32', 'uint32' ); +const out = promotionRules( 'float32', 'uint32' ); // returns 'float64' ``` If not provided [data types][@stdlib/array/dtypes], the function returns a promotion table. ```javascript -var out = promotionRules(); +const out = promotionRules(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var rule = f32[ 'uint32' ]; +const rule = f32[ 'uint32' ]; // returns 'float64' ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = promotionRules( 'foo', 'generic' ); +const out = promotionRules( 'foo', 'generic' ); // returns null ``` @@ -94,25 +94,18 @@ var out = promotionRules( 'foo', 'generic' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var promotionRules = require( '@stdlib/array/promotion-rules' ); - -var DTYPES; -var dt1; -var dt2; -var dt; -var i; -var j; +const dtypes = require( '@stdlib/array/dtypes' ); +const promotionRules = require( '@stdlib/array/promotion-rules' ); // Get the list of supported array data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the promotion rule for each pair of array data types... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt1 = DTYPES[ i ]; + for ( let j = 0; j < DTYPES.length; j++ ) { + const dt2 = DTYPES[ j ]; + const dt = promotionRules( dt1, dt2 ); console.log( '(%s, %s) => %s', dt1, dt2, dt ); } } diff --git a/lib/node_modules/@stdlib/array/put/README.md b/lib/node_modules/@stdlib/array/put/README.md index 4f2b1cfc3218..285b50bebc06 100644 --- a/lib/node_modules/@stdlib/array/put/README.md +++ b/lib/node_modules/@stdlib/array/put/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var put = require( '@stdlib/array/put' ); +const put = require( '@stdlib/array/put' ); ``` #### put( x, indices, values\[, options] ) @@ -35,12 +35,12 @@ var put = require( '@stdlib/array/put' ); Replaces specified elements of an array with provided values. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ 1, 3 ], [ 20, 40 ] ); +const out = put( x, [ 1, 3 ], [ 20, 40 ] ); // returns [ 1, 20, 3, 40 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -58,36 +58,36 @@ The function supports the following options: If `indices` is an empty array, the function returns the input array unchanged. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [], [ 20, 40 ] ); +const out = put( x, [], [ 20, 40 ] ); // returns [ 1, 2, 3, 4 ] ``` The function supports broadcasting a `values` array containing a single element against an `indices` array containing one or more elements. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ 1, 3 ], [ 20 ] ); +const out = put( x, [ 1, 3 ], [ 20 ] ); // returns [ 1, 20, 3, 20 ] ``` By default, the function normalizes negative integer indices to positive integer index equivalents. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ -3, -1 ], [ 20, 40 ] ); +const out = put( x, [ -3, -1 ], [ 20, 40 ] ); // returns [ 1, 20, 3, 40 ] ``` To specify an alternative index [mode][@stdlib/ndarray/base/ind], provide a `mode` option. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var out = put( x, [ -10, 10 ], [ 20, 40 ], { +const out = put( x, [ -10, 10 ], [ 20, 40 ], { 'mode': 'clamp' }); // returns [ 20, 2, 3, 40 ] @@ -116,26 +116,26 @@ var out = put( x, [ -10, 10 ], [ 20, 40 ], { ```javascript -var filledBy = require( '@stdlib/array/base/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var put = require( '@stdlib/array/put' ); +const filledBy = require( '@stdlib/array/base/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const put = require( '@stdlib/array/put' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate an array of random indices: -var N = discreteUniform( 5, 15 ); -var indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); +const N = discreteUniform( 5, 15 ); +const indices = filledBy( N, discreteUniform.factory( 0, x.length-1 ) ); console.log( indices ); // Generate an array of random values: -var values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); +const values = filledBy( N, discreteUniform.factory( 1000, 2000 ) ); console.log( values ); // Update a random sample of elements in `x`: -var out = put( x, indices, values ); +const out = put( x, indices, values ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/array/reviver/README.md b/lib/node_modules/@stdlib/array/reviver/README.md index 3df27c89fe00..71cdda55291b 100644 --- a/lib/node_modules/@stdlib/array/reviver/README.md +++ b/lib/node_modules/@stdlib/array/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveTypedArray = require( '@stdlib/array/reviver' ); +const reviveTypedArray = require( '@stdlib/array/reviver' ); ``` #### reviveTypedArray( key, value ) @@ -45,11 +45,11 @@ var reviveTypedArray = require( '@stdlib/array/reviver' ); Revives a JSON-serialized typed array. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"Float64Array","data":[5,3]}'; +const str = '{"type":"Float64Array","data":[5,3]}'; -var arr = parseJSON( str, reviveTypedArray ); +const arr = parseJSON( str, reviveTypedArray ); // returns [ 5.0, 3.0 ] ``` @@ -76,16 +76,16 @@ For details on the JSON serialization format, see [`@stdlib/array/to-json`][@std ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var typedarray2json = require( '@stdlib/array/to-json' ); -var reviveTypedArray = require( '@stdlib/array/reviver' ); +const Float64Array = require( '@stdlib/array/float64' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const typedarray2json = require( '@stdlib/array/to-json' ); +const reviveTypedArray = require( '@stdlib/array/reviver' ); -var arr = new Float64Array( [ 5.0, 3.0 ] ); -var str = JSON.stringify( typedarray2json( arr ) ); +const arr = new Float64Array( [ 5.0, 3.0 ] ); +const str = JSON.stringify( typedarray2json( arr ) ); // returns '{"type":"Float64Array","data":[5,3]}' -var out = parseJSON( str, reviveTypedArray ); +const out = parseJSON( str, reviveTypedArray ); if ( out instanceof Error ) { throw out; } diff --git a/lib/node_modules/@stdlib/array/safe-casts/README.md b/lib/node_modules/@stdlib/array/safe-casts/README.md index 4a6363e934b5..244f21ec5743 100644 --- a/lib/node_modules/@stdlib/array/safe-casts/README.md +++ b/lib/node_modules/@stdlib/array/safe-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var safeCasts = require( '@stdlib/array/safe-casts' ); +const safeCasts = require( '@stdlib/array/safe-casts' ); ``` #### safeCasts( \[dtype] ) @@ -45,27 +45,27 @@ var safeCasts = require( '@stdlib/array/safe-casts' ); If provided a `dtype` argument, returns a list of array [data types][@stdlib/array/dtypes] to which a provided array [data type][@stdlib/array/dtypes] can be safely cast. ```javascript -var out = safeCasts( 'float32' ); +const out = safeCasts( 'float32' ); // e.g., returns [ 'float32', 'float64', 'complex64', 'complex128', 'generic' ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = safeCasts(); +const out = safeCasts(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var v = f32[ 'float64' ]; +const v = f32[ 'float64' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = safeCasts( 'foo' ); +const out = safeCasts( 'foo' ); // returns null ``` @@ -90,17 +90,14 @@ var out = safeCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var safeCasts = require( '@stdlib/array/safe-casts' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const safeCasts = require( '@stdlib/array/safe-casts' ); // Get the list of supported array data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Print the list of array data types to which a data type can be safely cast... -var list; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - list = safeCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = safeCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/same-kind-casts/README.md b/lib/node_modules/@stdlib/array/same-kind-casts/README.md index a5fd5347744e..2d57d53cfc54 100644 --- a/lib/node_modules/@stdlib/array/same-kind-casts/README.md +++ b/lib/node_modules/@stdlib/array/same-kind-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sameKindCasts = require( '@stdlib/array/same-kind-casts' ); +const sameKindCasts = require( '@stdlib/array/same-kind-casts' ); ``` #### sameKindCasts( \[dtype] ) @@ -45,27 +45,27 @@ var sameKindCasts = require( '@stdlib/array/same-kind-casts' ); If provided a `dtype` argument, returns a list of array [data types][@stdlib/array/dtypes] to which a provided array [data type][@stdlib/array/dtypes] can be safely cast or cast within the same "kind" (e.g., between signed integers or between floating-point numbers). ```javascript -var out = sameKindCasts( 'float64' ); +const out = sameKindCasts( 'float64' ); // e.g., returns [ 'float64', 'float32', 'complex64', 'complex128', 'generic' ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = sameKindCasts(); +const out = sameKindCasts(); // returns {...} -var f64 = out[ 'float64' ]; +const f64 = out[ 'float64' ]; // returns {...} -var v = f64[ 'float32' ]; +const v = f64[ 'float32' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = sameKindCasts( 'foo' ); +const out = sameKindCasts( 'foo' ); // returns null ``` @@ -90,17 +90,14 @@ var out = sameKindCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var sameKindCasts = require( '@stdlib/array/same-kind-casts' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const sameKindCasts = require( '@stdlib/array/same-kind-casts' ); // Get the list of supported array data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Print the list of array data types to which a data type can be cast... -var list; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - list = sameKindCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = sameKindCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/array/shape/README.md b/lib/node_modules/@stdlib/array/shape/README.md index eae771a6cd35..305d0dcdd564 100644 --- a/lib/node_modules/@stdlib/array/shape/README.md +++ b/lib/node_modules/@stdlib/array/shape/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arrayShape = require( '@stdlib/array/shape' ); +const arrayShape = require( '@stdlib/array/shape' ); ``` #### arrayShape( arr ) @@ -45,26 +45,26 @@ var arrayShape = require( '@stdlib/array/shape' ); Returns array dimensions. ```javascript -var arr = [ +const arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]; -var shape = arrayShape( arr ); +const shape = arrayShape( arr ); // returns [ 3, 3 ] ``` The function **ignores** inconsistent dimensions. ```javascript -var arr = [ +const arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ] ]; -var shape = arrayShape( arr ); +const shape = arrayShape( arr ); // returns [ 3 ] ``` @@ -89,10 +89,10 @@ var shape = arrayShape( arr ); ```javascript -var arrayShape = require( '@stdlib/array/shape' ); +const arrayShape = require( '@stdlib/array/shape' ); -var arr = [ 1, 2, 3 ]; -var shape = arrayShape( arr ); +let arr = [ 1, 2, 3 ]; +let shape = arrayShape( arr ); // returns [ 3 ] arr = [ diff --git a/lib/node_modules/@stdlib/array/shared-buffer/README.md b/lib/node_modules/@stdlib/array/shared-buffer/README.md index 90083eff3156..667b136617fa 100644 --- a/lib/node_modules/@stdlib/array/shared-buffer/README.md +++ b/lib/node_modules/@stdlib/array/shared-buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); +const SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); ``` #### SharedArrayBuffer( size ) @@ -48,7 +48,7 @@ Returns a [`SharedArrayBuffer`][mdn-sharedarraybuffer] having a specified number ```javascript try { - var buf = new SharedArrayBuffer( 5 ); + const buf = new SharedArrayBuffer( 5 ); // returns } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -66,7 +66,7 @@ Number of input arguments the constructor accepts. ```javascript -var len = SharedArrayBuffer.length; +const len = SharedArrayBuffer.length; // returns 1 ``` @@ -78,8 +78,8 @@ var len = SharedArrayBuffer.length; ```javascript try { - var buf = new SharedArrayBuffer( 5 ); - var byteLength = buf.byteLength; + const buf = new SharedArrayBuffer( 5 ); + const byteLength = buf.byteLength; // returns 5 } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -98,12 +98,12 @@ Copies the bytes of a [`SharedArrayBuffer`][mdn-sharedarraybuffer] to a new [`Sh ```javascript try { - var b1 = new SharedArrayBuffer( 10 ); + const b1 = new SharedArrayBuffer( 10 ); - var b2 = b1.slice(); + const b2 = b1.slice(); // returns - var bool = ( b2 === b1 ); + const bool = ( b2 === b1 ); // returns false } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -116,10 +116,10 @@ By default, the method copies from the beginning of the [`SharedArrayBuffer`][md ```javascript try { - var b1 = new SharedArrayBuffer( 10 ); - var b2 = b1.slice( 2 ); + const b1 = new SharedArrayBuffer( 10 ); + const b2 = b1.slice( 2 ); - var nbytes = b2.byteLength; + const nbytes = b2.byteLength; // returns 8 } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -132,10 +132,10 @@ If `start < 0`, the index is relative to the end of the [`SharedArrayBuffer`][md ```javascript try { - var b1 = new SharedArrayBuffer( 10 ); - var b2 = b1.slice( -2 ); + const b1 = new SharedArrayBuffer( 10 ); + const b2 = b1.slice( -2 ); - var nbytes = b2.byteLength; + const nbytes = b2.byteLength; // returns 2 } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -148,10 +148,10 @@ By default, the method copies to the end of the [`SharedArrayBuffer`][mdn-shared ```javascript try { - var b1 = new SharedArrayBuffer( 10 ); - var b2 = b1.slice( 2, 6 ); + const b1 = new SharedArrayBuffer( 10 ); + const b2 = b1.slice( 2, 6 ); - var nbytes = b2.byteLength; + const nbytes = b2.byteLength; // returns 4 } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -164,10 +164,10 @@ If `end < 0`, the index is relative to the end of the [`SharedArrayBuffer`][mdn- ```javascript try { - var b1 = new SharedArrayBuffer( 10 ); - var b2 = b1.slice( 2, -2 ); + const b1 = new SharedArrayBuffer( 10 ); + const b2 = b1.slice( 2, -2 ); - var nbytes = b2.byteLength; + const nbytes = b2.byteLength; // returns 6 } catch ( err ) { console.log( 'Environment does not support SharedArrayBuffers.' ); @@ -201,32 +201,27 @@ try { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); -var SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); +const SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); function main() { - var bytes; - var buf; - var arr; - var i; - // Create a new SharedArrayBuffer: - buf = new SharedArrayBuffer( 64 ); + const buf = new SharedArrayBuffer( 64 ); // Create a Float64 array buffer view: - arr = new Float64Array( buf.byteLength/8 ); - for ( i = 0; i < arr.length; i++ ) { + const arr = new Float64Array( buf.byteLength/8 ); + for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } // Create a "bytes" view of the array buffer: - bytes = new Uint8Array( arr.buffer ); + const bytes = new Uint8Array( arr.buffer ); // Print the bytes: - for ( i = 0; i < bytes.length; i++ ) { + for ( let i = 0; i < bytes.length; i++ ) { console.log( 'byte %d: %s', i, toBinaryString( bytes[ i ] ) ); } } diff --git a/lib/node_modules/@stdlib/array/slice/README.md b/lib/node_modules/@stdlib/array/slice/README.md index bd5dde0c88e6..0c69f1a00b9d 100644 --- a/lib/node_modules/@stdlib/array/slice/README.md +++ b/lib/node_modules/@stdlib/array/slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice = require( '@stdlib/array/slice' ); +const slice = require( '@stdlib/array/slice' ); ``` #### slice( x\[, start\[, end]] ) @@ -45,12 +45,12 @@ var slice = require( '@stdlib/array/slice' ); Returns a shallow copy of a portion of an array. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = slice( x ); +const out = slice( x ); // returns [ 1, 2, 3, 4, 5, 6 ] -var bool = ( out === x ); +const bool = ( out === x ); // returns false ``` @@ -63,18 +63,18 @@ The function accepts the following arguments: By default, the function returns a shallow copy beginning from the first element of the provided input array. To begin copying from an alternative element, provide a starting index (inclusive). ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = slice( x, 2 ); +const out = slice( x, 2 ); // returns [ 3, 4, 5, 6 ] ``` By default, the function copies through the end of the provided input array. To copy up until a specific element, provide an ending index (exclusive). ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; -var out = slice( x, 1, 4 ); +const out = slice( x, 1, 4 ); // returns [ 2, 3, 4 ] ``` @@ -109,14 +109,14 @@ var out = slice( x, 1, 4 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var slice = require( '@stdlib/array/slice' ); +const Float64Array = require( '@stdlib/array/float64' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const slice = require( '@stdlib/array/slice' ); -var x = zeroTo( 6, 'float64' ); +const x = zeroTo( 6, 'float64' ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] -var s = slice( x ); +let s = slice( x ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] s = slice( x, 0, 4 ); diff --git a/lib/node_modules/@stdlib/array/take/README.md b/lib/node_modules/@stdlib/array/take/README.md index 6e3ad8e565fb..a5e313e506c3 100644 --- a/lib/node_modules/@stdlib/array/take/README.md +++ b/lib/node_modules/@stdlib/array/take/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var take = require( '@stdlib/array/take' ); +const take = require( '@stdlib/array/take' ); ``` #### take( x, indices\[, options] ) @@ -35,9 +35,9 @@ var take = require( '@stdlib/array/take' ); Takes elements from an array. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = take( x, [ 1, 3 ] ); +const y = take( x, [ 1, 3 ] ); // returns [ 2, 4 ] ``` @@ -54,18 +54,18 @@ The function supports the following options: By default, the function normalizes negative integer indices to positive integer index equivalents. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = take( x, [ -3, -1 ] ); +const y = take( x, [ -3, -1 ] ); // returns [ 2, 4 ] ``` To specify an alternative index [mode][@stdlib/ndarray/base/ind], provide a `mode` option. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = take( x, [ -10, 10 ], { +const y = take( x, [ -10, 10 ], { 'mode': 'clamp' }); // returns [ 1, 4 ] @@ -82,9 +82,9 @@ var y = take( x, [ -10, 10 ], { - If `indices` is an empty array, the function returns an empty array. ```javascript - var x = [ 1, 2, 3, 4 ]; + const x = [ 1, 2, 3, 4 ]; - var y = take( x, [] ); + const y = take( x, [] ); // returns [] ``` @@ -101,20 +101,20 @@ var y = take( x, [ -10, 10 ], { ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var linspace = require( '@stdlib/array/linspace' ); -var take = require( '@stdlib/array/take' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const linspace = require( '@stdlib/array/linspace' ); +const take = require( '@stdlib/array/take' ); // Generate a linearly spaced array: -var x = linspace( 0, 100, 11 ); +const x = linspace( 0, 100, 11 ); console.log( x ); // Generate an array of random indices: -var indices = discreteUniform( 10, 0, x.length-1 ); +const indices = discreteUniform( 10, 0, x.length-1 ); console.log( indices ); // Take a random sample of elements from `x`: -var y = take( x, indices ); +const y = take( x, indices ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/array/to-circular-iterator/README.md b/lib/node_modules/@stdlib/array/to-circular-iterator/README.md index 74b6dfc1abd4..2ac9f321afc4 100644 --- a/lib/node_modules/@stdlib/array/to-circular-iterator/README.md +++ b/lib/node_modules/@stdlib/array/to-circular-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var circarray2iterator = require( '@stdlib/array/to-circular-iterator' ); +const circarray2iterator = require( '@stdlib/array/to-circular-iterator' ); ``` #### circarray2iterator( src\[, options]\[, mapFcn\[, thisArg]] ) @@ -45,10 +45,10 @@ var circarray2iterator = require( '@stdlib/array/to-circular-iterator' ); Returns an iterator which repeatedly iterates over each element in an array-like `object`. ```javascript -var it = circarray2iterator( [ 1, 2, 3, 4 ] ); +const it = circarray2iterator( [ 1, 2, 3, 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -88,13 +88,13 @@ The function accepts the following `options`: To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 5 }; -var it = circarray2iterator( [ 1, 2, 3, 4 ], opts ); +const it = circarray2iterator( [ 1, 2, 3, 4 ], opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -109,20 +109,20 @@ v = it.next().value; v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` To iterate over elements from right to left, set the `dir` option to `-1`. ```javascript -var opts = { +const opts = { 'dir': -1 }; -var it = circarray2iterator( [ 1, 2, 3, 4 ], opts ); +const it = circarray2iterator( [ 1, 2, 3, 4 ], opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -150,10 +150,10 @@ function fcn( v ) { return v * 10.0; } -var it = circarray2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = circarray2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -177,10 +177,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = circarray2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = circarray2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -200,14 +200,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = circarray2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); +const it = circarray2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -216,7 +216,7 @@ v = it.next().value; v = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -249,26 +249,26 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var circarray2iterator = require( '@stdlib/array/to-circular-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const circarray2iterator = require( '@stdlib/array/to-circular-iterator' ); function scale( v, i, n ) { return v * n; } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 10 ), randu ); +const arr = inmap( new Float64Array( 10 ), randu ); // Create an iterator from the array which scales iterated values: -var opts = { +const opts = { 'iter': arr.length * 10 }; -var it = circarray2iterator( arr, opts, scale ); +const it = circarray2iterator( arr, opts, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-fancy/README.md b/lib/node_modules/@stdlib/array/to-fancy/README.md index abb3b16e8c24..82f911463c2f 100644 --- a/lib/node_modules/@stdlib/array/to-fancy/README.md +++ b/lib/node_modules/@stdlib/array/to-fancy/README.md @@ -29,16 +29,16 @@ limitations under the License. An array supporting **fancy indexing** is an array which supports slicing via indexing expressions for both retrieval and assignment. ```javascript -var array2fancy = require( '@stdlib/array/to-fancy' ); +const array2fancy = require( '@stdlib/array/to-fancy' ); // Create a plain array: -var x = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const x = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; // Turn the plain array into a "fancy" array: -var y = array2fancy( x ); +const y = array2fancy( x ); // Select the first 3 elements: -var v = y[ ':3' ]; +let v = y[ ':3' ]; // returns [ 1, 2, 3 ] // Select every other element, starting from the second element: @@ -68,7 +68,7 @@ v = y[ ':' ]; ## Usage ```javascript -var array2fancy = require( '@stdlib/array/to-fancy' ); +const array2fancy = require( '@stdlib/array/to-fancy' ); ``` #### array2fancy( x\[, options] ) @@ -76,15 +76,15 @@ var array2fancy = require( '@stdlib/array/to-fancy' ); Converts an array to an object supporting fancy indexing. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = array2fancy( x ); +const y = array2fancy( x ); // returns // Normal element access: -var v = y[ 0 ]; +let v = y[ 0 ]; // returns 1 v = y[ 1 ]; @@ -130,9 +130,9 @@ The function supports the following options: By default, the function returns a fancy array which does **not** enforce strict bounds checking. For example, ```javascript -var y = array2fancy( [ 1, 2, 3, 4 ] ); +const y = array2fancy( [ 1, 2, 3, 4 ] ); -var v = y[ 10 ]; +const v = y[ 10 ]; // returns undefined ``` @@ -141,11 +141,11 @@ To enforce strict bounds checking, set the `strict` option to `true`. ```javascript -var y = array2fancy( [ 1, 2, 3, 4 ], { +const y = array2fancy( [ 1, 2, 3, 4 ], { 'strict': true }); -var v = y[ 10 ]; +const v = y[ 10 ]; // throws ``` @@ -154,14 +154,14 @@ var v = y[ 10 ]; Returns a function for converting an array to an object supporting fancy indexing. ```javascript -var fcn = array2fancy.factory(); +const fcn = array2fancy.factory(); -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var y = fcn( x ); +const y = fcn( x ); // returns -var v = y[ ':' ]; +const v = y[ ':' ]; // returns [ 1, 2, 3, 4 ] ``` @@ -184,11 +184,11 @@ The function supports the following options: By default, the function returns a function which, by default, does **not** enforce strict bounds checking. For example, ```javascript -var fcn = array2fancy.factory(); +const fcn = array2fancy.factory(); -var y = fcn( [ 1, 2, 3, 4 ] ); +const y = fcn( [ 1, 2, 3, 4 ] ); -var v = y[ 10 ]; +const v = y[ 10 ]; // returns undefined ``` @@ -197,12 +197,12 @@ To enforce strict bounds checking by default, set the `strict` option to `true`. ```javascript -var fcn = array2fancy.factory({ +const fcn = array2fancy.factory({ 'strict': true }); -var y = fcn( [ 1, 2, 3, 4 ] ); +const y = fcn( [ 1, 2, 3, 4 ] ); -var v = y[ 10 ]; +const v = y[ 10 ]; // throws ``` @@ -213,9 +213,9 @@ The returned function supports the same options as above. When the returned func Wraps a provided array as an array index object. ```javascript -var x = [ 1, 2, 3, 4 ]; +const x = [ 1, 2, 3, 4 ]; -var idx = array2fancy.idx( x ); +const idx = array2fancy.idx( x ); // returns ``` @@ -249,12 +249,12 @@ Accordingly, when `strict` is `false`, one may observe the following behaviors: ```javascript -var x = array2fancy( [ 1, 2, 3, 4 ], { +const x = array2fancy( [ 1, 2, 3, 4 ], { 'strict': false }); // Access a non-existent property: -var v = x[ 'foo' ]; +let v = x[ 'foo' ]; // returns undefined // Access an out-of-bounds index: @@ -269,7 +269,7 @@ v = x[ '10:' ]; // returns [] // Access one or more out-of-bounds indices: -var i = array2fancy.idx( [ 10, 20 ] ); +const i = array2fancy.idx( [ 10, 20 ] ); v = x[ i ]; // throws ``` @@ -279,12 +279,12 @@ When `strict` is `true`, fancy arrays normalize index behavior and consistently ```javascript -var x = array2fancy( [ 1, 2, 3, 4 ], { +const x = array2fancy( [ 1, 2, 3, 4 ], { 'strict': true }); // Access a non-existent property: -var v = x[ 'foo' ]; +let v = x[ 'foo' ]; // returns undefined // Access an out-of-bounds index: @@ -299,7 +299,7 @@ v = x[ '10:' ]; // throws // Access one or more out-of-bounds indices: -var i = array2fancy.idx( [ 10, 20 ] ); +const i = array2fancy.idx( [ 10, 20 ] ); v = x[ i ]; // throws ``` @@ -309,11 +309,11 @@ v = x[ i ]; Fancy arrays support **broadcasting** in which assigned scalars and single-element arrays are repeated (without additional memory allocation) to match the length of a target array instance. ```javascript -var y = array2fancy( [ 1, 2, 3, 4 ] ); +const y = array2fancy( [ 1, 2, 3, 4 ] ); // Broadcast a scalar: y[ ':' ] = 5; -var v = y[ ':' ]; +let v = y[ ':' ]; // returns [ 5, 5, 5, 5 ] // Broadcast a single-element array: @@ -325,10 +325,10 @@ v = y[ ':' ]; Fancy array broadcasting follows the [same rules][@stdlib/ndarray/base/broadcast-shapes] as for [ndarrays][@stdlib/ndarray/ctor]. Consequently, when assigning arrays to slices, the array on the right-hand-side must be broadcast-compatible with number of elements in the slice. For example, each assignment expression in the following example follows broadcast rules and is thus valid. ```javascript -var y = array2fancy( [ 1, 2, 3, 4 ] ); +const y = array2fancy( [ 1, 2, 3, 4 ] ); y[ ':' ] = [ 5, 6, 7, 8 ]; -var v = y[ ':' ]; +let v = y[ ':' ]; // returns [ 5, 6, 7, 8 ] y[ '1::2' ] = [ 9, 10 ]; @@ -362,7 +362,7 @@ However, the following assignment expressions are not valid. ```javascript -var y = array2fancy( [ 1, 2, 3, 4 ] ); +const y = array2fancy( [ 1, 2, 3, 4 ] ); y[ ':' ] = [ 5, 6 ]; // throws @@ -375,11 +375,11 @@ y[ '10:20' ] = [ 8, 9, 10, 11 ]; In order to broadcast a nested array element as one would a scalar, one must wrap the element in a single-element array. ```javascript -var y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] ); +let y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] ); // Assign individual array elements: y[ ':' ] = [ 5, 6 ]; -var v = y[ ':' ]; +let v = y[ ':' ]; // returns [ 5, 6 ] y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] ); @@ -395,11 +395,11 @@ v = y[ ':' ]; Fancy arrays support [(mostly) safe casts][@stdlib/array/mostly-safe-casts] (i.e., any cast which can be performed without overflow or loss of precision, with the exception of floating-point arrays which are also allowed to downcast from higher precision to lower precision). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Int32Array = require( '@stdlib/array/int32' ); -var x = new Int32Array( [ 1, 2, 3, 4 ] ); -var y = array2fancy( x ); +const x = new Int32Array( [ 1, 2, 3, 4 ] ); +const y = array2fancy( x ); // 8-bit unsigned integer values can be safely cast to 32-bit signed integer values: y[ ':' ] = new Uint8Array( [ 5, 6, 7, 8 ] ); @@ -410,10 +410,10 @@ When attempting to perform an unsafe cast, fancy arrays will raise an exception. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Uint8Array( [ 1, 2, 3, 4 ] ); -var y = array2fancy( x ); +const x = new Uint8Array( [ 1, 2, 3, 4 ] ); +const y = array2fancy( x ); // Attempt to assign a non-integer value: y[ ':' ] = 3.14; @@ -427,21 +427,21 @@ y[ ':' ] = -3; When assigning a real-valued scalar to a complex number array (e.g., [`Complex128Array`][@stdlib/array/complex128] or [`Complex64Array`][@stdlib/array/complex64]), a fancy array will cast the real-valued scalar to a complex number argument having an imaginary component equal to zero. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = array2fancy( x ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = array2fancy( x ); // Retrieve the first element: -var v = y[ 0 ]; +let v = y[ 0 ]; // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns 2.0 // Assign a real-valued scalar to the first element: @@ -472,17 +472,17 @@ im = imag( v ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var Int32Array = require( '@stdlib/array/int32' ); -var BooleanArray = require( '@stdlib/array/bool' ); -var array2fancy = require( '@stdlib/array/to-fancy' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Int32Array = require( '@stdlib/array/int32' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const array2fancy = require( '@stdlib/array/to-fancy' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = array2fancy( x ); +let x = [ 1, 2, 3, 4, 5, 6 ]; +let y = array2fancy( x ); // returns // Slice retrieval: -var z = y[ '1::2' ]; +let z = y[ '1::2' ]; // returns [ 2, 4, 6 ] z = y[ '-2::-2' ]; @@ -501,9 +501,9 @@ z = y[ ':' ]; // returns [ 1, 2, -10, -9, -8, 6 ] // Array index retrieval: -var idx = array2fancy.idx; +const idx = array2fancy.idx; -var i = idx( [ 1, 3, 4 ] ); // integer index array +let i = idx( [ 1, 3, 4 ] ); // integer index array z = y[ i ]; // returns [ 2, -9, -8 ] diff --git a/lib/node_modules/@stdlib/array/to-iterator-right/README.md b/lib/node_modules/@stdlib/array/to-iterator-right/README.md index 81a0609b64c8..352a98878800 100644 --- a/lib/node_modules/@stdlib/array/to-iterator-right/README.md +++ b/lib/node_modules/@stdlib/array/to-iterator-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var array2iteratorRight = require( '@stdlib/array/to-iterator-right' ); +const array2iteratorRight = require( '@stdlib/array/to-iterator-right' ); ``` #### array2iteratorRight( src\[, mapFcn\[, thisArg]] ) @@ -45,10 +45,10 @@ var array2iteratorRight = require( '@stdlib/array/to-iterator-right' ); Returns an iterator which iterates from right to left over each element in an array-like `object`. ```javascript -var it = array2iteratorRight( [ 1, 2, 3, 4 ] ); +const it = array2iteratorRight( [ 1, 2, 3, 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -72,10 +72,10 @@ function fcn( v ) { return v * 10.0; } -var it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn ); +const it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; @@ -98,10 +98,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn ); +const it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 16 v = it.next().value; @@ -121,14 +121,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn, ctx ); +const it = array2iteratorRight( [ 1, 2, 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; @@ -137,7 +137,7 @@ v = it.next().value; v = it.next().value; // returns 20.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -170,23 +170,23 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var array2iteratorRight = require( '@stdlib/array/to-iterator-right' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const array2iteratorRight = require( '@stdlib/array/to-iterator-right' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 100 ), randu ); +const arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator from the array which scales iterated values: -var it = array2iteratorRight( arr, scale ); +const it = array2iteratorRight( arr, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-iterator/README.md b/lib/node_modules/@stdlib/array/to-iterator/README.md index 4b1dff1728f8..2b11e9d4c90c 100644 --- a/lib/node_modules/@stdlib/array/to-iterator/README.md +++ b/lib/node_modules/@stdlib/array/to-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); ``` #### array2iterator( src\[, mapFcn\[, thisArg]] ) @@ -45,10 +45,10 @@ var array2iterator = require( '@stdlib/array/to-iterator' ); Returns an iterator which iterates over each element in an array-like `object`. ```javascript -var it = array2iterator( [ 1, 2, 3, 4 ] ); +const it = array2iterator( [ 1, 2, 3, 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -72,10 +72,10 @@ function fcn( v ) { return v * 10.0; } -var it = array2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = array2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -98,10 +98,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = array2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = array2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -121,14 +121,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = array2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); +const it = array2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -137,7 +137,7 @@ v = it.next().value; v = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -170,23 +170,23 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 100 ), randu ); +const arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator from the array which scales iterated values: -var it = array2iterator( arr, scale ); +const it = array2iterator( arr, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-json/README.md b/lib/node_modules/@stdlib/array/to-json/README.md index 6ab48dd0c7e1..0b59ea3bc0c4 100644 --- a/lib/node_modules/@stdlib/array/to-json/README.md +++ b/lib/node_modules/@stdlib/array/to-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typedarray2json = require( '@stdlib/array/to-json' ); +const typedarray2json = require( '@stdlib/array/to-json' ); ``` #### typedarray2json( typedarray ) @@ -45,11 +45,11 @@ var typedarray2json = require( '@stdlib/array/to-json' ); Returns a [JSON][json] representation of a typed array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var arr = new Float64Array( [ 5.0, 3.0 ] ); +const arr = new Float64Array( [ 5.0, 3.0 ] ); -var json = typedarray2json( arr ); +const json = typedarray2json( arr ); /* returns { 'type': 'Float64Array', @@ -96,9 +96,9 @@ For guidance on reviving a JSON-serialized typed array, see [`reviver()`][@stdli } } - var arr = new CustomArray( [ 5.0, 3.0 ] ); + const arr = new CustomArray( [ 5.0, 3.0 ] ); - var json = typedarray2json( arr ); + const json = typedarray2json( arr ); /* returns { 'type': 'Float64Array', @@ -120,22 +120,22 @@ For guidance on reviving a JSON-serialized typed array, see [`reviver()`][@stdli ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var BooleanArray = require( '@stdlib/array/bool' ); -var typedarray2json = require( '@stdlib/array/to-json' ); - -var arr = new Float64Array( [ 5.0, 3.0 ] ); -var json = typedarray2json( arr ); +const Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const typedarray2json = require( '@stdlib/array/to-json' ); + +let arr = new Float64Array( [ 5.0, 3.0 ] ); +let json = typedarray2json( arr ); /* returns { 'type': 'Float64Array', diff --git a/lib/node_modules/@stdlib/array/to-sparse-iterator-right/README.md b/lib/node_modules/@stdlib/array/to-sparse-iterator-right/README.md index ae99fdb56dc9..636531b55c27 100644 --- a/lib/node_modules/@stdlib/array/to-sparse-iterator-right/README.md +++ b/lib/node_modules/@stdlib/array/to-sparse-iterator-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sparsearray2iteratorRight = require( '@stdlib/array/to-sparse-iterator-right' ); +const sparsearray2iteratorRight = require( '@stdlib/array/to-sparse-iterator-right' ); ``` #### sparsearray2iteratorRight( src\[, mapFcn\[, thisArg]] ) @@ -47,16 +47,16 @@ Returns an iterator which iterates from right to left over each element in a spa ```javascript -var it = sparsearray2iteratorRight( [ 1, , , 4 ] ); +const it = sparsearray2iteratorRight( [ 1, , , 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -74,10 +74,10 @@ function fcn( v ) { return v * 10.0; } -var it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn ); +const it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; @@ -99,10 +99,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn ); +const it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 16 v = it.next().value; @@ -122,20 +122,20 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn, ctx ); +const it = sparsearray2iteratorRight( [ 1, 2, , 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; // returns 20.0 -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -168,27 +168,26 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var sparsearray2iteratorRight = require( '@stdlib/array/to-sparse-iterator-right' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const sparsearray2iteratorRight = require( '@stdlib/array/to-sparse-iterator-right' ); function scale( v, i ) { return v * (i+1); } // Create an array partially filled with random numbers: -var arr = new Array( 100 ); -var i; -for ( i = 0; i < arr.length; i += 2 ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i += 2 ) { arr[ i ] = randu(); } // Create an iterator from the array which scales iterated values: -var it = sparsearray2iteratorRight( arr, scale ); +const it = sparsearray2iteratorRight( arr, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-sparse-iterator/README.md b/lib/node_modules/@stdlib/array/to-sparse-iterator/README.md index 0e2a59379966..95bc15a03be0 100644 --- a/lib/node_modules/@stdlib/array/to-sparse-iterator/README.md +++ b/lib/node_modules/@stdlib/array/to-sparse-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sparsearray2iterator = require( '@stdlib/array/to-sparse-iterator' ); +const sparsearray2iterator = require( '@stdlib/array/to-sparse-iterator' ); ``` #### sparsearray2iterator( src\[, mapFcn\[, thisArg]] ) @@ -47,16 +47,16 @@ Returns an iterator which iterates over each element in a sparse array-like `obj ```javascript -var it = sparsearray2iterator( [ 1, , , 4 ] ); +const it = sparsearray2iterator( [ 1, , , 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -74,10 +74,10 @@ function fcn( v ) { return v * 10.0; } -var it = sparsearray2iterator( [ 1, , 3, 4 ], fcn ); +const it = sparsearray2iterator( [ 1, , 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -99,10 +99,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = sparsearray2iterator( [ 1, 2, , 4 ], fcn ); +const it = sparsearray2iterator( [ 1, 2, , 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -122,20 +122,20 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = sparsearray2iterator( [ 1, , 3, 4 ], fcn, ctx ); +const it = sparsearray2iterator( [ 1, , 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -168,27 +168,26 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var sparsearray2iterator = require( '@stdlib/array/to-sparse-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const sparsearray2iterator = require( '@stdlib/array/to-sparse-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an array partially filled with random numbers: -var arr = new Array( 100 ); -var i; -for ( i = 0; i < arr.length; i += 2 ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i += 2 ) { arr[ i ] = randu(); } // Create an iterator from the array which scales iterated values: -var it = sparsearray2iterator( arr, scale ); +const it = sparsearray2iterator( arr, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-strided-iterator/README.md b/lib/node_modules/@stdlib/array/to-strided-iterator/README.md index bba0a74a370a..5ba25a584e4d 100644 --- a/lib/node_modules/@stdlib/array/to-strided-iterator/README.md +++ b/lib/node_modules/@stdlib/array/to-strided-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var stridedarray2iterator = require( '@stdlib/array/to-strided-iterator' ); +const stridedarray2iterator = require( '@stdlib/array/to-strided-iterator' ); ``` #### stridedarray2iterator( N, src, stride, offset\[, mapFcn\[, thisArg]] ) @@ -45,16 +45,16 @@ var stridedarray2iterator = require( '@stdlib/array/to-strided-iterator' ); Returns an [iterator][mdn-iterator-protocol] which iterates over elements in an array-like `object` according to specified stride parameters. ```javascript -var values = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const values = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; -var N = 4; -var stride = -2; -var offset = 6; +const N = 4; +const stride = -2; +const offset = 6; -var it = stridedarray2iterator( N, values, stride, offset ); +const it = stridedarray2iterator( N, values, stride, offset ); // returns -var v = it.next().value; +let v = it.next().value; // returns 7 v = it.next().value; @@ -78,10 +78,10 @@ function fcn( v ) { return v * 10.0; } -var it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn ); +const it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -105,10 +105,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn ); +const it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -128,14 +128,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn, ctx ); +const it = stridedarray2iterator( 4, [ 1, 2, 3, 4 ], 1, 0, fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -144,7 +144,7 @@ v = it.next().value; v = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -177,23 +177,23 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var stridedarray2iterator = require( '@stdlib/array/to-strided-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const stridedarray2iterator = require( '@stdlib/array/to-strided-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 100 ), randu ); +const arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator which scales every fourth value in reverse order: -var it = stridedarray2iterator( 25, arr, -4, 99, scale ); +const it = stridedarray2iterator( 25, arr, -4, 99, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-view-iterator-right/README.md b/lib/node_modules/@stdlib/array/to-view-iterator-right/README.md index 54970bdc3e2a..edf1c12e961e 100644 --- a/lib/node_modules/@stdlib/array/to-view-iterator-right/README.md +++ b/lib/node_modules/@stdlib/array/to-view-iterator-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arrayview2iteratorRight = require( '@stdlib/array/to-view-iterator-right' ); +const arrayview2iteratorRight = require( '@stdlib/array/to-view-iterator-right' ); ``` #### arrayview2iteratorRight( src\[, begin\[, end]]\[, mapFcn\[, thisArg]] ) @@ -45,10 +45,10 @@ var arrayview2iteratorRight = require( '@stdlib/array/to-view-iterator-right' ); Returns an iterator which iterates from right to left over each element in an array-like `object` view. ```javascript -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ] ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: The `begin` and `end` arguments define the starting (inclusive) and ending (non-inclusive) indices of the array view. By default, the returned iterator starts iterating from the last element in an array-like `object` (i.e., from the "end"). To specify an alternative view end, provide an `end` argument (non-inclusive). ```javascript -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 0, 3 ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 0, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; @@ -80,17 +80,17 @@ v = it.next().value; v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `end` is less than `0`, the first iterated value is resolved relative to the last view element. For example, the following generates the same behavior as in the previous example ```javascript -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 0, -1 ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 0, -1 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; @@ -99,17 +99,17 @@ v = it.next().value; v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` By default, the returned iterator iterates through the first element in an array-like `object` view. To specify an alternative view beginning, provide a `begin` argument (inclusive). ```javascript -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 1 ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], 1 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -118,17 +118,17 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `begin` is less than `0`, the last iterated value is resolved relative to the last view element. For example, the following generates the same behavior as in the previous example ```javascript -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], -3 ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], -3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -137,7 +137,7 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -148,10 +148,10 @@ function fcn( v ) { return v * 10.0; } -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; @@ -175,10 +175,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 16 v = it.next().value; @@ -198,14 +198,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn, ctx ); +const it = arrayview2iteratorRight( [ 1, 2, 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 40.0 v = it.next().value; @@ -214,7 +214,7 @@ v = it.next().value; v = it.next().value; // returns 20.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -247,23 +247,23 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var arrayview2iteratorRight = require( '@stdlib/array/to-view-iterator-right' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const arrayview2iteratorRight = require( '@stdlib/array/to-view-iterator-right' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 100 ), randu ); +const arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator from an array view which scales iterated values: -var it = arrayview2iteratorRight( arr, 40, 60, scale ); +const it = arrayview2iteratorRight( arr, 40, 60, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/to-view-iterator/README.md b/lib/node_modules/@stdlib/array/to-view-iterator/README.md index c47d091f9a31..2d68c54ca20f 100644 --- a/lib/node_modules/@stdlib/array/to-view-iterator/README.md +++ b/lib/node_modules/@stdlib/array/to-view-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arrayview2iterator = require( '@stdlib/array/to-view-iterator' ); +const arrayview2iterator = require( '@stdlib/array/to-view-iterator' ); ``` #### arrayview2iterator( src\[, begin\[, end]]\[, mapFcn\[, thisArg]] ) @@ -45,10 +45,10 @@ var arrayview2iterator = require( '@stdlib/array/to-view-iterator' ); Returns an iterator which iterates over each element in an array-like `object` view. ```javascript -var it = arrayview2iterator( [ 1, 2, 3, 4 ] ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ] ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: By default, the returned iterator begins iterating from the first element in an array-like `object`. To specify an alternative starting index, provide a `begin` argument (inclusive). ```javascript -var it = arrayview2iterator( [ 1, 2, 3, 4 ], 1 ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], 1 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -80,17 +80,17 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `begin` is less than `0`, the starting index is resolved relative to the last element. For example, the following generates the same behavior as in the previous example ```javascript -var it = arrayview2iterator( [ 1, 2, 3, 4 ], -3 ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], -3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -99,17 +99,17 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` By default, the returned iterator iterates until the last element in an array-like `object`. To specify an alternative ending index, provide an `end` argument (non-inclusive). ```javascript -var it = arrayview2iterator( [ 1, 2, 3, 4 ], 0, 3 ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], 0, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -118,17 +118,17 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `end` is less than `0`, the ending index is resolved relative to the last element. For example, the following generates the same behavior as in the previous example ```javascript -var it = arrayview2iterator( [ 1, 2, 3, 4 ], 0, -1 ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], 0, -1 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -137,7 +137,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -148,10 +148,10 @@ function fcn( v ) { return v * 10.0; } -var it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -175,10 +175,10 @@ function fcn( v, i ) { return v * (i+1); } -var it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -198,14 +198,14 @@ function fcn( v ) { return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); +const it = arrayview2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10.0 v = it.next().value; @@ -214,7 +214,7 @@ v = it.next().value; v = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -247,23 +247,23 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var inmap = require( '@stdlib/utils/inmap' ); -var randu = require( '@stdlib/random/base/randu' ); -var arrayview2iterator = require( '@stdlib/array/to-view-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const inmap = require( '@stdlib/utils/inmap' ); +const randu = require( '@stdlib/random/base/randu' ); +const arrayview2iterator = require( '@stdlib/array/to-view-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: -var arr = inmap( new Float64Array( 100 ), randu ); +const arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator from an array view which scales iterated values: -var it = arrayview2iterator( arr, 40, 60, scale ); +const it = arrayview2iterator( arr, 40, 60, scale ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/array/typed-complex-ctors/README.md b/lib/node_modules/@stdlib/array/typed-complex-ctors/README.md index e7c5cd515e24..75388d38fb0b 100644 --- a/lib/node_modules/@stdlib/array/typed-complex-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-complex-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-complex-ctors' ); +const ctors = require( '@stdlib/array/typed-complex-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-complex-ctors' ); Returns a complex typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'complex128' ); +const ctor = ctors( 'complex128' ); // returns ``` @@ -57,7 +57,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns null ``` @@ -82,15 +82,13 @@ var ctor = ctors( 'float64' ); ```javascript -var dtypes = require( '@stdlib/array/typed-complex-dtypes' ); -var ctors = require( '@stdlib/array/typed-complex-ctors' ); +const dtypes = require( '@stdlib/array/typed-complex-dtypes' ); +const ctors = require( '@stdlib/array/typed-complex-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-complex-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-complex-dtypes/README.md index 8420df3907bc..cbfa8b4e807b 100644 --- a/lib/node_modules/@stdlib/array/typed-complex-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-complex-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-complex-dtypes' ); +const dtypes = require( '@stdlib/array/typed-complex-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-complex-dtypes' ); Returns a list of complex typed array data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'complex64', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-complex-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-complex-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'complex64' ); +let bool = isdtype( 'complex64' ); // returns true bool = isdtype( 'complex128' ); diff --git a/lib/node_modules/@stdlib/array/typed-complex/README.md b/lib/node_modules/@stdlib/array/typed-complex/README.md index bbb240fa69d1..37c7f14bed16 100644 --- a/lib/node_modules/@stdlib/array/typed-complex/README.md +++ b/lib/node_modules/@stdlib/array/typed-complex/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var complexarray = require( '@stdlib/array/typed-complex' ); +const complexarray = require( '@stdlib/array/typed-complex' ); ``` #### complexarray( \[dtype] ) @@ -45,7 +45,7 @@ var complexarray = require( '@stdlib/array/typed-complex' ); Creates a complex number typed array having a specified data type `dtype`. ```javascript -var arr = complexarray(); +const arr = complexarray(); // returns ``` @@ -57,7 +57,7 @@ The function recognizes the following data types: By default, the output complex number typed array data type is `complex128`. To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = complexarray( 'complex64' ); +const arr = complexarray( 'complex64' ); // returns ``` @@ -66,10 +66,10 @@ var arr = complexarray( 'complex64' ); Returns a complex number typed array having a specified `length`. ```javascript -var arr1 = complexarray( 5 ); +const arr1 = complexarray( 5 ); // returns -var arr2 = complexarray( 5, 'complex64' ); +const arr2 = complexarray( 5, 'complex64' ); // returns ``` @@ -78,13 +78,13 @@ var arr2 = complexarray( 5, 'complex64' ); Creates a complex number typed array from another complex number typed array. ```javascript -var arr1 = complexarray( [ 5.0, -3.0, 2.0, 1.0 ] ); +const arr1 = complexarray( [ 5.0, -3.0, 2.0, 1.0 ] ); // returns -var arr2 = complexarray( arr1 ); +const arr2 = complexarray( arr1 ); // returns -var arr3 = complexarray( arr1, 'complex64' ); +const arr3 = complexarray( arr1, 'complex64' ); // returns ``` @@ -93,10 +93,10 @@ var arr3 = complexarray( arr1, 'complex64' ); Creates a complex number typed array from an array-like object or iterable. ```javascript -var arr1 = complexarray( [ 0.5, 0.5, 0.5, 0.5 ] ); +const arr1 = complexarray( [ 0.5, 0.5, 0.5, 0.5 ] ); // returns -var arr2 = complexarray( [ 0.5, 0.5, 0.5, 0.5 ], 'complex64' ); +const arr2 = complexarray( [ 0.5, 0.5, 0.5, 0.5 ], 'complex64' ); // returns ``` @@ -107,25 +107,25 @@ If a provided array-like object contains interleaved real and imaginary componen Returns a complex number typed array view of an [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 64 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 64 ); -var arr1 = complexarray( buf ); +const arr1 = complexarray( buf ); // returns -var arr2 = complexarray( buf, 'complex64' ); +const arr2 = complexarray( buf, 'complex64' ); // returns -var arr3 = complexarray( buf, 32 ); +const arr3 = complexarray( buf, 32 ); // returns -var arr4 = complexarray( buf, 32, 'complex64' ); +const arr4 = complexarray( buf, 32, 'complex64' ); // returns -var arr5 = complexarray( buf, 32, 1 ); +const arr5 = complexarray( buf, 32, 1 ); // returns -var arr6 = complexarray( buf, 24, 4, 'complex64' ); +const arr6 = complexarray( buf, 24, 4, 'complex64' ); // returns ``` @@ -150,26 +150,26 @@ var arr6 = complexarray( buf, 24, 4, 'complex64' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' ); -var complexarray = require( '@stdlib/array/typed-complex' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' ); +const complexarray = require( '@stdlib/array/typed-complex' ); function rand() { - var re = discreteUniform( -10, 10 ); - var im = discreteUniform( -10, 10 ); + const re = discreteUniform( -10, 10 ); + const im = discreteUniform( -10, 10 ); return new Complex128( re, im ); } // Create a new complex number typed array: -var arr = complexarray( 100, 'complex128' ); +const arr = complexarray( 100, 'complex128' ); // Fill the array with random complex numbers: gfillBy( arr.length, arr, 1, rand ); // Reinterpret the complex number array as a `Float64Array`: -var view = reinterpret128( arr, 0 ); +const view = reinterpret128( arr, 0 ); // View the results: console.log( view ); diff --git a/lib/node_modules/@stdlib/array/typed-ctors/README.md b/lib/node_modules/@stdlib/array/typed-ctors/README.md index 9c3867fbb4f9..a47b04a89c65 100644 --- a/lib/node_modules/@stdlib/array/typed-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-ctors' ); +const ctors = require( '@stdlib/array/typed-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-ctors' ); Returns a typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` @@ -67,7 +67,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -92,15 +92,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/array/typed-dtypes' ); -var ctors = require( '@stdlib/array/typed-ctors' ); +const dtypes = require( '@stdlib/array/typed-dtypes' ); +const ctors = require( '@stdlib/array/typed-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-dtypes/README.md index ee7df88724d3..579fe8feb289 100644 --- a/lib/node_modules/@stdlib/array/typed-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-dtypes' ); +const dtypes = require( '@stdlib/array/typed-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-dtypes' ); Returns a list of typed array data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'float32', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/array/typed-float-ctors/README.md b/lib/node_modules/@stdlib/array/typed-float-ctors/README.md index 66bf3e25288e..08ca30ed5e52 100644 --- a/lib/node_modules/@stdlib/array/typed-float-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-float-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-float-ctors' ); +const ctors = require( '@stdlib/array/typed-float-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-float-ctors' ); Returns a floating-point typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` @@ -59,7 +59,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -84,15 +84,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/array/typed-float-dtypes' ); -var ctors = require( '@stdlib/array/typed-float-ctors' ); +const dtypes = require( '@stdlib/array/typed-float-dtypes' ); +const ctors = require( '@stdlib/array/typed-float-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-float-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-float-dtypes/README.md index fbcf4cf61284..cdf51a00c4bc 100644 --- a/lib/node_modules/@stdlib/array/typed-float-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-float-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-float-dtypes' ); +const dtypes = require( '@stdlib/array/typed-float-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-float-dtypes' ); Returns a list of typed array floating-point data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'float32', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-float-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-float-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'complex128' ); diff --git a/lib/node_modules/@stdlib/array/typed-integer-ctors/README.md b/lib/node_modules/@stdlib/array/typed-integer-ctors/README.md index 7a58a4e29870..c0bf69549992 100644 --- a/lib/node_modules/@stdlib/array/typed-integer-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-integer-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-integer-ctors' ); +const ctors = require( '@stdlib/array/typed-integer-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-integer-ctors' ); Returns an integer-valued typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'int32' ); +const ctor = ctors( 'int32' ); // returns ``` @@ -62,7 +62,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'int' ); +const ctor = ctors( 'int' ); // returns null ``` @@ -87,15 +87,13 @@ var ctor = ctors( 'int' ); ```javascript -var dtypes = require( '@stdlib/array/typed-integer-dtypes' ); -var ctors = require( '@stdlib/array/typed-integer-ctors' ); +const dtypes = require( '@stdlib/array/typed-integer-dtypes' ); +const ctors = require( '@stdlib/array/typed-integer-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-integer-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-integer-dtypes/README.md index 714e61791db8..9fcf878c6203 100644 --- a/lib/node_modules/@stdlib/array/typed-integer-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-integer-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-integer-dtypes' ); +const dtypes = require( '@stdlib/array/typed-integer-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-integer-dtypes' ); Returns a list of typed array integer data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'int16', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-integer-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-integer-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'int32' ); +let bool = isdtype( 'int32' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/array/typed-real-ctors/README.md b/lib/node_modules/@stdlib/array/typed-real-ctors/README.md index 4eb613ef0cd8..65d6a1c3dcc8 100644 --- a/lib/node_modules/@stdlib/array/typed-real-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-real-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-real-ctors' ); +const ctors = require( '@stdlib/array/typed-real-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-real-ctors' ); Returns a typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` @@ -64,7 +64,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -89,15 +89,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); -var ctors = require( '@stdlib/array/typed-real-ctors' ); +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const ctors = require( '@stdlib/array/typed-real-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-real-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-real-dtypes/README.md index e60592faf026..1bec3d6dd506 100644 --- a/lib/node_modules/@stdlib/array/typed-real-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-real-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-real-dtypes' ); Returns a list of typed array real-valued data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'float32', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-real-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-real-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/array/typed-real-float-ctors/README.md b/lib/node_modules/@stdlib/array/typed-real-float-ctors/README.md index 90731beec4f6..914aa5c2ac0e 100644 --- a/lib/node_modules/@stdlib/array/typed-real-float-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-real-float-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-real-float-ctors' ); +const ctors = require( '@stdlib/array/typed-real-float-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-real-float-ctors' ); Returns a real-valued floating-point typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` @@ -57,7 +57,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -82,15 +82,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var ctors = require( '@stdlib/array/typed-real-float-ctors' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const ctors = require( '@stdlib/array/typed-real-float-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-real-float-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-real-float-dtypes/README.md index 36d42067a4fd..e15f9aaf2f73 100644 --- a/lib/node_modules/@stdlib/array/typed-real-float-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-real-float-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); Returns a list of typed array real-valued floating-point data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'float32', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'float32' ); diff --git a/lib/node_modules/@stdlib/array/typed-real/README.md b/lib/node_modules/@stdlib/array/typed-real/README.md index 6117c92b5fa2..d3054bd4242d 100644 --- a/lib/node_modules/@stdlib/array/typed-real/README.md +++ b/lib/node_modules/@stdlib/array/typed-real/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var realarray = require( '@stdlib/array/typed-real' ); +const realarray = require( '@stdlib/array/typed-real' ); ``` #### realarray( \[dtype] ) @@ -45,7 +45,7 @@ var realarray = require( '@stdlib/array/typed-real' ); Creates a [typed array][mdn-typed-array] having a specified data type `dtype`. ```javascript -var arr = realarray(); +const arr = realarray(); // returns ``` @@ -64,7 +64,7 @@ The function recognizes the following data types: By default, the output [typed array][mdn-typed-array] data type is `float64`. To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = realarray( 'int32' ); +const arr = realarray( 'int32' ); // returns ``` @@ -73,10 +73,10 @@ var arr = realarray( 'int32' ); Returns a [typed array][mdn-typed-array] having a specified `length`. ```javascript -var arr1 = realarray( 5 ); +const arr1 = realarray( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr2 = realarray( 5, 'uint8' ); +const arr2 = realarray( 5, 'uint8' ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -85,13 +85,13 @@ var arr2 = realarray( 5, 'uint8' ); Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-array]. ```javascript -var arr1 = realarray( [ 5.0, -3.0, 2.0 ] ); +const arr1 = realarray( [ 5.0, -3.0, 2.0 ] ); // returns [ 5.0, -3.0, 2.0 ] -var arr2 = realarray( arr1 ); +const arr2 = realarray( arr1 ); // returns [ 5.0, -3.0, 2.0 ] -var arr3 = realarray( arr1, 'int32' ); +const arr3 = realarray( arr1, 'int32' ); // returns [ 5, -3, 2 ] ``` @@ -100,10 +100,10 @@ var arr3 = realarray( arr1, 'int32' ); Creates a [typed array][mdn-typed-array] from an array-like object or iterable. ```javascript -var arr1 = realarray( [ 0.5, 0.5, 0.5 ] ); +const arr1 = realarray( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] -var arr2 = realarray( [ 0.5, 0.5, 0.5 ], 'float32' ); +const arr2 = realarray( [ 0.5, 0.5, 0.5 ], 'float32' ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -112,25 +112,25 @@ var arr2 = realarray( [ 0.5, 0.5, 0.5 ], 'float32' ); Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 32 ); -var arr1 = realarray( buf ); +const arr1 = realarray( buf ); // returns [ 0.0, 0.0, 0.0, 0.0 ] -var arr2 = realarray( buf, 'float32' ); +const arr2 = realarray( buf, 'float32' ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr3 = realarray( buf, 16 ); +const arr3 = realarray( buf, 16 ); // returns [ 0.0, 0.0 ] -var arr4 = realarray( buf, 16, 'float32' ); +const arr4 = realarray( buf, 16, 'float32' ); // returns [ 0.0, 0.0, 0.0, 0.0 ] -var arr5 = realarray( buf, 16, 1 ); +const arr5 = realarray( buf, 16, 1 ); // returns [ 0.0 ] -var arr6 = realarray( buf, 10, 4, 'int16' ); +const arr6 = realarray( buf, 10, 4, 'int16' ); // returns [ 0, 0, 0, 0 ] ``` @@ -155,13 +155,12 @@ var arr6 = realarray( buf, 10, 4, 'int16' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var realarray = require( '@stdlib/array/typed-real' ); +const randu = require( '@stdlib/random/base/randu' ); +const realarray = require( '@stdlib/array/typed-real' ); -var arr = realarray( 100, 'float64' ); +const arr = realarray( 100, 'float64' ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/typed-signed-integer-ctors/README.md b/lib/node_modules/@stdlib/array/typed-signed-integer-ctors/README.md index c2b32e0625b6..218bd3909a6c 100644 --- a/lib/node_modules/@stdlib/array/typed-signed-integer-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-signed-integer-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-signed-integer-ctors' ); +const ctors = require( '@stdlib/array/typed-signed-integer-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-signed-integer-ctors' ); Returns a signed integer typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'int32' ); +const ctor = ctors( 'int32' ); // returns ``` @@ -58,7 +58,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'int' ); +const ctor = ctors( 'int' ); // returns null ``` @@ -83,15 +83,13 @@ var ctor = ctors( 'int' ); ```javascript -var dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); -var ctors = require( '@stdlib/array/typed-signed-integer-ctors' ); +const dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); +const ctors = require( '@stdlib/array/typed-signed-integer-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-signed-integer-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-signed-integer-dtypes/README.md index ac2bebca50ef..8eee85ebea38 100644 --- a/lib/node_modules/@stdlib/array/typed-signed-integer-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-signed-integer-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); +const dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); Returns a list of typed array signed integer data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'int16', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-signed-integer-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'int32' ); +let bool = isdtype( 'int32' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/array/typed-unsigned-integer-ctors/README.md b/lib/node_modules/@stdlib/array/typed-unsigned-integer-ctors/README.md index 573448266af9..67f6b39923e0 100644 --- a/lib/node_modules/@stdlib/array/typed-unsigned-integer-ctors/README.md +++ b/lib/node_modules/@stdlib/array/typed-unsigned-integer-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/array/typed-unsigned-integer-ctors' ); +const ctors = require( '@stdlib/array/typed-unsigned-integer-ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/array/typed-unsigned-integer-ctors' ); Returns an unsigned integer typed array constructor for a specified data type. ```javascript -var ctor = ctors( 'uint32' ); +const ctor = ctors( 'uint32' ); // returns ``` @@ -59,7 +59,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'uint' ); +const ctor = ctors( 'uint' ); // returns null ``` @@ -84,15 +84,13 @@ var ctor = ctors( 'uint' ); ```javascript -var dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); -var ctors = require( '@stdlib/array/typed-unsigned-integer-ctors' ); +const dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); +const ctors = require( '@stdlib/array/typed-unsigned-integer-ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/array/typed-unsigned-integer-dtypes/README.md b/lib/node_modules/@stdlib/array/typed-unsigned-integer-dtypes/README.md index 7240e057691b..3cbbf36ce8d1 100644 --- a/lib/node_modules/@stdlib/array/typed-unsigned-integer-dtypes/README.md +++ b/lib/node_modules/@stdlib/array/typed-unsigned-integer-dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); +const dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); Returns a list of typed array unsigned integer data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'uint16', ... ] ``` @@ -70,10 +70,10 @@ var out = dtypes(); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/array/typed-unsigned-integer-dtypes' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -82,7 +82,7 @@ function isdtype( str ) { return true; } -var bool = isdtype( 'uint32' ); +let bool = isdtype( 'uint32' ); // returns true bool = isdtype( 'uint16' ); diff --git a/lib/node_modules/@stdlib/array/typed/README.md b/lib/node_modules/@stdlib/array/typed/README.md index f5cd4e25b55c..42b198ee7f3a 100644 --- a/lib/node_modules/@stdlib/array/typed/README.md +++ b/lib/node_modules/@stdlib/array/typed/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typedarray = require( '@stdlib/array/typed' ); +const typedarray = require( '@stdlib/array/typed' ); ``` #### typedarray( \[dtype] ) @@ -45,14 +45,14 @@ var typedarray = require( '@stdlib/array/typed' ); Creates a [typed array][mdn-typed-array] having a specified [data type][@stdlib/array/typed-dtypes]. ```javascript -var arr = typedarray(); +const arr = typedarray(); // returns ``` By default, the output [typed array][mdn-typed-array] data type is `float64`. To specify an alternative data type, provide a [`dtype`][@stdlib/array/typed-dtypes] argument. ```javascript -var arr = typedarray( 'int32' ); +const arr = typedarray( 'int32' ); // returns ``` @@ -61,10 +61,10 @@ var arr = typedarray( 'int32' ); Returns a [typed array][mdn-typed-array] having a specified `length`. ```javascript -var arr1 = typedarray( 5 ); +const arr1 = typedarray( 5 ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr2 = typedarray( 5, 'uint8' ); +const arr2 = typedarray( 5, 'uint8' ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -73,13 +73,13 @@ var arr2 = typedarray( 5, 'uint8' ); Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-array]. ```javascript -var arr1 = typedarray( [ 5.0, -3.0, 2.0 ] ); +const arr1 = typedarray( [ 5.0, -3.0, 2.0 ] ); // returns [ 5.0, -3.0, 2.0 ] -var arr2 = typedarray( arr1 ); +const arr2 = typedarray( arr1 ); // returns [ 5.0, -3.0, 2.0 ] -var arr3 = typedarray( arr1, 'int32' ); +const arr3 = typedarray( arr1, 'int32' ); // returns [ 5, -3, 2 ] ``` @@ -88,10 +88,10 @@ var arr3 = typedarray( arr1, 'int32' ); Creates a [typed array][mdn-typed-array] from an array-like object or iterable. ```javascript -var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] ); +const arr1 = typedarray( [ 0.5, 0.5, 0.5 ] ); // returns [ 0.5, 0.5, 0.5 ] -var arr2 = typedarray( [ 0.5, 0.5, 0.5 ], 'float32' ); +const arr2 = typedarray( [ 0.5, 0.5, 0.5 ], 'float32' ); // returns [ 0.5, 0.5, 0.5 ] ``` @@ -102,25 +102,25 @@ If [`dtype`][@stdlib/array/typed-dtypes] is complex number data type and an arra Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 32 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const buf = new ArrayBuffer( 32 ); -var arr1 = typedarray( buf ); +const arr1 = typedarray( buf ); // returns [ 0.0, 0.0, 0.0, 0.0 ] -var arr2 = typedarray( buf, 'float32' ); +const arr2 = typedarray( buf, 'float32' ); // returns [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] -var arr3 = typedarray( buf, 16 ); +const arr3 = typedarray( buf, 16 ); // returns [ 0.0, 0.0 ] -var arr4 = typedarray( buf, 16, 'float32' ); +const arr4 = typedarray( buf, 16, 'float32' ); // returns [ 0.0, 0.0, 0.0, 0.0 ] -var arr5 = typedarray( buf, 16, 1 ); +const arr5 = typedarray( buf, 16, 1 ); // returns [ 0.0 ] -var arr6 = typedarray( buf, 10, 4, 'int16' ); +const arr6 = typedarray( buf, 10, 4, 'int16' ); // returns [ 0, 0, 0, 0 ] ``` @@ -149,13 +149,12 @@ var arr6 = typedarray( buf, 10, 4, 'int16' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var typedarray = require( '@stdlib/array/typed' ); +const randu = require( '@stdlib/random/base/randu' ); +const typedarray = require( '@stdlib/array/typed' ); -var arr = typedarray( 100, 'float64' ); +const arr = typedarray( 100, 'float64' ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu() * 100.0; } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/uint16/README.md b/lib/node_modules/@stdlib/array/uint16/README.md index f1962df57fd5..b821e8f168c5 100644 --- a/lib/node_modules/@stdlib/array/uint16/README.md +++ b/lib/node_modules/@stdlib/array/uint16/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); ``` #### Uint16Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Uint16Array(); +const arr = new Uint16Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Uint16Array( 5 ); +const arr = new Uint16Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Uint16Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Uint16Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Uint16Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Uint16Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 8 ); -var arr = new Uint16Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 8 ); +const arr = new Uint16Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Uint16Array.BYTES_PER_ELEMENT; +const nbytes = Uint16Array.BYTES_PER_ELEMENT; // returns 2 ``` @@ -127,7 +127,7 @@ var nbytes = Uint16Array.BYTES_PER_ELEMENT; ```javascript -var str = Uint16Array.name; +const str = Uint16Array.name; // returns 'Uint16Array' ``` @@ -140,8 +140,8 @@ var str = Uint16Array.name; ```javascript -var arr = new Uint16Array( 5 ); -var buf = arr.buffer; +const arr = new Uint16Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Uint16Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Uint16Array( 5 ); +const byteLength = arr.byteLength; // returns 10 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Uint16Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Uint16Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Uint16Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Uint16Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 2 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Uint16Array( 5 ); -var len = arr.length; +const arr = new Uint16Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Uint16Array.from( [ 1, 2 ] ); +const arr = Uint16Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Uint16Array.from( [ 1, 2 ], mapFcn ); +const arr = Uint16Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Uint16Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Uint16Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Uint16Array.of( 1, 2 ); +const arr = Uint16Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Uint16Array( 2 ); +const arr = new Uint16Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Uint16Array( 2 ); +const arr = new Uint16Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint16Array( [ 2, 1, 3 ] ); +const arr = new Uint16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint16Array( [ 2, 1, 3 ] ); +const arr = new Uint16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint16Array( [ 2, 1, 3 ] ); +const arr = new Uint16Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint16Array( [ 2, 1, 3 ] ); +const arr = new Uint16Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Uint16Array( [ 2, 0, 3 ] ); +const arr = new Uint16Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint16Array( [ 1, 1 ] ); +const arr = new Uint16Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Uint16Array( [ 2, 3, 0 ] ); +const arr = new Uint16Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Uint16Array( [ 2, 3, 0 ] ); +const arr = new Uint16Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Uint16Array( [ 1, 2, 3 ] ); +const arr1 = new Uint16Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Uint16Array( [ 1, 2, 3 ] ); +const arr = new Uint16Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Uint16Array( [ 1, 2 ] ); +const arr = new Uint16Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/uint16' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/uint16' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/uint32/README.md b/lib/node_modules/@stdlib/array/uint32/README.md index c081d0e2ff33..9a9e9e679870 100644 --- a/lib/node_modules/@stdlib/array/uint32/README.md +++ b/lib/node_modules/@stdlib/array/uint32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); ``` #### Uint32Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Uint32Array(); +const arr = new Uint32Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Uint32Array( 5 ); +const arr = new Uint32Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Uint32Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Uint32Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Uint32Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Uint32Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 16 ); -var arr = new Uint32Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 16 ); +const arr = new Uint32Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Uint32Array.BYTES_PER_ELEMENT; +const nbytes = Uint32Array.BYTES_PER_ELEMENT; // returns 4 ``` @@ -127,7 +127,7 @@ var nbytes = Uint32Array.BYTES_PER_ELEMENT; ```javascript -var str = Uint32Array.name; +const str = Uint32Array.name; // returns 'Uint32Array' ``` @@ -140,8 +140,8 @@ var str = Uint32Array.name; ```javascript -var arr = new Uint32Array( 5 ); -var buf = arr.buffer; +const arr = new Uint32Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Uint32Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Uint32Array( 5 ); +const byteLength = arr.byteLength; // returns 20 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Uint32Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Uint32Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Uint32Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Uint32Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Uint32Array( 5 ); -var len = arr.length; +const arr = new Uint32Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Uint32Array.from( [ 1, 2 ] ); +const arr = Uint32Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Uint32Array.from( [ 1, 2 ], mapFcn ); +const arr = Uint32Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Uint32Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Uint32Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Uint32Array.of( 1, 2 ); +const arr = Uint32Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Uint32Array( 2 ); +const arr = new Uint32Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Uint32Array( 2 ); +const arr = new Uint32Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint32Array( [ 2, 1, 3 ] ); +const arr = new Uint32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint32Array( [ 2, 1, 3 ] ); +const arr = new Uint32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint32Array( [ 2, 1, 3 ] ); +const arr = new Uint32Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint32Array( [ 2, 1, 3 ] ); +const arr = new Uint32Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Uint32Array( [ 2, 0, 3 ] ); +const arr = new Uint32Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint32Array( [ 1, 1 ] ); +const arr = new Uint32Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Uint32Array( [ 2, 3, 0 ] ); +const arr = new Uint32Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Uint32Array( [ 2, 3, 0 ] ); +const arr = new Uint32Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Uint32Array( [ 1, 2, 3 ] ); +const arr1 = new Uint32Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Uint32Array( [ 1, 2, 3 ] ); +const arr = new Uint32Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Uint32Array( [ 1, 2 ] ); +const arr = new Uint32Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/uint32' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/uint32' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/uint8/README.md b/lib/node_modules/@stdlib/array/uint8/README.md index 53b5170784f6..de0589c8715f 100644 --- a/lib/node_modules/@stdlib/array/uint8/README.md +++ b/lib/node_modules/@stdlib/array/uint8/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); ``` #### Uint8Array() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Uint8Array(); +const arr = new Uint8Array(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Uint8Array( 5 ); +const arr = new Uint8Array( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Uint8Array( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Uint8Array( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Uint8Array( [ 5.0, 5.0, 5.0 ] ); +const arr = new Uint8Array( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 4 ); -var arr = new Uint8Array( buf, 0, 4 ); +const buf = new ArrayBuffer( 4 ); +const arr = new Uint8Array( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Uint8Array.BYTES_PER_ELEMENT; +const nbytes = Uint8Array.BYTES_PER_ELEMENT; // returns 1 ``` @@ -127,7 +127,7 @@ var nbytes = Uint8Array.BYTES_PER_ELEMENT; ```javascript -var str = Uint8Array.name; +const str = Uint8Array.name; // returns 'Uint8Array' ``` @@ -140,8 +140,8 @@ var str = Uint8Array.name; ```javascript -var arr = new Uint8Array( 5 ); -var buf = arr.buffer; +const arr = new Uint8Array( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Uint8Array( 5 ); -var byteLength = arr.byteLength; +const arr = new Uint8Array( 5 ); +const byteLength = arr.byteLength; // returns 5 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Uint8Array( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Uint8Array( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Uint8Array( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Uint8Array( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 1 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Uint8Array( 5 ); -var len = arr.length; +const arr = new Uint8Array( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Uint8Array.from( [ 1, 2 ] ); +const arr = Uint8Array.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Uint8Array.from( [ 1, 2 ], mapFcn ); +const arr = Uint8Array.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Uint8Array.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Uint8Array.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Uint8Array.of( 1, 2 ); +const arr = Uint8Array.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Uint8Array( 2 ); +const arr = new Uint8Array( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Uint8Array( 2 ); +const arr = new Uint8Array( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8Array( [ 2, 1, 3 ] ); +const arr = new Uint8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8Array( [ 2, 1, 3 ] ); +const arr = new Uint8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8Array( [ 2, 1, 3 ] ); +const arr = new Uint8Array( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8Array( [ 2, 1, 3 ] ); +const arr = new Uint8Array( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Uint8Array( [ 2, 0, 3 ] ); +const arr = new Uint8Array( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8Array( [ 1, 1 ] ); +const arr = new Uint8Array( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Uint8Array( [ 2, 3, 0 ] ); +const arr = new Uint8Array( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Uint8Array( [ 2, 3, 0 ] ); +const arr = new Uint8Array( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Uint8Array( [ 1, 2, 3 ] ); +const arr1 = new Uint8Array( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Uint8Array( [ 1, 2, 3 ] ); +const arr = new Uint8Array( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Uint8Array( [ 1, 2 ] ); +const arr = new Uint8Array( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/uint8' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/uint8' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/uint8c/README.md b/lib/node_modules/@stdlib/array/uint8c/README.md index aa4caf80a488..a639190d304d 100644 --- a/lib/node_modules/@stdlib/array/uint8c/README.md +++ b/lib/node_modules/@stdlib/array/uint8c/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); ``` #### Uint8ClampedArray() @@ -47,7 +47,7 @@ A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-t ```javascript -var arr = new Uint8ClampedArray(); +const arr = new Uint8ClampedArray(); // returns ``` @@ -58,7 +58,7 @@ Returns a [typed array][mdn-typed-array] having a specified length. ```javascript -var arr = new Uint8ClampedArray( 5 ); +const arr = new Uint8ClampedArray( 5 ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,10 +69,10 @@ Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-ar ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); -var arr2 = new Uint8ClampedArray( arr1 ); +const arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); +const arr2 = new Uint8ClampedArray( arr1 ); // returns [ 5, 5, 5 ] ``` @@ -83,7 +83,7 @@ Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable ```javascript -var arr = new Uint8ClampedArray( [ 5.0, 5.0, 5.0 ] ); +const arr = new Uint8ClampedArray( [ 5.0, 5.0, 5.0 ] ); // returns [ 5, 5, 5 ] ``` @@ -94,10 +94,10 @@ Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][@stdlib/arra ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var buf = new ArrayBuffer( 4 ); -var arr = new Uint8ClampedArray( buf, 0, 4 ); +const buf = new ArrayBuffer( 4 ); +const arr = new Uint8ClampedArray( buf, 0, 4 ); // returns [ 0, 0, 0, 0 ] ``` @@ -114,7 +114,7 @@ Number of bytes per view element. ```javascript -var nbytes = Uint8ClampedArray.BYTES_PER_ELEMENT; +const nbytes = Uint8ClampedArray.BYTES_PER_ELEMENT; // returns 1 ``` @@ -127,7 +127,7 @@ var nbytes = Uint8ClampedArray.BYTES_PER_ELEMENT; ```javascript -var str = Uint8ClampedArray.name; +const str = Uint8ClampedArray.name; // returns 'Uint8ClampedArray' ``` @@ -140,8 +140,8 @@ var str = Uint8ClampedArray.name; ```javascript -var arr = new Uint8ClampedArray( 5 ); -var buf = arr.buffer; +const arr = new Uint8ClampedArray( 5 ); +const buf = arr.buffer; // returns ``` @@ -154,8 +154,8 @@ var buf = arr.buffer; ```javascript -var arr = new Uint8ClampedArray( 5 ); -var byteLength = arr.byteLength; +const arr = new Uint8ClampedArray( 5 ); +const byteLength = arr.byteLength; // returns 5 ``` @@ -168,8 +168,8 @@ var byteLength = arr.byteLength; ```javascript -var arr = new Uint8ClampedArray( 5 ); -var byteOffset = arr.byteOffset; +const arr = new Uint8ClampedArray( 5 ); +const byteOffset = arr.byteOffset; // returns 0 ``` @@ -182,8 +182,8 @@ Number of bytes per view element. ```javascript -var arr = new Uint8ClampedArray( 5 ); -var nbytes = arr.BYTES_PER_ELEMENT; +const arr = new Uint8ClampedArray( 5 ); +const nbytes = arr.BYTES_PER_ELEMENT; // returns 1 ``` @@ -196,8 +196,8 @@ var nbytes = arr.BYTES_PER_ELEMENT; ```javascript -var arr = new Uint8ClampedArray( 5 ); -var len = arr.length; +const arr = new Uint8ClampedArray( 5 ); +const len = arr.length; // returns 5 ``` @@ -212,7 +212,7 @@ var len = arr.length; Creates a new typed array from an array-like `object` or an iterable. ```javascript -var arr = Uint8ClampedArray.from( [ 1, 2 ] ); +const arr = Uint8ClampedArray.from( [ 1, 2 ] ); // returns [ 1, 2 ] ``` @@ -223,7 +223,7 @@ function mapFcn( v ) { return v * 2; } -var arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn ); +const arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn ); // returns [ 2, 4 ] ``` @@ -240,14 +240,14 @@ function mapFcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn, ctx ); +const arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn, ctx ); // returns [ 2, 4 ] -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -258,7 +258,7 @@ var n = ctx.count; Creates a new typed array from a variable number of arguments. ```javascript -var arr = Uint8ClampedArray.of( 1, 2 ); +const arr = Uint8ClampedArray.of( 1, 2 ); // returns [ 1, 2 ] ``` @@ -271,12 +271,12 @@ Copies a sequence of elements within an array starting at `start` and ending at ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); // Copy the last two elements to the first two elements: arr.copyWithin( 0, 3 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -288,12 +288,12 @@ By default, `end` equals the number of array elements (i.e., one more than the l ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( 3, 0, 2 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -305,12 +305,12 @@ When a `target`, `start`, and/or `end` index is negative, the respective index i ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] ); // Copy the first two elements to the last two elements: arr.copyWithin( -2, -5, -3 ); -var v = arr[ 3 ]; +let v = arr[ 3 ]; // returns 1 v = arr[ 4 ]; @@ -326,19 +326,19 @@ Returns an iterator for iterating over array key-value pairs. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); // Create an iterator: -var it = arr.entries(); +const it = arr.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 1 ] v = it.next().value; // returns [ 1, 2 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -355,9 +355,9 @@ function predicate( v ) { return ( v <= 1 ); } -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); -var bool = arr.every( predicate ); +const bool = arr.every( predicate ); // returns false ``` @@ -377,16 +377,16 @@ function predicate( v ) { return ( v >= 1 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); -var bool = arr.every( predicate, ctx ); +const bool = arr.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -399,12 +399,12 @@ Fills an array from a `start` index to an `end` index (non-inclusive) with a pro ```javascript -var arr = new Uint8ClampedArray( 2 ); +const arr = new Uint8ClampedArray( 2 ); // Set all array elements to the same value: arr.fill( 2 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -434,12 +434,12 @@ When a `start` and/or `end` index is negative, the respective index is determine ```javascript -var arr = new Uint8ClampedArray( 2 ); +const arr = new Uint8ClampedArray( 2 ); // Set all array elements, except the last element, to the same value: arr.fill( 2, -arr.length, -1 ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 2 v = arr[ 1 ]; @@ -459,9 +459,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [ 2, 3 ] ``` @@ -474,9 +474,9 @@ function predicate( v ) { return ( v >= 10 ); } -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate ); +const arr2 = arr1.filter( predicate ); // returns [] ``` @@ -496,15 +496,15 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.filter( predicate, ctx ); +const arr2 = arr1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -521,9 +521,9 @@ function predicate( v ) { return ( v > 2 ); } -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns 3 ``` @@ -536,9 +536,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var v = arr.find( predicate ); +const v = arr.find( predicate ); // returns undefined ``` @@ -558,16 +558,16 @@ function predicate( v ) { return ( v > 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var v = arr.find( predicate, ctx ); +const v = arr.find( predicate, ctx ); // returns 3 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -584,9 +584,9 @@ function predicate( v ) { return ( v >= 3 ); } -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns 2 ``` @@ -599,9 +599,9 @@ function predicate( v ) { return ( v < 1 ); } -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate ); +const idx = arr.findIndex( predicate ); // returns -1 ``` @@ -621,16 +621,16 @@ function predicate( v ) { return ( v >= 3 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.findIndex( predicate, ctx ); +const idx = arr.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -643,9 +643,9 @@ Invokes a callback for each array element. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var str = ''; +let str = ''; function fcn( v, i ) { str += i + ':' + v; @@ -675,15 +675,15 @@ function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); arr.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -696,9 +696,9 @@ Returns a `boolean` indicating whether an array includes a search element. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var bool = arr.includes( 3 ); +let bool = arr.includes( 3 ); // returns true bool = arr.includes( 0 ); @@ -710,9 +710,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, 1 ); +const bool = arr.includes( 1, 1 ); // returns false ``` @@ -721,9 +721,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var bool = arr.includes( 1, -2 ); +const bool = arr.includes( 1, -2 ); // returns false ``` @@ -736,9 +736,9 @@ Returns the index of the first array element strictly equal to a search element. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 3 ); +let idx = arr.indexOf( 3 ); // returns 2 idx = arr.indexOf( 0 ); @@ -750,9 +750,9 @@ By default, the method searches the entire array (`fromIndex = 0`). To begin sea ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, 1 ); +const idx = arr.indexOf( 1, 1 ); // returns -1 ``` @@ -761,9 +761,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var idx = arr.indexOf( 1, -2 ); +const idx = arr.indexOf( 1, -2 ); // returns -1 ``` @@ -776,9 +776,9 @@ Serializes an array by joining all array elements as a string. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var str = arr.join(); +const str = arr.join(); // returns '1,2,3' ``` @@ -787,9 +787,9 @@ By default, the method delineates array elements using a comma `,`. To specify a ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var str = arr.join( '|' ); +const str = arr.join( '|' ); // returns '1|2|3' ``` @@ -802,19 +802,19 @@ Returns an iterator for iterating over array keys. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); // Create an iterator: -var it = arr.keys(); +const it = arr.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -827,9 +827,9 @@ Returns the index of the last array element strictly equal to a search element, ```javascript -var arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0 ); +let idx = arr.lastIndexOf( 0 ); // returns 3 idx = arr.lastIndexOf( 3 ); @@ -841,9 +841,9 @@ By default, the method searches the entire array (`fromIndex = -1`). To begin se ```javascript -var arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, 2 ); +const idx = arr.lastIndexOf( 0, 2 ); // returns 1 ``` @@ -852,9 +852,9 @@ When a `fromIndex` is negative, the starting index is resolved relative to the l ```javascript -var arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); +const arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] ); -var idx = arr.lastIndexOf( 0, -3 ); +const idx = arr.lastIndexOf( 0, -3 ); // returns 1 ``` @@ -871,9 +871,9 @@ function fcn( v ) { return v * 2; } -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn ); +const arr2 = arr1.map( fcn ); // returns [ 2, 4, 6 ] ``` @@ -893,15 +893,15 @@ function fcn( v ) { return v * 2; } -var ctx = { +const ctx = { 'count': 0 }; -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.map( fcn, ctx ); +const arr2 = arr1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -918,9 +918,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); +const arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn ); +const v = arr.reduce( fcn ); // returns 12 ``` @@ -935,9 +935,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); +const arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -961,9 +961,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); +const arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); -var v = arr.reduceRight( fcn ); +const v = arr.reduceRight( fcn ); // returns 8 ``` @@ -978,9 +978,9 @@ function fcn( acc, v ) { return acc + ( v*v ); } -var arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); +const arr = new Uint8ClampedArray( [ 2, 1, 3 ] ); -var v = arr.reduce( fcn, 0 ); +const v = arr.reduce( fcn, 0 ); // returns 14 ``` @@ -1000,12 +1000,12 @@ Reverses an array **in-place** (thus mutating the array on which the method is i ```javascript -var arr = new Uint8ClampedArray( [ 2, 0, 3 ] ); +const arr = new Uint8ClampedArray( [ 2, 0, 3 ] ); // Reverse the array: arr.reverse(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1024,13 +1024,13 @@ Sets array elements. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the first two array elements: arr.set( [ 4, 5 ] ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 4 v = arr[ 1 ]; @@ -1042,13 +1042,13 @@ By default, the method starts writing values at the first array index. To specif ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); // returns [ 1, 2, 3 ] // Set the last two array elements: arr.set( [ 4, 5 ], 1 ); -var v = arr[ 1 ]; +let v = arr[ 1 ]; // returns 4 v = arr[ 2 ]; @@ -1064,17 +1064,17 @@ Copies array elements to a new array with the same underlying data type as the h ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.slice(); +const arr2 = arr1.slice(); -var bool = ( arr1 === arr2 ); +let bool = ( arr1 === arr2 ); // returns false bool = ( arr1.buffer === arr2.buffer ); // returns false -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1089,14 +1089,14 @@ By default, the method copies elements beginning with the first array element. T ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 1 ); +const arr2 = arr1.slice( 1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 2 v = arr2[ 1 ]; @@ -1108,14 +1108,14 @@ By default, the method copies all array elements after `begin`. To specify an al ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( 0, 2 ); +const arr2 = arr1.slice( 0, 2 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1127,14 +1127,14 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.slice( -arr1.length, -1 ); +const arr2 = arr1.slice( -arr1.length, -1 ); -var len = arr2.length; +const len = arr2.length; // returns 2 -var v = arr2[ 0 ]; +let v = arr2[ 0 ]; // returns 1 v = arr2[ 1 ]; @@ -1154,9 +1154,9 @@ function predicate( v ) { return ( v >= 2 ); } -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); -var bool = arr.some( predicate ); +const bool = arr.some( predicate ); // returns true ``` @@ -1176,16 +1176,16 @@ function predicate( v ) { return ( v >= 2 ); } -var ctx = { +const ctx = { 'count': 0 }; -var arr = new Uint8ClampedArray( [ 1, 1 ] ); +const arr = new Uint8ClampedArray( [ 1, 1 ] ); -var bool = arr.some( predicate, ctx ); +const bool = arr.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1198,12 +1198,12 @@ Sorts an array **in-place** (thus mutating the array on which the method is invo ```javascript -var arr = new Uint8ClampedArray( [ 2, 3, 0 ] ); +const arr = new Uint8ClampedArray( [ 2, 3, 0 ] ); // Sort the array (in ascending order): arr.sort(); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 0 v = arr[ 1 ]; @@ -1222,12 +1222,12 @@ function descending( a, b ) { return b - a; } -var arr = new Uint8ClampedArray( [ 2, 3, 0 ] ); +const arr = new Uint8ClampedArray( [ 2, 3, 0 ] ); // Sort the array (in descending order): arr.sort( descending ); -var v = arr[ 0 ]; +let v = arr[ 0 ]; // returns 3 v = arr[ 1 ]; @@ -1252,12 +1252,12 @@ Creates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/ ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray(); +const arr2 = arr1.subarray(); // returns [ 1, 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1266,12 +1266,12 @@ By default, the method creates a typed array view beginning with the first array ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 1 ); +const arr2 = arr1.subarray( 1 ); // returns [ 2, 3 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1280,12 +1280,12 @@ By default, the method creates a typed array view which includes all array eleme ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 0, 2 ); +const arr2 = arr1.subarray( 0, 2 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1294,12 +1294,12 @@ When a `begin` and/or `end` index is negative, the respective index is determine ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( -arr1.length, -1 ); +const arr2 = arr1.subarray( -arr1.length, -1 ); // returns [ 1, 2 ] -var bool = ( arr1.buffer === arr2.buffer ); +const bool = ( arr1.buffer === arr2.buffer ); // returns true ``` @@ -1308,9 +1308,9 @@ If the method is unable to resolve indices to a non-empty array subsequence, the ```javascript -var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var arr2 = arr1.subarray( 10, -1 ); +const arr2 = arr1.subarray( 10, -1 ); // returns [] ``` @@ -1323,9 +1323,9 @@ Serializes an array as a locale-specific `string`. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var str = arr.toLocaleString(); +const str = arr.toLocaleString(); // returns '1,2,3' ``` @@ -1338,9 +1338,9 @@ Serializes an array as a `string`. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); +const arr = new Uint8ClampedArray( [ 1, 2, 3 ] ); -var str = arr.toString(); +const str = arr.toString(); // returns '1,2,3' ``` @@ -1353,19 +1353,19 @@ Returns an iterator for iterating over array elements. ```javascript -var arr = new Uint8ClampedArray( [ 1, 2 ] ); +const arr = new Uint8ClampedArray( [ 1, 2 ] ); // Create an iterator: -var it = arr.values(); +const it = arr.values(); // Iterate over array elements... -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1392,15 +1392,12 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ctor = require( '@stdlib/array/uint8c' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ctor = require( '@stdlib/array/uint8c' ); -var arr; -var i; - -arr = new ctor( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new ctor( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/array/zero-to-like/README.md b/lib/node_modules/@stdlib/array/zero-to-like/README.md index 2a34888075c5..f8dbcee70789 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/README.md +++ b/lib/node_modules/@stdlib/array/zero-to-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeroToLike = require( '@stdlib/array/zero-to-like' ); +const zeroToLike = require( '@stdlib/array/zero-to-like' ); ``` #### zeroToLike( x\[, dtype] ) @@ -45,7 +45,7 @@ var zeroToLike = require( '@stdlib/array/zero-to-like' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from zero and having the same length and data type as a provided input array `x`. ```javascript -var arr = zeroToLike( [ 0, 0, 0, 0, 0 ] ); +const arr = zeroToLike( [ 0, 0, 0, 0, 0 ] ); // returns [ 0, 1, 2, 3, 4 ] ``` @@ -67,7 +67,7 @@ The function recognizes the following data types: By default, the output array data type is inferred from the provided array `x`. To return an array having a different data type, provide a `dtype` argument. ```javascript -var arr = zeroToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); +const arr = zeroToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); // returns [ 0, 1, 2, 3, 4 ] ``` @@ -96,21 +96,21 @@ var arr = zeroToLike( [ 0, 0, 0, 0, 0 ], 'int32' ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var zeroToLike = require( '@stdlib/array/zero-to-like' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const zeroToLike = require( '@stdlib/array/zero-to-like' ); // Generate an array of random numbers: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, 100, 200, opts ); +const x = discreteUniform( 10, 100, 200, opts ); // Generate an array of indices: -var idx = zeroToLike( x ); +const idx = zeroToLike( x ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort the index array according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, idx, 1 ); diff --git a/lib/node_modules/@stdlib/array/zero-to/README.md b/lib/node_modules/@stdlib/array/zero-to/README.md index 043cd4e36f3c..00fbac373366 100644 --- a/lib/node_modules/@stdlib/array/zero-to/README.md +++ b/lib/node_modules/@stdlib/array/zero-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeroTo = require( '@stdlib/array/zero-to' ); +const zeroTo = require( '@stdlib/array/zero-to' ); ``` #### zeroTo( n\[, dtype] ) @@ -45,14 +45,14 @@ var zeroTo = require( '@stdlib/array/zero-to' ); Generates a linearly spaced numeric array whose elements increment by `1` starting from zero. ```javascript -var arr = zeroTo( 5 ); +const arr = zeroTo( 5 ); // returns [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ``` If `n == 0`, the function returns an empty array. ```javascript -var arr = zeroTo( 0 ); +const arr = zeroTo( 0 ); // returns [] ``` @@ -74,7 +74,7 @@ The function recognizes the following data types: By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = zeroTo( 5, 'int32' ); +const arr = zeroTo( 5, 'int32' ); // returns [ 0, 1, 2, 3, 4 ] ``` @@ -103,21 +103,21 @@ var arr = zeroTo( 5, 'int32' ); ```javascript -var sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var zeroTo = require( '@stdlib/array/zero-to' ); +const sort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const zeroTo = require( '@stdlib/array/zero-to' ); // Generate an array of random numbers: -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, 100, 200, opts ); +const x = discreteUniform( 10, 100, 200, opts ); // Generate an array of indices: -var idx = zeroTo( x.length, opts.dtype ); +const idx = zeroTo( x.length, opts.dtype ); // Create a temporary array to avoid mutation: -var tmp = x.slice(); +const tmp = x.slice(); // Sort the index array according to the sort order of `x`: sort2hp( x.length, 1, tmp, 1, idx, 1 ); diff --git a/lib/node_modules/@stdlib/array/zeros-like/README.md b/lib/node_modules/@stdlib/array/zeros-like/README.md index 6aaa36823d30..97630e0da870 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/README.md +++ b/lib/node_modules/@stdlib/array/zeros-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zerosLike = require( '@stdlib/array/zeros-like' ); +const zerosLike = require( '@stdlib/array/zeros-like' ); ``` #### zerosLike( x\[, dtype] ) @@ -45,9 +45,9 @@ var zerosLike = require( '@stdlib/array/zeros-like' ); Creates a zero-filled array having the same length and data type as a provided array `x`. ```javascript -var x = [ 1, 2, 3, 4, 5 ]; +const x = [ 1, 2, 3, 4, 5 ]; -var arr = zerosLike( x ); +const arr = zerosLike( x ); // returns [ 0, 0, 0, 0, 0 ] ``` @@ -69,9 +69,9 @@ The function supports the following data types: By default, the output array data type is inferred from the provided array `x`. To return an array having a different data type, provide a `dtype` argument. ```javascript -var x = [ 0, 0 ]; +const x = [ 0, 0 ]; -var arr = zerosLike( x, 'int32' ); +const arr = zerosLike( x, 'int32' ); // returns [ 0, 0 ] ``` @@ -96,21 +96,18 @@ var arr = zerosLike( x, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); -var zerosLike = require( '@stdlib/array/zeros-like' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); +const zerosLike = require( '@stdlib/array/zeros-like' ); // Create a zero-filled array: -var x = zeros( 4, 'complex128' ); +const x = zeros( 4, 'complex128' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate additional zero-filled arrays... -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - y = zerosLike( x, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const y = zerosLike( x, dt[ i ] ); console.log( y ); } ``` diff --git a/lib/node_modules/@stdlib/array/zeros/README.md b/lib/node_modules/@stdlib/array/zeros/README.md index df4d5b40ef93..97b3ab4c502e 100644 --- a/lib/node_modules/@stdlib/array/zeros/README.md +++ b/lib/node_modules/@stdlib/array/zeros/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); ``` #### zeros( length\[, dtype] ) @@ -45,7 +45,7 @@ var zeros = require( '@stdlib/array/zeros' ); Creates a zero-filled array having a specified length. ```javascript -var arr = zeros( 2 ); +const arr = zeros( 2 ); // returns [ 0.0, 0.0 ] ``` @@ -67,7 +67,7 @@ The function recognizes the following data types: By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument. ```javascript -var arr = zeros( 2, 'int32' ); +const arr = zeros( 2, 'int32' ); // returns [ 0, 0 ] ``` @@ -92,17 +92,14 @@ var arr = zeros( 2, 'int32' ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var zeros = require( '@stdlib/array/zeros' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const zeros = require( '@stdlib/array/zeros' ); // Get a list of array data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate zero-filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = zeros( 4, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = zeros( 4, dt[ i ] ); console.log( arr ); } ``` diff --git a/lib/node_modules/@stdlib/assert/README.md b/lib/node_modules/@stdlib/assert/README.md index 10072fef539b..41de28c4526b 100644 --- a/lib/node_modules/@stdlib/assert/README.md +++ b/lib/node_modules/@stdlib/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var assert = require( '@stdlib/assert' ); +const assert = require( '@stdlib/assert' ); ``` #### assert @@ -35,7 +35,7 @@ var assert = require( '@stdlib/assert' ); Namespace providing utilities for data type testing and feature detection. ```javascript -var o = assert; +const o = assert; // returns {...} ``` @@ -67,10 +67,10 @@ For primitive types having corresponding object wrappers, assertion utilities pr ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const isBoolean = require( '@stdlib/assert/is-boolean' ); -var bool = isBoolean.isObject( new Boolean( false ) ); +let bool = isBoolean.isObject( new Boolean( false ) ); // returns true bool = isBoolean.isObject( false ); @@ -106,9 +106,9 @@ Where applicable, similar to the assertion utilities for built-in data types, ar ```javascript -var isStringArray = require( '@stdlib/assert/is-string-array' ); +const isStringArray = require( '@stdlib/assert/is-string-array' ); -var bool = isStringArray( [ 'hello', 'world' ] ); +let bool = isStringArray( [ 'hello', 'world' ] ); // returns true bool = isStringArray.primitives( [ 'hello', 'world' ] ); @@ -509,8 +509,8 @@ The remaining namespace utilities are as follows: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var assert = require( '@stdlib/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const assert = require( '@stdlib/assert' ); console.log( objectKeys( assert ) ); ``` diff --git a/lib/node_modules/@stdlib/assert/contains/README.md b/lib/node_modules/@stdlib/assert/contains/README.md index fc4bed3e78dc..395a56f1dfa1 100644 --- a/lib/node_modules/@stdlib/assert/contains/README.md +++ b/lib/node_modules/@stdlib/assert/contains/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var contains = require( '@stdlib/assert/contains' ); +const contains = require( '@stdlib/assert/contains' ); ``` #### contains( val, searchValue\[, position] ) @@ -41,16 +41,16 @@ var contains = require( '@stdlib/assert/contains' ); Tests if `val` contains a search value. When `val` is a `string`, the function checks whether the characters of a search string are found in the input string. ```javascript -var v = contains( 'Hello World', 'World' ); +const v = contains( 'Hello World', 'World' ); // returns true ``` When `val` is an `array-like` object, but not a `string`, the function checks whether the input value contains an element strictly equal to the specified search value. ```javascript -var arr = [ null, NaN, 2, 'abc', {} ]; +const arr = [ null, NaN, 2, 'abc', {} ]; -var v = contains( arr, NaN ); // NaNs are considered equal +let v = contains( arr, NaN ); // NaNs are considered equal // returns true v = contains( arr, {} ); @@ -63,14 +63,14 @@ v = contains( arr, 'ab' ); Search is case-sensitive. ```javascript -var v = contains( 'Hello World', 'world' ); +const v = contains( 'Hello World', 'world' ); // returns false ``` To start searching at a specified index, provide a `position` argument. ```javascript -var v = contains( 'Hello World', 'Hello', 6 ); +let v = contains( 'Hello World', 'Hello', 6 ); // returns false v = contains( [ true, NaN, false ], true, 1 ); @@ -82,7 +82,7 @@ If not provided an `array-like` object, the function throws an error. ```javascript -var v = contains( false, 'abc' ); +const v = contains( false, 'abc' ); // throws ``` @@ -91,7 +91,7 @@ If not provided an integer-valued `position` argument, the function throws an er ```javascript -var v = contains( 'hello', 'e', 2.5 ); +const v = contains( 'hello', 'e', 2.5 ); // throws ``` @@ -120,9 +120,9 @@ var v = contains( 'hello', 'e', 2.5 ); ```javascript -var contains = require( '@stdlib/assert/contains' ); +const contains = require( '@stdlib/assert/contains' ); -var bool = contains( 'last man standing', 'stand' ); +let bool = contains( 'last man standing', 'stand' ); // returns true bool = contains( [ 1, 2, 3, 4 ], 2 ); diff --git a/lib/node_modules/@stdlib/assert/deep-equal/README.md b/lib/node_modules/@stdlib/assert/deep-equal/README.md index 988aede22801..44a9df0103ec 100644 --- a/lib/node_modules/@stdlib/assert/deep-equal/README.md +++ b/lib/node_modules/@stdlib/assert/deep-equal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deepEqual = require( '@stdlib/assert/deep-equal' ); +const deepEqual = require( '@stdlib/assert/deep-equal' ); ``` #### deepEqual( a, b ) @@ -37,7 +37,7 @@ Returns a `boolean` indicating if `a` is deep equal to `b`. ```javascript -var bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, 3 ] ); +let bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, 3 ] ); // returns true bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, '3' ] ); @@ -69,11 +69,11 @@ bool = deepEqual( { 'a': 2 }, { 'a': [ 2 ] } ); ```javascript -var deepEqual = require( '@stdlib/assert/deep-equal' ); +const deepEqual = require( '@stdlib/assert/deep-equal' ); -var a = [ true, false, true ]; -var b = [ true, false, true ]; -var bool = deepEqual( a, b ); +let a = [ true, false, true ]; +let b = [ true, false, true ]; +let bool = deepEqual( a, b ); // returns true b.pop(); diff --git a/lib/node_modules/@stdlib/assert/deep-has-own-property/README.md b/lib/node_modules/@stdlib/assert/deep-has-own-property/README.md index 803dc9e2e887..1cb60902cd84 100644 --- a/lib/node_modules/@stdlib/assert/deep-has-own-property/README.md +++ b/lib/node_modules/@stdlib/assert/deep-has-own-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deepHasOwnProp = require( '@stdlib/assert/deep-has-own-property' ); +const deepHasOwnProp = require( '@stdlib/assert/deep-has-own-property' ); ``` #### deepHasOwnProp( value, path\[, options] ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a specified `path`. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepHasOwnProp( obj, 'a.b.c' ); +let bool = deepHasOwnProp( obj, 'a.b.c' ); // returns true bool = deepHasOwnProp( obj, 'a.b.c.d.e' ); @@ -51,7 +51,7 @@ If a key path includes an `array`, specify the numeric index. ```javascript -var arr = [ +const arr = [ { 'a': [ { @@ -64,7 +64,7 @@ var arr = [ } ]; -var bool = deepHasOwnProp( arr, '0.a.0.b.0.c' ); +let bool = deepHasOwnProp( arr, '0.a.0.b.0.c' ); // returns true bool = deepHasOwnProp( arr, '0.a.1.b.0.c' ); @@ -79,9 +79,9 @@ The key path may be specified as either a delimited `string` or a key `array`. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepHasOwnProp( obj, [ 'a', 'b', 'c' ] ); +const bool = deepHasOwnProp( obj, [ 'a', 'b', 'c' ] ); // returns true ``` @@ -94,9 +94,9 @@ By default, the function assumes `.` separated key values. To specify an alterna ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepHasOwnProp( obj, 'a/b/c', { +const bool = deepHasOwnProp( obj, 'a/b/c', { 'sep': '/' }); // returns true @@ -107,7 +107,7 @@ var bool = deepHasOwnProp( obj, 'a/b/c', { Returns a `function` which tests whether a `value` contains a nested key `path`. ```javascript -var has = deepHasOwnProp.factory( 'a/b/c', { +const has = deepHasOwnProp.factory( 'a/b/c', { 'sep': '/' }); ``` @@ -119,11 +119,11 @@ Returns a `boolean` indicating whether a `value` contains a nested key `path`. ```javascript -var has = deepHasOwnProp.factory( 'a.b.c' ); +const has = deepHasOwnProp.factory( 'a.b.c' ); -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = has( obj ); +const bool = has( obj ); // returns true ``` @@ -144,9 +144,9 @@ var bool = has( obj ); } Foo.prototype.c = 'd'; - var foo = new Foo(); + const foo = new Foo(); - var bool = deepHasOwnProp( foo, 'a' ); + let bool = deepHasOwnProp( foo, 'a' ); // returns true bool = deepHasOwnProp( foo, 'c' ); @@ -156,7 +156,7 @@ var bool = has( obj ); - When provided `null` or `undefined`, the function result is always `false`. ```javascript - var bool = deepHasOwnProp( null, 'a.b.c' ); + let bool = deepHasOwnProp( null, 'a.b.c' ); // returns false bool = deepHasOwnProp( void 0, 'a.b.c' ); @@ -166,21 +166,21 @@ var bool = has( obj ); - Property values other than `null` or `undefined` are coerced to `objects`. ```javascript - var obj = { + const obj = { 'a': 'b' }; - var bool = deepHasOwnProp( obj, 'a.length' ); + const bool = deepHasOwnProp( obj, 'a.length' ); // returns true ``` - Key path `array` elements are coerced to `strings`. ```javascript - var obj = { + let obj = { 'null': false }; - var bool = deepHasOwnProp( obj, [ null ] ); + let bool = deepHasOwnProp( obj, [ null ] ); // returns true obj = { @@ -203,9 +203,9 @@ var bool = has( obj ); ```javascript -var deepHasOwnProp = require( '@stdlib/assert/deep-has-own-property' ); +const deepHasOwnProp = require( '@stdlib/assert/deep-has-own-property' ); -var bool = deepHasOwnProp( { 'a': { 'b': { 'c': 'd' } } }, 'a.b.c' ); +let bool = deepHasOwnProp( { 'a': { 'b': { 'c': 'd' } } }, 'a.b.c' ); // returns true bool = deepHasOwnProp( { 'a': { 'b': { 'c': 'd' } } }, [ 'a', 'b', 'c' ] ); @@ -228,7 +228,7 @@ bool = deepHasOwnProp( { 'a': { 'b': { 'c': 'd' } } }, 'a/b/c/d/e', { // returns false // Create a customized function: -var has = deepHasOwnProp.factory( 'a_b_c', { +const has = deepHasOwnProp.factory( 'a_b_c', { 'sep': '_' }); diff --git a/lib/node_modules/@stdlib/assert/deep-has-property/README.md b/lib/node_modules/@stdlib/assert/deep-has-property/README.md index 645dfa0ecdb8..28829a6f96ac 100644 --- a/lib/node_modules/@stdlib/assert/deep-has-property/README.md +++ b/lib/node_modules/@stdlib/assert/deep-has-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deepHasProp = require( '@stdlib/assert/deep-has-property' ); +const deepHasProp = require( '@stdlib/assert/deep-has-property' ); ``` #### deepHasProp( value, path\[, options] ) @@ -44,9 +44,9 @@ Foo.prototype.b = { 'c': 'd' }; -var obj = { 'a': new Foo() }; +const obj = { 'a': new Foo() }; -var bool = deepHasProp( obj, 'a.b.c' ); +let bool = deepHasProp( obj, 'a.b.c' ); // returns true bool = deepHasProp( obj, 'a.b.c.d.e' ); @@ -58,7 +58,7 @@ If a key path includes an `array`, specify the numeric index. ```javascript -var arr = [ +const arr = [ { 'a': [ { @@ -71,7 +71,7 @@ var arr = [ } ]; -var bool = deepHasProp( arr, '0.a.0.b.0.c' ); +let bool = deepHasProp( arr, '0.a.0.b.0.c' ); // returns true bool = deepHasProp( arr, '0.a.1.b.0.c' ); @@ -86,9 +86,9 @@ The key path may be specified as either a delimited `string` or a key `array`. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepHasProp( obj, [ 'a', 'b', 'c' ] ); +const bool = deepHasProp( obj, [ 'a', 'b', 'c' ] ); // returns true ``` @@ -101,9 +101,9 @@ By default, the function assumes `.` separated key values. To specify an alterna ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepHasProp( obj, 'a/b/c', { +const bool = deepHasProp( obj, 'a/b/c', { 'sep': '/' }); // returns true @@ -114,7 +114,7 @@ var bool = deepHasProp( obj, 'a/b/c', { Returns a `function` which tests whether a `value` contains a nested key `path`, either own or inherited. ```javascript -var has = deepHasProp.factory( 'a/b/c', { +const has = deepHasProp.factory( 'a/b/c', { 'sep': '/' }); ``` @@ -126,7 +126,7 @@ Returns a `boolean` indicating whether a `value` contains a nested key `path`, e ```javascript -var has = deepHasProp.factory( 'a.b.c' ); +const has = deepHasProp.factory( 'a.b.c' ); function Foo() { return this; @@ -135,9 +135,9 @@ Foo.prototype.b = { 'c': 'd' }; -var obj = { 'a': new Foo() }; +const obj = { 'a': new Foo() }; -var bool = has( obj ); +const bool = has( obj ); // returns true ``` @@ -152,7 +152,7 @@ var bool = has( obj ); - When provided `null` or `undefined`, the function result is always `false`. ```javascript - var bool = deepHasProp( null, 'a.b.c' ); + let bool = deepHasProp( null, 'a.b.c' ); // returns false bool = deepHasProp( void 0, 'a.b.c' ); @@ -162,21 +162,21 @@ var bool = has( obj ); - Property values other than `null` or `undefined` are coerced to `objects`. ```javascript - var obj = { + const obj = { 'a': 'b' }; - var bool = deepHasProp( obj, 'a.length' ); + const bool = deepHasProp( obj, 'a.length' ); // returns true ``` - Key path `array` elements are coerced to `strings`. ```javascript - var obj = { + let obj = { 'null': false }; - var bool = deepHasProp( obj, [ null ] ); + let bool = deepHasProp( obj, [ null ] ); // returns true obj = { @@ -199,9 +199,9 @@ var bool = has( obj ); ```javascript -var deepHasProp = require( '@stdlib/assert/deep-has-property' ); +const deepHasProp = require( '@stdlib/assert/deep-has-property' ); -var bool = deepHasProp( { 'a': { 'b': { 'c': 'd' } } }, 'a.b.c' ); +let bool = deepHasProp( { 'a': { 'b': { 'c': 'd' } } }, 'a.b.c' ); // returns true bool = deepHasProp( { 'a': { 'b': { 'c': 'd' } } }, [ 'a', 'b', 'hasOwnProperty' ] ); @@ -224,7 +224,7 @@ bool = deepHasProp( { 'a': { 'b': { 'c': 'd' } } }, 'a/b/c/d/e', { // returns false // Create a customized function: -var has = deepHasProp.factory( 'a_b_c', { +const has = deepHasProp.factory( 'a_b_c', { 'sep': '_' }); diff --git a/lib/node_modules/@stdlib/assert/has-arraybuffer-support/README.md b/lib/node_modules/@stdlib/assert/has-arraybuffer-support/README.md index afe8e91551bf..2d5849021344 100644 --- a/lib/node_modules/@stdlib/assert/has-arraybuffer-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-arraybuffer-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasArrayBufferSupport = require( '@stdlib/assert/has-arraybuffer-support' ); +const hasArrayBufferSupport = require( '@stdlib/assert/has-arraybuffer-support' ); ``` #### hasArrayBufferSupport() @@ -35,7 +35,7 @@ var hasArrayBufferSupport = require( '@stdlib/assert/has-arraybuffer-support' ); Detects if a runtime environment supports [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var bool = hasArrayBufferSupport(); +const bool = hasArrayBufferSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasArrayBufferSupport(); ```javascript -var hasArrayBufferSupport = require( '@stdlib/assert/has-arraybuffer-support' ); +const hasArrayBufferSupport = require( '@stdlib/assert/has-arraybuffer-support' ); -var bool = hasArrayBufferSupport(); +const bool = hasArrayBufferSupport(); if ( bool ) { console.log( 'Environment has ArrayBuffer support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-arrow-function-support/README.md b/lib/node_modules/@stdlib/assert/has-arrow-function-support/README.md index c7ad50140c7e..5598563088f1 100644 --- a/lib/node_modules/@stdlib/assert/has-arrow-function-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-arrow-function-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasArrowFunctionSupport = require( '@stdlib/assert/has-arrow-function-support' ); +const hasArrowFunctionSupport = require( '@stdlib/assert/has-arrow-function-support' ); ``` #### hasArrowFunctionSupport() @@ -35,7 +35,7 @@ var hasArrowFunctionSupport = require( '@stdlib/assert/has-arrow-function-suppor Detects if a runtime environment supports ES2015 [`arrow functions`][mdn-arrow-function] such as `( a, b ) => a + b`, `x => x`, or `( x ) => { return x*x; }`. ```javascript -var bool = hasArrowFunctionSupport(); +const bool = hasArrowFunctionSupport(); // returns ``` @@ -60,9 +60,9 @@ var bool = hasArrowFunctionSupport(); ```javascript -var hasArrowFunctionSupport = require( '@stdlib/assert/has-arrow-function-support' ); +const hasArrowFunctionSupport = require( '@stdlib/assert/has-arrow-function-support' ); -var bool = hasArrowFunctionSupport(); +const bool = hasArrowFunctionSupport(); if ( bool ) { console.log( 'Environment has native arrow function support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-async-await-support/README.md b/lib/node_modules/@stdlib/assert/has-async-await-support/README.md index 35265a1b28d1..ce3b94702106 100644 --- a/lib/node_modules/@stdlib/assert/has-async-await-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-async-await-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' ); +const hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' ); ``` #### hasAsyncAwaitSupport() @@ -35,7 +35,7 @@ var hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' ); Detects if a runtime environment supports ES2017 [`async`][mdn-async]/[`await`][mdn-await]. ```javascript -var bool = hasAsyncAwaitSupport(); +const bool = hasAsyncAwaitSupport(); // returns ``` @@ -60,9 +60,9 @@ var bool = hasAsyncAwaitSupport(); ```javascript -var hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' ); +const hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' ); -var bool = hasAsyncAwaitSupport(); +const bool = hasAsyncAwaitSupport(); if ( bool ) { console.log( 'Environment has native async/await support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-async-iterator-symbol-support/README.md b/lib/node_modules/@stdlib/assert/has-async-iterator-symbol-support/README.md index 37c1f1db8d85..5428a2e23a7a 100644 --- a/lib/node_modules/@stdlib/assert/has-async-iterator-symbol-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-async-iterator-symbol-support/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); +const hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); ``` #### hasAsyncIteratorSymbolSupport() @@ -39,7 +39,7 @@ Detects if a runtime environment supports ES2018 [`Symbol.asyncIterator`][mdn-sy ```javascript -var bool = hasAsyncIteratorSymbolSupport(); +const bool = hasAsyncIteratorSymbolSupport(); // returns ``` @@ -56,9 +56,9 @@ var bool = hasAsyncIteratorSymbolSupport(); ```javascript -var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); +const hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); -var bool = hasAsyncIteratorSymbolSupport(); +const bool = hasAsyncIteratorSymbolSupport(); if ( bool ) { console.log( 'Environment has Symbol.asyncIterator support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-atob-support/README.md b/lib/node_modules/@stdlib/assert/has-atob-support/README.md index ddf242509626..90286347486a 100644 --- a/lib/node_modules/@stdlib/assert/has-atob-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-atob-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasAtobSupport = require( '@stdlib/assert/has-atob-support' ); +const hasAtobSupport = require( '@stdlib/assert/has-atob-support' ); ``` #### hasAtobSupport() @@ -35,7 +35,7 @@ var hasAtobSupport = require( '@stdlib/assert/has-atob-support' ); Detects if a runtime environment supports [`atob`][mdn-atob]. ```javascript -var bool = hasAtobSupport(); +const bool = hasAtobSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasAtobSupport(); ```javascript -var hasAtobSupport = require( '@stdlib/assert/has-atob-support' ); +const hasAtobSupport = require( '@stdlib/assert/has-atob-support' ); -var bool = hasAtobSupport(); +const bool = hasAtobSupport(); if ( bool ) { console.log( 'Environment has atob support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-bigint-support/README.md b/lib/node_modules/@stdlib/assert/has-bigint-support/README.md index 562eec361ba1..a5b4a0f81ece 100644 --- a/lib/node_modules/@stdlib/assert/has-bigint-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-bigint-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); +const hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); ``` #### hasBigIntSupport() @@ -35,7 +35,7 @@ var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); Detects if a runtime environment supports ES2020 [`BigInt`][mdn-bigint]. ```javascript -var bool = hasBigIntSupport(); +const bool = hasBigIntSupport(); // returns ``` @@ -50,7 +50,7 @@ var bool = hasBigIntSupport(); ```javascript -var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); +const hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); if ( hasBigIntSupport() ) { console.log( 'Environment has BigInt support.' ); diff --git a/lib/node_modules/@stdlib/assert/has-bigint64array-support/README.md b/lib/node_modules/@stdlib/assert/has-bigint64array-support/README.md index aab554856106..222cbb43e37f 100644 --- a/lib/node_modules/@stdlib/assert/has-bigint64array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-bigint64array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasBigInt64ArraySupport = require( '@stdlib/assert/has-bigint64array-support' ); +const hasBigInt64ArraySupport = require( '@stdlib/assert/has-bigint64array-support' ); ``` #### hasBigInt64ArraySupport() @@ -35,7 +35,7 @@ var hasBigInt64ArraySupport = require( '@stdlib/assert/has-bigint64array-support Detects if a runtime environment supports [`BigInt64Array`][mdn-bigint64array]. ```javascript -var bool = hasBigInt64ArraySupport(); +const bool = hasBigInt64ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasBigInt64ArraySupport(); ```javascript -var hasBigInt64ArraySupport = require( '@stdlib/assert/has-bigint64array-support' ); +const hasBigInt64ArraySupport = require( '@stdlib/assert/has-bigint64array-support' ); -var bool = hasBigInt64ArraySupport(); +const bool = hasBigInt64ArraySupport(); if ( bool ) { console.log( 'Environment has BigInt64Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-biguint64array-support/README.md b/lib/node_modules/@stdlib/assert/has-biguint64array-support/README.md index 69c00495f4dd..dc4d19db990f 100644 --- a/lib/node_modules/@stdlib/assert/has-biguint64array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-biguint64array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasBigUint64ArraySupport = require( '@stdlib/assert/has-biguint64array-support' ); +const hasBigUint64ArraySupport = require( '@stdlib/assert/has-biguint64array-support' ); ``` #### hasBigUint64ArraySupport() @@ -35,7 +35,7 @@ var hasBigUint64ArraySupport = require( '@stdlib/assert/has-biguint64array-suppo Detects if a runtime environment supports [`BigUint64Array`][mdn-biguint64array]. ```javascript -var bool = hasBigUint64ArraySupport(); +const bool = hasBigUint64ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasBigUint64ArraySupport(); ```javascript -var hasBigUint64ArraySupport = require( '@stdlib/assert/has-biguint64array-support' ); +const hasBigUint64ArraySupport = require( '@stdlib/assert/has-biguint64array-support' ); -var bool = hasBigUint64ArraySupport(); +const bool = hasBigUint64ArraySupport(); if ( bool ) { console.log( 'Environment has BigUint64Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-btoa-support/README.md b/lib/node_modules/@stdlib/assert/has-btoa-support/README.md index e589c45eaabf..5edcb1e29194 100644 --- a/lib/node_modules/@stdlib/assert/has-btoa-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-btoa-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasBtoaSupport = require( '@stdlib/assert/has-btoa-support' ); +const hasBtoaSupport = require( '@stdlib/assert/has-btoa-support' ); ``` #### hasBtoaSupport() @@ -35,7 +35,7 @@ var hasBtoaSupport = require( '@stdlib/assert/has-btoa-support' ); Detects if a runtime environment supports [`btoa`][mdn-btoa]. ```javascript -var bool = hasBtoaSupport(); +const bool = hasBtoaSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasBtoaSupport(); ```javascript -var hasBtoaSupport = require( '@stdlib/assert/has-btoa-support' ); +const hasBtoaSupport = require( '@stdlib/assert/has-btoa-support' ); -var bool = hasBtoaSupport(); +const bool = hasBtoaSupport(); if ( bool ) { console.log( 'Environment has btoa support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-class-support/README.md b/lib/node_modules/@stdlib/assert/has-class-support/README.md index 1c815a482574..a61e3398175c 100644 --- a/lib/node_modules/@stdlib/assert/has-class-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-class-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasClassSupport = require( '@stdlib/assert/has-class-support' ); +const hasClassSupport = require( '@stdlib/assert/has-class-support' ); ``` #### hasClassSupport() @@ -35,7 +35,7 @@ var hasClassSupport = require( '@stdlib/assert/has-class-support' ); Detects if a runtime environment supports ES2015 [`class`][class]. ```javascript -var bool = hasClassSupport(); +const bool = hasClassSupport(); // returns ``` @@ -60,9 +60,9 @@ var bool = hasClassSupport(); ```javascript -var hasClassSupport = require( '@stdlib/assert/has-class-support' ); +const hasClassSupport = require( '@stdlib/assert/has-class-support' ); -var bool = hasClassSupport(); +const bool = hasClassSupport(); if ( bool ) { console.log( 'Environment has native class support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-dataview-support/README.md b/lib/node_modules/@stdlib/assert/has-dataview-support/README.md index 686afee9fb44..fb2f3b1c45e3 100644 --- a/lib/node_modules/@stdlib/assert/has-dataview-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-dataview-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasDataViewSupport = require( '@stdlib/assert/has-dataview-support' ); +const hasDataViewSupport = require( '@stdlib/assert/has-dataview-support' ); ``` #### hasDataViewSupport() @@ -35,7 +35,7 @@ var hasDataViewSupport = require( '@stdlib/assert/has-dataview-support' ); Detects if a runtime environment supports [`DataView`][mdn-dataview]. ```javascript -var bool = hasDataViewSupport(); +const bool = hasDataViewSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasDataViewSupport(); ```javascript -var hasDataViewSupport = require( '@stdlib/assert/has-dataview-support' ); +const hasDataViewSupport = require( '@stdlib/assert/has-dataview-support' ); -var bool = hasDataViewSupport(); +const bool = hasDataViewSupport(); if ( bool ) { console.log( 'Environment has DataView support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-define-properties-support/README.md b/lib/node_modules/@stdlib/assert/has-define-properties-support/README.md index 9563d16d579b..85b38bdb7acf 100644 --- a/lib/node_modules/@stdlib/assert/has-define-properties-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-define-properties-support/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); +const hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); ``` #### hasDefinePropertiesSupport() @@ -39,7 +39,7 @@ Detects if a runtime environment supports [`Object.defineProperties`][mdn-define ```javascript -var bool = hasDefinePropertiesSupport(); +const bool = hasDefinePropertiesSupport(); // returns ``` @@ -54,9 +54,9 @@ var bool = hasDefinePropertiesSupport(); ```javascript -var hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); +const hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); -var bool = hasDefinePropertiesSupport(); +const bool = hasDefinePropertiesSupport(); if ( bool ) { console.log( 'Environment has `Object.defineProperties` support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-define-property-support/README.md b/lib/node_modules/@stdlib/assert/has-define-property-support/README.md index f6729e8c1c1a..fb510de8e2d4 100644 --- a/lib/node_modules/@stdlib/assert/has-define-property-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-define-property-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasDefinePropertySupport = require( '@stdlib/assert/has-define-property-support' ); +const hasDefinePropertySupport = require( '@stdlib/assert/has-define-property-support' ); ``` #### hasDefinePropertySupport() @@ -35,7 +35,7 @@ var hasDefinePropertySupport = require( '@stdlib/assert/has-define-property-supp Detects if a runtime environment supports [`Object.defineProperty`][mdn-define-property]. ```javascript -var bool = hasDefinePropertySupport(); +const bool = hasDefinePropertySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasDefinePropertySupport(); ```javascript -var hasDefinePropertySupport = require( '@stdlib/assert/has-define-property-support' ); +const hasDefinePropertySupport = require( '@stdlib/assert/has-define-property-support' ); -var bool = hasDefinePropertySupport(); +const bool = hasDefinePropertySupport(); if ( bool ) { console.log( 'Environment has `Object.defineProperty` support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-float32array-support/README.md b/lib/node_modules/@stdlib/assert/has-float32array-support/README.md index cb4aa86b6ac3..7329a8384148 100644 --- a/lib/node_modules/@stdlib/assert/has-float32array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-float32array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' ); +const hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' ); ``` #### hasFloat32ArraySupport() @@ -35,7 +35,7 @@ var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' Detects if a runtime environment supports [`Float32Array`][mdn-float32array]. ```javascript -var bool = hasFloat32ArraySupport(); +const bool = hasFloat32ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasFloat32ArraySupport(); ```javascript -var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' ); +const hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' ); -var bool = hasFloat32ArraySupport(); +const bool = hasFloat32ArraySupport(); if ( bool ) { console.log( 'Environment has Float32Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-float64array-support/README.md b/lib/node_modules/@stdlib/assert/has-float64array-support/README.md index 21e3b880a8e7..6086c49d70b3 100644 --- a/lib/node_modules/@stdlib/assert/has-float64array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-float64array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' ); +const hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' ); ``` #### hasFloat64ArraySupport() @@ -35,7 +35,7 @@ var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' Detects if a runtime environment supports [`Float64Array`][mdn-float64array]. ```javascript -var bool = hasFloat64ArraySupport(); +const bool = hasFloat64ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasFloat64ArraySupport(); ```javascript -var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' ); +const hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' ); -var bool = hasFloat64ArraySupport(); +const bool = hasFloat64ArraySupport(); if ( bool ) { console.log( 'Environment has Float64Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-function-name-support/README.md b/lib/node_modules/@stdlib/assert/has-function-name-support/README.md index 3862c9f5e692..86009cd75d68 100644 --- a/lib/node_modules/@stdlib/assert/has-function-name-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-function-name-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' ); +const hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' ); ``` #### hasFunctionNameSupport() @@ -35,7 +35,7 @@ var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' Detects if a runtime environment supports the ES2015 function [`name`][function-name] property. ```javascript -var bool = hasFunctionNameSupport(); +const bool = hasFunctionNameSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasFunctionNameSupport(); ```javascript -var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' ); +const hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' ); -var bool = hasFunctionNameSupport(); +const bool = hasFunctionNameSupport(); if ( bool ) { console.log( 'Environment has function name support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-generator-support/README.md b/lib/node_modules/@stdlib/assert/has-generator-support/README.md index 3b53359944f3..07ae6e375de1 100644 --- a/lib/node_modules/@stdlib/assert/has-generator-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-generator-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' ); +const hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' ); ``` #### hasGeneratorSupport() @@ -35,7 +35,7 @@ var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' ); Detects if a runtime environment supports ES2015 [`generator functions`][generator-function], i.e. `function*()`. ```javascript -var bool = hasGeneratorSupport(); +const bool = hasGeneratorSupport(); // returns ``` @@ -60,9 +60,9 @@ var bool = hasGeneratorSupport(); ```javascript -var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' ); +const hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' ); -var bool = hasGeneratorSupport(); +const bool = hasGeneratorSupport(); if ( bool ) { console.log( 'Environment has native generator function support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-globalthis-support/README.md b/lib/node_modules/@stdlib/assert/has-globalthis-support/README.md index 9b633d772b14..6b753c1d8e42 100644 --- a/lib/node_modules/@stdlib/assert/has-globalthis-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-globalthis-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasGlobalThisSupport = require( '@stdlib/assert/has-globalthis-support' ); +const hasGlobalThisSupport = require( '@stdlib/assert/has-globalthis-support' ); ``` #### hasGlobalThisSupport() @@ -35,7 +35,7 @@ var hasGlobalThisSupport = require( '@stdlib/assert/has-globalthis-support' ); Detects if a runtime environment supports [`globalThis`][mdn-global-this]. ```javascript -var bool = hasGlobalThisSupport(); +const bool = hasGlobalThisSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasGlobalThisSupport(); ```javascript -var hasGlobalThisSupport = require( '@stdlib/assert/has-globalthis-support' ); +const hasGlobalThisSupport = require( '@stdlib/assert/has-globalthis-support' ); -var bool = hasGlobalThisSupport(); +const bool = hasGlobalThisSupport(); if ( bool ) { console.log( 'Environment has `globalThis` support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-int16array-support/README.md b/lib/node_modules/@stdlib/assert/has-int16array-support/README.md index 94fce8e34b10..67e8a91bc771 100644 --- a/lib/node_modules/@stdlib/assert/has-int16array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-int16array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' ); +const hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' ); ``` #### hasInt16ArraySupport() @@ -35,7 +35,7 @@ var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' ); Detects if a runtime environment supports [`Int16Array`][mdn-int16array]. ```javascript -var bool = hasInt16ArraySupport(); +const bool = hasInt16ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasInt16ArraySupport(); ```javascript -var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' ); +const hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' ); -var bool = hasInt16ArraySupport(); +const bool = hasInt16ArraySupport(); if ( bool ) { console.log( 'Environment has Int16Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-int32array-support/README.md b/lib/node_modules/@stdlib/assert/has-int32array-support/README.md index 653f8fb1d3ed..35e43a18557d 100644 --- a/lib/node_modules/@stdlib/assert/has-int32array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-int32array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' ); +const hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' ); ``` #### hasInt32ArraySupport() @@ -35,7 +35,7 @@ var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' ); Detects if a runtime environment supports [`Int32Array`][mdn-int32array]. ```javascript -var bool = hasInt32ArraySupport(); +const bool = hasInt32ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasInt32ArraySupport(); ```javascript -var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' ); +const hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' ); -var bool = hasInt32ArraySupport(); +const bool = hasInt32ArraySupport(); if ( bool ) { console.log( 'Environment has Int32Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-int8array-support/README.md b/lib/node_modules/@stdlib/assert/has-int8array-support/README.md index 56befdbb2378..0d871f1be41f 100644 --- a/lib/node_modules/@stdlib/assert/has-int8array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-int8array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' ); +const hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' ); ``` #### hasInt8ArraySupport() @@ -35,7 +35,7 @@ var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' ); Detects if a runtime environment supports [`Int8Array`][mdn-int8array]. ```javascript -var bool = hasInt8ArraySupport(); +const bool = hasInt8ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasInt8ArraySupport(); ```javascript -var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' ); +const hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' ); -var bool = hasInt8ArraySupport(); +const bool = hasInt8ArraySupport(); if ( bool ) { console.log( 'Environment has Int8Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-iterator-symbol-support/README.md b/lib/node_modules/@stdlib/assert/has-iterator-symbol-support/README.md index 434f3837b5d5..8734f0d55746 100644 --- a/lib/node_modules/@stdlib/assert/has-iterator-symbol-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-iterator-symbol-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' ); +const hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' ); ``` #### hasIteratorSymbolSupport() @@ -35,7 +35,7 @@ var hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-supp Detects if a runtime environment supports ES2015 [`Symbol.iterator`][mdn-iterator-symbol]. ```javascript -var bool = hasIteratorSymbolSupport(); +const bool = hasIteratorSymbolSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasIteratorSymbolSupport(); ```javascript -var hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' ); +const hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' ); -var bool = hasIteratorSymbolSupport(); +const bool = hasIteratorSymbolSupport(); if ( bool ) { console.log( 'Environment has Symbol.iterator support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-map-support/README.md b/lib/node_modules/@stdlib/assert/has-map-support/README.md index c2fa0f5ff0a3..68eecb32bdf6 100644 --- a/lib/node_modules/@stdlib/assert/has-map-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-map-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasMapSupport = require( '@stdlib/assert/has-map-support' ); +const hasMapSupport = require( '@stdlib/assert/has-map-support' ); ``` #### hasMapSupport() @@ -35,7 +35,7 @@ var hasMapSupport = require( '@stdlib/assert/has-map-support' ); Detects if a runtime environment supports ES2015 [`Map`][mdn-map]. ```javascript -var bool = hasMapSupport(); +const bool = hasMapSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasMapSupport(); ```javascript -var hasMapSupport = require( '@stdlib/assert/has-map-support' ); +const hasMapSupport = require( '@stdlib/assert/has-map-support' ); -var bool = hasMapSupport(); +const bool = hasMapSupport(); if ( bool ) { console.log( 'Environment has Map support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-node-buffer-support/README.md b/lib/node_modules/@stdlib/assert/has-node-buffer-support/README.md index e4759962d109..e1793e466f08 100644 --- a/lib/node_modules/@stdlib/assert/has-node-buffer-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-node-buffer-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' ); +const hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' ); ``` #### hasNodeBufferSupport() @@ -35,7 +35,7 @@ var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' ); Detects if a runtime environment supports [`Buffer`][node-buffer]. ```javascript -var bool = hasNodeBufferSupport(); +const bool = hasNodeBufferSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasNodeBufferSupport(); ```javascript -var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' ); +const hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' ); -var bool = hasNodeBufferSupport(); +const bool = hasNodeBufferSupport(); if ( bool ) { console.log( 'Environment has Buffer support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-own-property/README.md b/lib/node_modules/@stdlib/assert/has-own-property/README.md index 9ded631798fb..d0ec6b598d97 100644 --- a/lib/node_modules/@stdlib/assert/has-own-property/README.md +++ b/lib/node_modules/@stdlib/assert/has-own-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +const hasOwnProp = require( '@stdlib/assert/has-own-property' ); ``` #### hasOwnProp( value, property ) @@ -35,11 +35,11 @@ var hasOwnProp = require( '@stdlib/assert/has-own-property' ); Returns a `boolean` indicating if a `value` has a specified `property`. ```javascript -var value = { +const value = { 'beep': 'boop' }; -var bool = hasOwnProp( value, 'beep' ); +let bool = hasOwnProp( value, 'beep' ); // returns true bool = hasOwnProp( value, 'bap' ); @@ -57,7 +57,7 @@ bool = hasOwnProp( value, 'bap' ); - In contrast to the native [Object.prototype.hasOwnProperty][mdn-object-has-own-property], this function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`. ```javascript - var bool = hasOwnProp( null, 'a' ); + let bool = hasOwnProp( null, 'a' ); // returns false bool = hasOwnProp( void 0, 'a' ); @@ -67,17 +67,17 @@ bool = hasOwnProp( value, 'bap' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = hasOwnProp( 'beep', 'length' ); + const bool = hasOwnProp( 'beep', 'length' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var value = { + let value = { 'null': false }; - var bool = hasOwnProp( value, null ); + let bool = hasOwnProp( value, null ); // returns true value = { @@ -100,9 +100,9 @@ bool = hasOwnProp( value, 'bap' ); ```javascript -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +const hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var bool = hasOwnProp( { 'a': 'b' }, 'a' ); +let bool = hasOwnProp( { 'a': 'b' }, 'a' ); // returns true bool = hasOwnProp( { 'a': 'b' }, 'c' ); diff --git a/lib/node_modules/@stdlib/assert/has-property/README.md b/lib/node_modules/@stdlib/assert/has-property/README.md index 8c885f5c0ae9..cddde5f17168 100644 --- a/lib/node_modules/@stdlib/assert/has-property/README.md +++ b/lib/node_modules/@stdlib/assert/has-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasProp = require( '@stdlib/assert/has-property' ); +const hasProp = require( '@stdlib/assert/has-property' ); ``` #### hasProp( value, property ) @@ -35,11 +35,11 @@ var hasProp = require( '@stdlib/assert/has-property' ); Returns a `boolean` indicating if a `value` has a specified `property`, either own or inherited. ```javascript -var value = { +const value = { 'beep': 'boop' }; -var bool = hasProp( value, 'beep' ); +let bool = hasProp( value, 'beep' ); // returns true bool = hasProp( value, 'hasOwnProperty' ); @@ -60,7 +60,7 @@ bool = hasProp( value, 'bap' ); - The function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`. ```javascript - var bool = hasProp( null, 'a' ); + let bool = hasProp( null, 'a' ); // returns false bool = hasProp( void 0, 'a' ); @@ -70,17 +70,17 @@ bool = hasProp( value, 'bap' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = hasProp( 'beep', 'length' ); + const bool = hasProp( 'beep', 'length' ); // returns true ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var value = { + let value = { 'null': false }; - var bool = hasProp( value, null ); + let bool = hasProp( value, null ); // returns true value = { @@ -103,9 +103,9 @@ bool = hasProp( value, 'bap' ); ```javascript -var hasProp = require( '@stdlib/assert/has-property' ); +const hasProp = require( '@stdlib/assert/has-property' ); -var bool = hasProp( { 'a': 'b' }, 'a' ); +let bool = hasProp( { 'a': 'b' }, 'a' ); // returns true bool = hasProp( {}, 'hasOwnProperty' ); diff --git a/lib/node_modules/@stdlib/assert/has-proxy-support/README.md b/lib/node_modules/@stdlib/assert/has-proxy-support/README.md index ea67f57bbfbb..0a1c58ae2917 100644 --- a/lib/node_modules/@stdlib/assert/has-proxy-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-proxy-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasProxySupport = require( '@stdlib/assert/has-proxy-support' ); +const hasProxySupport = require( '@stdlib/assert/has-proxy-support' ); ``` #### hasProxySupport() @@ -35,7 +35,7 @@ var hasProxySupport = require( '@stdlib/assert/has-proxy-support' ); Detects if a runtime environment supports ES2015 [`Proxy`][mdn-proxy]. ```javascript -var bool = hasProxySupport(); +const bool = hasProxySupport(); // returns ``` @@ -60,9 +60,9 @@ var bool = hasProxySupport(); ```javascript -var hasProxySupport = require( '@stdlib/assert/has-proxy-support' ); +const hasProxySupport = require( '@stdlib/assert/has-proxy-support' ); -var bool = hasProxySupport(); +const bool = hasProxySupport(); if ( bool ) { console.log( 'Environment has native Proxy support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-set-support/README.md b/lib/node_modules/@stdlib/assert/has-set-support/README.md index d09bf798be52..a5b056cec8c5 100644 --- a/lib/node_modules/@stdlib/assert/has-set-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-set-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasSetSupport = require( '@stdlib/assert/has-set-support' ); +const hasSetSupport = require( '@stdlib/assert/has-set-support' ); ``` #### hasSetSupport() @@ -35,7 +35,7 @@ var hasSetSupport = require( '@stdlib/assert/has-set-support' ); Detects if a runtime environment supports ES2015 [`Set`][mdn-set]. ```javascript -var bool = hasSetSupport(); +const bool = hasSetSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasSetSupport(); ```javascript -var hasSetSupport = require( '@stdlib/assert/has-set-support' ); +const hasSetSupport = require( '@stdlib/assert/has-set-support' ); -var bool = hasSetSupport(); +const bool = hasSetSupport(); if ( bool ) { console.log( 'Environment has Set support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/README.md b/lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/README.md index 12c7f985166e..983d5c72d952 100644 --- a/lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var hasSharedArrayBufferSupport = require( '@stdlib/assert/has-sharedarraybuffer-support' ); +const hasSharedArrayBufferSupport = require( '@stdlib/assert/has-sharedarraybuffer-support' ); ``` #### hasSharedArrayBufferSupport() @@ -39,7 +39,7 @@ Detects if a runtime environment supports [`SharedArrayBuffer`][mdn-sharedarrayb ```javascript -var bool = hasSharedArrayBufferSupport(); +const bool = hasSharedArrayBufferSupport(); // returns ``` @@ -56,9 +56,9 @@ var bool = hasSharedArrayBufferSupport(); ```javascript -var hasSharedArrayBufferSupport = require( '@stdlib/assert/has-sharedarraybuffer-support' ); +const hasSharedArrayBufferSupport = require( '@stdlib/assert/has-sharedarraybuffer-support' ); -var bool = hasSharedArrayBufferSupport(); +const bool = hasSharedArrayBufferSupport(); if ( bool ) { console.log( 'Environment has SharedArrayBuffer support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-symbol-support/README.md b/lib/node_modules/@stdlib/assert/has-symbol-support/README.md index de1a32aff9fb..cbb4e53f4107 100644 --- a/lib/node_modules/@stdlib/assert/has-symbol-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-symbol-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); ``` #### hasSymbolSupport() @@ -35,7 +35,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); Detects if a runtime environment supports ES2015 [`Symbol`][mdn-symbol]. ```javascript -var bool = hasSymbolSupport(); +const bool = hasSymbolSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasSymbolSupport(); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var bool = hasSymbolSupport(); +const bool = hasSymbolSupport(); if ( bool ) { console.log( 'Environment has Symbol support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-tostringtag-support/README.md b/lib/node_modules/@stdlib/assert/has-tostringtag-support/README.md index d26fb7f785e9..7018e99e7325 100644 --- a/lib/node_modules/@stdlib/assert/has-tostringtag-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-tostringtag-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' ); +const hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' ); ``` #### hasToStringTagSupport() @@ -35,7 +35,7 @@ var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' ); Detects if a runtime environment supports ES2015 [`Symbol.toStringTag`][mdn-symbol]. ```javascript -var bool = hasToStringTagSupport(); +const bool = hasToStringTagSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasToStringTagSupport(); ```javascript -var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' ); +const hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' ); -var bool = hasToStringTagSupport(); +const bool = hasToStringTagSupport(); if ( bool ) { console.log( 'Environment has `toStringTag` support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-uint16array-support/README.md b/lib/node_modules/@stdlib/assert/has-uint16array-support/README.md index 5797db6113c9..6fc6672d2d88 100644 --- a/lib/node_modules/@stdlib/assert/has-uint16array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-uint16array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' ); +const hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' ); ``` #### hasUint16ArraySupport() @@ -35,7 +35,7 @@ var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' ); Detects if a runtime environment supports [`Uint16Array`][mdn-uint16array]. ```javascript -var bool = hasUint16ArraySupport(); +const bool = hasUint16ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasUint16ArraySupport(); ```javascript -var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' ); +const hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' ); -var bool = hasUint16ArraySupport(); +const bool = hasUint16ArraySupport(); if ( bool ) { console.log( 'Environment has Uint16Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-uint32array-support/README.md b/lib/node_modules/@stdlib/assert/has-uint32array-support/README.md index 59bef353881e..6565597696eb 100644 --- a/lib/node_modules/@stdlib/assert/has-uint32array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-uint32array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' ); +const hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' ); ``` #### hasUint32ArraySupport() @@ -35,7 +35,7 @@ var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' ); Detects if a runtime environment supports [`Uint32Array`][mdn-uint32array]. ```javascript -var bool = hasUint32ArraySupport(); +const bool = hasUint32ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasUint32ArraySupport(); ```javascript -var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' ); +const hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' ); -var bool = hasUint32ArraySupport(); +const bool = hasUint32ArraySupport(); if ( bool ) { console.log( 'Environment has Uint32Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-uint8array-support/README.md b/lib/node_modules/@stdlib/assert/has-uint8array-support/README.md index 50e52d6ecc34..0705b73b22f2 100644 --- a/lib/node_modules/@stdlib/assert/has-uint8array-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-uint8array-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' ); +const hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' ); ``` #### hasUint8ArraySupport() @@ -35,7 +35,7 @@ var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' ); Detects if a runtime environment supports [`Uint8Array`][mdn-uint8array]. ```javascript -var bool = hasUint8ArraySupport(); +const bool = hasUint8ArraySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasUint8ArraySupport(); ```javascript -var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' ); +const hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' ); -var bool = hasUint8ArraySupport(); +const bool = hasUint8ArraySupport(); if ( bool ) { console.log( 'Environment has Uint8Array support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-uint8clampedarray-support/README.md b/lib/node_modules/@stdlib/assert/has-uint8clampedarray-support/README.md index f87b23498032..1b86e97a93e3 100644 --- a/lib/node_modules/@stdlib/assert/has-uint8clampedarray-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-uint8clampedarray-support/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); +const hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); ``` #### hasUint8ClampedArraySupport() @@ -39,7 +39,7 @@ Detects if a runtime environment supports [`Uint8ClampedArray`][mdn-uint8clamped ```javascript -var bool = hasUint8ClampedArraySupport(); +const bool = hasUint8ClampedArraySupport(); // returns ``` @@ -56,9 +56,9 @@ var bool = hasUint8ClampedArraySupport(); ```javascript -var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); +const hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); -var bool = hasUint8ClampedArraySupport(); +const bool = hasUint8ClampedArraySupport(); if ( bool ) { console.log( 'Environment has Uint8ClampedArray support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-utf16-surrogate-pair-at/README.md b/lib/node_modules/@stdlib/assert/has-utf16-surrogate-pair-at/README.md index 03df9487d19f..5f1b663fd681 100644 --- a/lib/node_modules/@stdlib/assert/has-utf16-surrogate-pair-at/README.md +++ b/lib/node_modules/@stdlib/assert/has-utf16-surrogate-pair-at/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasUTF16SurrogatePairAt = require( '@stdlib/assert/has-utf16-surrogate-pair-at' ); +const hasUTF16SurrogatePairAt = require( '@stdlib/assert/has-utf16-surrogate-pair-at' ); ``` #### hasUTF16SurrogatePairAt( string, position ) @@ -35,7 +35,7 @@ var hasUTF16SurrogatePairAt = require( '@stdlib/assert/has-utf16-surrogate-pair- Tests if a `position` (in [UTF-16][utf-16] code units) in a `string` marks the start of a [UTF-16][utf-16] surrogate pair. ```javascript -var bool = hasUTF16SurrogatePairAt( '🌷', 0 ); +let bool = hasUTF16SurrogatePairAt( '🌷', 0 ); // returns true bool = hasUTF16SurrogatePairAt( '🌷', 1 ); @@ -63,9 +63,9 @@ bool = hasUTF16SurrogatePairAt( '🌷', 1 ); ```javascript -var hasUTF16SurrogatePairAt = require( '@stdlib/assert/has-utf16-surrogate-pair-at' ); +const hasUTF16SurrogatePairAt = require( '@stdlib/assert/has-utf16-surrogate-pair-at' ); -var bool = hasUTF16SurrogatePairAt( '🌷', 0 ); +let bool = hasUTF16SurrogatePairAt( '🌷', 0 ); // returns true bool = hasUTF16SurrogatePairAt( '🌷', 1 ); diff --git a/lib/node_modules/@stdlib/assert/has-wasm-support/README.md b/lib/node_modules/@stdlib/assert/has-wasm-support/README.md index cff9bdedc8f4..3f792d81817b 100644 --- a/lib/node_modules/@stdlib/assert/has-wasm-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-wasm-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); ``` #### hasWebAssemblySupport() @@ -35,7 +35,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); Detects if a runtime environment supports [WebAssembly][webassembly]. ```javascript -var bool = hasWebAssemblySupport(); +const bool = hasWebAssemblySupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasWebAssemblySupport(); ```javascript -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); -var bool = hasWebAssemblySupport(); +const bool = hasWebAssemblySupport(); if ( bool ) { console.log( 'Environment has WebAssembly support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-weakmap-support/README.md b/lib/node_modules/@stdlib/assert/has-weakmap-support/README.md index 15fd3e631e3e..72a8777476a5 100644 --- a/lib/node_modules/@stdlib/assert/has-weakmap-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-weakmap-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' ); +const hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' ); ``` #### hasWeakMapSupport() @@ -35,7 +35,7 @@ var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' ); Detects if a runtime environment supports ES2015 [`WeakMap`][mdn-weakmap]. ```javascript -var bool = hasWeakMapSupport(); +const bool = hasWeakMapSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasWeakMapSupport(); ```javascript -var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' ); +const hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' ); -var bool = hasWeakMapSupport(); +const bool = hasWeakMapSupport(); if ( bool ) { console.log( 'Environment has WeakMap support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/has-weakset-support/README.md b/lib/node_modules/@stdlib/assert/has-weakset-support/README.md index 48ea52ff6b93..eb6977666323 100644 --- a/lib/node_modules/@stdlib/assert/has-weakset-support/README.md +++ b/lib/node_modules/@stdlib/assert/has-weakset-support/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' ); +const hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' ); ``` #### hasWeakSetSupport() @@ -35,7 +35,7 @@ var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' ); Detects if a runtime environment supports ES2015 [`WeakSet`][mdn-weakset]. ```javascript -var bool = hasWeakSetSupport(); +const bool = hasWeakSetSupport(); // returns ``` @@ -50,9 +50,9 @@ var bool = hasWeakSetSupport(); ```javascript -var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' ); +const hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' ); -var bool = hasWeakSetSupport(); +const bool = hasWeakSetSupport(); if ( bool ) { console.log( 'Environment has WeakSet support.' ); } else { diff --git a/lib/node_modules/@stdlib/assert/instance-of/README.md b/lib/node_modules/@stdlib/assert/instance-of/README.md index 66ef6285e4b8..9ab08d591f47 100644 --- a/lib/node_modules/@stdlib/assert/instance-of/README.md +++ b/lib/node_modules/@stdlib/assert/instance-of/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var instanceOf = require( '@stdlib/assert/instance-of' ); +const instanceOf = require( '@stdlib/assert/instance-of' ); ``` #### instanceOf( value, constructor ) @@ -41,7 +41,7 @@ var instanceOf = require( '@stdlib/assert/instance-of' ); Tests whether a `value` has in its prototype chain a specified `constructor` as a `prototype` property. ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Foo() { return this; @@ -52,9 +52,9 @@ function Bar() { } inherit( Bar, Foo ); -var bar = new Bar(); +const bar = new Bar(); -var bool = instanceOf( bar, Foo ); +const bool = instanceOf( bar, Foo ); // returns true ``` @@ -69,7 +69,7 @@ var bool = instanceOf( bar, Foo ); - The function throws a `TypeError` if provided a `constructor` argument which is not callable. ```javascript - var bool = instanceOf( {}, null ); + const bool = instanceOf( {}, null ); // throws ``` @@ -80,9 +80,9 @@ var bool = instanceOf( bar, Foo ); ```javascript - var Object = require( '@stdlib/object/ctor' ); + const Object = require( '@stdlib/object/ctor' ); - var bool = ( {} instanceof Object ); + let bool = ( {} instanceof Object ); // returns true bool = instanceOf( {}, Object ); @@ -104,12 +104,12 @@ var bool = instanceOf( bar, Foo ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var Object = require( '@stdlib/object/ctor' ); -var Function = require( '@stdlib/function/ctor' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); +const Number = require( '@stdlib/number/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Function = require( '@stdlib/function/ctor' ); +const instanceOf = require( '@stdlib/assert/instance-of' ); -var bool = instanceOf( [], Array ); +let bool = instanceOf( [], Array ); // returns true bool = instanceOf( [], Object ); diff --git a/lib/node_modules/@stdlib/assert/is-absolute-http-uri/README.md b/lib/node_modules/@stdlib/assert/is-absolute-http-uri/README.md index 04a1880478f9..cae3fa9f870b 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-http-uri/README.md +++ b/lib/node_modules/@stdlib/assert/is-absolute-http-uri/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isAbsoluteHttpURI = require( '@stdlib/assert/is-absolute-http-uri' ); +const isAbsoluteHttpURI = require( '@stdlib/assert/is-absolute-http-uri' ); ``` #### isAbsoluteHttpURI( value ) @@ -45,7 +45,7 @@ var isAbsoluteHttpURI = require( '@stdlib/assert/is-absolute-http-uri' ); Tests whether a value is an absolute HTTP(S) [URI][uri]. ```javascript -var bool = isAbsoluteHttpURI( 'http://example.com' ); +let bool = isAbsoluteHttpURI( 'http://example.com' ); // returns true bool = isAbsoluteHttpURI( './beep/boop' ); @@ -78,9 +78,9 @@ bool = isAbsoluteHttpURI( './beep/boop' ); ```javascript -var isAbsoluteHttpURI = require( '@stdlib/assert/is-absolute-http-uri' ); +const isAbsoluteHttpURI = require( '@stdlib/assert/is-absolute-http-uri' ); -var bool = isAbsoluteHttpURI( 'https://www.google.com/' ); +let bool = isAbsoluteHttpURI( 'https://www.google.com/' ); // returns true bool = isAbsoluteHttpURI( 'https://www.google.com/search?q=node.js' ); diff --git a/lib/node_modules/@stdlib/assert/is-absolute-path/README.md b/lib/node_modules/@stdlib/assert/is-absolute-path/README.md index c3a098f1d59e..84f29737fddc 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-path/README.md +++ b/lib/node_modules/@stdlib/assert/is-absolute-path/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isAbsolutePath = require( '@stdlib/assert/is-absolute-path' ); +const isAbsolutePath = require( '@stdlib/assert/is-absolute-path' ); ``` #### isAbsolutePath( value ) @@ -41,9 +41,9 @@ var isAbsolutePath = require( '@stdlib/assert/is-absolute-path' ); Tests if a `value` is an absolute path. ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var bool; +let bool; if ( IS_WINDOWS ) { bool = isAbsolutePath( 'C:\\foo\\bar\\baz' ); // returns true @@ -58,7 +58,7 @@ if ( IS_WINDOWS ) { Tests if a `value` is a POSIX absolute path. ```javascript -var bool = isAbsolutePath.posix( '/foo/bar/baz' ); +let bool = isAbsolutePath.posix( '/foo/bar/baz' ); // returns true bool = isAbsolutePath.posix( 'foo/bar/baz' ); @@ -70,7 +70,7 @@ bool = isAbsolutePath.posix( 'foo/bar/baz' ); Tests if a `value` is a Windows absolute path. ```javascript -var bool = isAbsolutePath.win32( 'C:\\foo\\bar\\baz' ); +let bool = isAbsolutePath.win32( 'C:\\foo\\bar\\baz' ); // returns true bool = isAbsolutePath.win32( 'foo\\bar\\baz' ); @@ -98,9 +98,9 @@ bool = isAbsolutePath.win32( 'foo\\bar\\baz' ); ```javascript -var isAbsolutePath = require( '@stdlib/assert/is-absolute-path' ); +const isAbsolutePath = require( '@stdlib/assert/is-absolute-path' ); -var bool = isAbsolutePath.posix( '/foo/bar/baz' ); +let bool = isAbsolutePath.posix( '/foo/bar/baz' ); // returns true bool = isAbsolutePath.posix( '/foo/..' ); diff --git a/lib/node_modules/@stdlib/assert/is-absolute-uri/README.md b/lib/node_modules/@stdlib/assert/is-absolute-uri/README.md index 5389e38535bc..9e3aa84da02d 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-uri/README.md +++ b/lib/node_modules/@stdlib/assert/is-absolute-uri/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isAbsoluteURI = require( '@stdlib/assert/is-absolute-uri' ); +const isAbsoluteURI = require( '@stdlib/assert/is-absolute-uri' ); ``` #### isAbsoluteURI( value ) @@ -45,7 +45,7 @@ var isAbsoluteURI = require( '@stdlib/assert/is-absolute-uri' ); Tests whether a value is an absolute [URI][uri]. ```javascript -var bool = isAbsoluteURI( 'http://example.com' ); +let bool = isAbsoluteURI( 'http://example.com' ); // returns true bool = isAbsoluteURI( './beep/boop' ); @@ -78,9 +78,9 @@ bool = isAbsoluteURI( './beep/boop' ); ```javascript -var isAbsoluteURI = require( '@stdlib/assert/is-absolute-uri' ); +const isAbsoluteURI = require( '@stdlib/assert/is-absolute-uri' ); -var bool = isAbsoluteURI( 'https://www.google.com/' ); +let bool = isAbsoluteURI( 'https://www.google.com/' ); // returns true bool = isAbsoluteURI( 'https://www.google.com/search?q=node.js' ); diff --git a/lib/node_modules/@stdlib/assert/is-accessor-array/README.md b/lib/node_modules/@stdlib/assert/is-accessor-array/README.md index 01c7ae37476e..ee89427b6a86 100644 --- a/lib/node_modules/@stdlib/assert/is-accessor-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-accessor-array/README.md @@ -35,7 +35,7 @@ An accessor array is defined as either an [`Array`][mdn-array], [`Typed Array`][ ## Usage ```javascript -var isAccessorArray = require( '@stdlib/assert/is-accessor-array' ); +const isAccessorArray = require( '@stdlib/assert/is-accessor-array' ); ``` #### isAccessorArray( value ) @@ -43,14 +43,14 @@ var isAccessorArray = require( '@stdlib/assert/is-accessor-array' ); Tests if a value is an array-like object supporting the accessor (get/set) protocol. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); // Create a new complex number array: -var arr = new Complex128Array( 10 ); +const arr = new Complex128Array( 10 ); // Retrieve a complex number element: -var z = arr.get( 0 ); +const z = arr.get( 0 ); // returns // Set a complex number element: @@ -59,7 +59,7 @@ arr.set( new Complex128( 1.0, 1.0 ), 0 ); // ... // Check whether an array is an accessor array: -var bool = isAccessorArray( arr ); +const bool = isAccessorArray( arr ); // returns true ``` @@ -76,20 +76,20 @@ var bool = isAccessorArray( arr ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isAccessorArray = require( '@stdlib/assert/is-accessor-array' ); - -var bool = isAccessorArray( new Complex128Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isAccessorArray = require( '@stdlib/assert/is-accessor-array' ); + +let bool = isAccessorArray( new Complex128Array( 10 ) ); // returns true bool = isAccessorArray( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-accessor-property-in/README.md b/lib/node_modules/@stdlib/assert/is-accessor-property-in/README.md index 9611e6e6ba6e..5bb33f7656dd 100644 --- a/lib/node_modules/@stdlib/assert/is-accessor-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-accessor-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isAccessorPropertyIn = require( '@stdlib/assert/is-accessor-property-in' ); +const isAccessorPropertyIn = require( '@stdlib/assert/is-accessor-property-in' ); ``` #### isAccessorPropertyIn( value, property ) @@ -37,16 +37,15 @@ Returns a `boolean` indicating if an object's own or inherited `property` has an ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; return this; } +const obj = new Foo(); + defineProperty( Foo.prototype, 'beep', { 'configurable': false, 'enumerable': false, @@ -65,9 +64,7 @@ defineProperty( Foo.prototype, 'accessor', { } }); -obj = new Foo(); - -bool = isAccessorPropertyIn( obj, 'foo' ); +let bool = isAccessorPropertyIn( obj, 'foo' ); // returns false bool = isAccessorPropertyIn( obj, 'beep' ); @@ -88,16 +85,16 @@ bool = isAccessorPropertyIn( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isAccessorPropertyIn( 'beep', 'length' ); + const bool = isAccessorPropertyIn( 'beep', 'length' ); // returns false ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; function getter() { return true; @@ -109,7 +106,7 @@ bool = isAccessorPropertyIn( obj, 'accessor' ); 'get': getter }); - var bool = isAccessorPropertyIn( obj, null ); + const bool = isAccessorPropertyIn( obj, null ); // returns true ``` @@ -126,9 +123,9 @@ bool = isAccessorPropertyIn( obj, 'accessor' ); ```javascript -var isAccessorPropertyIn = require( '@stdlib/assert/is-accessor-property-in' ); +const isAccessorPropertyIn = require( '@stdlib/assert/is-accessor-property-in' ); -var bool = isAccessorPropertyIn( [ 'a' ], 'length' ); +let bool = isAccessorPropertyIn( [ 'a' ], 'length' ); // returns false bool = isAccessorPropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-accessor-property/README.md b/lib/node_modules/@stdlib/assert/is-accessor-property/README.md index 2a914e3409eb..ef38eb940557 100644 --- a/lib/node_modules/@stdlib/assert/is-accessor-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-accessor-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isAccessorProperty = require( '@stdlib/assert/is-accessor-property' ); +const isAccessorProperty = require( '@stdlib/assert/is-accessor-property' ); ``` #### isAccessorProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if an object's own `property` has an accessor des ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -61,7 +61,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isAccessorProperty( obj, 'foo' ); +let bool = isAccessorProperty( obj, 'foo' ); // returns false bool = isAccessorProperty( obj, 'beep' ); @@ -82,16 +82,16 @@ bool = isAccessorProperty( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isAccessorProperty( 'beep', 'length' ); + const bool = isAccessorProperty( 'beep', 'length' ); // returns false ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; function getter() { return true; @@ -103,7 +103,7 @@ bool = isAccessorProperty( obj, 'accessor' ); 'get': getter }); - var bool = isAccessorProperty( obj, null ); + const bool = isAccessorProperty( obj, null ); // returns true ``` @@ -120,9 +120,9 @@ bool = isAccessorProperty( obj, 'accessor' ); ```javascript -var isAccessorProperty = require( '@stdlib/assert/is-accessor-property' ); +const isAccessorProperty = require( '@stdlib/assert/is-accessor-property' ); -var bool = isAccessorProperty( [ 'a' ], 'length' ); +let bool = isAccessorProperty( [ 'a' ], 'length' ); // returns false bool = isAccessorProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-alphagram/README.md b/lib/node_modules/@stdlib/assert/is-alphagram/README.md index c8eb9559e570..149a4d2390b6 100644 --- a/lib/node_modules/@stdlib/assert/is-alphagram/README.md +++ b/lib/node_modules/@stdlib/assert/is-alphagram/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isAlphagram = require( '@stdlib/assert/is-alphagram' ); +const isAlphagram = require( '@stdlib/assert/is-alphagram' ); ``` #### isAlphagram( value ) @@ -35,9 +35,9 @@ var isAlphagram = require( '@stdlib/assert/is-alphagram' ); Tests if a `value` is an [alphagram][alphagram] (i.e., a sequence of characters arranged in alphabetical order). ```javascript -var value = 'beep'; +const value = 'beep'; -var bool = isAlphagram( value ); +const bool = isAlphagram( value ); // returns true ``` @@ -64,9 +64,9 @@ var bool = isAlphagram( value ); ```javascript -var isAlphagram = require( '@stdlib/assert/is-alphagram' ); +const isAlphagram = require( '@stdlib/assert/is-alphagram' ); -var out = isAlphagram( 'beep' ); +let out = isAlphagram( 'beep' ); // returns true out = isAlphagram( new String( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-alphanumeric/README.md b/lib/node_modules/@stdlib/assert/is-alphanumeric/README.md index 255b43c26894..6602e4173813 100644 --- a/lib/node_modules/@stdlib/assert/is-alphanumeric/README.md +++ b/lib/node_modules/@stdlib/assert/is-alphanumeric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isAlphaNumeric = require( '@stdlib/assert/is-alphanumeric' ); +const isAlphaNumeric = require( '@stdlib/assert/is-alphanumeric' ); ``` #### isAlphaNumeric( value ) @@ -35,7 +35,7 @@ var isAlphaNumeric = require( '@stdlib/assert/is-alphanumeric' ); Tests whether a string contains only alphanumeric characters. ```javascript -var bool = isAlphaNumeric( 'abc0123456789' ); +const bool = isAlphaNumeric( 'abc0123456789' ); // returns true ``` @@ -61,9 +61,9 @@ var bool = isAlphaNumeric( 'abc0123456789' ); ```javascript -var isAlphaNumeric = require( '@stdlib/assert/is-alphanumeric' ); +const isAlphaNumeric = require( '@stdlib/assert/is-alphanumeric' ); -var out = isAlphaNumeric( 'abs0123456789' ); +let out = isAlphaNumeric( 'abs0123456789' ); // returns true out = isAlphaNumeric( '0xffffff' ); diff --git a/lib/node_modules/@stdlib/assert/is-anagram/README.md b/lib/node_modules/@stdlib/assert/is-anagram/README.md index df70df36dcf1..3715adbc4a4e 100644 --- a/lib/node_modules/@stdlib/assert/is-anagram/README.md +++ b/lib/node_modules/@stdlib/assert/is-anagram/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isAnagram = require( '@stdlib/assert/is-anagram' ); +const isAnagram = require( '@stdlib/assert/is-anagram' ); ``` #### isAnagram( str, value ) @@ -35,10 +35,10 @@ var isAnagram = require( '@stdlib/assert/is-anagram' ); Tests if a `value` is an [anagram][anagram]. ```javascript -var str = 'I am a weakish speller'; -var value = 'William Shakespeare'; +const str = 'I am a weakish speller'; +const value = 'William Shakespeare'; -var bool = isAnagram( str, value ); +const bool = isAnagram( str, value ); // returns true ``` @@ -67,9 +67,9 @@ var bool = isAnagram( str, value ); ```javascript -var isAnagram = require( '@stdlib/assert/is-anagram' ); +const isAnagram = require( '@stdlib/assert/is-anagram' ); -var bool = isAnagram( 'I am a weakish speller', 'William Shakespeare' ); +let bool = isAnagram( 'I am a weakish speller', 'William Shakespeare' ); // returns true bool = isAnagram( 'bat', 'tab' ); diff --git a/lib/node_modules/@stdlib/assert/is-arguments/README.md b/lib/node_modules/@stdlib/assert/is-arguments/README.md index 878ae9d69cf3..c79b63f26c29 100644 --- a/lib/node_modules/@stdlib/assert/is-arguments/README.md +++ b/lib/node_modules/@stdlib/assert/is-arguments/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArguments = require( '@stdlib/assert/is-arguments' ); +const isArguments = require( '@stdlib/assert/is-arguments' ); ``` #### isArguments( value ) @@ -39,7 +39,7 @@ function foo() { return arguments; } -var bool = isArguments( foo() ); +let bool = isArguments( foo() ); // returns true bool = isArguments( [] ); @@ -57,13 +57,13 @@ bool = isArguments( [] ); ```javascript -var isArguments = require( '@stdlib/assert/is-arguments' ); +const isArguments = require( '@stdlib/assert/is-arguments' ); function foo() { return arguments; } -var bool = isArguments( foo() ); +let bool = isArguments( foo() ); // returns true bool = isArguments( [] ); diff --git a/lib/node_modules/@stdlib/assert/is-array-array/README.md b/lib/node_modules/@stdlib/assert/is-array-array/README.md index 741d44f2265a..5859e8926bb1 100644 --- a/lib/node_modules/@stdlib/assert/is-array-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-array-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayArray = require( '@stdlib/assert/is-array-array' ); +const isArrayArray = require( '@stdlib/assert/is-array-array' ); ``` #### isArrayArray( value ) @@ -35,7 +35,7 @@ var isArrayArray = require( '@stdlib/assert/is-array-array' ); Tests if a `value` is an `array` of `arrays`. ```javascript -var bool = isArrayArray( [ [], [] ] ); +let bool = isArrayArray( [ [], [] ] ); // returns true bool = isArrayArray( [ {}, {} ] ); @@ -62,9 +62,9 @@ bool = isArrayArray( [ null, {} ] ); ```javascript -var isArrayArray = require( '@stdlib/assert/is-array-array' ); +const isArrayArray = require( '@stdlib/assert/is-array-array' ); -var bool = isArrayArray( [ [], [], [] ] ); +let bool = isArrayArray( [ [], [], [] ] ); // returns true bool = isArrayArray( [ [], {} ] ); diff --git a/lib/node_modules/@stdlib/assert/is-array-length/README.md b/lib/node_modules/@stdlib/assert/is-array-length/README.md index 753d309e5666..01245f179949 100644 --- a/lib/node_modules/@stdlib/assert/is-array-length/README.md +++ b/lib/node_modules/@stdlib/assert/is-array-length/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayLength = require( '@stdlib/assert/is-array-length' ); +const isArrayLength = require( '@stdlib/assert/is-array-length' ); ``` #### isArrayLength( value ) @@ -35,7 +35,7 @@ var isArrayLength = require( '@stdlib/assert/is-array-length' ); Tests if a value is a valid `array` length. ```javascript -var bool = isArrayLength( 5 ); +let bool = isArrayLength( 5 ); // returns true bool = isArrayLength( -1 ); @@ -72,9 +72,9 @@ bool = isArrayLength( null ); ```javascript -var isArrayLength = require( '@stdlib/assert/is-array-length' ); +const isArrayLength = require( '@stdlib/assert/is-array-length' ); -var bool = isArrayLength( 5 ); +let bool = isArrayLength( 5 ); // returns true bool = isArrayLength( 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-array-like-object/README.md b/lib/node_modules/@stdlib/assert/is-array-like-object/README.md index 4e6673c31c5d..d91fdfcbd379 100644 --- a/lib/node_modules/@stdlib/assert/is-array-like-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-array-like-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' ); +const isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' ); ``` #### isArrayLikeObject( value ) @@ -37,7 +37,7 @@ Tests if a value is an [array-like][array-like] `object`. ```javascript -var bool = isArrayLikeObject( [] ); +let bool = isArrayLikeObject( [] ); // returns true bool = isArrayLikeObject( { 'length': 10 } ); @@ -47,7 +47,7 @@ bool = isArrayLikeObject( { 'length': 10 } ); If provided a `string`, the function returns `false`. ```javascript -var bool = isArrayLikeObject( 'beep' ); +const bool = isArrayLikeObject( 'beep' ); // returns false ``` @@ -64,10 +64,10 @@ var bool = isArrayLikeObject( 'beep' ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' ); -var bool = isArrayLikeObject( { 'length': 10 } ); +let bool = isArrayLikeObject( { 'length': 10 } ); // returns true bool = isArrayLikeObject( [] ); diff --git a/lib/node_modules/@stdlib/assert/is-array-like/README.md b/lib/node_modules/@stdlib/assert/is-array-like/README.md index ca28ec1c2dab..17d09c1d296b 100644 --- a/lib/node_modules/@stdlib/assert/is-array-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-array-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayLike = require( '@stdlib/assert/is-array-like' ); +const isArrayLike = require( '@stdlib/assert/is-array-like' ); ``` #### isArrayLike( value ) @@ -37,7 +37,7 @@ Tests if a value is [array-like][array-like]. ```javascript -var bool = isArrayLike( [] ); +let bool = isArrayLike( [] ); // returns true bool = isArrayLike( { 'length': 10 } ); @@ -47,7 +47,7 @@ bool = isArrayLike( { 'length': 10 } ); If provided a `string`, the function returns `true`. ```javascript -var bool = isArrayLike( 'beep' ); +const bool = isArrayLike( 'beep' ); // returns true ``` @@ -64,9 +64,9 @@ var bool = isArrayLike( 'beep' ); ```javascript -var isArrayLike = require( '@stdlib/assert/is-array-like' ); +const isArrayLike = require( '@stdlib/assert/is-array-like' ); -var bool = isArrayLike( { 'length': 10 } ); +let bool = isArrayLike( { 'length': 10 } ); // returns true bool = isArrayLike( [] ); diff --git a/lib/node_modules/@stdlib/assert/is-array/README.md b/lib/node_modules/@stdlib/assert/is-array/README.md index 4e12d5a49ec9..272ed9602847 100644 --- a/lib/node_modules/@stdlib/assert/is-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArray = require( '@stdlib/assert/is-array' ); +const isArray = require( '@stdlib/assert/is-array' ); ``` #### isArray( value ) @@ -35,7 +35,7 @@ var isArray = require( '@stdlib/assert/is-array' ); Tests if a value is an `array`. ```javascript -var bool = isArray( [] ); +const bool = isArray( [] ); // returns true ``` @@ -50,9 +50,9 @@ var bool = isArray( [] ); ```javascript -var isArray = require( '@stdlib/assert/is-array' ); +const isArray = require( '@stdlib/assert/is-array' ); -var bool = isArray( [ 1, 2, 3, 4 ] ); +let bool = isArray( [ 1, 2, 3, 4 ] ); // returns true bool = isArray( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-arraybuffer-view/README.md b/lib/node_modules/@stdlib/assert/is-arraybuffer-view/README.md index 63402da53ca4..900ce4b1136d 100644 --- a/lib/node_modules/@stdlib/assert/is-arraybuffer-view/README.md +++ b/lib/node_modules/@stdlib/assert/is-arraybuffer-view/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayBufferView = require( '@stdlib/assert/is-arraybuffer-view' ); +const isArrayBufferView = require( '@stdlib/assert/is-arraybuffer-view' ); ``` #### isArrayBufferView( value ) @@ -35,10 +35,10 @@ var isArrayBufferView = require( '@stdlib/assert/is-arraybuffer-view' ); Tests if a value is an [`ArrayBuffer`][mdn-arraybuffer] view such as a [`DataView`][mdn-dataview] or [`TypedArray`][mdn-typed-array]. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const Int8Array = require( '@stdlib/array/int8' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var bool = isArrayBufferView( new Int8Array( 10 ) ); +let bool = isArrayBufferView( new Int8Array( 10 ) ); // returns true bool = isArrayBufferView( new ArrayBuffer( 10 ) ); @@ -56,16 +56,16 @@ bool = isArrayBufferView( new ArrayBuffer( 10 ) ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var isArrayBufferView = require( '@stdlib/assert/is-arraybuffer-view' ); - -var bool = isArrayBufferView( new Int8Array( 10 ) ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const isArrayBufferView = require( '@stdlib/assert/is-arraybuffer-view' ); + +let bool = isArrayBufferView( new Int8Array( 10 ) ); // returns true bool = isArrayBufferView( new Int16Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-arraybuffer/README.md b/lib/node_modules/@stdlib/assert/is-arraybuffer/README.md index da1306bbb8ae..6b9bf6bfb5e1 100644 --- a/lib/node_modules/@stdlib/assert/is-arraybuffer/README.md +++ b/lib/node_modules/@stdlib/assert/is-arraybuffer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); +const isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); ``` #### isArrayBuffer( value ) @@ -35,9 +35,9 @@ var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); Tests if a value is an [`ArrayBuffer`][mdn-arraybuffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var bool = isArrayBuffer( new ArrayBuffer( 10 ) ); +let bool = isArrayBuffer( new ArrayBuffer( 10 ) ); // returns true bool = isArrayBuffer( [] ); @@ -55,19 +55,19 @@ bool = isArrayBuffer( [] ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); - -var bool = isArrayBuffer( new ArrayBuffer( 10 ) ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); + +let bool = isArrayBuffer( new ArrayBuffer( 10 ) ); // returns true bool = isArrayBuffer( new Float32Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-arrow-function/README.md b/lib/node_modules/@stdlib/assert/is-arrow-function/README.md index 1ce9496741d8..b0d1f014ff13 100644 --- a/lib/node_modules/@stdlib/assert/is-arrow-function/README.md +++ b/lib/node_modules/@stdlib/assert/is-arrow-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isArrowFunction = require( '@stdlib/assert/is-arrow-function' ); +const isArrowFunction = require( '@stdlib/assert/is-arrow-function' ); ``` #### isArrowFunction( value ) @@ -37,11 +37,11 @@ Tests if a `value` is a an [`arrow function`][mdn-arrow-function] such as `( a, ```javascript -var beep = () => { +const beep = () => { console.log( 'beep' ); }; -var bool = isArrowFunction( beep ); +let bool = isArrowFunction( beep ); // returns true function boop() { @@ -65,9 +65,9 @@ bool = isArrowFunction( boop ); ```javascript -var isArrowFunction = require( '@stdlib/assert/is-arrow-function' ); +const isArrowFunction = require( '@stdlib/assert/is-arrow-function' ); -var bool = isArrowFunction( () => {} ); +let bool = isArrowFunction( () => {} ); // returns true bool = isArrowFunction( function foo() {} ); diff --git a/lib/node_modules/@stdlib/assert/is-ascii/README.md b/lib/node_modules/@stdlib/assert/is-ascii/README.md index 7ebb73f04065..92453a023512 100644 --- a/lib/node_modules/@stdlib/assert/is-ascii/README.md +++ b/lib/node_modules/@stdlib/assert/is-ascii/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isASCII = require( '@stdlib/assert/is-ascii' ); +const isASCII = require( '@stdlib/assert/is-ascii' ); ``` #### isASCII( value ) @@ -35,7 +35,7 @@ var isASCII = require( '@stdlib/assert/is-ascii' ); Tests whether a character belongs to the [ASCII][ascii] character set and whether this is true for all characters in a provided string. ```javascript -var bool = isASCII( 'beep' ); +const bool = isASCII( 'beep' ); // returns true ``` @@ -60,9 +60,9 @@ var bool = isASCII( 'beep' ); ```javascript -var isASCII = require( '@stdlib/assert/is-ascii' ); +const isASCII = require( '@stdlib/assert/is-ascii' ); -var out = isASCII( 'beep' ); +let out = isASCII( 'beep' ); // returns true out = isASCII( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-between-array/README.md b/lib/node_modules/@stdlib/assert/is-between-array/README.md index cb15a5218040..beea977859d8 100644 --- a/lib/node_modules/@stdlib/assert/is-between-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-between-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBetweenArray = require( '@stdlib/assert/is-between-array' ); +const isBetweenArray = require( '@stdlib/assert/is-between-array' ); ``` #### isBetweenArray( value, a, b\[, left, right] ) @@ -35,9 +35,9 @@ var isBetweenArray = require( '@stdlib/assert/is-between-array' ); Tests if a `value` is an array-like `object` where every element is between two values `a` (left comparison value) and `b` (right comparison value). ```javascript -var arr = [ 3, 4, 5 ]; +const arr = [ 3, 4, 5 ]; -var bool = isBetweenArray( arr, 3, 5 ); +let bool = isBetweenArray( arr, 3, 5 ); // returns true bool = isBetweenArray( arr, 4, 5 ); @@ -50,9 +50,9 @@ bool = isBetweenArray( arr, 3, 4 ); By default, the function assumes that `a` and `b` are inclusive. ```javascript -var arr = [ 3, 4, 5 ]; +const arr = [ 3, 4, 5 ]; -var bool = isBetweenArray( arr, 3, 5 ); +let bool = isBetweenArray( arr, 3, 5 ); // returns true bool = isBetweenArray( arr, 3, 5, 'closed', 'closed' ); @@ -62,9 +62,9 @@ bool = isBetweenArray( arr, 3, 5, 'closed', 'closed' ); To make `a` and/or `b` exclusive, set the respective arguments to `'open'`. ```javascript -var arr = [ 3, 4, 5 ]; +const arr = [ 3, 4, 5 ]; -var bool = isBetweenArray( arr, 3, 5, 'open', 'closed' ); +let bool = isBetweenArray( arr, 3, 5, 'open', 'closed' ); // returns false bool = isBetweenArray( arr, 3, 5, 'closed', 'open' ); @@ -106,7 +106,7 @@ bool = isBetweenArray( arr, 3, 5, 'closed', 'open' ); - If provided an empty array-like `object`, the function returns `false`. ```javascript - var bool = isBetweenArray( [], 0.0, 1.0 ); + const bool = isBetweenArray( [], 0.0, 1.0 ); // returns false ``` @@ -123,15 +123,15 @@ bool = isBetweenArray( arr, 3, 5, 'closed', 'open' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var isBetweenArray = require( '@stdlib/assert/is-between-array' ); +const randu = require( '@stdlib/random/base/randu' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const isBetweenArray = require( '@stdlib/assert/is-between-array' ); // Create an array of random numbers: -var x = filledarrayBy( 100, 'float64', randu ); +const x = filledarrayBy( 100, 'float64', randu ); // Check whether every element resides within the interval [0.01, 0.99]: -var bool = isBetweenArray( x, 0.01, 0.99 ); +const bool = isBetweenArray( x, 0.01, 0.99 ); console.log( bool ); ``` diff --git a/lib/node_modules/@stdlib/assert/is-between/README.md b/lib/node_modules/@stdlib/assert/is-between/README.md index 70f31fb43639..19bb0f4beb12 100644 --- a/lib/node_modules/@stdlib/assert/is-between/README.md +++ b/lib/node_modules/@stdlib/assert/is-between/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBetween = require( '@stdlib/assert/is-between' ); +const isBetween = require( '@stdlib/assert/is-between' ); ``` #### isBetween( value, a, b\[, left, right] ) @@ -35,7 +35,7 @@ var isBetween = require( '@stdlib/assert/is-between' ); Tests if a `value` is between two values `a` (left comparison value) and `b` (right comparison value). ```javascript -var bool = isBetween( 4, 3, 5 ); +let bool = isBetween( 4, 3, 5 ); // returns true bool = isBetween( 2, 3, 5 ); @@ -48,7 +48,7 @@ bool = isBetween( 6, 3, 5 ); By default, the function assumes that `a` and `b` are inclusive. ```javascript -var bool = isBetween( 3, 3, 5 ); +let bool = isBetween( 3, 3, 5 ); // returns true bool = isBetween( 3, 3, 5, 'closed', 'closed' ); @@ -64,7 +64,7 @@ bool = isBetween( 5, 3, 5, 'closed', 'closed' ); To make `a` and/or `b` exclusive, set the respective arguments to `'open'`. ```javascript -var bool = isBetween( 3, 3, 5, 'open', 'closed' ); +let bool = isBetween( 3, 3, 5, 'open', 'closed' ); // returns false bool = isBetween( 5, 3, 5, 'closed', 'open' ); @@ -116,21 +116,15 @@ bool = isBetween( 5, 3, 5, 'closed', 'open' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var isBetween = require( '@stdlib/assert/is-between' ); - -var bool; -var a; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - a = round( (randu()*10.0) + 5.0 ); - b = round( (randu()*10.0) + 15.0 ); - v = round( randu()*25.0 ); - bool = isBetween( v, a, b, 'open', 'closed' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const isBetween = require( '@stdlib/assert/is-between' ); + +for ( let i = 0; i < 100; i++ ) { + const a = round( (randu()*10.0) + 5.0 ); + const b = round( (randu()*10.0) + 15.0 ); + const v = round( randu()*25.0 ); + const bool = isBetween( v, a, b, 'open', 'closed' ); console.log( '%d < %d <= %d: %s', a, v, b, bool.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/assert/is-big-endian/README.md b/lib/node_modules/@stdlib/assert/is-big-endian/README.md index 646c81555fcf..9e4e27d091ef 100644 --- a/lib/node_modules/@stdlib/assert/is-big-endian/README.md +++ b/lib/node_modules/@stdlib/assert/is-big-endian/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_BIG_ENDIAN = require( '@stdlib/assert/is-big-endian' ); +const IS_BIG_ENDIAN = require( '@stdlib/assert/is-big-endian' ); ``` #### IS_BIG_ENDIAN @@ -35,7 +35,7 @@ var IS_BIG_ENDIAN = require( '@stdlib/assert/is-big-endian' ); `Boolean` indicating if an environment is [big endian][endianness]. ```javascript -var bool = IS_BIG_ENDIAN; +const bool = IS_BIG_ENDIAN; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_BIG_ENDIAN; ```javascript -var IS_BIG_ENDIAN = require( '@stdlib/assert/is-big-endian' ); +const IS_BIG_ENDIAN = require( '@stdlib/assert/is-big-endian' ); console.log( IS_BIG_ENDIAN ); // => diff --git a/lib/node_modules/@stdlib/assert/is-bigint/README.md b/lib/node_modules/@stdlib/assert/is-bigint/README.md index b866eb9c58e7..1e71b6e2b4bd 100644 --- a/lib/node_modules/@stdlib/assert/is-bigint/README.md +++ b/lib/node_modules/@stdlib/assert/is-bigint/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBigInt = require( '@stdlib/assert/is-bigint' ); +const isBigInt = require( '@stdlib/assert/is-bigint' ); ``` #### isBigInt( value ) @@ -35,10 +35,10 @@ var isBigInt = require( '@stdlib/assert/is-bigint' ); Tests if a value is a [`BigInt`][mdn-bigint]. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var BigInt = require( '@stdlib/bigint/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const BigInt = require( '@stdlib/bigint/ctor' ); -var bool = isBigInt( BigInt( '1' ) ); +let bool = isBigInt( BigInt( '1' ) ); // returns true bool = isBigInt( Object( BigInt( '1' ) ) ); @@ -50,10 +50,10 @@ bool = isBigInt( Object( BigInt( '1' ) ) ); Tests if a `value` is a primitive [`BigInt`][mdn-bigint]. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var BigInt = require( '@stdlib/bigint/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const BigInt = require( '@stdlib/bigint/ctor' ); -var bool = isBigInt.isPrimitive( BigInt( '1' ) ); +let bool = isBigInt.isPrimitive( BigInt( '1' ) ); // returns true bool = isBigInt.isPrimitive( Object( BigInt( '1' ) ) ); @@ -65,10 +65,10 @@ bool = isBigInt.isPrimitive( Object( BigInt( '1' ) ) ); Tests if a `value` is a [`BigInt`][mdn-bigint] object. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var BigInt = require( '@stdlib/bigint/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const BigInt = require( '@stdlib/bigint/ctor' ); -var bool = isBigInt.isObject( BigInt( '1' ) ); +let bool = isBigInt.isObject( BigInt( '1' ) ); // returns false bool = isBigInt.isObject( Object( BigInt( '1' ) ) ); @@ -88,11 +88,11 @@ bool = isBigInt.isObject( Object( BigInt( '1' ) ) ); ```javascript -var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); -var BigInt = require( '@stdlib/bigint/ctor' ); -var isBigInt = require( '@stdlib/assert/is-bigint' ); +const hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); +const BigInt = require( '@stdlib/bigint/ctor' ); +const isBigInt = require( '@stdlib/assert/is-bigint' ); -var bool; +let bool; if ( hasBigIntSupport() ) { bool = isBigInt( BigInt( '1' ) ); // returns true diff --git a/lib/node_modules/@stdlib/assert/is-bigint64array/README.md b/lib/node_modules/@stdlib/assert/is-bigint64array/README.md index eb4c541aaddf..600ed7fd5b36 100644 --- a/lib/node_modules/@stdlib/assert/is-bigint64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-bigint64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBigInt64Array = require( '@stdlib/assert/is-bigint64array' ); +const isBigInt64Array = require( '@stdlib/assert/is-bigint64array' ); ``` #### isBigInt64Array( value ) @@ -37,7 +37,7 @@ Tests if a value is a [`BigInt64Array`][mdn-bigint64array]. ```javascript -var bool = isBigInt64Array( new BigInt64Array( 10 ) ); +let bool = isBigInt64Array( new BigInt64Array( 10 ) ); // returns true bool = isBigInt64Array( [] ); @@ -57,18 +57,18 @@ bool = isBigInt64Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isBigInt64Array = require( '@stdlib/assert/is-bigint64array' ); - -var bool = isBigInt64Array( new BigInt64Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isBigInt64Array = require( '@stdlib/assert/is-bigint64array' ); + +let bool = isBigInt64Array( new BigInt64Array( 10 ) ); // returns true bool = isBigInt64Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-biguint64array/README.md b/lib/node_modules/@stdlib/assert/is-biguint64array/README.md index 883fc3c3e8e7..e1cd64740e8f 100644 --- a/lib/node_modules/@stdlib/assert/is-biguint64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-biguint64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBigUint64Array = require( '@stdlib/assert/is-biguint64array' ); +const isBigUint64Array = require( '@stdlib/assert/is-biguint64array' ); ``` #### isBigUint64Array( value ) @@ -37,7 +37,7 @@ Tests if a value is a [`BigUint64Array`][mdn-biguint64array]. ```javascript -var bool = isBigUint64Array( new BigUint64Array( 10 ) ); +let bool = isBigUint64Array( new BigUint64Array( 10 ) ); // returns true bool = isBigUint64Array( [] ); @@ -57,18 +57,18 @@ bool = isBigUint64Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isBigUint64Array = require( '@stdlib/assert/is-biguint64array' ); - -var bool = isBigUint64Array( new BigUint64Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isBigUint64Array = require( '@stdlib/assert/is-biguint64array' ); + +let bool = isBigUint64Array( new BigUint64Array( 10 ) ); // returns true bool = isBigUint64Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-binary-string/README.md b/lib/node_modules/@stdlib/assert/is-binary-string/README.md index e44aa13204f0..9eaf222573d8 100644 --- a/lib/node_modules/@stdlib/assert/is-binary-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBinaryString = require( '@stdlib/assert/is-binary-string' ); +const isBinaryString = require( '@stdlib/assert/is-binary-string' ); ``` #### isBinaryString( value ) @@ -35,7 +35,7 @@ var isBinaryString = require( '@stdlib/assert/is-binary-string' ); Tests if a `value` is a binary `string`; i.e., a character sequence of `1`'s and `0`'s. ```javascript -var bool = isBinaryString( '1000101' ); +let bool = isBinaryString( '1000101' ); // returns true bool = isBinaryString( 'beep' ); @@ -56,9 +56,9 @@ bool = isBinaryString( '' ); ```javascript -var isBinaryString = require( '@stdlib/assert/is-binary-string' ); +const isBinaryString = require( '@stdlib/assert/is-binary-string' ); -var bool = isBinaryString( '1' ); +let bool = isBinaryString( '1' ); // returns true bool = isBinaryString( '0' ); diff --git a/lib/node_modules/@stdlib/assert/is-blank-string/README.md b/lib/node_modules/@stdlib/assert/is-blank-string/README.md index 6fd6206ee2b1..d8ab0556e3aa 100644 --- a/lib/node_modules/@stdlib/assert/is-blank-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-blank-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBlankString = require( '@stdlib/assert/is-blank-string' ); +const isBlankString = require( '@stdlib/assert/is-blank-string' ); ``` #### isBlankString( value ) @@ -35,7 +35,7 @@ var isBlankString = require( '@stdlib/assert/is-blank-string' ); Tests if a `value` is a blank `string` (i.e., an empty string or a string consisting only of whitespace characters). ```javascript -var bool = isBlankString( ' ' ); +let bool = isBlankString( ' ' ); // returns true bool = isBlankString( '' ); @@ -56,9 +56,9 @@ bool = isBlankString( 0 ); ```javascript -var isBlankString = require( '@stdlib/assert/is-blank-string' ); +const isBlankString = require( '@stdlib/assert/is-blank-string' ); -var out = isBlankString( ' ' ); +let out = isBlankString( ' ' ); // returns true out = isBlankString( '\t\t\t' ); diff --git a/lib/node_modules/@stdlib/assert/is-boolean-array/README.md b/lib/node_modules/@stdlib/assert/is-boolean-array/README.md index 6d1cd8eeb179..bde405ab66f7 100644 --- a/lib/node_modules/@stdlib/assert/is-boolean-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-boolean-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBooleanArray = require( '@stdlib/assert/is-boolean-array' ); +const isBooleanArray = require( '@stdlib/assert/is-boolean-array' ); ``` #### isBooleanArray( value ) @@ -35,7 +35,7 @@ var isBooleanArray = require( '@stdlib/assert/is-boolean-array' ); Tests if a `value` is an array-like object of `booleans`. ```javascript -var bool = isBooleanArray( [ true, false, false, true ] ); +const bool = isBooleanArray( [ true, false, false, true ] ); // returns true ``` @@ -46,9 +46,9 @@ Tests if a `value` is an array-like object containing **only** `boolean` primiti ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBooleanArray.primitives( [ true, false ] ); +let bool = isBooleanArray.primitives( [ true, false ] ); // returns true bool = isBooleanArray.primitives( [ false, new Boolean( true ) ] ); @@ -62,9 +62,9 @@ Tests if a `value` is an array-like object containing **only** `Boolean` objects ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBooleanArray.objects( [ new Boolean( false ), new Boolean( true ) ] ); +let bool = isBooleanArray.objects( [ new Boolean( false ), new Boolean( true ) ] ); // returns true bool = isBooleanArray.objects( [ new Boolean( false ), true ] ); @@ -84,10 +84,10 @@ bool = isBooleanArray.objects( [ new Boolean( false ), true ] ); ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); -var isBooleanArray = require( '@stdlib/assert/is-boolean-array' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const isBooleanArray = require( '@stdlib/assert/is-boolean-array' ); -var bool = isBooleanArray( [ true, false ] ); +let bool = isBooleanArray( [ true, false ] ); // returns true bool = isBooleanArray( [ true, new Boolean( false ) ] ); diff --git a/lib/node_modules/@stdlib/assert/is-boolean/README.md b/lib/node_modules/@stdlib/assert/is-boolean/README.md index 6e7fcc834837..828d0d9f46d6 100644 --- a/lib/node_modules/@stdlib/assert/is-boolean/README.md +++ b/lib/node_modules/@stdlib/assert/is-boolean/README.md @@ -27,7 +27,7 @@ limitations under the License. ### Usage ```javascript -var isBoolean = require( '@stdlib/assert/is-boolean' ); +const isBoolean = require( '@stdlib/assert/is-boolean' ); ``` #### isBoolean( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `boolean`. ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBoolean( false ); +let bool = isBoolean( false ); // returns true bool = isBoolean( true ); @@ -59,9 +59,9 @@ Tests if a `value` is a primitive `boolean`. ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBoolean.isPrimitive( true ); +let bool = isBoolean.isPrimitive( true ); // returns true bool = isBoolean.isPrimitive( false ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Boolean` object. ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBoolean.isObject( true ); +let bool = isBoolean.isObject( true ); // returns false bool = isBoolean.isObject( new Boolean( false ) ); @@ -100,10 +100,10 @@ bool = isBoolean.isObject( new Boolean( false ) ); ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const isBoolean = require( '@stdlib/assert/is-boolean' ); -var bool = isBoolean( false ); +let bool = isBoolean( false ); // returns true bool = isBoolean( new Boolean( false ) ); diff --git a/lib/node_modules/@stdlib/assert/is-booleanarray/README.md b/lib/node_modules/@stdlib/assert/is-booleanarray/README.md index 1f19f41fd9c7..7d38f1dfd27d 100644 --- a/lib/node_modules/@stdlib/assert/is-booleanarray/README.md +++ b/lib/node_modules/@stdlib/assert/is-booleanarray/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +const isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); ``` #### isBooleanArray( value ) @@ -35,9 +35,9 @@ var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); Tests if a value is a [`BooleanArray`][@stdlib/array/bool]. ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); -var bool = isBooleanArray( new BooleanArray( 10 ) ); +let bool = isBooleanArray( new BooleanArray( 10 ) ); // returns true bool = isBooleanArray( [] ); @@ -55,21 +55,21 @@ bool = isBooleanArray( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var BooleanArray = require( '@stdlib/array/bool' ); -var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); - -var bool = isBooleanArray( new BooleanArray( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); + +let bool = isBooleanArray( new BooleanArray( 10 ) ); // returns true bool = isBooleanArray( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-boxed-primitive/README.md b/lib/node_modules/@stdlib/assert/is-boxed-primitive/README.md index fb703557b19b..f656ccaf6ce7 100644 --- a/lib/node_modules/@stdlib/assert/is-boxed-primitive/README.md +++ b/lib/node_modules/@stdlib/assert/is-boxed-primitive/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBoxedPrimitive = require( '@stdlib/assert/is-boxed-primitive' ); +const isBoxedPrimitive = require( '@stdlib/assert/is-boxed-primitive' ); ``` #### isBoxedPrimitive( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a JavaScript boxed primitive. ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); -var bool = isBoxedPrimitive( new Boolean( false ) ); +let bool = isBoxedPrimitive( new Boolean( false ) ); // returns true bool = isBoxedPrimitive( true ); @@ -74,11 +74,11 @@ bool = isBoxedPrimitive( true ); ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); -var Number = require( '@stdlib/number/ctor' ); -var isBoxedPrimitive = require( '@stdlib/assert/is-boxed-primitive' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const Number = require( '@stdlib/number/ctor' ); +const isBoxedPrimitive = require( '@stdlib/assert/is-boxed-primitive' ); -var bool = isBoxedPrimitive( new Boolean( false ) ); +let bool = isBoxedPrimitive( new Boolean( false ) ); // returns true bool = isBoxedPrimitive( new String( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-browser/README.md b/lib/node_modules/@stdlib/assert/is-browser/README.md index 903333f6dd28..6e044780a305 100644 --- a/lib/node_modules/@stdlib/assert/is-browser/README.md +++ b/lib/node_modules/@stdlib/assert/is-browser/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +const IS_BROWSER = require( '@stdlib/assert/is-browser' ); ``` #### IS_BROWSER @@ -35,7 +35,7 @@ var IS_BROWSER = require( '@stdlib/assert/is-browser' ); `Boolean` indicating if the runtime is a web browser. ```javascript -var bool = IS_BROWSER; +const bool = IS_BROWSER; // returns ``` @@ -60,7 +60,7 @@ var bool = IS_BROWSER; ```javascript -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +const IS_BROWSER = require( '@stdlib/assert/is-browser' ); console.log( IS_BROWSER ); // => diff --git a/lib/node_modules/@stdlib/assert/is-buffer/README.md b/lib/node_modules/@stdlib/assert/is-buffer/README.md index 18313ecb2a33..cdd0a922379a 100644 --- a/lib/node_modules/@stdlib/assert/is-buffer/README.md +++ b/lib/node_modules/@stdlib/assert/is-buffer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isBuffer = require( '@stdlib/assert/is-buffer' ); +const isBuffer = require( '@stdlib/assert/is-buffer' ); ``` #### isBuffer( value ) @@ -39,11 +39,11 @@ Tests if a `value` is a [`Buffer`][node-buffer] object. ```javascript -var Buffer = require( '@stdlib/buffer/ctor' ); +const Buffer = require( '@stdlib/buffer/ctor' ); -var value = new Buffer( [ 1, 2, 3, 4 ] ); +const value = new Buffer( [ 1, 2, 3, 4 ] ); -var bool = isBuffer( value ); +const bool = isBuffer( value ); // returns true ``` @@ -72,11 +72,11 @@ var bool = isBuffer( value ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Buffer = require( '@stdlib/buffer/ctor' ); -var isBuffer = require( '@stdlib/assert/is-buffer' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Buffer = require( '@stdlib/buffer/ctor' ); +const isBuffer = require( '@stdlib/assert/is-buffer' ); -var bool = isBuffer( new Buffer( [ 1, 2, 3, 4 ] ) ); +let bool = isBuffer( new Buffer( [ 1, 2, 3, 4 ] ) ); // returns true bool = isBuffer( new Buffer( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-camelcase/README.md b/lib/node_modules/@stdlib/assert/is-camelcase/README.md index c8fa6a483905..0655972b8151 100644 --- a/lib/node_modules/@stdlib/assert/is-camelcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-camelcase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCamelcase = require( '@stdlib/assert/is-camelcase' ); +const isCamelcase = require( '@stdlib/assert/is-camelcase' ); ``` #### isCamelcase( value ) @@ -35,7 +35,7 @@ var isCamelcase = require( '@stdlib/assert/is-camelcase' ); Tests if a `value` is an camelcase `string`. ```javascript -var bool = isCamelcase( 'beepBoop' ); +let bool = isCamelcase( 'beepBoop' ); // returns true bool = isCamelcase( 'beep and Boop' ); @@ -63,7 +63,7 @@ bool = isCamelcase( 'beep and Boop' ); ```javascript -var isCamelcase = require( '@stdlib/assert/is-camelcase' ); +const isCamelcase = require( '@stdlib/assert/is-camelcase' ); console.log( isCamelcase( 'beepBoop' ) ); // => true diff --git a/lib/node_modules/@stdlib/assert/is-capitalized/README.md b/lib/node_modules/@stdlib/assert/is-capitalized/README.md index a619cbef38e2..37d6919d5434 100644 --- a/lib/node_modules/@stdlib/assert/is-capitalized/README.md +++ b/lib/node_modules/@stdlib/assert/is-capitalized/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCapitalized = require( '@stdlib/assert/is-capitalized' ); +const isCapitalized = require( '@stdlib/assert/is-capitalized' ); ``` #### isCapitalized( value ) @@ -35,7 +35,7 @@ var isCapitalized = require( '@stdlib/assert/is-capitalized' ); Tests if a `value` is a `string` having an uppercase first character. ```javascript -var bool = isCapitalized( 'Every noble work is at first impossible.' ); +let bool = isCapitalized( 'Every noble work is at first impossible.' ); // returns true bool = isCapitalized( 'HELLO WORLD!' ); @@ -66,9 +66,9 @@ bool = isCapitalized( 'salt and light' ); ```javascript -var isCapitalized = require( '@stdlib/assert/is-capitalized' ); +const isCapitalized = require( '@stdlib/assert/is-capitalized' ); -var bool = isCapitalized( 'Hello' ); +let bool = isCapitalized( 'Hello' ); // returns true bool = isCapitalized( 'HELLO' ); diff --git a/lib/node_modules/@stdlib/assert/is-centrosymmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-centrosymmetric-matrix/README.md index 77ffded2c5d4..29f6ef1b7abf 100644 --- a/lib/node_modules/@stdlib/assert/is-centrosymmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-centrosymmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); +const isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); ``` #### isCentrosymmetricMatrix( value ) @@ -37,16 +37,16 @@ Tests if a value is a [centrosymmetric matrix][centrosymmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = [ +const buffer = [ 1, 2, 3, 4, 5, 4, 3, 2, 1 ]; -var arr = ndarray( 'generic', buffer, [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ); +const arr = ndarray( 'generic', buffer, [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ); -var bool = isCentrosymmetricMatrix( arr ); +const bool = isCentrosymmetricMatrix( arr ); // returns true ``` @@ -61,12 +61,12 @@ var bool = isCentrosymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isCentrosymmetricMatrix = require( '@stdlib/assert/is-centrosymmetric-matrix' ); -var arr = ndarray( 'generic', [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'generic', [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isCentrosymmetricMatrix( arr ); +let out = isCentrosymmetricMatrix( arr ); // returns true out = isCentrosymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-circular-array/README.md b/lib/node_modules/@stdlib/assert/is-circular-array/README.md index 6ce3dc5947d8..a148d4fdd0ec 100644 --- a/lib/node_modules/@stdlib/assert/is-circular-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-circular-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCircularArray = require( '@stdlib/assert/is-circular-array' ); +const isCircularArray = require( '@stdlib/assert/is-circular-array' ); ``` #### isCircularArray( value ) @@ -35,8 +35,8 @@ var isCircularArray = require( '@stdlib/assert/is-circular-array' ); Tests if a `value` is an `array` containing a circular reference. ```javascript -var arr = [ 1, 2, 3 ]; -var bool = isCircularArray( arr ); +const arr = [ 1, 2, 3 ]; +let bool = isCircularArray( arr ); // returns false arr.push( arr ); @@ -60,14 +60,14 @@ bool = isCircularArray( arr ); ```javascript -var isCircularArray = require( '@stdlib/assert/is-circular-array' ); +const isCircularArray = require( '@stdlib/assert/is-circular-array' ); -var arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; arr.push( arr ); console.log( isCircularArray( arr ) ); // => true -var obj = { +const obj = { 'beep': 'boop' }; obj.self = obj; diff --git a/lib/node_modules/@stdlib/assert/is-circular-plain-object/README.md b/lib/node_modules/@stdlib/assert/is-circular-plain-object/README.md index 472fae621b08..759dbbc83e1d 100644 --- a/lib/node_modules/@stdlib/assert/is-circular-plain-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-circular-plain-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCircularPlainObject = require( '@stdlib/assert/is-circular' ); +const isCircularPlainObject = require( '@stdlib/assert/is-circular' ); ``` #### isCircularPlainObject( value ) @@ -35,10 +35,10 @@ var isCircularPlainObject = require( '@stdlib/assert/is-circular' ); Tests if a `value` is a plain `object` containing a circular reference. ```javascript -var obj = { +const obj = { 'beep': 'boop' }; -var bool = isCircularPlainObject( obj ); +let bool = isCircularPlainObject( obj ); // returns false obj.self = obj; @@ -57,31 +57,31 @@ bool = isCircularPlainObject( obj ); ```javascript -var isCircularPlainObject = require( '@stdlib/assert/is-circular' ); +const isCircularPlainObject = require( '@stdlib/assert/is-circular' ); -var obj1 = { +const obj1 = { 'a': 'beep', 'b': { 'c': 'boop' } }; obj1.b.self = obj1; -var bool = isCircularPlainObject( obj1 ); +let bool = isCircularPlainObject( obj1 ); // returns true -var obj2 = { +const obj2 = { 'a': {}, 'b': obj1 }; bool = isCircularPlainObject( obj2 ); // returns true -var arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; arr.push( arr ); bool = isCircularPlainObject( arr ); // returns false -var obj3 = { +const obj3 = { 'beep': 'boop' }; bool = isCircularPlainObject({ diff --git a/lib/node_modules/@stdlib/assert/is-circular/README.md b/lib/node_modules/@stdlib/assert/is-circular/README.md index ab59f53e9e35..6a2c91cd47e0 100644 --- a/lib/node_modules/@stdlib/assert/is-circular/README.md +++ b/lib/node_modules/@stdlib/assert/is-circular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCircular = require( '@stdlib/assert/is-circular' ); +const isCircular = require( '@stdlib/assert/is-circular' ); ``` #### isCircular( value ) @@ -35,10 +35,10 @@ var isCircular = require( '@stdlib/assert/is-circular' ); Tests if an object-like `value` contains a circular reference. ```javascript -var obj = { +const obj = { 'beep': 'boop' }; -var bool = isCircular( obj ); +let bool = isCircular( obj ); // returns false obj.self = obj; @@ -71,26 +71,26 @@ bool = isCircular( obj ); ```javascript -var isCircular = require( '@stdlib/assert/is-circular' ); +const isCircular = require( '@stdlib/assert/is-circular' ); -var obj1 = { +const obj1 = { 'a': 'beep', 'b': { 'c': 'boop' } }; obj1.b.self = obj1; -var bool = isCircular( obj1 ); +let bool = isCircular( obj1 ); // returns true -var obj2 = { +const obj2 = { 'a': {}, 'b': obj1 }; bool = isCircular( obj2 ); // returns true -var arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; arr.push( arr ); bool = isCircular( arr ); // returns true @@ -100,7 +100,7 @@ circ.self = circ; bool = isCircular( circ ); // returns true -var obj3 = { +const obj3 = { 'beep': 'boop' }; bool = isCircular({ diff --git a/lib/node_modules/@stdlib/assert/is-class/README.md b/lib/node_modules/@stdlib/assert/is-class/README.md index a13ff8cc1cfe..337f1fb14603 100644 --- a/lib/node_modules/@stdlib/assert/is-class/README.md +++ b/lib/node_modules/@stdlib/assert/is-class/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isClass = require( '@stdlib/assert/is-class' ); +const isClass = require( '@stdlib/assert/is-class' ); ``` #### isClass( value ) @@ -37,14 +37,14 @@ Tests if a value is a [`class`][mdn-class]. ```javascript -var bool = isClass( class Animal { +let bool = isClass( class Animal { speak() { return this; } } ); // returns true -var Rectangle = class { +const Rectangle = class { constructor( height, width ) { this.height = height; this.width = width; @@ -71,9 +71,9 @@ bool = isClass( null ); ```javascript -var isClass = require( '@stdlib/assert/is-class' ); +const isClass = require( '@stdlib/assert/is-class' ); -var bool = isClass( class Person {} ); +let bool = isClass( class Person {} ); // returns true bool = isClass( function Person() {} ); diff --git a/lib/node_modules/@stdlib/assert/is-collection/README.md b/lib/node_modules/@stdlib/assert/is-collection/README.md index 917e5d892453..dae097b89373 100644 --- a/lib/node_modules/@stdlib/assert/is-collection/README.md +++ b/lib/node_modules/@stdlib/assert/is-collection/README.md @@ -35,7 +35,7 @@ A collection is defined as either an [`Array`][mdn-array], [`Typed Array`][mdn-t ## Usage ```javascript -var isCollection = require( '@stdlib/assert/is-collection' ); +const isCollection = require( '@stdlib/assert/is-collection' ); ``` #### isCollection( value ) @@ -43,7 +43,7 @@ var isCollection = require( '@stdlib/assert/is-collection' ); Tests if a value is a collection. ```javascript -var bool = isCollection( [] ); +const bool = isCollection( [] ); // returns true ``` @@ -60,18 +60,18 @@ var bool = isCollection( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isCollection = require( '@stdlib/assert/is-collection' ); - -var bool = isCollection( [] ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isCollection = require( '@stdlib/assert/is-collection' ); + +let bool = isCollection( [] ); // returns true bool = isCollection( new Float64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex-like/README.md b/lib/node_modules/@stdlib/assert/is-complex-like/README.md index d34bb60382e2..4a8bab5fa7c6 100644 --- a/lib/node_modules/@stdlib/assert/is-complex-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplexLike = require( '@stdlib/assert/is-complex-like' ); +const isComplexLike = require( '@stdlib/assert/is-complex-like' ); ``` #### isComplexLike( value ) @@ -35,11 +35,11 @@ var isComplexLike = require( '@stdlib/assert/is-complex-like' ); Tests if a value is a complex number-like `object`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var x = new Complex128( 1.0, 3.0 ); -var bool = isComplexLike( x ); +let x = new Complex128( 1.0, 3.0 ); +let bool = isComplexLike( x ); // returns true x = new Complex64( 3.0, 1.0 ); @@ -80,11 +80,11 @@ bool = isComplexLike( x ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isComplexLike = require( '@stdlib/assert/is-complex-like' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isComplexLike = require( '@stdlib/assert/is-complex-like' ); -var out = isComplexLike( new Complex64( 2.0, 2.0 ) ); +let out = isComplexLike( new Complex64( 2.0, 2.0 ) ); // returns true out = isComplexLike( new Complex128( 3.0, 1.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex-typed-array-like/README.md b/lib/node_modules/@stdlib/assert/is-complex-typed-array-like/README.md index 6734a47c1afa..45ff357ba8f4 100644 --- a/lib/node_modules/@stdlib/assert/is-complex-typed-array-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex-typed-array-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplexTypedArrayLike = require( '@stdlib/assert/is-complex-typed-array-like' ); +const isComplexTypedArrayLike = require( '@stdlib/assert/is-complex-typed-array-like' ); ``` #### isComplexTypedArrayLike( value ) @@ -37,9 +37,9 @@ Tests if a value is complex-typed-array-like. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var bool = isComplexTypedArrayLike( new Complex64Array() ); +let bool = isComplexTypedArrayLike( new Complex64Array() ); // returns true bool = isComplexTypedArrayLike({ @@ -66,13 +66,10 @@ bool = isComplexTypedArrayLike({ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplexTypedArrayLike = require( '@stdlib/assert/is-complex-typed-array-like' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplexTypedArrayLike = require( '@stdlib/assert/is-complex-typed-array-like' ); -var bool; -var arr; - -arr = { +const arr = { 'BYTES_PER_ELEMENT': 8, 'length': 10, 'byteOffset': 0, @@ -80,7 +77,7 @@ arr = { 'get': function get() {}, 'set': function set() {} }; -bool = isComplexTypedArrayLike( arr ); +let bool = isComplexTypedArrayLike( arr ); // returns true bool = isComplexTypedArrayLike( new Complex64Array( 4 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex-typed-array/README.md b/lib/node_modules/@stdlib/assert/is-complex-typed-array/README.md index 66465fd14957..df7a090918d9 100644 --- a/lib/node_modules/@stdlib/assert/is-complex-typed-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex-typed-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' ); +const isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' ); ``` #### isComplexTypedArray( value ) @@ -35,9 +35,9 @@ var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' ); Tests if a value is a complex typed array. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var bool = isComplexTypedArray( new Complex128Array( 10 ) ); +let bool = isComplexTypedArray( new Complex128Array( 10 ) ); // returns true bool = isComplexTypedArray( [] ); @@ -55,21 +55,21 @@ bool = isComplexTypedArray( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' ); - -var arr = new Complex64Array( 10 ); -var bool = isComplexTypedArray( arr ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' ); + +let arr = new Complex64Array( 10 ); +let bool = isComplexTypedArray( arr ); // returns true arr = new Complex128Array( 10 ); diff --git a/lib/node_modules/@stdlib/assert/is-complex/README.md b/lib/node_modules/@stdlib/assert/is-complex/README.md index c0c4c67b1bf0..f5b8c6d58ce2 100644 --- a/lib/node_modules/@stdlib/assert/is-complex/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex = require( '@stdlib/assert/is-complex' ); +const isComplex = require( '@stdlib/assert/is-complex' ); ``` #### isComplex( value ) @@ -35,11 +35,11 @@ var isComplex = require( '@stdlib/assert/is-complex' ); Tests if a value is a [64-bit][@stdlib/complex/float32/ctor] or [128-bit][@stdlib/complex/float64/ctor] complex number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var x = new Complex128( 1.0, 3.0 ); -var bool = isComplex( x ); +let x = new Complex128( 1.0, 3.0 ); +let bool = isComplex( x ); // returns true x = new Complex64( 3.0, 1.0 ); @@ -58,11 +58,11 @@ bool = isComplex( x ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isComplex = require( '@stdlib/assert/is-complex' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isComplex = require( '@stdlib/assert/is-complex' ); -var out = isComplex( new Complex64( 2.0, 2.0 ) ); +let out = isComplex( new Complex64( 2.0, 2.0 ) ); // returns true out = isComplex( new Complex128( 3.0, 1.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex128/README.md b/lib/node_modules/@stdlib/assert/is-complex128/README.md index 256a567d62cd..1e3f84f2338f 100644 --- a/lib/node_modules/@stdlib/assert/is-complex128/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex128/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128 = require( '@stdlib/assert/is-complex128' ); +const isComplex128 = require( '@stdlib/assert/is-complex128' ); ``` #### isComplex128( value ) @@ -35,11 +35,11 @@ var isComplex128 = require( '@stdlib/assert/is-complex128' ); Tests if a value is a [128-bit complex number][@stdlib/complex/float64/ctor]. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var x = new Complex128( 1.0, 3.0 ); +const x = new Complex128( 1.0, 3.0 ); -var bool = isComplex128( x ); +const bool = isComplex128( x ); // returns true ``` @@ -54,11 +54,11 @@ var bool = isComplex128( x ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isComplex128 = require( '@stdlib/assert/is-complex128' ); -var out = isComplex128( new Complex128( 3.0, 1.0 ) ); +let out = isComplex128( new Complex128( 3.0, 1.0 ) ); // returns true out = isComplex128( new Complex64( 2.0, 2.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex128array/README.md b/lib/node_modules/@stdlib/assert/is-complex128array/README.md index 0b842f6b3682..a6c16ed73850 100644 --- a/lib/node_modules/@stdlib/assert/is-complex128array/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex128array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128Array = require( '@stdlib/assert/is-complex128array' ); +const isComplex128Array = require( '@stdlib/assert/is-complex128array' ); ``` #### isComplex128Array( value ) @@ -35,9 +35,9 @@ var isComplex128Array = require( '@stdlib/assert/is-complex128array' ); Tests if a value is a [`Complex128Array`][@stdlib/array/complex128]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var bool = isComplex128Array( new Complex128Array( 10 ) ); +let bool = isComplex128Array( new Complex128Array( 10 ) ); // returns true bool = isComplex128Array( [] ); @@ -55,20 +55,20 @@ bool = isComplex128Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var isComplex128Array = require( '@stdlib/assert/is-complex128array' ); - -var bool = isComplex128Array( new Complex128Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isComplex128Array = require( '@stdlib/assert/is-complex128array' ); + +let bool = isComplex128Array( new Complex128Array( 10 ) ); // returns true bool = isComplex128Array( new Complex64Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex128matrix-like/README.md b/lib/node_modules/@stdlib/assert/is-complex128matrix-like/README.md index 2dd874028af8..c03487ba22de 100644 --- a/lib/node_modules/@stdlib/assert/is-complex128matrix-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex128matrix-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128MatrixLike = require( '@stdlib/assert/is-complex128matrix-like' ); +const isComplex128MatrixLike = require( '@stdlib/assert/is-complex128matrix-like' ); ``` #### isComplex128MatrixLike( value ) @@ -35,12 +35,12 @@ var isComplex128MatrixLike = require( '@stdlib/assert/is-complex128matrix-like' Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex128`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isComplex128MatrixLike( arr ); +const bool = isComplex128MatrixLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex128MatrixLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var isComplex128MatrixLike = require( '@stdlib/assert/is-complex128matrix-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isComplex128MatrixLike = require( '@stdlib/assert/is-complex128matrix-like' ); -var buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex128', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex128', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isComplex128MatrixLike( arr ); +let out = isComplex128MatrixLike( arr ); // returns true out = isComplex128MatrixLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-complex128ndarray-like/README.md b/lib/node_modules/@stdlib/assert/is-complex128ndarray-like/README.md index 9b243fd93147..1b6fd9658a1f 100644 --- a/lib/node_modules/@stdlib/assert/is-complex128ndarray-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex128ndarray-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128ndarrayLike = require( '@stdlib/assert/is-complex128ndarray-like' ); +const isComplex128ndarrayLike = require( '@stdlib/assert/is-complex128ndarray-like' ); ``` #### isComplex128ndarrayLike( value ) @@ -35,12 +35,12 @@ var isComplex128ndarrayLike = require( '@stdlib/assert/is-complex128ndarray-like Tests if a value is an [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex128`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isComplex128ndarrayLike( arr ); +const bool = isComplex128ndarrayLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex128ndarrayLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var isComplex128ndarrayLike = require( '@stdlib/assert/is-complex128ndarray-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isComplex128ndarrayLike = require( '@stdlib/assert/is-complex128ndarray-like' ); -var buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex128', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex128', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isComplex128ndarrayLike( arr ); +let out = isComplex128ndarrayLike( arr ); // returns true out = isComplex128ndarrayLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-complex128vector-like/README.md b/lib/node_modules/@stdlib/assert/is-complex128vector-like/README.md index 2eaa548b98a7..9e713600fa1b 100644 --- a/lib/node_modules/@stdlib/assert/is-complex128vector-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex128vector-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex128VectorLike = require( '@stdlib/assert/is-complex128vector-like' ); +const isComplex128VectorLike = require( '@stdlib/assert/is-complex128vector-like' ); ``` #### isComplex128VectorLike( value ) @@ -35,12 +35,12 @@ var isComplex128VectorLike = require( '@stdlib/assert/is-complex128vector-like' Tests if a value is a 1-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex128`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex128', new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); -var bool = isComplex128VectorLike( arr ); +const bool = isComplex128VectorLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex128VectorLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var isComplex128VectorLike = require( '@stdlib/assert/is-complex128vector-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isComplex128VectorLike = require( '@stdlib/assert/is-complex128vector-like' ); -var buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex128', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); +const buffer = new Complex128Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex128', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); -var out = isComplex128VectorLike( arr ); +let out = isComplex128VectorLike( arr ); // returns true out = isComplex128VectorLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-complex64/README.md b/lib/node_modules/@stdlib/assert/is-complex64/README.md index 5dd47978a94e..f3b247ee164d 100644 --- a/lib/node_modules/@stdlib/assert/is-complex64/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64 = require( '@stdlib/assert/is-complex64' ); +const isComplex64 = require( '@stdlib/assert/is-complex64' ); ``` #### isComplex64( value ) @@ -35,11 +35,11 @@ var isComplex64 = require( '@stdlib/assert/is-complex64' ); Tests if a value is a [64-bit complex number][@stdlib/complex/float32/ctor]. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var x = new Complex64( 1.0, 3.0 ); +const x = new Complex64( 1.0, 3.0 ); -var bool = isComplex64( x ); +const bool = isComplex64( x ); // returns true ``` @@ -54,11 +54,11 @@ var bool = isComplex64( x ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isComplex64 = require( '@stdlib/assert/is-complex64' ); -var out = isComplex64( new Complex64( 2.0, 2.0 ) ); +let out = isComplex64( new Complex64( 2.0, 2.0 ) ); // returns true out = isComplex64( new Complex128( 3.0, 1.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex64array/README.md b/lib/node_modules/@stdlib/assert/is-complex64array/README.md index 60c64453bf2a..17e3e0d05df7 100644 --- a/lib/node_modules/@stdlib/assert/is-complex64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64Array = require( '@stdlib/assert/is-complex64array' ); +const isComplex64Array = require( '@stdlib/assert/is-complex64array' ); ``` #### isComplex64Array( value ) @@ -35,9 +35,9 @@ var isComplex64Array = require( '@stdlib/assert/is-complex64array' ); Tests if a value is a [`Complex64Array`][@stdlib/array/complex64]. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var bool = isComplex64Array( new Complex64Array( 10 ) ); +let bool = isComplex64Array( new Complex64Array( 10 ) ); // returns true bool = isComplex64Array( [] ); @@ -55,20 +55,20 @@ bool = isComplex64Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex64Array = require( '@stdlib/assert/is-complex64array' ); - -var bool = isComplex64Array( new Complex64Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex64Array = require( '@stdlib/assert/is-complex64array' ); + +let bool = isComplex64Array( new Complex64Array( 10 ) ); // returns true bool = isComplex64Array( new Complex128Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-complex64matrix-like/README.md b/lib/node_modules/@stdlib/assert/is-complex64matrix-like/README.md index c075e1a9c571..e7020f6a6192 100644 --- a/lib/node_modules/@stdlib/assert/is-complex64matrix-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex64matrix-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64MatrixLike = require( '@stdlib/assert/is-complex64matrix-like' ); +const isComplex64MatrixLike = require( '@stdlib/assert/is-complex64matrix-like' ); ``` #### isComplex64MatrixLike( value ) @@ -35,12 +35,12 @@ var isComplex64MatrixLike = require( '@stdlib/assert/is-complex64matrix-like' ); Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex64`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isComplex64MatrixLike( arr ); +const bool = isComplex64MatrixLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex64MatrixLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex64MatrixLike = require( '@stdlib/assert/is-complex64matrix-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex64MatrixLike = require( '@stdlib/assert/is-complex64matrix-like' ); -var buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isComplex64MatrixLike( arr ); +let out = isComplex64MatrixLike( arr ); // returns true out = isComplex64MatrixLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-complex64ndarray-like/README.md b/lib/node_modules/@stdlib/assert/is-complex64ndarray-like/README.md index 9fd968dbf357..e241a2f56033 100644 --- a/lib/node_modules/@stdlib/assert/is-complex64ndarray-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex64ndarray-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64ndarrayLike = require( '@stdlib/assert/is-complex64ndarray-like' ); +const isComplex64ndarrayLike = require( '@stdlib/assert/is-complex64ndarray-like' ); ``` #### isComplex64ndarrayLike( value ) @@ -35,12 +35,12 @@ var isComplex64ndarrayLike = require( '@stdlib/assert/is-complex64ndarray-like' Tests if a value is an [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex64`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isComplex64ndarrayLike( arr ); +const bool = isComplex64ndarrayLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex64ndarrayLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex64ndarrayLike = require( '@stdlib/assert/is-complex64ndarray-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex64ndarrayLike = require( '@stdlib/assert/is-complex64ndarray-like' ); -var buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isComplex64ndarrayLike( arr ); +let out = isComplex64ndarrayLike( arr ); // returns true out = isComplex64ndarrayLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-complex64vector-like/README.md b/lib/node_modules/@stdlib/assert/is-complex64vector-like/README.md index ddba22b8523f..049286ef25ec 100644 --- a/lib/node_modules/@stdlib/assert/is-complex64vector-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-complex64vector-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isComplex64VectorLike = require( '@stdlib/assert/is-complex64vector-like' ); +const isComplex64VectorLike = require( '@stdlib/assert/is-complex64vector-like' ); ``` #### isComplex64VectorLike( value ) @@ -35,12 +35,12 @@ var isComplex64VectorLike = require( '@stdlib/assert/is-complex64vector-like' ); Tests if a value is a 1-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `complex64`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); +const arr = ndarray( 'complex64', new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); -var bool = isComplex64VectorLike( arr ); +const bool = isComplex64VectorLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isComplex64VectorLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var isComplex64VectorLike = require( '@stdlib/assert/is-complex64vector-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isComplex64VectorLike = require( '@stdlib/assert/is-complex64vector-like' ); -var buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); -var arr = ndarray( 'complex64', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); +const buffer = new Complex64Array( [ 0, 0, 0, 0, 0, 0, 0, 0 ] ); +const arr = ndarray( 'complex64', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); -var out = isComplex64VectorLike( arr ); +let out = isComplex64VectorLike( arr ); // returns true out = isComplex64VectorLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-composite/README.md b/lib/node_modules/@stdlib/assert/is-composite/README.md index 72fb7fa82868..05a1c73f9e4e 100644 --- a/lib/node_modules/@stdlib/assert/is-composite/README.md +++ b/lib/node_modules/@stdlib/assert/is-composite/README.md @@ -35,7 +35,7 @@ A **composite number** is defined as a positive integer value greater than `1` w ## Usage ```javascript -var isComposite = require( '@stdlib/assert/is-composite' ); +const isComposite = require( '@stdlib/assert/is-composite' ); ``` #### isComposite( value ) @@ -45,9 +45,9 @@ Tests if a `value` is a composite number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isComposite( 4.0 ); +let bool = isComposite( 4.0 ); // returns true bool = isComposite( new Number( 4.0 ) ); @@ -73,9 +73,9 @@ Tests if a `value` is a primitive composite number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isComposite.isPrimitive( 4.0 ); +let bool = isComposite.isPrimitive( 4.0 ); // returns true bool = isComposite.isPrimitive( new Number( 4.0 ) ); @@ -89,9 +89,9 @@ Tests if a `value` is a `Number` object having a value which is a composite numb ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isComposite.isObject( 4.0 ); +let bool = isComposite.isObject( 4.0 ); // returns false bool = isComposite.isObject( new Number( 4.0 ) ); @@ -111,10 +111,10 @@ bool = isComposite.isObject( new Number( 4.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isComposite = require( '@stdlib/assert/is-composite' ); +const Number = require( '@stdlib/number/ctor' ); +const isComposite = require( '@stdlib/assert/is-composite' ); -var bool = isComposite( 4.0 ); +let bool = isComposite( 4.0 ); // returns true bool = isComposite( new Number( 4.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-configurable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-configurable-property-in/README.md index 6e6f52ba2323..9ae7ec6a5cf0 100644 --- a/lib/node_modules/@stdlib/assert/is-configurable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-configurable-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isConfigurablePropertyIn = require( '@stdlib/assert/is-configurable-property-in' ); +const isConfigurablePropertyIn = require( '@stdlib/assert/is-configurable-property-in' ); ``` #### isConfigurablePropertyIn( value, property ) @@ -37,10 +37,7 @@ Returns a `boolean` indicating if a `value` has a configurable `property` (i.e., ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; @@ -61,9 +58,9 @@ defineProperty( Foo.prototype, 'boop', { 'value': true }); -obj = new Foo(); +const obj = new Foo(); -bool = isConfigurablePropertyIn( obj, 'foo' ); +let bool = isConfigurablePropertyIn( obj, 'foo' ); // returns true bool = isConfigurablePropertyIn( obj, 'beep' ); @@ -84,18 +81,18 @@ bool = isConfigurablePropertyIn( obj, 'boop' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isConfigurablePropertyIn( 'beep', 'toString' ); + const bool = isConfigurablePropertyIn( 'beep', 'toString' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isConfigurablePropertyIn( obj, null ); + const bool = isConfigurablePropertyIn( obj, null ); // returns true ``` @@ -112,9 +109,9 @@ bool = isConfigurablePropertyIn( obj, 'boop' ); ```javascript -var isConfigurablePropertyIn = require( '@stdlib/assert/is-configurable-property-in' ); +const isConfigurablePropertyIn = require( '@stdlib/assert/is-configurable-property-in' ); -var bool = isConfigurablePropertyIn( { 'a': 'b' }, 'a' ); +let bool = isConfigurablePropertyIn( { 'a': 'b' }, 'a' ); // returns true bool = isConfigurablePropertyIn( [ 'a' ], 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-configurable-property/README.md b/lib/node_modules/@stdlib/assert/is-configurable-property/README.md index 57912ab87a6c..8004c527447a 100644 --- a/lib/node_modules/@stdlib/assert/is-configurable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-configurable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); +const isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); ``` #### isConfigurableProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a configurable `property` (i.e., ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -57,7 +57,7 @@ defineProperty( obj, 'boop', { 'value': true }); -var bool = isConfigurableProperty( obj, 'foo' ); +let bool = isConfigurableProperty( obj, 'foo' ); // returns true bool = isConfigurableProperty( obj, 'beep' ); @@ -78,18 +78,18 @@ bool = isConfigurableProperty( obj, 'boop' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isConfigurableProperty( 'beep', 'length' ); + const bool = isConfigurableProperty( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isConfigurableProperty( obj, null ); + const bool = isConfigurableProperty( obj, null ); // returns true ``` @@ -106,9 +106,9 @@ bool = isConfigurableProperty( obj, 'boop' ); ```javascript -var isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); +const isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); -var bool = isConfigurableProperty( { 'a': 'b' }, 'a' ); +let bool = isConfigurableProperty( { 'a': 'b' }, 'a' ); // returns true bool = isConfigurableProperty( [ 'a' ], 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-constantcase/README.md b/lib/node_modules/@stdlib/assert/is-constantcase/README.md index b672206d862f..a5545fdefae9 100644 --- a/lib/node_modules/@stdlib/assert/is-constantcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-constantcase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isConstantcase = require( '@stdlib/assert/is-constantcase' ); +const isConstantcase = require( '@stdlib/assert/is-constantcase' ); ``` #### isConstantcase( value ) @@ -35,7 +35,7 @@ var isConstantcase = require( '@stdlib/assert/is-constantcase' ); Tests if a `value` is a constantcase `string`. ```javascript -var bool = isConstantcase( 'BEEP_BOOP' ); +let bool = isConstantcase( 'BEEP_BOOP' ); // returns true bool = isConstantcase( 'BEEP and BOOP' ); @@ -63,7 +63,7 @@ bool = isConstantcase( 'BEEP and BOOP' ); ```javascript -var isConstantcase = require( '@stdlib/assert/is-constantcase' ); +const isConstantcase = require( '@stdlib/assert/is-constantcase' ); console.log( isConstantcase( 'BEEP_BOOP' ) ); // => true diff --git a/lib/node_modules/@stdlib/assert/is-cube-number/README.md b/lib/node_modules/@stdlib/assert/is-cube-number/README.md index d369a6a85ac2..0d8346bf1187 100644 --- a/lib/node_modules/@stdlib/assert/is-cube-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-cube-number/README.md @@ -35,7 +35,7 @@ A **cube number** is defined as an integer value which is the cube of an integer ## Usage ```javascript -var isCubeNumber = require( '@stdlib/assert/is-cube-number' ); +const isCubeNumber = require( '@stdlib/assert/is-cube-number' ); ``` #### isCubeNumber( value ) @@ -45,9 +45,9 @@ Tests if a `value` is a cube number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isCubeNumber( 8.0 ); +let bool = isCubeNumber( 8.0 ); // returns true bool = isCubeNumber( new Number( 8.0 ) ); @@ -73,9 +73,9 @@ Tests if a `value` is a primitive cube number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isCubeNumber.isPrimitive( 8.0 ); +let bool = isCubeNumber.isPrimitive( 8.0 ); // returns true bool = isCubeNumber.isPrimitive( new Number( 8.0 ) ); @@ -89,9 +89,9 @@ Tests if a `value` is a `Number` object having a value which is a cube number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isCubeNumber.isObject( 8.0 ); +let bool = isCubeNumber.isObject( 8.0 ); // returns false bool = isCubeNumber.isObject( new Number( 8.0 ) ); @@ -111,10 +111,10 @@ bool = isCubeNumber.isObject( new Number( 8.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isCubeNumber = require( '@stdlib/assert/is-cube-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isCubeNumber = require( '@stdlib/assert/is-cube-number' ); -var bool = isCubeNumber( 8.0 ); +let bool = isCubeNumber( 8.0 ); // returns true bool = isCubeNumber( new Number( 8.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-current-year/README.md b/lib/node_modules/@stdlib/assert/is-current-year/README.md index fb65d8fb4e30..830f3c11966e 100644 --- a/lib/node_modules/@stdlib/assert/is-current-year/README.md +++ b/lib/node_modules/@stdlib/assert/is-current-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isCurrentYear = require( '@stdlib/assert/is-current-year' ); +const isCurrentYear = require( '@stdlib/assert/is-current-year' ); ``` #### isCurrentYear( value ) @@ -35,9 +35,9 @@ var isCurrentYear = require( '@stdlib/assert/is-current-year' ); Tests if a `value` is either an integer equal to the current year or a `Date` object representing the current year. ```javascript -var currentYear = require( '@stdlib/time/current-year' ); +const currentYear = require( '@stdlib/time/current-year' ); -var bool = isCurrentYear( currentYear() ); +let bool = isCurrentYear( currentYear() ); // returns true bool = isCurrentYear( 2021 ); @@ -55,10 +55,10 @@ bool = isCurrentYear( 2021 ); ```javascript -var currentYear = require( '@stdlib/time/current-year' ); -var isCurrentYear = require( '@stdlib/assert/is-current-year' ); +const currentYear = require( '@stdlib/time/current-year' ); +const isCurrentYear = require( '@stdlib/assert/is-current-year' ); -var bool = isCurrentYear( new Date() ); +let bool = isCurrentYear( new Date() ); // returns true bool = isCurrentYear( currentYear() ); diff --git a/lib/node_modules/@stdlib/assert/is-darwin/README.md b/lib/node_modules/@stdlib/assert/is-darwin/README.md index 2d522877097d..16105134cdf8 100644 --- a/lib/node_modules/@stdlib/assert/is-darwin/README.md +++ b/lib/node_modules/@stdlib/assert/is-darwin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_DARWIN = require( '@stdlib/assert/is-darwin' ); +const IS_DARWIN = require( '@stdlib/assert/is-darwin' ); ``` #### IS_DARWIN @@ -50,8 +50,8 @@ console.log( IS_DARWIN ); ```javascript -var PLATFORM = require( '@stdlib/os/platform' ); -var IS_DARWIN = require( '@stdlib/assert/is-darwin' ); +const PLATFORM = require( '@stdlib/os/platform' ); +const IS_DARWIN = require( '@stdlib/assert/is-darwin' ); if ( IS_DARWIN ) { console.log( 'Running on Darwin...' ); diff --git a/lib/node_modules/@stdlib/assert/is-data-property-in/README.md b/lib/node_modules/@stdlib/assert/is-data-property-in/README.md index 0a17e2455b43..cc68f351798d 100644 --- a/lib/node_modules/@stdlib/assert/is-data-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-data-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDataPropertyIn = require( '@stdlib/assert/is-data-property-in' ); +const isDataPropertyIn = require( '@stdlib/assert/is-data-property-in' ); ``` #### isDataPropertyIn( value, property ) @@ -37,16 +37,15 @@ Returns a `boolean` indicating if a `value` has a data `property` (either own or ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; return this; } +const obj = new Foo(); + defineProperty( Foo.prototype, 'beep', { 'configurable': false, 'enumerable': false, @@ -65,9 +64,7 @@ defineProperty( Foo.prototype, 'accessor', { } }); -obj = new Foo(); - -bool = isDataPropertyIn( obj, 'foo' ); +let bool = isDataPropertyIn( obj, 'foo' ); // returns true bool = isDataPropertyIn( obj, 'beep' ); @@ -88,18 +85,18 @@ bool = isDataPropertyIn( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isDataPropertyIn( 'beep', 'length' ); + const bool = isDataPropertyIn( 'beep', 'length' ); // returns true ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isDataPropertyIn( obj, null ); + const bool = isDataPropertyIn( obj, null ); // returns true ``` @@ -116,9 +113,9 @@ bool = isDataPropertyIn( obj, 'accessor' ); ```javascript -var isDataPropertyIn = require( '@stdlib/assert/is-data-property-in' ); +const isDataPropertyIn = require( '@stdlib/assert/is-data-property-in' ); -var bool = isDataPropertyIn( [ 'a' ], 'length' ); +let bool = isDataPropertyIn( [ 'a' ], 'length' ); // returns true bool = isDataPropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-data-property/README.md b/lib/node_modules/@stdlib/assert/is-data-property/README.md index 61e3af0e83e2..7591ee4193eb 100644 --- a/lib/node_modules/@stdlib/assert/is-data-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-data-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDataProperty = require( '@stdlib/assert/is-data-property' ); +const isDataProperty = require( '@stdlib/assert/is-data-property' ); ``` #### isDataProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a data `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -61,7 +61,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isDataProperty( obj, 'foo' ); +let bool = isDataProperty( obj, 'foo' ); // returns true bool = isDataProperty( obj, 'beep' ); @@ -82,18 +82,18 @@ bool = isDataProperty( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isDataProperty( 'beep', 'length' ); + const bool = isDataProperty( 'beep', 'length' ); // returns true ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isDataProperty( obj, null ); + const bool = isDataProperty( obj, null ); // returns true ``` @@ -110,9 +110,9 @@ bool = isDataProperty( obj, 'accessor' ); ```javascript -var isDataProperty = require( '@stdlib/assert/is-data-property' ); +const isDataProperty = require( '@stdlib/assert/is-data-property' ); -var bool = isDataProperty( [ 'a' ], 'length' ); +let bool = isDataProperty( [ 'a' ], 'length' ); // returns true bool = isDataProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-dataview/README.md b/lib/node_modules/@stdlib/assert/is-dataview/README.md index 7e452c27c8c5..f4c903c886cd 100644 --- a/lib/node_modules/@stdlib/assert/is-dataview/README.md +++ b/lib/node_modules/@stdlib/assert/is-dataview/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDataView = require( '@stdlib/assert/is-dataview' ); +const isDataView = require( '@stdlib/assert/is-dataview' ); ``` #### isDataView( value ) @@ -35,10 +35,10 @@ var isDataView = require( '@stdlib/assert/is-dataview' ); Tests if a value is a [`DataView`][mdn-dataview]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) ); +let bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) ); // returns true bool = isDataView( [] ); @@ -56,20 +56,20 @@ bool = isDataView( [] ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); -var isDataView = require( '@stdlib/assert/is-dataview' ); - -var bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); +const isDataView = require( '@stdlib/assert/is-dataview' ); + +let bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) ); // returns true bool = isDataView( new Float32Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-date-object-array/README.md b/lib/node_modules/@stdlib/assert/is-date-object-array/README.md index 407da6428634..76aa5396b605 100644 --- a/lib/node_modules/@stdlib/assert/is-date-object-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-date-object-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDateObjectArray = require( '@stdlib/assert/is-date-object-array' ); +const isDateObjectArray = require( '@stdlib/assert/is-date-object-array' ); ``` #### isDateObjectArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** [`Date`][@stdlib/ ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isDateObjectArray( [ new Date(), new Date() ] ); +let bool = isDateObjectArray( [ new Date(), new Date() ] ); // returns true bool = isDateObjectArray( [ {}, new Number( 3.0 ) ] ); @@ -68,10 +68,10 @@ bool = isDateObjectArray( [ null, {} ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isDateObjectArray = require( '@stdlib/assert/is-date-object-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isDateObjectArray = require( '@stdlib/assert/is-date-object-array' ); -var bool = isDateObjectArray( [ new Date(), new Date(), new Date() ] ); +let bool = isDateObjectArray( [ new Date(), new Date(), new Date() ] ); // returns true bool = isDateObjectArray( [ new Date(), new Number( 3 ) ] ); diff --git a/lib/node_modules/@stdlib/assert/is-date-object/README.md b/lib/node_modules/@stdlib/assert/is-date-object/README.md index 648e48000568..51e1f4d699d6 100644 --- a/lib/node_modules/@stdlib/assert/is-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-date-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDateObject = require( '@stdlib/assert/is-date-object' ); +const isDateObject = require( '@stdlib/assert/is-date-object' ); ``` #### isDateObject( value ) @@ -35,7 +35,7 @@ var isDateObject = require( '@stdlib/assert/is-date-object' ); Tests if a value is a [`Date`][mdn-date-object] object. ```javascript -var bool = isDateObject( new Date() ); +let bool = isDateObject( new Date() ); // returns true bool = isDateObject( '2017-01-01' ); @@ -55,9 +55,9 @@ bool = isDateObject( '2017-01-01' ); ```javascript -var isDateObject = require( '@stdlib/assert/is-date-object' ); +const isDateObject = require( '@stdlib/assert/is-date-object' ); -var bool = isDateObject( new Date() ); +let bool = isDateObject( new Date() ); // returns true bool = isDateObject( '2017-01-01' ); diff --git a/lib/node_modules/@stdlib/assert/is-digit-string/README.md b/lib/node_modules/@stdlib/assert/is-digit-string/README.md index 9580afc339c9..d6b92d9d2b8c 100644 --- a/lib/node_modules/@stdlib/assert/is-digit-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-digit-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDigitString = require( '@stdlib/assert/is-digit-string' ); +const isDigitString = require( '@stdlib/assert/is-digit-string' ); ``` #### isDigitString( value ) @@ -35,7 +35,7 @@ var isDigitString = require( '@stdlib/assert/is-digit-string' ); Tests whether a string contains only numeric digits. ```javascript -var bool = isDigitString( '0123456789' ); +const bool = isDigitString( '0123456789' ); // returns true ``` @@ -60,9 +60,9 @@ var bool = isDigitString( '0123456789' ); ```javascript -var isDigitString = require( '@stdlib/assert/is-digit-string' ); +const isDigitString = require( '@stdlib/assert/is-digit-string' ); -var out = isDigitString( '0123456789' ); +let out = isDigitString( '0123456789' ); // returns true out = isDigitString( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-docker/README.md b/lib/node_modules/@stdlib/assert/is-docker/README.md index 423e5bf925f7..ab29e1cabfaa 100644 --- a/lib/node_modules/@stdlib/assert/is-docker/README.md +++ b/lib/node_modules/@stdlib/assert/is-docker/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_DOCKER = require( '@stdlib/assert/is-docker' ); +const IS_DOCKER = require( '@stdlib/assert/is-docker' ); ``` #### IS_DOCKER @@ -35,7 +35,7 @@ var IS_DOCKER = require( '@stdlib/assert/is-docker' ); `Boolean` indicating if the process is running in a [Docker][docker] container. ```javascript -var bool = IS_DOCKER; +const bool = IS_DOCKER; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_DOCKER; ```javascript -var IS_DOCKER = require( '@stdlib/assert/is-docker' ); +const IS_DOCKER = require( '@stdlib/assert/is-docker' ); console.log( IS_DOCKER ); // => diff --git a/lib/node_modules/@stdlib/assert/is-domain-name/README.md b/lib/node_modules/@stdlib/assert/is-domain-name/README.md index b977b2f41b1d..9d2c9eaa8d1a 100644 --- a/lib/node_modules/@stdlib/assert/is-domain-name/README.md +++ b/lib/node_modules/@stdlib/assert/is-domain-name/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isDomainName = require( '@stdlib/assert/is-domain-name' ); +const isDomainName = require( '@stdlib/assert/is-domain-name' ); ``` #### isDomainName( value ) @@ -41,7 +41,7 @@ var isDomainName = require( '@stdlib/assert/is-domain-name' ); Tests if a `value` is a domain name. ```javascript -var bool = isDomainName( 'example.com' ); +let bool = isDomainName( 'example.com' ); // returns true bool = isDomainName( 'foo@bar.com' ); @@ -67,9 +67,9 @@ bool = isDomainName( 'foo@bar.com' ); ```javascript -var isDomainName = require( '@stdlib/assert/is-domain-name' ); +const isDomainName = require( '@stdlib/assert/is-domain-name' ); -var bool = isDomainName( 'www.example.com' ); +let bool = isDomainName( 'www.example.com' ); // returns true bool = isDomainName( 'foo@bar.com' ); diff --git a/lib/node_modules/@stdlib/assert/is-duration-string/README.md b/lib/node_modules/@stdlib/assert/is-duration-string/README.md index 91228b698dbb..31865f733f45 100644 --- a/lib/node_modules/@stdlib/assert/is-duration-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-duration-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isDurationString = require( '@stdlib/assert/is-duration-string' ); +const isDurationString = require( '@stdlib/assert/is-duration-string' ); ``` #### isDurationString( value ) @@ -35,7 +35,7 @@ var isDurationString = require( '@stdlib/assert/is-duration-string' ); Tests if a `value` is a duration `string`. ```javascript -var bool = isDurationString( '1d' ); +let bool = isDurationString( '1d' ); // returns true bool = isDurationString( '1d2h' ); @@ -75,9 +75,9 @@ bool = isDurationString( '1d2h' ); ```javascript -var isDurationString = require( '@stdlib/assert/is-duration-string' ); +const isDurationString = require( '@stdlib/assert/is-duration-string' ); -var bool = isDurationString( '1h' ); +let bool = isDurationString( '1h' ); // returns true bool = isDurationString( '1m20ms' ); diff --git a/lib/node_modules/@stdlib/assert/is-electron-main/README.md b/lib/node_modules/@stdlib/assert/is-electron-main/README.md index 65b72eee4bb4..35ffebcd5e7a 100644 --- a/lib/node_modules/@stdlib/assert/is-electron-main/README.md +++ b/lib/node_modules/@stdlib/assert/is-electron-main/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_ELECTRON_MAIN = require( '@stdlib/assert/is-electron-main' ); +const IS_ELECTRON_MAIN = require( '@stdlib/assert/is-electron-main' ); ``` #### IS_ELECTRON_MAIN @@ -35,7 +35,7 @@ var IS_ELECTRON_MAIN = require( '@stdlib/assert/is-electron-main' ); `Boolean` indicating if the runtime is the main [Electron][electron] process. ```javascript -var bool = IS_ELECTRON_MAIN; +const bool = IS_ELECTRON_MAIN; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_ELECTRON_MAIN; ```javascript -var IS_ELECTRON_MAIN = require( '@stdlib/assert/is-electron-main' ); +const IS_ELECTRON_MAIN = require( '@stdlib/assert/is-electron-main' ); console.log( IS_ELECTRON_MAIN ); // => diff --git a/lib/node_modules/@stdlib/assert/is-electron-renderer/README.md b/lib/node_modules/@stdlib/assert/is-electron-renderer/README.md index 5fc2d699b3e7..78322783bd96 100644 --- a/lib/node_modules/@stdlib/assert/is-electron-renderer/README.md +++ b/lib/node_modules/@stdlib/assert/is-electron-renderer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_ELECTRON_RENDERER = require( '@stdlib/assert/is-electron-renderer' ); +const IS_ELECTRON_RENDERER = require( '@stdlib/assert/is-electron-renderer' ); ``` #### IS_ELECTRON_RENDERER @@ -35,7 +35,7 @@ var IS_ELECTRON_RENDERER = require( '@stdlib/assert/is-electron-renderer' ); `Boolean` indicating if the runtime is the [Electron][electron] renderer process. ```javascript -var bool = IS_ELECTRON_RENDERER; +const bool = IS_ELECTRON_RENDERER; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_ELECTRON_RENDERER; ```javascript -var IS_ELECTRON_RENDERER = require( '@stdlib/assert/is-electron-renderer' ); +const IS_ELECTRON_RENDERER = require( '@stdlib/assert/is-electron-renderer' ); console.log( IS_ELECTRON_RENDERER ); // => diff --git a/lib/node_modules/@stdlib/assert/is-electron/README.md b/lib/node_modules/@stdlib/assert/is-electron/README.md index 9c6c50ec4e71..4f089a9db91e 100644 --- a/lib/node_modules/@stdlib/assert/is-electron/README.md +++ b/lib/node_modules/@stdlib/assert/is-electron/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_ELECTRON = require( '@stdlib/assert/is-electron' ); +const IS_ELECTRON = require( '@stdlib/assert/is-electron' ); ``` #### IS_ELECTRON @@ -35,7 +35,7 @@ var IS_ELECTRON = require( '@stdlib/assert/is-electron' ); `Boolean` indicating if the runtime is [Electron][electron]. ```javascript -var bool = IS_ELECTRON; +const bool = IS_ELECTRON; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_ELECTRON; ```javascript -var IS_ELECTRON = require( '@stdlib/assert/is-electron' ); +const IS_ELECTRON = require( '@stdlib/assert/is-electron' ); console.log( IS_ELECTRON ); // => diff --git a/lib/node_modules/@stdlib/assert/is-email-address/README.md b/lib/node_modules/@stdlib/assert/is-email-address/README.md index 6e4334bcc3f3..ea3bfcb99b79 100644 --- a/lib/node_modules/@stdlib/assert/is-email-address/README.md +++ b/lib/node_modules/@stdlib/assert/is-email-address/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isEmail = require( '@stdlib/assert/is-email-address' ); +const isEmail = require( '@stdlib/assert/is-email-address' ); ``` #### isEmail( value ) @@ -41,7 +41,7 @@ var isEmail = require( '@stdlib/assert/is-email-address' ); Tests if a `value` is an [email address][validate-email-address]. ```javascript -var bool = isEmail( 'beep@boop.com' ); +const bool = isEmail( 'beep@boop.com' ); // returns true ``` @@ -65,11 +65,9 @@ var bool = isEmail( 'beep@boop.com' ); ```javascript -var isEmail = require( '@stdlib/assert/is-email-address' ); +const isEmail = require( '@stdlib/assert/is-email-address' ); -var bool; - -bool = isEmail( 'beep@boop.com' ); +let bool = isEmail( 'beep@boop.com' ); // returns true bool = isEmail( 'beep' ); diff --git a/lib/node_modules/@stdlib/assert/is-empty-array-like-object/README.md b/lib/node_modules/@stdlib/assert/is-empty-array-like-object/README.md index a67b2783bd8a..e8c374bbf691 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-array-like-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-empty-array-like-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEmptyArrayLikeObject = require( '@stdlib/assert/is-empty-array-like-object' ); +const isEmptyArrayLikeObject = require( '@stdlib/assert/is-empty-array-like-object' ); ``` #### isEmptyArrayLikeObject( value ) @@ -37,7 +37,7 @@ Tests if a value is an empty [array-like][array-like] `object`. ```javascript -var bool = isEmptyArrayLikeObject( [] ); +let bool = isEmptyArrayLikeObject( [] ); // returns true bool = isEmptyArrayLikeObject( { 'length': 0 } ); @@ -47,7 +47,7 @@ bool = isEmptyArrayLikeObject( { 'length': 0 } ); If provided a `string`, the function returns `false`. ```javascript -var bool = isEmptyArrayLikeObject( '' ); +const bool = isEmptyArrayLikeObject( '' ); // returns false ``` @@ -64,10 +64,10 @@ var bool = isEmptyArrayLikeObject( '' ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var isEmptyArrayLikeObject = require( '@stdlib/assert/is-empty-array-like-object' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isEmptyArrayLikeObject = require( '@stdlib/assert/is-empty-array-like-object' ); -var bool = isEmptyArrayLikeObject( { 'length': 0 } ); +let bool = isEmptyArrayLikeObject( { 'length': 0 } ); // returns true bool = isEmptyArrayLikeObject( [] ); diff --git a/lib/node_modules/@stdlib/assert/is-empty-array/README.md b/lib/node_modules/@stdlib/assert/is-empty-array/README.md index ee372ae1e16f..7c0b220aa280 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-empty-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEmptyArray = require( '@stdlib/assert/is-empty-array' ); +const isEmptyArray = require( '@stdlib/assert/is-empty-array' ); ``` #### isEmptyArray( value ) @@ -35,7 +35,7 @@ var isEmptyArray = require( '@stdlib/assert/is-empty-array' ); Tests if a value is an empty `array`. ```javascript -var bool = isEmptyArray( [] ); +const bool = isEmptyArray( [] ); // returns true ``` @@ -52,9 +52,9 @@ var bool = isEmptyArray( [] ); ```javascript -var isEmptyArray = require( '@stdlib/assert/is-empty-array' ); +const isEmptyArray = require( '@stdlib/assert/is-empty-array' ); -var bool = isEmptyArray( [] ); +let bool = isEmptyArray( [] ); // returns true bool = isEmptyArray( new Array() ); diff --git a/lib/node_modules/@stdlib/assert/is-empty-collection/README.md b/lib/node_modules/@stdlib/assert/is-empty-collection/README.md index ede925ef608b..09745fe52f71 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-collection/README.md +++ b/lib/node_modules/@stdlib/assert/is-empty-collection/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); +const isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); ``` #### isEmptyCollection( value ) @@ -35,7 +35,7 @@ var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); Tests if a value is an empty collection. ```javascript -var bool = isEmptyCollection( [] ); +const bool = isEmptyCollection( [] ); // returns true ``` @@ -52,18 +52,18 @@ var bool = isEmptyCollection( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); - -var bool = isEmptyCollection( [] ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); + +let bool = isEmptyCollection( [] ); // returns true bool = isEmptyCollection( new Float64Array( [] ) ); diff --git a/lib/node_modules/@stdlib/assert/is-empty-object/README.md b/lib/node_modules/@stdlib/assert/is-empty-object/README.md index 56296e8ac78c..614d58fd1da8 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-empty-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEmptyObject = require( '@stdlib/assert/is-empty-object' ); +const isEmptyObject = require( '@stdlib/assert/is-empty-object' ); ``` #### isEmptyObject( value ) @@ -35,7 +35,7 @@ var isEmptyObject = require( '@stdlib/assert/is-empty-object' ); Tests if a value is an empty `object`. ```javascript -var bool = isEmptyObject( {} ); +const bool = isEmptyObject( {} ); // returns true ``` @@ -52,10 +52,10 @@ var bool = isEmptyObject( {} ); ```javascript -var Object = require( '@stdlib/object/ctor' ); -var isEmptyObject = require( '@stdlib/assert/is-empty-object' ); +const Object = require( '@stdlib/object/ctor' ); +const isEmptyObject = require( '@stdlib/assert/is-empty-object' ); -var bool = isEmptyObject( {} ); +let bool = isEmptyObject( {} ); // returns true bool = isEmptyObject( new Object() ); diff --git a/lib/node_modules/@stdlib/assert/is-empty-string/README.md b/lib/node_modules/@stdlib/assert/is-empty-string/README.md index a91ba528a1a5..a5af2156f89f 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-empty-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEmptyString = require( '@stdlib/assert/is-empty-string' ); +const isEmptyString = require( '@stdlib/assert/is-empty-string' ); ``` #### isEmptyString( value ) @@ -37,7 +37,7 @@ Tests if a value is an empty `string`. ```javascript -var bool = isEmptyString( '' ); +let bool = isEmptyString( '' ); // returns true bool = isEmptyString( new String( '' ) ); @@ -51,7 +51,7 @@ Tests if a `value` is an empty primitive `string`. ```javascript -var bool = isEmptyString.isPrimitive( '' ); +let bool = isEmptyString.isPrimitive( '' ); // returns true bool = isEmptyString.isPrimitive( new String( '' ) ); @@ -65,7 +65,7 @@ Tests if a `value` is an empty `String` object. ```javascript -var bool = isEmptyString.isObject( '' ); +let bool = isEmptyString.isObject( '' ); // returns false bool = isEmptyString.isObject( new String( '' ) ); @@ -85,9 +85,9 @@ bool = isEmptyString.isObject( new String( '' ) ); ```javascript -var isEmptyString = require( '@stdlib/assert/is-empty-string' ); +const isEmptyString = require( '@stdlib/assert/is-empty-string' ); -var bool = isEmptyString( '' ); +let bool = isEmptyString( '' ); // returns true bool = isEmptyString( new String( '' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-enumerable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-enumerable-property-in/README.md index ec8ada08c2d5..39bbc3aa9de4 100644 --- a/lib/node_modules/@stdlib/assert/is-enumerable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-enumerable-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEnumerablePropertyIn = require( '@stdlib/assert/is-enumerable-property-in' ); +const isEnumerablePropertyIn = require( '@stdlib/assert/is-enumerable-property-in' ); ``` #### isEnumerablePropertyIn( value, property ) @@ -37,10 +37,7 @@ Returns a `boolean` indicating if a `value` has an enumerable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; @@ -61,9 +58,9 @@ defineProperty( Foo.prototype, 'boop', { 'value': true }); -obj = new Foo(); +const obj = new Foo(); -bool = isEnumerablePropertyIn( obj, 'foo' ); +let bool = isEnumerablePropertyIn( obj, 'foo' ); // returns true bool = isEnumerablePropertyIn( obj, 'beep' ); @@ -84,18 +81,18 @@ bool = isEnumerablePropertyIn( obj, 'boop' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isEnumerablePropertyIn( 'beep', 'toString' ); + const bool = isEnumerablePropertyIn( 'beep', 'toString' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isEnumerablePropertyIn( obj, null ); + const bool = isEnumerablePropertyIn( obj, null ); // returns true ``` @@ -112,9 +109,9 @@ bool = isEnumerablePropertyIn( obj, 'boop' ); ```javascript -var isEnumerablePropertyIn = require( '@stdlib/assert/is-enumerable-property-in' ); +const isEnumerablePropertyIn = require( '@stdlib/assert/is-enumerable-property-in' ); -var bool = isEnumerablePropertyIn( { 'a': 'b' }, 'a' ); +let bool = isEnumerablePropertyIn( { 'a': 'b' }, 'a' ); // returns true bool = isEnumerablePropertyIn( [ 'a' ], 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-enumerable-property/README.md b/lib/node_modules/@stdlib/assert/is-enumerable-property/README.md index 954cf3c8762b..eace1714ce30 100644 --- a/lib/node_modules/@stdlib/assert/is-enumerable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-enumerable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' ); +const isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' ); ``` #### isEnumerableProperty( value, property ) @@ -35,11 +35,11 @@ var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' ); Returns a `boolean` indicating if a `value` has an enumerable `property`. ```javascript -var value = { +const value = { 'beep': 'boop' }; -var bool = isEnumerableProperty( value, 'beep' ); +let bool = isEnumerableProperty( value, 'beep' ); // returns true bool = isEnumerableProperty( value, 'constructor' ); @@ -57,7 +57,7 @@ bool = isEnumerableProperty( value, 'constructor' ); - In contrast to the native [Object.prototype.propertyIsEnumerable][mdn-object-property-is-enumerable], this function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`. ```javascript - var bool = isEnumerableProperty( null, 'a' ); + let bool = isEnumerableProperty( null, 'a' ); // returns false bool = isEnumerableProperty( void 0, 'a' ); @@ -67,17 +67,17 @@ bool = isEnumerableProperty( value, 'constructor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isEnumerableProperty( 'beep', '1' ); + const bool = isEnumerableProperty( 'beep', '1' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var value = { + let value = { 'null': false }; - var bool = isEnumerableProperty( value, null ); + let bool = isEnumerableProperty( value, null ); // returns true value = { @@ -100,9 +100,9 @@ bool = isEnumerableProperty( value, 'constructor' ); ```javascript -var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' ); +const isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' ); -var bool = isEnumerableProperty( { 'a': 'b' }, 'a' ); +let bool = isEnumerableProperty( { 'a': 'b' }, 'a' ); // returns true bool = isEnumerableProperty( [ 'a' ], 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-equal-array/README.md b/lib/node_modules/@stdlib/assert/is-equal-array/README.md index bb180df19905..995a8ad799b3 100644 --- a/lib/node_modules/@stdlib/assert/is-equal-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-equal-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEqualArray = require( '@stdlib/assert/is-equal-array' ); +const isEqualArray = require( '@stdlib/assert/is-equal-array' ); ``` #### isEqualArray( v1, v2 ) @@ -35,9 +35,9 @@ var isEqualArray = require( '@stdlib/assert/is-equal-array' ); Tests if two arguments are both generic arrays and have equal values. ```javascript -var x = [ 1.0, 2.0 ]; -var y = [ 1.0, 2.0 ]; -var bool = isEqualArray( x, y ); +const x = [ 1.0, 2.0 ]; +const y = [ 1.0, 2.0 ]; +let bool = isEqualArray( x, y ); // returns true bool = isEqualArray( x, [ -1.0, 2.0 ] ); @@ -65,11 +65,11 @@ bool = isEqualArray( x, [ -1.0, 2.0 ] ); ```javascript -var isEqualArray = require( '@stdlib/assert/is-equal-array' ); +const isEqualArray = require( '@stdlib/assert/is-equal-array' ); -var x = [ 1.0, 2.0, 3.0 ]; -var y = [ 1.0, 2.0, 3.0 ]; -var out = isEqualArray( x, y ); +let x = [ 1.0, 2.0, 3.0 ]; +let y = [ 1.0, 2.0, 3.0 ]; +let out = isEqualArray( x, y ); // returns true x = [ -0.0, 0.0, -0.0 ]; diff --git a/lib/node_modules/@stdlib/assert/is-error/README.md b/lib/node_modules/@stdlib/assert/is-error/README.md index 307ecba6660b..98c7b3124a89 100644 --- a/lib/node_modules/@stdlib/assert/is-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isError = require( '@stdlib/assert/is-error' ); +const isError = require( '@stdlib/assert/is-error' ); ``` #### isError( value ) @@ -45,7 +45,7 @@ var isError = require( '@stdlib/assert/is-error' ); Tests if a `value` is an [`Error`][mdn-error] object. ```javascript -var bool = isError( new Error( 'beep' ) ); +const bool = isError( new Error( 'beep' ) ); // returns true ``` @@ -70,9 +70,9 @@ var bool = isError( new Error( 'beep' ) ); ```javascript -var isError = require( '@stdlib/assert/is-error' ); +const isError = require( '@stdlib/assert/is-error' ); -var bool = isError( new Error( 'error' ) ); +let bool = isError( new Error( 'error' ) ); // returns true bool = isError( new EvalError( 'eval error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-eval-error/README.md b/lib/node_modules/@stdlib/assert/is-eval-error/README.md index 4a6ddb5efdd0..121301fc582a 100644 --- a/lib/node_modules/@stdlib/assert/is-eval-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-eval-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isEvalError = require( '@stdlib/assert/is-eval-error' ); +const isEvalError = require( '@stdlib/assert/is-eval-error' ); ``` #### isEvalError( value ) @@ -45,7 +45,7 @@ var isEvalError = require( '@stdlib/assert/is-eval-error' ); Tests if a `value` is an [`EvalError`][mdn-eval-error] object. ```javascript -var bool = isEvalError( new EvalError( 'beep' ) ); +const bool = isEvalError( new EvalError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isEvalError( new EvalError( 'beep' ) ); ```javascript -var isEvalError = require( '@stdlib/assert/is-eval-error' ); +const isEvalError = require( '@stdlib/assert/is-eval-error' ); -var bool = isEvalError( new EvalError( 'eval error' ) ); +let bool = isEvalError( new EvalError( 'eval error' ) ); // returns true bool = isEvalError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-even/README.md b/lib/node_modules/@stdlib/assert/is-even/README.md index 78a654d49fe2..a812dc14f7dd 100644 --- a/lib/node_modules/@stdlib/assert/is-even/README.md +++ b/lib/node_modules/@stdlib/assert/is-even/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEven = require( '@stdlib/assert/is-even' ); +const isEven = require( '@stdlib/assert/is-even' ); ``` #### isEven( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an even `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isEven( 6.0 ); +let bool = isEven( 6.0 ); // returns true bool = isEven( new Number( 6.0 ) ); @@ -65,9 +65,9 @@ Tests if a `value` is a primitive even `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isEven.isPrimitive( -4.0 ); +let bool = isEven.isPrimitive( -4.0 ); // returns true bool = isEven.isPrimitive( new Number( -4.0 ) ); @@ -81,9 +81,9 @@ Tests if a `value` is a `Number` object having an even number value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isEven.isObject( 4.0 ); +let bool = isEven.isObject( 4.0 ); // returns false bool = isEven.isObject( new Number( 4.0 ) ); @@ -103,10 +103,10 @@ bool = isEven.isObject( new Number( 4.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isEven = require( '@stdlib/assert/is-even' ); +const Number = require( '@stdlib/number/ctor' ); +const isEven = require( '@stdlib/assert/is-even' ); -var bool = isEven( 4.0 ); +let bool = isEven( 4.0 ); // returns true bool = isEven( 0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-falsy-array/README.md b/lib/node_modules/@stdlib/assert/is-falsy-array/README.md index 7cd380c93538..f1642a8d8112 100644 --- a/lib/node_modules/@stdlib/assert/is-falsy-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-falsy-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFalsyArray = require( '@stdlib/assert/is-falsy-array' ); +const isFalsyArray = require( '@stdlib/assert/is-falsy-array' ); ``` #### isFalsyArray( value ) @@ -35,7 +35,7 @@ var isFalsyArray = require( '@stdlib/assert/is-falsy-array' ); Tests if a `value` is an array-like `object` containing only falsy values. ```javascript -var bool = isFalsyArray( [ '', null, void 0, false, 0, NaN ] ); +let bool = isFalsyArray( [ '', null, void 0, false, 0, NaN ] ); // returns true bool = isFalsyArray( [ [], {} ] ); @@ -53,9 +53,9 @@ bool = isFalsyArray( [ [], {} ] ); ```javascript -var isFalsyArray = require( '@stdlib/assert/is-falsy-array' ); +const isFalsyArray = require( '@stdlib/assert/is-falsy-array' ); -var bool = isFalsyArray( [ null, '', NaN, 0, void 0, false ] ); +let bool = isFalsyArray( [ null, '', NaN, 0, void 0, false ] ); // returns true bool = isFalsyArray( [ [], {}, true, 'a', 5, -5 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-falsy/README.md b/lib/node_modules/@stdlib/assert/is-falsy/README.md index 70f19eceb439..eab958890f80 100644 --- a/lib/node_modules/@stdlib/assert/is-falsy/README.md +++ b/lib/node_modules/@stdlib/assert/is-falsy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFalsy = require( '@stdlib/assert/is-falsy' ); +const isFalsy = require( '@stdlib/assert/is-falsy' ); ``` #### isFalsy( value ) @@ -35,7 +35,7 @@ var isFalsy = require( '@stdlib/assert/is-falsy' ); Tests if a `value` is a value which translates to `false` when evaluated in a boolean context. ```javascript -var bool = isFalsy( false ); +let bool = isFalsy( false ); // returns true bool = isFalsy( '' ); @@ -70,9 +70,9 @@ bool = isFalsy( [] ); ```javascript -var isFalsy = require( '@stdlib/assert/is-falsy' ); +const isFalsy = require( '@stdlib/assert/is-falsy' ); -var bool = isFalsy( false ); +let bool = isFalsy( false ); // returns true bool = isFalsy( 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-finite-array/README.md b/lib/node_modules/@stdlib/assert/is-finite-array/README.md index f4409640cf75..919742180e11 100644 --- a/lib/node_modules/@stdlib/assert/is-finite-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-finite-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFiniteArray = require( '@stdlib/assert/is-finite-array' ); +const isFiniteArray = require( '@stdlib/assert/is-finite-array' ); ``` #### isFiniteArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** finite `numbers`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFiniteArray( [ -3.0, new Number(3.0) ] ); +let bool = isFiniteArray( [ -3.0, new Number(3.0) ] ); // returns true bool = isFiniteArray( [ -3.0, 'abc' ] ); @@ -56,9 +56,9 @@ Tests if a `value` is an array-like object containing **only** primitive finite ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFiniteArray.primitives( [ -1.0, 0.0, 4.5 ] ); +let bool = isFiniteArray.primitives( [ -1.0, 0.0, 4.5 ] ); // returns true bool = isFiniteArray.primitives( [ -1.0, 1.0/0.0 ] ); @@ -75,9 +75,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFiniteArray.objects( [ new Number(-1.0), new Number(2.0) ] ); +let bool = isFiniteArray.objects( [ new Number(-1.0), new Number(2.0) ] ); // returns true bool = isFiniteArray.objects( [ -1.0, 0.0, 1.0 ] ); @@ -100,10 +100,10 @@ bool = isFiniteArray.objects( [ -3.0, new Number(1.0) ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isFiniteArray = require( '@stdlib/assert/is-finite-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isFiniteArray = require( '@stdlib/assert/is-finite-array' ); -var bool = isFiniteArray( [ -5.0, 0.0, 2.0, 5.0 ] ); +let bool = isFiniteArray( [ -5.0, 0.0, 2.0, 5.0 ] ); // returns true bool = isFiniteArray( [ -4.0, -3.14, 1.0, 3.14 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-finite/README.md b/lib/node_modules/@stdlib/assert/is-finite/README.md index 08b243840a5b..4cd64b0cf101 100644 --- a/lib/node_modules/@stdlib/assert/is-finite/README.md +++ b/lib/node_modules/@stdlib/assert/is-finite/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var isFinite = require( '@stdlib/assert/is-finite' ); +const isFinite = require( '@stdlib/assert/is-finite' ); ``` #### isFinite( value ) @@ -39,9 +39,9 @@ Tests if a value is a finite `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFinite( 5.0 ); +let bool = isFinite( 5.0 ); // returns true bool = isFinite( new Number( 5.0 ) ); @@ -61,9 +61,9 @@ Tests if a `value` is a primitive `number` having a finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFinite.isPrimitive( -3.0 ); +let bool = isFinite.isPrimitive( -3.0 ); // returns true bool = isFinite.isPrimitive( new Number( -3.0 ) ); @@ -77,9 +77,9 @@ Tests if a `value` is a `Number` object having a finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isFinite.isObject( 3.0 ); +let bool = isFinite.isObject( 3.0 ); // returns false bool = isFinite.isObject( new Number( 3.0 ) ); @@ -109,10 +109,10 @@ bool = isFinite.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isFinite = require( '@stdlib/assert/is-finite' ); +const Number = require( '@stdlib/number/ctor' ); +const isFinite = require( '@stdlib/assert/is-finite' ); -var bool = isFinite( -5.0 ); +let bool = isFinite( -5.0 ); // returns true bool = isFinite( 0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-float32array/README.md b/lib/node_modules/@stdlib/assert/is-float32array/README.md index d3e0ace2eb78..4dee86daf0cb 100644 --- a/lib/node_modules/@stdlib/assert/is-float32array/README.md +++ b/lib/node_modules/@stdlib/assert/is-float32array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat32Array = require( '@stdlib/assert/is-float32array' ); +const isFloat32Array = require( '@stdlib/assert/is-float32array' ); ``` #### isFloat32Array( value ) @@ -35,9 +35,9 @@ var isFloat32Array = require( '@stdlib/assert/is-float32array' ); Tests if a value is a [`Float32Array`][mdn-float32array]. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var bool = isFloat32Array( new Float32Array( 10 ) ); +let bool = isFloat32Array( new Float32Array( 10 ) ); // returns true bool = isFloat32Array( [] ); @@ -55,18 +55,18 @@ bool = isFloat32Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isFloat32Array = require( '@stdlib/assert/is-float32array' ); - -var bool = isFloat32Array( new Float32Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isFloat32Array = require( '@stdlib/assert/is-float32array' ); + +let bool = isFloat32Array( new Float32Array( 10 ) ); // returns true bool = isFloat32Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-float32matrix-like/README.md b/lib/node_modules/@stdlib/assert/is-float32matrix-like/README.md index 5e49a74a311d..94a6956de30a 100644 --- a/lib/node_modules/@stdlib/assert/is-float32matrix-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float32matrix-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat32MatrixLike = require( '@stdlib/assert/is-float32matrix-like' ); +const isFloat32MatrixLike = require( '@stdlib/assert/is-float32matrix-like' ); ``` #### isFloat32MatrixLike( value ) @@ -35,12 +35,12 @@ var isFloat32MatrixLike = require( '@stdlib/assert/is-float32matrix-like' ); Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float32`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isFloat32MatrixLike( arr ); +const bool = isFloat32MatrixLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat32MatrixLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var isFloat32MatrixLike = require( '@stdlib/assert/is-float32matrix-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const isFloat32MatrixLike = require( '@stdlib/assert/is-float32matrix-like' ); -var buffer = new Float32Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float32', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Float32Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float32', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isFloat32MatrixLike( arr ); +let out = isFloat32MatrixLike( arr ); // returns true out = isFloat32MatrixLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-float32ndarray-like/README.md b/lib/node_modules/@stdlib/assert/is-float32ndarray-like/README.md index 05cd34b3ce04..84dfb43cd73b 100644 --- a/lib/node_modules/@stdlib/assert/is-float32ndarray-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float32ndarray-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat32ndarrayLike = require( '@stdlib/assert/is-float32ndarray-like' ); +const isFloat32ndarrayLike = require( '@stdlib/assert/is-float32ndarray-like' ); ``` #### isFloat32ndarrayLike( value ) @@ -35,12 +35,12 @@ var isFloat32ndarrayLike = require( '@stdlib/assert/is-float32ndarray-like' ); Tests if a value is an [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float32`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isFloat32ndarrayLike( arr ); +const bool = isFloat32ndarrayLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat32ndarrayLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var isFloat32ndarrayLike = require( '@stdlib/assert/is-float32ndarray-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const isFloat32ndarrayLike = require( '@stdlib/assert/is-float32ndarray-like' ); -var buffer = new Float32Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float32', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Float32Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float32', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isFloat32ndarrayLike( arr ); +let out = isFloat32ndarrayLike( arr ); // returns true out = isFloat32ndarrayLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-float32vector-like/README.md b/lib/node_modules/@stdlib/assert/is-float32vector-like/README.md index 5a512f24951c..050c8e611cd3 100644 --- a/lib/node_modules/@stdlib/assert/is-float32vector-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float32vector-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' ); +const isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' ); ``` #### isFloat32VectorLike( value ) @@ -35,12 +35,12 @@ var isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' ); Tests if a value is a 1-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float32`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); +const arr = ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); -var bool = isFloat32VectorLike( arr ); +const bool = isFloat32VectorLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat32VectorLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' ); -var buffer = new Float32Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float32', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); +const buffer = new Float32Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float32', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); -var out = isFloat32VectorLike( arr ); +let out = isFloat32VectorLike( arr ); // returns true out = isFloat32VectorLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-float64array/README.md b/lib/node_modules/@stdlib/assert/is-float64array/README.md index 1ebe454944c2..34e26f3fb0ec 100644 --- a/lib/node_modules/@stdlib/assert/is-float64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-float64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +const isFloat64Array = require( '@stdlib/assert/is-float64array' ); ``` #### isFloat64Array( value ) @@ -35,9 +35,9 @@ var isFloat64Array = require( '@stdlib/assert/is-float64array' ); Tests if a value is a [`Float64Array`][mdn-float64array]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var bool = isFloat64Array( new Float64Array( 10 ) ); +let bool = isFloat64Array( new Float64Array( 10 ) ); // returns true bool = isFloat64Array( [] ); @@ -55,18 +55,18 @@ bool = isFloat64Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isFloat64Array = require( '@stdlib/assert/is-float64array' ); - -var bool = isFloat64Array( new Float64Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isFloat64Array = require( '@stdlib/assert/is-float64array' ); + +let bool = isFloat64Array( new Float64Array( 10 ) ); // returns true bool = isFloat64Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-float64matrix-like/README.md b/lib/node_modules/@stdlib/assert/is-float64matrix-like/README.md index f4e27620226e..786ada74e4aa 100644 --- a/lib/node_modules/@stdlib/assert/is-float64matrix-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float64matrix-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat64MatrixLike = require( '@stdlib/assert/is-float64matrix-like' ); +const isFloat64MatrixLike = require( '@stdlib/assert/is-float64matrix-like' ); ``` #### isFloat64MatrixLike( value ) @@ -35,12 +35,12 @@ var isFloat64MatrixLike = require( '@stdlib/assert/is-float64matrix-like' ); Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float64`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isFloat64MatrixLike( arr ); +const bool = isFloat64MatrixLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat64MatrixLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isFloat64MatrixLike = require( '@stdlib/assert/is-float64matrix-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isFloat64MatrixLike = require( '@stdlib/assert/is-float64matrix-like' ); -var buffer = new Float64Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Float64Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isFloat64MatrixLike( arr ); +let out = isFloat64MatrixLike( arr ); // returns true out = isFloat64MatrixLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-float64ndarray-like/README.md b/lib/node_modules/@stdlib/assert/is-float64ndarray-like/README.md index a2f204c241fc..d075eae0e67d 100644 --- a/lib/node_modules/@stdlib/assert/is-float64ndarray-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float64ndarray-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat64ndarrayLike = require( '@stdlib/assert/is-float64ndarray-like' ); +const isFloat64ndarrayLike = require( '@stdlib/assert/is-float64ndarray-like' ); ``` #### isFloat64ndarrayLike( value ) @@ -35,12 +35,12 @@ var isFloat64ndarrayLike = require( '@stdlib/assert/is-float64ndarray-like' ); Tests if a value is an [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float64`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isFloat64ndarrayLike( arr ); +const bool = isFloat64ndarrayLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat64ndarrayLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isFloat64ndarrayLike = require( '@stdlib/assert/is-float64ndarray-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isFloat64ndarrayLike = require( '@stdlib/assert/is-float64ndarray-like' ); -var buffer = new Float64Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const buffer = new Float64Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float64', buffer, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isFloat64ndarrayLike( arr ); +let out = isFloat64ndarrayLike( arr ); // returns true out = isFloat64ndarrayLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-float64vector-like/README.md b/lib/node_modules/@stdlib/assert/is-float64vector-like/README.md index 494d5411817e..240a7513ec7c 100644 --- a/lib/node_modules/@stdlib/assert/is-float64vector-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-float64vector-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' ); +const isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' ); ``` #### isFloat64VectorLike( value ) @@ -35,12 +35,12 @@ var isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' ); Tests if a value is a 1-dimensional [ndarray][@stdlib/ndarray/ctor]-like object whose underlying data type is `float64`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); +const arr = ndarray( 'float64', new Float64Array( [ 0, 0, 0, 0 ] ), [ 4 ], [ 1 ], 0, 'row-major' ); -var bool = isFloat64VectorLike( arr ); +const bool = isFloat64VectorLike( arr ); // returns true ``` @@ -55,14 +55,14 @@ var bool = isFloat64VectorLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' ); -var buffer = new Float64Array( [ 0, 0, 0, 0 ] ); -var arr = ndarray( 'float64', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); +const buffer = new Float64Array( [ 0, 0, 0, 0 ] ); +const arr = ndarray( 'float64', buffer, [ 4 ], [ 1 ], 0, 'row-major' ); -var out = isFloat64VectorLike( arr ); +let out = isFloat64VectorLike( arr ); // returns true out = isFloat64VectorLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-function-array/README.md b/lib/node_modules/@stdlib/assert/is-function-array/README.md index ae7f08cae9bb..dd898b82017e 100644 --- a/lib/node_modules/@stdlib/assert/is-function-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-function-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFunctionArray = require( '@stdlib/assert/is-function-array' ); +const isFunctionArray = require( '@stdlib/assert/is-function-array' ); ``` #### isFunctionArray( value ) @@ -43,7 +43,7 @@ function boop() { console.log( 'boop' ); } -var bool = isFunctionArray( [ beep, boop ] ); +const bool = isFunctionArray( [ beep, boop ] ); // returns true ``` @@ -58,7 +58,7 @@ var bool = isFunctionArray( [ beep, boop ] ); ```javascript -var isFunctionArray = require( '@stdlib/assert/is-function-array' ); +const isFunctionArray = require( '@stdlib/assert/is-function-array' ); function beep() { console.log( 'beep' ); @@ -68,7 +68,7 @@ function boop() { console.log( 'boop' ); } -var bool = isFunctionArray( [ beep, boop ] ); +let bool = isFunctionArray( [ beep, boop ] ); // returns true bool = isFunctionArray( [ beep, {} ] ); diff --git a/lib/node_modules/@stdlib/assert/is-function/README.md b/lib/node_modules/@stdlib/assert/is-function/README.md index 72b4260008a8..3a18dd7152fa 100644 --- a/lib/node_modules/@stdlib/assert/is-function/README.md +++ b/lib/node_modules/@stdlib/assert/is-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isFunction = require( '@stdlib/assert/is-function' ); +const isFunction = require( '@stdlib/assert/is-function' ); ``` #### isFunction( value ) @@ -39,7 +39,7 @@ function beep() { console.log( 'beep' ); } -var bool = isFunction( beep ); +const bool = isFunction( beep ); // returns true ``` @@ -56,9 +56,9 @@ var bool = isFunction( beep ); ```javascript -var isFunction = require( '@stdlib/assert/is-function' ); +const isFunction = require( '@stdlib/assert/is-function' ); -var bool = isFunction( function foo() {} ); +let bool = isFunction( function foo() {} ); // returns true bool = isFunction( 'beep' ); diff --git a/lib/node_modules/@stdlib/assert/is-generator-object-like/README.md b/lib/node_modules/@stdlib/assert/is-generator-object-like/README.md index a8bb99989a31..b09a935fa4ea 100644 --- a/lib/node_modules/@stdlib/assert/is-generator-object-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-generator-object-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' ); +const isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' ); ``` #### isGeneratorObjectLike( value ) @@ -37,12 +37,12 @@ Tests if a `value` is [`generator`][mdn-generator-object] object-like. ```javascript -var obj = { +const obj = { 'next': function noop() {}, 'return': function noop() {}, 'throw': function noop() {} }; -var bool = isGeneratorObjectLike( obj ); +let bool = isGeneratorObjectLike( obj ); // returns true bool = isGeneratorObjectLike( {} ); @@ -60,15 +60,15 @@ bool = isGeneratorObjectLike( {} ); ```javascript -var noop = require( '@stdlib/utils/noop' ); -var isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' ); +const noop = require( '@stdlib/utils/noop' ); +const isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' ); -var obj = { +const obj = { 'next': noop, 'return': noop, 'throw': noop }; -var bool = isGeneratorObjectLike( obj ); +let bool = isGeneratorObjectLike( obj ); // returns true bool = isGeneratorObjectLike( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-generator-object/README.md b/lib/node_modules/@stdlib/assert/is-generator-object/README.md index 099a7c5ad158..1631087b00a9 100644 --- a/lib/node_modules/@stdlib/assert/is-generator-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-generator-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isGeneratorObject = require( '@stdlib/assert/is-generator-object' ); +const isGeneratorObject = require( '@stdlib/assert/is-generator-object' ); ``` #### isGeneratorObject( value ) @@ -38,14 +38,14 @@ Tests if a `value` is a [`generator`][mdn-generator-object] object. ```javascript function* generateID() { - var idx = 0; + let idx = 0; while ( idx < idx+1 ) { yield idx; idx += 1; } } -var bool = isGeneratorObject( generateID() ); +let bool = isGeneratorObject( generateID() ); // returns true bool = isGeneratorObject( generateID ); @@ -68,7 +68,7 @@ bool = isGeneratorObject( {} ); ```javascript -var isGeneratorObject = require( '@stdlib/assert/is-generator-object' ); +const isGeneratorObject = require( '@stdlib/assert/is-generator-object' ); function* generator() { while ( true ) { @@ -76,7 +76,7 @@ function* generator() { } } -var bool = isGeneratorObject( generator() ); +let bool = isGeneratorObject( generator() ); // returns true bool = isGeneratorObject( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-gzip-buffer/README.md b/lib/node_modules/@stdlib/assert/is-gzip-buffer/README.md index 893b17fdde18..67740bed1d9b 100644 --- a/lib/node_modules/@stdlib/assert/is-gzip-buffer/README.md +++ b/lib/node_modules/@stdlib/assert/is-gzip-buffer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isgzipBuffer = require( '@stdlib/assert/is-gzip-buffer' ); +const isgzipBuffer = require( '@stdlib/assert/is-gzip-buffer' ); ``` #### isgzipBuffer( value ) @@ -35,14 +35,14 @@ var isgzipBuffer = require( '@stdlib/assert/is-gzip-buffer' ); Tests if a value is a [`gzip`][gzip-rfc-1952] buffer. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var buf = new Uint8Array( 20 ); +const buf = new Uint8Array( 20 ); buf[ 0 ] = 31; // 0x1f => magic number buf[ 1 ] = 139; // 0x8b buf[ 2 ] = 8; // 0x08 => compression method -var bool = isgzipBuffer( buf ); +let bool = isgzipBuffer( buf ); // returns true bool = isgzipBuffer( [] ); @@ -71,23 +71,23 @@ bool = isgzipBuffer( [] ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var isgzipBuffer = require( '@stdlib/assert/is-gzip-buffer' ); - -var buf = new Uint8Array( 20 ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const isgzipBuffer = require( '@stdlib/assert/is-gzip-buffer' ); + +const buf = new Uint8Array( 20 ); buf[ 0 ] = 31; // 0x1f => magic number buf[ 1 ] = 139; // 0x8b buf[ 2 ] = 8; // 0x08 => compression method -var bool = isgzipBuffer( buf ); +let bool = isgzipBuffer( buf ); // returns true bool = isgzipBuffer( new Float32Array( 20 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-hex-string/README.md b/lib/node_modules/@stdlib/assert/is-hex-string/README.md index 46c55e042956..39bfec61ec9f 100644 --- a/lib/node_modules/@stdlib/assert/is-hex-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-hex-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isHexString = require( '@stdlib/assert/is-hex-string' ); +const isHexString = require( '@stdlib/assert/is-hex-string' ); ``` #### isHexString( value ) @@ -35,7 +35,7 @@ var isHexString = require( '@stdlib/assert/is-hex-string' ); Tests whether a string contains only hexadecimal digits. ```javascript -var bool = isHexString( '0123456789abcdefABCDEF' ); +const bool = isHexString( '0123456789abcdefABCDEF' ); // returns true ``` @@ -61,9 +61,9 @@ var bool = isHexString( '0123456789abcdefABCDEF' ); ```javascript -var isHexString = require( '@stdlib/assert/is-hex-string' ); +const isHexString = require( '@stdlib/assert/is-hex-string' ); -var out = isHexString( '0123456789abcdefABCDEF' ); +let out = isHexString( '0123456789abcdefABCDEF' ); // returns true out = isHexString( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-infinite/README.md b/lib/node_modules/@stdlib/assert/is-infinite/README.md index f3012b90152c..f5d3d2fc917a 100644 --- a/lib/node_modules/@stdlib/assert/is-infinite/README.md +++ b/lib/node_modules/@stdlib/assert/is-infinite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInfinite = require( '@stdlib/assert/is-infinite' ); +const isInfinite = require( '@stdlib/assert/is-infinite' ); ``` #### isInfinite( value ) @@ -37,9 +37,9 @@ Tests if a value is an infinite `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInfinite( 1.0/0.0 ); +let bool = isInfinite( 1.0/0.0 ); // returns true bool = isInfinite( new Number( 1.0/0.0 ) ); @@ -59,9 +59,9 @@ Tests if a `value` is a primitive `number` having an infinite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInfinite.isPrimitive( -1.0/0.0 ); +let bool = isInfinite.isPrimitive( -1.0/0.0 ); // returns true bool = isInfinite.isPrimitive( new Number( -1.0/0.0 ) ); @@ -75,9 +75,9 @@ Tests if a `value` is a `Number` object having an infinite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInfinite.isObject( 1.0/0.0 ); +let bool = isInfinite.isObject( 1.0/0.0 ); // returns false bool = isInfinite.isObject( new Number( 1.0/0.0 ) ); @@ -103,10 +103,10 @@ bool = isInfinite.isObject( new Number( 1.0/0.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isInfinite = require( '@stdlib/assert/is-infinite' ); +const Number = require( '@stdlib/number/ctor' ); +const isInfinite = require( '@stdlib/assert/is-infinite' ); -var bool = isInfinite( 1.0/0.0 ); +let bool = isInfinite( 1.0/0.0 ); // returns true bool = isInfinite( -1.0/0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-inherited-property/README.md b/lib/node_modules/@stdlib/assert/is-inherited-property/README.md index dd3f904a684c..abd82b52e8a5 100644 --- a/lib/node_modules/@stdlib/assert/is-inherited-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-inherited-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInheritedProperty = require( '@stdlib/assert/is-inherited-property' ); +const isInheritedProperty = require( '@stdlib/assert/is-inherited-property' ); ``` #### isInheritedProperty( value, property ) @@ -35,11 +35,11 @@ var isInheritedProperty = require( '@stdlib/assert/is-inherited-property' ); Returns a `boolean` indicating if a `value` has an inherited `property`. ```javascript -var obj = { +const obj = { 'beep': 'boop' }; -var bool = isInheritedProperty( obj, 'beep' ); +let bool = isInheritedProperty( obj, 'beep' ); // returns false bool = isInheritedProperty( obj, 'hasOwnProperty' ); @@ -60,7 +60,7 @@ bool = isInheritedProperty( obj, 'bap' ); - The function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`. ```javascript - var bool = isInheritedProperty( null, 'a' ); + let bool = isInheritedProperty( null, 'a' ); // returns false bool = isInheritedProperty( void 0, 'a' ); @@ -70,7 +70,7 @@ bool = isInheritedProperty( obj, 'bap' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isInheritedProperty( 'beep', 'toString' ); + const bool = isInheritedProperty( 'beep', 'toString' ); // returns true ``` @@ -84,9 +84,9 @@ bool = isInheritedProperty( obj, 'bap' ); Foo.prototype.null = true; Foo.prototype[ '[object Object]' ] = true; - var obj = new Foo(); + const obj = new Foo(); - var bool = isInheritedProperty( obj, null ); + let bool = isInheritedProperty( obj, null ); // returns true bool = isInheritedProperty( obj, {} ); @@ -106,9 +106,9 @@ bool = isInheritedProperty( obj, 'bap' ); ```javascript -var isInheritedProperty = require( '@stdlib/assert/is-inherited-property' ); +const isInheritedProperty = require( '@stdlib/assert/is-inherited-property' ); -var bool = isInheritedProperty( {}, 'hasOwnProperty' ); +let bool = isInheritedProperty( {}, 'hasOwnProperty' ); // returns true bool = isInheritedProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-int16array/README.md b/lib/node_modules/@stdlib/assert/is-int16array/README.md index b2b4757fee39..142b069720d7 100644 --- a/lib/node_modules/@stdlib/assert/is-int16array/README.md +++ b/lib/node_modules/@stdlib/assert/is-int16array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInt16Array = require( '@stdlib/assert/is-int16array' ); +const isInt16Array = require( '@stdlib/assert/is-int16array' ); ``` #### isInt16Array( value ) @@ -35,9 +35,9 @@ var isInt16Array = require( '@stdlib/assert/is-int16array' ); Tests if a value is an [`Int16Array`][mdn-int16array]. ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); -var bool = isInt16Array( new Int16Array( 10 ) ); +let bool = isInt16Array( new Int16Array( 10 ) ); // returns true bool = isInt16Array( [] ); @@ -55,18 +55,18 @@ bool = isInt16Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isInt16Array = require( '@stdlib/assert/is-int16array' ); - -var bool = isInt16Array( new Int16Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isInt16Array = require( '@stdlib/assert/is-int16array' ); + +let bool = isInt16Array( new Int16Array( 10 ) ); // returns true bool = isInt16Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-int32array/README.md b/lib/node_modules/@stdlib/assert/is-int32array/README.md index 7f3891d64055..91c330a01ef9 100644 --- a/lib/node_modules/@stdlib/assert/is-int32array/README.md +++ b/lib/node_modules/@stdlib/assert/is-int32array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInt32Array = require( '@stdlib/assert/is-int32array' ); +const isInt32Array = require( '@stdlib/assert/is-int32array' ); ``` #### isInt32Array( value ) @@ -35,9 +35,9 @@ var isInt32Array = require( '@stdlib/assert/is-int32array' ); Tests if a value is an [`Int32Array`][mdn-int32array]. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); -var bool = isInt32Array( new Int32Array( 10 ) ); +let bool = isInt32Array( new Int32Array( 10 ) ); // returns true bool = isInt32Array( [] ); @@ -55,18 +55,18 @@ bool = isInt32Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isInt32Array = require( '@stdlib/assert/is-int32array' ); - -var bool = isInt32Array( new Int32Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isInt32Array = require( '@stdlib/assert/is-int32array' ); + +let bool = isInt32Array( new Int32Array( 10 ) ); // returns true bool = isInt32Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-int8array/README.md b/lib/node_modules/@stdlib/assert/is-int8array/README.md index 7d7ed54354c6..2f82565a8441 100644 --- a/lib/node_modules/@stdlib/assert/is-int8array/README.md +++ b/lib/node_modules/@stdlib/assert/is-int8array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInt8Array = require( '@stdlib/assert/is-int8array' ); +const isInt8Array = require( '@stdlib/assert/is-int8array' ); ``` #### isInt8Array( value ) @@ -35,9 +35,9 @@ var isInt8Array = require( '@stdlib/assert/is-int8array' ); Tests if a value is an [`Int8Array`][mdn-int8array]. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var bool = isInt8Array( new Int8Array( 10 ) ); +let bool = isInt8Array( new Int8Array( 10 ) ); // returns true bool = isInt8Array( [] ); @@ -55,18 +55,18 @@ bool = isInt8Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isInt8Array = require( '@stdlib/assert/is-int8array' ); - -var bool = isInt8Array( new Int8Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isInt8Array = require( '@stdlib/assert/is-int8array' ); + +let bool = isInt8Array( new Int8Array( 10 ) ); // returns true bool = isInt8Array( new Uint8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-integer-array/README.md index 46698c3470db..4355bf91244a 100644 --- a/lib/node_modules/@stdlib/assert/is-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isIntegerArray = require( '@stdlib/assert/is-integer-array' ); +const isIntegerArray = require( '@stdlib/assert/is-integer-array' ); ``` #### isIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** `integer` values. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isIntegerArray( [ -3, new Number(3) ] ); +let bool = isIntegerArray( [ -3, new Number(3) ] ); // returns true bool = isIntegerArray( [ -3, 'abc' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object containing **only** primitive `intege ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isIntegerArray.primitives( [ -1.0, 0.0, 4.0 ] ); +let bool = isIntegerArray.primitives( [ -1.0, 0.0, 4.0 ] ); // returns true bool = isIntegerArray.primitives( [ -1.0, 2.2 ] ); @@ -72,9 +72,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isIntegerArray.objects( [ new Number(-1.0), new Number(2.0) ] ); +let bool = isIntegerArray.objects( [ new Number(-1.0), new Number(2.0) ] ); // returns true bool = isIntegerArray.objects( [ -1.0, 0.0, 1.0 ] ); @@ -97,10 +97,10 @@ bool = isIntegerArray.objects( [ -3.0, new Number(1.0) ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isIntegerArray = require( '@stdlib/assert/is-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isIntegerArray = require( '@stdlib/assert/is-integer-array' ); -var bool = isIntegerArray( [ -5, 0, 2, 5 ] ); +let bool = isIntegerArray( [ -5, 0, 2, 5 ] ); // returns true bool = isIntegerArray( [ -4, -3, 1, 3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-integer/README.md b/lib/node_modules/@stdlib/assert/is-integer/README.md index e19da0533882..8104b182a11f 100644 --- a/lib/node_modules/@stdlib/assert/is-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInteger = require( '@stdlib/assert/is-integer' ); +const isInteger = require( '@stdlib/assert/is-integer' ); ``` #### isInteger( value ) @@ -37,9 +37,9 @@ Tests if a value is a `number` having an `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInteger( 5.0 ); +let bool = isInteger( 5.0 ); // returns true bool = isInteger( new Number( 5.0 ) ); @@ -59,9 +59,9 @@ Tests if a `value` is a primitive `number` having an `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInteger.isPrimitive( -3.0 ); +let bool = isInteger.isPrimitive( -3.0 ); // returns true bool = isInteger.isPrimitive( new Number( -3.0 ) ); @@ -75,9 +75,9 @@ Tests if a `value` is a `Number` object having an `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isInteger.isObject( 3.0 ); +let bool = isInteger.isObject( 3.0 ); // returns false bool = isInteger.isObject( new Number( 3.0 ) ); @@ -97,10 +97,10 @@ bool = isInteger.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isInteger = require( '@stdlib/assert/is-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isInteger = require( '@stdlib/assert/is-integer' ); -var bool = isInteger( -5.0 ); +let bool = isInteger( -5.0 ); // returns true bool = isInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-iterable-like/README.md b/lib/node_modules/@stdlib/assert/is-iterable-like/README.md index 464051708444..3a1fa6afce4f 100644 --- a/lib/node_modules/@stdlib/assert/is-iterable-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-iterable-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isIterableLike = require( '@stdlib/assert/is-iterable-like' ); +const isIterableLike = require( '@stdlib/assert/is-iterable-like' ); ``` #### isIterableLike( value ) @@ -35,7 +35,7 @@ var isIterableLike = require( '@stdlib/assert/is-iterable-like' ); Tests if a `value` is [`iterable`][mdn-iterator-protocol]-like. ```javascript -var bool = isIterableLike( [] ); +let bool = isIterableLike( [] ); // returns bool = isIterableLike( {} ); @@ -66,9 +66,9 @@ bool = isIterableLike( {} ); ```javascript -var isIterableLike = require( '@stdlib/assert/is-iterable-like' ); +const isIterableLike = require( '@stdlib/assert/is-iterable-like' ); -var bool = isIterableLike( [] ); +let bool = isIterableLike( [] ); // returns bool = isIterableLike( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-iterator-like/README.md b/lib/node_modules/@stdlib/assert/is-iterator-like/README.md index 4c38c162d1fc..782199f23958 100644 --- a/lib/node_modules/@stdlib/assert/is-iterator-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-iterator-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +const isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); ``` #### isIteratorLike( value ) @@ -37,10 +37,10 @@ Tests if a `value` is [`iterator`][mdn-iterator-protocol]-like. ```javascript -var obj = { +const obj = { 'next': function noop() {} }; -var bool = isIteratorLike( obj ); +let bool = isIteratorLike( obj ); // returns true bool = isIteratorLike( {} ); @@ -69,13 +69,13 @@ bool = isIteratorLike( {} ); ```javascript -var noop = require( '@stdlib/utils/noop' ); -var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +const noop = require( '@stdlib/utils/noop' ); +const isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); -var obj = { +const obj = { 'next': noop }; -var bool = isIteratorLike( obj ); +let bool = isIteratorLike( obj ); // returns true bool = isIteratorLike( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-json/README.md b/lib/node_modules/@stdlib/assert/is-json/README.md index 1a659312f4ca..233eebda7295 100644 --- a/lib/node_modules/@stdlib/assert/is-json/README.md +++ b/lib/node_modules/@stdlib/assert/is-json/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isJSON = require( '@stdlib/assert/is-json' ); +const isJSON = require( '@stdlib/assert/is-json' ); ``` #### isJSON( value ) @@ -35,9 +35,9 @@ var isJSON = require( '@stdlib/assert/is-json' ); Tests if a `value` is a parseable JSON `string`. ```javascript -var value = '{"a":5}'; +const value = '{"a":5}'; -var bool = isJSON( value ); +const bool = isJSON( value ); // returns true ``` @@ -70,9 +70,9 @@ var bool = isJSON( value ); ```javascript -var isJSON = require( '@stdlib/assert/is-json' ); +const isJSON = require( '@stdlib/assert/is-json' ); -var bool = isJSON( '{"a":5}' ); +let bool = isJSON( '{"a":5}' ); // returns true bool = isJSON( '{a":5}' ); diff --git a/lib/node_modules/@stdlib/assert/is-kebabcase/README.md b/lib/node_modules/@stdlib/assert/is-kebabcase/README.md index 4008dce37120..c8add21aecf2 100644 --- a/lib/node_modules/@stdlib/assert/is-kebabcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-kebabcase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isKebabcase = require( '@stdlib/assert/is-kebabcase' ); +const isKebabcase = require( '@stdlib/assert/is-kebabcase' ); ``` #### isKebabcase( value ) @@ -35,7 +35,7 @@ var isKebabcase = require( '@stdlib/assert/is-kebabcase' ); Tests if a `value` is a `string` in kebab case. ```javascript -var bool = isKebabcase( 'beep-boop' ); +let bool = isKebabcase( 'beep-boop' ); // returns true bool = isKebabcase( 'BEEP_BOOP' ); @@ -63,9 +63,9 @@ bool = isKebabcase( 'BEEP_BOOP' ); ```javascript -var isKebabcase = require( '@stdlib/assert/is-kebabcase' ); +const isKebabcase = require( '@stdlib/assert/is-kebabcase' ); -var bool = isKebabcase( 'beep-boop' ); +let bool = isKebabcase( 'beep-boop' ); // returns true bool = isKebabcase( 'BEEP_BOOP' ); diff --git a/lib/node_modules/@stdlib/assert/is-leap-year/README.md b/lib/node_modules/@stdlib/assert/is-leap-year/README.md index 2fca744204ec..84567d5641cd 100644 --- a/lib/node_modules/@stdlib/assert/is-leap-year/README.md +++ b/lib/node_modules/@stdlib/assert/is-leap-year/README.md @@ -29,7 +29,7 @@ A [leap year][leap-year] is defined as any year which is exactly divisible by `4 ## Usage ```javascript -var isLeapYear = require( '@stdlib/assert/is-leap-year' ); +const isLeapYear = require( '@stdlib/assert/is-leap-year' ); ``` #### isLeapYear( \[value] ) @@ -37,7 +37,7 @@ var isLeapYear = require( '@stdlib/assert/is-leap-year' ); Tests if a `value` corresponds to a [leap year][leap-year] in the [Gregorian calendar][gregorian-calendar]. ```javascript -var bool = isLeapYear(); +let bool = isLeapYear(); // returns bool = isLeapYear( new Date() ); @@ -63,7 +63,7 @@ bool = isLeapYear( 2017 ); - If provided a `value` which is neither an integer value nor a [`Date`][date-object], the function **always** returns `false`. ```javascript - var bool = isLeapYear( '2016' ); + let bool = isLeapYear( '2016' ); // returns false bool = isLeapYear( null ); @@ -81,13 +81,10 @@ bool = isLeapYear( 2017 ); ```javascript -var isLeapYear = require( '@stdlib/assert/is-leap-year' ); +const isLeapYear = require( '@stdlib/assert/is-leap-year' ); -var bool; -var i; - -for ( i = 0; i < 2021; i++ ) { - bool = isLeapYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const bool = isLeapYear( i ); console.log( 'The year %d %s a leap year.', i, ( bool ) ? 'is' : 'is not' ); } ``` diff --git a/lib/node_modules/@stdlib/assert/is-little-endian/README.md b/lib/node_modules/@stdlib/assert/is-little-endian/README.md index c4deeadbffd1..73ae355eb5cc 100644 --- a/lib/node_modules/@stdlib/assert/is-little-endian/README.md +++ b/lib/node_modules/@stdlib/assert/is-little-endian/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); ``` #### IS_LITTLE_ENDIAN @@ -35,7 +35,7 @@ var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); `Boolean` indicating if an environment is [little endian][endianness]. ```javascript -var bool = IS_LITTLE_ENDIAN; +const bool = IS_LITTLE_ENDIAN; // returns ``` @@ -50,7 +50,7 @@ var bool = IS_LITTLE_ENDIAN; ```javascript -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); console.log( IS_LITTLE_ENDIAN ); // => diff --git a/lib/node_modules/@stdlib/assert/is-localhost/README.md b/lib/node_modules/@stdlib/assert/is-localhost/README.md index bc4278a9eda4..a4b853cb8389 100644 --- a/lib/node_modules/@stdlib/assert/is-localhost/README.md +++ b/lib/node_modules/@stdlib/assert/is-localhost/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isLocalhost = require( '@stdlib/assert/is-localhost' ); +const isLocalhost = require( '@stdlib/assert/is-localhost' ); ``` #### isLocalhost( value ) @@ -45,7 +45,7 @@ var isLocalhost = require( '@stdlib/assert/is-localhost' ); Tests whether a value is a localhost hostname. ```javascript -var bool = isLocalhost( 'localhost' ); +let bool = isLocalhost( 'localhost' ); // returns true bool = isLocalhost( 'stdlib.io' ); @@ -73,9 +73,9 @@ bool = isLocalhost( 'stdlib.io' ); ```javascript -var isLocalhost = require( '@stdlib/assert/is-localhost' ); +const isLocalhost = require( '@stdlib/assert/is-localhost' ); -var bool = isLocalhost( 'localhost' ); +let bool = isLocalhost( 'localhost' ); // returns true bool = isLocalhost( '127.0.0.1' ); diff --git a/lib/node_modules/@stdlib/assert/is-lowercase/README.md b/lib/node_modules/@stdlib/assert/is-lowercase/README.md index f166a0fd7a4b..7494ba53dab6 100644 --- a/lib/node_modules/@stdlib/assert/is-lowercase/README.md +++ b/lib/node_modules/@stdlib/assert/is-lowercase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isLowercase = require( '@stdlib/assert/is-lowercase' ); +const isLowercase = require( '@stdlib/assert/is-lowercase' ); ``` #### isLowercase( value ) @@ -35,7 +35,7 @@ var isLowercase = require( '@stdlib/assert/is-lowercase' ); Tests if a `value` is a lowercase `string`. ```javascript -var bool = isLowercase( 'salt and light' ); +let bool = isLowercase( 'salt and light' ); // returns true bool = isLowercase( 'HELLO' ); @@ -66,9 +66,9 @@ bool = isLowercase( 'World' ); ```javascript -var isLowercase = require( '@stdlib/assert/is-lowercase' ); +const isLowercase = require( '@stdlib/assert/is-lowercase' ); -var bool = isLowercase( 'hello' ); +let bool = isLowercase( 'hello' ); // returns true bool = isLowercase( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-matrix-like/README.md b/lib/node_modules/@stdlib/assert/is-matrix-like/README.md index c20adf7f218e..3a9a5d02051b 100644 --- a/lib/node_modules/@stdlib/assert/is-matrix-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-matrix-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isMatrixLike = require( '@stdlib/assert/is-matrix-like' ); +const isMatrixLike = require( '@stdlib/assert/is-matrix-like' ); ``` #### isMatrixLike( value ) @@ -35,10 +35,10 @@ var isMatrixLike = require( '@stdlib/assert/is-matrix-like' ); Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isMatrixLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isMatrixLike( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isMatrixLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isMatrixLike = require( '@stdlib/assert/is-matrix-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isMatrixLike = require( '@stdlib/assert/is-matrix-like' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isMatrixLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isMatrixLike( arr ); // returns true out = isMatrixLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-method-in/README.md b/lib/node_modules/@stdlib/assert/is-method-in/README.md index 28c755c434b9..2105b82df5fa 100644 --- a/lib/node_modules/@stdlib/assert/is-method-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-method-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isMethodIn = require( '@stdlib/assert/is-method-in' ); +const isMethodIn = require( '@stdlib/assert/is-method-in' ); ``` #### isMethodIn( value, property ) @@ -35,11 +35,11 @@ var isMethodIn = require( '@stdlib/assert/is-method-in' ); Returns a `boolean` indicating if a `value` has a specified method name, either own or inherited. ```javascript -var value = { +const value = { 'beep': 'boop' }; -var bool = isMethodIn( value, 'toString' ); +let bool = isMethodIn( value, 'toString' ); // returns true bool = isMethodIn( value, 'beep' ); @@ -60,7 +60,7 @@ bool = isMethodIn( value, 'bap' ); - The function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`. ```javascript - var bool = isMethodIn( null, 'toString' ); + let bool = isMethodIn( null, 'toString' ); // returns false bool = isMethodIn( void 0, 'toString' ); @@ -70,7 +70,7 @@ bool = isMethodIn( value, 'bap' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isMethodIn( 'beep', 'toString' ); + const bool = isMethodIn( 'beep', 'toString' ); // returns true ``` @@ -81,10 +81,10 @@ bool = isMethodIn( value, 'bap' ); // Example function... } - var value = { + let value = { 'null': noop }; - var bool = isMethodIn( value, null ); + let bool = isMethodIn( value, null ); // returns true value = { @@ -107,9 +107,9 @@ bool = isMethodIn( value, 'bap' ); ```javascript -var isMethodIn = require( '@stdlib/assert/is-method-in' ); +const isMethodIn = require( '@stdlib/assert/is-method-in' ); -var bool = isMethodIn( {}, 'toString' ); +let bool = isMethodIn( {}, 'toString' ); // returns true bool = isMethodIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-method/README.md b/lib/node_modules/@stdlib/assert/is-method/README.md index f3e5a39cfac1..7e8523cb89d6 100644 --- a/lib/node_modules/@stdlib/assert/is-method/README.md +++ b/lib/node_modules/@stdlib/assert/is-method/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isMethod = require( '@stdlib/assert/is-method' ); +const isMethod = require( '@stdlib/assert/is-method' ); ``` #### isMethod( value, property ) @@ -39,11 +39,11 @@ function noop() { // Example function... } -var value = { +const value = { 'beep': noop }; -var bool = isMethod( value, 'beep' ); +let bool = isMethod( value, 'beep' ); // returns true bool = isMethod( value, 'toString' ); @@ -61,7 +61,7 @@ bool = isMethod( value, 'toString' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isMethod( 'beep', 'toString' ); + const bool = isMethod( 'beep', 'toString' ); // returns false ``` @@ -72,10 +72,10 @@ bool = isMethod( value, 'toString' ); // Example function... } - var value = { + let value = { 'null': noop }; - var bool = isMethod( value, null ); + let bool = isMethod( value, null ); // returns true value = { @@ -100,9 +100,9 @@ bool = isMethod( value, 'toString' ); ```javascript -var isMethod = require( '@stdlib/assert/is-method' ); +const isMethod = require( '@stdlib/assert/is-method' ); -var bool = isMethod( { 'a': isMethod }, 'a' ); +let bool = isMethod( { 'a': isMethod }, 'a' ); // returns true bool = isMethod( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-mobile/README.md b/lib/node_modules/@stdlib/assert/is-mobile/README.md index dc45dd64decb..9e13aef3d6ea 100644 --- a/lib/node_modules/@stdlib/assert/is-mobile/README.md +++ b/lib/node_modules/@stdlib/assert/is-mobile/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_MOBILE = require( '@stdlib/assert/is-mobile' ); +const IS_MOBILE = require( '@stdlib/assert/is-mobile' ); ``` #### IS_MOBILE @@ -35,7 +35,7 @@ var IS_MOBILE = require( '@stdlib/assert/is-mobile' ); `Boolean` indicating if the current environment is a mobile device. ```javascript -var bool = IS_MOBILE; +const bool = IS_MOBILE; // returns ``` @@ -60,7 +60,7 @@ var bool = IS_MOBILE; ```javascript -var IS_MOBILE = require( '@stdlib/assert/is-mobile' ); +const IS_MOBILE = require( '@stdlib/assert/is-mobile' ); console.log( IS_MOBILE ); // => diff --git a/lib/node_modules/@stdlib/assert/is-multi-slice/README.md b/lib/node_modules/@stdlib/assert/is-multi-slice/README.md index 556fbd5caff8..b94436a9238f 100644 --- a/lib/node_modules/@stdlib/assert/is-multi-slice/README.md +++ b/lib/node_modules/@stdlib/assert/is-multi-slice/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isMultiSlice = require( '@stdlib/assert/is-multi-slice' ); +const isMultiSlice = require( '@stdlib/assert/is-multi-slice' ); ``` #### isMultiSlice( value ) @@ -35,11 +35,11 @@ var isMultiSlice = require( '@stdlib/assert/is-multi-slice' ); Tests if a value is a [`MultiSlice`][@stdlib/slice/multi]. ```javascript -var MultiSlice = require( '@stdlib/slice/multi' ); +const MultiSlice = require( '@stdlib/slice/multi' ); -var s = new MultiSlice(); +const s = new MultiSlice(); -var bool = isMultiSlice( s ); +const bool = isMultiSlice( s ); // returns true ``` @@ -54,11 +54,11 @@ var bool = isMultiSlice( s ); ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var isMultiSlice = require( '@stdlib/assert/is-multi-slice' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const isMultiSlice = require( '@stdlib/assert/is-multi-slice' ); -var out = isMultiSlice( new MultiSlice() ); +let out = isMultiSlice( new MultiSlice() ); // returns true out = isMultiSlice( new Slice( 0, 10, 1 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-named-typed-tuple-like/README.md b/lib/node_modules/@stdlib/assert/is-named-typed-tuple-like/README.md index 25c64506beb2..92514a84693e 100644 --- a/lib/node_modules/@stdlib/assert/is-named-typed-tuple-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-named-typed-tuple-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNamedTypedTupleLike = require( '@stdlib/assert/is-named-typed-tuple-like' ); +const isNamedTypedTupleLike = require( '@stdlib/assert/is-named-typed-tuple-like' ); ``` #### isNamedTypedTupleLike( value ) @@ -35,12 +35,12 @@ var isNamedTypedTupleLike = require( '@stdlib/assert/is-named-typed-tuple-like' Tests if a value is [named typed tuple][@stdlib/utils/named-typed-tuple]-like. ```javascript -var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); +const namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); -var Point = namedtypedtuple( [ 'x', 'y' ] ); -var p = new Point(); +const Point = namedtypedtuple( [ 'x', 'y' ] ); +const p = new Point(); -var bool = isNamedTypedTupleLike( p ); +const bool = isNamedTypedTupleLike( p ); // returns true ``` @@ -55,13 +55,13 @@ var bool = isNamedTypedTupleLike( p ); ```javascript -var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); -var isNamedTypedTupleLike = require( '@stdlib/assert/is-named-typed-tuple-like' ); +const namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); +const isNamedTypedTupleLike = require( '@stdlib/assert/is-named-typed-tuple-like' ); -var Point = namedtypedtuple( [ 'x', 'y' ] ); -var p = new Point(); +const Point = namedtypedtuple( [ 'x', 'y' ] ); +const p = new Point(); -var bool = isNamedTypedTupleLike( p ); +let bool = isNamedTypedTupleLike( p ); // returns true bool = isNamedTypedTupleLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nan-array/README.md b/lib/node_modules/@stdlib/assert/is-nan-array/README.md index 51d0d5c87c54..649bda03456e 100644 --- a/lib/node_modules/@stdlib/assert/is-nan-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-nan-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNaNArray = require( '@stdlib/assert/is-nan-array' ); +const isNaNArray = require( '@stdlib/assert/is-nan-array' ); ``` #### isNaNArray( value ) @@ -35,7 +35,7 @@ var isNaNArray = require( '@stdlib/assert/is-nan-array' ); Tests if a `value` is an array-like object containing **only** `NaN` values. ```javascript -var bool = isNaNArray( [ NaN, NaN, NaN ] ); +let bool = isNaNArray( [ NaN, NaN, NaN ] ); // returns true bool = isNaNArray( [ NaN, 2 ] ); @@ -49,9 +49,9 @@ Tests if a `value` is an array-like object containing **only** primitive `NaN` v ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNaNArray.primitives( [ NaN, NaN, NaN ] ); +let bool = isNaNArray.primitives( [ NaN, NaN, NaN ] ); // returns true bool = isNaNArray.primitives( [ NaN, new Number( NaN ) ] ); @@ -65,9 +65,9 @@ Tests if a `value` is an array-like object containing **only** object `NaN` valu ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNaNArray.objects( [ new Number( NaN ), new Number( NaN ) ] ); +let bool = isNaNArray.objects( [ new Number( NaN ), new Number( NaN ) ] ); // returns true bool = isNaNArray.objects( [ NaN, new Number( NaN ) ] ); @@ -90,11 +90,11 @@ bool = isNaNArray.objects( [ NaN, NaN, NaN ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isNaNArray = require( '@stdlib/assert/is-nan-array' ); +const Number = require( '@stdlib/number/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isNaNArray = require( '@stdlib/assert/is-nan-array' ); -var bool = isNaNArray( [ NaN ] ); +let bool = isNaNArray( [ NaN ] ); // returns true bool = isNaNArray( [ NaN, NaN, NaN ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nan/README.md b/lib/node_modules/@stdlib/assert/is-nan/README.md index 2aec671ccb6d..64480a8f8891 100644 --- a/lib/node_modules/@stdlib/assert/is-nan/README.md +++ b/lib/node_modules/@stdlib/assert/is-nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isnan = require( '@stdlib/assert/is-nan' ); +const isnan = require( '@stdlib/assert/is-nan' ); ``` #### isnan( value ) @@ -37,9 +37,9 @@ Tests if a `value` is `NaN`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isnan( NaN ); +let bool = isnan( NaN ); // returns true bool = isnan( new Number( NaN ) ); @@ -59,9 +59,9 @@ Tests if a `value` is a `NaN` primitive `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isnan.isPrimitive( NaN ); +let bool = isnan.isPrimitive( NaN ); // returns true bool = isnan.isPrimitive( 3.14 ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a value of `NaN`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isnan.isObject( NaN ); +let bool = isnan.isObject( NaN ); // returns false bool = isnan.isObject( new Number( NaN ) ); @@ -100,11 +100,11 @@ bool = isnan.isObject( new Number( NaN ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var isnan = require( '@stdlib/assert/is-nan' ); +const Number = require( '@stdlib/number/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const isnan = require( '@stdlib/assert/is-nan' ); -var bool = isnan( NaN ); +let bool = isnan( NaN ); // returns true bool = isnan( new Number( NaN ) ); diff --git a/lib/node_modules/@stdlib/assert/is-native-function/README.md b/lib/node_modules/@stdlib/assert/is-native-function/README.md index a8a032fdbf9f..ae1f2cb28a3a 100644 --- a/lib/node_modules/@stdlib/assert/is-native-function/README.md +++ b/lib/node_modules/@stdlib/assert/is-native-function/README.md @@ -35,7 +35,7 @@ Native functions execute native code that is typically not written in JavaScript ## Usage ```javascript -var isNativeFunction = require( '@stdlib/assert/is-native-function' ); +const isNativeFunction = require( '@stdlib/assert/is-native-function' ); ``` #### isNativeFunction( value ) @@ -43,7 +43,7 @@ var isNativeFunction = require( '@stdlib/assert/is-native-function' ); Tests if a `value` is a native `function`. ```javascript -var bool = isNativeFunction( Date ); +let bool = isNativeFunction( Date ); // returns true function beep() { @@ -67,9 +67,9 @@ bool = isNativeFunction( beep ); ```javascript -var isNativeFunction = require( '@stdlib/assert/is-native-function' ); +const isNativeFunction = require( '@stdlib/assert/is-native-function' ); -var bool = isNativeFunction( Math.sqrt ); +let bool = isNativeFunction( Math.sqrt ); // returns true bool = isNativeFunction( Date ); diff --git a/lib/node_modules/@stdlib/assert/is-ndarray-like-with-data-type/README.md b/lib/node_modules/@stdlib/assert/is-ndarray-like-with-data-type/README.md index 60e93a6aaa99..71b4b08debac 100644 --- a/lib/node_modules/@stdlib/assert/is-ndarray-like-with-data-type/README.md +++ b/lib/node_modules/@stdlib/assert/is-ndarray-like-with-data-type/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isndarrayLikeWithDataType = require( '@stdlib/assert/is-ndarray-like-with-data-type' ); +const isndarrayLikeWithDataType = require( '@stdlib/assert/is-ndarray-like-with-data-type' ); ``` #### isndarrayLikeWithDataType( value, dtype ) @@ -35,10 +35,10 @@ var isndarrayLikeWithDataType = require( '@stdlib/assert/is-ndarray-like-with-da Tests if a value is an [ndarray-like object][@stdlib/assert/is-ndarray-like] having a specified [data type][@stdlib/ndarray/dtypes]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isndarrayLikeWithDataType( arr, 'generic' ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isndarrayLikeWithDataType( arr, 'generic' ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isndarrayLikeWithDataType( arr, 'generic' ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isndarrayLikeWithDataType = require( '@stdlib/assert/is-ndarray-like-with-data-type' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isndarrayLikeWithDataType = require( '@stdlib/assert/is-ndarray-like-with-data-type' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isndarrayLikeWithDataType( arr, 'generic' ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let bool = isndarrayLikeWithDataType( arr, 'generic' ); // returns true bool = isndarrayLikeWithDataType( [ 1, 2, 3, 4 ], 'generic' ); diff --git a/lib/node_modules/@stdlib/assert/is-ndarray-like/README.md b/lib/node_modules/@stdlib/assert/is-ndarray-like/README.md index 289b640881dd..f89f65b6a774 100644 --- a/lib/node_modules/@stdlib/assert/is-ndarray-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-ndarray-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +const isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); ``` #### isndarrayLike( value ) @@ -35,10 +35,10 @@ var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); Tests if a value is [ndarray][@stdlib/ndarray/ctor]-like. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isndarrayLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isndarrayLike( arr ); // returns true ``` @@ -67,11 +67,11 @@ A value is [ndarray][@stdlib/ndarray/ctor]-like if a value is an `object` with t ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isndarrayLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let bool = isndarrayLike( arr ); // returns true bool = isndarrayLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-finite/README.md b/lib/node_modules/@stdlib/assert/is-negative-finite/README.md index 85787a3c5767..7da4cef053dc 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-finite/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ); +const isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ); ``` #### isNegativeFinite( value ) @@ -37,9 +37,9 @@ Tests if a value is a number having a finite negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeFinite( -5.0 ); +let bool = isNegativeFinite( -5.0 ); // returns true bool = isNegativeFinite( new Number( -5.0 ) ); @@ -65,9 +65,9 @@ Tests if a value is a primitive number having a finite negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeFinite.isPrimitive( -3.0 ); +let bool = isNegativeFinite.isPrimitive( -3.0 ); // returns true bool = isNegativeFinite.isPrimitive( new Number( -3.0 ) ); @@ -81,9 +81,9 @@ Tests if a value is a `Number` object having a finite negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeFinite.isObject( -3.0 ); +let bool = isNegativeFinite.isObject( -3.0 ); // returns false bool = isNegativeFinite.isObject( new Number( -3.0 ) ); @@ -103,10 +103,10 @@ bool = isNegativeFinite.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ); +const Number = require( '@stdlib/number/ctor' ); +const isNegativeFinite = require( '@stdlib/assert/is-negative-finite' ); -var bool = isNegativeFinite( -5.0 ); +let bool = isNegativeFinite( -5.0 ); // returns true bool = isNegativeFinite( new Number( -5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-negative-integer-array/README.md index abf0875b2c69..2f3cbd2d3a73 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' ); +const isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' ); ``` #### isNegativeIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** negative `integer ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeIntegerArray( [ -3, new Number(-3) ] ); +let bool = isNegativeIntegerArray( [ -3, new Number(-3) ] ); // returns true bool = isNegativeIntegerArray( [ -3, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object containing **only** negative primitiv ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeIntegerArray.primitives( [ -1.0, -10.0 ] ); +let bool = isNegativeIntegerArray.primitives( [ -1.0, -10.0 ] ); // returns true bool = isNegativeIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] ); @@ -72,9 +72,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] ); +let bool = isNegativeIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] ); // returns true bool = isNegativeIntegerArray.objects( [ -1.0, 0.0, -10.0 ] ); @@ -97,10 +97,10 @@ bool = isNegativeIntegerArray.objects( [ -3.0, new Number(-1.0) ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNegativeIntegerArray = require( '@stdlib/assert/is-negative-integer-array' ); -var bool = isNegativeIntegerArray( [ -5, -2, -3 ] ); +let bool = isNegativeIntegerArray( [ -5, -2, -3 ] ); // returns true bool = isNegativeIntegerArray( [ -4, -3, -2, -1 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-integer/README.md b/lib/node_modules/@stdlib/assert/is-negative-integer/README.md index 58599c4197aa..0e141df13bea 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeInteger = require( '@stdlib/assert/is-negative-integer' ); +const isNegativeInteger = require( '@stdlib/assert/is-negative-integer' ); ``` #### isNegativeInteger( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a negative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeInteger( -5.0 ); +let bool = isNegativeInteger( -5.0 ); // returns true bool = isNegativeInteger( new Number( -5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a negative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeInteger.isPrimitive( -3.0 ); +let bool = isNegativeInteger.isPrimitive( -3.0 ); // returns true bool = isNegativeInteger.isPrimitive( new Number( -3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a negative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeInteger.isObject( -3.0 ); +let bool = isNegativeInteger.isObject( -3.0 ); // returns false bool = isNegativeInteger.isObject( new Number( -3.0 ) ); @@ -100,10 +100,10 @@ bool = isNegativeInteger.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNegativeInteger = require( '@stdlib/assert/is-negative-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isNegativeInteger = require( '@stdlib/assert/is-negative-integer' ); -var bool = isNegativeInteger( -5.0 ); +let bool = isNegativeInteger( -5.0 ); // returns true bool = isNegativeInteger( new Number( -5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-number-array/README.md b/lib/node_modules/@stdlib/assert/is-negative-number-array/README.md index ee7aa561e1c3..bfe1f8439c61 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-number-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-number-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeNumberArray = require( '@stdlib/assert/is-negative-number-array' ); +const isNegativeNumberArray = require( '@stdlib/assert/is-negative-number-array' ); ``` #### isNegativeNumberArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** negative numbers. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumberArray( [ -3.0, new Number(-3.0) ] ); +let bool = isNegativeNumberArray( [ -3.0, new Number(-3.0) ] ); // returns true bool = isNegativeNumberArray( [ -3.0, '-3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object `array` containing **only** primitive ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumberArray.primitives( [ -1.0, -5.0, -10.0 ] ); +let bool = isNegativeNumberArray.primitives( [ -1.0, -5.0, -10.0 ] ); // returns true bool = isNegativeNumberArray.primitives( [ -3.0, new Number(-1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object `array` containing **only** object ne ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumberArray.objects( [ new Number(-1.0), new Number(-1.0) ] ); +let bool = isNegativeNumberArray.objects( [ new Number(-1.0), new Number(-1.0) ] ); // returns true bool = isNegativeNumberArray.objects( [ -1.0, -5.0, -10.0 ] ); @@ -91,10 +91,10 @@ bool = isNegativeNumberArray.objects( [ -1.0, -5.0, -10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNegativeNumberArray = require( '@stdlib/assert/is-negative-number-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNegativeNumberArray = require( '@stdlib/assert/is-negative-number-array' ); -var bool = isNegativeNumberArray( [ -5.0, -0.2, -3.9 ] ); +let bool = isNegativeNumberArray( [ -5.0, -0.2, -3.9 ] ); // returns true bool = isNegativeNumberArray( [ -1, -2, -3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-number/README.md b/lib/node_modules/@stdlib/assert/is-negative-number/README.md index 092b54a064b9..182d0cdf8a97 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeNumber = require( '@stdlib/assert/is-negative-number' ); +const isNegativeNumber = require( '@stdlib/assert/is-negative-number' ); ``` #### isNegativeNumber( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumber( -5.0 ); +let bool = isNegativeNumber( -5.0 ); // returns true bool = isNegativeNumber( new Number( -5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumber.isPrimitive( -3.0 ); +let bool = isNegativeNumber.isPrimitive( -3.0 ); // returns true bool = isNegativeNumber.isPrimitive( new Number( -3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a negative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeNumber.isObject( -3.0 ); +let bool = isNegativeNumber.isObject( -3.0 ); // returns false bool = isNegativeNumber.isObject( new Number( -3.0 ) ); @@ -100,11 +100,11 @@ bool = isNegativeNumber.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var isNegativeNumber = require( '@stdlib/assert/is-negative-number' ); +const isNegativeNumber = require( '@stdlib/assert/is-negative-number' ); -var bool = isNegativeNumber( -5.0 ); +let bool = isNegativeNumber( -5.0 ); // returns true bool = isNegativeNumber( new Number( -5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-negative-zero/README.md b/lib/node_modules/@stdlib/assert/is-negative-zero/README.md index 3c7aba1743f2..d114f36a4d65 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-zero/README.md +++ b/lib/node_modules/@stdlib/assert/is-negative-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeZero = require( '@stdlib/assert/is-negative-zero' ); +const isNegativeZero = require( '@stdlib/assert/is-negative-zero' ); ``` #### isNegativeZero( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a value equal to negative zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeZero( -0.0 ); +let bool = isNegativeZero( -0.0 ); // returns true bool = isNegativeZero( new Number( -0.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` equal to negative zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeZero.isPrimitive( -0.0 ); +let bool = isNegativeZero.isPrimitive( -0.0 ); // returns true bool = isNegativeZero.isPrimitive( new Number( -0.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a value equal to negative zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNegativeZero.isObject( -0.0 ); +let bool = isNegativeZero.isObject( -0.0 ); // returns false bool = isNegativeZero.isObject( new Number( -0.0 ) ); @@ -100,10 +100,10 @@ bool = isNegativeZero.isObject( new Number( -0.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNegativeZero = require( '@stdlib/assert/is-negative-zero' ); +const Number = require( '@stdlib/number/ctor' ); +const isNegativeZero = require( '@stdlib/assert/is-negative-zero' ); -var bool = isNegativeZero( -0.0 ); +let bool = isNegativeZero( -0.0 ); // returns true bool = isNegativeZero( new Number( -0.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-node-builtin/README.md b/lib/node_modules/@stdlib/assert/is-node-builtin/README.md index e71188ef5541..36f203560dd7 100644 --- a/lib/node_modules/@stdlib/assert/is-node-builtin/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-builtin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' ); +const isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' ); ``` #### isNodeBuiltin( value ) @@ -35,7 +35,7 @@ var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' ); Tests whether a string matches a Node.js built-in module name. ```javascript -var bool = isNodeBuiltin( 'util' ); +const bool = isNodeBuiltin( 'util' ); // returns true ``` @@ -60,9 +60,9 @@ var bool = isNodeBuiltin( 'util' ); ```javascript -var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' ); +const isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' ); -var out = isNodeBuiltin( 'fs' ); +let out = isNodeBuiltin( 'fs' ); // returns true out = isNodeBuiltin( 'child_process' ); diff --git a/lib/node_modules/@stdlib/assert/is-node-duplex-stream-like/README.md b/lib/node_modules/@stdlib/assert/is-node-duplex-stream-like/README.md index 8e41439f1ff3..127fcb74b11a 100644 --- a/lib/node_modules/@stdlib/assert/is-node-duplex-stream-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-duplex-stream-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeDuplexStreamLike = require( '@stdlib/assert/is-node-duplex-stream-like' ); +const isNodeDuplexStreamLike = require( '@stdlib/assert/is-node-duplex-stream-like' ); ``` #### isNodeDuplexStreamLike( value ) @@ -35,9 +35,9 @@ var isNodeDuplexStreamLike = require( '@stdlib/assert/is-node-duplex-stream-like Tests if a `value` is Node [duplex stream][nodejs-stream]-like. ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); -var bool = isNodeDuplexStreamLike( transformStream() ); +const bool = isNodeDuplexStreamLike( transformStream() ); // returns true ``` @@ -58,11 +58,11 @@ var bool = isNodeDuplexStreamLike( transformStream() ); ```javascript -var stream = require( 'stream' ); -var transformStream = require( '@stdlib/streams/node/transform' ); -var isNodeDuplexStreamLike = require( '@stdlib/assert/is-node-duplex-stream-like' ); +const stream = require( 'stream' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const isNodeDuplexStreamLike = require( '@stdlib/assert/is-node-duplex-stream-like' ); -var bool = isNodeDuplexStreamLike( new stream.Duplex() ); +let bool = isNodeDuplexStreamLike( new stream.Duplex() ); // returns true bool = isNodeDuplexStreamLike( new stream.Transform() ); diff --git a/lib/node_modules/@stdlib/assert/is-node-readable-stream-like/README.md b/lib/node_modules/@stdlib/assert/is-node-readable-stream-like/README.md index 8f6ea10e79de..d7736ee314bf 100644 --- a/lib/node_modules/@stdlib/assert/is-node-readable-stream-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-readable-stream-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream-like' ); +const isNodeReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream-like' ); ``` #### isNodeReadableStreamLike( value ) @@ -35,9 +35,9 @@ var isNodeReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream- Tests if a `value` is Node [readable stream][nodejs-stream]-like. ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); -var bool = isNodeReadableStreamLike( transformStream() ); +const bool = isNodeReadableStreamLike( transformStream() ); // returns true ``` @@ -58,11 +58,11 @@ var bool = isNodeReadableStreamLike( transformStream() ); ```javascript -var stream = require( 'stream' ); -var transformStream = require( '@stdlib/streams/node/transform' ); -var isNodeReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream-like' ); +const stream = require( 'stream' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const isNodeReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream-like' ); -var bool = isNodeReadableStreamLike( new stream.Readable() ); +let bool = isNodeReadableStreamLike( new stream.Readable() ); // returns true bool = isNodeReadableStreamLike( new stream.Duplex() ); diff --git a/lib/node_modules/@stdlib/assert/is-node-repl/README.md b/lib/node_modules/@stdlib/assert/is-node-repl/README.md index bc0b4481a7d6..b726afc216a8 100644 --- a/lib/node_modules/@stdlib/assert/is-node-repl/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-repl/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeREPL = require( '@stdlib/assert/is-node-repl' ); +const isNodeREPL = require( '@stdlib/assert/is-node-repl' ); ``` #### isNodeREPL() @@ -35,7 +35,7 @@ var isNodeREPL = require( '@stdlib/assert/is-node-repl' ); Returns a `boolean` indicating if running in a [Node.js][node-js] REPL environment. ```javascript -var bool = isNodeREPL(); +const bool = isNodeREPL(); // returns ``` @@ -50,7 +50,7 @@ var bool = isNodeREPL(); ```javascript -var isNodeREPL = require( '@stdlib/assert/is-node-repl' ); +const isNodeREPL = require( '@stdlib/assert/is-node-repl' ); console.log( isNodeREPL() ); // => diff --git a/lib/node_modules/@stdlib/assert/is-node-stream-like/README.md b/lib/node_modules/@stdlib/assert/is-node-stream-like/README.md index 5fb271b9587b..ad4141d86bdb 100644 --- a/lib/node_modules/@stdlib/assert/is-node-stream-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-stream-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' ); +const isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' ); ``` #### isNodeStreamLike( value ) @@ -35,9 +35,9 @@ var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' ); Tests if a `value` is Node [stream][nodejs-stream]-like. ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); -var bool = isNodeStreamLike( transformStream() ); +const bool = isNodeStreamLike( transformStream() ); // returns true ``` @@ -58,11 +58,11 @@ var bool = isNodeStreamLike( transformStream() ); ```javascript -var stream = require( 'stream' ); -var transformStream = require( '@stdlib/streams/node/transform' ); -var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' ); +const stream = require( 'stream' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' ); -var bool = isNodeStreamLike( new stream.Stream() ); +let bool = isNodeStreamLike( new stream.Stream() ); // returns true bool = isNodeStreamLike( new stream.Readable() ); diff --git a/lib/node_modules/@stdlib/assert/is-node-transform-stream-like/README.md b/lib/node_modules/@stdlib/assert/is-node-transform-stream-like/README.md index fb8223aab8d8..31bb6abd7d23 100644 --- a/lib/node_modules/@stdlib/assert/is-node-transform-stream-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-transform-stream-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' ); +const isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' ); ``` #### isNodeTransformStreamLike( value ) @@ -35,9 +35,9 @@ var isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-strea Tests if a `value` is Node [transform stream][nodejs-stream]-like. ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); -var bool = isNodeTransformStreamLike( transformStream() ); +const bool = isNodeTransformStreamLike( transformStream() ); // returns true ``` @@ -58,11 +58,11 @@ var bool = isNodeTransformStreamLike( transformStream() ); ```javascript -var stream = require( 'stream' ); -var transformStream = require( '@stdlib/streams/node/transform' ); -var isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' ); +const stream = require( 'stream' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' ); -var bool = isNodeTransformStreamLike( new stream.Transform() ); +let bool = isNodeTransformStreamLike( new stream.Transform() ); // returns true bool = isNodeTransformStreamLike( transformStream() ); diff --git a/lib/node_modules/@stdlib/assert/is-node-writable-stream-like/README.md b/lib/node_modules/@stdlib/assert/is-node-writable-stream-like/README.md index 97aee2b23882..f6bce18785a5 100644 --- a/lib/node_modules/@stdlib/assert/is-node-writable-stream-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-node-writable-stream-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' ); +const isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' ); ``` #### isNodeWritableStreamLike( value ) @@ -35,9 +35,9 @@ var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream- Tests if a `value` is Node [writable stream][nodejs-stream]-like. ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); -var bool = isNodeWritableStreamLike( transformStream() ); +const bool = isNodeWritableStreamLike( transformStream() ); // returns true ``` @@ -58,11 +58,11 @@ var bool = isNodeWritableStreamLike( transformStream() ); ```javascript -var stream = require( 'stream' ); -var transformStream = require( '@stdlib/streams/node/transform' ); -var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' ); +const stream = require( 'stream' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' ); -var bool = isNodeWritableStreamLike( new stream.Writable() ); +let bool = isNodeWritableStreamLike( new stream.Writable() ); // returns true bool = isNodeWritableStreamLike( new stream.Transform() ); diff --git a/lib/node_modules/@stdlib/assert/is-node/README.md b/lib/node_modules/@stdlib/assert/is-node/README.md index 6b076834cf76..2288ee9b84e0 100644 --- a/lib/node_modules/@stdlib/assert/is-node/README.md +++ b/lib/node_modules/@stdlib/assert/is-node/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_NODE = require( '@stdlib/assert/is-node' ); +const IS_NODE = require( '@stdlib/assert/is-node' ); ``` #### IS_NODE @@ -35,7 +35,7 @@ var IS_NODE = require( '@stdlib/assert/is-node' ); `Boolean` indicating if the runtime is [Node.js][node-js]. ```javascript -var bool = IS_NODE; +const bool = IS_NODE; // returns ``` @@ -60,7 +60,7 @@ var bool = IS_NODE; ```javascript -var IS_NODE = require( '@stdlib/assert/is-node' ); +const IS_NODE = require( '@stdlib/assert/is-node' ); console.log( IS_NODE ); // => diff --git a/lib/node_modules/@stdlib/assert/is-nonconfigurable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-nonconfigurable-property-in/README.md index 5827cd13b97a..298366be66c0 100644 --- a/lib/node_modules/@stdlib/assert/is-nonconfigurable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonconfigurable-property-in/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' ); +const isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' ); ``` #### isNonConfigurablePropertyIn( value, property ) @@ -39,10 +39,7 @@ Returns a `boolean` indicating if a `value` has a non-configurable `property` (i ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; @@ -63,9 +60,9 @@ defineProperty( Foo.prototype, 'boop', { 'value': true }); -obj = new Foo(); +const obj = new Foo(); -bool = isNonConfigurablePropertyIn( obj, 'foo' ); +let bool = isNonConfigurablePropertyIn( obj, 'foo' ); // returns false bool = isNonConfigurablePropertyIn( obj, 'beep' ); @@ -88,7 +85,7 @@ bool = isNonConfigurablePropertyIn( obj, 'boop' ); ```javascript - var bool = isNonConfigurablePropertyIn( 'beep', 'length' ); + const bool = isNonConfigurablePropertyIn( 'beep', 'length' ); // returns true ``` @@ -97,9 +94,9 @@ bool = isNonConfigurablePropertyIn( obj, 'boop' ); ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; defineProperty( obj, 'null', { 'configurable': false, @@ -108,7 +105,7 @@ bool = isNonConfigurablePropertyIn( obj, 'boop' ); 'value': true }); - var bool = isNonConfigurablePropertyIn( obj, null ); + const bool = isNonConfigurablePropertyIn( obj, null ); // returns true ``` @@ -125,9 +122,9 @@ bool = isNonConfigurablePropertyIn( obj, 'boop' ); ```javascript -var isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' ); +const isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' ); -var bool = isNonConfigurablePropertyIn( [ 'a' ], 'length' ); +let bool = isNonConfigurablePropertyIn( [ 'a' ], 'length' ); // returns true bool = isNonConfigurablePropertyIn( {}, 'toString' ); diff --git a/lib/node_modules/@stdlib/assert/is-nonconfigurable-property/README.md b/lib/node_modules/@stdlib/assert/is-nonconfigurable-property/README.md index f7debf1e4263..744b6e000c66 100644 --- a/lib/node_modules/@stdlib/assert/is-nonconfigurable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonconfigurable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-property' ); +const isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-property' ); ``` #### isNonConfigurableProperty( value, property ) @@ -35,9 +35,9 @@ var isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-prop Returns a `boolean` indicating if a `value` has a non-configurable `property` (i.e., a property which cannot be deleted and whose descriptor cannot be changed). ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -48,7 +48,7 @@ defineProperty( obj, 'beep', { 'value': 'boop' }); -var bool = isNonConfigurableProperty( obj, 'beep' ); +let bool = isNonConfigurableProperty( obj, 'beep' ); // returns true bool = isNonConfigurableProperty( obj, 'foo' ); @@ -66,7 +66,7 @@ bool = isNonConfigurableProperty( obj, 'foo' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isNonConfigurableProperty( 'beep', 'length' ); + const bool = isNonConfigurableProperty( 'beep', 'length' ); // returns true ``` @@ -83,9 +83,9 @@ bool = isNonConfigurableProperty( obj, 'foo' ); ```javascript -var isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-property' ); +const isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-property' ); -var bool = isNonConfigurableProperty( [ 'a' ], 'length' ); +let bool = isNonConfigurableProperty( [ 'a' ], 'length' ); // returns true bool = isNonConfigurableProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-nonenumerable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-nonenumerable-property-in/README.md index 00056ee22cb8..d0ab2237deb0 100644 --- a/lib/node_modules/@stdlib/assert/is-nonenumerable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonenumerable-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' ); +const isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' ); ``` #### isNonEnumerablePropertyIn( value, property ) @@ -37,10 +37,7 @@ Returns a `boolean` indicating if a `value` has a non-enumerable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; @@ -61,9 +58,9 @@ defineProperty( Foo.prototype, 'boop', { 'value': true }); -obj = new Foo(); +const obj = new Foo(); -bool = isNonEnumerablePropertyIn( obj, 'foo' ); +let bool = isNonEnumerablePropertyIn( obj, 'foo' ); // returns false bool = isNonEnumerablePropertyIn( obj, 'beep' ); @@ -84,16 +81,16 @@ bool = isNonEnumerablePropertyIn( obj, 'boop' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isNonEnumerablePropertyIn( 'beep', 'length' ); + const bool = isNonEnumerablePropertyIn( 'beep', 'length' ); // returns true ``` - Non-symbol property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; defineProperty( obj, 'null', { 'configurable': true, @@ -102,7 +99,7 @@ bool = isNonEnumerablePropertyIn( obj, 'boop' ); 'value': true }); - var bool = isNonEnumerablePropertyIn( obj, null ); + const bool = isNonEnumerablePropertyIn( obj, null ); // returns true ``` @@ -119,9 +116,9 @@ bool = isNonEnumerablePropertyIn( obj, 'boop' ); ```javascript -var isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' ); +const isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' ); -var bool = isNonEnumerablePropertyIn( {}, 'toString' ); +let bool = isNonEnumerablePropertyIn( {}, 'toString' ); // returns true bool = isNonEnumerablePropertyIn( {}, 'hasOwnProperty' ); diff --git a/lib/node_modules/@stdlib/assert/is-nonenumerable-property/README.md b/lib/node_modules/@stdlib/assert/is-nonenumerable-property/README.md index 11f170089702..48413d71a37d 100644 --- a/lib/node_modules/@stdlib/assert/is-nonenumerable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonenumerable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' ); +const isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' ); ``` #### isNonEnumerableProperty( value, property ) @@ -35,9 +35,9 @@ var isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property Returns a `boolean` indicating if a `value` has a non-enumerable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -48,7 +48,7 @@ defineProperty( obj, 'beep', { 'value': 'boop' }); -var bool = isNonEnumerableProperty( obj, 'beep' ); +let bool = isNonEnumerableProperty( obj, 'beep' ); // returns true bool = isNonEnumerableProperty( obj, 'foo' ); @@ -66,7 +66,7 @@ bool = isNonEnumerableProperty( obj, 'foo' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isNonEnumerableProperty( 'beep', 'length' ); + const bool = isNonEnumerableProperty( 'beep', 'length' ); // returns true ``` @@ -83,9 +83,9 @@ bool = isNonEnumerableProperty( obj, 'foo' ); ```javascript -var isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' ); +const isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' ); -var bool = isNonEnumerableProperty( [ 'a' ], 'length' ); +let bool = isNonEnumerableProperty( [ 'a' ], 'length' ); // returns true bool = isNonEnumerableProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-nonnegative-finite/README.md b/lib/node_modules/@stdlib/assert/is-nonnegative-finite/README.md index 8dd4528af1c0..0c43366fd901 100644 --- a/lib/node_modules/@stdlib/assert/is-nonnegative-finite/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonnegative-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' ); +const isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' ); ``` #### isNonNegativeFinite( value ) @@ -37,9 +37,9 @@ Tests if a value is a number having a nonnegative finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeFinite( 5.0 ); +let bool = isNonNegativeFinite( 5.0 ); // returns true bool = isNonNegativeFinite( new Number( 5.0 ) ); @@ -65,9 +65,9 @@ Tests if a value is a primitive number having a nonnegative finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeFinite.isPrimitive( 3.0 ); +let bool = isNonNegativeFinite.isPrimitive( 3.0 ); // returns true bool = isNonNegativeFinite.isPrimitive( new Number( 3.0 ) ); @@ -81,9 +81,9 @@ Tests if a value is a `Number` object having a nonnegative finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeFinite.isObject( 3.0 ); +let bool = isNonNegativeFinite.isObject( 3.0 ); // returns false bool = isNonNegativeFinite.isObject( new Number( 3.0 ) ); @@ -103,10 +103,10 @@ bool = isNonNegativeFinite.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' ); -var bool = isNonNegativeFinite( 5.0 ); +let bool = isNonNegativeFinite( 5.0 ); // returns true bool = isNonNegativeFinite( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-nonnegative-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-nonnegative-integer-array/README.md index f43bfd472207..611bfa299713 100644 --- a/lib/node_modules/@stdlib/assert/is-nonnegative-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonnegative-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ); +const isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ); ``` #### isNonNegativeIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** nonnegative `inte ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] ); +let bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] ); // returns true bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object containing **only** nonnegative prim ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] ); +let bool = isNonNegativeIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] ); // returns true bool = isNonNegativeIntegerArray.primitives( [ 3.0, new Number(1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object containing **only** nonnegative obje ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeIntegerArray.objects( [ new Number(3.0), new Number(1.0) ] ); +let bool = isNonNegativeIntegerArray.objects( [ new Number(3.0), new Number(1.0) ] ); // returns true bool = isNonNegativeIntegerArray.objects( [ 1.0, 0.0, 10.0 ] ); @@ -91,10 +91,10 @@ bool = isNonNegativeIntegerArray.objects( [ 1.0, 0.0, 10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ); -var bool = isNonNegativeIntegerArray( [ 5, 2, 3 ] ); +let bool = isNonNegativeIntegerArray( [ 5, 2, 3 ] ); // returns true bool = isNonNegativeIntegerArray( [ 0, 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nonnegative-integer/README.md b/lib/node_modules/@stdlib/assert/is-nonnegative-integer/README.md index c1ae53d42dfb..3914358cbf1a 100644 --- a/lib/node_modules/@stdlib/assert/is-nonnegative-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonnegative-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ); +const isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ); ``` #### isNonNegativeInteger( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a nonnegative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeInteger( 5.0 ); +let bool = isNonNegativeInteger( 5.0 ); // returns true bool = isNonNegativeInteger( new Number( 5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a nonnegative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeInteger.isPrimitive( 3.0 ); +let bool = isNonNegativeInteger.isPrimitive( 3.0 ); // returns true bool = isNonNegativeInteger.isPrimitive( new Number( 3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a nonnegative `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeInteger.isObject( 3.0 ); +let bool = isNonNegativeInteger.isObject( 3.0 ); // returns false bool = isNonNegativeInteger.isObject( new Number( 3.0 ) ); @@ -100,10 +100,10 @@ bool = isNonNegativeInteger.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ); -var bool = isNonNegativeInteger( 5.0 ); +let bool = isNonNegativeInteger( 5.0 ); // returns true bool = isNonNegativeInteger( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-nonnegative-number-array/README.md b/lib/node_modules/@stdlib/assert/is-nonnegative-number-array/README.md index 8e0618c0011b..b3330686a6d7 100644 --- a/lib/node_modules/@stdlib/assert/is-nonnegative-number-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonnegative-number-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeNumberArray = require( '@stdlib/assert/is-nonnegative-number-array' ); +const isNonNegativeNumberArray = require( '@stdlib/assert/is-nonnegative-number-array' ); ``` #### isNonNegativeNumberArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** nonnegative numbe ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumberArray( [ 3.0, new Number(3.0) ] ); +let bool = isNonNegativeNumberArray( [ 3.0, new Number(3.0) ] ); // returns true bool = isNonNegativeNumberArray( [ 3.0, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object `array` containing **only** primitive ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumberArray.primitives( [ 1.0, 0.0, 10.0 ] ); +let bool = isNonNegativeNumberArray.primitives( [ 1.0, 0.0, 10.0 ] ); // returns true bool = isNonNegativeNumberArray.primitives( [ 3.0, new Number(1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object `array` containing **only** object no ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumberArray.objects( [ new Number(1.0), new Number(1.0) ] ); +let bool = isNonNegativeNumberArray.objects( [ new Number(1.0), new Number(1.0) ] ); // returns true bool = isNonNegativeNumberArray.objects( [ 1.0, 0.0, 10.0 ] ); @@ -91,10 +91,10 @@ bool = isNonNegativeNumberArray.objects( [ 1.0, 0.0, 10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonNegativeNumberArray = require( '@stdlib/assert/is-nonnegative-number-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonNegativeNumberArray = require( '@stdlib/assert/is-nonnegative-number-array' ); -var bool = isNonNegativeNumberArray( [ 5.0, 0.2, 3.9 ] ); +let bool = isNonNegativeNumberArray( [ 5.0, 0.2, 3.9 ] ); // returns true bool = isNonNegativeNumberArray( [ 1, 2, 3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nonnegative-number/README.md b/lib/node_modules/@stdlib/assert/is-nonnegative-number/README.md index ad91108f8529..16575c6cdbb5 100644 --- a/lib/node_modules/@stdlib/assert/is-nonnegative-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonnegative-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ); +const isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ); ``` #### isNonNegativeNumber( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a nonnegative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumber( 5.0 ); +let bool = isNonNegativeNumber( 5.0 ); // returns true bool = isNonNegativeNumber( new Number( 5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a nonnegative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumber.isPrimitive( 3.0 ); +let bool = isNonNegativeNumber.isPrimitive( 3.0 ); // returns true bool = isNonNegativeNumber.isPrimitive( new Number( 3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a nonnegative value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonNegativeNumber.isObject( 3.0 ); +let bool = isNonNegativeNumber.isObject( 3.0 ); // returns false bool = isNonNegativeNumber.isObject( new Number( 3.0 ) ); @@ -100,10 +100,10 @@ bool = isNonNegativeNumber.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ); -var bool = isNonNegativeNumber( 5.0 ); +let bool = isNonNegativeNumber( 5.0 ); // returns true bool = isNonNegativeNumber( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-finite/README.md b/lib/node_modules/@stdlib/assert/is-nonpositive-finite/README.md index 27f48d35a81f..1a8080bf05cc 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-finite/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveFinite = require( '@stdlib/assert/is-nonpositive-finite' ); +const isNonPositiveFinite = require( '@stdlib/assert/is-nonpositive-finite' ); ``` #### isNonPositiveFinite( value ) @@ -37,10 +37,10 @@ Tests if a `value` is a `number` having a nonpositive finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); -var NINF = require('@stdlib/constants/float64/ninf'); +const Number = require( '@stdlib/number/ctor' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); -var bool = isNonPositiveFinite( -5.0 ); +let bool = isNonPositiveFinite( -5.0 ); // returns true bool = isNonPositiveFinite( NINF ); @@ -66,9 +66,9 @@ Tests if a `value` is a primitive `number` having a nonpositive finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveFinite.isPrimitive( -3.0 ); +let bool = isNonPositiveFinite.isPrimitive( -3.0 ); // returns true bool = isNonPositiveFinite.isPrimitive( new Number( -3.0 ) ); @@ -82,9 +82,9 @@ Tests if a `value` is a `Number` object having a nonpositive finite value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveFinite.isObject( -3.0 ); +let bool = isNonPositiveFinite.isObject( -3.0 ); // returns false bool = isNonPositiveFinite.isObject( new Number( -3.0 ) ); @@ -104,11 +104,11 @@ bool = isNonPositiveFinite.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonPositiveFinite = require( '@stdlib/assert/is-nonpositive-finite' ); -var NINF = require('@stdlib/constants/float64/ninf'); +const Number = require( '@stdlib/number/ctor' ); +const isNonPositiveFinite = require( '@stdlib/assert/is-nonpositive-finite' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); -var bool = isNonPositiveFinite( -5.0 ); +let bool = isNonPositiveFinite( -5.0 ); // returns true bool = isNonPositiveFinite( NINF ); diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-nonpositive-integer-array/README.md index 02ba31fbf21f..a93be714c9f7 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveIntegerArray = require( '@stdlib/assert/is-nonpositive-integer-array' ); +const isNonPositiveIntegerArray = require( '@stdlib/assert/is-nonpositive-integer-array' ); ``` #### isNonPositiveIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** nonpositive `inte ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveIntegerArray( [ -3, new Number(-3) ] ); +let bool = isNonPositiveIntegerArray( [ -3, new Number(-3) ] ); // returns true bool = isNonPositiveIntegerArray( [ -3, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object containing **only** nonpositive primi ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveIntegerArray.primitives( [ -1.0, -10.0 ] ); +let bool = isNonPositiveIntegerArray.primitives( [ -1.0, -10.0 ] ); // returns true bool = isNonPositiveIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] ); @@ -72,9 +72,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] ); +let bool = isNonPositiveIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] ); // returns true bool = isNonPositiveIntegerArray.objects( [ -1.0, 0.0, -10.0 ] ); @@ -97,10 +97,10 @@ bool = isNonPositiveIntegerArray.objects( [ -3.0, new Number(-1.0) ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonPositiveIntegerArray = require( '@stdlib/assert/is-nonpositive-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonPositiveIntegerArray = require( '@stdlib/assert/is-nonpositive-integer-array' ); -var bool = isNonPositiveIntegerArray( [ -5, -2, -3 ] ); +let bool = isNonPositiveIntegerArray( [ -5, -2, -3 ] ); // returns true bool = isNonPositiveIntegerArray( [ -4, -3, -2, -1 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-integer/README.md b/lib/node_modules/@stdlib/assert/is-nonpositive-integer/README.md index 743407301e95..6be918b10af2 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveInteger = require( '@stdlib/assert/is-nonpositive-integer' ); +const isNonPositiveInteger = require( '@stdlib/assert/is-nonpositive-integer' ); ``` #### isNonPositiveInteger( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a nonpositive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveInteger( -5.0 ); +let bool = isNonPositiveInteger( -5.0 ); // returns true bool = isNonPositiveInteger( new Number( -5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a nonpositive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveInteger.isPrimitive( -3.0 ); +let bool = isNonPositiveInteger.isPrimitive( -3.0 ); // returns true bool = isNonPositiveInteger.isPrimitive( new Number( -3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a nonpositive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveInteger.isObject( -3.0 ); +let bool = isNonPositiveInteger.isObject( -3.0 ); // returns false bool = isNonPositiveInteger.isObject( new Number( -3.0 ) ); @@ -100,10 +100,10 @@ bool = isNonPositiveInteger.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonPositiveInteger = require( '@stdlib/assert/is-nonpositive-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonPositiveInteger = require( '@stdlib/assert/is-nonpositive-integer' ); -var bool = isNonPositiveInteger( -5.0 ); +let bool = isNonPositiveInteger( -5.0 ); // returns true bool = isNonPositiveInteger( new Number( -5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/README.md b/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/README.md index 59b0730e59d3..375fd50d608b 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveNumberArray = require( '@stdlib/assert/is-nonpositive-number-array' ); +const isNonPositiveNumberArray = require( '@stdlib/assert/is-nonpositive-number-array' ); ``` #### isNonPositiveNumberArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** nonpositive numbe ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumberArray( [ -3.0, new Number(-3.0) ] ); +let bool = isNonPositiveNumberArray( [ -3.0, new Number(-3.0) ] ); // returns true bool = isNonPositiveNumberArray( [ -3.0, '-3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object `array` containing **only** primitive ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumberArray.primitives( [ -1.0, 0.0, -10.0 ] ); +let bool = isNonPositiveNumberArray.primitives( [ -1.0, 0.0, -10.0 ] ); // returns true bool = isNonPositiveNumberArray.primitives( [ -3.0, new Number(-1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object `array` containing **only** object no ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumberArray.objects( [ new Number(-1.0), new Number(-1.0) ] ); +let bool = isNonPositiveNumberArray.objects( [ new Number(-1.0), new Number(-1.0) ] ); // returns true bool = isNonPositiveNumberArray.objects( [ -1.0, 0.0, -10.0 ] ); @@ -91,10 +91,10 @@ bool = isNonPositiveNumberArray.objects( [ -1.0, 0.0, -10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonPositiveNumberArray = require( '@stdlib/assert/is-nonpositive-number-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonPositiveNumberArray = require( '@stdlib/assert/is-nonpositive-number-array' ); -var bool = isNonPositiveNumberArray( [ -5.0, -0.2, -3.9 ] ); +let bool = isNonPositiveNumberArray( [ -5.0, -0.2, -3.9 ] ); // returns true bool = isNonPositiveNumberArray( [ -1, -2, -3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-number/README.md b/lib/node_modules/@stdlib/assert/is-nonpositive-number/README.md index ef2cfa066d4b..69ccb4685eae 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' ); +const isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' ); ``` #### isNonPositiveNumber( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a nonpositive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumber( -5.0 ); +let bool = isNonPositiveNumber( -5.0 ); // returns true bool = isNonPositiveNumber( new Number( -5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a nonpositive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumber.isPrimitive( -3.0 ); +let bool = isNonPositiveNumber.isPrimitive( -3.0 ); // returns true bool = isNonPositiveNumber.isPrimitive( new Number( -3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a nonpositive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNonPositiveNumber.isObject( -3.0 ); +let bool = isNonPositiveNumber.isObject( -3.0 ); // returns false bool = isNonPositiveNumber.isObject( new Number( -3.0 ) ); @@ -100,10 +100,10 @@ bool = isNonPositiveNumber.isObject( new Number( -3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isNonPositiveNumber = require( '@stdlib/assert/is-nonpositive-number' ); -var bool = isNonPositiveNumber( -5.0 ); +let bool = isNonPositiveNumber( -5.0 ); // returns true bool = isNonPositiveNumber( new Number( -5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-nonsymmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-nonsymmetric-matrix/README.md index 828cf48aa299..688047c9ec7e 100644 --- a/lib/node_modules/@stdlib/assert/is-nonsymmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-nonsymmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonSymmetricMatrix = require( '@stdlib/assert/is-nonsymmetric-matrix' ); +const isNonSymmetricMatrix = require( '@stdlib/assert/is-nonsymmetric-matrix' ); ``` #### isNonSymmetricMatrix( value ) @@ -35,10 +35,10 @@ var isNonSymmetricMatrix = require( '@stdlib/assert/is-nonsymmetric-matrix' ); Tests if a value is a [non-symmetric matrix][symmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isNonSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isNonSymmetricMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isNonSymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isNonSymmetricMatrix = require( '@stdlib/assert/is-nonsymmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isNonSymmetricMatrix = require( '@stdlib/assert/is-nonsymmetric-matrix' ); -var arr = ndarray( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isNonSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isNonSymmetricMatrix( arr ); // returns true out = isNonSymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-null-array/README.md b/lib/node_modules/@stdlib/assert/is-null-array/README.md index 5b9b69c53608..1b3337fcae4f 100644 --- a/lib/node_modules/@stdlib/assert/is-null-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-null-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNullArray = require( '@stdlib/assert/is-null-array' ); +const isNullArray = require( '@stdlib/assert/is-null-array' ); ``` #### isNullArray( value ) @@ -35,7 +35,7 @@ var isNullArray = require( '@stdlib/assert/is-null-array' ); Tests if a `value` is an array-like object containing only `null` values. ```javascript -var bool = isNullArray( [ null, null, null ] ); +let bool = isNullArray( [ null, null, null ] ); // returns true bool = isNullArray( [ null, NaN, null ] ); @@ -53,9 +53,9 @@ bool = isNullArray( [ null, NaN, null ] ); ```javascript -var isNullArray = require( '@stdlib/assert/is-null-array' ); +const isNullArray = require( '@stdlib/assert/is-null-array' ); -var bool = isNullArray( [ null ] ); +let bool = isNullArray( [ null ] ); // returns true bool = isNullArray( [ null, null, null ] ); diff --git a/lib/node_modules/@stdlib/assert/is-null/README.md b/lib/node_modules/@stdlib/assert/is-null/README.md index 707b2b64cd03..12ea1ce81763 100644 --- a/lib/node_modules/@stdlib/assert/is-null/README.md +++ b/lib/node_modules/@stdlib/assert/is-null/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNull = require( '@stdlib/assert/is-null' ); +const isNull = require( '@stdlib/assert/is-null' ); ``` #### isNull( value ) @@ -35,7 +35,7 @@ var isNull = require( '@stdlib/assert/is-null' ); Tests if a `value` is `null`. ```javascript -var bool = isNull( null ); +const bool = isNull( null ); // returns true ``` @@ -52,9 +52,9 @@ var bool = isNull( null ); ```javascript -var isNull = require( '@stdlib/assert/is-null' ); +const isNull = require( '@stdlib/assert/is-null' ); -var bool = isNull( null ); +let bool = isNull( null ); // returns true bool = isNull( 'beep' ); diff --git a/lib/node_modules/@stdlib/assert/is-number-array/README.md b/lib/node_modules/@stdlib/assert/is-number-array/README.md index cbcb428b9c19..be7af412d50c 100644 --- a/lib/node_modules/@stdlib/assert/is-number-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-number-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNumberArray = require( '@stdlib/assert/is-number-array' ); +const isNumberArray = require( '@stdlib/assert/is-number-array' ); ``` #### isNumberArray( value ) @@ -35,7 +35,7 @@ var isNumberArray = require( '@stdlib/assert/is-number-array' ); Tests if a `value` is an array-like object of `numbers`. ```javascript -var bool = isNumberArray( [ 1, 2, 3, 4 ] ); +const bool = isNumberArray( [ 1, 2, 3, 4 ] ); // returns true ``` @@ -46,9 +46,9 @@ Tests if a `value` is an array-like object containing **only** `number` primitiv ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNumberArray.primitives( [ 1, 2, 3 ] ); +let bool = isNumberArray.primitives( [ 1, 2, 3 ] ); // returns true bool = isNumberArray.primitives( [ 1, new Number( 2 ), 3 ] ); @@ -62,9 +62,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNumberArray.objects( [ new Number( 1 ), new Number( 2 ) ] ); +let bool = isNumberArray.objects( [ new Number( 1 ), new Number( 2 ) ] ); // returns true bool = isNumberArray.objects( [ new Number( 1 ), 2 ] ); @@ -84,10 +84,10 @@ bool = isNumberArray.objects( [ new Number( 1 ), 2 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNumberArray = require( '@stdlib/assert/is-number-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isNumberArray = require( '@stdlib/assert/is-number-array' ); -var bool = isNumberArray( [ 3.14 ] ); +let bool = isNumberArray( [ 3.14 ] ); // returns true bool = isNumberArray( [ NaN ] ); diff --git a/lib/node_modules/@stdlib/assert/is-number/README.md b/lib/node_modules/@stdlib/assert/is-number/README.md index ae9ab52e06d0..1f98106957df 100644 --- a/lib/node_modules/@stdlib/assert/is-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNumber = require( '@stdlib/assert/is-number' ); +const isNumber = require( '@stdlib/assert/is-number' ); ``` #### isNumber( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNumber( 3.14 ); +let bool = isNumber( 3.14 ); // returns true bool = isNumber( new Number( 3.14 ) ); @@ -59,9 +59,9 @@ Tests if a `value` is a primitive `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNumber.isPrimitive( 3.14 ); +let bool = isNumber.isPrimitive( 3.14 ); // returns true bool = isNumber.isPrimitive( NaN ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isNumber.isObject( 3.14 ); +let bool = isNumber.isObject( 3.14 ); // returns false bool = isNumber.isObject( new Number( 3.14 ) ); @@ -100,10 +100,10 @@ bool = isNumber.isObject( new Number( 3.14 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isNumber = require( '@stdlib/assert/is-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isNumber = require( '@stdlib/assert/is-number' ); -var bool = isNumber( 5 ); +let bool = isNumber( 5 ); // returns true bool = isNumber( new Number( 5 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-numeric-array/README.md b/lib/node_modules/@stdlib/assert/is-numeric-array/README.md index e4f64856bfa8..17625d3c9c58 100644 --- a/lib/node_modules/@stdlib/assert/is-numeric-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-numeric-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNumericArray = require( '@stdlib/assert/is-numeric-array' ); +const isNumericArray = require( '@stdlib/assert/is-numeric-array' ); ``` #### isNumericArray( value ) @@ -35,9 +35,9 @@ var isNumericArray = require( '@stdlib/assert/is-numeric-array' ); Tests if a value is a numeric array. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var bool = isNumericArray( new Int8Array( 10 ) ); +let bool = isNumericArray( new Int8Array( 10 ) ); // returns true bool = isNumericArray( [ 1, 2, 3 ] ); @@ -62,20 +62,20 @@ bool = isNumericArray( [ '1', '2', '3' ] ); ```javascript -var Buffer = require( '@stdlib/buffer/ctor' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isNumericArray = require( '@stdlib/assert/is-numeric-array' ); - -var arr = new Int8Array( 10 ); -var bool = isNumericArray( arr ); +const Buffer = require( '@stdlib/buffer/ctor' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isNumericArray = require( '@stdlib/assert/is-numeric-array' ); + +let arr = new Int8Array( 10 ); +let bool = isNumericArray( arr ); // returns true arr = new Uint8Array( 10 ); diff --git a/lib/node_modules/@stdlib/assert/is-object-array/README.md b/lib/node_modules/@stdlib/assert/is-object-array/README.md index a7736c618773..06e5b53fc6ae 100644 --- a/lib/node_modules/@stdlib/assert/is-object-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-object-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isObjectArray = require( '@stdlib/assert/is-object-array' ); +const isObjectArray = require( '@stdlib/assert/is-object-array' ); ``` #### isObjectArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** `objects`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isObjectArray( [ {}, new Number(3.0) ] ); +let bool = isObjectArray( [ {}, new Number(3.0) ] ); // returns true bool = isObjectArray( [ {}, { 'beep': 'boop' } ] ); @@ -68,10 +68,10 @@ bool = isObjectArray( [ null, {} ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isObjectArray = require( '@stdlib/assert/is-object-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isObjectArray = require( '@stdlib/assert/is-object-array' ); -var bool = isObjectArray( [ { 'beep': 'boop' }, {}, {} ] ); +let bool = isObjectArray( [ { 'beep': 'boop' }, {}, {} ] ); // returns true bool = isObjectArray( [ new Date(), new Number( 3 ) ] ); diff --git a/lib/node_modules/@stdlib/assert/is-object-like/README.md b/lib/node_modules/@stdlib/assert/is-object-like/README.md index b207942ac8d7..3cb4bf4a5903 100644 --- a/lib/node_modules/@stdlib/assert/is-object-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-object-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isObjectLike = require( '@stdlib/assert/is-object-like' ); +const isObjectLike = require( '@stdlib/assert/is-object-like' ); ``` #### isObjectLike( value ) @@ -35,7 +35,7 @@ var isObjectLike = require( '@stdlib/assert/is-object-like' ); Tests if a `value` is object-like. ```javascript -var bool = isObjectLike( {} ); +let bool = isObjectLike( {} ); // returns true bool = isObjectLike( [] ); @@ -50,7 +50,7 @@ bool = isObjectLike( true ); Tests if a `value` is an `array` of object-like values. ```javascript -var bool = isObjectLike.isObjectLikeArray( [ {}, [] ] ); +let bool = isObjectLike.isObjectLikeArray( [ {}, [] ] ); // returns true bool = isObjectLike.isObjectLikeArray( [ {}, '3.0' ] ); @@ -71,7 +71,7 @@ bool = isObjectLike.isObjectLikeArray( [] ); - Return values are the same as would be obtained using the built-in [`typeof`][type-of] operator **except** that `null` is **not** considered an `object`. ```javascript - var bool = ( typeof null === 'object' ); + let bool = ( typeof null === 'object' ); // returns true bool = isObjectLike( null ); @@ -91,11 +91,11 @@ bool = isObjectLike.isObjectLikeArray( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var isObjectLike = require( '@stdlib/assert/is-object-like' ); +const Int8Array = require( '@stdlib/array/int8' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const isObjectLike = require( '@stdlib/assert/is-object-like' ); -var bool = isObjectLike( {} ); +let bool = isObjectLike( {} ); // returns true bool = isObjectLike( [] ); diff --git a/lib/node_modules/@stdlib/assert/is-object/README.md b/lib/node_modules/@stdlib/assert/is-object/README.md index 12fcc1ee71bc..3878b8c1eb05 100644 --- a/lib/node_modules/@stdlib/assert/is-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isObject = require( '@stdlib/assert/is-object' ); +const isObject = require( '@stdlib/assert/is-object' ); ``` #### isObject( value ) @@ -35,7 +35,7 @@ var isObject = require( '@stdlib/assert/is-object' ); Tests if a `value` is an `object`. ```javascript -var bool = isObject( {} ); +let bool = isObject( {} ); // returns true bool = isObject( true ); @@ -53,12 +53,12 @@ bool = isObject( true ); - The function returns `false` if provided an `array` or `null`. ```javascript - var bool = isObject( [] ); + let bool = isObject( [] ); // returns false bool = isObject( null ); // returns false - ``` + ``` @@ -71,9 +71,9 @@ bool = isObject( true ); ```javascript -var isObject = require( '@stdlib/assert/is-object' ); +const isObject = require( '@stdlib/assert/is-object' ); -var bool = isObject( {} ); +let bool = isObject( {} ); // returns true bool = isObject( new Date() ); diff --git a/lib/node_modules/@stdlib/assert/is-odd/README.md b/lib/node_modules/@stdlib/assert/is-odd/README.md index 491cdaca9cf0..1fa8c8ba9c8a 100644 --- a/lib/node_modules/@stdlib/assert/is-odd/README.md +++ b/lib/node_modules/@stdlib/assert/is-odd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isOdd = require( '@stdlib/assert/is-odd' ); +const isOdd = require( '@stdlib/assert/is-odd' ); ``` #### isOdd( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an odd `number`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isOdd( 5.0 ); +let bool = isOdd( 5.0 ); // returns true bool = isOdd( new Number( 5.0 ) ); @@ -65,9 +65,9 @@ Tests if a `value` is an odd primitive number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isOdd.isPrimitive( -5.0 ); +let bool = isOdd.isPrimitive( -5.0 ); // returns true bool = isOdd.isPrimitive( new Number( -5.0 ) ); @@ -81,9 +81,9 @@ Tests if a `value` is a `Number` object having an odd number value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isOdd.isObject( 5.0 ); +let bool = isOdd.isObject( 5.0 ); // returns false bool = isOdd.isObject( new Number( 5.0 ) ); @@ -103,10 +103,10 @@ bool = isOdd.isObject( new Number( 5.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isOdd = require( '@stdlib/assert/is-odd' ); +const Number = require( '@stdlib/number/ctor' ); +const isOdd = require( '@stdlib/assert/is-odd' ); -var bool = isOdd( 5.0 ); +let bool = isOdd( 5.0 ); // returns true bool = isOdd( new Number( 5 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-pascalcase/README.md b/lib/node_modules/@stdlib/assert/is-pascalcase/README.md index 1cdab12cd475..e18dbd65653a 100644 --- a/lib/node_modules/@stdlib/assert/is-pascalcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-pascalcase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPascalcase = require( '@stdlib/assert/is-pascalcase' ); +const isPascalcase = require( '@stdlib/assert/is-pascalcase' ); ``` #### isPascalcase( value ) @@ -35,7 +35,7 @@ var isPascalcase = require( '@stdlib/assert/is-pascalcase' ); Tests if a `value` is a `string` in Pascal case. ```javascript -var bool = isPascalcase( 'HelloWorld' ); +let bool = isPascalcase( 'HelloWorld' ); // returns true bool = isPascalcase( 'Hello World' ); @@ -63,9 +63,9 @@ bool = isPascalcase( 'Hello World' ); ```javascript -var isPascalcase = require( '@stdlib/assert/is-pascalcase' ); +const isPascalcase = require( '@stdlib/assert/is-pascalcase' ); -var bool = isPascalcase( 'FooBarBaz' ); +let bool = isPascalcase( 'FooBarBaz' ); // returns true bool = isPascalcase( 'fooBarBaz' ); diff --git a/lib/node_modules/@stdlib/assert/is-persymmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-persymmetric-matrix/README.md index 5ec4480a4375..e7204c630538 100644 --- a/lib/node_modules/@stdlib/assert/is-persymmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-persymmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPersymmetricMatrix = require( '@stdlib/assert/is-persymmetric-matrix' ); +const isPersymmetricMatrix = require( '@stdlib/assert/is-persymmetric-matrix' ); ``` #### isPersymmetricMatrix( value ) @@ -35,10 +35,10 @@ var isPersymmetricMatrix = require( '@stdlib/assert/is-persymmetric-matrix' ); Tests if a value is a [persymmetric matrix][persymmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isPersymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isPersymmetricMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isPersymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isPersymmetricMatrix = require( '@stdlib/assert/is-persymmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isPersymmetricMatrix = require( '@stdlib/assert/is-persymmetric-matrix' ); -var arr = ndarray( 'generic', [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isPersymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isPersymmetricMatrix( arr ); // returns true out = isPersymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-plain-object-array/README.md b/lib/node_modules/@stdlib/assert/is-plain-object-array/README.md index 96af37f15330..30e397cdabee 100644 --- a/lib/node_modules/@stdlib/assert/is-plain-object-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-plain-object-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' ); +const isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' ); ``` #### isPlainObjectArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** plain `objects`. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] ); +let bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] ); // returns true bool = isPlainObjectArray( [ {}, new Number(3.0) ] ); @@ -68,10 +68,10 @@ bool = isPlainObjectArray( [ null, {} ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isPlainObjectArray = require( '@stdlib/assert/is-plain-object-array' ); -var bool = isPlainObjectArray( [ { 'beep': 'boop' }, {}, {} ] ); +let bool = isPlainObjectArray( [ { 'beep': 'boop' }, {}, {} ] ); // returns true bool = isPlainObjectArray( [ new Date(), new Number( 3 ) ] ); diff --git a/lib/node_modules/@stdlib/assert/is-plain-object/README.md b/lib/node_modules/@stdlib/assert/is-plain-object/README.md index 8a56b5a09930..c30169f8d194 100644 --- a/lib/node_modules/@stdlib/assert/is-plain-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-plain-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +const isPlainObject = require( '@stdlib/assert/is-plain-object' ); ``` #### isPlainObject( value ) @@ -35,7 +35,7 @@ var isPlainObject = require( '@stdlib/assert/is-plain-object' ); Tests if a `value` is a plain `object`. ```javascript -var bool = isPlainObject( {} ); +let bool = isPlainObject( {} ); // returns true bool = isPlainObject( null ); @@ -53,9 +53,9 @@ bool = isPlainObject( null ); ```javascript -var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +const isPlainObject = require( '@stdlib/assert/is-plain-object' ); -var bool = isPlainObject( {} ); +let bool = isPlainObject( {} ); // returns true bool = isPlainObject( Object.create( null ) ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-finite/README.md b/lib/node_modules/@stdlib/assert/is-positive-finite/README.md index c29d4c861bf4..b72fc0b235a6 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-finite/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveFinite = require( '@stdlib/assert/is-positive-finite' ); +const isPositiveFinite = require( '@stdlib/assert/is-positive-finite' ); ``` #### isPositiveFinite( value ) @@ -37,9 +37,9 @@ Tests if a value is a number having a finite positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveFinite( 5.0 ); +let bool = isPositiveFinite( 5.0 ); // returns true bool = isPositiveFinite( new Number( 5.0 ) ); @@ -65,9 +65,9 @@ Tests if a value is a primitive number having a finite positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveFinite.isPrimitive( 3.0 ); +let bool = isPositiveFinite.isPrimitive( 3.0 ); // returns true bool = isPositiveFinite.isPrimitive( 3.0/0.0 ); @@ -84,9 +84,9 @@ Tests if a value is a `Number` object having a finite positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveFinite.isObject( new Number( 3.0 ) ); +let bool = isPositiveFinite.isObject( new Number( 3.0 ) ); // returns true bool = isPositiveFinite.isObject( 3.0 ); @@ -109,10 +109,10 @@ bool = isPositiveFinite.isObject( new Number( 1.0/0.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveFinite = require( '@stdlib/assert/is-positive-finite' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveFinite = require( '@stdlib/assert/is-positive-finite' ); -var bool = isPositiveFinite( 5.0 ); +let bool = isPositiveFinite( 5.0 ); // returns true bool = isPositiveFinite( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-positive-integer-array/README.md index 35cc5a874bba..ab70682d7b28 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ); +const isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ); ``` #### isPositiveIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** positive `integer ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] ); +let bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] ); // returns true bool = isPositiveIntegerArray( [ 3.0, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object containing **only** positive primitiv ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveIntegerArray.primitives( [ 1.0, 2.0, 10.0 ] ); +let bool = isPositiveIntegerArray.primitives( [ 1.0, 2.0, 10.0 ] ); // returns true bool = isPositiveIntegerArray.primitives( [ 3.0, new Number(1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object containing **only** positive object ` ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveIntegerArray.objects( [ new Number(3.0), new Number(1.0) ] ); +let bool = isPositiveIntegerArray.objects( [ new Number(3.0), new Number(1.0) ] ); // returns true bool = isPositiveIntegerArray.objects( [ 1.0, 2.0, 10.0 ] ); @@ -91,10 +91,10 @@ bool = isPositiveIntegerArray.objects( [ 1.0, 2.0, 10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ); -var bool = isPositiveIntegerArray( [ 5, 2, 3 ] ); +let bool = isPositiveIntegerArray( [ 5, 2, 3 ] ); // returns true bool = isPositiveIntegerArray( [ 1, new Number( 6 ), 3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-integer/README.md b/lib/node_modules/@stdlib/assert/is-positive-integer/README.md index 8c504f52c81b..0358627b4cc1 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ); ``` #### isPositiveInteger( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a positive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveInteger( 5.0 ); +let bool = isPositiveInteger( 5.0 ); // returns true bool = isPositiveInteger( new Number( 5.0 ) ); @@ -65,9 +65,9 @@ Tests if a `value` is a primitive `number` having a positive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveInteger.isPrimitive( 3.0 ); +let bool = isPositiveInteger.isPrimitive( 3.0 ); // returns true bool = isPositiveInteger.isPrimitive( new Number( 3.0 ) ); @@ -81,9 +81,9 @@ Tests if a `value` is a `Number` object having a positive `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveInteger.isObject( 3.0 ); +let bool = isPositiveInteger.isObject( 3.0 ); // returns false bool = isPositiveInteger.isObject( new Number( 3.0 ) ); @@ -103,10 +103,10 @@ bool = isPositiveInteger.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ); -var bool = isPositiveInteger( 5.0 ); +let bool = isPositiveInteger( 5.0 ); // returns true bool = isPositiveInteger( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-number-array/README.md b/lib/node_modules/@stdlib/assert/is-positive-number-array/README.md index fc7efcb42319..7491e7a96893 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-number-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-number-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ); +const isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ); ``` #### isPositiveNumberArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** positive numbers. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] ); +let bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] ); // returns true bool = isPositiveNumberArray( [ 3.0, '3.0' ] ); @@ -53,9 +53,9 @@ Tests if a `value` is an array-like object `array` containing **only** primitive ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumberArray.primitives( [ 1.0, 5.0, 10.0 ] ); +let bool = isPositiveNumberArray.primitives( [ 1.0, 5.0, 10.0 ] ); // returns true bool = isPositiveNumberArray.primitives( [ 3.0, new Number(1.0) ] ); @@ -69,9 +69,9 @@ Tests if a `value` is an array-like object `array` containing **only** object po ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumberArray.objects( [ new Number(1.0), new Number(1.0) ] ); +let bool = isPositiveNumberArray.objects( [ new Number(1.0), new Number(1.0) ] ); // returns true bool = isPositiveNumberArray.objects( [ 1.0, 5.0, 10.0 ] ); @@ -91,10 +91,10 @@ bool = isPositiveNumberArray.objects( [ 1.0, 5.0, 10.0 ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveNumberArray = require( '@stdlib/assert/is-positive-number-array' ); -var bool = isPositiveNumberArray( [ 5.0, 0.2, 3.9 ] ); +let bool = isPositiveNumberArray( [ 5.0, 0.2, 3.9 ] ); // returns true bool = isPositiveNumberArray( [ 1, 2, 3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-number/README.md b/lib/node_modules/@stdlib/assert/is-positive-number/README.md index 6f29db705296..78379f0c15d1 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ); +const isPositiveNumber = require( '@stdlib/assert/is-positive-number' ); ``` #### isPositiveNumber( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumber( 5.0 ); +let bool = isPositiveNumber( 5.0 ); // returns true bool = isPositiveNumber( new Number( 5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumber.isPrimitive( 3.0 ); +let bool = isPositiveNumber.isPrimitive( 3.0 ); // returns true bool = isPositiveNumber.isPrimitive( new Number( 3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a positive value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveNumber.isObject( 3.0 ); +let bool = isPositiveNumber.isObject( 3.0 ); // returns false bool = isPositiveNumber.isObject( new Number( 3.0 ) ); @@ -100,10 +100,10 @@ bool = isPositiveNumber.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveNumber = require( '@stdlib/assert/is-positive-number' ); -var bool = isPositiveNumber( 5.0 ); +let bool = isPositiveNumber( 5.0 ); // returns true bool = isPositiveNumber( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-positive-zero/README.md b/lib/node_modules/@stdlib/assert/is-positive-zero/README.md index e154543f6235..43f7c0148b96 100644 --- a/lib/node_modules/@stdlib/assert/is-positive-zero/README.md +++ b/lib/node_modules/@stdlib/assert/is-positive-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); +const isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); ``` #### isPositiveZero( value ) @@ -37,9 +37,9 @@ Tests if a `value` is a `number` having a value equal to positive zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveZero( 0.0 ); +let bool = isPositiveZero( 0.0 ); // returns true bool = isPositiveZero( new Number( 0.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` equal to positive zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveZero.isPrimitive( 0.0 ); +let bool = isPositiveZero.isPrimitive( 0.0 ); // returns true bool = isPositiveZero.isPrimitive( new Number( 0.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a value equal to positive zero. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPositiveZero.isObject( 0.0 ); +let bool = isPositiveZero.isObject( 0.0 ); // returns false bool = isPositiveZero.isObject( new Number( 0.0 ) ); @@ -100,10 +100,10 @@ bool = isPositiveZero.isObject( new Number( 0.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); +const Number = require( '@stdlib/number/ctor' ); +const isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); -var bool = isPositiveZero( 0.0 ); +let bool = isPositiveZero( 0.0 ); // returns true bool = isPositiveZero( new Number( 0.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-prime/README.md b/lib/node_modules/@stdlib/assert/is-prime/README.md index 25263a569a23..a955f08b2cad 100644 --- a/lib/node_modules/@stdlib/assert/is-prime/README.md +++ b/lib/node_modules/@stdlib/assert/is-prime/README.md @@ -35,7 +35,7 @@ A **prime number** is defined as an integer value greater than `1` which is only ## Usage ```javascript -var isPrime = require( '@stdlib/assert/is-prime' ); +const isPrime = require( '@stdlib/assert/is-prime' ); ``` #### isPrime( value ) @@ -45,9 +45,9 @@ Tests if a `value` is a prime number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPrime( 5.0 ); +let bool = isPrime( 5.0 ); // returns true bool = isPrime( new Number( 5.0 ) ); @@ -73,9 +73,9 @@ Tests if a `value` is a primitive prime number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPrime.isPrimitive( 5.0 ); +let bool = isPrime.isPrimitive( 5.0 ); // returns true bool = isPrime.isPrimitive( new Number( 5.0 ) ); @@ -89,9 +89,9 @@ Tests if a `value` is a `Number` object having a value which is a prime number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isPrime.isObject( 5.0 ); +let bool = isPrime.isObject( 5.0 ); // returns false bool = isPrime.isObject( new Number( 5.0 ) ); @@ -111,10 +111,10 @@ bool = isPrime.isObject( new Number( 5.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPrime = require( '@stdlib/assert/is-prime' ); +const Number = require( '@stdlib/number/ctor' ); +const isPrime = require( '@stdlib/assert/is-prime' ); -var bool = isPrime( 5.0 ); +let bool = isPrime( 5.0 ); // returns true bool = isPrime( new Number( 5.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-primitive-array/README.md b/lib/node_modules/@stdlib/assert/is-primitive-array/README.md index 69f36df52236..939c8727f4dc 100644 --- a/lib/node_modules/@stdlib/assert/is-primitive-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-primitive-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' ); +const isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' ); ``` #### isPrimitiveArray( value ) @@ -37,7 +37,7 @@ Tests if a `value` is an array-like object containing **only** JavaScript primit ```javascript -var bool = isPrimitiveArray( [ '3', 2, null ] ); +let bool = isPrimitiveArray( [ '3', 2, null ] ); // returns true bool = isPrimitiveArray( [ {}, 2, 1 ] ); @@ -60,10 +60,10 @@ bool = isPrimitiveArray( [ new String( 'abc' ), '3.0' ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isPrimitiveArray = require( '@stdlib/assert/is-primitive-array' ); -var bool = isPrimitiveArray( [ '3', 2, null ] ); +let bool = isPrimitiveArray( [ '3', 2, null ] ); // returns true bool = isPrimitiveArray( [ void 0, true ] ); diff --git a/lib/node_modules/@stdlib/assert/is-primitive/README.md b/lib/node_modules/@stdlib/assert/is-primitive/README.md index 0438e7be1f09..bdbbe7773e09 100644 --- a/lib/node_modules/@stdlib/assert/is-primitive/README.md +++ b/lib/node_modules/@stdlib/assert/is-primitive/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPrimitive = require( '@stdlib/assert/is-primitive' ); +const isPrimitive = require( '@stdlib/assert/is-primitive' ); ``` #### isPrimitive( value ) @@ -35,7 +35,7 @@ var isPrimitive = require( '@stdlib/assert/is-primitive' ); Tests if a `value` is a JavaScript primitive. ```javascript -var bool = isPrimitive( false ); +const bool = isPrimitive( false ); // returns true ``` @@ -70,11 +70,11 @@ var bool = isPrimitive( false ); ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); -var Object = require( '@stdlib/object/ctor' ); -var isPrimitive = require( '@stdlib/assert/is-primitive' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const isPrimitive = require( '@stdlib/assert/is-primitive' ); -var bool = isPrimitive( false ); +let bool = isPrimitive( false ); // returns true bool = isPrimitive( 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-prng-like/README.md b/lib/node_modules/@stdlib/assert/is-prng-like/README.md index 725e4d458a90..0a437b0acb2e 100644 --- a/lib/node_modules/@stdlib/assert/is-prng-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-prng-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPRNGLike = require( '@stdlib/assert/is-prng-like' ); +const isPRNGLike = require( '@stdlib/assert/is-prng-like' ); ``` #### isPRNGLike( value ) @@ -35,9 +35,9 @@ var isPRNGLike = require( '@stdlib/assert/is-prng-like' ); Tests if a value is PRNG-like. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); -var bool = isPRNGLike( randu ); +const bool = isPRNGLike( randu ); // returns true ``` @@ -62,10 +62,10 @@ var bool = isPRNGLike( randu ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var isPRNGLike = require( '@stdlib/assert/is-prng-like' ); +const randu = require( '@stdlib/random/base/randu' ); +const isPRNGLike = require( '@stdlib/assert/is-prng-like' ); -var bool = isPRNGLike( randu ); +let bool = isPRNGLike( randu ); // returns true bool = isPRNGLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-probability-array/README.md b/lib/node_modules/@stdlib/assert/is-probability-array/README.md index 18a0d36eed11..0105b8dae555 100644 --- a/lib/node_modules/@stdlib/assert/is-probability-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-probability-array/README.md @@ -35,7 +35,7 @@ A **probability** is defined as a numeric value on the interval `[0,1]`. ## Usage ```javascript -var isProbabilityArray = require( '@stdlib/assert/is-probability-array' ); +const isProbabilityArray = require( '@stdlib/assert/is-probability-array' ); ``` #### isProbabilityArray( value ) @@ -45,10 +45,10 @@ Tests if a `value` is an array-like object containing **only** probabilities. ```javascript -var Number = require( '@stdlib/number/ctor' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Number = require( '@stdlib/number/ctor' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var bool = isProbabilityArray( [ 0.6, 0.5, 0.25 ] ); +let bool = isProbabilityArray( [ 0.6, 0.5, 0.25 ] ); // returns true bool = isProbabilityArray( [ 0.6, 0.5, new Number( 0.25 ) ] ); @@ -68,9 +68,9 @@ Tests if a `value` is an array-like object `array` containing **only** primitive ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isProbabilityArray.primitives( [ 1.0, 0.0, 0.8 ] ); +let bool = isProbabilityArray.primitives( [ 1.0, 0.0, 0.8 ] ); // returns true bool = isProbabilityArray.primitives( [ 0.9, new Number(1.0) ] ); @@ -84,9 +84,9 @@ Tests if a `value` is an array-like object `array` containing **only** `Number` ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isProbabilityArray.objects( [ new Number(1.0), new Number(1.0) ] ); +let bool = isProbabilityArray.objects( [ new Number(1.0), new Number(1.0) ] ); // returns true bool = isProbabilityArray.objects( [ 1.0, 0.0, 0.6 ] ); @@ -104,11 +104,11 @@ bool = isProbabilityArray.objects( [ 1.0, 0.0, 0.6 ] ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var isProbabilityArray = require( '@stdlib/assert/is-probability-array' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const isProbabilityArray = require( '@stdlib/assert/is-probability-array' ); -var arr = [ 0.0, 1.0, 0.5 ]; -var bool = isProbabilityArray( arr ); +let arr = [ 0.0, 1.0, 0.5 ]; +let bool = isProbabilityArray( arr ); // returns true arr = [ 0.5, 0.25, 0.25 ]; diff --git a/lib/node_modules/@stdlib/assert/is-probability/README.md b/lib/node_modules/@stdlib/assert/is-probability/README.md index 68214a0d526c..97f1afa207d9 100644 --- a/lib/node_modules/@stdlib/assert/is-probability/README.md +++ b/lib/node_modules/@stdlib/assert/is-probability/README.md @@ -35,7 +35,7 @@ A **probability** is defined as a numeric value on the interval `[0,1]`. ## Usage ```javascript -var isProbability = require( '@stdlib/assert/is-probability' ); +const isProbability = require( '@stdlib/assert/is-probability' ); ``` #### isProbability( value ) @@ -45,9 +45,9 @@ Tests if a `value` is a probability. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isProbability( 0.5 ); +let bool = isProbability( 0.5 ); // returns true bool = isProbability( new Number( 0.5 ) ); @@ -73,9 +73,9 @@ Tests if a `value` is a primitive probability. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isProbability.isPrimitive( 0.33 ); +let bool = isProbability.isPrimitive( 0.33 ); // returns true bool = isProbability.isPrimitive( new Number( 0.33 ) ); @@ -89,9 +89,9 @@ Tests if a `value` is a `Number` object having a value which is a probability. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isProbability.isObject( 0.11 ); +let bool = isProbability.isObject( 0.11 ); // returns false bool = isProbability.isObject( new Number( 0.11 ) ); @@ -111,10 +111,10 @@ bool = isProbability.isObject( new Number( 0.11 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isProbability = require( '@stdlib/assert/is-probability' ); +const Number = require( '@stdlib/number/ctor' ); +const isProbability = require( '@stdlib/assert/is-probability' ); -var bool = isProbability( 0.5 ); +let bool = isProbability( 0.5 ); // returns true bool = isProbability( new Number( 0.5 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-property-key/README.md b/lib/node_modules/@stdlib/assert/is-property-key/README.md index f748350514ff..a17f3ca1efeb 100644 --- a/lib/node_modules/@stdlib/assert/is-property-key/README.md +++ b/lib/node_modules/@stdlib/assert/is-property-key/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isPropertyKey = require( '@stdlib/assert/is-property-key' ); +const isPropertyKey = require( '@stdlib/assert/is-property-key' ); ``` #### isPropertyKey( value ) @@ -45,7 +45,7 @@ var isPropertyKey = require( '@stdlib/assert/is-property-key' ); Tests whether a value is a property key. ```javascript -var bool = isPropertyKey( 'beep' ); +let bool = isPropertyKey( 'beep' ); // returns true bool = isPropertyKey( 3.14 ); @@ -78,12 +78,12 @@ bool = isPropertyKey( 3.14 ); ```javascript -var Symbol = require( '@stdlib/symbol/ctor' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var isPropertyKey = require( '@stdlib/assert/is-property-key' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const isPropertyKey = require( '@stdlib/assert/is-property-key' ); -var hasSymbols = hasSymbolSupport(); -var bool = isPropertyKey( 'beep' ); +const hasSymbols = hasSymbolSupport(); +let bool = isPropertyKey( 'beep' ); // returns true if ( hasSymbols ) { diff --git a/lib/node_modules/@stdlib/assert/is-prototype-of/README.md b/lib/node_modules/@stdlib/assert/is-prototype-of/README.md index 58243d151a1b..90125cec08e6 100644 --- a/lib/node_modules/@stdlib/assert/is-prototype-of/README.md +++ b/lib/node_modules/@stdlib/assert/is-prototype-of/README.md @@ -35,7 +35,7 @@ limitations under the License. ```javascript -var isPrototypeOf = require( '@stdlib/assert/is-prototype-of' ); +const isPrototypeOf = require( '@stdlib/assert/is-prototype-of' ); ``` #### isPrototypeOf( obj, prototype ) @@ -45,7 +45,7 @@ Tests if an `object`'s prototype chain contains a provided `prototype`. ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Foo() { return this; @@ -56,9 +56,9 @@ function Bar() { } inherit( Bar, Foo ); -var bar = new Bar(); +const bar = new Bar(); -var bool = isPrototypeOf( bar, Foo.prototype ); +const bool = isPrototypeOf( bar, Foo.prototype ); // returns true ``` @@ -75,9 +75,9 @@ var bool = isPrototypeOf( bar, Foo.prototype ); ```javascript - var Number = require( '@stdlib/number/ctor' ); + const Number = require( '@stdlib/number/ctor' ); - var bool = isPrototypeOf( 5, Number.prototype ); + let bool = isPrototypeOf( 5, Number.prototype ); // returns false bool = isPrototypeOf( 'beep', String.prototype ); @@ -92,7 +92,7 @@ var bool = isPrototypeOf( bar, Foo.prototype ); ```javascript - var bool = isPrototypeOf( Object.create( null ), null ); + const bool = isPrototypeOf( Object.create( null ), null ); // throws ``` @@ -109,16 +109,16 @@ var bool = isPrototypeOf( bar, Foo.prototype ); Ctor.prototype = proto; return new Ctor(); } - var superProto = { + const superProto = { 'beep': 'beep' }; - var subProto = createObject( superProto ); + const subProto = createObject( superProto ); subProto.boop = 'boop'; - var v = createObject( subProto ); + const v = createObject( subProto ); - var bool; + let bool; try { bool = ( v instanceof superProto ); } catch ( error ) { @@ -143,8 +143,8 @@ var bool = isPrototypeOf( bar, Foo.prototype ); ```javascript -var inherit = require( '@stdlib/utils/inherit' ); -var isPrototypeOf = require( '@stdlib/assert/is-prototype-of' ); +const inherit = require( '@stdlib/utils/inherit' ); +const isPrototypeOf = require( '@stdlib/assert/is-prototype-of' ); function A() { return this; @@ -165,12 +165,12 @@ function D() { } inherit( D, C ); -var a = new A(); -var b = new B(); -var c = new C(); -var d = new D(); +const a = new A(); +const b = new B(); +const c = new C(); +const d = new D(); -var bool = isPrototypeOf( d, C.prototype ); +let bool = isPrototypeOf( d, C.prototype ); // returns true bool = isPrototypeOf( d, B.prototype ); diff --git a/lib/node_modules/@stdlib/assert/is-ragged-nested-array/README.md b/lib/node_modules/@stdlib/assert/is-ragged-nested-array/README.md index 2889b561b41f..f255cf2c085b 100644 --- a/lib/node_modules/@stdlib/assert/is-ragged-nested-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-ragged-nested-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isRaggedNestedArray = require( '@stdlib/assert/is-ragged-nested-array' ); +const isRaggedNestedArray = require( '@stdlib/assert/is-ragged-nested-array' ); ``` #### isRaggedNestedArray( value ) @@ -35,7 +35,7 @@ var isRaggedNestedArray = require( '@stdlib/assert/is-ragged-nested-array' ); Tests if a value is a ragged nested array. ```javascript -var bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5 ] ] ); +let bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5 ] ] ); // returns true bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ); @@ -55,9 +55,9 @@ bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ); ```javascript -var isRaggedNestedArray = require( '@stdlib/assert/is-ragged-nested-array' ); +const isRaggedNestedArray = require( '@stdlib/assert/is-ragged-nested-array' ); -var bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5 ] ] ); +let bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5 ] ] ); // returns true bool = isRaggedNestedArray( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ); diff --git a/lib/node_modules/@stdlib/assert/is-range-error/README.md b/lib/node_modules/@stdlib/assert/is-range-error/README.md index 68d94d75c1c4..ee993f502ded 100644 --- a/lib/node_modules/@stdlib/assert/is-range-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-range-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isRangeError = require( '@stdlib/assert/is-range-error' ); +const isRangeError = require( '@stdlib/assert/is-range-error' ); ``` #### isRangeError( value ) @@ -45,7 +45,7 @@ var isRangeError = require( '@stdlib/assert/is-range-error' ); Tests if a `value` is a [`RangeError`][mdn-range-error] object. ```javascript -var bool = isRangeError( new RangeError( 'beep' ) ); +const bool = isRangeError( new RangeError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isRangeError( new RangeError( 'beep' ) ); ```javascript -var isRangeError = require( '@stdlib/assert/is-range-error' ); +const isRangeError = require( '@stdlib/assert/is-range-error' ); -var bool = isRangeError( new RangeError( 'range error' ) ); +let bool = isRangeError( new RangeError( 'range error' ) ); // returns true bool = isRangeError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-read-only-property-in/README.md b/lib/node_modules/@stdlib/assert/is-read-only-property-in/README.md index bd6d2f3012a7..879d9e35d626 100644 --- a/lib/node_modules/@stdlib/assert/is-read-only-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-read-only-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadOnlyPropertyIn = require( '@stdlib/assert/is-read-only-property-in' ); +const isReadOnlyPropertyIn = require( '@stdlib/assert/is-read-only-property-in' ); ``` #### isReadOnlyPropertyIn( value, property ) @@ -37,16 +37,15 @@ Returns a `boolean` indicating if a `value` has a [read-only][@stdlib/utils/defi ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; return this; } +const obj = new Foo(); + defineProperty( Foo.prototype, 'beep', { 'configurable': false, 'enumerable': false, @@ -62,9 +61,7 @@ defineProperty( Foo.prototype, 'accessor', { } }); -obj = new Foo(); - -bool = isReadOnlyPropertyIn( obj, 'foo' ); +let bool = isReadOnlyPropertyIn( obj, 'foo' ); // returns false bool = isReadOnlyPropertyIn( obj, 'beep' ); @@ -85,16 +82,16 @@ bool = isReadOnlyPropertyIn( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadOnlyPropertyIn( 'beep', 'length' ); + const bool = isReadOnlyPropertyIn( 'beep', 'length' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; defineProperty( obj, 'null', { 'configurable': false, @@ -103,7 +100,7 @@ bool = isReadOnlyPropertyIn( obj, 'accessor' ); 'value': true }); - var bool = isReadOnlyPropertyIn( obj, null ); + const bool = isReadOnlyPropertyIn( obj, null ); // returns true ``` @@ -120,9 +117,9 @@ bool = isReadOnlyPropertyIn( obj, 'accessor' ); ```javascript -var isReadOnlyPropertyIn = require( '@stdlib/assert/is-read-only-property-in' ); +const isReadOnlyPropertyIn = require( '@stdlib/assert/is-read-only-property-in' ); -var bool = isReadOnlyPropertyIn( 'a', 'length' ); +let bool = isReadOnlyPropertyIn( 'a', 'length' ); // returns true bool = isReadOnlyPropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-read-only-property/README.md b/lib/node_modules/@stdlib/assert/is-read-only-property/README.md index a7d06d22314e..0e235a75dc8c 100644 --- a/lib/node_modules/@stdlib/assert/is-read-only-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-read-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadOnlyProperty = require( '@stdlib/assert/is-read-only-property' ); +const isReadOnlyProperty = require( '@stdlib/assert/is-read-only-property' ); ``` #### isReadOnlyProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a [read-only][@stdlib/utils/defi ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isReadOnlyProperty( obj, 'foo' ); +let bool = isReadOnlyProperty( obj, 'foo' ); // returns false bool = isReadOnlyProperty( obj, 'beep' ); @@ -79,16 +79,16 @@ bool = isReadOnlyProperty( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadOnlyProperty( 'beep', 'length' ); + const bool = isReadOnlyProperty( 'beep', 'length' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; defineProperty( obj, 'null', { 'configurable': false, @@ -97,7 +97,7 @@ bool = isReadOnlyProperty( obj, 'accessor' ); 'value': true }); - var bool = isReadOnlyProperty( obj, null ); + const bool = isReadOnlyProperty( obj, null ); // returns true ``` @@ -114,9 +114,9 @@ bool = isReadOnlyProperty( obj, 'accessor' ); ```javascript -var isReadOnlyProperty = require( '@stdlib/assert/is-read-only-property' ); +const isReadOnlyProperty = require( '@stdlib/assert/is-read-only-property' ); -var bool = isReadOnlyProperty( 'a', 'length' ); +let bool = isReadOnlyProperty( 'a', 'length' ); // returns true bool = isReadOnlyProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-read-write-property-in/README.md b/lib/node_modules/@stdlib/assert/is-read-write-property-in/README.md index d12455f69c85..87b8eb66f3d0 100644 --- a/lib/node_modules/@stdlib/assert/is-read-write-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-read-write-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadWritePropertyIn = require( '@stdlib/assert/is-read-write-property-in' ); +const isReadWritePropertyIn = require( '@stdlib/assert/is-read-write-property-in' ); ``` #### isReadWritePropertyIn( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a readable **and** writable `pro ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -61,7 +61,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isReadWritePropertyIn( obj, 'foo' ); +let bool = isReadWritePropertyIn( obj, 'foo' ); // returns true bool = isReadWritePropertyIn( obj, 'beep' ); @@ -82,18 +82,18 @@ bool = isReadWritePropertyIn( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadWritePropertyIn( 'beep', 'length' ); + const bool = isReadWritePropertyIn( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isReadWritePropertyIn( obj, null ); + const bool = isReadWritePropertyIn( obj, null ); // returns true ``` @@ -110,9 +110,9 @@ bool = isReadWritePropertyIn( obj, 'accessor' ); ```javascript -var isReadWritePropertyIn = require( '@stdlib/assert/is-read-write-property-in' ); +const isReadWritePropertyIn = require( '@stdlib/assert/is-read-write-property-in' ); -var bool = isReadWritePropertyIn( [ 'a' ], 'length' ); +let bool = isReadWritePropertyIn( [ 'a' ], 'length' ); // returns true bool = isReadWritePropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-read-write-property/README.md b/lib/node_modules/@stdlib/assert/is-read-write-property/README.md index 9b6d62d8ee16..100ee7d94e59 100644 --- a/lib/node_modules/@stdlib/assert/is-read-write-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-read-write-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadWriteProperty = require( '@stdlib/assert/is-read-write-property' ); +const isReadWriteProperty = require( '@stdlib/assert/is-read-write-property' ); ``` #### isReadWriteProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a readable **and** writable `pro ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -61,7 +61,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isReadWriteProperty( obj, 'foo' ); +let bool = isReadWriteProperty( obj, 'foo' ); // returns true bool = isReadWriteProperty( obj, 'beep' ); @@ -82,18 +82,18 @@ bool = isReadWriteProperty( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadWriteProperty( 'beep', 'length' ); + const bool = isReadWriteProperty( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isReadWriteProperty( obj, null ); + const bool = isReadWriteProperty( obj, null ); // returns true ``` @@ -110,9 +110,9 @@ bool = isReadWriteProperty( obj, 'accessor' ); ```javascript -var isReadWriteProperty = require( '@stdlib/assert/is-read-write-property' ); +const isReadWriteProperty = require( '@stdlib/assert/is-read-write-property' ); -var bool = isReadWriteProperty( [ 'a' ], 'length' ); +let bool = isReadWriteProperty( [ 'a' ], 'length' ); // returns true bool = isReadWriteProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-readable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-readable-property-in/README.md index 2bc95a73e4f3..6d5f1c9cf4a2 100644 --- a/lib/node_modules/@stdlib/assert/is-readable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-readable-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadablePropertyIn = require( '@stdlib/assert/is-readable-property-in' ); +const isReadablePropertyIn = require( '@stdlib/assert/is-readable-property-in' ); ``` #### isReadablePropertyIn( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a readable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'setter', { } }); -var bool = isReadablePropertyIn( obj, 'foo' ); +let bool = isReadablePropertyIn( obj, 'foo' ); // returns true bool = isReadablePropertyIn( obj, 'beep' ); @@ -79,18 +79,18 @@ bool = isReadablePropertyIn( obj, 'setter' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadablePropertyIn( 'beep', 'toString' ); + const bool = isReadablePropertyIn( 'beep', 'toString' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isReadablePropertyIn( obj, null ); + const bool = isReadablePropertyIn( obj, null ); // returns true ``` @@ -107,9 +107,9 @@ bool = isReadablePropertyIn( obj, 'setter' ); ```javascript -var isReadablePropertyIn = require( '@stdlib/assert/is-readable-property-in' ); +const isReadablePropertyIn = require( '@stdlib/assert/is-readable-property-in' ); -var bool = isReadablePropertyIn( [ 'a' ], 'length' ); +let bool = isReadablePropertyIn( [ 'a' ], 'length' ); // returns true bool = isReadablePropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-readable-property/README.md b/lib/node_modules/@stdlib/assert/is-readable-property/README.md index 1ca6067c6e32..b17fe2c49e2c 100644 --- a/lib/node_modules/@stdlib/assert/is-readable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-readable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isReadableProperty = require( '@stdlib/assert/is-readable-property' ); +const isReadableProperty = require( '@stdlib/assert/is-readable-property' ); ``` #### isReadableProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a readable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'setter', { } }); -var bool = isReadableProperty( obj, 'foo' ); +let bool = isReadableProperty( obj, 'foo' ); // returns true bool = isReadableProperty( obj, 'beep' ); @@ -79,18 +79,18 @@ bool = isReadableProperty( obj, 'setter' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isReadableProperty( 'beep', 'length' ); + const bool = isReadableProperty( 'beep', 'length' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isReadableProperty( obj, null ); + const bool = isReadableProperty( obj, null ); // returns true ``` @@ -107,9 +107,9 @@ bool = isReadableProperty( obj, 'setter' ); ```javascript -var isReadableProperty = require( '@stdlib/assert/is-readable-property' ); +const isReadableProperty = require( '@stdlib/assert/is-readable-property' ); -var bool = isReadableProperty( [ 'a' ], 'length' ); +let bool = isReadableProperty( [ 'a' ], 'length' ); // returns true bool = isReadableProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-reference-error/README.md b/lib/node_modules/@stdlib/assert/is-reference-error/README.md index 4a2e8ccffe43..1dbea0bb9759 100644 --- a/lib/node_modules/@stdlib/assert/is-reference-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-reference-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isReferenceError = require( '@stdlib/assert/is-reference-error' ); +const isReferenceError = require( '@stdlib/assert/is-reference-error' ); ``` #### isReferenceError( value ) @@ -45,7 +45,7 @@ var isReferenceError = require( '@stdlib/assert/is-reference-error' ); Tests if a `value` is a [`ReferenceError`][mdn-reference-error] object. ```javascript -var bool = isReferenceError( new ReferenceError( 'beep' ) ); +const bool = isReferenceError( new ReferenceError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isReferenceError( new ReferenceError( 'beep' ) ); ```javascript -var isReferenceError = require( '@stdlib/assert/is-reference-error' ); +const isReferenceError = require( '@stdlib/assert/is-reference-error' ); -var bool = isReferenceError( new ReferenceError( 'reference error' ) ); +let bool = isReferenceError( new ReferenceError( 'reference error' ) ); // returns true bool = isReferenceError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-regexp-string/README.md b/lib/node_modules/@stdlib/assert/is-regexp-string/README.md index a80a6cd24906..97a886666c1d 100644 --- a/lib/node_modules/@stdlib/assert/is-regexp-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-regexp-string/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); +const isRegExpString = require( '@stdlib/assert/is-regexp-string' ); ``` #### isRegExpString( value ) @@ -41,7 +41,7 @@ var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); Tests if a `value` is a regular expression `string`. ```javascript -var bool = isRegExpString( '/^beep$/' ); +const bool = isRegExpString( '/^beep$/' ); // returns true ``` @@ -56,11 +56,9 @@ var bool = isRegExpString( '/^beep$/' ); ```javascript -var isRegExpString = require( '@stdlib/assert/is-regexp-string' ); +const isRegExpString = require( '@stdlib/assert/is-regexp-string' ); -var bool; - -bool = isRegExpString( '/beep/' ); +let bool = isRegExpString( '/beep/' ); // returns true bool = isRegExpString( '/beep/gim' ); diff --git a/lib/node_modules/@stdlib/assert/is-regexp/README.md b/lib/node_modules/@stdlib/assert/is-regexp/README.md index afd107a79ccc..6fa46298c70c 100644 --- a/lib/node_modules/@stdlib/assert/is-regexp/README.md +++ b/lib/node_modules/@stdlib/assert/is-regexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isRegExp = require( '@stdlib/assert/is-regexp' ); +const isRegExp = require( '@stdlib/assert/is-regexp' ); ``` #### isRegExp( value ) @@ -35,7 +35,7 @@ var isRegExp = require( '@stdlib/assert/is-regexp' ); Tests if a `value` is a regular expression. ```javascript -var bool = isRegExp( /.+/ ); +let bool = isRegExp( /.+/ ); // returns true bool = isRegExp( {} ); @@ -55,9 +55,9 @@ bool = isRegExp( {} ); ```javascript -var isRegExp = require( '@stdlib/assert/is-regexp' ); +const isRegExp = require( '@stdlib/assert/is-regexp' ); -var bool = isRegExp( /.+/ ); +let bool = isRegExp( /.+/ ); // returns true bool = isRegExp( new RegExp( '.+' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-relative-path/README.md b/lib/node_modules/@stdlib/assert/is-relative-path/README.md index 031949b44531..1fcf527960f2 100644 --- a/lib/node_modules/@stdlib/assert/is-relative-path/README.md +++ b/lib/node_modules/@stdlib/assert/is-relative-path/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isRelativePath = require( '@stdlib/assert/is-relative-path' ); +const isRelativePath = require( '@stdlib/assert/is-relative-path' ); ``` #### isRelativePath( value ) @@ -41,9 +41,9 @@ var isRelativePath = require( '@stdlib/assert/is-relative-path' ); Tests if a `value` is a relative path. ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var bool; +let bool; if ( IS_WINDOWS ) { bool = isRelativePath( 'foo\\bar\\baz' ); // returns true @@ -64,7 +64,7 @@ if ( IS_WINDOWS ) { Tests if a `value` is a POSIX relative path. ```javascript -var bool = isRelativePath.posix( './foo/bar/baz' ); +let bool = isRelativePath.posix( './foo/bar/baz' ); // returns true bool = isRelativePath.posix( '/foo/../bar/baz' ); @@ -76,7 +76,7 @@ bool = isRelativePath.posix( '/foo/../bar/baz' ); Tests if a `value` is a Windows relative path. ```javascript -var bool = isRelativePath.win32( 'foo\\bar\\baz' ); +let bool = isRelativePath.win32( 'foo\\bar\\baz' ); // returns true bool = isRelativePath.win32( 'C:\\foo\\..\\bar\\baz' ); @@ -104,9 +104,9 @@ bool = isRelativePath.win32( 'C:\\foo\\..\\bar\\baz' ); ```javascript -var isRelativePath = require( '@stdlib/assert/is-relative-path' ); +const isRelativePath = require( '@stdlib/assert/is-relative-path' ); -var bool = isRelativePath.posix( 'foo/' ); +let bool = isRelativePath.posix( 'foo/' ); // returns true bool = isRelativePath.posix( 'foo' ); diff --git a/lib/node_modules/@stdlib/assert/is-relative-uri/README.md b/lib/node_modules/@stdlib/assert/is-relative-uri/README.md index 1f7c732569f9..c8fb2b3e1c62 100644 --- a/lib/node_modules/@stdlib/assert/is-relative-uri/README.md +++ b/lib/node_modules/@stdlib/assert/is-relative-uri/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isRelativeURI = require( '@stdlib/assert/is-relative-uri' ); +const isRelativeURI = require( '@stdlib/assert/is-relative-uri' ); ``` #### isRelativeURI( value ) @@ -45,7 +45,7 @@ var isRelativeURI = require( '@stdlib/assert/is-relative-uri' ); Tests whether a value is a relative [URI][uri]. ```javascript -var bool = isRelativeURI( 'foo/bar' ); +let bool = isRelativeURI( 'foo/bar' ); // returns true bool = isRelativeURI( 'https://example.com/' ); @@ -78,9 +78,9 @@ bool = isRelativeURI( 'https://example.com/' ); ```javascript -var isRelativeURI = require( '@stdlib/assert/is-relative-uri' ); +const isRelativeURI = require( '@stdlib/assert/is-relative-uri' ); -var bool = isRelativeURI( './foo.js' ); +let bool = isRelativeURI( './foo.js' ); // returns true bool = isRelativeURI( '/dashboard/admin' ); diff --git a/lib/node_modules/@stdlib/assert/is-safe-integer-array/README.md b/lib/node_modules/@stdlib/assert/is-safe-integer-array/README.md index addbfb264c62..27de4755ace4 100644 --- a/lib/node_modules/@stdlib/assert/is-safe-integer-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-safe-integer-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSafeIntegerArray = require( '@stdlib/assert/is-safe-integer-array' ); +const isSafeIntegerArray = require( '@stdlib/assert/is-safe-integer-array' ); ``` #### isSafeIntegerArray( value ) @@ -37,9 +37,9 @@ Tests if a `value` is an array-like object containing **only** [safe `integer`][ ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeIntegerArray( [ -3, new Number(3) ] ); +let bool = isSafeIntegerArray( [ -3, new Number(3) ] ); // returns true bool = isSafeIntegerArray( [ -1e100, 2e200 ] ); @@ -56,9 +56,9 @@ Tests if a `value` is an array-like object containing **only** primitive [safe ` ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeIntegerArray.primitives( [ -1.0, 0.0, 4.0 ] ); +let bool = isSafeIntegerArray.primitives( [ -1.0, 0.0, 4.0 ] ); // returns true bool = isSafeIntegerArray.primitives( [ -1.0, 2.2 ] ); @@ -75,9 +75,9 @@ Tests if a `value` is an array-like object containing **only** `Number` objects ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeIntegerArray.objects( [ new Number(-1.0), new Number(2.0) ] ); +let bool = isSafeIntegerArray.objects( [ new Number(-1.0), new Number(2.0) ] ); // returns true bool = isSafeIntegerArray.objects( [ -1.0, 0.0, 1.0 ] ); @@ -100,10 +100,10 @@ bool = isSafeIntegerArray.objects( [ -3.0, new Number(1.0) ] ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isSafeIntegerArray = require( '@stdlib/assert/is-safe-integer-array' ); +const Number = require( '@stdlib/number/ctor' ); +const isSafeIntegerArray = require( '@stdlib/assert/is-safe-integer-array' ); -var bool = isSafeIntegerArray( [ -5, 0, 2, 5 ] ); +let bool = isSafeIntegerArray( [ -5, 0, 2, 5 ] ); // returns true bool = isSafeIntegerArray( [ -4, -3, 1, 3 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-safe-integer/README.md b/lib/node_modules/@stdlib/assert/is-safe-integer/README.md index 3a9b0232b524..340329c597cf 100644 --- a/lib/node_modules/@stdlib/assert/is-safe-integer/README.md +++ b/lib/node_modules/@stdlib/assert/is-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSafeInteger = require( '@stdlib/assert/is-safe-integer' ); +const isSafeInteger = require( '@stdlib/assert/is-safe-integer' ); ``` #### isSafeInteger( value ) @@ -37,9 +37,9 @@ Tests if a value is a `number` having a safe `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeInteger( 5.0 ); +let bool = isSafeInteger( 5.0 ); // returns true bool = isSafeInteger( new Number( 5.0 ) ); @@ -62,9 +62,9 @@ Tests if a `value` is a primitive `number` having a safe `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeInteger.isPrimitive( -3.0 ); +let bool = isSafeInteger.isPrimitive( -3.0 ); // returns true bool = isSafeInteger.isPrimitive( new Number( -3.0 ) ); @@ -78,9 +78,9 @@ Tests if a `value` is a `Number` object having a safe `integer` value. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSafeInteger.isObject( 3.0 ); +let bool = isSafeInteger.isObject( 3.0 ); // returns false bool = isSafeInteger.isObject( new Number( 3.0 ) ); @@ -98,16 +98,16 @@ bool = isSafeInteger.isObject( new Number( 3.0 ) ); - An integer valued number is "safe" when the number can be exactly represented as a [double-precision floating-point number][ieee754]. For example, ```javascript - var MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); + const MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); // returns 9007199254740991 - var x = 9007199254740992; + const x = 9007199254740992; // returns 9007199254740992 - var y = 9007199254740993; + const y = 9007199254740993; // returns 9007199254740992 - var bool = ( x === y ); + const bool = ( x === y ); // returns true ``` @@ -126,10 +126,10 @@ bool = isSafeInteger.isObject( new Number( 3.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isSafeInteger = require( '@stdlib/assert/is-safe-integer' ); +const Number = require( '@stdlib/number/ctor' ); +const isSafeInteger = require( '@stdlib/assert/is-safe-integer' ); -var bool = isSafeInteger( -5.0 ); +let bool = isSafeInteger( -5.0 ); // returns true bool = isSafeInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-same-accessor-array/README.md b/lib/node_modules/@stdlib/assert/is-same-accessor-array/README.md index 014a102cb147..1b1ad6ef5d93 100644 --- a/lib/node_modules/@stdlib/assert/is-same-accessor-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-accessor-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameAccessorArray = require( '@stdlib/assert/is-same-accessor-array' ); +const isSameAccessorArray = require( '@stdlib/assert/is-same-accessor-array' ); ``` #### isSameAccessorArray( v1, v2 ) @@ -35,11 +35,11 @@ var isSameAccessorArray = require( '@stdlib/assert/is-same-accessor-array' ); Tests if two arguments are both [accessor arrays][@stdlib/assert/is-accessor-array] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( [ 1.0, 2.0 ] ); -var y = new Complex128Array( [ 1.0, 2.0 ] ); -var bool = isSameAccessorArray( x, y ); +const x = new Complex128Array( [ 1.0, 2.0 ] ); +const y = new Complex128Array( [ 1.0, 2.0 ] ); +let bool = isSameAccessorArray( x, y ); // returns true bool = isSameAccessorArray( x, [ -1.0, 2.0 ] ); @@ -67,12 +67,12 @@ bool = isSameAccessorArray( x, [ -1.0, 2.0 ] ); ```javascript -var isSameAccessorArray = require( '@stdlib/assert/is-same-accessor-array' ); -var Complex128Array = require( '@stdlib/array/complex128' ); +const isSameAccessorArray = require( '@stdlib/assert/is-same-accessor-array' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var out = isSameAccessorArray( x, y ); +let x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let y = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let out = isSameAccessorArray( x, y ); // returns true x = new Complex128Array( [ 1.0, 2.0, 0.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-array-like-object/README.md b/lib/node_modules/@stdlib/assert/is-same-array-like-object/README.md index ad681b5b24dc..a21999bcb45c 100644 --- a/lib/node_modules/@stdlib/assert/is-same-array-like-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-array-like-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameArrayLikeObject = require( '@stdlib/assert/is-same-array-like-object' ); +const isSameArrayLikeObject = require( '@stdlib/assert/is-same-array-like-object' ); ``` #### isSameArrayLikeObject( v1, v2 ) @@ -35,9 +35,9 @@ var isSameArrayLikeObject = require( '@stdlib/assert/is-same-array-like-object' Tests if two arguments are both [array-like objects][@stdlib/assert/is-array-like-object] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var x = [ 1.0, 2.0 ]; -var y = [ 1.0, 2.0 ]; -var bool = isSameArrayLikeObject( x, y ); +const x = [ 1.0, 2.0 ]; +const y = [ 1.0, 2.0 ]; +let bool = isSameArrayLikeObject( x, y ); // returns true bool = isSameArrayLikeObject( x, [ -1.0, 2.0 ] ); @@ -65,11 +65,11 @@ bool = isSameArrayLikeObject( x, [ -1.0, 2.0 ] ); ```javascript -var isSameArrayLikeObject = require( '@stdlib/assert/is-same-array-like-object' ); +const isSameArrayLikeObject = require( '@stdlib/assert/is-same-array-like-object' ); -var x = [ 1.0, 2.0, 3.0 ]; -var y = [ 1.0, 2.0, 3.0 ]; -var out = isSameArrayLikeObject( x, y ); +let x = [ 1.0, 2.0, 3.0 ]; +let y = [ 1.0, 2.0, 3.0 ]; +let out = isSameArrayLikeObject( x, y ); // returns true x = [ -0.0, 0.0, -0.0 ]; diff --git a/lib/node_modules/@stdlib/assert/is-same-array-like/README.md b/lib/node_modules/@stdlib/assert/is-same-array-like/README.md index 7c6bdf106f3c..91b296532319 100644 --- a/lib/node_modules/@stdlib/assert/is-same-array-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-array-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameArrayLike = require( '@stdlib/assert/is-same-array-like' ); +const isSameArrayLike = require( '@stdlib/assert/is-same-array-like' ); ``` #### isSameArrayLike( v1, v2 ) @@ -35,9 +35,9 @@ var isSameArrayLike = require( '@stdlib/assert/is-same-array-like' ); Tests if two arguments are both array-like and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var x = [ 1.0, 2.0 ]; -var y = [ 1.0, 2.0 ]; -var bool = isSameArrayLike( x, y ); +const x = [ 1.0, 2.0 ]; +const y = [ 1.0, 2.0 ]; +let bool = isSameArrayLike( x, y ); // returns true bool = isSameArrayLike( x, [ -1.0, 2.0 ] ); @@ -65,11 +65,11 @@ bool = isSameArrayLike( x, [ -1.0, 2.0 ] ); ```javascript -var isSameArrayLike = require( '@stdlib/assert/is-same-array-like' ); +const isSameArrayLike = require( '@stdlib/assert/is-same-array-like' ); -var x = [ 1.0, 2.0, 3.0 ]; -var y = [ 1.0, 2.0, 3.0 ]; -var out = isSameArrayLike( x, y ); +let x = [ 1.0, 2.0, 3.0 ]; +let y = [ 1.0, 2.0, 3.0 ]; +let out = isSameArrayLike( x, y ); // returns true x = [ -0.0, 0.0, -0.0 ]; diff --git a/lib/node_modules/@stdlib/assert/is-same-array/README.md b/lib/node_modules/@stdlib/assert/is-same-array/README.md index fa926e36cc7c..078e6fecfec2 100644 --- a/lib/node_modules/@stdlib/assert/is-same-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameArray = require( '@stdlib/assert/is-same-array' ); +const isSameArray = require( '@stdlib/assert/is-same-array' ); ``` #### isSameArray( v1, v2 ) @@ -35,9 +35,9 @@ var isSameArray = require( '@stdlib/assert/is-same-array' ); Tests if two arguments are both generic arrays and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var x = [ 1.0, 2.0 ]; -var y = [ 1.0, 2.0 ]; -var bool = isSameArray( x, y ); +const x = [ 1.0, 2.0 ]; +const y = [ 1.0, 2.0 ]; +let bool = isSameArray( x, y ); // returns true bool = isSameArray( x, [ -1.0, 2.0 ] ); @@ -65,11 +65,11 @@ bool = isSameArray( x, [ -1.0, 2.0 ] ); ```javascript -var isSameArray = require( '@stdlib/assert/is-same-array' ); +const isSameArray = require( '@stdlib/assert/is-same-array' ); -var x = [ 1.0, 2.0, 3.0 ]; -var y = [ 1.0, 2.0, 3.0 ]; -var out = isSameArray( x, y ); +let x = [ 1.0, 2.0, 3.0 ]; +let y = [ 1.0, 2.0, 3.0 ]; +let out = isSameArray( x, y ); // returns true x = [ -0.0, 0.0, -0.0 ]; diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md index b069aecf20d7..3ce292643f2c 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); +const isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); ``` #### isSameBooleanArray( v1, v2 ) @@ -35,11 +35,11 @@ var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); Tests if two arguments are both [BooleanArrays][@stdlib/array/bool] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); -var x = new BooleanArray( [ true, false ] ); -var y = new BooleanArray( [ true, false ] ); -var bool = isSameBooleanArray( x, y ); +const x = new BooleanArray( [ true, false ] ); +const y = new BooleanArray( [ true, false ] ); +let bool = isSameBooleanArray( x, y ); // returns true bool = isSameBooleanArray( x, [ true, false ] ); @@ -63,12 +63,12 @@ bool = isSameBooleanArray( x, [ true, false ] ); ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); -var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); -var x = new BooleanArray( [ true, false, false, true ] ); -var y = new BooleanArray( [ true, false, false, true ] ); -var out = isSameBooleanArray( x, y ); +let x = new BooleanArray( [ true, false, false, true ] ); +let y = new BooleanArray( [ true, false, false, true ] ); +let out = isSameBooleanArray( x, y ); // returns true x = new BooleanArray( [ true, false, false, true ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-complex128/README.md b/lib/node_modules/@stdlib/assert/is-same-complex128/README.md index 3d1ff39a1205..fa359e37fa65 100644 --- a/lib/node_modules/@stdlib/assert/is-same-complex128/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-complex128/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); +const isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); ``` #### isSameComplex128( v1, v2 ) @@ -35,11 +35,11 @@ var isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); Tests if two arguments are both [double-precision complex floating-point numbers][@stdlib/complex/float64/ctor] and have the [same value][@stdlib/assert/is-same-value]. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var x = new Complex128( 1.0, 2.0 ); -var y = new Complex128( 1.0, 2.0 ); -var bool = isSameComplex128( x, y ); +const x = new Complex128( 1.0, 2.0 ); +const y = new Complex128( 1.0, 2.0 ); +const bool = isSameComplex128( x, y ); // returns true ``` @@ -64,12 +64,12 @@ var bool = isSameComplex128( x, y ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); -var x = new Complex128( 1.0, 2.0 ); -var y = new Complex128( 1.0, 2.0 ); -var out = isSameComplex128( x, y ); +let x = new Complex128( 1.0, 2.0 ); +let y = new Complex128( 1.0, 2.0 ); +let out = isSameComplex128( x, y ); // returns true x = new Complex128( 0.0, -0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-same-complex128array/README.md b/lib/node_modules/@stdlib/assert/is-same-complex128array/README.md index 4262656d796a..51bf8538fa35 100644 --- a/lib/node_modules/@stdlib/assert/is-same-complex128array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-complex128array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +const isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); ``` #### isSameComplex128Array( v1, v2 ) @@ -35,11 +35,11 @@ var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); Tests if two arguments are both [Complex128Arrays][@stdlib/array/complex128] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( [ 1.0, 2.0 ] ); -var y = new Complex128Array( [ 1.0, 2.0 ] ); -var bool = isSameComplex128Array( x, y ); +const x = new Complex128Array( [ 1.0, 2.0 ] ); +const y = new Complex128Array( [ 1.0, 2.0 ] ); +let bool = isSameComplex128Array( x, y ); // returns true bool = isSameComplex128Array( x, [ 1.0, 2.0 ] ); @@ -67,12 +67,12 @@ bool = isSameComplex128Array( x, [ 1.0, 2.0 ] ); ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var out = isSameComplex128Array( x, y ); +let x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let y = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let out = isSameComplex128Array( x, y ); // returns true x = new Complex128Array( [ -0.0, 0.0, -0.0, 0.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-complex64/README.md b/lib/node_modules/@stdlib/assert/is-same-complex64/README.md index 6d2a79279d72..6ad72eb184db 100644 --- a/lib/node_modules/@stdlib/assert/is-same-complex64/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-complex64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); +const isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); ``` #### isSameComplex64( v1, v2 ) @@ -35,11 +35,11 @@ var isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); Tests if two arguments are both [single-precision complex floating-point numbers][@stdlib/complex/float32/ctor] and have the [same value][@stdlib/assert/is-same-value]. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var x = new Complex64( 1.0, 2.0 ); -var y = new Complex64( 1.0, 2.0 ); -var bool = isSameComplex64( x, y ); +const x = new Complex64( 1.0, 2.0 ); +const y = new Complex64( 1.0, 2.0 ); +const bool = isSameComplex64( x, y ); // returns true ``` @@ -64,12 +64,12 @@ var bool = isSameComplex64( x, y ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); -var x = new Complex64( 1.0, 2.0 ); -var y = new Complex64( 1.0, 2.0 ); -var out = isSameComplex64( x, y ); +let x = new Complex64( 1.0, 2.0 ); +let y = new Complex64( 1.0, 2.0 ); +let out = isSameComplex64( x, y ); // returns true x = new Complex64( 0.0, -0.0 ); diff --git a/lib/node_modules/@stdlib/assert/is-same-complex64array/README.md b/lib/node_modules/@stdlib/assert/is-same-complex64array/README.md index cda95836bfa4..929f2a4f0166 100644 --- a/lib/node_modules/@stdlib/assert/is-same-complex64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-complex64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +const isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); ``` #### isSameComplex64Array( v1, v2 ) @@ -35,11 +35,11 @@ var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); Tests if two arguments are both [Complex64Arrays][@stdlib/array/complex64] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var x = new Complex64Array( [ 1.0, 2.0 ] ); -var y = new Complex64Array( [ 1.0, 2.0 ] ); -var bool = isSameComplex64Array( x, y ); +const x = new Complex64Array( [ 1.0, 2.0 ] ); +const y = new Complex64Array( [ 1.0, 2.0 ] ); +let bool = isSameComplex64Array( x, y ); // returns true bool = isSameComplex64Array( x, [ 1.0, 2.0 ] ); @@ -67,12 +67,12 @@ bool = isSameComplex64Array( x, [ 1.0, 2.0 ] ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var out = isSameComplex64Array( x, y ); +let x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let y = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +let out = isSameComplex64Array( x, y ); // returns true x = new Complex64Array( [ -0.0, 0.0, -0.0, 0.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md index ca7a7af7a886..47f647cc446f 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); +const isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); ``` #### isSameDateObject( d1, d2 ) @@ -35,9 +35,9 @@ var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); Tests if two values are both Date objects corresponding to the same date and time. ```javascript -var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); -var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); -var bool = isSameDateObject( d1, d2 ); +const d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +const d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +let bool = isSameDateObject( d1, d2 ); // returns true bool = isSameDateObject( d1, new Date( 2023, 11, 31, 23, 59, 59, 78 ) ); @@ -55,12 +55,12 @@ bool = isSameDateObject( d1, new Date( 2023, 11, 31, 23, 59, 59, 78 ) ); ```javascript -var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); +const isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); -var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); -var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +let d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +let d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); -var bool = isSameDateObject( d1, d2 ); +let bool = isSameDateObject( d1, d2 ); // returns true d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); @@ -75,8 +75,8 @@ d2 = new Date( '2024-12-31T23:59:59.999' ); bool = isSameDateObject( d1, d2 ); // returns false -var d3 = new Date( 2024, 11, 31 ); -var d4 = new Date( 'December 31, 2024 23:59:59:999' ); +const d3 = new Date( 2024, 11, 31 ); +const d4 = new Date( 'December 31, 2024 23:59:59:999' ); bool = isSameDateObject( d1, d3 ); // returns false diff --git a/lib/node_modules/@stdlib/assert/is-same-float32array/README.md b/lib/node_modules/@stdlib/assert/is-same-float32array/README.md index 5dc24e430630..d01d70adc8f8 100644 --- a/lib/node_modules/@stdlib/assert/is-same-float32array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-float32array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +const isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); ``` #### isSameFloat32Array( v1, v2 ) @@ -35,11 +35,11 @@ var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); Tests if two arguments are both [Float32Arrays][@stdlib/array/float32] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0 ] ); -var y = new Float32Array( [ 1.0, 2.0 ] ); -var bool = isSameFloat32Array( x, y ); +const x = new Float32Array( [ 1.0, 2.0 ] ); +const y = new Float32Array( [ 1.0, 2.0 ] ); +let bool = isSameFloat32Array( x, y ); // returns true bool = isSameFloat32Array( x, [ 1.0, 2.0 ] ); @@ -67,12 +67,12 @@ bool = isSameFloat32Array( x, [ 1.0, 2.0 ] ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +const Float32Array = require( '@stdlib/array/float32' ); +const isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var out = isSameFloat32Array( x, y ); +let x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +let y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +let out = isSameFloat32Array( x, y ); // returns true x = new Float32Array( [ -0.0, 0.0, -0.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-float64array/README.md b/lib/node_modules/@stdlib/assert/is-same-float64array/README.md index 14a45149f9e2..98e405b40379 100644 --- a/lib/node_modules/@stdlib/assert/is-same-float64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-float64array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); +const isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); ``` #### isSameFloat64Array( v1, v2 ) @@ -35,11 +35,11 @@ var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); Tests if two arguments are both [Float64Arrays][@stdlib/array/float64] and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0 ] ); -var y = new Float64Array( [ 1.0, 2.0 ] ); -var bool = isSameFloat64Array( x, y ); +const x = new Float64Array( [ 1.0, 2.0 ] ); +const y = new Float64Array( [ 1.0, 2.0 ] ); +let bool = isSameFloat64Array( x, y ); // returns true bool = isSameFloat64Array( x, [ 1.0, 2.0 ] ); @@ -67,12 +67,12 @@ bool = isSameFloat64Array( x, [ 1.0, 2.0 ] ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var out = isSameFloat64Array( x, y ); +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let out = isSameFloat64Array( x, y ); // returns true x = new Float64Array( [ -0.0, 0.0, -0.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-native-class/README.md b/lib/node_modules/@stdlib/assert/is-same-native-class/README.md index d80da327092b..5be4ec74e692 100644 --- a/lib/node_modules/@stdlib/assert/is-same-native-class/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-native-class/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); +const isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); ``` #### isSameNativeClass( a, b ) @@ -35,7 +35,7 @@ var isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); Tests if two arguments `a` and `b` have the same [native class][@stdlib/utils/native-class]. ```javascript -var bool = isSameNativeClass( 'beep', 'boop' ); +let bool = isSameNativeClass( 'beep', 'boop' ); // returns true bool = isSameNativeClass( [], {} ); @@ -61,10 +61,10 @@ bool = isSameNativeClass( [], {} ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); +const Number = require( '@stdlib/number/ctor' ); +const isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); -var bool = isSameNativeClass( 3.14, new Number( 3.14 ) ); +let bool = isSameNativeClass( 3.14, new Number( 3.14 ) ); // returns true bool = isSameNativeClass( 'beep', 'boop' ); diff --git a/lib/node_modules/@stdlib/assert/is-same-type/README.md b/lib/node_modules/@stdlib/assert/is-same-type/README.md index 93cf08f6af8c..84163c89f4fa 100644 --- a/lib/node_modules/@stdlib/assert/is-same-type/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-type/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameType = require( '@stdlib/assert/is-same-type' ); +const isSameType = require( '@stdlib/assert/is-same-type' ); ``` #### isSameType( a, b ) @@ -35,7 +35,7 @@ var isSameType = require( '@stdlib/assert/is-same-type' ); Tests if two arguments `a` and `b` have the same type. ```javascript -var bool = isSameType( false, true ); +let bool = isSameType( false, true ); // returns true bool = isSameType( 'beep', 'boop' ); @@ -67,9 +67,9 @@ bool = isSameType( 0.0, '0.0' ); ```javascript -var isSameType = require( '@stdlib/assert/is-same-type' ); +const isSameType = require( '@stdlib/assert/is-same-type' ); -var bool = isSameType( true, false ); +let bool = isSameType( true, false ); // returns true bool = isSameType( 3.14, -3.14 ); diff --git a/lib/node_modules/@stdlib/assert/is-same-typed-array-like/README.md b/lib/node_modules/@stdlib/assert/is-same-typed-array-like/README.md index b5fc51528ef8..890cf6b34888 100644 --- a/lib/node_modules/@stdlib/assert/is-same-typed-array-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-typed-array-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameTypedArrayLike = require( '@stdlib/assert/is-same-typed-array-like' ); +const isSameTypedArrayLike = require( '@stdlib/assert/is-same-typed-array-like' ); ``` #### isSameTypedArrayLike( v1, v2 ) @@ -35,12 +35,12 @@ var isSameTypedArrayLike = require( '@stdlib/assert/is-same-typed-array-like' ); Tests if two arguments are both typed-array-like objects and have the [same values][@stdlib/assert/is-same-value]. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); -var x = new Int8Array( [ 1.0, 2.0 ] ); -var y = new Int16Array( [ 1.0, 2.0 ] ); -var bool = isSameTypedArrayLike( x, y ); +const x = new Int8Array( [ 1.0, 2.0 ] ); +const y = new Int16Array( [ 1.0, 2.0 ] ); +let bool = isSameTypedArrayLike( x, y ); // returns true bool = isSameTypedArrayLike( x, new Int8Array( [ -1.0, 2.0 ] ) ); @@ -58,13 +58,13 @@ bool = isSameTypedArrayLike( x, new Int8Array( [ -1.0, 2.0 ] ) ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var isSameTypedArrayLike = require( '@stdlib/assert/is-same-typed-array-like' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const isSameTypedArrayLike = require( '@stdlib/assert/is-same-typed-array-like' ); -var x = new Int8Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Int16Array( [ 1.0, 2.0, 3.0 ] ); -var out = isSameTypedArrayLike( x, y ); +let x = new Int8Array( [ 1.0, 2.0, 3.0 ] ); +let y = new Int16Array( [ 1.0, 2.0, 3.0 ] ); +let out = isSameTypedArrayLike( x, y ); // returns true x = new Int8Array( [ 1.0, 2.0, 3.0 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/assert/is-same-value-zero/README.md index 615d19f74ba4..6cb326eb9b06 100644 --- a/lib/node_modules/@stdlib/assert/is-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-value-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValueZero = require( '@stdlib/assert/is-same-value-zero' ); +const isSameValueZero = require( '@stdlib/assert/is-same-value-zero' ); ``` #### isSameValueZero( a, b ) @@ -35,7 +35,7 @@ var isSameValueZero = require( '@stdlib/assert/is-same-value-zero' ); Tests if two arguments `a` and `b` are the same value. ```javascript -var bool = isSameValueZero( false, false ); +let bool = isSameValueZero( false, false ); // returns true bool = isSameValueZero( '', '' ); @@ -50,7 +50,7 @@ In contrast to the strict equality operator `===`, the function treats `NaNs` as ```javascript -var bool = ( NaN === NaN ); +let bool = ( NaN === NaN ); // returns false bool = isSameValueZero( NaN, NaN ); @@ -62,7 +62,7 @@ In contrast to the [SameValue Algorithm][@stdlib/assert/is-same-value], the func ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValueZero( 0.0, -0.0 ); @@ -89,9 +89,9 @@ bool = isSameValueZero( -0.0, 0.0 ); ```javascript -var isSameValueZero = require( '@stdlib/assert/is-same-value-zero' ); +const isSameValueZero = require( '@stdlib/assert/is-same-value-zero' ); -var bool = isSameValueZero( true, true ); +let bool = isSameValueZero( true, true ); // returns true bool = isSameValueZero( true, false ); diff --git a/lib/node_modules/@stdlib/assert/is-same-value/README.md b/lib/node_modules/@stdlib/assert/is-same-value/README.md index b87fe852efbf..e31e7e74e519 100644 --- a/lib/node_modules/@stdlib/assert/is-same-value/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-value/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValue = require( '@stdlib/assert/is-same-value' ); +const isSameValue = require( '@stdlib/assert/is-same-value' ); ``` #### isSameValue( a, b ) @@ -35,7 +35,7 @@ var isSameValue = require( '@stdlib/assert/is-same-value' ); Tests if two arguments `a` and `b` are the same value. ```javascript -var bool = isSameValue( false, false ); +let bool = isSameValue( false, false ); // returns true bool = isSameValue( '', '' ); @@ -50,7 +50,7 @@ In contrast to the strict equality operator `===`, the function distinguishes be ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValue( 0.0, -0.0 ); @@ -87,9 +87,9 @@ bool = isSameValue( NaN, NaN ); ```javascript -var isSameValue = require( '@stdlib/assert/is-same-value' ); +const isSameValue = require( '@stdlib/assert/is-same-value' ); -var bool = isSameValue( true, true ); +let bool = isSameValue( true, true ); // returns true bool = isSameValue( true, false ); diff --git a/lib/node_modules/@stdlib/assert/is-semver/README.md b/lib/node_modules/@stdlib/assert/is-semver/README.md index 8eaaeb2a3d7c..e8acabff2458 100644 --- a/lib/node_modules/@stdlib/assert/is-semver/README.md +++ b/lib/node_modules/@stdlib/assert/is-semver/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSemVer = require( '@stdlib/assert/is-semver' ); +const isSemVer = require( '@stdlib/assert/is-semver' ); ``` #### isSemVer( value ) @@ -35,7 +35,7 @@ var isSemVer = require( '@stdlib/assert/is-semver' ); Tests if a `value` is a [semantic version][semantic-version] string. ```javascript -var bool = isSemVer( '0.0.2' ); +let bool = isSemVer( '0.0.2' ); // returns true bool = isSemVer( 'foo' ); @@ -57,9 +57,9 @@ bool = isSemVer( 'foo' ); ## Examples ```javascript -var isSemVer = require( '@stdlib/assert/is-semver' ); +const isSemVer = require( '@stdlib/assert/is-semver' ); -var bool = isSemVer( '1.0.0' ); +let bool = isSemVer( '1.0.0' ); // returns true bool = isSemVer( '1.0.0-alpha.1' ); diff --git a/lib/node_modules/@stdlib/assert/is-sharedarraybuffer/README.md b/lib/node_modules/@stdlib/assert/is-sharedarraybuffer/README.md index d8c0af26bb91..b1e935fc284a 100644 --- a/lib/node_modules/@stdlib/assert/is-sharedarraybuffer/README.md +++ b/lib/node_modules/@stdlib/assert/is-sharedarraybuffer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSharedArrayBuffer = require( '@stdlib/assert/is-sharedarraybuffer' ); +const isSharedArrayBuffer = require( '@stdlib/assert/is-sharedarraybuffer' ); ``` #### isSharedArrayBuffer( value ) @@ -37,9 +37,9 @@ Tests if a value is a [`SharedArrayBuffer`][mdn-sharedarraybuffer]. ```javascript -var SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); +const SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); -var bool; +let bool; try { bool = isSharedArrayBuffer( new SharedArrayBuffer( 10 ) ); // returns true @@ -64,20 +64,20 @@ bool = isSharedArrayBuffer( [] ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); -var isSharedArrayBuffer = require( '@stdlib/assert/is-sharedarraybuffer' ); - -var bool; +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const SharedArrayBuffer = require( '@stdlib/array/shared-buffer' ); +const isSharedArrayBuffer = require( '@stdlib/assert/is-sharedarraybuffer' ); + +let bool; try { bool = isSharedArrayBuffer( new SharedArrayBuffer( 10 ) ); // returns true diff --git a/lib/node_modules/@stdlib/assert/is-skew-centrosymmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-skew-centrosymmetric-matrix/README.md index a4a5cd568c2f..42e024f636a3 100644 --- a/lib/node_modules/@stdlib/assert/is-skew-centrosymmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-skew-centrosymmetric-matrix/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var isSkewCentrosymmetricMatrix = require( '@stdlib/assert/is-skew-centrosymmetric-matrix' ); +const isSkewCentrosymmetricMatrix = require( '@stdlib/assert/is-skew-centrosymmetric-matrix' ); ``` #### isSkewCentrosymmetricMatrix( value ) @@ -41,16 +41,16 @@ Tests if a value is a [skew-centrosymmetric matrix][centrosymmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = [ +const buffer = [ 1, 2, 3, 4, 0, -4, -3, -2, -1 ]; -var arr = ndarray( 'generic', buffer, [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ); +const arr = ndarray( 'generic', buffer, [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ); -var bool = isSkewCentrosymmetricMatrix( arr ); +const bool = isSkewCentrosymmetricMatrix( arr ); // returns true ``` @@ -67,11 +67,11 @@ var bool = isSkewCentrosymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isSkewCentrosymmetricMatrix = require( '@stdlib/assert/is-skew-centrosymmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isSkewCentrosymmetricMatrix = require( '@stdlib/assert/is-skew-centrosymmetric-matrix' ); -var arr = ndarray( 'generic', [ 2, 1, -1, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isSkewCentrosymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 2, 1, -1, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isSkewCentrosymmetricMatrix( arr ); // returns true out = isSkewCentrosymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-skew-persymmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-skew-persymmetric-matrix/README.md index d958be2164c8..8837bf6aeb35 100644 --- a/lib/node_modules/@stdlib/assert/is-skew-persymmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-skew-persymmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSkewPersymmetricMatrix = require( '@stdlib/assert/is-skew-persymmetric-matrix' ); +const isSkewPersymmetricMatrix = require( '@stdlib/assert/is-skew-persymmetric-matrix' ); ``` #### isSkewPersymmetricMatrix( value ) @@ -35,10 +35,10 @@ var isSkewPersymmetricMatrix = require( '@stdlib/assert/is-skew-persymmetric-mat Tests if a value is a [skew-persymmetric matrix][persymmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 2, 0, 0, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isSkewPersymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 2, 0, 0, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isSkewPersymmetricMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isSkewPersymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isSkewPersymmetricMatrix = require( '@stdlib/assert/is-skew-persymmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isSkewPersymmetricMatrix = require( '@stdlib/assert/is-skew-persymmetric-matrix' ); -var arr = ndarray( 'generic', [ 1, 0, 0, -1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isSkewPersymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 1, 0, 0, -1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isSkewPersymmetricMatrix( arr ); // returns true out = isSkewPersymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-skew-symmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-skew-symmetric-matrix/README.md index 55f03d599730..e0720aee571c 100644 --- a/lib/node_modules/@stdlib/assert/is-skew-symmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-skew-symmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSkewSymmetricMatrix = require( '@stdlib/assert/is-skew-symmetric-matrix' ); +const isSkewSymmetricMatrix = require( '@stdlib/assert/is-skew-symmetric-matrix' ); ``` #### isSkewSymmetricMatrix( value ) @@ -35,10 +35,10 @@ var isSkewSymmetricMatrix = require( '@stdlib/assert/is-skew-symmetric-matrix' ) Tests if a value is a [skew-symmetric matrix][skew-symmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 1, -1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isSkewSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 0, 1, -1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isSkewSymmetricMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isSkewSymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isSkewSymmetricMatrix = require( '@stdlib/assert/is-skew-symmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isSkewSymmetricMatrix = require( '@stdlib/assert/is-skew-symmetric-matrix' ); -var arr = ndarray( 'generic', [ 0, -1, 1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isSkewSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 0, -1, 1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isSkewSymmetricMatrix( arr ); // returns true out = isSkewSymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-slice/README.md b/lib/node_modules/@stdlib/assert/is-slice/README.md index ce321982dd63..943de5592d3f 100644 --- a/lib/node_modules/@stdlib/assert/is-slice/README.md +++ b/lib/node_modules/@stdlib/assert/is-slice/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSlice = require( '@stdlib/assert/is-slice' ); +const isSlice = require( '@stdlib/assert/is-slice' ); ``` #### isSlice( value ) @@ -35,11 +35,11 @@ var isSlice = require( '@stdlib/assert/is-slice' ); Tests if a value is a [`Slice`][@stdlib/slice/ctor]. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 0, 10 ); +const s = new Slice( 0, 10 ); -var bool = isSlice( s ); +const bool = isSlice( s ); // returns true ``` @@ -54,10 +54,10 @@ var bool = isSlice( s ); ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var isSlice = require( '@stdlib/assert/is-slice' ); +const Slice = require( '@stdlib/slice/ctor' ); +const isSlice = require( '@stdlib/assert/is-slice' ); -var out = isSlice( new Slice( 0, 10, 1 ) ); +let out = isSlice( new Slice( 0, 10, 1 ) ); // returns true out = isSlice( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-snakecase/README.md b/lib/node_modules/@stdlib/assert/is-snakecase/README.md index e1bc38418a69..be8d7877e999 100644 --- a/lib/node_modules/@stdlib/assert/is-snakecase/README.md +++ b/lib/node_modules/@stdlib/assert/is-snakecase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSnakecase = require( '@stdlib/assert/is-snakecase' ); +const isSnakecase = require( '@stdlib/assert/is-snakecase' ); ``` #### isSnakecase( value ) @@ -35,7 +35,7 @@ var isSnakecase = require( '@stdlib/assert/is-snakecase' ); Tests if a `value` is a `string` in snake case. ```javascript -var bool = isSnakecase( 'hello_world' ); +let bool = isSnakecase( 'hello_world' ); // returns true bool = isSnakecase( 'Hello World' ); @@ -63,9 +63,9 @@ bool = isSnakecase( 'Hello World' ); ```javascript -var isSnakecase = require( '@stdlib/assert/is-snakecase' ); +const isSnakecase = require( '@stdlib/assert/is-snakecase' ); -var bool = isSnakecase( 'foo_bar_baz' ); +let bool = isSnakecase( 'foo_bar_baz' ); // returns true bool = isSnakecase( 'FOO_BAR' ); diff --git a/lib/node_modules/@stdlib/assert/is-square-matrix/README.md b/lib/node_modules/@stdlib/assert/is-square-matrix/README.md index f76f28843413..cfd96e03a4d7 100644 --- a/lib/node_modules/@stdlib/assert/is-square-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-square-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSquareMatrix = require( '@stdlib/assert/is-square-matrix' ); +const isSquareMatrix = require( '@stdlib/assert/is-square-matrix' ); ``` #### isSquareMatrix( value ) @@ -35,10 +35,10 @@ var isSquareMatrix = require( '@stdlib/assert/is-square-matrix' ); Tests if a value is a 2-dimensional [ndarray][@stdlib/ndarray/ctor]-like object having equal dimensions. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isSquareMatrix( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isSquareMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isSquareMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isSquareMatrix = require( '@stdlib/assert/is-square-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isSquareMatrix = require( '@stdlib/assert/is-square-matrix' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isSquareMatrix( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isSquareMatrix( arr ); // returns true out = isSquareMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-square-number/README.md b/lib/node_modules/@stdlib/assert/is-square-number/README.md index 3a4d488c94d6..ebf2c346ca2f 100644 --- a/lib/node_modules/@stdlib/assert/is-square-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-square-number/README.md @@ -35,7 +35,7 @@ A **square number** is defined as an integer value which is the square of an int ## Usage ```javascript -var isSquareNumber = require( '@stdlib/assert/is-square-number' ); +const isSquareNumber = require( '@stdlib/assert/is-square-number' ); ``` #### isSquareNumber( value ) @@ -45,9 +45,9 @@ Tests if a `value` is a square number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareNumber( 4.0 ); +let bool = isSquareNumber( 4.0 ); // returns true bool = isSquareNumber( new Number( 4.0 ) ); @@ -73,9 +73,9 @@ Tests if a `value` is a primitive square number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareNumber.isPrimitive( 4.0 ); +let bool = isSquareNumber.isPrimitive( 4.0 ); // returns true bool = isSquareNumber.isPrimitive( new Number( 4.0 ) ); @@ -89,9 +89,9 @@ Tests if a `value` is a `Number` object having a value which is a square number. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareNumber.isObject( 4.0 ); +let bool = isSquareNumber.isObject( 4.0 ); // returns false bool = isSquareNumber.isObject( new Number( 4.0 ) ); @@ -111,10 +111,10 @@ bool = isSquareNumber.isObject( new Number( 4.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isSquareNumber = require( '@stdlib/assert/is-square-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isSquareNumber = require( '@stdlib/assert/is-square-number' ); -var bool = isSquareNumber( 4.0 ); +let bool = isSquareNumber( 4.0 ); // returns true bool = isSquareNumber( new Number( 4.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-square-triangular-number/README.md b/lib/node_modules/@stdlib/assert/is-square-triangular-number/README.md index 6b7aeac2487a..49ab2a598ba9 100644 --- a/lib/node_modules/@stdlib/assert/is-square-triangular-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-square-triangular-number/README.md @@ -69,7 +69,7 @@ Accordingly, an integer `x` is a [triangular number][@stdlib/assert/is-triangula ## Usage ```javascript -var isSquareTriangularNumber = require( '@stdlib/assert/is-square-triangular-number' ); +const isSquareTriangularNumber = require( '@stdlib/assert/is-square-triangular-number' ); ``` #### isSquareTriangularNumber( value ) @@ -79,9 +79,9 @@ Tests if a `value` is a [square triangular number][square-triangular-number]. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareTriangularNumber( 36.0 ); +let bool = isSquareTriangularNumber( 36.0 ); // returns true bool = isSquareTriangularNumber( new Number( 36.0 ) ); @@ -107,9 +107,9 @@ Tests if a `value` is a primitive [square triangular number][square-triangular-n ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareTriangularNumber.isPrimitive( 36.0 ); +let bool = isSquareTriangularNumber.isPrimitive( 36.0 ); // returns true bool = isSquareTriangularNumber.isPrimitive( new Number( 36.0 ) ); @@ -123,9 +123,9 @@ Tests if a `value` is a `Number` object having a value which is a [square triang ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isSquareTriangularNumber.isObject( 36.0 ); +let bool = isSquareTriangularNumber.isObject( 36.0 ); // returns false bool = isSquareTriangularNumber.isObject( new Number( 36.0 ) ); @@ -155,10 +155,10 @@ bool = isSquareTriangularNumber.isObject( new Number( 36.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isSquareTriangularNumber = require( '@stdlib/assert/is-square-triangular-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isSquareTriangularNumber = require( '@stdlib/assert/is-square-triangular-number' ); -var bool = isSquareTriangularNumber( 36.0 ); +let bool = isSquareTriangularNumber( 36.0 ); // returns true bool = isSquareTriangularNumber( new Number( 36.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-startcase/README.md b/lib/node_modules/@stdlib/assert/is-startcase/README.md index 0197516293c6..e22c02255bf1 100644 --- a/lib/node_modules/@stdlib/assert/is-startcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-startcase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isStartcase = require( '@stdlib/assert/is-startcase' ); +const isStartcase = require( '@stdlib/assert/is-startcase' ); ``` #### isStartcase( value ) @@ -35,7 +35,7 @@ var isStartcase = require( '@stdlib/assert/is-startcase' ); Tests if a `value` is a startcase `string` (i.e., the first character of each word is uppercase). ```javascript -var bool = isStartcase( 'Beep Boop' ); +let bool = isStartcase( 'Beep Boop' ); // returns true bool = isStartcase( 'Beep and Boop' ); @@ -63,9 +63,9 @@ bool = isStartcase( 'Beep and Boop' ); ```javascript -var isStartcase = require( '@stdlib/assert/is-startcase' ); +const isStartcase = require( '@stdlib/assert/is-startcase' ); -var bool = isStartcase( 'Beep Boop' ); +let bool = isStartcase( 'Beep Boop' ); // returns true bool = isStartcase( 'BeepBoop123' ); diff --git a/lib/node_modules/@stdlib/assert/is-strict-equal/README.md b/lib/node_modules/@stdlib/assert/is-strict-equal/README.md index f63439bb6534..170402d649c2 100644 --- a/lib/node_modules/@stdlib/assert/is-strict-equal/README.md +++ b/lib/node_modules/@stdlib/assert/is-strict-equal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isStrictEqual = require( '@stdlib/assert/is-strict-equal' ); +const isStrictEqual = require( '@stdlib/assert/is-strict-equal' ); ``` #### isStrictEqual( a, b ) @@ -35,7 +35,7 @@ var isStrictEqual = require( '@stdlib/assert/is-strict-equal' ); Tests if two arguments `a` and `b` are strictly equal. ```javascript -var bool = isStrictEqual( false, false ); +let bool = isStrictEqual( false, false ); // returns true bool = isStrictEqual( '', '' ); @@ -53,7 +53,7 @@ In contrast to the strict equality operator `===`, the function distinguishes be ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isStrictEqual( 0.0, -0.0 ); @@ -74,9 +74,9 @@ bool = isStrictEqual( -0.0, -0.0 ); ```javascript -var isStrictEqual = require( '@stdlib/assert/is-strict-equal' ); +const isStrictEqual = require( '@stdlib/assert/is-strict-equal' ); -var bool = isStrictEqual( true, true ); +let bool = isStrictEqual( true, true ); // returns true bool = isStrictEqual( true, false ); diff --git a/lib/node_modules/@stdlib/assert/is-string-array/README.md b/lib/node_modules/@stdlib/assert/is-string-array/README.md index ff562253ecf8..bfa63acd60e2 100644 --- a/lib/node_modules/@stdlib/assert/is-string-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-string-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isStringArray = require( '@stdlib/assert/is-string-array' ); +const isStringArray = require( '@stdlib/assert/is-string-array' ); ``` #### isStringArray( value ) @@ -37,7 +37,7 @@ Tests if a `value` is an array of strings. ```javascript -var bool = isStringArray( [ 'beep', new String('boop') ] ); +let bool = isStringArray( [ 'beep', new String('boop') ] ); // returns true bool = isStringArray( [ 'beep', null ] ); @@ -51,7 +51,7 @@ Tests if a `value` is an `array` containing **only** `string` primitives. ```javascript -var bool = isStringArray.primitives( [ 'beep', 'boop' ] ); +let bool = isStringArray.primitives( [ 'beep', 'boop' ] ); // returns true bool = isStringArray.primitives( [ 'beep', new String('boop') ] ); @@ -65,7 +65,7 @@ Tests if a `value` is an `array` containing **only** `String` objects. ```javascript -var bool = isStringArray.objects( [ new String('beep'), new String('boop') ] ); +let bool = isStringArray.objects( [ new String('beep'), new String('boop') ] ); // returns true bool = isStringArray.objects( [ 'beep', new String('boop') ] ); @@ -85,9 +85,9 @@ bool = isStringArray.objects( [ 'beep', new String('boop') ] ); ```javascript -var isStringArray = require( '@stdlib/assert/is-string-array' ); +const isStringArray = require( '@stdlib/assert/is-string-array' ); -var bool = isStringArray( [ 'Hello World!' ] ); +let bool = isStringArray( [ 'Hello World!' ] ); // returns true bool = isStringArray( [ 'a', 'b', 'c' ] ); diff --git a/lib/node_modules/@stdlib/assert/is-string/README.md b/lib/node_modules/@stdlib/assert/is-string/README.md index 5794ac54ecbd..2bea416cb13e 100644 --- a/lib/node_modules/@stdlib/assert/is-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isString = require( '@stdlib/assert/is-string' ); +const isString = require( '@stdlib/assert/is-string' ); ``` #### isString( value ) @@ -37,7 +37,7 @@ Tests if a value is a `string`. ```javascript -var bool = isString( 'beep' ); +let bool = isString( 'beep' ); // returns true bool = isString( new String( 'beep' ) ); @@ -51,7 +51,7 @@ Tests if a `value` is a primitive `string`. ```javascript -var bool = isString.isPrimitive( 'beep' ); +let bool = isString.isPrimitive( 'beep' ); // returns true bool = isString.isPrimitive( new String( 'boop' ) ); @@ -65,7 +65,7 @@ Tests if a `value` is a `String` object. ```javascript -var bool = isString.isObject( 'beep' ); +let bool = isString.isObject( 'beep' ); // returns false bool = isString.isObject( new String( 'boop' ) ); @@ -85,9 +85,9 @@ bool = isString.isObject( new String( 'boop' ) ); ```javascript -var isString = require( '@stdlib/assert/is-string' ); +const isString = require( '@stdlib/assert/is-string' ); -var bool = isString( 'beep' ); +let bool = isString( 'beep' ); // returns true bool = isString( new String( 'beep' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-symbol-array/README.md b/lib/node_modules/@stdlib/assert/is-symbol-array/README.md index a039af0243f3..e91395e4ae05 100644 --- a/lib/node_modules/@stdlib/assert/is-symbol-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-symbol-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSymbolArray = require( '@stdlib/assert/is-symbol-array' ); +const isSymbolArray = require( '@stdlib/assert/is-symbol-array' ); ``` #### isSymbolArray( value ) @@ -35,9 +35,9 @@ var isSymbolArray = require( '@stdlib/assert/is-symbol-array' ); Tests if a `value` is an array-like object containing only [symbols][mdn-symbol]. ```javascript -var Symbol = require( '@stdlib/symbol/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbolArray( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); +let bool = isSymbolArray( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); // returns true bool = isSymbolArray( [ 'beep', 'boop' ] ); @@ -49,10 +49,10 @@ bool = isSymbolArray( [ 'beep', 'boop' ] ); Tests if a `value` is an array-like object containing only [`symbol`][mdn-symbol] primitives. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbolArray.primitives( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); +let bool = isSymbolArray.primitives( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); // returns true bool = isSymbolArray.primitives( [ Symbol( 'beep' ), Object( Symbol( 'boop' ) ) ] ); @@ -64,10 +64,10 @@ bool = isSymbolArray.primitives( [ Symbol( 'beep' ), Object( Symbol( 'boop' ) ) Tests if a `value` is an array-like object containing only [`Symbol`][mdn-symbol] objects. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbolArray.objects( [ Object( Symbol( 'beep' ) ), Object( Symbol( 'boop' ) ) ] ); +let bool = isSymbolArray.objects( [ Object( Symbol( 'beep' ) ), Object( Symbol( 'boop' ) ) ] ); // returns true bool = isSymbolArray.objects( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); @@ -85,12 +85,12 @@ bool = isSymbolArray.objects( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var isSymbolArray = require( '@stdlib/assert/is-symbol-array' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const isSymbolArray = require( '@stdlib/assert/is-symbol-array' ); -var hasSymbols = hasSymbolSupport(); -var bool; +const hasSymbols = hasSymbolSupport(); +let bool; if ( hasSymbols ) { bool = isSymbolArray( [ Symbol( 'beep' ), Symbol( 'boop' ) ] ); diff --git a/lib/node_modules/@stdlib/assert/is-symbol/README.md b/lib/node_modules/@stdlib/assert/is-symbol/README.md index 68e5920e7992..8a78db4c1708 100644 --- a/lib/node_modules/@stdlib/assert/is-symbol/README.md +++ b/lib/node_modules/@stdlib/assert/is-symbol/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSymbol = require( '@stdlib/assert/is-symbol' ); +const isSymbol = require( '@stdlib/assert/is-symbol' ); ``` #### isSymbol( value ) @@ -35,10 +35,10 @@ var isSymbol = require( '@stdlib/assert/is-symbol' ); Tests if a value is a [symbol][mdn-symbol]. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbol( Symbol( 'beep' ) ); +let bool = isSymbol( Symbol( 'beep' ) ); // returns true bool = isSymbol( Object( Symbol( 'beep' ) ) ); @@ -50,10 +50,10 @@ bool = isSymbol( Object( Symbol( 'beep' ) ) ); Tests if a `value` is a primitive [symbol][mdn-symbol]. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbol.isPrimitive( Symbol( 'beep' ) ); +let bool = isSymbol.isPrimitive( Symbol( 'beep' ) ); // returns true bool = isSymbol.isPrimitive( Object( Symbol( 'boop' ) ) ); @@ -65,10 +65,10 @@ bool = isSymbol.isPrimitive( Object( Symbol( 'boop' ) ) ); Tests if a `value` is a [`Symbol`][mdn-symbol] object. ```javascript -var Object = require( '@stdlib/object/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const Object = require( '@stdlib/object/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var bool = isSymbol.isObject( Symbol( 'beep' ) ); +let bool = isSymbol.isObject( Symbol( 'beep' ) ); // returns false bool = isSymbol.isObject( Object( Symbol( 'boop' ) ) ); @@ -88,11 +88,11 @@ bool = isSymbol.isObject( Object( Symbol( 'boop' ) ) ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var isSymbol = require( '@stdlib/assert/is-symbol' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const isSymbol = require( '@stdlib/assert/is-symbol' ); -var bool; +let bool; if ( hasSymbolSupport() ) { bool = isSymbol( Symbol( 'beep' ) ); // returns true diff --git a/lib/node_modules/@stdlib/assert/is-symmetric-matrix/README.md b/lib/node_modules/@stdlib/assert/is-symmetric-matrix/README.md index f769ec9cfd5f..d4eb65642fe4 100644 --- a/lib/node_modules/@stdlib/assert/is-symmetric-matrix/README.md +++ b/lib/node_modules/@stdlib/assert/is-symmetric-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' ); +const isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' ); ``` #### isSymmetricMatrix( value ) @@ -35,10 +35,10 @@ var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' ); Tests if a value is a [symmetric matrix][symmetric-matrix]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var bool = isSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +const bool = isSymmetricMatrix( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isSymmetricMatrix( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isSymmetricMatrix = require( '@stdlib/assert/is-symmetric-matrix' ); -var arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); -var out = isSymmetricMatrix( arr ); +const arr = ndarray( 'generic', [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' ); +let out = isSymmetricMatrix( arr ); // returns true out = isSymmetricMatrix( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-syntax-error/README.md b/lib/node_modules/@stdlib/assert/is-syntax-error/README.md index 5c1f684f0d40..173688dab9ea 100644 --- a/lib/node_modules/@stdlib/assert/is-syntax-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-syntax-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSyntaxError = require( '@stdlib/assert/is-syntax-error' ); +const isSyntaxError = require( '@stdlib/assert/is-syntax-error' ); ``` #### isSyntaxError( value ) @@ -45,7 +45,7 @@ var isSyntaxError = require( '@stdlib/assert/is-syntax-error' ); Tests if a `value` is a [`SyntaxError`][mdn-syntax-error] object. ```javascript -var bool = isSyntaxError( new SyntaxError( 'beep' ) ); +const bool = isSyntaxError( new SyntaxError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isSyntaxError( new SyntaxError( 'beep' ) ); ```javascript -var isSyntaxError = require( '@stdlib/assert/is-syntax-error' ); +const isSyntaxError = require( '@stdlib/assert/is-syntax-error' ); -var bool = isSyntaxError( new SyntaxError( 'syntax error' ) ); +let bool = isSyntaxError( new SyntaxError( 'syntax error' ) ); // returns true bool = isSyntaxError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-touch-device/README.md b/lib/node_modules/@stdlib/assert/is-touch-device/README.md index 78af5b74cbce..b2ec71c8cb02 100644 --- a/lib/node_modules/@stdlib/assert/is-touch-device/README.md +++ b/lib/node_modules/@stdlib/assert/is-touch-device/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_TOUCH_DEVICE = require( '@stdlib/assert/is-touch-device' ); +const IS_TOUCH_DEVICE = require( '@stdlib/assert/is-touch-device' ); ``` #### IS_TOUCH_DEVICE @@ -35,7 +35,7 @@ var IS_TOUCH_DEVICE = require( '@stdlib/assert/is-touch-device' ); `Boolean` indicating if the current environment is a touch device. ```javascript -var bool = IS_TOUCH_DEVICE; +const bool = IS_TOUCH_DEVICE; // returns ``` @@ -56,7 +56,7 @@ var bool = IS_TOUCH_DEVICE; ```javascript -var IS_TOUCH_DEVICE = require( '@stdlib/assert/is-touch-device' ); +const IS_TOUCH_DEVICE = require( '@stdlib/assert/is-touch-device' ); console.log( IS_TOUCH_DEVICE ); // => diff --git a/lib/node_modules/@stdlib/assert/is-triangular-number/README.md b/lib/node_modules/@stdlib/assert/is-triangular-number/README.md index 29bc4f620476..364b849cb9c8 100644 --- a/lib/node_modules/@stdlib/assert/is-triangular-number/README.md +++ b/lib/node_modules/@stdlib/assert/is-triangular-number/README.md @@ -67,7 +67,7 @@ Accordingly, an integer `x` is a [triangular number][triangular-number] **if and ## Usage ```javascript -var isTriangularNumber = require( '@stdlib/assert/is-triangular-number' ); +const isTriangularNumber = require( '@stdlib/assert/is-triangular-number' ); ``` #### isTriangularNumber( value ) @@ -77,9 +77,9 @@ Tests if a `value` is a [triangular number][triangular-number]. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isTriangularNumber( 36.0 ); +let bool = isTriangularNumber( 36.0 ); // returns true bool = isTriangularNumber( new Number( 36.0 ) ); @@ -105,9 +105,9 @@ Tests if a `value` is a primitive [triangular number][triangular-number]. ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isTriangularNumber.isPrimitive( 36.0 ); +let bool = isTriangularNumber.isPrimitive( 36.0 ); // returns true bool = isTriangularNumber.isPrimitive( new Number( 36.0 ) ); @@ -121,9 +121,9 @@ Tests if a `value` is a `Number` object having a value which is a [triangular nu ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); -var bool = isTriangularNumber.isObject( 36.0 ); +let bool = isTriangularNumber.isObject( 36.0 ); // returns false bool = isTriangularNumber.isObject( new Number( 36.0 ) ); @@ -153,10 +153,10 @@ bool = isTriangularNumber.isObject( new Number( 36.0 ) ); ```javascript -var Number = require( '@stdlib/number/ctor' ); -var isTriangularNumber = require( '@stdlib/assert/is-triangular-number' ); +const Number = require( '@stdlib/number/ctor' ); +const isTriangularNumber = require( '@stdlib/assert/is-triangular-number' ); -var bool = isTriangularNumber( 36.0 ); +let bool = isTriangularNumber( 36.0 ); // returns true bool = isTriangularNumber( new Number( 36.0 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-truthy-array/README.md b/lib/node_modules/@stdlib/assert/is-truthy-array/README.md index dc3aec2c032e..e81c049af390 100644 --- a/lib/node_modules/@stdlib/assert/is-truthy-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-truthy-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isTruthyArray = require( '@stdlib/assert/is-truthy-array' ); +const isTruthyArray = require( '@stdlib/assert/is-truthy-array' ); ``` #### isTruthyArray( value ) @@ -35,7 +35,7 @@ var isTruthyArray = require( '@stdlib/assert/is-truthy-array' ); Tests if a `value` is an array-like `object` containing only truthy values. ```javascript -var bool = isTruthyArray( [ [], {} ] ); +let bool = isTruthyArray( [ [], {} ] ); // returns true bool = isTruthyArray( [ '', null, void 0, false, 0, NaN ] ); @@ -53,9 +53,9 @@ bool = isTruthyArray( [ '', null, void 0, false, 0, NaN ] ); ```javascript -var isTruthyArray = require( '@stdlib/assert/is-truthy-array' ); +const isTruthyArray = require( '@stdlib/assert/is-truthy-array' ); -var bool = isTruthyArray( [ [], {}, true, 'a', 5, -5 ] ); +let bool = isTruthyArray( [ [], {}, true, 'a', 5, -5 ] ); // returns true bool = isTruthyArray( [ null, '', NaN, 0, void 0, false ] ); diff --git a/lib/node_modules/@stdlib/assert/is-truthy/README.md b/lib/node_modules/@stdlib/assert/is-truthy/README.md index 7559e0c5db18..880d5c13341d 100644 --- a/lib/node_modules/@stdlib/assert/is-truthy/README.md +++ b/lib/node_modules/@stdlib/assert/is-truthy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isTruthy = require( '@stdlib/assert/is-truthy' ); +const isTruthy = require( '@stdlib/assert/is-truthy' ); ``` #### isTruthy( value ) @@ -35,7 +35,7 @@ var isTruthy = require( '@stdlib/assert/is-truthy' ); Tests if a `value` is a value which translates to `true` when evaluated in a boolean context. ```javascript -var bool = isTruthy( true ); +let bool = isTruthy( true ); // returns true bool = isTruthy( [] ); @@ -73,9 +73,9 @@ bool = isTruthy( void 0 ); ```javascript -var isTruthy = require( '@stdlib/assert/is-truthy' ); +const isTruthy = require( '@stdlib/assert/is-truthy' ); -var bool = isTruthy( true ); +let bool = isTruthy( true ); // returns true bool = isTruthy( 'beep' ); diff --git a/lib/node_modules/@stdlib/assert/is-type-error/README.md b/lib/node_modules/@stdlib/assert/is-type-error/README.md index 6279c84788c2..b6de10817cae 100644 --- a/lib/node_modules/@stdlib/assert/is-type-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-type-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isTypeError = require( '@stdlib/assert/is-type-error' ); +const isTypeError = require( '@stdlib/assert/is-type-error' ); ``` #### isTypeError( value ) @@ -45,7 +45,7 @@ var isTypeError = require( '@stdlib/assert/is-type-error' ); Tests if a `value` is a [`TypeError`][mdn-type-error] object. ```javascript -var bool = isTypeError( new TypeError( 'beep' ) ); +const bool = isTypeError( new TypeError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isTypeError( new TypeError( 'beep' ) ); ```javascript -var isTypeError = require( '@stdlib/assert/is-type-error' ); +const isTypeError = require( '@stdlib/assert/is-type-error' ); -var bool = isTypeError( new TypeError( 'type error' ) ); +let bool = isTypeError( new TypeError( 'type error' ) ); // returns true bool = isTypeError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-typed-array-length/README.md b/lib/node_modules/@stdlib/assert/is-typed-array-length/README.md index 6d28a1d9cce8..b50af6ebe100 100644 --- a/lib/node_modules/@stdlib/assert/is-typed-array-length/README.md +++ b/lib/node_modules/@stdlib/assert/is-typed-array-length/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isTypedArrayLength = require( '@stdlib/assert/is-typed-array-length' ); +const isTypedArrayLength = require( '@stdlib/assert/is-typed-array-length' ); ``` #### isTypedArrayLength( value ) @@ -35,7 +35,7 @@ var isTypedArrayLength = require( '@stdlib/assert/is-typed-array-length' ); Tests if a value is a valid [typed array][mdn-typed-array] length. ```javascript -var bool = isTypedArrayLength( 5 ); +let bool = isTypedArrayLength( 5 ); // returns true bool = isTypedArrayLength( -1 ); @@ -72,9 +72,9 @@ bool = isTypedArrayLength( null ); ```javascript -var isTypedArrayLength = require( '@stdlib/assert/is-typed-array-length' ); +const isTypedArrayLength = require( '@stdlib/assert/is-typed-array-length' ); -var bool = isTypedArrayLength( 5 ); +let bool = isTypedArrayLength( 5 ); // returns true bool = isTypedArrayLength( 0 ); diff --git a/lib/node_modules/@stdlib/assert/is-typed-array-like/README.md b/lib/node_modules/@stdlib/assert/is-typed-array-like/README.md index c88415eecf40..a7bff0f8870f 100644 --- a/lib/node_modules/@stdlib/assert/is-typed-array-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-typed-array-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +const isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); ``` #### isTypedArrayLike( value ) @@ -35,9 +35,9 @@ var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); Tests if a value is [typed-array][mdn-typed-array]-like. ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); -var bool = isTypedArrayLike( new Int16Array() ); +let bool = isTypedArrayLike( new Int16Array() ); // returns true bool = isTypedArrayLike({ @@ -62,19 +62,16 @@ bool = isTypedArrayLike({ ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +const Int8Array = require( '@stdlib/array/int8' ); +const isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); -var bool; -var arr; - -arr = { +const arr = { 'BYTES_PER_ELEMENT': 8, 'length': 10, 'byteOffset': 0, 'byteLength': 10 }; -bool = isTypedArrayLike( arr ); +let bool = isTypedArrayLike( arr ); // returns true bool = isTypedArrayLike( new Int8Array( 4 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-typed-array/README.md b/lib/node_modules/@stdlib/assert/is-typed-array/README.md index 7f2edf0e87d9..10046d6c2aef 100644 --- a/lib/node_modules/@stdlib/assert/is-typed-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-typed-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +const isTypedArray = require( '@stdlib/assert/is-typed-array' ); ``` #### isTypedArray( value ) @@ -35,9 +35,9 @@ var isTypedArray = require( '@stdlib/assert/is-typed-array' ); Tests if a value is a [typed array][mdn-typed-array]. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var bool = isTypedArray( new Int8Array( 10 ) ); +let bool = isTypedArray( new Int8Array( 10 ) ); // returns true bool = isTypedArray( [] ); @@ -55,19 +55,19 @@ bool = isTypedArray( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isTypedArray = require( '@stdlib/assert/is-typed-array' ); - -var arr = new Int8Array( 10 ); -var bool = isTypedArray( arr ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isTypedArray = require( '@stdlib/assert/is-typed-array' ); + +let arr = new Int8Array( 10 ); +let bool = isTypedArray( arr ); // returns true arr = new Uint8Array( 10 ); diff --git a/lib/node_modules/@stdlib/assert/is-uint16array/README.md b/lib/node_modules/@stdlib/assert/is-uint16array/README.md index 78ec63a49ffe..28a3d2d0cab5 100644 --- a/lib/node_modules/@stdlib/assert/is-uint16array/README.md +++ b/lib/node_modules/@stdlib/assert/is-uint16array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +const isUint16Array = require( '@stdlib/assert/is-uint16array' ); ``` #### isUint16Array( value ) @@ -35,9 +35,9 @@ var isUint16Array = require( '@stdlib/assert/is-uint16array' ); Tests if a value is a [`Uint16Array`][mdn-uint16array]. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); -var bool = isUint16Array( new Uint16Array( 10 ) ); +let bool = isUint16Array( new Uint16Array( 10 ) ); // returns true bool = isUint16Array( [] ); @@ -55,18 +55,18 @@ bool = isUint16Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isUint16Array = require( '@stdlib/assert/is-uint16array' ); - -var bool = isUint16Array( new Uint16Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isUint16Array = require( '@stdlib/assert/is-uint16array' ); + +let bool = isUint16Array( new Uint16Array( 10 ) ); // returns true bool = isUint16Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-uint32array/README.md b/lib/node_modules/@stdlib/assert/is-uint32array/README.md index 94acaf0a2da2..627fdbb3d538 100644 --- a/lib/node_modules/@stdlib/assert/is-uint32array/README.md +++ b/lib/node_modules/@stdlib/assert/is-uint32array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +const isUint32Array = require( '@stdlib/assert/is-uint32array' ); ``` #### isUint32Array( value ) @@ -35,9 +35,9 @@ var isUint32Array = require( '@stdlib/assert/is-uint32array' ); Tests if a value is a [`Uint32Array`][mdn-uint32array]. ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); -var bool = isUint32Array( new Uint32Array( 10 ) ); +let bool = isUint32Array( new Uint32Array( 10 ) ); // returns true bool = isUint32Array( [] ); @@ -55,18 +55,18 @@ bool = isUint32Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isUint32Array = require( '@stdlib/assert/is-uint32array' ); - -var bool = isUint32Array( new Uint32Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isUint32Array = require( '@stdlib/assert/is-uint32array' ); + +let bool = isUint32Array( new Uint32Array( 10 ) ); // returns true bool = isUint32Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-uint8array/README.md b/lib/node_modules/@stdlib/assert/is-uint8array/README.md index 84f14656e5d0..59a526bbc372 100644 --- a/lib/node_modules/@stdlib/assert/is-uint8array/README.md +++ b/lib/node_modules/@stdlib/assert/is-uint8array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +const isUint8Array = require( '@stdlib/assert/is-uint8array' ); ``` #### isUint8Array( value ) @@ -35,9 +35,9 @@ var isUint8Array = require( '@stdlib/assert/is-uint8array' ); Tests if a value is a [`Uint8Array`][mdn-uint8array]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var bool = isUint8Array( new Uint8Array( 10 ) ); +let bool = isUint8Array( new Uint8Array( 10 ) ); // returns true bool = isUint8Array( [] ); @@ -55,18 +55,18 @@ bool = isUint8Array( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isUint8Array = require( '@stdlib/assert/is-uint8array' ); - -var bool = isUint8Array( new Uint8Array( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isUint8Array = require( '@stdlib/assert/is-uint8array' ); + +let bool = isUint8Array( new Uint8Array( 10 ) ); // returns true bool = isUint8Array( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-uint8clampedarray/README.md b/lib/node_modules/@stdlib/assert/is-uint8clampedarray/README.md index 27d7ccc371bc..1fe0c75500d6 100644 --- a/lib/node_modules/@stdlib/assert/is-uint8clampedarray/README.md +++ b/lib/node_modules/@stdlib/assert/is-uint8clampedarray/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +const isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); ``` #### isUint8ClampedArray( value ) @@ -35,9 +35,9 @@ var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); Tests if a value is a [`Uint8ClampedArray`][mdn-uint8clampedarray]. ```javascript -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) ); +let bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) ); // returns true bool = isUint8ClampedArray( [] ); @@ -55,18 +55,18 @@ bool = isUint8ClampedArray( [] ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); - -var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) ); +const Int8Array = require( '@stdlib/array/int8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); + +let bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) ); // returns true bool = isUint8ClampedArray( new Int8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-unc-path/README.md b/lib/node_modules/@stdlib/assert/is-unc-path/README.md index 5284196b32be..6a1e0ef56de7 100644 --- a/lib/node_modules/@stdlib/assert/is-unc-path/README.md +++ b/lib/node_modules/@stdlib/assert/is-unc-path/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var isUNCPath = require( '@stdlib/assert/is-unc-path' ); +const isUNCPath = require( '@stdlib/assert/is-unc-path' ); ``` #### isUNCPath( value ) @@ -41,7 +41,7 @@ var isUNCPath = require( '@stdlib/assert/is-unc-path' ); Tests if a `value` is a [UNC][unc] path. ```javascript -var bool = isUNCPath( '\\\\server\\share\\foo\\bar\\baz' ); +let bool = isUNCPath( '\\\\server\\share\\foo\\bar\\baz' ); // returns true bool = isUNCPath( '/foo/bar/baz' ); @@ -59,10 +59,10 @@ bool = isUNCPath( '/foo/bar/baz' ); ```javascript -var isUNCPath = require( '@stdlib/assert/is-unc-path' ); +const isUNCPath = require( '@stdlib/assert/is-unc-path' ); -var path = '\\\\server\\share\\foo\\bar\\baz:a:b'; -var bool = isUNCPath( path ); +let path = '\\\\server\\share\\foo\\bar\\baz:a:b'; +let bool = isUNCPath( path ); // returns true path = '\\\\server\\share\\foo\\bar\\baz::b'; diff --git a/lib/node_modules/@stdlib/assert/is-undefined-or-null/README.md b/lib/node_modules/@stdlib/assert/is-undefined-or-null/README.md index dc9112791411..efd28609f022 100644 --- a/lib/node_modules/@stdlib/assert/is-undefined-or-null/README.md +++ b/lib/node_modules/@stdlib/assert/is-undefined-or-null/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); +const isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); ``` #### isUndefinedOrNull( value ) @@ -37,7 +37,7 @@ Tests if a `value` is `undefined` or `null`. ```javascript -var bool = isUndefinedOrNull( undefined ); +let bool = isUndefinedOrNull( undefined ); // returns true bool = isUndefinedOrNull( null ); @@ -57,12 +57,10 @@ bool = isUndefinedOrNull( null ); ```javascript -var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); +const isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); -var bool; -var x; - -bool = isUndefinedOrNull( x ); +let x; +let bool = isUndefinedOrNull( x ); // returns true bool = isUndefinedOrNull( undefined ); diff --git a/lib/node_modules/@stdlib/assert/is-undefined/README.md b/lib/node_modules/@stdlib/assert/is-undefined/README.md index 1ad1f286838c..c39e5b171d94 100644 --- a/lib/node_modules/@stdlib/assert/is-undefined/README.md +++ b/lib/node_modules/@stdlib/assert/is-undefined/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUndefined = require( '@stdlib/assert/is-undefined' ); +const isUndefined = require( '@stdlib/assert/is-undefined' ); ``` #### isUndefined( value ) @@ -37,7 +37,7 @@ Tests if a `value` is `undefined`. ```javascript -var bool = isUndefined( undefined ); +const bool = isUndefined( undefined ); // returns true ``` @@ -54,12 +54,10 @@ var bool = isUndefined( undefined ); ```javascript -var isUndefined = require( '@stdlib/assert/is-undefined' ); +const isUndefined = require( '@stdlib/assert/is-undefined' ); -var bool; -var x; - -bool = isUndefined( x ); +let x; +let bool = isUndefined( x ); // returns true bool = isUndefined( undefined ); diff --git a/lib/node_modules/@stdlib/assert/is-unity-probability-array/README.md b/lib/node_modules/@stdlib/assert/is-unity-probability-array/README.md index 1c1d341725f8..c7220ad37aa5 100644 --- a/lib/node_modules/@stdlib/assert/is-unity-probability-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-unity-probability-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' ); +const isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' ); ``` #### isUnityProbabilityArray( value ) @@ -35,9 +35,9 @@ var isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-arra Tests if a `value` is an array of probabilities that sum to one. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] ); +let bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] ); // returns true bool = isUnityProbabilityArray( new Uint8Array( [ 0, 1 ] ) ); @@ -58,10 +58,9 @@ bool = isUnityProbabilityArray( [ 3.14, 0.0 ] ); - Summation of finite-precision floating-point numbers often has numerical error. For example, ```javascript - var arr = [ 0.1, 0.2, 0.1, 0.1, 0.2, 0.2, 0.1 ]; // => 1.0 - var sum = 0.0; - var i; - for ( i = 0; i < arr.length; i++ ) { + const arr = [ 0.1, 0.2, 0.1, 0.1, 0.2, 0.2, 0.1 ]; // => 1.0 + let sum = 0.0; + for ( let i = 0; i < arr.length; i++ ) { sum += arr[ i ]; } console.log( sum ); @@ -87,11 +86,11 @@ bool = isUnityProbabilityArray( [ 3.14, 0.0 ] ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' ); -var arr = [ 0.0, 1.0 ]; -var bool = isUnityProbabilityArray( arr ); +let arr = [ 0.0, 1.0 ]; +let bool = isUnityProbabilityArray( arr ); // returns true arr = [ 0.5, 0.25, 0.25 ]; diff --git a/lib/node_modules/@stdlib/assert/is-uppercase/README.md b/lib/node_modules/@stdlib/assert/is-uppercase/README.md index 877c9231f4a8..aba92a284cdc 100644 --- a/lib/node_modules/@stdlib/assert/is-uppercase/README.md +++ b/lib/node_modules/@stdlib/assert/is-uppercase/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isUppercase = require( '@stdlib/assert/is-uppercase' ); +const isUppercase = require( '@stdlib/assert/is-uppercase' ); ``` #### isUppercase( value ) @@ -35,7 +35,7 @@ var isUppercase = require( '@stdlib/assert/is-uppercase' ); Tests if a `value` is an uppercase `string`. ```javascript -var bool = isUppercase( 'HELLO' ); +let bool = isUppercase( 'HELLO' ); // returns true bool = isUppercase( 'salt and light' ); @@ -63,9 +63,9 @@ bool = isUppercase( 'salt and light' ); ```javascript -var isUppercase = require( '@stdlib/assert/is-uppercase' ); +const isUppercase = require( '@stdlib/assert/is-uppercase' ); -var bool = isUppercase( 'HELLO' ); +let bool = isUppercase( 'HELLO' ); // returns true bool = isUppercase( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-uri-error/README.md b/lib/node_modules/@stdlib/assert/is-uri-error/README.md index 3bf8eb940dd1..c7eb800813dd 100644 --- a/lib/node_modules/@stdlib/assert/is-uri-error/README.md +++ b/lib/node_modules/@stdlib/assert/is-uri-error/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isURIError = require( '@stdlib/assert/is-uri-error' ); +const isURIError = require( '@stdlib/assert/is-uri-error' ); ``` #### isURIError( value ) @@ -45,7 +45,7 @@ var isURIError = require( '@stdlib/assert/is-uri-error' ); Tests if a `value` is a [`URIError`][mdn-uri-error] object. ```javascript -var bool = isURIError( new URIError( 'beep' ) ); +const bool = isURIError( new URIError( 'beep' ) ); // returns true ``` @@ -74,9 +74,9 @@ var bool = isURIError( new URIError( 'beep' ) ); ```javascript -var isURIError = require( '@stdlib/assert/is-uri-error' ); +const isURIError = require( '@stdlib/assert/is-uri-error' ); -var bool = isURIError( new URIError( 'URI error' ) ); +let bool = isURIError( new URIError( 'URI error' ) ); // returns true bool = isURIError( new Error( 'error' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-uri/README.md b/lib/node_modules/@stdlib/assert/is-uri/README.md index f2244b822379..e58b69cfda71 100644 --- a/lib/node_modules/@stdlib/assert/is-uri/README.md +++ b/lib/node_modules/@stdlib/assert/is-uri/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isURI = require( '@stdlib/assert/is-uri' ); +const isURI = require( '@stdlib/assert/is-uri' ); ``` #### isURI( value ) @@ -35,7 +35,7 @@ var isURI = require( '@stdlib/assert/is-uri' ); Tests if a `value` is a [URI][uri]. ```javascript -var bool = isURI( 'https://google.com' ); +let bool = isURI( 'https://google.com' ); // returns true bool = isURI( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' ); @@ -79,11 +79,11 @@ bool = isURI( true ); ```javascript -var isURI = require( '@stdlib/assert/is-uri' ); +const isURI = require( '@stdlib/assert/is-uri' ); /* Valid */ -var bool = isURI( 'http://google.com' ); +let bool = isURI( 'http://google.com' ); // returns true bool = isURI( 'http://localhost/' ); diff --git a/lib/node_modules/@stdlib/assert/is-vector-like/README.md b/lib/node_modules/@stdlib/assert/is-vector-like/README.md index fe4956e9f4c9..63ed4929980b 100644 --- a/lib/node_modules/@stdlib/assert/is-vector-like/README.md +++ b/lib/node_modules/@stdlib/assert/is-vector-like/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isVectorLike = require( '@stdlib/assert/is-vector-like' ); +const isVectorLike = require( '@stdlib/assert/is-vector-like' ); ``` #### isVectorLike( value ) @@ -35,10 +35,10 @@ var isVectorLike = require( '@stdlib/assert/is-vector-like' ); Tests if a value is a 1-dimensional [ndarray][@stdlib/ndarray/ctor]-like object. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 4 ], [ 1 ], 0, 'row-major' ); -var bool = isVectorLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 4 ], [ 1 ], 0, 'row-major' ); +const bool = isVectorLike( arr ); // returns true ``` @@ -53,11 +53,11 @@ var bool = isVectorLike( arr ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var isVectorLike = require( '@stdlib/assert/is-vector-like' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const isVectorLike = require( '@stdlib/assert/is-vector-like' ); -var arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 4 ], [ 1 ], 0, 'row-major' ); -var out = isVectorLike( arr ); +const arr = ndarray( 'generic', [ 0, 0, 0, 0 ], [ 4 ], [ 1 ], 0, 'row-major' ); +let out = isVectorLike( arr ); // returns true out = isVectorLike( [ 1, 2, 3, 4 ] ); diff --git a/lib/node_modules/@stdlib/assert/is-wasm-memory/README.md b/lib/node_modules/@stdlib/assert/is-wasm-memory/README.md index a5a005be354c..ca17fc2b65b2 100644 --- a/lib/node_modules/@stdlib/assert/is-wasm-memory/README.md +++ b/lib/node_modules/@stdlib/assert/is-wasm-memory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWebAssemblyMemory = require( '@stdlib/assert/is-wasm-memory' ); +const isWebAssemblyMemory = require( '@stdlib/assert/is-wasm-memory' ); ``` #### isWebAssemblyMemory( value ) @@ -35,12 +35,12 @@ var isWebAssemblyMemory = require( '@stdlib/assert/is-wasm-memory' ); Tests if a value is a WebAssembly [memory][@stdlib/wasm/memory] instance. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); -var mem = new Memory({ +const mem = new Memory({ 'initial': 0 }); -var bool = isWebAssemblyMemory( mem ); +const bool = isWebAssemblyMemory( mem ); // returns true ``` @@ -55,15 +55,15 @@ var bool = isWebAssemblyMemory( mem ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Memory = require( '@stdlib/wasm/memory' ); -var isWebAssemblyMemory = require( '@stdlib/assert/is-wasm-memory' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Memory = require( '@stdlib/wasm/memory' ); +const isWebAssemblyMemory = require( '@stdlib/assert/is-wasm-memory' ); -var mem = new Memory({ +const mem = new Memory({ 'initial': 0 }); -var bool = isWebAssemblyMemory( mem ); +let bool = isWebAssemblyMemory( mem ); // returns true bool = isWebAssemblyMemory( new Uint8Array( 10 ) ); diff --git a/lib/node_modules/@stdlib/assert/is-web-worker/README.md b/lib/node_modules/@stdlib/assert/is-web-worker/README.md index c95277b88230..fa9a5ac2d517 100644 --- a/lib/node_modules/@stdlib/assert/is-web-worker/README.md +++ b/lib/node_modules/@stdlib/assert/is-web-worker/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_WEB_WORKER = require( '@stdlib/assert/is-web-worker' ); +const IS_WEB_WORKER = require( '@stdlib/assert/is-web-worker' ); ``` #### IS_WEB_WORKER @@ -35,7 +35,7 @@ var IS_WEB_WORKER = require( '@stdlib/assert/is-web-worker' ); `Boolean` indicating if the runtime is a [web worker][mdn-web-workers-api]. ```javascript -var bool = IS_WEB_WORKER; +const bool = IS_WEB_WORKER; // returns ``` @@ -60,7 +60,7 @@ var bool = IS_WEB_WORKER; ```javascript -var IS_WEB_WORKER = require( '@stdlib/assert/is-web-worker' ); +const IS_WEB_WORKER = require( '@stdlib/assert/is-web-worker' ); console.log( IS_WEB_WORKER ); // => diff --git a/lib/node_modules/@stdlib/assert/is-well-formed-string/README.md b/lib/node_modules/@stdlib/assert/is-well-formed-string/README.md index d397ef8496f9..adf93e7e789f 100644 --- a/lib/node_modules/@stdlib/assert/is-well-formed-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-well-formed-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWellFormedString = require( '@stdlib/assert/is-well-formed-string' ); +const isWellFormedString = require( '@stdlib/assert/is-well-formed-string' ); ``` #### isWellFormedString( str ) @@ -37,7 +37,7 @@ Tests if a `string` is well-formed. ```javascript -var bool = isWellFormedString( '' ); +let bool = isWellFormedString( '' ); // returns true bool = isWellFormedString( new String( '' ) ); @@ -66,7 +66,7 @@ Tests if a `string` is a well-formed `string` primitive. ```javascript -var bool = isWellFormedString.isPrimitive( '' ); +let bool = isWellFormedString.isPrimitive( '' ); // returns true bool = isWellFormedString.isPrimitive( new String( '' ) ); @@ -80,7 +80,7 @@ Tests if a `string` is a well-formed `String` object. ```javascript -var bool = isWellFormedString.isObject( '' ); +let bool = isWellFormedString.isObject( '' ); // returns false bool = isWellFormedString.isObject( new String( '' ) ); @@ -100,9 +100,9 @@ bool = isWellFormedString.isObject( new String( '' ) ); ```javascript -var isWellFormedString = require( '@stdlib/assert/is-well-formed-string' ); +const isWellFormedString = require( '@stdlib/assert/is-well-formed-string' ); -var bool = isWellFormedString( '' ); +let bool = isWellFormedString( '' ); // returns true bool = isWellFormedString( new String( '' ) ); diff --git a/lib/node_modules/@stdlib/assert/is-whitespace/README.md b/lib/node_modules/@stdlib/assert/is-whitespace/README.md index 7bd9d8bdb3e1..5abe8410e12c 100644 --- a/lib/node_modules/@stdlib/assert/is-whitespace/README.md +++ b/lib/node_modules/@stdlib/assert/is-whitespace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWhitespace = require( '@stdlib/assert/is-whitespace' ); +const isWhitespace = require( '@stdlib/assert/is-whitespace' ); ``` #### isWhitespace( value ) @@ -35,7 +35,7 @@ var isWhitespace = require( '@stdlib/assert/is-whitespace' ); Tests whether a string contains only [white space][whitespace] characters. ```javascript -var bool = isWhitespace( ' ' ); +const bool = isWhitespace( ' ' ); // returns true ``` @@ -61,9 +61,9 @@ var bool = isWhitespace( ' ' ); ```javascript -var isWhitespace = require( '@stdlib/assert/is-whitespace' ); +const isWhitespace = require( '@stdlib/assert/is-whitespace' ); -var out = isWhitespace( ' ' ); +let out = isWhitespace( ' ' ); // returns true out = isWhitespace( '' ); diff --git a/lib/node_modules/@stdlib/assert/is-windows/README.md b/lib/node_modules/@stdlib/assert/is-windows/README.md index 1f7b7f24a18c..834d78369623 100644 --- a/lib/node_modules/@stdlib/assert/is-windows/README.md +++ b/lib/node_modules/@stdlib/assert/is-windows/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); ``` #### IS_WINDOWS @@ -50,8 +50,8 @@ console.log( IS_WINDOWS ); ```javascript -var PLATFORM = require( '@stdlib/os/platform' ); -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const PLATFORM = require( '@stdlib/os/platform' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); if ( IS_WINDOWS ) { console.log( 'Running on Windows...' ); diff --git a/lib/node_modules/@stdlib/assert/is-writable-property-in/README.md b/lib/node_modules/@stdlib/assert/is-writable-property-in/README.md index b21336f54fe3..cc11ed5aa2cc 100644 --- a/lib/node_modules/@stdlib/assert/is-writable-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-writable-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWritablePropertyIn = require( '@stdlib/assert/is-writable-property-in' ); +const isWritablePropertyIn = require( '@stdlib/assert/is-writable-property-in' ); ``` #### isWritablePropertyIn( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a writable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'setter', { } }); -var bool = isWritablePropertyIn( obj, 'foo' ); +let bool = isWritablePropertyIn( obj, 'foo' ); // returns true bool = isWritablePropertyIn( obj, 'setter' ); @@ -79,18 +79,18 @@ bool = isWritablePropertyIn( obj, 'beep' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isWritablePropertyIn( 'beep', 'toString' ); + const bool = isWritablePropertyIn( 'beep', 'toString' ); // returns true ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isWritablePropertyIn( obj, null ); + const bool = isWritablePropertyIn( obj, null ); // returns true ``` @@ -107,9 +107,9 @@ bool = isWritablePropertyIn( obj, 'beep' ); ```javascript -var isWritablePropertyIn = require( '@stdlib/assert/is-writable-property-in' ); +const isWritablePropertyIn = require( '@stdlib/assert/is-writable-property-in' ); -var bool = isWritablePropertyIn( [ 'a' ], 'length' ); +let bool = isWritablePropertyIn( [ 'a' ], 'length' ); // returns true bool = isWritablePropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-writable-property/README.md b/lib/node_modules/@stdlib/assert/is-writable-property/README.md index 1ba3943aa4e8..dfec05fc1ead 100644 --- a/lib/node_modules/@stdlib/assert/is-writable-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-writable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWritableProperty = require( '@stdlib/assert/is-writable-property' ); +const isWritableProperty = require( '@stdlib/assert/is-writable-property' ); ``` #### isWritableProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a writable `property`. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'setter', { } }); -var bool = isWritableProperty( obj, 'foo' ); +let bool = isWritableProperty( obj, 'foo' ); // returns true bool = isWritableProperty( obj, 'setter' ); @@ -79,18 +79,18 @@ bool = isWritableProperty( obj, 'beep' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isWritableProperty( 'beep', 'length' ); + const bool = isWritableProperty( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var obj = { + const obj = { 'null': 'foo' }; - var bool = isWritableProperty( obj, null ); + const bool = isWritableProperty( obj, null ); // returns true ``` @@ -107,9 +107,9 @@ bool = isWritableProperty( obj, 'beep' ); ```javascript -var isWritableProperty = require( '@stdlib/assert/is-writable-property' ); +const isWritableProperty = require( '@stdlib/assert/is-writable-property' ); -var bool = isWritableProperty( [ 'a' ], 'length' ); +let bool = isWritableProperty( [ 'a' ], 'length' ); // returns true bool = isWritableProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-write-only-property-in/README.md b/lib/node_modules/@stdlib/assert/is-write-only-property-in/README.md index 632170cdd53f..81349eefcfc7 100644 --- a/lib/node_modules/@stdlib/assert/is-write-only-property-in/README.md +++ b/lib/node_modules/@stdlib/assert/is-write-only-property-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWriteOnlyPropertyIn = require( '@stdlib/assert/is-write-only-property-in' ); +const isWriteOnlyPropertyIn = require( '@stdlib/assert/is-write-only-property-in' ); ``` #### isWriteOnlyPropertyIn( value, property ) @@ -37,16 +37,15 @@ Returns a `boolean` indicating if a `value` has a [write-only][@stdlib/utils/def ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); - -var bool; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.foo = 'bar'; return this; } +const obj = new Foo(); + defineProperty( Foo.prototype, 'beep', { 'configurable': false, 'enumerable': false, @@ -62,9 +61,7 @@ defineProperty( Foo.prototype, 'accessor', { } }); -obj = new Foo(); - -bool = isWriteOnlyPropertyIn( obj, 'foo' ); +let bool = isWriteOnlyPropertyIn( obj, 'foo' ); // returns false bool = isWriteOnlyPropertyIn( obj, 'beep' ); @@ -85,16 +82,16 @@ bool = isWriteOnlyPropertyIn( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isWriteOnlyPropertyIn( 'beep', 'length' ); + const bool = isWriteOnlyPropertyIn( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; function setter( v ) { obj.null = v; @@ -106,7 +103,7 @@ bool = isWriteOnlyPropertyIn( obj, 'accessor' ); 'set': setter }); - var bool = isWriteOnlyPropertyIn( obj, null ); + const bool = isWriteOnlyPropertyIn( obj, null ); // returns true ``` @@ -123,9 +120,9 @@ bool = isWriteOnlyPropertyIn( obj, 'accessor' ); ```javascript -var isWriteOnlyPropertyIn = require( '@stdlib/assert/is-write-only-property-in' ); +const isWriteOnlyPropertyIn = require( '@stdlib/assert/is-write-only-property-in' ); -var bool = isWriteOnlyPropertyIn( 'a', 'length' ); +let bool = isWriteOnlyPropertyIn( 'a', 'length' ); // returns false bool = isWriteOnlyPropertyIn( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/is-write-only-property/README.md b/lib/node_modules/@stdlib/assert/is-write-only-property/README.md index e92cdb98ad80..75cce89f8489 100644 --- a/lib/node_modules/@stdlib/assert/is-write-only-property/README.md +++ b/lib/node_modules/@stdlib/assert/is-write-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isWriteOnlyProperty = require( '@stdlib/assert/is-write-only-property' ); +const isWriteOnlyProperty = require( '@stdlib/assert/is-write-only-property' ); ``` #### isWriteOnlyProperty( value, property ) @@ -37,9 +37,9 @@ Returns a `boolean` indicating if a `value` has a [write-only][@stdlib/utils/def ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'foo': 'bar' }; @@ -58,7 +58,7 @@ defineProperty( obj, 'accessor', { } }); -var bool = isWriteOnlyProperty( obj, 'foo' ); +let bool = isWriteOnlyProperty( obj, 'foo' ); // returns false bool = isWriteOnlyProperty( obj, 'beep' ); @@ -79,16 +79,16 @@ bool = isWriteOnlyProperty( obj, 'accessor' ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var bool = isWriteOnlyProperty( 'beep', 'length' ); + const bool = isWriteOnlyProperty( 'beep', 'length' ); // returns false ``` - Property arguments are coerced to `strings`. ```javascript - var defineProperty = require( '@stdlib/utils/define-property' ); + const defineProperty = require( '@stdlib/utils/define-property' ); - var obj = {}; + const obj = {}; function setter( v ) { obj.null = v; @@ -100,7 +100,7 @@ bool = isWriteOnlyProperty( obj, 'accessor' ); 'set': setter }); - var bool = isWriteOnlyProperty( obj, null ); + const bool = isWriteOnlyProperty( obj, null ); // returns true ``` @@ -117,9 +117,9 @@ bool = isWriteOnlyProperty( obj, 'accessor' ); ```javascript -var isWriteOnlyProperty = require( '@stdlib/assert/is-write-only-property' ); +const isWriteOnlyProperty = require( '@stdlib/assert/is-write-only-property' ); -var bool = isWriteOnlyProperty( 'a', 'length' ); +let bool = isWriteOnlyProperty( 'a', 'length' ); // returns false bool = isWriteOnlyProperty( { 'a': 'b' }, 'a' ); diff --git a/lib/node_modules/@stdlib/assert/napi/README.md b/lib/node_modules/@stdlib/assert/napi/README.md index f485e148576e..23220442a320 100644 --- a/lib/node_modules/@stdlib/assert/napi/README.md +++ b/lib/node_modules/@stdlib/assert/napi/README.md @@ -39,7 +39,7 @@ This package exposes an absolute file path for the directory containing header f ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi' ); +const headerDir = require( '@stdlib/assert/napi' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/assert/napi' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi' ); +const headerDir = require( '@stdlib/assert/napi' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/equal-typedarray-types/README.md b/lib/node_modules/@stdlib/assert/napi/equal-typedarray-types/README.md index f0f6ff5b6cef..dff2d991f6ed 100644 --- a/lib/node_modules/@stdlib/assert/napi/equal-typedarray-types/README.md +++ b/lib/node_modules/@stdlib/assert/napi/equal-typedarray-types/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/equal-typedarray-types' ); +const headerDir = require( '@stdlib/assert/napi/equal-typedarray-types' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/equal-typedarray-types' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/equal-typedarray-types' ); +const headerDir = require( '@stdlib/assert/napi/equal-typedarray-types' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/equal-types/README.md b/lib/node_modules/@stdlib/assert/napi/equal-types/README.md index 597ebfddcd91..c26f8407e76c 100644 --- a/lib/node_modules/@stdlib/assert/napi/equal-types/README.md +++ b/lib/node_modules/@stdlib/assert/napi/equal-types/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/equal-types' ); +const headerDir = require( '@stdlib/assert/napi/equal-types' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/equal-types' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/equal-types' ); +const headerDir = require( '@stdlib/assert/napi/equal-types' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/has-property/README.md b/lib/node_modules/@stdlib/assert/napi/has-property/README.md index 49644cc574bc..5f63bcaa5a05 100644 --- a/lib/node_modules/@stdlib/assert/napi/has-property/README.md +++ b/lib/node_modules/@stdlib/assert/napi/has-property/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/has-property' ); +const headerDir = require( '@stdlib/assert/napi/has-property' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/has-property' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/has-property' ); +const headerDir = require( '@stdlib/assert/napi/has-property' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/is-type/README.md b/lib/node_modules/@stdlib/assert/napi/is-type/README.md index 80e964b11d5a..2d8fc4aee10c 100644 --- a/lib/node_modules/@stdlib/assert/napi/is-type/README.md +++ b/lib/node_modules/@stdlib/assert/napi/is-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/is-type' ); +const headerDir = require( '@stdlib/assert/napi/is-type' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/is-type' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/is-type' ); +const headerDir = require( '@stdlib/assert/napi/is-type' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/is-typedarray/README.md b/lib/node_modules/@stdlib/assert/napi/is-typedarray/README.md index be2c8aae2e4a..10e9e7d847a7 100644 --- a/lib/node_modules/@stdlib/assert/napi/is-typedarray/README.md +++ b/lib/node_modules/@stdlib/assert/napi/is-typedarray/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/is-typedarray' ); +const headerDir = require( '@stdlib/assert/napi/is-typedarray' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/is-typedarray' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/is-typedarray' ); +const headerDir = require( '@stdlib/assert/napi/is-typedarray' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/napi/status-ok/README.md b/lib/node_modules/@stdlib/assert/napi/status-ok/README.md index d7c6220c38e3..be7f15e1e4d1 100644 --- a/lib/node_modules/@stdlib/assert/napi/status-ok/README.md +++ b/lib/node_modules/@stdlib/assert/napi/status-ok/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/assert/napi/status-ok' ); +const headerDir = require( '@stdlib/assert/napi/status-ok' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/assert/napi/status-ok' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/assert/napi/status-ok' ); +const headerDir = require( '@stdlib/assert/napi/status-ok' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/assert/tools/README.md b/lib/node_modules/@stdlib/assert/tools/README.md index 3f2ffb0ff132..e9546f580ac8 100644 --- a/lib/node_modules/@stdlib/assert/tools/README.md +++ b/lib/node_modules/@stdlib/assert/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tools = require( '@stdlib/assert/tools' ); +const tools = require( '@stdlib/assert/tools' ); ``` #### tools @@ -35,7 +35,7 @@ var tools = require( '@stdlib/assert/tools' ); Namespace for assertion utility tools. ```javascript -var o = tools; +const o = tools; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var tools = require( '@stdlib/assert/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const tools = require( '@stdlib/assert/tools' ); console.log( objectKeys( tools ) ); ``` diff --git a/lib/node_modules/@stdlib/assert/tools/array-function/README.md b/lib/node_modules/@stdlib/assert/tools/array-function/README.md index 35ad677d7001..83fcd1875581 100644 --- a/lib/node_modules/@stdlib/assert/tools/array-function/README.md +++ b/lib/node_modules/@stdlib/assert/tools/array-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arrayfcn = require( '@stdlib/assert/tools/array-function' ); +const arrayfcn = require( '@stdlib/assert/tools/array-function' ); ``` @@ -37,14 +37,14 @@ var arrayfcn = require( '@stdlib/assert/tools/array-function' ); Returns a function which tests if every element in an [`array`][mdn-array] passes a test condition. Given an input [`array`][mdn-array], the function returns `true` if all elements pass the test and `false` otherwise. ```javascript -var isOdd = require( '@stdlib/assert/is-odd' ); +const isOdd = require( '@stdlib/assert/is-odd' ); -var arr1 = [ 1, 3, 5, 7 ]; -var arr2 = [ 3, 5, 8 ]; +const arr1 = [ 1, 3, 5, 7 ]; +const arr2 = [ 3, 5, 8 ]; -var f = arrayfcn( isOdd ); +const f = arrayfcn( isOdd ); -var bool = f( arr1 ); +let bool = f( arr1 ); // returns true bool = f( arr2 ); @@ -74,28 +74,22 @@ bool = f( arr2 ); ```javascript -var isEven = require( '@stdlib/assert/is-even' ); -var arrayfcn = require( '@stdlib/assert/tools/array-function' ); +const isEven = require( '@stdlib/assert/is-even' ); +const arrayfcn = require( '@stdlib/assert/tools/array-function' ); -var arr1; -var arr2; -var bool; -var f; -var i; - -arr1 = new Array( 25 ); -for ( i = 0; i < arr1.length; i++ ) { +const arr1 = new Array( 25 ); +for ( let i = 0; i < arr1.length; i++ ) { arr1[ i ] = i; } -arr2 = new Array( 25 ); -for ( i = 0; i < arr2.length; i++ ) { +const arr2 = new Array( 25 ); +for ( let i = 0; i < arr2.length; i++ ) { arr2[ i ] = 2 * i; } -f = arrayfcn( isEven ); +const f = arrayfcn( isEven ); -bool = f( arr1 ); +let bool = f( arr1 ); // returns false bool = f( arr2 ); diff --git a/lib/node_modules/@stdlib/assert/tools/array-like-function/README.md b/lib/node_modules/@stdlib/assert/tools/array-like-function/README.md index a6f216c14107..2165fb6f0fee 100644 --- a/lib/node_modules/@stdlib/assert/tools/array-like-function/README.md +++ b/lib/node_modules/@stdlib/assert/tools/array-like-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); +const arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); ``` @@ -37,14 +37,14 @@ var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); Returns a function which tests if every element in an [array-like object][array-like] passes a test condition. Given an input [array-like object][array-like], the function returns `true` if all elements pass the test and `false` otherwise. ```javascript -var isOdd = require( '@stdlib/assert/is-odd' ); +const isOdd = require( '@stdlib/assert/is-odd' ); -var arr1 = [ 1, 3, 5, 7 ]; -var arr2 = [ 3, 5, 8 ]; +const arr1 = [ 1, 3, 5, 7 ]; +const arr2 = [ 3, 5, 8 ]; -var f = arraylikefcn( isOdd ); +const f = arraylikefcn( isOdd ); -var bool = f( arr1 ); +let bool = f( arr1 ); // returns true bool = f( arr2 ); @@ -74,28 +74,22 @@ bool = f( arr2 ); ```javascript -var isEven = require( '@stdlib/assert/is-even' ); -var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); +const isEven = require( '@stdlib/assert/is-even' ); +const arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); -var arr1; -var arr2; -var bool; -var f; -var i; - -arr1 = new Array( 25 ); -for ( i = 0; i < arr1.length; i++ ) { +const arr1 = new Array( 25 ); +for ( let i = 0; i < arr1.length; i++ ) { arr1[ i ] = i; } -arr2 = new Array( 25 ); -for ( i = 0; i < arr2.length; i++ ) { +const arr2 = new Array( 25 ); +for ( let i = 0; i < arr2.length; i++ ) { arr2[ i ] = 2 * i; } -f = arraylikefcn( isEven ); +const f = arraylikefcn( isEven ); -bool = f( arr1 ); +let bool = f( arr1 ); // returns false bool = f( arr2 ); diff --git a/lib/node_modules/@stdlib/assert/tools/typed-array-function/README.md b/lib/node_modules/@stdlib/assert/tools/typed-array-function/README.md index 2940653da454..8700e5459e6d 100644 --- a/lib/node_modules/@stdlib/assert/tools/typed-array-function/README.md +++ b/lib/node_modules/@stdlib/assert/tools/typed-array-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var typedarrayfcn = require( '@stdlib/assert/tools/typed-array-function' ); +const typedarrayfcn = require( '@stdlib/assert/tools/typed-array-function' ); ``` @@ -37,15 +37,15 @@ var typedarrayfcn = require( '@stdlib/assert/tools/typed-array-function' ); Returns a function which tests if every element in a [`typed array`][mdn-typed-array] passes a test condition. Given an input [`typed array`][mdn-typed-array], the function returns `true` if all elements pass the test and `false` otherwise. ```javascript -var isOdd = require( '@stdlib/assert/is-odd' ); -var Int32Array = require( '@stdlib/array/int32' ); +const isOdd = require( '@stdlib/assert/is-odd' ); +const Int32Array = require( '@stdlib/array/int32' ); -var arr1 = new Int32Array( [ 1, 3, 5, 7 ] ); -var arr2 = new Int32Array( [ 3, 5, 8 ] ); +const arr1 = new Int32Array( [ 1, 3, 5, 7 ] ); +const arr2 = new Int32Array( [ 3, 5, 8 ] ); -var f = typedarrayfcn( isOdd ); +const f = typedarrayfcn( isOdd ); -var bool = f( arr1 ); +let bool = f( arr1 ); // returns true bool = f( arr2 ); @@ -75,29 +75,23 @@ bool = f( arr2 ); ```javascript -var isEven = require( '@stdlib/assert/is-even' ); -var Int32Array = require( '@stdlib/array/int32' ); -var typedarrayfcn = require( '@stdlib/assert/tools/typed-array-function' ); - -var arr1; -var arr2; -var bool; -var f; -var i; - -arr1 = new Int32Array( 25 ); -for ( i = 0; i < arr1.length; i++ ) { +const isEven = require( '@stdlib/assert/is-even' ); +const Int32Array = require( '@stdlib/array/int32' ); +const typedarrayfcn = require( '@stdlib/assert/tools/typed-array-function' ); + +const arr1 = new Int32Array( 25 ); +for ( let i = 0; i < arr1.length; i++ ) { arr1[ i ] = i; } -arr2 = new Int32Array( 25 ); -for ( i = 0; i < arr2.length; i++ ) { +const arr2 = new Int32Array( 25 ); +for ( let i = 0; i < arr2.length; i++ ) { arr2[ i ] = 2 * i; } -f = typedarrayfcn( isEven ); +const f = typedarrayfcn( isEven ); -bool = f( arr1 ); +let bool = f( arr1 ); // returns false bool = f( arr2 ); diff --git a/lib/node_modules/@stdlib/bench/README.md b/lib/node_modules/@stdlib/bench/README.md index d2ef2dc837ba..69318fad7a6c 100644 --- a/lib/node_modules/@stdlib/bench/README.md +++ b/lib/node_modules/@stdlib/bench/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bench = require( '@stdlib/bench' ); +const bench = require( '@stdlib/bench' ); ``` #### bench( name\[, options]\[, benchmark] ) diff --git a/lib/node_modules/@stdlib/bench/harness/README.md b/lib/node_modules/@stdlib/bench/harness/README.md index 140cbafb17cb..9c3464dbb376 100644 --- a/lib/node_modules/@stdlib/bench/harness/README.md +++ b/lib/node_modules/@stdlib/bench/harness/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bench = require( '@stdlib/bench/harness' ); +const bench = require( '@stdlib/bench/harness' ); ``` @@ -50,10 +50,9 @@ Queues a `benchmark` to be run during a subsequent turn of the event loop. After ```javascript bench( 'Math.sin', function benchmark( b ) { - var x; - var i; + let x; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = Math.sin( Math.random() ); if ( x !== x ) { b.fail( 'should not return NaN' ); @@ -80,14 +79,13 @@ where `b` is a `Benchmark` instance. Synchronous benchmarks should, at minimum, ```javascript function benchmark( b ) { - var x; - var i; + let x; // [1] Start timing: b.tic(); // [2] Loop containing code to time... - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // [3] Code to time... // [4] A conditional verifying results to prevent certain compiler optimizations: @@ -111,7 +109,7 @@ Asynchronous benchmarks should have a structure similar to the following: ```javascript function benchmark( b ) { - var i = 0; + let i = 0; // [1] Start timing: b.tic(); @@ -143,9 +141,8 @@ For both synchronous and asynchronous benchmarks, calling `b.end()` is **mandato ```javascript function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Synchronous task... } b.toc(); @@ -158,10 +155,9 @@ function benchmark( b ) { ```javascript function benchmark( b ) { - var x; - var i; + let x; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = Math.sin( Math.random() ); b.equal( x, x, 'does not return NaN' ); // Avoid doing this! } @@ -177,21 +173,17 @@ Additionally, ensure that all setup code executes **before** calling `b.tic()` a ```javascript function benchmark( b ) { - var x; - var y; - var i; - // Start timing: b.tic(); // Setup code: - x = new Array( b.iterations ); // Should be before b.tic()! - for ( i = 0; i < b.iterations; i++ ) { + const x = new Array( b.iterations ); // Should be before b.tic()! + for ( let i = 0; i < b.iterations; i++ ) { x[ i ] = Math.random(); } // Code to be timed... - for ( i = 0; i < b.iterations; i++ ) { - y = Math.sin( x[ i ] ); + for ( let i = 0; i < b.iterations; i++ ) { + const y = Math.sin( x[ i ] ); if ( y !== y ) { b.fail( 'should not return NaN' ); } @@ -218,14 +210,13 @@ By default, the harness will automatically determine an iteration number for eac ```javascript -var opts = { +const opts = { 'iterations': 1e6 }; bench( 'require a specific number of iterations', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Code to be benchmarked... } b.toc(); @@ -238,14 +229,13 @@ To ensure that benchmark results are reproducible, the harness runs each benchma ```javascript -var opts = { +const opts = { 'repeats': 5 }; bench( 'repeat a benchmark multiple times', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Code to be benchmarked... } b.toc(); @@ -258,14 +248,13 @@ To skip a benchmark, set the `skip` option. ```javascript -var opts = { +const opts = { 'skip': true }; bench( 'skipped benchmark', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Code to be benchmarked... } b.toc(); @@ -278,12 +267,12 @@ To fail benchmarks which take longer than a specified amount of time to complete ```javascript -var opts = { +const opts = { 'timeout': 5000 // 5 seconds }; bench( 'async benchmark', opts, function benchmark( b ) { - var i = 0; + let i = 0; b.tic(); return next(); @@ -325,22 +314,21 @@ Returns a results [stream][nodejs-stream]. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var stream = bench.createStream(); +const stream = bench.createStream(); // Direct all results to `stdout`: stream.pipe( stdout ); -var opts = { +const opts = { 'iterations': 1, 'repeats': 1 }; bench( 'beep', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { b.equal( 3.14, 3.14, 'should be equal' ); } b.toc(); @@ -372,11 +360,11 @@ The function accepts the same `options` as [@stdlib/streams/node/transform][@std ```javascript -var opts = { +let opts = { 'objectMode': true }; -var stream = bench.createStream( opts ); +const stream = bench.createStream( opts ); stream.on( 'data', onRow ); function onRow( row ) { @@ -389,9 +377,8 @@ opts = { }; bench( 'beep', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { b.equal( 3.14, 3.14, 'should be equal' ); } b.toc(); @@ -415,12 +402,11 @@ Creates a benchmark harness with a new pending stack and state. ```javascript -var harness = bench.createHarness(); +const harness = bench.createHarness(); harness( 'beep', function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Synchronous task... } b.toc(); @@ -433,16 +419,15 @@ To trigger an action when a harness finishes running all benchmarks, provide a c ```javascript -var harness = bench.createHarness( onFinish ); +const harness = bench.createHarness( onFinish ); function onFinish() { harness.close(); } harness( 'beep', function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Synchronous task... } b.toc(); @@ -459,14 +444,13 @@ By default, a `harness` does **not** automatically close. To automatically close ```javascript -var harness = bench.createHarness({ +const harness = bench.createHarness({ 'autoclose': true }); harness( 'beep', function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { // Synchronous task... } b.toc(); @@ -489,23 +473,22 @@ Returns a results [stream][nodejs-stream]. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var harness = bench.createHarness(); -var stream = harness.createStream(); +const harness = bench.createHarness(); +const stream = harness.createStream(); // Direct all results to `stdout`: stream.pipe( stdout ); -var opts = { +const opts = { 'iterations': 1, 'repeats': 1 }; harness( 'beep', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { b.equal( 'beep', 'beep', 'should be equal' ); } b.toc(); @@ -543,20 +526,20 @@ Closes a benchmark harness. Any pending benchmarks are cleared from the harness ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var harness = bench.createHarness(); +const harness = bench.createHarness(); -var stream = harness.createStream(); +const stream = harness.createStream(); stream.pipe( stdout ); -var opts = { +const opts = { 'iterations': 5, 'repeats': 5 }; harness( 'early close', opts, function benchmark( b ) { - var i = 0; + let i = 0; b.tic(); setTimeout( next, 0 ); function next() { @@ -605,19 +588,19 @@ Forcefully exits a benchmark harness. All pending benchmarks will generate **fai ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var harness = bench.createHarness(); +const harness = bench.createHarness(); -var stream = harness.createStream(); +const stream = harness.createStream(); stream.pipe( stdout ); -var opts = { +const opts = { 'iterations': 5 }; harness( 'force exit', opts, function benchmark( b ) { - var i = 0; + let i = 0; b.tic(); return next(); function next() { @@ -675,25 +658,24 @@ ok 7 should be truthy ```javascript -var harness = bench.createHarness(); +const harness = bench.createHarness(); // Benchmarks only start running when results have a destination: -var stream = harness.createStream(); +const stream = harness.createStream(); function onFinish() { console.log( harness.exitCode ); // => 1 } -var opts = { +const opts = { 'iterations': 1, 'repeats': 1 }; harness( 'exit code', opts, function benchmark( b ) { - var i; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { b.fail( 'failing assertion' ); } b.toc(); @@ -718,7 +700,7 @@ A `Benchmark` instance has the following properties and methods... ```javascript -var str = b.name; +const str = b.name; // returns ``` @@ -733,7 +715,7 @@ var str = b.name; ```javascript -var iter = b.iterations; +const iter = b.iterations; // returns ``` @@ -749,13 +731,12 @@ Starts a benchmark timer. In order to benchmark code, this method **must always* ```javascript function benchmark( b ) { - var x; - var i; + let x; // Start a timer: b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = Math.sin( Math.random() ); if ( x !== x ) { b.fail( 'should not return NaN' ); @@ -781,11 +762,10 @@ Stops a benchmark timer. In order to benchmark code, this method **must always** ```javascript function benchmark( b ) { - var x; - var i; + let x; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = Math.sin( Math.random() ); if ( x !== x ) { b.fail( 'should not return NaN' ); @@ -813,11 +793,10 @@ Explicitly ends a benchmark. In order to benchmark code, this method **must alwa ```javascript function benchmark( b ) { - var x; - var i; + let x; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = Math.sin( Math.random() ); if ( x !== x ) { b.fail( 'should not return NaN' ); @@ -1029,8 +1008,8 @@ Asserts that `actual` is **strictly** equal to `expected`. ```javascript -var expected = []; -var actual = expected; +const expected = []; +const actual = expected; b.equal( actual, expected ); ``` @@ -1046,8 +1025,8 @@ To override the default message, provide a `msg` argument. ```javascript -var expected = []; -var actual = expected; +const expected = []; +const actual = expected; b.equal( actual, expected, 'This asserts two values are strictly equal.' ); b.equal( 1.0, 2.0, 'This asserts two values are strictly equal.' ); @@ -1073,8 +1052,8 @@ Asserts that `actual` is not **strictly** equal to `expected`. ```javascript -var expected = []; -var actual = []; +const expected = []; +const actual = []; b.notEqual( actual, expected ); ``` @@ -1090,8 +1069,8 @@ To override the default message, provide a `msg` argument. ```javascript -var expected = []; -var actual = []; +const expected = []; +const actual = []; b.notEqual( 1.0, 2.0, 'This asserts two values are not equal.' ); b.notEqual( actual, expected, 'This asserts two values are not equal.' ); @@ -1117,10 +1096,10 @@ Asserts that `actual` is **deeply** equal to `expected`. ```javascript -var expected = { +const expected = { 'a': 'b' }; -var actual = { +const actual = { 'a': 'b' }; @@ -1138,10 +1117,10 @@ To override the default message, provide a `msg` argument. ```javascript -var expected = { +const expected = { 'a': 'b' }; -var actual = { +const actual = { 'a': 'b' }; @@ -1166,10 +1145,10 @@ Asserts that `actual` is not **deeply** equal to `expected`. ```javascript -var expected = { +const expected = { 'a': 'b' }; -var actual = { +const actual = { 'a': 'c' }; @@ -1187,10 +1166,10 @@ To override the default message, provide a `msg` argument. ```javascript -var expected = { +const expected = { 'a': 'b' }; -var actual = { +const actual = { 'a': 'c' }; @@ -1315,23 +1294,22 @@ TODO ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var sin = require( '@stdlib/math/base/special/sin' ); -var bench = require( '@stdlib/bench/harness' ); +const randu = require( '@stdlib/random/base/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const sin = require( '@stdlib/math/base/special/sin' ); +const bench = require( '@stdlib/bench/harness' ); -var opts = { +const opts = { 'iterations': 1e6, 'repeats': 3 }; bench( 'Math.sin', opts, function benchmark( b ) { - var x; - var y; - var i; + let x; + let y; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = (randu()*100.0) - 50.0; y = Math.sin( x ); if ( y < -1.0 || y > 1.0 ) { @@ -1348,12 +1326,11 @@ bench( 'Math.sin', opts, function benchmark( b ) { }); bench( 'sin', opts, function benchmark( b ) { - var x; - var y; - var i; + let x; + let y; b.tic(); - for ( i = 0; i < b.iterations; i++ ) { + for ( let i = 0; i < b.iterations; i++ ) { x = (randu()*100.0) - 50.0; y = sin( x ); if ( y < -1.0 || y > 1.0 ) { diff --git a/lib/node_modules/@stdlib/bigint/README.md b/lib/node_modules/@stdlib/bigint/README.md index 1247732f6a81..bbd164d06981 100644 --- a/lib/node_modules/@stdlib/bigint/README.md +++ b/lib/node_modules/@stdlib/bigint/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/bigint' ); +const ns = require( '@stdlib/bigint' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/bigint' ); BigInt namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/bigint' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/bigint' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/bigint/ctor/README.md b/lib/node_modules/@stdlib/bigint/ctor/README.md index 156dcd6ba30d..0966c4184a4a 100644 --- a/lib/node_modules/@stdlib/bigint/ctor/README.md +++ b/lib/node_modules/@stdlib/bigint/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var BigInt = require( '@stdlib/bigint/ctor' ); +const BigInt = require( '@stdlib/bigint/ctor' ); ``` #### BigInt( value ) @@ -47,7 +47,7 @@ Returns a [`BigInt`][mdn-bigint] primitive. ```javascript -var v = BigInt( '1' ); +const v = BigInt( '1' ); // returns ``` @@ -79,13 +79,11 @@ TODO: document properties/methods ```javascript -var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); -var BigInt = require( '@stdlib/bigint/ctor' ); - -var v; +const hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); +const BigInt = require( '@stdlib/bigint/ctor' ); if ( hasBigIntSupport() ) { - v = BigInt( '1' ); + const v = BigInt( '1' ); // Print the value type: console.log( typeof v ); diff --git a/lib/node_modules/@stdlib/blas/README.md b/lib/node_modules/@stdlib/blas/README.md index a401a45fe2b1..da6dd35e4a98 100644 --- a/lib/node_modules/@stdlib/blas/README.md +++ b/lib/node_modules/@stdlib/blas/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var blas = require( '@stdlib/blas' ); +const blas = require( '@stdlib/blas' ); ``` #### blas @@ -35,7 +35,7 @@ var blas = require( '@stdlib/blas' ); Namespace for basic linear algebra subprograms (BLAS). ```javascript -var o = blas; +const o = blas; // returns {...} ``` @@ -71,8 +71,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var blas = require( '@stdlib/blas' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const blas = require( '@stdlib/blas' ); console.log( objectKeys( blas ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/README.md b/lib/node_modules/@stdlib/blas/base/README.md index 3c26e8705276..2ce63f77c482 100644 --- a/lib/node_modules/@stdlib/blas/base/README.md +++ b/lib/node_modules/@stdlib/blas/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var blas = require( '@stdlib/blas/base' ); +const blas = require( '@stdlib/blas/base' ); ``` #### blas @@ -35,7 +35,7 @@ var blas = require( '@stdlib/blas/base' ); Namespace for "base" (i.e., lower-level) basic linear algebra subprograms (BLAS). ```javascript -var o = blas; +const o = blas; // returns {...} ``` @@ -191,8 +191,8 @@ var o = blas; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var blas = require( '@stdlib/blas/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const blas = require( '@stdlib/blas/base' ); console.log( objectKeys( blas ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/assert/README.md b/lib/node_modules/@stdlib/blas/base/assert/README.md index 30801d8bdc45..d703ab5f6593 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/blas/base/assert' ); +const ns = require( '@stdlib/blas/base/assert' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/blas/base/assert' ); Base BLAS assertion utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/blas/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/blas/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-diagonal-type/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-diagonal-type/README.md index 4f1c6714140b..3f5a5daa5c8e 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/is-diagonal-type/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/is-diagonal-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +const isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); ``` #### isDiagonalType( value ) @@ -45,7 +45,7 @@ var isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); Tests if an input `value` is a BLAS diagonal type. ```javascript -var bool = isDiagonalType( 'unit' ); +let bool = isDiagonalType( 'unit' ); // returns true bool = isDiagonalType( 'non-unit' ); @@ -73,9 +73,9 @@ bool = isDiagonalType( 'non-unit' ); ```javascript -var isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +const isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); -var bool = isDiagonalType( 'unit' ); +let bool = isDiagonalType( 'unit' ); // returns true bool = isDiagonalType( 'non-unit' ); diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-layout/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-layout/README.md index e34d65a53417..b1f3516558f4 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/is-layout/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/is-layout/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +const isLayout = require( '@stdlib/blas/base/assert/is-layout' ); ``` #### isLayout( value ) @@ -45,7 +45,7 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); Tests if an input `value` is a BLAS memory layout. ```javascript -var bool = isLayout( 'row-major' ); +let bool = isLayout( 'row-major' ); // returns true bool = isLayout( 'column-major' ); @@ -73,9 +73,9 @@ bool = isLayout( 'column-major' ); ```javascript -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +const isLayout = require( '@stdlib/blas/base/assert/is-layout' ); -var bool = isLayout( 'row-major' ); +let bool = isLayout( 'row-major' ); // returns true bool = isLayout( 'column-major' ); diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-matrix-triangle/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-matrix-triangle/README.md index 9590d197dc1f..d28cbc67f804 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/is-matrix-triangle/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/is-matrix-triangle/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +const isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); ``` #### isMatrixTriangle( value ) @@ -45,7 +45,7 @@ var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); Tests if an input `value` is a BLAS matrix triangle. ```javascript -var bool = isMatrixTriangle( 'lower' ); +let bool = isMatrixTriangle( 'lower' ); // returns true bool = isMatrixTriangle( 'upper' ); @@ -73,9 +73,9 @@ bool = isMatrixTriangle( 'upper' ); ```javascript -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +const isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var bool = isMatrixTriangle( 'lower' ); +let bool = isMatrixTriangle( 'lower' ); // returns true bool = isMatrixTriangle( 'upper' ); diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-operation-side/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-operation-side/README.md index a897ad1f8e25..01ebcf599033 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/is-operation-side/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/is-operation-side/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +const isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); ``` #### isOperationSide( value ) @@ -45,7 +45,7 @@ var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); Tests if an input `value` is a BLAS operation side. ```javascript -var bool = isOperationSide( 'right' ); +let bool = isOperationSide( 'right' ); // returns true bool = isOperationSide( 'left' ); @@ -73,9 +73,9 @@ bool = isOperationSide( 'left' ); ```javascript -var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +const isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); -var bool = isOperationSide( 'right' ); +let bool = isOperationSide( 'right' ); // returns true bool = isOperationSide( 'left' ); diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transpose-operation/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-transpose-operation/README.md index af2b76158b36..dee6a577366c 100644 --- a/lib/node_modules/@stdlib/blas/base/assert/is-transpose-operation/README.md +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transpose-operation/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +const isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); ``` #### isTransposeOperation( value ) @@ -45,7 +45,7 @@ var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-opera Tests if an input `value` is a BLAS transpose operation. ```javascript -var bool = isTransposeOperation( 'transpose' ); +let bool = isTransposeOperation( 'transpose' ); // returns true bool = isTransposeOperation( 'conjugate-transpose' ); @@ -73,9 +73,9 @@ bool = isTransposeOperation( 'conjugate-transpose' ); ```javascript -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +const isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); -var bool = isTransposeOperation( 'transpose' ); +let bool = isTransposeOperation( 'transpose' ); // returns true bool = isTransposeOperation( 'conjugate-transpose' ); diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/README.md b/lib/node_modules/@stdlib/blas/base/caxpy/README.md index 08ac120e4b16..5342cdf13bd6 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/caxpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var caxpy = require( '@stdlib/blas/base/caxpy' ); +const caxpy = require( '@stdlib/blas/base/caxpy' ); ``` #### caxpy( N, ca, cx, strideX, cy, strideY ) @@ -35,24 +35,24 @@ var caxpy = require( '@stdlib/blas/base/caxpy' ); Scales values from `cx` by `ca` and adds the result to `cy`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); caxpy( 3, ca, cx, 1, cy, 1 ); -var z = cy.get( 0 ); +const z = cy.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 7.0 ``` @@ -68,24 +68,24 @@ The function has the following parameters: The `N` and stride parameters determine how values from `cx` are scaled by `ca` and added to `cy`. For example, to scale every other value in `cx` by `ca` and add the result to every other value of `cy`, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); caxpy( 2, ca, cx, 2, cy, 2 ); -var z = cy.get( 0 ); +const z = cy.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 7.0 ``` @@ -94,32 +94,32 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial arrays... -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy0 = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy0 = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Create offset views... -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Scales values of `cx0` by `ca` starting from second index and add the result to `cy0` starting from third index... caxpy( 2, ca, cx1, 1, cy1, 1 ); -var z = cy0.get( 2 ); +const z = cy0.get( 2 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 15.0 ``` @@ -128,24 +128,24 @@ var im = imagf( z ); Scales values from `cx` by `ca` and adds the result to `cy` using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); caxpy.ndarray( 3, ca, cx, 1, 0, cy, 1, 0 ); -var z = cy.get( 0 ); +const z = cy.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 7.0 ``` @@ -157,24 +157,24 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to scale values in the first input strided array starting from the second element and add the result to the second input array starting from the second element, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); caxpy.ndarray( 3, ca, cx, 1, 1, cy, 1, 1 ); -var z = cy.get( 3 ); +const z = cy.get( 3 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 31.0 ``` @@ -200,23 +200,23 @@ var im = imagf( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var ccopy = require( '@stdlib/blas/base/ccopy' ); -var zeros = require( '@stdlib/array/zeros' ); -var logEach = require( '@stdlib/console/log-each' ); -var caxpy = require( '@stdlib/blas/base/caxpy' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const ccopy = require( '@stdlib/blas/base/ccopy' ); +const zeros = require( '@stdlib/array/zeros' ); +const logEach = require( '@stdlib/console/log-each' ); +const caxpy = require( '@stdlib/blas/base/caxpy' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); -var cy = filledarrayBy( 10, 'complex64', rand ); -var cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); +const cx = filledarrayBy( 10, 'complex64', rand ); +const cy = filledarrayBy( 10, 'complex64', rand ); +const cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Scale values from `cx` by `ca` and add the result to `cy`: caxpy( cx.length, ca, cx, 1, cy, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/ccopy/README.md b/lib/node_modules/@stdlib/blas/base/ccopy/README.md index 98d446dbeaca..bb96b155cad0 100644 --- a/lib/node_modules/@stdlib/blas/base/ccopy/README.md +++ b/lib/node_modules/@stdlib/blas/base/ccopy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ccopy = require( '@stdlib/blas/base/ccopy' ); +const ccopy = require( '@stdlib/blas/base/ccopy' ); ``` #### ccopy( N, x, strideX, y, strideY ) @@ -35,22 +35,22 @@ var ccopy = require( '@stdlib/blas/base/ccopy' ); Copies values from `x` into `y`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ccopy( x.length, x, 1, y, 1 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 ``` @@ -65,22 +65,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ccopy( 2, x, -2, y, 1 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 5.0 -var im = imagf( z ); +const im = imagf( z ); // returns 6.0 ``` @@ -89,28 +89,28 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial arrays... -var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Copy in reverse order every other value from `x1` into `y1`... ccopy( 2, x1, -2, y1, 1 ); -var z = y0.get( 2 ); +const z = y0.get( 2 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 7.0 -var im = imagf( z ); +const im = imagf( z ); // returns 8.0 ``` @@ -119,22 +119,22 @@ var im = imagf( z ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 1.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 ``` @@ -146,22 +146,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ccopy.ndarray( 2, x, 2, 1, y, -1, y.length-1 ); -var z = y.get( y.length-1 ); +const z = y.get( y.length-1 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 3.0 -var im = imagf( z ); +const im = imagf( z ); // returns 4.0 ``` @@ -187,19 +187,19 @@ var im = imagf( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var ccopy = require( '@stdlib/blas/base/ccopy' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const ccopy = require( '@stdlib/blas/base/ccopy' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var x = filledarrayBy( 10, 'complex64', rand ); +const x = filledarrayBy( 10, 'complex64', rand ); console.log( x.get( 0 ).toString() ); -var y = filledarrayBy( 10, 'complex64', rand ); +const y = filledarrayBy( 10, 'complex64', rand ); console.log( y.get( 0 ).toString() ); // Copy elements from `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/cscal-wasm/README.md b/lib/node_modules/@stdlib/blas/base/cscal-wasm/README.md index 88bd7530485d..cbbeef98aef7 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/cscal-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cscal = require( '@stdlib/blas/base/cscal-wasm' ); +const cscal = require( '@stdlib/blas/base/cscal-wasm' ); ``` #### cscal.main( N, ca, cx, strideX ) @@ -35,27 +35,27 @@ var cscal = require( '@stdlib/blas/base/cscal-wasm' ); Scales values from `cx` by `ca`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Define a strided array: -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Perform operation: cscal.main( cx.length, ca, cx, 1 ); -var v = cx.get( 0 ); +const v = cx.get( 0 ); // returns -var re = realf( v ); +const re = realf( v ); // returns -2.0 -var im = imagf( v ); +const im = imagf( v ); // returns 6.0 ``` @@ -69,27 +69,27 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to scale every other value in `cx` by `ca`, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Define a strided array: -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 0.0 ); +const ca = new Complex64( 2.0, 0.0 ); // Perform operation: cscal.main( 2, ca, cx, 2 ); -var v = cx.get( 2 ); +const v = cx.get( 2 ); // returns -var re = realf( v ); +const re = realf( v ); // returns 10.0 -var im = imagf( v ); +const im = imagf( v ); // returns 12.0 ``` @@ -98,30 +98,30 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Create an offset view: -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scales every other value from `cx1` by `ca`... cscal.main( 3, ca, cx1, 1 ); -var z = cx0.get( 1 ); +const z = cx0.get( 1 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 14.0 ``` @@ -130,27 +130,27 @@ var im = imagf( z ); Scales values from `cx` by `ca` using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Define a strided array: -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Perform operation: cscal.main( cx.length, ca, cx, 1 ); -var v = cx.get( 0 ); +const v = cx.get( 0 ); // returns -var re = realf( v ); +const re = realf( v ); // returns -2.0 -var im = imagf( v ); +const im = imagf( v ); // returns 6.0 ``` @@ -161,23 +161,23 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other value in the input strided array starting from the second element, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); cscal.ndarray( 2, ca, cx, 2, 1 ); -var z = cx.get( 3 ); +const z = cx.get( 3 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 30.0 ``` @@ -192,16 +192,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new cscal.Module( mem ); +const mod = new cscal.Module( mem ); // returns // Initialize the routine: @@ -215,44 +215,44 @@ Scales values from `cx` by `ca` . ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); -var cscal = require( '@stdlib/blas/base/cscal-wasm' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); +const cscal = require( '@stdlib/blas/base/cscal-wasm' ); // Create a new memory instance with an initial size of 10 pages (320KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new cscal.Module( mem ); +const mod = new cscal.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'complex64'; +const dtype = 'complex64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Define a pointer for storing a complex number: -var zptr = N * bytesPerElement( dtype ); +const zptr = N * bytesPerElement( dtype ); // Write vector values to module memory: -var xbuf = oneTo( N*2, 'float32' ); -var x = new Complex64Array( xbuf.buffer ); +const xbuf = oneTo( N*2, 'float32' ); +const x = new Complex64Array( xbuf.buffer ); mod.write( xptr, x ); // Write a complex number to module memory: @@ -262,7 +262,7 @@ mod.write( zptr, new Float32Array( [ 2.0, 2.0 ] ) ); mod.main( N, zptr, xptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( xptr, view ); console.log( reinterpretComplex64( view, 0 ) ); @@ -283,44 +283,44 @@ Scales values from `cx` by `ca` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); -var cscal = require( '@stdlib/blas/base/cscal-wasm' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); +const cscal = require( '@stdlib/blas/base/cscal-wasm' ); // Create a new memory instance with an initial size of 10 pages (320KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new cscal.Module( mem ); +const mod = new cscal.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'complex64'; +const dtype = 'complex64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Define a pointer for storing a complex number: -var zptr = N * bytesPerElement( dtype ); +const zptr = N * bytesPerElement( dtype ); // Write vector values to module memory: -var xbuf = oneTo( N*2, 'float32' ); -var x = new Complex64Array( xbuf.buffer ); +const xbuf = oneTo( N*2, 'float32' ); +const x = new Complex64Array( xbuf.buffer ); mod.write( xptr, x ); // Write a complex number to module memory: @@ -330,7 +330,7 @@ mod.write( zptr, new Float32Array( [ 2.0, 2.0 ] ) ); mod.ndarray( N, zptr, xptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( xptr, view ); console.log( reinterpretComplex64( view, 0 ) ); @@ -368,22 +368,22 @@ The function has the following additional parameters: ```javascript -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); -var oneTo = require( '@stdlib/array/one-to' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); -var cscal = require( '@stdlib/blas/base/cscal-wasm' ); +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const oneTo = require( '@stdlib/array/one-to' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const reinterpretComplex64 = require( '@stdlib/strided/base/reinterpret-complex64' ); +const cscal = require( '@stdlib/blas/base/cscal-wasm' ); // Specify a vector length: -var N = 5; +const N = 5; // Create an input array: -var xbuf = oneTo( N*2, 'float32' ); -var x = new Complex64Array( xbuf.buffer ); +const xbuf = oneTo( N*2, 'float32' ); +const x = new Complex64Array( xbuf.buffer ); // Create a complex number: -var z = new Complex64( 2.0, 2.0 ); +const z = new Complex64( 2.0, 2.0 ); // Perform computation: cscal.ndarray( N, z, x, 1, 0 ); diff --git a/lib/node_modules/@stdlib/blas/base/cscal/README.md b/lib/node_modules/@stdlib/blas/base/cscal/README.md index 5ff72d193ef5..1fcfbef65588 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/cscal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cscal = require( '@stdlib/blas/base/cscal' ); +const cscal = require( '@stdlib/blas/base/cscal' ); ``` #### cscal( N, ca, cx, strideX ) @@ -35,23 +35,23 @@ var cscal = require( '@stdlib/blas/base/cscal' ); Scales values from `cx` by `ca`. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 0.0 ); +const cx = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const ca = new Complex64( 2.0, 0.0 ); cscal( 3, ca, cx, 1 ); -var z = cx.get( 0 ); +const z = cx.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 2.0 ``` @@ -65,23 +65,23 @@ The function has the following parameters: The `N` and stride parameters determine how values from `cx` are scaled by `ca`. For example, to scale every other value in `cx` by `ca`, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var ca = new Complex64( 2.0, 0.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const ca = new Complex64( 2.0, 0.0 ); cscal( 2, ca, cx, 2 ); -var z = cx.get( 2 ); +const z = cx.get( 2 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 10.0 -var im = imagf( z ); +const im = imagf( z ); // returns 12.0 ``` @@ -90,30 +90,30 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); // Create an offset view: -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scales every other value from `cx1` by `ca`... cscal( 3, ca, cx1, 1 ); -var z = cx0.get( 1 ); +const z = cx0.get( 1 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 14.0 ``` @@ -122,23 +122,23 @@ var im = imagf( z ); Scales values from `cx` by `ca` using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); cscal.ndarray( 3, ca, cx, 1, 0 ); -var z = cx.get( 0 ); +const z = cx.get( 0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 6.0 ``` @@ -149,23 +149,23 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other value in the input strided array starting from the second element, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const ca = new Complex64( 2.0, 2.0 ); cscal.ndarray( 2, ca, cx, 2, 1 ); -var z = cx.get( 3 ); +const z = cx.get( 3 ); // returns -var re = realf( z ); +const re = realf( z ); // returns -2.0 -var im = imagf( z ); +const im = imagf( z ); // returns 30.0 ``` @@ -191,19 +191,19 @@ var im = imagf( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cscal = require( '@stdlib/blas/base/cscal' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cscal = require( '@stdlib/blas/base/cscal' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); +const cx = filledarrayBy( 10, 'complex64', rand ); console.log( cx.toString() ); -var ca = new Complex64( 2.0, 2.0 ); +const ca = new Complex64( 2.0, 2.0 ); console.log( ca.toString() ); // Scale elements from `cx` by `ca`: diff --git a/lib/node_modules/@stdlib/blas/base/csrot/README.md b/lib/node_modules/@stdlib/blas/base/csrot/README.md index c908f6198f17..7573b440f021 100644 --- a/lib/node_modules/@stdlib/blas/base/csrot/README.md +++ b/lib/node_modules/@stdlib/blas/base/csrot/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var csrot = require( '@stdlib/blas/base/csrot' ); +const csrot = require( '@stdlib/blas/base/csrot' ); ``` #### csrot( N, cx, strideX, cy, strideY, c, s ) @@ -35,22 +35,22 @@ var csrot = require( '@stdlib/blas/base/csrot' ); Applies a plane rotation. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); csrot( cx.length, cx, 1, cy, 1, 0.8, 0.6 ); -var z = cy.get( 0 ); +let z = cy.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns ~-0.6 -var im = imagf( z ); +let im = imagf( z ); // returns ~-1.2 z = cx.get( 0 ); @@ -74,22 +74,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `cx` and `cy` are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); csrot( 2, cx, 2, cy, 2, 0.8, 0.6 ); -var z = cy.get( 0 ); +let z = cy.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns ~-0.6 -var im = imagf( z ); +let im = imagf( z ); // returns ~-1.2 z = cx.get( 0 ); @@ -107,27 +107,27 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial arrays... -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element csrot( 2, cx1, -2, cy1, 1, 0.8, 0.6 ); -var z = cy0.get( 2 ); +let z = cy0.get( 2 ); // returns -var re = realf( z ); +let re = realf( z ); // returns ~-4.2 -var im = imagf( z ); +let im = imagf( z ); // returns ~-4.8 z = cx0.get( 3 ); @@ -145,22 +145,22 @@ im = imagf( z ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); csrot.ndarray( cx.length, cx, 1, 0, cy, 1, 0, 0.8, 0.6 ); -var z = cy.get( 0 ); +let z = cy.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns ~-0.6 -var im = imagf( z ); +let im = imagf( z ); // returns ~-1.2 z = cx.get( 0 ); @@ -181,22 +181,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); csrot.ndarray( 2, cx, 2, 1, cy, 2, 1, 0.8, 0.6 ); -var z = cy.get( 3 ); +let z = cy.get( 3 ); // returns -var re = realf( z ); +let re = realf( z ); // returns ~-4.2 -var im = imagf( z ); +let im = imagf( z ); // returns ~-4.8 z = cx.get( 1 ); @@ -231,24 +231,24 @@ im = imagf( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var ccopy = require( '@stdlib/blas/base/ccopy' ); -var zeros = require( '@stdlib/array/zeros' ); -var logEach = require( '@stdlib/console/log-each' ); -var csrot = require( '@stdlib/blas/base/csrot' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const ccopy = require( '@stdlib/blas/base/ccopy' ); +const zeros = require( '@stdlib/array/zeros' ); +const logEach = require( '@stdlib/console/log-each' ); +const csrot = require( '@stdlib/blas/base/csrot' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } // Generate random input arrays: -var cx = filledarrayBy( 10, 'complex64', rand ); -var cxc = ccopy( cx.length, cx, 1, zeros( cx.length, 'complex64' ), 1 ); +const cx = filledarrayBy( 10, 'complex64', rand ); +const cxc = ccopy( cx.length, cx, 1, zeros( cx.length, 'complex64' ), 1 ); -var cy = filledarrayBy( 10, 'complex64', rand ); -var cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); +const cy = filledarrayBy( 10, 'complex64', rand ); +const cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); // Apply a plane rotation: csrot( cx.length, cx, 1, cy, 1, 0.8, 0.6 ); diff --git a/lib/node_modules/@stdlib/blas/base/cswap/README.md b/lib/node_modules/@stdlib/blas/base/cswap/README.md index b5f7fe45796f..4a136f87b8de 100644 --- a/lib/node_modules/@stdlib/blas/base/cswap/README.md +++ b/lib/node_modules/@stdlib/blas/base/cswap/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cswap = require( '@stdlib/blas/base/cswap' ); +const cswap = require( '@stdlib/blas/base/cswap' ); ``` #### cswap( N, x, strideX, y, strideY ) @@ -35,22 +35,22 @@ var cswap = require( '@stdlib/blas/base/cswap' ); Interchanges two complex single-precision floating-point vectors. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cswap( x.length, x, 1, y, 1 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 2.0 z = x.get( 0 ); @@ -74,22 +74,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are interchanged with values from `y`. For example, to interchange in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cswap( 2, x, -2, y, 1 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 5.0 -var im = imagf( z ); +let im = imagf( z ); // returns 6.0 z = x.get( 0 ); @@ -107,28 +107,28 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Initial arrays... -var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Interchange in reverse order every other value from `x1` into `y1`... cswap( 2, x1, -2, y1, 1 ); -var z = y0.get( 2 ); +let z = y0.get( 2 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 7.0 -var im = imagf( z ); +let im = imagf( z ); // returns 8.0 z = x0.get( 1 ); @@ -146,22 +146,22 @@ im = imagf( z ); Interchanges two complex single-precision floating-point vectors using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 1.0 -var im = imagf( z ); +let im = imagf( z ); // returns 2.0 z = x.get( 0 ); @@ -182,22 +182,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to interchange every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cswap.ndarray( 2, x, 2, 1, y, -1, y.length-1 ); -var z = y.get( y.length-1 ); +let z = y.get( y.length-1 ); // returns -var re = realf( z ); +let re = realf( z ); // returns 3.0 -var im = imagf( z ); +let im = imagf( z ); // returns 4.0 z = x.get( x.length-1 ); @@ -232,19 +232,19 @@ im = imagf( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cswap = require( '@stdlib/blas/base/cswap' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cswap = require( '@stdlib/blas/base/cswap' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var x = filledarrayBy( 10, 'complex64', rand ); +const x = filledarrayBy( 10, 'complex64', rand ); console.log( x.get( 0 ).toString() ); -var y = filledarrayBy( 10, 'complex64', rand ); +const y = filledarrayBy( 10, 'complex64', rand ); console.log( y.get( 0 ).toString() ); // Swap elements in `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/dasum-wasm/README.md b/lib/node_modules/@stdlib/blas/base/dasum-wasm/README.md index b9b1a03967c8..8911fd165eba 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dasum-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dasum = require( '@stdlib/blas/base/dasum-wasm' ); +const dasum = require( '@stdlib/blas/base/dasum-wasm' ); ``` #### dasum.main( N, x, stride ) @@ -35,11 +35,11 @@ var dasum = require( '@stdlib/blas/base/dasum-wasm' ); Computes the sum of absolute values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var sum = dasum.main( x.length, x, 1 ); +const sum = dasum.main( x.length, x, 1 ); // returns 15.0 ``` @@ -52,11 +52,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to compute the sum of every other value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = dasum.main( 4, x, 2 ); +const sum = dasum.main( 4, x, 2 ); // returns 10.0 ``` @@ -65,15 +65,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create a typed array view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var sum = dasum.main( 3, x1, 2 ); +const sum = dasum.main( 3, x1, 2 ); // returns 12.0 ``` @@ -82,11 +82,11 @@ var sum = dasum.main( 3, x1, 2 ); Computes the sum of absolute values using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = dasum.ndarray( x.length, x, 1, 0 ); +const sum = dasum.ndarray( x.length, x, 1, 0 ); // returns 19.0 ``` @@ -97,11 +97,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to compute the sum of last three elements, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var sum = dasum.ndarray( 3, x, 1, x.length-3 ); +let sum = dasum.ndarray( 3, x, 1, x.length-3 ); // returns 15.0 // Using a negative stride to sum from the last element: @@ -120,16 +120,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dasum.Module( mem ); +const mod = new dasum.Module( mem ); // returns // Initialize the routine: @@ -143,37 +143,37 @@ Computes the sum of absolute values. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var zeros = require( '@stdlib/array/zeros' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const zeros = require( '@stdlib/array/zeros' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dasum.Module( mem ); +const mod = new dasum.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var sum = mod.main( N, xptr, 1 ); +const sum = mod.main( N, xptr, 1 ); // returns 15.0 ``` @@ -190,37 +190,37 @@ Computes the sum of absolute values using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var zeros = require( '@stdlib/array/zeros' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const zeros = require( '@stdlib/array/zeros' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dasum.Module( mem ); +const mod = new dasum.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var sum = mod.ndarray( N, xptr, 1, 0 ); +const sum = mod.ndarray( N, xptr, 1, 0 ); // returns 15.0 ``` @@ -255,16 +255,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dasum = require( '@stdlib/blas/base/dasum-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dasum = require( '@stdlib/blas/base/dasum-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var sum = dasum.ndarray( x.length, x, 1, 0 ); +const sum = dasum.ndarray( x.length, x, 1, 0 ); console.log( sum ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/dasum/README.md b/lib/node_modules/@stdlib/blas/base/dasum/README.md index 985daee97205..aa4911435758 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/dasum/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var dasum = require( '@stdlib/blas/base/dasum' ); +const dasum = require( '@stdlib/blas/base/dasum' ); ``` #### dasum( N, x, stride ) @@ -56,11 +56,11 @@ var dasum = require( '@stdlib/blas/base/dasum' ); Computes the sum of [absolute values][@stdlib/math/base/special/abs]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = dasum( x.length, x, 1 ); +const sum = dasum( x.length, x, 1 ); // returns 19.0 ``` @@ -73,27 +73,27 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = dasum( 4, x, 2 ); +const sum = dasum( 4, x, 2 ); // returns 10.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sum every other value... -var sum = dasum( 3, x1, 2 ); +const sum = dasum( 3, x1, 2 ); // returns 12.0 ``` @@ -104,11 +104,11 @@ If `N` is less than or equal to `0`, the function returns `0`. Computes the sum of [absolute values][@stdlib/math/base/special/abs] using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = dasum.ndarray( x.length, x, 1, 0 ); +const sum = dasum.ndarray( x.length, x, 1, 0 ); // returns 19.0 ``` @@ -119,11 +119,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var sum = dasum.ndarray( 3, x, 1, x.length-3 ); +let sum = dasum.ndarray( 3, x, 1, x.length-3 ); // returns 15.0 // Using a negative stride to sum from the last element: @@ -153,16 +153,16 @@ sum = dasum.ndarray( 3, x, -1, x.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dasum = require( '@stdlib/blas/base/dasum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dasum = require( '@stdlib/blas/base/dasum' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var out = dasum( x.length, x, 1 ); +const out = dasum( x.length, x, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/daxpy-wasm/README.md b/lib/node_modules/@stdlib/blas/base/daxpy-wasm/README.md index fae7996ae87a..72a5165bb4dd 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/daxpy-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var daxpy = require( '@stdlib/blas/base/daxpy-wasm' ); +const daxpy = require( '@stdlib/blas/base/daxpy-wasm' ); ``` #### daxpy.main( N, alpha, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var daxpy = require( '@stdlib/blas/base/daxpy-wasm' ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); daxpy.main( x.length, 5.0, x, 1, y, 1 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -56,12 +56,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const alpha = 5.0; daxpy.main( 3, alpha, x, 2, y, -1 ); // y => [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ] @@ -72,15 +72,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element daxpy.main( 3, 5.0, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -91,11 +91,11 @@ daxpy.main( 3, 5.0, x1, -2, y1, 1 ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var alpha = 5.0; +const alpha = 5.0; daxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -131,16 +131,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new daxpy.Module( mem ); +const mod = new daxpy.Module( mem ); // returns // Initialize the routine: @@ -154,34 +154,34 @@ Multiplies a vector `x` by a constant and adds the result to `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new daxpy.Module( mem ); +const mod = new daxpy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -191,7 +191,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, 5.0, xptr, 1, yptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -214,34 +214,34 @@ Multiplies a vector `x` by a constant and adds the result to `y` using alternati ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new daxpy.Module( mem ); +const mod = new daxpy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -251,7 +251,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, 5.0, xptr, 1, 0, yptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -290,16 +290,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var daxpy = require( '@stdlib/blas/base/daxpy-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const daxpy = require( '@stdlib/blas/base/daxpy-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); daxpy.ndarray( x.length, 5.0, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/daxpy/README.md b/lib/node_modules/@stdlib/blas/base/daxpy/README.md index 264cb253bf18..9d2c62cd0e29 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/daxpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var daxpy = require( '@stdlib/blas/base/daxpy' ); +const daxpy = require( '@stdlib/blas/base/daxpy' ); ``` #### daxpy( N, alpha, x, strideX, y, strideY ) @@ -35,11 +35,11 @@ var daxpy = require( '@stdlib/blas/base/daxpy' ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; daxpy( x.length, alpha, x, 1, y, 1 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const alpha = 5.0; daxpy( 3, alpha, x, 2, y, -1 ); // y => [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ] @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element daxpy( 3, 5.0, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -92,11 +92,11 @@ daxpy( 3, 5.0, x1, -2, y1, 1 ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -110,12 +110,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var alpha = 5.0; +const alpha = 5.0; daxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -143,16 +143,16 @@ daxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var daxpy = require( '@stdlib/blas/base/daxpy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const daxpy = require( '@stdlib/blas/base/daxpy' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); daxpy.ndarray( x.length, 5.0, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/dcabs1/README.md b/lib/node_modules/@stdlib/blas/base/dcabs1/README.md index eb30b16077bf..3fe5f2e1cfac 100644 --- a/lib/node_modules/@stdlib/blas/base/dcabs1/README.md +++ b/lib/node_modules/@stdlib/blas/base/dcabs1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dcabs1 = require( '@stdlib/blas/base/dcabs1' ); +const dcabs1 = require( '@stdlib/blas/base/dcabs1' ); ``` #### dcabs1( z ) @@ -35,9 +35,9 @@ var dcabs1 = require( '@stdlib/blas/base/dcabs1' ); Computes the sum of the [absolute values][absolute-value] of the real part and imaginary components of a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var y = dcabs1( new Complex128( 5.0, -3.0 ) ); +const y = dcabs1( new Complex128( 5.0, -3.0 ) ); // returns 8.0 ``` @@ -52,14 +52,12 @@ var y = dcabs1( new Complex128( 5.0, -3.0 ) ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var dcabs1 = require( '@stdlib/blas/base/dcabs1' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const dcabs1 = require( '@stdlib/blas/base/dcabs1' ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); console.log( 'dcabs1(%s) = %d', z.toString(), dcabs1( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/blas/base/dcopy-wasm/README.md b/lib/node_modules/@stdlib/blas/base/dcopy-wasm/README.md index 41a17d81ee02..98ff07344a47 100644 --- a/lib/node_modules/@stdlib/blas/base/dcopy-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dcopy-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dcopy = require( '@stdlib/blas/base/dcopy-wasm' ); +const dcopy = require( '@stdlib/blas/base/dcopy-wasm' ); ``` #### dcopy.main( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dcopy = require( '@stdlib/blas/base/dcopy-wasm' ); Copies values from `x` into `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dcopy.main( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -55,10 +55,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to copy every other element from `x` into `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dcopy.main( 3, x, 2, y, -1 ); // y => [ 5.0, 3.0, 1.0, 1.0, 1.0, 1.0 ] @@ -69,15 +69,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcopy.main( 3, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -88,10 +88,10 @@ dcopy.main( 3, x1, -2, y1, 1 ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -105,10 +105,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dcopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -125,16 +125,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dcopy.Module( mem ); +const mod = new dcopy.Module( mem ); // returns // Initialize the routine: @@ -148,34 +148,34 @@ Copies values from `x` into `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dcopy.Module( mem ); +const mod = new dcopy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -185,7 +185,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, xptr, 1, yptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -207,34 +207,34 @@ Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dcopy.Module( mem ); +const mod = new dcopy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -244,7 +244,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -283,16 +283,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dcopy = require( '@stdlib/blas/base/dcopy-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dcopy = require( '@stdlib/blas/base/dcopy-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); dcopy.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/dcopy/README.md b/lib/node_modules/@stdlib/blas/base/dcopy/README.md index e25a02a65840..a341770297ac 100644 --- a/lib/node_modules/@stdlib/blas/base/dcopy/README.md +++ b/lib/node_modules/@stdlib/blas/base/dcopy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dcopy = require( '@stdlib/blas/base/dcopy' ); +const dcopy = require( '@stdlib/blas/base/dcopy' ); ``` #### dcopy( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dcopy = require( '@stdlib/blas/base/dcopy' ); Copies values from `x` into `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); dcopy( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -55,10 +55,10 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dcopy( 3, x, -2, y, 1 ); // y => [ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ] @@ -69,15 +69,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Copy in reverse order every other value from `x1` into `y1`... dcopy( 3, x1, -2, y1, 1 ); @@ -89,10 +89,10 @@ dcopy( 3, x1, -2, y1, 1 ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -106,10 +106,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dcopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -137,16 +137,16 @@ dcopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dcopy = require( '@stdlib/blas/base/dcopy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dcopy = require( '@stdlib/blas/base/dcopy' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Copy elements from `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/ddot-wasm/README.md b/lib/node_modules/@stdlib/blas/base/ddot-wasm/README.md index f13388eea677..b525bbca5583 100644 --- a/lib/node_modules/@stdlib/blas/base/ddot-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/ddot-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ddot = require( '@stdlib/blas/base/ddot-wasm' ); +const ddot = require( '@stdlib/blas/base/ddot-wasm' ); ``` #### ddot.main( N, x, strideX, y, strideY ) @@ -35,12 +35,12 @@ var ddot = require( '@stdlib/blas/base/ddot-wasm' ); Computes the dot product of `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = ddot.main( x.length, x, 1, y, 1 ); +const z = ddot.main( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -55,12 +55,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = ddot.main( 3, x, 2, y, -1 ); +const z = ddot.main( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -69,17 +69,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = ddot.main( 3, x1, -2, y1, 1 ); +const z = ddot.main( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -88,12 +88,12 @@ var z = ddot.main( 3, x1, -2, y1, 1 ); Computes the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -105,12 +105,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = ddot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = ddot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -125,16 +125,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new ddot.Module( mem ); +const mod = new ddot.Module( mem ); // returns // Initialize the routine: @@ -148,41 +148,41 @@ Computes the dot product of `x` and `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new ddot.Module( mem ); +const mod = new ddot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); mod.write( yptr, ones( N, dtype ) ); // Perform computation: -var z = mod.main( N, xptr, 1, yptr, 1 ); +const z = mod.main( N, xptr, 1, yptr, 1 ); console.log( z ); ``` @@ -202,41 +202,41 @@ Computes the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new ddot.Module( mem ); +const mod = new ddot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); mod.write( yptr, ones( N, dtype ) ); // Perform computation: -var z = mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); +const z = mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); console.log( z ); ``` @@ -273,19 +273,19 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ddot = require( '@stdlib/blas/base/ddot-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ddot = require( '@stdlib/blas/base/ddot-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var z = ddot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); +const z = ddot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); console.log( z ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/ddot/README.md b/lib/node_modules/@stdlib/blas/base/ddot/README.md index 90b7023547a4..d310a65f3249 100644 --- a/lib/node_modules/@stdlib/blas/base/ddot/README.md +++ b/lib/node_modules/@stdlib/blas/base/ddot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var ddot = require( '@stdlib/blas/base/ddot' ); +const ddot = require( '@stdlib/blas/base/ddot' ); ``` #### ddot( N, x, strideX, y, strideY ) @@ -56,12 +56,12 @@ var ddot = require( '@stdlib/blas/base/ddot' ); Calculates the dot product of vectors `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = ddot( x.length, x, 1, y, 1 ); +const z = ddot( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -76,12 +76,12 @@ The function has the following parameters: The `N` and strides parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = ddot( 3, x, 2, y, -1 ); +const z = ddot( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -90,17 +90,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = ddot( 3, x1, -2, y1, 1 ); +const z = ddot( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -109,12 +109,12 @@ var z = ddot( 3, x1, -2, y1, 1 ); Calculates the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -126,12 +126,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = ddot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = ddot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -157,19 +157,19 @@ var z = ddot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ddot = require( '@stdlib/blas/base/ddot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ddot = require( '@stdlib/blas/base/ddot' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var out = ddot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); +const out = ddot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/README.md b/lib/node_modules/@stdlib/blas/base/dgemm/README.md index 37a124e79288..98a5f1826ecc 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dgemm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dgemm = require( '@stdlib/blas/base/dgemm' ); +const dgemm = require( '@stdlib/blas/base/dgemm' ); ``` #### dgemm( ord, ta, tb, M, N, K, α, A, lda, B, ldb, β, C, ldc ) @@ -35,11 +35,11 @@ var dgemm = require( '@stdlib/blas/base/dgemm' ); Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); -var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +const C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); dgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 2, B, 2, 1.0, C, 2 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -65,11 +65,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] ); -var B = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] ); -var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] ); +const B = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] ); +const C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); dgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 4, B, 4, 1.0, C, 2 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -82,11 +82,11 @@ dgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 4, B, 4, 1. Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); -var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +const C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); dgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 2, 1, 0, B, 2, 1, 0, 1.0, C, 2, 1, 0 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -107,11 +107,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); -var B = new Float64Array( [ 0.0, 1.0, 0.0, 1.0, 1.0 ] ); -var C = new Float64Array( [ 0.0, 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); +const A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); +const B = new Float64Array( [ 0.0, 1.0, 0.0, 1.0, 1.0 ] ); +const C = new Float64Array( [ 0.0, 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); dgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 1, 2, 2, B, 1, 2, 1, 1.0, C, 1, 2, 3 ); // C => [ 0.0, 0.0, 0.0, 2.0, 6.0, 5.0, 11.0 ] @@ -138,20 +138,20 @@ dgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 1, 2, 2, B, 1, 2 ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dgemm = require( '@stdlib/blas/base/dgemm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dgemm = require( '@stdlib/blas/base/dgemm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var M = 3; -var N = 4; -var K = 2; +const M = 3; +const N = 4; +const K = 2; -var A = discreteUniform( M*K, 0, 10, opts ); // 3x2 -var B = discreteUniform( K*N, 0, 10, opts ); // 2x4 -var C = discreteUniform( M*N, 0, 10, opts ); // 3x4 +const A = discreteUniform( M*K, 0, 10, opts ); // 3x2 +const B = discreteUniform( K*N, 0, 10, opts ); // 2x4 +const C = discreteUniform( M*N, 0, 10, opts ); // 3x4 dgemm( 'row-major', 'no-transpose', 'no-transpose', M, N, K, 1.0, A, K, B, N, 1.0, C, N ); console.log( C ); diff --git a/lib/node_modules/@stdlib/blas/base/dgemv/README.md b/lib/node_modules/@stdlib/blas/base/dgemv/README.md index ab38a7abd2d6..3940e8dc4f22 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dgemv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dgemv = require( '@stdlib/blas/base/dgemv' ); +const dgemv = require( '@stdlib/blas/base/dgemv' ); ``` #### dgemv( ord, trans, M, N, α, A, LDA, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var dgemv = require( '@stdlib/blas/base/dgemv' ); Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A**T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0 ] ); dgemv( 'row-major', 'no-transpose', 2, 3, 1.0, A, 3, x, 1, 1.0, y, 1 ); // y => [ 7.0, 16.0 ] @@ -63,11 +63,11 @@ The function has the following parameters: The stride parameters determine how operations are performed. For example, to iterate over every other element in `x` and `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var x = new Float64Array( [ 1.0, 0.0, 1.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 0.0, 1.0, 0.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 1.0, 0.0, 1.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 0.0, 1.0, 0.0 ] ); dgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x, 2, 1.0, y, 2 ); // y => [ 4.0, 0.0, 8.0, 0.0 ] @@ -78,16 +78,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x1, -1, 1.0, y1, -1 ); // y0 => [ 0.0, 8.0, 4.0 ] @@ -98,11 +98,11 @@ dgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x1, -1, 1.0, y1, -1 ); Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A**T*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0 ] ); dgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // y => [ 7.0, 16.0 ] @@ -119,11 +119,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0 ] ); dgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 1, 1.0, y, -2, 2 ); // y => [ 39, 8, 23, 10 ] @@ -150,19 +150,19 @@ dgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 1, 1.0, y, -2, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dgemv = require( '@stdlib/blas/base/dgemv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dgemv = require( '@stdlib/blas/base/dgemv' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var M = 3; -var N = 3; +const M = 3; +const N = 3; -var A = discreteUniform( M*N, 0, 255, opts ); -var x = discreteUniform( N, 0, 255, opts ); -var y = discreteUniform( M, 0, 255, opts ); +const A = discreteUniform( M*N, 0, 255, opts ); +const x = discreteUniform( N, 0, 255, opts ); +const y = discreteUniform( M, 0, 255, opts ); dgemv( 'row-major', 'no-transpose', M, N, 1.0, A, N, x, -1, 1.0, y, -1 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/dger/README.md b/lib/node_modules/@stdlib/blas/base/dger/README.md index 679b9ef2fb63..0fc54df1e18d 100644 --- a/lib/node_modules/@stdlib/blas/base/dger/README.md +++ b/lib/node_modules/@stdlib/blas/base/dger/README.md @@ -35,7 +35,7 @@ TODO ## Usage ```javascript -var dger = require( '@stdlib/blas/base/dger' ); +const dger = require( '@stdlib/blas/base/dger' ); ``` #### TODO diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-enum2str/README.md b/lib/node_modules/@stdlib/blas/base/diagonal-type-enum2str/README.md index 9afb7880d263..bf60d1b8d151 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-enum2str/README.md +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/blas/base/diagonal-type-enum2str' ); +const enum2str = require( '@stdlib/blas/base/diagonal-type-enum2str' ); ``` #### enum2str( value ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/blas/base/diagonal-type-enum2str' ); Returns the BLAS diagonal type string associated with a BLAS diagonal type enumeration constant. ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var v = str2enum( 'unit' ); +const v = str2enum( 'unit' ); // returns -var s = enum2str( v ); +const s = enum2str( v ); // returns 'unit' ``` If unable to resolve a diagonal type string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var enum2str = require( '@stdlib/blas/base/diagonal-type-enum2str' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const enum2str = require( '@stdlib/blas/base/diagonal-type-enum2str' ); -var str = enum2str( str2enum( 'unit' ) ); +let str = enum2str( str2enum( 'unit' ) ); // returns 'unit' str = enum2str( str2enum( 'non-unit' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/README.md b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/README.md index f7d1fec57d62..13f18b329b32 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/diagonal-type-resolve-enum' ); ``` #### resolve( value ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-enum' ); Returns the enumeration constant associated with a BLAS diagonal type value. ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var v = resolve( 'non-unit' ); +let v = resolve( 'non-unit' ); // returns v = resolve( str2enum( 'non-unit' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'non-unit' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/diagonal-type-resolve-enum' ); -var v = resolve( 'non-unit' ); +let v = resolve( 'non-unit' ); // returns v = resolve( 'unit' ); diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/README.md b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/README.md index 8d1f0fdfc3c4..b41ca2925f24 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/README.md +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); +const resolve = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); ``` #### resolve( value ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); Returns the diagonal type string associated with a BLAS diagonal type value. ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var v = resolve( 'unit' ); +let v = resolve( 'unit' ); // returns 'unit' v = resolve( str2enum( 'unit' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'unit' ) ); If unable to resolve a diagonal type string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var resolve = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const resolve = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); -var v = resolve( str2enum( 'unit' ) ); +let v = resolve( str2enum( 'unit' ) ); // returns 'unit' v = resolve( str2enum( 'non-unit' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-str2enum/README.md b/lib/node_modules/@stdlib/blas/base/diagonal-type-str2enum/README.md index ed84b5a19f86..2d0228e7e795 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-str2enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); ``` #### str2enum( diagonal ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); Returns the enumeration constant associated with a BLAS diagonal-type. ```javascript -var v = str2enum( 'unit' ); +const v = str2enum( 'unit' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +const str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); -var v = str2enum( 'unit' ); +let v = str2enum( 'unit' ); // returns v = str2enum( 'non-unit' ); diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-types/README.md b/lib/node_modules/@stdlib/blas/base/diagonal-types/README.md index c935ab5ad01d..a6ce3659a4e2 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-types/README.md +++ b/lib/node_modules/@stdlib/blas/base/diagonal-types/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var diagonalTypes = require( '@stdlib/blas/base/diagonal-types' ); +const diagonalTypes = require( '@stdlib/blas/base/diagonal-types' ); ``` #### diagonalTypes() @@ -45,7 +45,7 @@ var diagonalTypes = require( '@stdlib/blas/base/diagonal-types' ); Returns a list of BLAS diagonal element types. ```javascript -var out = diagonalTypes(); +const out = diagonalTypes(); // e.g., returns [ 'non-unit', 'unit' ] ``` @@ -75,12 +75,12 @@ The output array contains the following types: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var diagonalTypes = require( '@stdlib/blas/base/diagonal-types' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const diagonalTypes = require( '@stdlib/blas/base/diagonal-types' ); -var isDiagonalType = contains( diagonalTypes() ); +const isDiagonalType = contains( diagonalTypes() ); -var bool = isDiagonalType( 'non-unit' ); +let bool = isDiagonalType( 'non-unit' ); // returns true bool = isDiagonalType( 'unit' ); diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2-wasm/README.md b/lib/node_modules/@stdlib/blas/base/dnrm2-wasm/README.md index 9e0d3ad7e507..826c9eb0547c 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dnrm2-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dnrm2 = require( '@stdlib/blas/base/dnrm2-wasm' ); +const dnrm2 = require( '@stdlib/blas/base/dnrm2-wasm' ); ``` #### dnrm2.main( N, x, strideX ) @@ -35,11 +35,11 @@ var dnrm2 = require( '@stdlib/blas/base/dnrm2-wasm' ); Calculates the L2-norm of a double-precision floating-point vector. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var z = dnrm2.main( 3, x, 1 ); +const z = dnrm2.main( 3, x, 1 ); // returns 3.0 ``` @@ -52,11 +52,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to compute the L2-norm of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var z = dnrm2.main( 4, x, 2 ); +const z = dnrm2.main( 4, x, 2 ); // returns 5.0 ``` @@ -65,15 +65,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); // Create a typed array view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z = dnrm2.main( 4, x1, 2 ); +const z = dnrm2.main( 4, x1, 2 ); // returns 5.0 ``` @@ -82,11 +82,11 @@ var z = dnrm2.main( 4, x1, 2 ); Calculates the L2-norm of a double-precision floating-point vector using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var z = dnrm2.ndarray( 3, x, 1, 0 ); +const z = dnrm2.ndarray( 3, x, 1, 0 ); // returns 3.0 ``` @@ -97,11 +97,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the L2-norm for every other value in `x` starting from the second value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var z = dnrm2.ndarray( 4, x, 2, 1 ); +const z = dnrm2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -116,16 +116,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dnrm2.Module( mem ); +const mod = new dnrm2.Module( mem ); // returns // Initialize the routine: @@ -139,36 +139,36 @@ Computes the L2-norm of a double-precision floating-point vector. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dnrm2.Module( mem ); +const mod = new dnrm2.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var out = mod.main( N, xptr, 1 ); +const out = mod.main( N, xptr, 1 ); // returns ~7.42 ``` @@ -185,36 +185,36 @@ Computes the L2-norm of a double-precision floating-point vector using alternati ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dnrm2.Module( mem ); +const mod = new dnrm2.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var out = mod.ndarray( N, xptr, 1, 0 ); +const out = mod.ndarray( N, xptr, 1, 0 ); // returns ~7.42 ``` @@ -249,16 +249,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dnrm2 = require( '@stdlib/blas/base/dnrm2-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dnrm2 = require( '@stdlib/blas/base/dnrm2-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var out = dnrm2.ndarray( x.length, x, 1, 0 ); +const out = dnrm2.ndarray( x.length, x, 1, 0 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2/README.md b/lib/node_modules/@stdlib/blas/base/dnrm2/README.md index c4a6f6e72934..e6434c4399df 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/dnrm2/README.md @@ -44,7 +44,7 @@ The [L2-norm][l2-norm] is defined as ## Usage ```javascript -var dnrm2 = require( '@stdlib/blas/base/dnrm2' ); +const dnrm2 = require( '@stdlib/blas/base/dnrm2' ); ``` #### dnrm2( N, x, stride ) @@ -52,11 +52,11 @@ var dnrm2 = require( '@stdlib/blas/base/dnrm2' ); Computes the [L2-norm][l2-norm] of a double-precision floating-point vector `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var z = dnrm2( 3, x, 1 ); +const z = dnrm2( 3, x, 1 ); // returns 3.0 ``` @@ -69,11 +69,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [L2-norm][l2-norm] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var z = dnrm2( 4, x, 2 ); +const z = dnrm2( 4, x, 2 ); // returns 5.0 ``` @@ -82,12 +82,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z = dnrm2( 4, x1, 2 ); +const z = dnrm2( 4, x1, 2 ); // returns 5.0 ``` @@ -98,11 +98,11 @@ If `N` is less than or equal to `0`, the function returns `0`. Computes the [L2-norm][l2-norm] of a double-precision floating-point vector using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var z = dnrm2.ndarray( 3, x, 1, 0 ); +const z = dnrm2.ndarray( 3, x, 1, 0 ); // returns 3.0 ``` @@ -113,11 +113,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [L2-norm][l2-norm] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var z = dnrm2.ndarray( 4, x, 2, 1 ); +const z = dnrm2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -143,16 +143,16 @@ var z = dnrm2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dnrm2 = require( '@stdlib/blas/base/dnrm2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dnrm2 = require( '@stdlib/blas/base/dnrm2' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var out = dnrm2( x.length, x, 1 ); +const out = dnrm2( x.length, x, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/drot-wasm/README.md b/lib/node_modules/@stdlib/blas/base/drot-wasm/README.md index a243f0ade209..5568e685658f 100644 --- a/lib/node_modules/@stdlib/blas/base/drot-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/drot-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var drot = require( '@stdlib/blas/base/drot-wasm' ); +const drot = require( '@stdlib/blas/base/drot-wasm' ); ``` #### drot.main( N, x, strideX, y, strideY, c, s ) @@ -35,10 +35,10 @@ var drot = require( '@stdlib/blas/base/drot-wasm' ); Applies a plane rotation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); drot.main( x.length, x, 1, y, 1, 0.0, 1.0 ); // x => [ 1.0, 1.0, 1.0, 1.0, 1.0 ] @@ -58,10 +58,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); drot.main( 3, x, 2, y, 2, 0.8, 0.6 ); // x => [ 5.0, 2.0, 7.8, 4.0, 10.6, 6.0 ] @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element drot.main( 3, x1, -2, y1, 1, 0.8, 0.6 ); // x0 => [ 1.0, ~8.8, 3.0, 9.8, 5.0, 10.8 ] @@ -93,10 +93,10 @@ drot.main( 3, x1, -2, y1, 1, 0.8, 0.6 ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); drot.ndarray( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); // x => [ 1.0, ~5.8, 7.2, 8.6, 10.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); drot.ndarray( 3, x, 2, 1, y, 2, 1, 0.8, 0.6 ); // x => [ 1.0, 6.4, 3.0, 9.2, 5.0, 12.0 ] @@ -132,16 +132,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new drot.Module( mem ); +const mod = new drot.Module( mem ); // returns // Initialize the routine: @@ -155,34 +155,34 @@ Applies a plane rotation. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new drot.Module( mem ); +const mod = new drot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -192,8 +192,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, xptr, 1, yptr, 1, 0.0, 1.0 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -221,34 +221,34 @@ Applies a plane rotation using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new drot.Module( mem ); +const mod = new drot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -258,8 +258,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, xptr, 1, 0, yptr, 1, 0, 0.0, 1.0 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -302,16 +302,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var drot = require( '@stdlib/blas/base/drot-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const drot = require( '@stdlib/blas/base/drot-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); drot.ndarray( x.length, x, 1, 0, y, -1, y.length-1, 0.8, 0.6 ); diff --git a/lib/node_modules/@stdlib/blas/base/drot/README.md b/lib/node_modules/@stdlib/blas/base/drot/README.md index f12f5efce11c..b85abc2e7125 100644 --- a/lib/node_modules/@stdlib/blas/base/drot/README.md +++ b/lib/node_modules/@stdlib/blas/base/drot/README.md @@ -41,7 +41,7 @@ where `x_i` and `y_i` are the individual elements on which the rotation is appli ## Usage ```javascript -var drot = require( '@stdlib/blas/base/drot' ); +const drot = require( '@stdlib/blas/base/drot' ); ``` #### drot( N, x, strideX, y, strideY, c, s ) @@ -49,10 +49,10 @@ var drot = require( '@stdlib/blas/base/drot' ); Applies a plane rotation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); drot( x.length, x, 1, y, 1, 0.8, 0.6 ); // x => [ ~4.4, ~5.8, 7.2, 8.6, 10.0 ] @@ -72,10 +72,10 @@ The function has the following parameters: The `N` and stride parameters determine how values in the strided arrays are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); drot( 3, x, 2, y, 2, 0.8, 0.6 ); // x => [ 5.0, 2.0, 7.8, 4.0, 10.6, 6.0 ] @@ -87,15 +87,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element drot( 3, x1, -2, y1, 1, 0.8, 0.6 ); // x0 => [ 1.0, ~8.8, 3.0, 9.8, 5.0, 10.8 ] @@ -107,10 +107,10 @@ drot( 3, x1, -2, y1, 1, 0.8, 0.6 ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); drot.ndarray( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); // x => [ 1.0, ~5.8, 7.2, 8.6, 10.0 ] @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); drot.ndarray( 3, x, 2, 1, y, 2, 1, 0.8, 0.6 ); // x => [ 1.0, 6.4, 3.0, 9.2, 5.0, 12.0 ] @@ -157,16 +157,16 @@ drot.ndarray( 3, x, 2, 1, y, 2, 1, 0.8, 0.6 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var drot = require( '@stdlib/blas/base/drot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const drot = require( '@stdlib/blas/base/drot' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Apply a plane rotation: diff --git a/lib/node_modules/@stdlib/blas/base/drotg/README.md b/lib/node_modules/@stdlib/blas/base/drotg/README.md index decede2c4f99..765775ae6cba 100644 --- a/lib/node_modules/@stdlib/blas/base/drotg/README.md +++ b/lib/node_modules/@stdlib/blas/base/drotg/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var drotg = require( '@stdlib/blas/base/drotg' ); +const drotg = require( '@stdlib/blas/base/drotg' ); ``` #### drotg( a, b ) @@ -35,7 +35,7 @@ var drotg = require( '@stdlib/blas/base/drotg' ); Constructs a Givens plane rotation provided two double-precision floating-point values `a` and `b`. ```javascript -var out = drotg( 0.0, 2.0 ); +const out = drotg( 0.0, 2.0 ); // returns [ 2.0, 1.0, 0.0, 1.0 ] ``` @@ -49,14 +49,14 @@ The function has the following parameters: Constructs a Givens plane rotation provided two double-precision floating-point values `a` and `b` and assigns results to an output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 4 ); +const out = new Float64Array( 4 ); -var y = drotg.assign( 0.0, 2.0, out, 1, 0 ); +const y = drotg.assign( 0.0, 2.0, out, 1, 0 ); // returns [ 2.0, 1.0, 0.0, 1.0 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true ``` @@ -77,14 +77,11 @@ var bool = ( y === out );
```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var drotg = require( '@stdlib/blas/base/drotg' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const drotg = require( '@stdlib/blas/base/drotg' ); -var out; -var i; - -for ( i = 0; i < 100; i++ ) { - out = drotg( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); +for ( let i = 0; i < 100; i++ ) { + const out = drotg( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); console.log( out ); } ``` diff --git a/lib/node_modules/@stdlib/blas/base/drotm/README.md b/lib/node_modules/@stdlib/blas/base/drotm/README.md index 1c3cbd622814..e6dc31c41a75 100644 --- a/lib/node_modules/@stdlib/blas/base/drotm/README.md +++ b/lib/node_modules/@stdlib/blas/base/drotm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var drotm = require( '@stdlib/blas/base/drotm' ); +const drotm = require( '@stdlib/blas/base/drotm' ); ``` #### drotm( N, x, strideX, y, strideY, param ) @@ -35,11 +35,11 @@ var drotm = require( '@stdlib/blas/base/drotm' ); Applies a modified Givens plane rotation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); drotm( 2, x, 2, y, 1, param ); // x => [ ~-17.0, 2.0, ~-18.0, 4.0, 5.0 ] @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine how values in the strided arrays are accessed at runtime. For example, to apply a modified Givens plane rotation to every other element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); drotm( 3, x, 2, y, 2, param ); // x => [ ~-20.0, 2.0, ~-24.0, 4.0, ~-28.0, 6.0 ] @@ -74,16 +74,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y0 = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float64Array( [ 1.0, 0.0, 2.0, 3.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y0 = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float64Array( [ 1.0, 0.0, 2.0, 3.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element drotm( 2, x1, 1, y1, 1, param ); // x0 => [ 1.0, ~9.0, ~10.0, 4.0, 5.0 ] @@ -95,11 +95,11 @@ drotm( 2, x1, 1, y1, 1, param ); Applies a modified Givens plane rotation using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); drotm.ndarray( 2, x, 1, 0, y, 2, 1, param ); // x => [ ~-20.0, ~-25.0, 3.0, 4.0, 5.0 ] @@ -114,11 +114,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a modified Givens plane rotation to every other element starting from the second element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const param = new Float64Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); drotm.ndarray( 3, x, 2, 1, y, 2, 1, param ); // x => [ 1.0, ~-22.0, 3.0, ~-26.0, 5.0, ~-30.0 ] @@ -147,19 +147,19 @@ drotm.ndarray( 3, x, 2, 1, y, 2, 1, param ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var drotm = require( '@stdlib/blas/base/drotm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const drotm = require( '@stdlib/blas/base/drotm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); -var param = discreteUniform( 5, -5, 5, opts ); +const param = discreteUniform( 5, -5, 5, opts ); console.log( param ); // Apply a plane rotation: diff --git a/lib/node_modules/@stdlib/blas/base/dscal-wasm/README.md b/lib/node_modules/@stdlib/blas/base/dscal-wasm/README.md index d0392651de26..b82833ae4153 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dscal-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dscal = require( '@stdlib/blas/base/dscal-wasm' ); +const dscal = require( '@stdlib/blas/base/dscal-wasm' ); ``` #### dscal.main( N, alpha, x, strideX ) @@ -35,9 +35,9 @@ var dscal = require( '@stdlib/blas/base/dscal-wasm' ); Multiplies a vector `x` by a constant `alpha`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dscal.main( x.length, 5.0, x, 1 ); // x => [ 5.0, 10.0, 15.0, 20.0, 25.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to multiply every other value in `x` by `alpha` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); dscal.main( 5, 5.0, x, -1 ); // x => [ 5.0, 10.0, 15.0, 20.0, 25.0 ] @@ -66,13 +66,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Create a typed array view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dscal.main( 3, 5.0, x1, -2 ); // x0 => [ 1.0, 10.0, 3.0, 20.0, 5.0, 30.0 ] @@ -83,9 +83,9 @@ dscal.main( 3, 5.0, x1, -2 ); Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dscal.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 5.0, 10.0, 15.0, 20.0, 25.0 ] @@ -98,9 +98,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to multiply every other value in `x` by a constant `alpha` starting from the second element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); dscal.ndarray( 3, 5.0, x, 2, 1 ); // x => [ 1.0, 10.0, 3.0, 20.0, 5.0, 30.0 ] @@ -117,16 +117,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dscal.Module( mem ); +const mod = new dscal.Module( mem ); // returns // Initialize the routine: @@ -140,33 +140,33 @@ Multiplies a vector `x` by a constant `α`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dscal.Module( mem ); +const mod = new dscal.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -175,7 +175,7 @@ mod.write( xptr, oneTo( N, dtype ) ); mod.main( N, 5.0, xptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( xptr, view ); console.log( view ); @@ -196,33 +196,33 @@ Multiplies a vector `x` by a constant `α` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dscal.Module( mem ); +const mod = new dscal.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -231,7 +231,7 @@ mod.write( xptr, oneTo( N, dtype ) ); mod.ndarray( N, 5.0, xptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( xptr, view ); console.log( view ); @@ -269,13 +269,13 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dscal = require( '@stdlib/blas/base/dscal-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dscal = require( '@stdlib/blas/base/dscal-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); dscal.ndarray( x.length, 5.0, x, 1, 0 ); diff --git a/lib/node_modules/@stdlib/blas/base/dscal/README.md b/lib/node_modules/@stdlib/blas/base/dscal/README.md index 0716abd284be..b44206908658 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/dscal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dscal = require( '@stdlib/blas/base/dscal' ); +const dscal = require( '@stdlib/blas/base/dscal' ); ``` #### dscal( N, alpha, x, stride ) @@ -35,9 +35,9 @@ var dscal = require( '@stdlib/blas/base/dscal' ); Multiplies a double-precision floating-point vector `x` by a constant `alpha`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dscal( x.length, 5.0, x, 1 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to multiply every other value by a constant ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dscal( 4, 5.0, x, 2 ); // x => [ -10.0, 1.0, 15.0, -5.0, 20.0, 0.0, -5.0, -3.0 ] @@ -64,13 +64,13 @@ dscal( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scale every other value... dscal( 3, 5.0, x1, 2 ); @@ -84,9 +84,9 @@ If `N` is less than or equal to `0`, the function returns `x` unchanged. Multiplies a double-precision floating-point vector `x` by a constant `alpha` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dscal.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -99,9 +99,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to multiply the last three elements of `x` by a constant ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dscal.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ] @@ -129,13 +129,13 @@ dscal.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dscal = require( '@stdlib/blas/base/dscal' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dscal = require( '@stdlib/blas/base/dscal' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); dscal( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/dsdot/README.md b/lib/node_modules/@stdlib/blas/base/dsdot/README.md index cc11f49ee0ef..2503567a7912 100644 --- a/lib/node_modules/@stdlib/blas/base/dsdot/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var dsdot = require( '@stdlib/blas/base/dsdot' ); +const dsdot = require( '@stdlib/blas/base/dsdot' ); ``` #### dsdot( N, x, strideX, y, strideY ) @@ -56,12 +56,12 @@ var dsdot = require( '@stdlib/blas/base/dsdot' ); Calculates the dot product of vectors `x` and `y` with extended accumulation and result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = dsdot( x.length, x, 1, y, 1 ); +const z = dsdot( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -76,12 +76,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = dsdot( 3, x, 2, y, -1 ); +const z = dsdot( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -90,17 +90,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = dsdot( 3, x1, -2, y1, 1 ); +const z = dsdot( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -109,12 +109,12 @@ var z = dsdot( 3, x1, -2, y1, 1 ); Calculates the dot product of `x` and `y` with extended accumulation and result and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = dsdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = dsdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -126,12 +126,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = dsdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = dsdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -157,19 +157,19 @@ var z = dsdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dsdot = require( '@stdlib/blas/base/dsdot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dsdot = require( '@stdlib/blas/base/dsdot' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var out = dsdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); +const out = dsdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/dspmv/README.md b/lib/node_modules/@stdlib/blas/base/dspmv/README.md index a219c0bac186..2e4281d767b2 100644 --- a/lib/node_modules/@stdlib/blas/base/dspmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dspmv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dspmv = require( '@stdlib/blas/base/dspmv' ); +const dspmv = require( '@stdlib/blas/base/dspmv' ); ``` #### dspmv( order, uplo, N, α, AP, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var dspmv = require( '@stdlib/blas/base/dspmv' ); Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix supplied in packed form `AP`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); dspmv( 'column-major', 'lower', 3, 1.0, AP, x, 1, 1.0, y, 1 ); // y => [ 7.0, 12.0, 15.0 ] @@ -61,11 +61,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); dspmv( 'column-major', 'lower', 3, 1.0, AP, x, 1, 1.0, y, -1 ); // y => [ 15.0, 12.0, 7.0 ] @@ -76,16 +76,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dspmv( 'row-major', 'upper', 2, 1.0, AP, x1, -1, 1.0, y1, -1 ); // y0 => [ 0.0, 6.0, 4.0 ] @@ -96,11 +96,11 @@ dspmv( 'row-major', 'upper', 2, 1.0, AP, x1, -1, 1.0, y1, -1 ); Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix supplied in packed form `AP`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); dspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, 0, x, 1, 0, 1.0, y, 1, 0 ); // y => [ 7.0, 12.0, 15.0 ] @@ -115,11 +115,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float64Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); dspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, 2, x, 1, 0, 1.0, y, -1, 2 ); // y => [ 15.0, 12.0, 7.0 ] @@ -146,18 +146,18 @@ dspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, 2, x, 1, 0, 1.0, y, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dspmv = require( '@stdlib/blas/base/dspmv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dspmv = require( '@stdlib/blas/base/dspmv' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 3; -var AP = discreteUniform( N * ( N + 1 ) / 2, -10, 10, opts ); +const N = 3; +const AP = discreteUniform( N * ( N + 1 ) / 2, -10, 10, opts ); -var x = discreteUniform( N, -10, 10, opts ); -var y = discreteUniform( N, -10, 10, opts ); +const x = discreteUniform( N, -10, 10, opts ); +const y = discreteUniform( N, -10, 10, opts ); dspmv.ndarray( 'row-major', 'upper', N, 1.0, AP, 0, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/dspr/README.md b/lib/node_modules/@stdlib/blas/base/dspr/README.md index eb930c6c66a8..e3604952256e 100644 --- a/lib/node_modules/@stdlib/blas/base/dspr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dspr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dspr = require( '@stdlib/blas/base/dspr' ); +const dspr = require( '@stdlib/blas/base/dspr' ); ``` #### dspr( order, uplo, N, α, x, sx, AP ) @@ -35,10 +35,10 @@ var dspr = require( '@stdlib/blas/base/dspr' ); Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dspr( 'row-major', 'upper', 3, 1.0, x, 1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -57,10 +57,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); dspr( 'row-major', 'upper', 3, 1.0, x, -1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -71,14 +71,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 3.0, 2.0, 1.0 ] ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x0 = new Float64Array( [ 0.0, 3.0, 2.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dspr( 'row-major', 'upper', 3, 1.0, x1, -1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -89,10 +89,10 @@ dspr( 'row-major', 'upper', 3, 1.0, x1, -1, AP ); Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 1.0, 2.0, 1.0, 2.0, 3.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const AP = new Float64Array( [ 1.0, 1.0, 2.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dspr.ndarray( 'row-major', 'lower', 3, 1.0, x, 1, 0, AP, 1, 0 ); // AP => [ 2.0, 3.0, 6.0, 4.0, 8.0, 12.0 ] @@ -107,10 +107,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); +const AP = new Float64Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); dspr.ndarray( 'row-major', 'upper', 3, 1.0, x, -1, 2, AP, 1, 0 ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -137,17 +137,17 @@ dspr.ndarray( 'row-major', 'upper', 3, 1.0, x, -1, 2, AP, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dspr = require( '@stdlib/blas/base/dspr' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dspr = require( '@stdlib/blas/base/dspr' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 5; +const N = 5; -var AP = discreteUniform( N * ( N + 1 ) / 2, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const AP = discreteUniform( N * ( N + 1 ) / 2, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); dspr( 'column-major', 'upper', N, 1.0, x, 1, AP ); console.log( AP ); diff --git a/lib/node_modules/@stdlib/blas/base/dswap-wasm/README.md b/lib/node_modules/@stdlib/blas/base/dswap-wasm/README.md index f76bb100f779..81c9f989a7d9 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dswap-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dswap = require( '@stdlib/blas/base/dswap-wasm' ); +const dswap = require( '@stdlib/blas/base/dswap-wasm' ); ``` #### dswap.main( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dswap = require( '@stdlib/blas/base/dswap-wasm' ); Interchanges two double-precision floating point vectors. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dswap.main( x.length, x, 1, y, 1 ); // x => [ 1.0, 1.0, 1.0, 1.0, 1.0 ] @@ -56,10 +56,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to swap every other element from `x` with elements `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dswap.main( 3, x, 2, y, -1 ); // y => [ 5.0, 3.0, 1.0, 1.0, 1.0, 1.0 ] @@ -70,15 +70,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dswap.main( 3, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -89,10 +89,10 @@ dswap.main( 3, x1, -2, y1, 1 ); Interchanges two double-precision floating point vectors using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); dswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); // x => [ 1.0, 1.0, 1.0, 1.0, 1.0 ] @@ -107,10 +107,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to swap every other value in `x` starting from the second value with the last `N` elements in `y`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // x => [ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ] @@ -128,16 +128,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dswap.Module( mem ); +const mod = new dswap.Module( mem ); // returns // Initialize the routine: @@ -151,34 +151,34 @@ Interchanges two double-precision floating point vectors. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dswap.Module( mem ); +const mod = new dswap.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -188,8 +188,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, xptr, 1, yptr, 1 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -215,34 +215,34 @@ Interchanges two double-precision floating point vectors using alternative index ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new dswap.Module( mem ); +const mod = new dswap.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -252,8 +252,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -296,16 +296,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dswap = require( '@stdlib/blas/base/dswap-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dswap = require( '@stdlib/blas/base/dswap-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); dswap.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/dswap/README.md b/lib/node_modules/@stdlib/blas/base/dswap/README.md index 546fb164219f..927d9f7f81a5 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap/README.md +++ b/lib/node_modules/@stdlib/blas/base/dswap/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dswap = require( '@stdlib/blas/base/dswap' ); +const dswap = require( '@stdlib/blas/base/dswap' ); ``` #### dswap( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dswap = require( '@stdlib/blas/base/dswap' ); Interchanges vectors `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); dswap( x.length, x, 1, y, 1 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -56,10 +56,10 @@ The function has the following parameters: The `N` and stride parameters determine how values in the strided arrays are accessed at runtime. For example, to swap in reverse order every other value in `x` with the first `N` elements of `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dswap( 3, x, -2, y, 1 ); // x => [ 9.0, 2.0, 8.0, 4.0, 7.0, 6.0 ] @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Swap in reverse order every other value from `x1` with `y1`... dswap( 3, x1, -2, y1, 1 ); @@ -92,10 +92,10 @@ dswap( 3, x1, -2, y1, 1 ); Interchanges vectors `x` and `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); dswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to swap every other value in `x` starting from the second value with the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); dswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // x => [ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ] @@ -142,16 +142,16 @@ dswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dswap = require( '@stdlib/blas/base/dswap' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dswap = require( '@stdlib/blas/base/dswap' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Swap elements in `x` and `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/README.md b/lib/node_modules/@stdlib/blas/base/dsymv/README.md index 01a45f2576ad..0917482f4171 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsymv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsymv = require( '@stdlib/blas/base/dsymv' ); +const dsymv = require( '@stdlib/blas/base/dsymv' ); ``` #### dsymv( order, uplo, N, α, A, LDA, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var dsymv = require( '@stdlib/blas/base/dsymv' ); Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +const A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); dsymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0.0, y, 1 ); // y => [ 1.0, 2.0, 3.0 ] @@ -62,11 +62,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsymv( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 1.0, y, 1 ); // y => [ 7.0, 10.0, 9.0 ] @@ -77,16 +77,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var y0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const y0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dsymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); // y0 => [ 1.0, 4.0, 3.0, 2.0 ] @@ -97,11 +97,11 @@ dsymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 2, 1.0, y, 1, 0 ); // y => [ 7.0, 10.0, 9.0 ] @@ -115,11 +115,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); dsymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); // y => [ 4.0, 3.0, 2.0 ] @@ -146,19 +146,19 @@ dsymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var dsymv = require( '@stdlib/blas/base/dsymv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const dsymv = require( '@stdlib/blas/base/dsymv' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 3; -var A = ones( N*N, opts.dtype ); +const N = 3; +const A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, 0, 255, opts ); -var y = discreteUniform( N, 0, 255, opts ); +const x = discreteUniform( N, 0, 255, opts ); +const y = discreteUniform( N, 0, 255, opts ); dsymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index 62b1b6179a5d..5a6047d62239 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsyr = require( '@stdlib/blas/base/dsyr' ); +const dsyr = require( '@stdlib/blas/base/dsyr' ); ``` #### dsyr( order, uplo, N, α, x, sx, A, LDA ) @@ -35,10 +35,10 @@ var dsyr = require( '@stdlib/blas/base/dsyr' ); Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] @@ -58,10 +58,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsyr( 'row-major', 'upper', 3, 1.0, x, -2, A, 3 ); // A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] @@ -72,14 +72,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dsyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); // A => [ 2.0, 3.0, 4.0, 0.0, 2.0, 3.0, 0.0, 0.0, 2.0 ] @@ -90,10 +90,10 @@ dsyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] @@ -109,10 +109,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsyr.ndarray( 'upper', 3, 1.0, x, -2, 4, A, 3, 1, 0 ); // A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] @@ -139,18 +139,18 @@ dsyr.ndarray( 'upper', 3, 1.0, x, -2, 4, A, 3, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var dsyr = require( '@stdlib/blas/base/dsyr' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const dsyr = require( '@stdlib/blas/base/dsyr' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 3; +const N = 3; -var A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = ones( N*N, opts.dtype ); +const x = discreteUniform( N, -10.0, 10.0, opts ); dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); console.log( A ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/README.md b/lib/node_modules/@stdlib/blas/base/dsyr2/README.md index a94a443ea293..822fe10c1149 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsyr2 = require( '@stdlib/blas/base/dsyr2' ); +const dsyr2 = require( '@stdlib/blas/base/dsyr2' ); ``` #### dsyr2( order, uplo, N, α, x, sx, y, sy, A, LDA ) @@ -35,11 +35,11 @@ var dsyr2 = require( '@stdlib/blas/base/dsyr2' ); Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 ); // A => [ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ] @@ -61,11 +61,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr2( 'row-major', 'upper', 3, 1.0, x, 2, y, 1, A, 3 ); // A => [ 3.0, 7.0, 11.0, 0.0, 13.0, 21.0, 0.0, 0.0, 31.0 ] @@ -76,16 +76,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 1.0, 1.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 1.0, 1.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dsyr2( 'row-major', 'upper', 3, 1.0, x1, 1, y1, 1, A, 3 ); // A => [ 3.0, 5.0, 7.0, 0.0, 5.0, 7.0, 0.0, 0.0, 7.0 ] @@ -96,11 +96,11 @@ dsyr2( 'row-major', 'upper', 3, 1.0, x1, 1, y1, 1, A, 3 ); Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr2.ndarray( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // A => [ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ] @@ -117,11 +117,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr2.ndarray( 'upper', 3, 1.0, x, -2, 4, y, 1, 0, A, 3, 1, 0 ); // A => [ 11.0, 15.0, 19.0, 0.0, 13.0, 13.0, 0.0, 0.0, 7.0 ] @@ -148,19 +148,19 @@ dsyr2.ndarray( 'upper', 3, 1.0, x, -2, 4, y, 1, 0, A, 3, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var dsyr2 = require( '@stdlib/blas/base/dsyr2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const dsyr2 = require( '@stdlib/blas/base/dsyr2' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 3; +const N = 3; -var A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, -10.0, 10.0, opts ); -var y = discreteUniform( N, -10.0, 10.0, opts ); +const A = ones( N*N, opts.dtype ); +const x = discreteUniform( N, -10.0, 10.0, opts ); +const y = discreteUniform( N, -10.0, 10.0, opts ); dsyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 ); console.log( A ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md index 67c35dd7c8c1..188d68a7113c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dtrmv = require( '@stdlib/blas/base/dtrmv' ); +const dtrmv = require( '@stdlib/blas/base/dtrmv' ); ``` #### dtrmv( order, uplo, trans, diag, N, A, LDA, x, sx ) @@ -35,10 +35,10 @@ var dtrmv = require( '@stdlib/blas/base/dtrmv' ); Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); // x => [ 14.0, 8.0, 3.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 1.0, 4.0, 10.0 ] @@ -73,14 +73,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] @@ -91,10 +91,10 @@ dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 14.0, 8.0, 3.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] @@ -140,17 +140,17 @@ dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dtrmv = require( '@stdlib/blas/base/dtrmv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dtrmv = require( '@stdlib/blas/base/dtrmv' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 5; +const N = 5; -var A = discreteUniform( N*N, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = discreteUniform( N*N, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); dtrmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsv/README.md b/lib/node_modules/@stdlib/blas/base/dtrsv/README.md index 0a8cd0d23c11..81f8a6d3817d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dtrsv = require( '@stdlib/blas/base/dtrsv' ); +const dtrsv = require( '@stdlib/blas/base/dtrsv' ); ``` #### dtrsv( order, uplo, trans, diag, N, A, LDA, x, sx ) @@ -35,10 +35,10 @@ var dtrsv = require( '@stdlib/blas/base/dtrsv' ); Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); // x => [ 0.0, -4.0, 3.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); dtrsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 3.0, -4.0, 0.0 ] @@ -73,14 +73,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dtrsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 0.0, -1.0, 1.0 ] @@ -91,10 +91,10 @@ dtrsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); Solves one of the systems of equations `A*x = b` or `A^T*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dtrsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 0.0, -4.0, 3.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); dtrsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 3.0, -4.0, 0.0 ] @@ -141,17 +141,17 @@ dtrsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dtrsv = require( '@stdlib/blas/base/dtrsv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dtrsv = require( '@stdlib/blas/base/dtrsv' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var N = 5; +const N = 5; -var A = discreteUniform( N*N, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = discreteUniform( N*N, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); dtrsv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/README.md b/lib/node_modules/@stdlib/blas/base/dznrm2/README.md index f98c2f9cb8f4..c315fdaf0154 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); +const dznrm2 = require( '@stdlib/blas/base/dznrm2' ); ``` #### dznrm2( N, zx, strideX ) @@ -35,11 +35,11 @@ var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); Computes the L2-norm of a complex double-precision floating-point vector. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = dznrm2( 4, zx, 1 ); +const norm = dznrm2( 4, zx, 1 ); // returns ~0.8 ``` @@ -52,27 +52,27 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to traverse every other value, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const zx = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var norm = dznrm2( 2, zx, 2 ); +const norm = dznrm2( 2, zx, 2 ); // returns ~4.6 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); // Initial array: -var zx0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const zx0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the L2-norm: -var norm = dznrm2( 2, zx1, 1 ); +const norm = dznrm2( 2, zx1, 1 ); // returns ~9.3 ``` @@ -81,11 +81,11 @@ var norm = dznrm2( 2, zx1, 1 ); Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = dznrm2.ndarray( 4, zx, 1, 0 ); +const norm = dznrm2.ndarray( 4, zx, 1, 0 ); // returns ~0.8 ``` @@ -96,11 +96,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const zx = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var norm = dznrm2.ndarray( 2, zx, 1, 1 ); +const norm = dznrm2.ndarray( 2, zx, 1, 1 ); // returns ~9.3 ``` @@ -126,20 +126,20 @@ var norm = dznrm2.ndarray( 2, zx, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const dznrm2 = require( '@stdlib/blas/base/dznrm2' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var zx = filledarrayBy( 10, 'complex128', rand ); +const zx = filledarrayBy( 10, 'complex128', rand ); console.log( zx.toString() ); // Computes the L2-norm: -var norm = dznrm2( zx.length, zx, 1 ); +const norm = dznrm2( zx.length, zx, 1 ); console.log( norm ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/gasum/README.md b/lib/node_modules/@stdlib/blas/base/gasum/README.md index d4df1f5dd4de..4b007a3fdfdc 100644 --- a/lib/node_modules/@stdlib/blas/base/gasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/gasum/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var gasum = require( '@stdlib/blas/base/gasum' ); +const gasum = require( '@stdlib/blas/base/gasum' ); ``` #### gasum( N, x, stride ) @@ -56,9 +56,9 @@ var gasum = require( '@stdlib/blas/base/gasum' ); Computes the sum of [absolute values][@stdlib/math/base/special/abs]. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var sum = gasum( x.length, x, 1 ); +const sum = gasum( x.length, x, 1 ); // returns 19.0 ``` @@ -71,25 +71,25 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var sum = gasum( 4, x, 2 ); +const sum = gasum( 4, x, 2 ); // returns 10.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sum every other value... -var sum = gasum( 3, x1, 2 ); +const sum = gasum( 3, x1, 2 ); // returns 12.0 ``` @@ -100,9 +100,9 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `0` Computes the sum of [absolute values][@stdlib/math/base/special/abs] using alternative indexing semantics. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var sum = gasum.ndarray( x.length, x, 1, 0 ); +const sum = gasum.ndarray( x.length, x, 1, 0 ); // returns 19.0 ``` @@ -113,11 +113,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var sum = gasum.ndarray( 3, x, 1, x.length-3 ); +let sum = gasum.ndarray( 3, x, 1, x.length-3 ); // returns 15.0 // Using a negative stride to sum from the last element: @@ -147,16 +147,16 @@ sum = gasum.ndarray( 3, x, -1, x.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gasum = require( '@stdlib/blas/base/gasum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gasum = require( '@stdlib/blas/base/gasum' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var y = gasum( x.length, x, 1 ); +const y = gasum( x.length, x, 1 ); console.log( y ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/gaxpy/README.md b/lib/node_modules/@stdlib/blas/base/gaxpy/README.md index a737ec1d5246..153cc663be64 100644 --- a/lib/node_modules/@stdlib/blas/base/gaxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/gaxpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gaxpy = require( '@stdlib/blas/base/gaxpy' ); +const gaxpy = require( '@stdlib/blas/base/gaxpy' ); ``` #### gaxpy( N, alpha, x, strideX, y, strideY ) @@ -35,9 +35,9 @@ var gaxpy = require( '@stdlib/blas/base/gaxpy' ); Multiplies `x` by a constant `alpha` and adds the result to `y`. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; -var alpha = 5.0; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; +const alpha = 5.0; gaxpy( x.length, alpha, x, 1, y, 1 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -55,8 +55,8 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order, ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]; gaxpy( 3, 5.0, x, 2, y, -1 ); // y => [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ] @@ -67,15 +67,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element gaxpy( 3, 5.0, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -86,9 +86,9 @@ gaxpy( 3, 5.0, x1, -2, y1, 1 ); Multiplies `x` by a constant `alpha` and adds the result to `y` using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; -var alpha = 5.0; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; +const alpha = 5.0; gaxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -102,8 +102,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,..., ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; gaxpy.ndarray( 3, 5.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -131,16 +131,16 @@ gaxpy.ndarray( 3, 5.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gaxpy = require( '@stdlib/blas/base/gaxpy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gaxpy = require( '@stdlib/blas/base/gaxpy' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); gaxpy.ndarray( x.length, 5.0, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/gcopy/README.md b/lib/node_modules/@stdlib/blas/base/gcopy/README.md index dcf702f140e3..4f9526aa7b89 100644 --- a/lib/node_modules/@stdlib/blas/base/gcopy/README.md +++ b/lib/node_modules/@stdlib/blas/base/gcopy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gcopy = require( '@stdlib/blas/base/gcopy' ); +const gcopy = require( '@stdlib/blas/base/gcopy' ); ``` #### gcopy( N, x, strideX, y, strideY ) @@ -35,8 +35,8 @@ var gcopy = require( '@stdlib/blas/base/gcopy' ); Copies values from `x` into `y`. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; gcopy( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -53,8 +53,8 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; gcopy( 3, x, -2, y, 1 ); // y => [ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ] @@ -65,15 +65,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Copy in reverse order every other value from `x1` into `y1`... gcopy( 3, x1, -2, y1, 1 ); @@ -85,8 +85,8 @@ gcopy( 3, x1, -2, y1, 1 ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -100,8 +100,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; gcopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -130,16 +130,16 @@ gcopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gcopy = require( '@stdlib/blas/base/gcopy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gcopy = require( '@stdlib/blas/base/gcopy' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Copy elements from `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/gdot/README.md b/lib/node_modules/@stdlib/blas/base/gdot/README.md index 1c92a3246636..e8412ffa11a7 100644 --- a/lib/node_modules/@stdlib/blas/base/gdot/README.md +++ b/lib/node_modules/@stdlib/blas/base/gdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var gdot = require( '@stdlib/blas/base/gdot' ); +const gdot = require( '@stdlib/blas/base/gdot' ); ``` #### gdot( N, x, strideX, y, strideY ) @@ -56,10 +56,10 @@ var gdot = require( '@stdlib/blas/base/gdot' ); Calculates the dot product of vectors `x` and `y`. ```javascript -var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ]; -var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ]; +const x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ]; +const y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ]; -var z = gdot( x.length, x, 1, y, 1 ); +const z = gdot( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -74,10 +74,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]; -var z = gdot( 3, x, 2, y, -1 ); +const z = gdot( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -86,17 +86,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = gdot( 3, x1, -2, y1, 1 ); +const z = gdot( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -105,10 +105,10 @@ var z = gdot( 3, x1, -2, y1, 1 ); Calculates the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ]; -var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ]; +const x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ]; +const y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ]; -var z = gdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = gdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -120,10 +120,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; -var z = gdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = gdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -149,19 +149,19 @@ var z = gdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gdot = require( '@stdlib/blas/base/gdot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gdot = require( '@stdlib/blas/base/gdot' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); -var out = gdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); +const out = gdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/gnrm2/README.md b/lib/node_modules/@stdlib/blas/base/gnrm2/README.md index 7475dea9c0f5..fe29e98e996c 100644 --- a/lib/node_modules/@stdlib/blas/base/gnrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/gnrm2/README.md @@ -44,7 +44,7 @@ The [L2-norm][l2-norm] is defined as ## Usage ```javascript -var gnrm2 = require( '@stdlib/blas/base/gnrm2' ); +const gnrm2 = require( '@stdlib/blas/base/gnrm2' ); ``` #### gnrm2( N, x, stride ) @@ -52,9 +52,9 @@ var gnrm2 = require( '@stdlib/blas/base/gnrm2' ); Computes the [L2-norm][l2-norm] of a vector `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var z = gnrm2( x.length, x, 1 ); +const z = gnrm2( x.length, x, 1 ); // returns 3.0 ``` @@ -67,9 +67,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [L2-norm][l2-norm] of every other element in `x`, ```javascript -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var z = gnrm2( 4, x, 2 ); +const z = gnrm2( 4, x, 2 ); // returns 5.0 ``` @@ -78,12 +78,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z = gnrm2( 4, x1, 2 ); +const z = gnrm2( 4, x1, 2 ); // returns 5.0 ``` @@ -94,9 +94,9 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `0` Computes the [L2-norm][l2-norm] of a vector using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var z = gnrm2.ndarray( x.length, x, 1, 0 ); +const z = gnrm2.ndarray( x.length, x, 1, 0 ); // returns 3.0 ``` @@ -107,9 +107,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [L2-norm][l2-norm] for every other value in `x` starting from the second value ```javascript -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var z = gnrm2.ndarray( 4, x, 2, 1 ); +const z = gnrm2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -135,16 +135,16 @@ var z = gnrm2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gnrm2 = require( '@stdlib/blas/base/gnrm2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gnrm2 = require( '@stdlib/blas/base/gnrm2' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var out = gnrm2( x.length, x, 1 ); +const out = gnrm2( x.length, x, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/gscal/README.md b/lib/node_modules/@stdlib/blas/base/gscal/README.md index 800a03d51947..3db81030febd 100644 --- a/lib/node_modules/@stdlib/blas/base/gscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/gscal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gscal = require( '@stdlib/blas/base/gscal' ); +const gscal = require( '@stdlib/blas/base/gscal' ); ``` #### gscal( N, alpha, x, stride ) @@ -35,7 +35,7 @@ var gscal = require( '@stdlib/blas/base/gscal' ); Multiplies a vector `x` by a constant `alpha`. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gscal( x.length, 5.0, x, 1 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -51,7 +51,7 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to multiply every other value by a constant ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gscal( 4, 5.0, x, 2 ); // x => [ -10.0, 1.0, 15.0, -5.0, 20.0, 0.0, -5.0, -3.0 ] @@ -60,13 +60,13 @@ gscal( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scale every other value: gscal( 3, 5.0, x1, 2 ); @@ -80,7 +80,7 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `x` Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gscal.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -93,7 +93,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to multiply the last three elements of `x` by a constant ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gscal.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ] @@ -121,13 +121,13 @@ gscal.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gscal = require( '@stdlib/blas/base/gscal' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gscal = require( '@stdlib/blas/base/gscal' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); gscal( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/gswap/README.md b/lib/node_modules/@stdlib/blas/base/gswap/README.md index 17c0cce119df..1ffd0944a262 100644 --- a/lib/node_modules/@stdlib/blas/base/gswap/README.md +++ b/lib/node_modules/@stdlib/blas/base/gswap/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gswap = require( '@stdlib/blas/base/gswap' ); +const gswap = require( '@stdlib/blas/base/gswap' ); ``` #### gswap( N, x, strideX, y, strideY ) @@ -35,8 +35,8 @@ var gswap = require( '@stdlib/blas/base/gswap' ); Interchanges vectors `x` and `y`. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; gswap( x.length, x, 1, y, 1 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -54,8 +54,8 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to swap in reverse order every other value in `x` with the first `N` elements of `y`, ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; gswap( 3, x, -2, y, 1 ); // x => [ 9.0, 2.0, 8.0, 4.0, 7.0, 6.0 ] @@ -67,15 +67,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Swap in reverse order every other value from `x1` with `y1`... gswap( 3, x1, -2, y1, 1 ); @@ -88,8 +88,8 @@ gswap( 3, x1, -2, y1, 1 ); Interchanges vectors `x` and `y` using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; gswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -104,10 +104,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to swap every other value in `x` starting from the second value with the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); gswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // x => [ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ] @@ -137,16 +137,16 @@ gswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gswap = require( '@stdlib/blas/base/gswap' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gswap = require( '@stdlib/blas/base/gswap' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Swap elements in `x` and `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/idamax-wasm/README.md b/lib/node_modules/@stdlib/blas/base/idamax-wasm/README.md index 99cee8b01f5c..1c620f88e62e 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/idamax-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var idamax = require( '@stdlib/blas/base/idamax-wasm' ); +const idamax = require( '@stdlib/blas/base/idamax-wasm' ); ``` #### idamax.main( N, x, strideX ) @@ -35,11 +35,11 @@ var idamax = require( '@stdlib/blas/base/idamax-wasm' ); Finds the index of the first element having the maximum absolute value. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var idx = idamax.main( 3, x, 1 ); +const idx = idamax.main( 3, x, 1 ); // returns 1 ``` @@ -52,11 +52,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to traverse every other value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = idamax.main( 4, x, 2 ); +const idx = idamax.main( 4, x, 2 ); // returns 2 ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Find index of element having the maximum absolute value: -var idx = idamax.main( 3, x1, 2 ); +const idx = idamax.main( 3, x1, 2 ); // returns 2 ``` @@ -83,11 +83,11 @@ var idx = idamax.main( 3, x1, 2 ); Finds the index of the first element having the maximum absolute value using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var idx = idamax.ndarray( 3, x, 1, 0 ); +const idx = idamax.ndarray( 3, x, 1, 0 ); // returns 1 ``` @@ -98,11 +98,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var idx = idamax.ndarray( 5, x, 1, 1 ); +const idx = idamax.ndarray( 5, x, 1, 1 ); // returns 4 ``` @@ -117,16 +117,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new idamax.Module( mem ); +const mod = new idamax.Module( mem ); // returns // Initialize the routine: @@ -140,36 +140,36 @@ Finds the index of the first element having the maximum absolute value. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new idamax.Module( mem ); +const mod = new idamax.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) to the first vector element: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var idx = mod.main( N, xptr, 1 ); +const idx = mod.main( N, xptr, 1 ); // returns 4 ``` @@ -186,36 +186,36 @@ Finds the index of the first element having the maximum absolute value using alt ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new idamax.Module( mem ); +const mod = new idamax.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float64'; +const dtype = 'float64'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) to the first vector element: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var idx = mod.ndarray( N, xptr, 1, 0 ); +const idx = mod.ndarray( N, xptr, 1, 0 ); // returns 4 ``` @@ -250,16 +250,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var idamax = require( '@stdlib/blas/base/idamax-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const idamax = require( '@stdlib/blas/base/idamax-wasm' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var idx = idamax.ndarray( x.length, x, 1, 0 ); +const idx = idamax.ndarray( x.length, x, 1, 0 ); console.log( idx ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/idamax/README.md b/lib/node_modules/@stdlib/blas/base/idamax/README.md index 0600c90b7bd7..21f1221ff547 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/idamax/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var idamax = require( '@stdlib/blas/base/idamax' ); +const idamax = require( '@stdlib/blas/base/idamax' ); ``` #### idamax( N, x, strideX ) @@ -35,11 +35,11 @@ var idamax = require( '@stdlib/blas/base/idamax' ); Finds the index of the first element having the maximum absolute value. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = idamax( x.length, x, 1 ); +const idx = idamax( x.length, x, 1 ); // returns 3 ``` @@ -52,27 +52,27 @@ The function has the following parameters: The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to traverse every other value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = idamax( 4, x, 2 ); +const idx = idamax( 4, x, 2 ); // returns 2 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Find index of element having the maximum absolute value: -var idx = idamax( 3, x1, 2 ); +const idx = idamax( 3, x1, 2 ); // returns 2 ``` @@ -81,11 +81,11 @@ var idx = idamax( 3, x1, 2 ); Finds the index of the first element having the maximum absolute value using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = idamax.ndarray( x.length, x, 1, 0 ); +const idx = idamax.ndarray( x.length, x, 1, 0 ); // returns 3 ``` @@ -96,11 +96,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var idx = idamax.ndarray( 5, x, 1, 1 ); +const idx = idamax.ndarray( 5, x, 1, 1 ); // returns 4 ``` @@ -126,16 +126,16 @@ var idx = idamax.ndarray( 5, x, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var idamax = require( '@stdlib/blas/base/idamax' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const idamax = require( '@stdlib/blas/base/idamax' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var idx = idamax( x.length, x, 1 ); +const idx = idamax( x.length, x, 1 ); console.log( idx ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/isamax/README.md b/lib/node_modules/@stdlib/blas/base/isamax/README.md index c1e6e887fa11..0d5235caf2a5 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/isamax/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isamax = require( '@stdlib/blas/base/isamax' ); +const isamax = require( '@stdlib/blas/base/isamax' ); ``` #### isamax( N, x, strideX ) @@ -35,11 +35,11 @@ var isamax = require( '@stdlib/blas/base/isamax' ); Finds the index of the first element having the maximum absolute value. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = isamax( x.length, x, 1 ); +const idx = isamax( x.length, x, 1 ); // returns 3 ``` @@ -52,27 +52,27 @@ The function has the following parameters: The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to traverse every other value, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = isamax( 4, x, 2 ); +const idx = isamax( 4, x, 2 ); // returns 2 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Find index of element having the maximum absolute value: -var idx = isamax( 3, x1, 2 ); +const idx = isamax( 3, x1, 2 ); // returns 2 ``` @@ -81,11 +81,11 @@ var idx = isamax( 3, x1, 2 ); Finds the index of the first element having the maximum absolute value using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var idx = isamax.ndarray( x.length, x, 1, 0 ); +const idx = isamax.ndarray( x.length, x, 1, 0 ); // returns 3 ``` @@ -96,11 +96,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var idx = isamax.ndarray( 5, x, 1, 1 ); +const idx = isamax.ndarray( 5, x, 1, 1 ); // returns 4 ``` @@ -126,16 +126,16 @@ var idx = isamax.ndarray( 5, x, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var isamax = require( '@stdlib/blas/base/isamax' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const isamax = require( '@stdlib/blas/base/isamax' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var idx = isamax( x.length, x, 1 ); +const idx = isamax( x.length, x, 1 ); console.log( idx ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/layout-enum2str/README.md b/lib/node_modules/@stdlib/blas/base/layout-enum2str/README.md index 2f97094f37db..eacaf4bab424 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-enum2str/README.md +++ b/lib/node_modules/@stdlib/blas/base/layout-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/blas/base/layout-enum2str' ); +const enum2str = require( '@stdlib/blas/base/layout-enum2str' ); ``` #### enum2str( layout ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/blas/base/layout-enum2str' ); Returns the BLAS memory layout string associated with a BLAS memory layout enumeration constant. ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var v = str2enum( 'row-major' ); +const v = str2enum( 'row-major' ); // returns -var s = enum2str( v ); +const s = enum2str( v ); // returns 'row-major' ``` If unable to resolve a layout string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var enum2str = require( '@stdlib/blas/base/layout-enum2str' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const enum2str = require( '@stdlib/blas/base/layout-enum2str' ); -var str = enum2str( str2enum( 'row-major' ) ); +let str = enum2str( str2enum( 'row-major' ) ); // returns 'row-major' str = enum2str( str2enum( 'column-major' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/README.md b/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/README.md index 0ae11fbf9fae..05404d1e132b 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); ``` #### resolve( layout ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); Returns the enumeration constant associated with a BLAS memory layout value. ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var v = resolve( 'row-major' ); +let v = resolve( 'row-major' ); // returns v = resolve( str2enum( 'row-major' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'row-major' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); -var v = resolve( 'row-major' ); +let v = resolve( 'row-major' ); // returns v = resolve( 'column-major' ); diff --git a/lib/node_modules/@stdlib/blas/base/layout-resolve-str/README.md b/lib/node_modules/@stdlib/blas/base/layout-resolve-str/README.md index 9a69b3458e41..0ed6b5e99c85 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-resolve-str/README.md +++ b/lib/node_modules/@stdlib/blas/base/layout-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/layout-resolve-str' ); +const resolve = require( '@stdlib/blas/base/layout-resolve-str' ); ``` #### resolve( layout ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/layout-resolve-str' ); Returns the layout string associated with a BLAS memory layout value. ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var v = resolve( 'row-major' ); +let v = resolve( 'row-major' ); // returns 'row-major' v = resolve( str2enum( 'row-major' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'row-major' ) ); If unable to resolve a layout string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var resolve = require( '@stdlib/blas/base/layout-resolve-str' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const resolve = require( '@stdlib/blas/base/layout-resolve-str' ); -var v = resolve( str2enum( 'row-major' ) ); +let v = resolve( str2enum( 'row-major' ) ); // returns 'row-major' v = resolve( str2enum( 'column-major' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/layout-str2enum/README.md b/lib/node_modules/@stdlib/blas/base/layout-str2enum/README.md index f0643a1e91d2..f436562158a3 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-str2enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/layout-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); ``` #### str2enum( layout ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); Returns the enumeration constant associated with a BLAS memory layout string. ```javascript -var v = str2enum( 'row-major' ); +const v = str2enum( 'row-major' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +const str2enum = require( '@stdlib/blas/base/layout-str2enum' ); -var v = str2enum( 'row-major' ); +let v = str2enum( 'row-major' ); // returns v = str2enum( 'column-major' ); diff --git a/lib/node_modules/@stdlib/blas/base/layouts/README.md b/lib/node_modules/@stdlib/blas/base/layouts/README.md index 81275e2eb9f6..7ced971c5c19 100644 --- a/lib/node_modules/@stdlib/blas/base/layouts/README.md +++ b/lib/node_modules/@stdlib/blas/base/layouts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var layouts = require( '@stdlib/blas/base/layouts' ); +const layouts = require( '@stdlib/blas/base/layouts' ); ``` #### layouts() @@ -45,7 +45,7 @@ var layouts = require( '@stdlib/blas/base/layouts' ); Returns a list of BLAS memory layouts. ```javascript -var out = layouts(); +const out = layouts(); // e.g., returns [ 'row-major', 'column-major' ] ``` @@ -75,12 +75,12 @@ The output array contains the following layouts: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var layouts = require( '@stdlib/blas/base/layouts' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const layouts = require( '@stdlib/blas/base/layouts' ); -var isLayout = contains( layouts() ); +const isLayout = contains( layouts() ); -var bool = isLayout( 'row-major' ); +let bool = isLayout( 'row-major' ); // returns true bool = isLayout( 'column-major' ); diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangle-enum2str/README.md b/lib/node_modules/@stdlib/blas/base/matrix-triangle-enum2str/README.md index cc5250f6d045..df07a8a203d6 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangle-enum2str/README.md +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangle-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/blas/base/matrix-triangle-enum2str' ); +const enum2str = require( '@stdlib/blas/base/matrix-triangle-enum2str' ); ``` #### enum2str( value ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/blas/base/matrix-triangle-enum2str' ); Returns the BLAS matrix triangle string associated with a BLAS matrix triangle enumeration constant. ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var v = str2enum( 'upper' ); +const v = str2enum( 'upper' ); // returns -var s = enum2str( v ); +const s = enum2str( v ); // returns 'upper' ``` If unable to resolve a matrix triangle string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var enum2str = require( '@stdlib/blas/base/matrix-triangle-enum2str' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const enum2str = require( '@stdlib/blas/base/matrix-triangle-enum2str' ); -var str = enum2str( str2enum( 'upper' ) ); +let str = enum2str( str2enum( 'upper' ) ); // returns 'upper' str = enum2str( str2enum( 'lower' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-enum/README.md b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-enum/README.md index 5bb8d3d6ab89..5b5d1f04dce1 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); ``` #### resolve( value ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); Returns the enumeration constant associated with a BLAS matrix triangle value. ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var v = resolve( 'lower' ); +let v = resolve( 'lower' ); // returns v = resolve( str2enum( 'lower' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'lower' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); -var v = resolve( 'lower' ); +let v = resolve( 'lower' ); // returns v = resolve( 'upper' ); diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/README.md b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/README.md index 01be4c9ebdeb..3801ff522350 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/README.md +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); +const resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); ``` #### resolve( value ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); Returns the matrix triangle string associated with a BLAS matrix triangle value. ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var v = resolve( 'upper' ); +let v = resolve( 'upper' ); // returns 'upper' v = resolve( str2enum( 'upper' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'upper' ) ); If unable to resolve a matrix triangle string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const resolve = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); -var v = resolve( str2enum( 'upper' ) ); +let v = resolve( str2enum( 'upper' ) ); // returns 'upper' v = resolve( str2enum( 'lower' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangle-str2enum/README.md b/lib/node_modules/@stdlib/blas/base/matrix-triangle-str2enum/README.md index 7bc14509198e..6f27fbfcd7c7 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangle-str2enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangle-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); ``` #### str2enum( operation ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); Returns the enumeration constant associated with a BLAS matrix triangle. ```javascript -var v = str2enum( 'upper' ); +const v = str2enum( 'upper' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +const str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var v = str2enum( 'upper' ); +let v = str2enum( 'upper' ); // returns v = str2enum( 'lower' ); diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangles/README.md b/lib/node_modules/@stdlib/blas/base/matrix-triangles/README.md index 398797e4dd88..f858fae5783b 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangles/README.md +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangles/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); +const matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); ``` #### matrixTriangles() @@ -45,7 +45,7 @@ var matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); Returns a list of BLAS matrix triangles. ```javascript -var out = matrixTriangles(); +const out = matrixTriangles(); // e.g., returns [ 'upper', 'lower' ] ``` @@ -75,12 +75,12 @@ The output array contains the following types: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); -var isMatrixTriangle = contains( matrixTriangles() ); +const isMatrixTriangle = contains( matrixTriangles() ); -var bool = isMatrixTriangle( 'lower' ); +let bool = isMatrixTriangle( 'lower' ); // returns true bool = isMatrixTriangle( 'upper' ); diff --git a/lib/node_modules/@stdlib/blas/base/operation-side-enum2str/README.md b/lib/node_modules/@stdlib/blas/base/operation-side-enum2str/README.md index 6f407dc14727..94fecd1b74ec 100644 --- a/lib/node_modules/@stdlib/blas/base/operation-side-enum2str/README.md +++ b/lib/node_modules/@stdlib/blas/base/operation-side-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/blas/base/operation-side-enum2str' ); +const enum2str = require( '@stdlib/blas/base/operation-side-enum2str' ); ``` #### enum2str( operation ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/blas/base/operation-side-enum2str' ); Returns the BLAS operation side string associated with a BLAS operation side enumeration constant. ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var v = str2enum( 'left' ); +const v = str2enum( 'left' ); // returns -var s = enum2str( v ); +const s = enum2str( v ); // returns 'left' ``` If unable to resolve an operation string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var enum2str = require( '@stdlib/blas/base/operation-side-enum2str' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const enum2str = require( '@stdlib/blas/base/operation-side-enum2str' ); -var str = enum2str( str2enum( 'left' ) ); +let str = enum2str( str2enum( 'left' ) ); // returns 'left' str = enum2str( str2enum( 'right' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/operation-side-resolve-enum/README.md b/lib/node_modules/@stdlib/blas/base/operation-side-resolve-enum/README.md index 0b01668fb230..97ddccbc2d9e 100644 --- a/lib/node_modules/@stdlib/blas/base/operation-side-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/operation-side-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/operation-side-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/operation-side-resolve-enum' ); ``` #### resolve( operation ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/operation-side-resolve-enum' ); Returns the enumeration constant associated with a BLAS operation side value. ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var v = resolve( 'right' ); +let v = resolve( 'right' ); // returns v = resolve( str2enum( 'right' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'right' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/blas/base/operation-side-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/operation-side-resolve-enum' ); -var v = resolve( 'right' ); +let v = resolve( 'right' ); // returns v = resolve( 'left' ); diff --git a/lib/node_modules/@stdlib/blas/base/operation-side-resolve-str/README.md b/lib/node_modules/@stdlib/blas/base/operation-side-resolve-str/README.md index 848d6d5e7e1f..cb313610dfeb 100644 --- a/lib/node_modules/@stdlib/blas/base/operation-side-resolve-str/README.md +++ b/lib/node_modules/@stdlib/blas/base/operation-side-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/operation-side-resolve-str' ); +const resolve = require( '@stdlib/blas/base/operation-side-resolve-str' ); ``` #### resolve( operation ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/operation-side-resolve-str' ); Returns the operation side string associated with a BLAS operation side value. ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var v = resolve( 'left' ); +let v = resolve( 'left' ); // returns 'left' v = resolve( str2enum( 'left' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'left' ) ); If unable to resolve a operation side string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var resolve = require( '@stdlib/blas/base/operation-side-resolve-str' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const resolve = require( '@stdlib/blas/base/operation-side-resolve-str' ); -var v = resolve( str2enum( 'left' ) ); +let v = resolve( str2enum( 'left' ) ); // returns 'left' v = resolve( str2enum( 'right' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/operation-side-str2enum/README.md b/lib/node_modules/@stdlib/blas/base/operation-side-str2enum/README.md index 24883066827f..02c31d02031f 100644 --- a/lib/node_modules/@stdlib/blas/base/operation-side-str2enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/operation-side-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); ``` #### str2enum( operation ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); Returns the enumeration constant associated with a BLAS operation side. ```javascript -var v = str2enum( 'left' ); +const v = str2enum( 'left' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); +const str2enum = require( '@stdlib/blas/base/operation-side-str2enum' ); -var v = str2enum( 'left' ); +let v = str2enum( 'left' ); // returns v = str2enum( 'right' ); diff --git a/lib/node_modules/@stdlib/blas/base/operation-sides/README.md b/lib/node_modules/@stdlib/blas/base/operation-sides/README.md index a7b43d00d0ed..ee0ad15771a1 100644 --- a/lib/node_modules/@stdlib/blas/base/operation-sides/README.md +++ b/lib/node_modules/@stdlib/blas/base/operation-sides/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var operationSides = require( '@stdlib/blas/base/operation-sides' ); +const operationSides = require( '@stdlib/blas/base/operation-sides' ); ``` #### operationSides() @@ -45,7 +45,7 @@ var operationSides = require( '@stdlib/blas/base/operation-sides' ); Returns a list of BLAS operation sides. ```javascript -var out = operationSides(); +const out = operationSides(); // e.g., returns [ 'left', 'right' ] ``` @@ -75,12 +75,12 @@ The output array contains the following types: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var operationSides = require( '@stdlib/blas/base/operation-sides' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const operationSides = require( '@stdlib/blas/base/operation-sides' ); -var isOperationSide = contains( operationSides() ); +const isOperationSide = contains( operationSides() ); -var bool = isOperationSide( 'right' ); +let bool = isOperationSide( 'right' ); // returns true bool = isOperationSide( 'left' ); diff --git a/lib/node_modules/@stdlib/blas/base/sasum-wasm/README.md b/lib/node_modules/@stdlib/blas/base/sasum-wasm/README.md index 0d73d5cec80c..f9ca18e4f4e0 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/sasum-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sasum = require( '@stdlib/blas/base/sasum-wasm' ); +const sasum = require( '@stdlib/blas/base/sasum-wasm' ); ``` #### sasum.main( N, x, stride ) @@ -35,11 +35,11 @@ var sasum = require( '@stdlib/blas/base/sasum-wasm' ); Computes the sum of absolute values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var sum = sasum.main( x.length, x, 1 ); +const sum = sasum.main( x.length, x, 1 ); // returns 15.0 ``` @@ -52,11 +52,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to compute the sum of every other value, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = sasum.main( 4, x, 2 ); +const sum = sasum.main( 4, x, 2 ); // returns 10.0 ``` @@ -65,15 +65,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create a typed array view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var sum = sasum.main( 3, x1, 2 ); +const sum = sasum.main( 3, x1, 2 ); // returns 12.0 ``` @@ -82,11 +82,11 @@ var sum = sasum.main( 3, x1, 2 ); Computes the sum of absolute values using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = sasum.ndarray( x.length, x, 1, 0 ); +const sum = sasum.ndarray( x.length, x, 1, 0 ); // returns 19.0 ``` @@ -97,11 +97,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to compute the sum of last three elements, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var sum = sasum.ndarray( 3, x, 1, x.length-3 ); +let sum = sasum.ndarray( 3, x, 1, x.length-3 ); // returns 15.0 // Using a negative stride to sum from the last element: @@ -120,16 +120,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sasum.Module( mem ); +const mod = new sasum.Module( mem ); // returns // Initialize the routine: @@ -143,37 +143,37 @@ Computes the sum of absolute values. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var zeros = require( '@stdlib/array/zeros' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const zeros = require( '@stdlib/array/zeros' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sasum.Module( mem ); +const mod = new sasum.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var sum = mod.main( N, xptr, 1 ); +const sum = mod.main( N, xptr, 1 ); // returns 15.0 ``` @@ -190,37 +190,37 @@ Computes the sum of absolute values using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var zeros = require( '@stdlib/array/zeros' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const zeros = require( '@stdlib/array/zeros' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sasum.Module( mem ); +const mod = new sasum.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var sum = mod.ndarray( N, xptr, 1, 0 ); +const sum = mod.ndarray( N, xptr, 1, 0 ); // returns 15.0 ``` @@ -255,16 +255,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sasum = require( '@stdlib/blas/base/sasum-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sasum = require( '@stdlib/blas/base/sasum-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var sum = sasum.ndarray( x.length, x, 1, 0 ); +const sum = sasum.ndarray( x.length, x, 1, 0 ); console.log( sum ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/sasum/README.md b/lib/node_modules/@stdlib/blas/base/sasum/README.md index a79dfb368ce8..e22e957b436e 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/sasum/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var sasum = require( '@stdlib/blas/base/sasum' ); +const sasum = require( '@stdlib/blas/base/sasum' ); ``` #### sasum( N, x, stride ) @@ -56,11 +56,11 @@ var sasum = require( '@stdlib/blas/base/sasum' ); Computes the sum of [absolute values][@stdlib/math/base/special/abs]. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = sasum( x.length, x, 1 ); +const sum = sasum( x.length, x, 1 ); // returns 19.0 ``` @@ -73,27 +73,27 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = sasum( 4, x, 2 ); +const sum = sasum( 4, x, 2 ); // returns 10.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sum every other value: -var sum = sasum( 3, x1, 2 ); +const sum = sasum( 3, x1, 2 ); // returns 12.0 ``` @@ -104,11 +104,11 @@ If either `N` is less than or equal to `0`, the function returns `0`. Computes the sum of [absolute values][@stdlib/math/base/special/abs] using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var sum = sasum.ndarray( x.length, x, 1, 0 ); +const sum = sasum.ndarray( x.length, x, 1, 0 ); // returns 19.0 ``` @@ -119,11 +119,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var sum = sasum.ndarray( 3, x, 1, x.length-3 ); +let sum = sasum.ndarray( 3, x, 1, x.length-3 ); // returns 15.0 // Using a negative stride to sum from the last element: @@ -153,16 +153,16 @@ sum = sasum.ndarray( 3, x, -1, x.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sasum = require( '@stdlib/blas/base/sasum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sasum = require( '@stdlib/blas/base/sasum' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); -var out = sasum( x.length, x, 1 ); +const out = sasum( x.length, x, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/saxpy-wasm/README.md b/lib/node_modules/@stdlib/blas/base/saxpy-wasm/README.md index 4d768807f56b..d77a282418b7 100644 --- a/lib/node_modules/@stdlib/blas/base/saxpy-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/saxpy-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var saxpy = require( '@stdlib/blas/base/saxpy-wasm' ); +const saxpy = require( '@stdlib/blas/base/saxpy-wasm' ); ``` #### saxpy.main( N, alpha, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var saxpy = require( '@stdlib/blas/base/saxpy-wasm' ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); saxpy.main( x.length, 5.0, x, 1, y, 1 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -56,12 +56,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const alpha = 5.0; saxpy.main( 3, alpha, x, 2, y, -1 ); // y => [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ] @@ -72,15 +72,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element saxpy.main( 3, 5.0, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -91,11 +91,11 @@ saxpy.main( 3, 5.0, x1, -2, y1, 1 ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var alpha = 5.0; +const alpha = 5.0; saxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -131,16 +131,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new saxpy.Module( mem ); +const mod = new saxpy.Module( mem ); // returns // Initialize the routine: @@ -154,34 +154,34 @@ Multiplies a vector `x` by a constant and adds the result to `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new saxpy.Module( mem ); +const mod = new saxpy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -191,7 +191,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, 5.0, xptr, 1, yptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -214,34 +214,34 @@ Multiplies a vector `x` by a constant and adds the result to `y` using alternati ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new saxpy.Module( mem ); +const mod = new saxpy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -251,7 +251,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, 5.0, xptr, 1, 0, yptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -290,16 +290,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var saxpy = require( '@stdlib/blas/base/saxpy-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const saxpy = require( '@stdlib/blas/base/saxpy-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); saxpy.ndarray( x.length, 5.0, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/saxpy/README.md b/lib/node_modules/@stdlib/blas/base/saxpy/README.md index efac1e63552e..b63b84948083 100644 --- a/lib/node_modules/@stdlib/blas/base/saxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/saxpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var saxpy = require( '@stdlib/blas/base/saxpy' ); +const saxpy = require( '@stdlib/blas/base/saxpy' ); ``` #### saxpy( N, alpha, x, strideX, y, strideY ) @@ -35,11 +35,11 @@ var saxpy = require( '@stdlib/blas/base/saxpy' ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; saxpy( x.length, alpha, x, 1, y, 1 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const alpha = 5.0; saxpy( 3, alpha, x, 2, y, -1 ); // y => [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ] @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element saxpy( 3, 5.0, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -92,11 +92,11 @@ saxpy( 3, 5.0, x1, -2, y1, 1 ); Multiplies a vector `x` by a constant `alpha` and adds the result to `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var alpha = 5.0; +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const alpha = 5.0; saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ] @@ -110,12 +110,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var alpha = 5.0; +const alpha = 5.0; saxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ] @@ -143,16 +143,16 @@ saxpy.ndarray( 3, alpha, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var saxpy = require( '@stdlib/blas/base/saxpy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const saxpy = require( '@stdlib/blas/base/saxpy' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); saxpy.ndarray( x.length, 5.0, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/scabs1/README.md b/lib/node_modules/@stdlib/blas/base/scabs1/README.md index b1d31193fdc0..90dc16950994 100644 --- a/lib/node_modules/@stdlib/blas/base/scabs1/README.md +++ b/lib/node_modules/@stdlib/blas/base/scabs1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var scabs1 = require( '@stdlib/blas/base/scabs1' ); +const scabs1 = require( '@stdlib/blas/base/scabs1' ); ``` #### scabs1( z ) @@ -35,9 +35,9 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); Computes the sum of the [absolute values][absolute-value] of the real and imaginary components of a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var y = scabs1( new Complex64( 5.0, -3.0 ) ); +const y = scabs1( new Complex64( 5.0, -3.0 ) ); // returns 8.0 ``` @@ -52,14 +52,12 @@ var y = scabs1( new Complex64( 5.0, -3.0 ) ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var scabs1 = require( '@stdlib/blas/base/scabs1' ); - -var c; -var i; -for ( i = 0; i < 100; i++ ) { - c = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const scabs1 = require( '@stdlib/blas/base/scabs1' ); + +for ( let i = 0; i < 100; i++ ) { + const c = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); console.log( 'scabs1(%s) = %d', c.toString(), scabs1( c ) ); } ``` diff --git a/lib/node_modules/@stdlib/blas/base/scasum/README.md b/lib/node_modules/@stdlib/blas/base/scasum/README.md index 0181c0f29e44..0deba4f7b2bf 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/scasum/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var scasum = require( '@stdlib/blas/base/scasum' ); +const scasum = require( '@stdlib/blas/base/scasum' ); ``` #### scasum( N, cx, strideX ) @@ -35,11 +35,11 @@ var scasum = require( '@stdlib/blas/base/scasum' ); Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var out = scasum( 4, cx, 1 ); +const out = scasum( 4, cx, 1 ); // returns ~1.6 ``` @@ -52,27 +52,27 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to traverse every other value, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var out = scasum( 2, cx, 2 ); +const out = scasum( 2, cx, 2 ); // returns 7.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the L2-out: -var out = scasum( 2, cx1, 1 ); +const out = scasum( 2, cx1, 1 ); // returns 18.0 ``` @@ -81,11 +81,11 @@ var out = scasum( 2, cx1, 1 ); Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var out = scasum.ndarray( 4, cx, 1, 0 ); +const out = scasum.ndarray( 4, cx, 1, 0 ); // returns ~1.6 ``` @@ -96,11 +96,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var out = scasum.ndarray( 2, cx, 1, 1 ); +const out = scasum.ndarray( 2, cx, 1, 1 ); // returns 18.0 ``` @@ -126,20 +126,20 @@ var out = scasum.ndarray( 2, cx, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var scasum = require( '@stdlib/blas/base/scasum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const scasum = require( '@stdlib/blas/base/scasum' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); +const cx = filledarrayBy( 10, 'complex64', rand ); console.log( cx.toString() ); // Compute the sum of the absolute values of real and imaginary components: -var out = scasum( cx.length, cx, 1 ); +const out = scasum( cx.length, cx, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/README.md b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md index 2d964a481936..3e141055fb27 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var scnrm2 = require( '@stdlib/blas/base/scnrm2' ); +const scnrm2 = require( '@stdlib/blas/base/scnrm2' ); ``` #### scnrm2( N, cx, strideX ) @@ -35,11 +35,11 @@ var scnrm2 = require( '@stdlib/blas/base/scnrm2' ); Computes the L2-norm of a complex single-precision floating-point vector. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = scnrm2( 4, cx, 1 ); +const norm = scnrm2( 4, cx, 1 ); // returns ~0.8 ``` @@ -52,27 +52,27 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to traverse every other value, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var norm = scnrm2( 2, cx, 2 ); +const norm = scnrm2( 2, cx, 2 ); // returns ~4.6 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the L2-norm: -var norm = scnrm2( 2, cx1, 1 ); +const norm = scnrm2( 2, cx1, 1 ); // returns ~9.3 ``` @@ -81,11 +81,11 @@ var norm = scnrm2( 2, cx1, 1 ); Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +const cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = scnrm2.ndarray( 4, cx, 1, 0 ); +const norm = scnrm2.ndarray( 4, cx, 1, 0 ); // returns ~0.8 ``` @@ -96,11 +96,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var norm = scnrm2.ndarray( 2, cx, 1, 1 ); +const norm = scnrm2.ndarray( 2, cx, 1, 1 ); // returns ~9.3 ``` @@ -126,20 +126,20 @@ var norm = scnrm2.ndarray( 2, cx, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var scnrm2 = require( '@stdlib/blas/base/scnrm2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const scnrm2 = require( '@stdlib/blas/base/scnrm2' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); +const cx = filledarrayBy( 10, 'complex64', rand ); console.log( cx.toString() ); // Compute the L2-norm: -var norm = scnrm2( cx.length, cx, 1 ); +const norm = scnrm2( cx.length, cx, 1 ); console.log( norm ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/scopy-wasm/README.md b/lib/node_modules/@stdlib/blas/base/scopy-wasm/README.md index 47ebe78ec695..5aac516ab8f3 100644 --- a/lib/node_modules/@stdlib/blas/base/scopy-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/scopy-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var scopy = require( '@stdlib/blas/base/scopy-wasm' ); +const scopy = require( '@stdlib/blas/base/scopy-wasm' ); ``` #### scopy.main( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var scopy = require( '@stdlib/blas/base/scopy-wasm' ); Copies values from `x` into `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); scopy.main( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -55,10 +55,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to copy every other element from `x` into `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); scopy.main( 3, x, 2, y, -1 ); // y => [ 5.0, 3.0, 1.0, 1.0, 1.0, 1.0 ] @@ -69,15 +69,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scopy.main( 3, x1, -2, y1, 1 ); // y0 => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -88,10 +88,10 @@ scopy.main( 3, x1, -2, y1, 1 ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); scopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -105,10 +105,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); scopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -125,16 +125,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new scopy.Module( mem ); +const mod = new scopy.Module( mem ); // returns // Initialize the routine: @@ -148,34 +148,34 @@ Copies values from `x` into `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new scopy.Module( mem ); +const mod = new scopy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -185,7 +185,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, xptr, 1, yptr, 1 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -207,34 +207,34 @@ Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new scopy.Module( mem ); +const mod = new scopy.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -244,7 +244,7 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); // Read out the results: -var view = zeros( N, dtype ); +const view = zeros( N, dtype ); mod.read( yptr, view ); console.log( view ); @@ -283,16 +283,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var scopy = require( '@stdlib/blas/base/scopy-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const scopy = require( '@stdlib/blas/base/scopy-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); scopy.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/blas/base/scopy/README.md b/lib/node_modules/@stdlib/blas/base/scopy/README.md index 4cdf63244e72..1d1c6d309bb5 100644 --- a/lib/node_modules/@stdlib/blas/base/scopy/README.md +++ b/lib/node_modules/@stdlib/blas/base/scopy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var scopy = require( '@stdlib/blas/base/scopy' ); +const scopy = require( '@stdlib/blas/base/scopy' ); ``` #### scopy( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var scopy = require( '@stdlib/blas/base/scopy' ); Copies values from `x` into `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); scopy( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -55,10 +55,10 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); scopy( 3, x, -2, y, 1 ); // y => [ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ] @@ -69,15 +69,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Copy in reverse order every other value from `x1` into `y1`... scopy( 3, x1, -2, y1, 1 ); @@ -89,10 +89,10 @@ scopy( 3, x1, -2, y1, 1 ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); scopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -106,10 +106,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); scopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ] @@ -137,16 +137,16 @@ scopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var scopy = require( '@stdlib/blas/base/scopy' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const scopy = require( '@stdlib/blas/base/scopy' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Copy elements from `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/sdot-wasm/README.md b/lib/node_modules/@stdlib/blas/base/sdot-wasm/README.md index d7c27084234f..2b204cd9c1aa 100644 --- a/lib/node_modules/@stdlib/blas/base/sdot-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/sdot-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sdot = require( '@stdlib/blas/base/sdot-wasm' ); +const sdot = require( '@stdlib/blas/base/sdot-wasm' ); ``` #### sdot.main( N, x, strideX, y, strideY ) @@ -35,12 +35,12 @@ var sdot = require( '@stdlib/blas/base/sdot-wasm' ); Computes the dot product of `x` and `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdot.main( x.length, x, 1, y, 1 ); +const z = sdot.main( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -55,12 +55,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = sdot.main( 3, x, 2, y, -1 ); +const z = sdot.main( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -69,17 +69,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = sdot.main( 3, x1, -2, y1, 1 ); +const z = sdot.main( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -88,12 +88,12 @@ var z = sdot.main( 3, x1, -2, y1, 1 ); Computes the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -105,12 +105,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = sdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = sdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -125,16 +125,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sdot.Module( mem ); +const mod = new sdot.Module( mem ); // returns // Initialize the routine: @@ -148,41 +148,41 @@ Computes the dot product of `x` and `y`. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sdot.Module( mem ); +const mod = new sdot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); mod.write( yptr, ones( N, dtype ) ); // Perform computation: -var z = mod.main( N, xptr, 1, yptr, 1 ); +const z = mod.main( N, xptr, 1, yptr, 1 ); console.log( z ); ``` @@ -202,41 +202,41 @@ Computes the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new sdot.Module( mem ); +const mod = new sdot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); mod.write( yptr, ones( N, dtype ) ); // Perform computation: -var z = mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); +const z = mod.ndarray( N, xptr, 1, 0, yptr, 1, 0 ); console.log( z ); ``` @@ -273,19 +273,19 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sdot = require( '@stdlib/blas/base/sdot-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sdot = require( '@stdlib/blas/base/sdot-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var z = sdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); +const z = sdot.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); console.log( z ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/sdot/README.md b/lib/node_modules/@stdlib/blas/base/sdot/README.md index 63bece136415..48ccb7d0be08 100644 --- a/lib/node_modules/@stdlib/blas/base/sdot/README.md +++ b/lib/node_modules/@stdlib/blas/base/sdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var sdot = require( '@stdlib/blas/base/sdot' ); +const sdot = require( '@stdlib/blas/base/sdot' ); ``` #### sdot( N, x, strideX, y, strideY ) @@ -56,12 +56,12 @@ var sdot = require( '@stdlib/blas/base/sdot' ); Calculates the dot product of vectors `x` and `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdot( x.length, x, 1, y, 1 ); +const z = sdot( x.length, x, 1, y, 1 ); // returns -5.0 ``` @@ -76,12 +76,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = sdot( 3, x, 2, y, -1 ); +const z = sdot( 3, x, 2, y, -1 ); // returns 9.0 ``` @@ -90,17 +90,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = sdot( 3, x1, -2, y1, 1 ); +const z = sdot( 3, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -109,12 +109,12 @@ var z = sdot( 3, x1, -2, y1, 1 ); Calculates the dot product of `x` and `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); +const z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -126,12 +126,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = sdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); +const z = sdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -157,19 +157,19 @@ var z = sdot.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sdot = require( '@stdlib/blas/base/sdot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sdot = require( '@stdlib/blas/base/sdot' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var out = sdot( x.length, x, 1, y, -1 ); +const out = sdot( x.length, x, 1, y, -1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/sdsdot/README.md b/lib/node_modules/@stdlib/blas/base/sdsdot/README.md index d6b8f9131d58..184c1fdf7888 100644 --- a/lib/node_modules/@stdlib/blas/base/sdsdot/README.md +++ b/lib/node_modules/@stdlib/blas/base/sdsdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var sdsdot = require( '@stdlib/blas/base/sdsdot' ); +const sdsdot = require( '@stdlib/blas/base/sdsdot' ); ``` #### sdsdot( N, scalar, x, strideX, y, strideY ) @@ -56,12 +56,12 @@ var sdsdot = require( '@stdlib/blas/base/sdsdot' ); Calculates the dot product of vectors `x` and `y` with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdsdot( x.length, 0.0, x, 1, y, 1 ); +const z = sdsdot( x.length, 0.0, x, 1, y, 1 ); // returns -5.0 ``` @@ -77,12 +77,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var z = sdsdot( 3, 0.0, x, 2, y, -1 ); +const z = sdsdot( 3, 0.0, x, 2, y, -1 ); // returns 9.0 ``` @@ -91,17 +91,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z = sdsdot( 3, 0.0, x1, -2, y1, 1 ); +const z = sdsdot( 3, 0.0, x1, -2, y1, 1 ); // returns 128.0 ``` @@ -110,12 +110,12 @@ var z = sdsdot( 3, 0.0, x1, -2, y1, 1 ); Calculates the dot product of vectors `x` and `y` with extended accumulation and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); -var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); +const x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); +const y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); -var z = sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); +const z = sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // returns -5.0 ``` @@ -127,12 +127,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the dot product of every other value in `x` starting from the second value with the last 3 elements in `y` in reverse order ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var z = sdsdot.ndarray( 3, 0.0, x, 2, 1, y, -1, y.length-1 ); +const z = sdsdot.ndarray( 3, 0.0, x, 2, 1, y, -1, y.length-1 ); // returns 128.0 ``` @@ -158,19 +158,19 @@ var z = sdsdot.ndarray( 3, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sdsdot = require( '@stdlib/blas/base/sdsdot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sdsdot = require( '@stdlib/blas/base/sdsdot' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); -var out = sdsdot( x.length, 0.0, x, 1, y, -1 ); +const out = sdsdot( x.length, 0.0, x, 1, y, -1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/README.md b/lib/node_modules/@stdlib/blas/base/sgemm/README.md index e3356fcbab40..f67fbddc9a72 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/README.md +++ b/lib/node_modules/@stdlib/blas/base/sgemm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sgemm = require( '@stdlib/blas/base/sgemm' ); +const sgemm = require( '@stdlib/blas/base/sgemm' ); ``` #### sgemm( ord, ta, tb, M, N, K, α, A, lda, B, ldb, β, C, ldc ) @@ -35,11 +35,11 @@ var sgemm = require( '@stdlib/blas/base/sgemm' ); Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float32Array( [ 1.0, 1.0, 0.0, 1.0 ] ); -var C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float32Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +const C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); sgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 2, B, 2, 1.0, C, 2 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -65,11 +65,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] ); -var B = new Float32Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] ); -var C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] ); +const B = new Float32Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] ); +const C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); sgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 4, B, 4, 1.0, C, 2 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -82,11 +82,11 @@ sgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 4, B, 4, 1. Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float32Array( [ 1.0, 1.0, 0.0, 1.0 ] ); -var C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float32Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +const C = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); sgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 2, 1, 0, B, 2, 1, 0, 1.0, C, 2, 1, 0 ); // C => [ 2.0, 5.0, 6.0, 11.0 ] @@ -107,11 +107,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); -var B = new Float32Array( [ 0.0, 1.0, 0.0, 1.0, 1.0 ] ); -var C = new Float32Array( [ 0.0, 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); +const A = new Float32Array( [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); +const B = new Float32Array( [ 0.0, 1.0, 0.0, 1.0, 1.0 ] ); +const C = new Float32Array( [ 0.0, 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] ); sgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 1, 2, 2, B, 1, 2, 1, 1.0, C, 1, 2, 3 ); // C => [ 0.0, 0.0, 0.0, 2.0, 6.0, 5.0, 11.0 ] @@ -138,20 +138,20 @@ sgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 1, 2, 2, B, 1, 2 ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sgemm = require( '@stdlib/blas/base/sgemm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sgemm = require( '@stdlib/blas/base/sgemm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var M = 3; -var N = 4; -var K = 2; +const M = 3; +const N = 4; +const K = 2; -var A = discreteUniform( M*K, 0, 10, opts ); // 3x2 -var B = discreteUniform( K*N, 0, 10, opts ); // 2x4 -var C = discreteUniform( M*N, 0, 10, opts ); // 3x4 +const A = discreteUniform( M*K, 0, 10, opts ); // 3x2 +const B = discreteUniform( K*N, 0, 10, opts ); // 2x4 +const C = discreteUniform( M*N, 0, 10, opts ); // 3x4 sgemm( 'row-major', 'no-transpose', 'no-transpose', M, N, K, 1.0, A, K, B, N, 1.0, C, N ); console.log( C ); diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/README.md b/lib/node_modules/@stdlib/blas/base/sgemv/README.md index 3a65df1b86d8..5bc56627a3ad 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/sgemv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sgemv = require( '@stdlib/blas/base/sgemv' ); +const sgemv = require( '@stdlib/blas/base/sgemv' ); ``` #### sgemv( ord, trans, M, N, α, A, LDA, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var sgemv = require( '@stdlib/blas/base/sgemv' ); Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0 ] ); sgemv( 'row-major', 'no-transpose', 2, 3, 1.0, A, 3, x, 1, 1.0, y, 1 ); // y => [ 7.0, 16.0 ] @@ -63,11 +63,11 @@ The function has the following parameters: The stride parameters determine how operations are performed. For example, to iterate over every other element in `x` and `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var x = new Float32Array( [ 1.0, 0.0, 1.0, 0.0 ] ); -var y = new Float32Array( [ 1.0, 0.0, 1.0, 0.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 1.0, 0.0, 1.0, 0.0 ] ); +const y = new Float32Array( [ 1.0, 0.0, 1.0, 0.0 ] ); sgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x, 2, 1.0, y, 2 ); // y => [ 4.0, 0.0, 8.0, 0.0 ] @@ -78,16 +78,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element sgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x1, -1, 1.0, y1, -1 ); // y0 => [ 0.0, 8.0, 4.0 ] @@ -98,11 +98,11 @@ sgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x1, -1, 1.0, y1, -1 ); Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0 ] ); sgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // y => [ 7.0, 16.0 ] @@ -119,11 +119,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0 ] ); sgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 1, 1.0, y, -2, 2 ); // y => [ 39, 8, 23, 10 ] @@ -150,19 +150,19 @@ sgemv.ndarray( 'no-transpose', 2, 3, 1.0, A, 3, 1, 0, x, 1, 1, 1.0, y, -2, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sgemv = require( '@stdlib/blas/base/sgemv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sgemv = require( '@stdlib/blas/base/sgemv' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var M = 3; -var N = 3; +const M = 3; +const N = 3; -var A = discreteUniform( M*N, 0, 255, opts ); -var x = discreteUniform( N, 0, 255, opts ); -var y = discreteUniform( M, 0, 255, opts ); +const A = discreteUniform( M*N, 0, 255, opts ); +const x = discreteUniform( N, 0, 255, opts ); +const y = discreteUniform( M, 0, 255, opts ); sgemv( 'row-major', 'no-transpose', M, N, 1.0, A, N, x, -1, 1.0, y, -1 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/shared/README.md b/lib/node_modules/@stdlib/blas/base/shared/README.md index 64c67a48f075..c71e6db79e02 100644 --- a/lib/node_modules/@stdlib/blas/base/shared/README.md +++ b/lib/node_modules/@stdlib/blas/base/shared/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/blas/base/shared' ); +const headerDir = require( '@stdlib/blas/base/shared' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/blas/base/shared' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/blas/base/shared' ); +const headerDir = require( '@stdlib/blas/base/shared' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/blas/base/snrm2-wasm/README.md b/lib/node_modules/@stdlib/blas/base/snrm2-wasm/README.md index 93ee8a65b97f..1665efd14d3c 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/snrm2-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var snrm2 = require( '@stdlib/blas/base/snrm2-wasm' ); +const snrm2 = require( '@stdlib/blas/base/snrm2-wasm' ); ``` #### snrm2.main( N, x, strideX ) @@ -35,11 +35,11 @@ var snrm2 = require( '@stdlib/blas/base/snrm2-wasm' ); Calculates the L2-norm of a single-precision floating-point vector. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var z = snrm2.main( 3, x, 1 ); +const z = snrm2.main( 3, x, 1 ); // returns 3.0 ``` @@ -52,11 +52,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the input strided array are accessed at runtime. For example, to compute the L2-norm of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var z = snrm2.main( 4, x, 2 ); +const z = snrm2.main( 4, x, 2 ); // returns 5.0 ``` @@ -65,15 +65,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); // Create a typed array view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z = snrm2.main( 4, x1, 2 ); +const z = snrm2.main( 4, x1, 2 ); // returns 5.0 ``` @@ -82,11 +82,11 @@ var z = snrm2.main( 4, x1, 2 ); Calculates the L2-norm of a single-precision floating-point vector using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var z = snrm2.ndarray( 3, x, 1, 0 ); +const z = snrm2.ndarray( 3, x, 1, 0 ); // returns 3.0 ``` @@ -97,11 +97,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the L2-norm for every other value in `x` starting from the second value, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var z = snrm2.ndarray( 4, x, 2, 1 ); +const z = snrm2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -116,16 +116,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new snrm2.Module( mem ); +const mod = new snrm2.Module( mem ); // returns // Initialize the routine: @@ -139,36 +139,36 @@ Computes the L2-norm of a single-precision floating-point vector. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new snrm2.Module( mem ); +const mod = new snrm2.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var out = mod.main( N, xptr, 1 ); +const out = mod.main( N, xptr, 1 ); // returns ~7.42 ``` @@ -185,36 +185,36 @@ Computes the L2-norm of a single-precision floating-point vector using alternati ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new snrm2.Module( mem ); +const mod = new snrm2.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define a pointer (i.e., byte offset) for storing the input vector: -var xptr = 0; +const xptr = 0; // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); // Perform computation: -var out = mod.ndarray( N, xptr, 1, 0 ); +const out = mod.ndarray( N, xptr, 1, 0 ); // returns ~7.42 ``` @@ -249,16 +249,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var snrm2 = require( '@stdlib/blas/base/snrm2-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const snrm2 = require( '@stdlib/blas/base/snrm2-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var out = snrm2.ndarray( x.length, x, 1, 0 ); +const out = snrm2.ndarray( x.length, x, 1, 0 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/README.md b/lib/node_modules/@stdlib/blas/base/snrm2/README.md index 5fd7646b133f..15538869b4a9 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/snrm2/README.md @@ -44,7 +44,7 @@ The [L2-norm][l2-norm] is defined as ## Usage ```javascript -var snrm2 = require( '@stdlib/blas/base/snrm2' ); +const snrm2 = require( '@stdlib/blas/base/snrm2' ); ``` #### snrm2( N, x, stride ) @@ -52,11 +52,11 @@ var snrm2 = require( '@stdlib/blas/base/snrm2' ); Computes the [L2-norm][l2-norm] of a single-precision floating-point vector `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var z = snrm2( x.length, x, 1 ); +const z = snrm2( x.length, x, 1 ); // returns 3.0 ``` @@ -69,11 +69,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [L2-norm][l2-norm] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var z = snrm2( 4, x, 2 ); +const z = snrm2( 4, x, 2 ); // returns 5.0 ``` @@ -82,12 +82,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z = snrm2( 4, x1, 2 ); +const z = snrm2( 4, x1, 2 ); // returns 5.0 ``` @@ -98,11 +98,11 @@ If `N` is less than or equal to `0`, the function returns `0`. Computes the [L2-norm][l2-norm] of a single-precision floating-point vector using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var z = snrm2.ndarray( x.length, x, 1, 0 ); +const z = snrm2.ndarray( x.length, x, 1, 0 ); // returns 3.0 ``` @@ -113,11 +113,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [L2-norm][l2-norm] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var z = snrm2.ndarray( 4, x, 2, 1 ); +const z = snrm2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -143,16 +143,16 @@ var z = snrm2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var snrm2 = require( '@stdlib/blas/base/snrm2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const snrm2 = require( '@stdlib/blas/base/snrm2' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var out = snrm2( x.length, x, 1 ); +const out = snrm2( x.length, x, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/srot-wasm/README.md b/lib/node_modules/@stdlib/blas/base/srot-wasm/README.md index 2f601469c615..a8d3ba2e3fb2 100644 --- a/lib/node_modules/@stdlib/blas/base/srot-wasm/README.md +++ b/lib/node_modules/@stdlib/blas/base/srot-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var srot = require( '@stdlib/blas/base/srot-wasm' ); +const srot = require( '@stdlib/blas/base/srot-wasm' ); ``` #### srot.main( N, x, strideX, y, strideY, c, s ) @@ -35,10 +35,10 @@ var srot = require( '@stdlib/blas/base/srot-wasm' ); Applies a plane rotation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); srot.main( x.length, x, 1, y, 1, 0.0, 1.0 ); // x => [ 1.0, 1.0, 1.0, 1.0, 1.0 ] @@ -58,10 +58,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); srot.main( 3, x, 2, y, 2, 0.8, 0.6 ); // x => [ ~5.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element srot.main( 3, x1, -2, y1, 1, 0.8, 0.6 ); // x0 => [ 1.0, ~8.8, 3.0, ~9.8, 5.0, ~10.8 ] @@ -93,10 +93,10 @@ srot.main( 3, x1, -2, y1, 1, 0.8, 0.6 ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); srot.ndarray( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); // x => [ 1.0, ~5.8, ~7.2, ~8.6, 10.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); srot.ndarray( 3, x, 2, 1, y, 2, 1, 0.8, 0.6 ); // x => [ 1.0, ~6.4, 3.0, ~9.2, 5.0, 12.0 ] @@ -132,16 +132,16 @@ Returns a new WebAssembly [module wrapper][@stdlib/wasm/module-wrapper] instance ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new srot.Module( mem ); +const mod = new srot.Module( mem ); // returns // Initialize the routine: @@ -155,34 +155,34 @@ Applies a plane rotation. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new srot.Module( mem ); +const mod = new srot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -192,8 +192,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.main( N, xptr, 1, yptr, 1, 0.0, 1.0 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -221,34 +221,34 @@ Applies a plane rotation using alternative indexing semantics. ```javascript -var Memory = require( '@stdlib/wasm/memory' ); -var oneTo = require( '@stdlib/array/one-to' ); -var ones = require( '@stdlib/array/ones' ); -var zeros = require( '@stdlib/array/zeros' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const Memory = require( '@stdlib/wasm/memory' ); +const oneTo = require( '@stdlib/array/one-to' ); +const ones = require( '@stdlib/array/ones' ); +const zeros = require( '@stdlib/array/zeros' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); // Create a new memory instance with an initial size of 10 pages (640KiB) and a maximum size of 100 pages (6.4MiB): -var mem = new Memory({ +const mem = new Memory({ 'initial': 10, 'maximum': 100 }); // Create a BLAS routine: -var mod = new srot.Module( mem ); +const mod = new srot.Module( mem ); // returns // Initialize the routine: mod.initializeSync(); // Define a vector data type: -var dtype = 'float32'; +const dtype = 'float32'; // Specify a vector length: -var N = 5; +const N = 5; // Define pointers (i.e., byte offsets) for storing two vectors: -var xptr = 0; -var yptr = N * bytesPerElement( dtype ); +const xptr = 0; +const yptr = N * bytesPerElement( dtype ); // Write vector values to module memory: mod.write( xptr, oneTo( N, dtype ) ); @@ -258,8 +258,8 @@ mod.write( yptr, ones( N, dtype ) ); mod.ndarray( N, xptr, 1, 0, yptr, 1, 0, 0.0, 1.0 ); // Read out the results: -var viewX = zeros( N, dtype ); -var viewY = zeros( N, dtype ); +const viewX = zeros( N, dtype ); +const viewY = zeros( N, dtype ); mod.read( xptr, viewX ); mod.read( yptr, viewY ); @@ -302,16 +302,16 @@ The function has the following additional parameters: ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var srot = require( '@stdlib/blas/base/srot-wasm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const srot = require( '@stdlib/blas/base/srot-wasm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 100, opts ); +const x = discreteUniform( 10, 0, 100, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 10, opts ); +const y = discreteUniform( x.length, 0, 10, opts ); console.log( y ); srot.ndarray( x.length, x, 1, 0, y, -1, y.length-1, 0.8, 0.6 ); diff --git a/lib/node_modules/@stdlib/blas/base/srot/README.md b/lib/node_modules/@stdlib/blas/base/srot/README.md index 0db8477dbc3c..99ba5164056d 100644 --- a/lib/node_modules/@stdlib/blas/base/srot/README.md +++ b/lib/node_modules/@stdlib/blas/base/srot/README.md @@ -41,7 +41,7 @@ where `x_i` and `y_i` are the individual elements on which the rotation is appli ## Usage ```javascript -var srot = require( '@stdlib/blas/base/srot' ); +const srot = require( '@stdlib/blas/base/srot' ); ``` #### srot( N, x, strideX, y, strideY, c, s ) @@ -49,10 +49,10 @@ var srot = require( '@stdlib/blas/base/srot' ); Applies a plane rotation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); srot( x.length, x, 1, y, 1, 0.8, 0.6 ); // x => [ ~4.4, ~5.8, ~7.2, ~8.6, 10.0 ] @@ -72,10 +72,10 @@ The function has the following parameters: The `N` and stride parameters determine how values in the strided arrays are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); srot( 3, x, 2, y, 2, 0.8, 0.6 ); // x => [ ~5.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] @@ -87,15 +87,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element srot( 3, x1, 1, y1, 1, 0.8, 0.6 ); // x0 => [ 1.0, ~7.6, 9.0, ~10.4, 5.0, 6.0 ] @@ -107,10 +107,10 @@ srot( 3, x1, 1, y1, 1, 0.8, 0.6 ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); srot.ndarray( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); // x => [ 1.0, ~5.8, ~7.2, ~8.6, 10.0 ] @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from third element,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); srot.ndarray( 2, x, 2, 2, y, 2, 2, 0.8, 0.6 ); // x => [ 1.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] @@ -157,16 +157,16 @@ srot.ndarray( 2, x, 2, 2, y, 2, 2, 0.8, 0.6 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var srot = require( '@stdlib/blas/base/srot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const srot = require( '@stdlib/blas/base/srot' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Applies a plane rotation : diff --git a/lib/node_modules/@stdlib/blas/base/srotg/README.md b/lib/node_modules/@stdlib/blas/base/srotg/README.md index 7fa9b5bc1174..9fe322a2a22b 100644 --- a/lib/node_modules/@stdlib/blas/base/srotg/README.md +++ b/lib/node_modules/@stdlib/blas/base/srotg/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var srotg = require( '@stdlib/blas/base/srotg' ); +const srotg = require( '@stdlib/blas/base/srotg' ); ``` #### srotg( a, b ) @@ -35,7 +35,7 @@ var srotg = require( '@stdlib/blas/base/srotg' ); Constructs a Givens plane rotation provided two single-precision floating-point values `a` and `b`. ```javascript -var out = srotg( 0.0, 2.0 ); +const out = srotg( 0.0, 2.0 ); // returns [ 2.0, 1.0, 0.0, 1.0 ] ``` @@ -49,14 +49,14 @@ The function has the following parameters: Constructs a Givens plane rotation provided two single-precision floating-point values `a` and `b` and assigns results to an output array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var out = new Float32Array( 4 ); +const out = new Float32Array( 4 ); -var y = srotg.assign( 0.0, 2.0, out, 1, 0 ); +const y = srotg.assign( 0.0, 2.0, out, 1, 0 ); // returns [ 2.0, 1.0, 0.0, 1.0 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true ``` @@ -77,13 +77,11 @@ var bool = ( y === out );
```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var srotg = require( '@stdlib/blas/base/srotg' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const srotg = require( '@stdlib/blas/base/srotg' ); -var out; -var i; -for ( i = 0; i < 100; i++ ) { - out = srotg( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); +for ( let i = 0; i < 100; i++ ) { + const out = srotg( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); console.log( out ); } ``` diff --git a/lib/node_modules/@stdlib/blas/base/srotm/README.md b/lib/node_modules/@stdlib/blas/base/srotm/README.md index d5d0fbdf379d..21eb64656631 100644 --- a/lib/node_modules/@stdlib/blas/base/srotm/README.md +++ b/lib/node_modules/@stdlib/blas/base/srotm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var srotm = require( '@stdlib/blas/base/srotm' ); +const srotm = require( '@stdlib/blas/base/srotm' ); ``` #### srotm( N, x, strideX, y, strideY, param ) @@ -35,11 +35,11 @@ var srotm = require( '@stdlib/blas/base/srotm' ); Applies a modified Givens plane rotation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); srotm( 2, x, 2, y, 1, param ); // x => [ ~-17.0, 2.0, ~-18.0, 4.0, 5.0 ] @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine how values in the strided arrays are accessed at runtime. For example, to apply a modified Givens plane rotation to every other element, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); srotm( 3, x, 2, y, 2, param ); // x => [ ~-20.0, 2.0, ~-24.0, 4.0, ~-28.0, 6.0 ] @@ -74,16 +74,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y0 = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float32Array( [ 1.0, 0.0, 2.0, 3.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y0 = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float32Array( [ 1.0, 0.0, 2.0, 3.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element srotm( 2, x1, 1, y1, 1, param ); // x0 => [ 1.0, ~9.0, ~10.0, 4.0, 5.0 ] @@ -95,11 +95,11 @@ srotm( 2, x1, 1, y1, 1, param ); Applies a modified Givens plane rotation using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); -var param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); srotm.ndarray( 2, x, 1, 0, y, 2, 1, param ); // x => [ ~-20.0, ~-25.0, 3.0, 4.0, 5.0 ] @@ -114,11 +114,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a modified Givens plane rotation to every other element starting from the second element, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] ); srotm.ndarray( 3, x, 2, 1, y, 2, 1, param ); // x => [ 1.0, ~-22.0, 3.0, ~-26.0, 5.0, ~-30.0 ] @@ -147,19 +147,19 @@ srotm.ndarray( 3, x, 2, 1, y, 2, 1, param ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var srotm = require( '@stdlib/blas/base/srotm' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const srotm = require( '@stdlib/blas/base/srotm' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); -var param = discreteUniform( 5, -5, 5, opts ); +const param = discreteUniform( 5, -5, 5, opts ); console.log( param ); // Apply a plane rotation: diff --git a/lib/node_modules/@stdlib/blas/base/sscal/README.md b/lib/node_modules/@stdlib/blas/base/sscal/README.md index 11290c779b53..dce980dd4f8c 100644 --- a/lib/node_modules/@stdlib/blas/base/sscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/sscal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sscal = require( '@stdlib/blas/base/sscal' ); +const sscal = require( '@stdlib/blas/base/sscal' ); ``` #### sscal( N, alpha, x, stride ) @@ -35,9 +35,9 @@ var sscal = require( '@stdlib/blas/base/sscal' ); Multiplies a single-precision floating-point vector `x` by a constant `alpha`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sscal( x.length, 5.0, x, 1 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to multiply every other value by a constant ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sscal( 4, 5.0, x, 2 ); // x => [ -10.0, 1.0, 15.0, -5.0, 20.0, 0.0, -5.0, -3.0 ] @@ -64,13 +64,13 @@ sscal( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scale every other value: sscal( 3, 5.0, x1, 2 ); @@ -84,9 +84,9 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `x` Multiplies a single-precision floating-point vector `x` by a constant `alpha` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sscal.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ] @@ -99,9 +99,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to multiply the last three elements of `x` by a constant ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); sscal.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ] @@ -129,13 +129,13 @@ sscal.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sscal = require( '@stdlib/blas/base/sscal' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sscal = require( '@stdlib/blas/base/sscal' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, -100, 100, opts ); +const x = discreteUniform( 10, -100, 100, opts ); console.log( x ); sscal( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/sspmv/README.md b/lib/node_modules/@stdlib/blas/base/sspmv/README.md index ccf70b261676..ab2424a26abb 100644 --- a/lib/node_modules/@stdlib/blas/base/sspmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/sspmv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sspmv = require( '@stdlib/blas/base/sspmv' ); +const sspmv = require( '@stdlib/blas/base/sspmv' ); ``` #### sspmv( order, uplo, N, α, AP, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var sspmv = require( '@stdlib/blas/base/sspmv' ); Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix supplied in packed form `AP`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); sspmv( 'column-major', 'lower', 3, 1.0, AP, x, 1, 1.0, y, 1 ); // y => [ 7.0, 12.0, 15.0 ] @@ -61,11 +61,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); sspmv( 'column-major', 'lower', 3, 1.0, AP, x, 1, 1.0, y, -1 ); // y => [ 15.0, 12.0, 7.0 ] @@ -76,16 +76,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const x0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element sspmv( 'row-major', 'upper', 2, 1.0, AP, x1, -1, 1.0, y1, -1 ); // y0 => [ 0.0, 6.0, 4.0 ] @@ -96,11 +96,11 @@ sspmv( 'row-major', 'upper', 2, 1.0, AP, x1, -1, 1.0, y1, -1 ); Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix supplied in packed form `AP`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); sspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, x, 1, 0, 1.0, y, 1, 0 ); // y => [ 7.0, 12.0, 15.0 ] @@ -114,11 +114,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); sspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, x, 1, 0, 1.0, y, -1, 2 ); // y => [ 15.0, 12.0, 7.0 ] @@ -145,18 +145,18 @@ sspmv.ndarray( 'column-major', 'lower', 3, 1.0, AP, x, 1, 0, 1.0, y, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sspmv = require( '@stdlib/blas/base/sspmv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sspmv = require( '@stdlib/blas/base/sspmv' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 3; -var AP = discreteUniform( N * ( N + 1 ) / 2, -10, 10, opts ); +const N = 3; +const AP = discreteUniform( N * ( N + 1 ) / 2, -10, 10, opts ); -var x = discreteUniform( N, -10, 10, opts ); -var y = discreteUniform( N, -10, 10, opts ); +const x = discreteUniform( N, -10, 10, opts ); +const y = discreteUniform( N, -10, 10, opts ); sspmv.ndarray( 'row-major', 'upper', N, 1.0, AP, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/sspr/README.md b/lib/node_modules/@stdlib/blas/base/sspr/README.md index 7e5a6511d577..427329b44c7b 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/README.md +++ b/lib/node_modules/@stdlib/blas/base/sspr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sspr = require( '@stdlib/blas/base/sspr' ); +const sspr = require( '@stdlib/blas/base/sspr' ); ``` #### sspr( order, uplo, N, α, x, sx, AP ) @@ -35,10 +35,10 @@ var sspr = require( '@stdlib/blas/base/sspr' ); Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); sspr( 'row-major', 'upper', 3, 1.0, x, 1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -57,10 +57,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); sspr( 'row-major', 'upper', 3, 1.0, x, -1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -71,14 +71,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 3.0, 2.0, 1.0 ] ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x0 = new Float32Array( [ 0.0, 3.0, 2.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element sspr( 'row-major', 'upper', 3, 1.0, x1, -1, AP ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -89,10 +89,10 @@ sspr( 'row-major', 'upper', 3, 1.0, x1, -1, AP ); Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 1.0, 2.0, 1.0, 2.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const AP = new Float32Array( [ 1.0, 1.0, 2.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); sspr.ndarray( 'row-major', 'lower', 3, 1.0, x, 1, 0, AP, 1, 0 ); // AP => [ 2.0, 3.0, 6.0, 4.0, 8.0, 12.0 ] @@ -107,10 +107,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); -var x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); +const AP = new Float32Array( [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ] ); +const x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); sspr.ndarray( 'row-major', 'upper', 3, 1.0, x, -1, 2, AP, 1, 0 ); // AP => [ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ] @@ -137,17 +137,17 @@ sspr.ndarray( 'row-major', 'upper', 3, 1.0, x, -1, 2, AP, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sspr = require( '@stdlib/blas/base/sspr' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sspr = require( '@stdlib/blas/base/sspr' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 5; +const N = 5; -var AP = discreteUniform( N * ( N + 1 ) / 2, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const AP = discreteUniform( N * ( N + 1 ) / 2, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); sspr( 'column-major', 'upper', N, 1.0, x, 1, AP ); console.log( AP ); diff --git a/lib/node_modules/@stdlib/blas/base/sswap/README.md b/lib/node_modules/@stdlib/blas/base/sswap/README.md index c93c69742ef2..9898b1d0da77 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/README.md +++ b/lib/node_modules/@stdlib/blas/base/sswap/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sswap = require( '@stdlib/blas/base/sswap' ); +const sswap = require( '@stdlib/blas/base/sswap' ); ``` #### sswap( N, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var sswap = require( '@stdlib/blas/base/sswap' ); Interchanges vectors `x` and `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); sswap( x.length, x, 1, y, 1 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -56,10 +56,10 @@ The function has the following parameters: The `N` and stride parameters determine how values from the strided arrays are accessed at runtime. For example, to swap in reverse order every other value in `x` with the first `N` elements of `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); sswap( 3, x, -2, y, 1 ); // x => [ 9.0, 2.0, 8.0, 4.0, 7.0, 6.0 ] @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Swap in reverse order every other value from `x1` with `y1`... sswap( 3, x1, -2, y1, 1 ); @@ -92,10 +92,10 @@ sswap( 3, x1, -2, y1, 1 ); Interchanges vectors `x` and `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); sswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to swap every other value in `x` starting from the second value with the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); sswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // x => [ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ] @@ -142,16 +142,16 @@ sswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sswap = require( '@stdlib/blas/base/sswap' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sswap = require( '@stdlib/blas/base/sswap' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = discreteUniform( 10, 0, 500, opts ); +const x = discreteUniform( 10, 0, 500, opts ); console.log( x ); -var y = discreteUniform( x.length, 0, 255, opts ); +const y = discreteUniform( x.length, 0, 255, opts ); console.log( y ); // Swap elements in `x` and `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/README.md b/lib/node_modules/@stdlib/blas/base/ssymv/README.md index 5d9e8c0403f5..37a673a13a63 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ssymv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssymv = require( '@stdlib/blas/base/ssymv' ); +const ssymv = require( '@stdlib/blas/base/ssymv' ); ``` #### ssymv( order, uplo, N, α, A, LDA, x, sx, β, y, sy ) @@ -35,11 +35,11 @@ var ssymv = require( '@stdlib/blas/base/ssymv' ); Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +const A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); ssymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0.0, y, 1 ); // y => [ 1.0, 2.0, 3.0 ] @@ -62,11 +62,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssymv( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 1.0, y, 1 ); // y => [ 7.0, 10.0, 9.0 ] @@ -77,16 +77,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var y0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const y0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element ssymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); // y0 => [ 1.0, 4.0, 3.0, 2.0 ] @@ -97,11 +97,11 @@ ssymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 2, 1.0, y, 1, 0 ); // y => [ 7.0, 10.0, 9.0 ] @@ -115,11 +115,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); ssymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); // y => [ 4.0, 3.0, 2.0 ] @@ -146,19 +146,19 @@ ssymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var ssymv = require( '@stdlib/blas/base/ssymv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const ssymv = require( '@stdlib/blas/base/ssymv' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 3; -var A = ones( N*N, opts.dtype ); +const N = 3; +const A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, 0, 255, opts ); -var y = discreteUniform( N, 0, 255, opts ); +const x = discreteUniform( N, 0, 255, opts ); +const y = discreteUniform( N, 0, 255, opts ); ssymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/README.md b/lib/node_modules/@stdlib/blas/base/ssyr/README.md index 4b9c40a8af6f..f4947adc5b24 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/ssyr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssyr = require( '@stdlib/blas/base/ssyr' ); +const ssyr = require( '@stdlib/blas/base/ssyr' ); ``` #### ssyr( order, uplo, N, α, x, sx, A, LDA ) @@ -35,10 +35,10 @@ var ssyr = require( '@stdlib/blas/base/ssyr' ); Performs the symmetric rank 1 operation `A = α*x*x**T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] @@ -58,10 +58,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); ssyr( 'row-major', 'upper', 3, 1.0, x, -2, A, 3 ); // A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] @@ -72,14 +72,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element ssyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); // A => [ 2.0, 3.0, 4.0, 0.0, 2.0, 3.0, 0.0, 0.0, 2.0 ] @@ -90,10 +90,10 @@ ssyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] @@ -109,10 +109,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); ssyr.ndarray( 'upper', 3, 1.0, x, -2, 4, A, 3, 1, 0 ); // A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] @@ -139,18 +139,18 @@ ssyr.ndarray( 'upper', 3, 1.0, x, -2, 4, A, 3, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var ssyr = require( '@stdlib/blas/base/ssyr' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const ssyr = require( '@stdlib/blas/base/ssyr' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 3; +const N = 3; -var A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = ones( N*N, opts.dtype ); +const x = discreteUniform( N, -10.0, 10.0, opts ); ssyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); console.log( A ); diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/README.md b/lib/node_modules/@stdlib/blas/base/ssyr2/README.md index ec57dfc1c231..cf3d49500e3f 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/README.md +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssyr2 = require( '@stdlib/blas/base/ssyr2' ); +const ssyr2 = require( '@stdlib/blas/base/ssyr2' ); ``` #### ssyr2( order, uplo, N, α, x, sx, y, sy, A, LDA ) @@ -35,11 +35,11 @@ var ssyr2 = require( '@stdlib/blas/base/ssyr2' ); Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 ); // A => [ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ] @@ -61,11 +61,11 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr2( 'row-major', 'upper', 3, 1.0, x, 2, y, 1, A, 3 ); // A => [ 3.0, 7.0, 11.0, 0.0, 13.0, 21.0, 0.0, 0.0, 31.0 ] @@ -76,16 +76,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 1.0, 1.0, 1.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float32Array( [ 0.0, 1.0, 1.0, 1.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element ssyr2( 'row-major', 'upper', 3, 1.0, x1, 1, y1, 1, A, 3 ); // A => [ 3.0, 5.0, 7.0, 0.0, 5.0, 7.0, 0.0, 0.0, 7.0 ] @@ -96,11 +96,11 @@ ssyr2( 'row-major', 'upper', 3, 1.0, x1, 1, y1, 1, A, 3 ); Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr2.ndarray( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // A => [ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ] @@ -117,11 +117,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); ssyr2.ndarray( 'upper', 3, 1.0, x, -2, 4, y, 1, 0, A, 3, 1, 0 ); // A => [ 11.0, 15.0, 19.0, 0.0, 13.0, 13.0, 0.0, 0.0, 7.0 ] @@ -148,19 +148,19 @@ ssyr2.ndarray( 'upper', 3, 1.0, x, -2, 4, y, 1, 0, A, 3, 1, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var ssyr2 = require( '@stdlib/blas/base/ssyr2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ones = require( '@stdlib/array/ones' ); +const ssyr2 = require( '@stdlib/blas/base/ssyr2' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 3; +const N = 3; -var A = ones( N*N, opts.dtype ); -var x = discreteUniform( N, -10.0, 10.0, opts ); -var y = discreteUniform( N, -10.0, 10.0, opts ); +const A = ones( N*N, opts.dtype ); +const x = discreteUniform( N, -10.0, 10.0, opts ); +const y = discreteUniform( N, -10.0, 10.0, opts ); ssyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 ); console.log( A ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 0f88ca758b80..86d9fb96ddf1 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var strmv = require( '@stdlib/blas/base/strmv' ); +const strmv = require( '@stdlib/blas/base/strmv' ); ``` #### strmv( order, uplo, trans, diag, N, A, LDA, x, sx ) @@ -35,10 +35,10 @@ var strmv = require( '@stdlib/blas/base/strmv' ); Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); // x => [ 14.0, 8.0, 3.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 1.0, 4.0, 10.0 ] @@ -73,14 +73,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] @@ -91,10 +91,10 @@ strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 14.0, 8.0, 3.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] @@ -140,17 +140,17 @@ strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var strmv = require( '@stdlib/blas/base/strmv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const strmv = require( '@stdlib/blas/base/strmv' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 5; +const N = 5; -var A = discreteUniform( N*N, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = discreteUniform( N*N, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); strmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/strsv/README.md b/lib/node_modules/@stdlib/blas/base/strsv/README.md index 35278437b1b9..d287ca89fda3 100644 --- a/lib/node_modules/@stdlib/blas/base/strsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strsv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var strsv = require( '@stdlib/blas/base/strsv' ); +const strsv = require( '@stdlib/blas/base/strsv' ); ``` #### strsv( order, uplo, trans, diag, N, A, LDA, x, sx ) @@ -35,10 +35,10 @@ var strsv = require( '@stdlib/blas/base/strsv' ); Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); // x => [ 0.0, -4.0, 3.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); strsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 3.0, -4.0, 0.0 ] @@ -73,14 +73,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element strsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 0.0, -1.0, 1.0 ] @@ -91,10 +91,10 @@ strsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); Solves one of the systems of equations `A*x = b` or `A^T*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); strsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 0.0, -4.0, 3.0 ] @@ -110,10 +110,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +const x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); strsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 3.0, -4.0, 0.0 ] @@ -141,17 +141,17 @@ strsv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var strsv = require( '@stdlib/blas/base/strsv' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const strsv = require( '@stdlib/blas/base/strsv' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var N = 5; +const N = 5; -var A = discreteUniform( N*N, -10.0, 10.0, opts ); -var x = discreteUniform( N, -10.0, 10.0, opts ); +const A = discreteUniform( N*N, -10.0, 10.0, opts ); +const x = discreteUniform( N, -10.0, 10.0, opts ); strsv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/transpose-operation-enum2str/README.md b/lib/node_modules/@stdlib/blas/base/transpose-operation-enum2str/README.md index 016dddcf3458..3366b46421cd 100644 --- a/lib/node_modules/@stdlib/blas/base/transpose-operation-enum2str/README.md +++ b/lib/node_modules/@stdlib/blas/base/transpose-operation-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/blas/base/transpose-operation-enum2str' ); +const enum2str = require( '@stdlib/blas/base/transpose-operation-enum2str' ); ``` #### enum2str( operation ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/blas/base/transpose-operation-enum2str' ); Returns the BLAS transpose operation string associated with a BLAS transpose operation enumeration constant. ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var v = str2enum( 'transpose' ); +const v = str2enum( 'transpose' ); // returns -var s = enum2str( v ); +const s = enum2str( v ); // returns 'transpose' ``` If unable to resolve a operation string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var enum2str = require( '@stdlib/blas/base/transpose-operation-enum2str' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const enum2str = require( '@stdlib/blas/base/transpose-operation-enum2str' ); -var str = enum2str( str2enum( 'transpose' ) ); +let str = enum2str( str2enum( 'transpose' ) ); // returns 'transpose' str = enum2str( str2enum( 'conjugate-transpose' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-enum/README.md b/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-enum/README.md index 32d3af0a7e07..1dc55e799fe9 100644 --- a/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); ``` #### resolve( operation ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); Returns the enumeration constant associated with a BLAS transpose operation value. ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var v = resolve( 'conjugate-transpose' ); +let v = resolve( 'conjugate-transpose' ); // returns v = resolve( str2enum( 'conjugate-transpose' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'conjugate-transpose' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); +const resolve = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); -var v = resolve( 'conjugate-transpose' ); +let v = resolve( 'conjugate-transpose' ); // returns v = resolve( 'transpose' ); diff --git a/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-str/README.md b/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-str/README.md index 6e89443edac7..2a5f43dbdd7d 100644 --- a/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-str/README.md +++ b/lib/node_modules/@stdlib/blas/base/transpose-operation-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); +const resolve = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); ``` #### resolve( operation ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); Returns the transpose operation string associated with a BLAS transpose operation value. ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var v = resolve( 'transpose' ); +let v = resolve( 'transpose' ); // returns 'transpose' v = resolve( str2enum( 'transpose' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'transpose' ) ); If unable to resolve a transpose operation string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var resolve = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const resolve = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); -var v = resolve( str2enum( 'transpose' ) ); +let v = resolve( str2enum( 'transpose' ) ); // returns 'transpose' v = resolve( str2enum( 'conjugate-transpose' ) ); diff --git a/lib/node_modules/@stdlib/blas/base/transpose-operation-str2enum/README.md b/lib/node_modules/@stdlib/blas/base/transpose-operation-str2enum/README.md index d747e261cd45..e0e665ce9f9f 100644 --- a/lib/node_modules/@stdlib/blas/base/transpose-operation-str2enum/README.md +++ b/lib/node_modules/@stdlib/blas/base/transpose-operation-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); ``` #### str2enum( operation ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); Returns the enumeration constant associated with a BLAS transpose operation. ```javascript -var v = str2enum( 'transpose' ); +const v = str2enum( 'transpose' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); +const str2enum = require( '@stdlib/blas/base/transpose-operation-str2enum' ); -var v = str2enum( 'transpose' ); +let v = str2enum( 'transpose' ); // returns v = str2enum( 'conjugate-transpose' ); diff --git a/lib/node_modules/@stdlib/blas/base/transpose-operations/README.md b/lib/node_modules/@stdlib/blas/base/transpose-operations/README.md index bd1ec759cff4..43c96452e6e2 100644 --- a/lib/node_modules/@stdlib/blas/base/transpose-operations/README.md +++ b/lib/node_modules/@stdlib/blas/base/transpose-operations/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var transposeOperations = require( '@stdlib/blas/base/transpose-operations' ); +const transposeOperations = require( '@stdlib/blas/base/transpose-operations' ); ``` #### transposeOperations() @@ -45,7 +45,7 @@ var transposeOperations = require( '@stdlib/blas/base/transpose-operations' ); Returns a list of BLAS transpose operations. ```javascript -var out = transposeOperations(); +const out = transposeOperations(); // e.g., returns [ 'no-transpose', 'transpose', 'conjugate-transpose' ] ``` @@ -76,12 +76,12 @@ The output array contains the following operations: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var transposeOperations = require( '@stdlib/blas/base/transpose-operations' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const transposeOperations = require( '@stdlib/blas/base/transpose-operations' ); -var isOp = contains( transposeOperations() ); +const isOp = contains( transposeOperations() ); -var bool = isOp( 'transpose' ); +let bool = isOp( 'transpose' ); // returns true bool = isOp( 'conjugate-transpose' ); diff --git a/lib/node_modules/@stdlib/blas/base/xerbla/README.md b/lib/node_modules/@stdlib/blas/base/xerbla/README.md index 4db790347b69..3bd7df388183 100644 --- a/lib/node_modules/@stdlib/blas/base/xerbla/README.md +++ b/lib/node_modules/@stdlib/blas/base/xerbla/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/blas/base/xerbla' ); +const headerDir = require( '@stdlib/blas/base/xerbla' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/blas/base/xerbla' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/blas/base/xerbla' ); +const headerDir = require( '@stdlib/blas/base/xerbla' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/blas/base/zaxpy/README.md b/lib/node_modules/@stdlib/blas/base/zaxpy/README.md index a1dafcfe789c..bc2a4694d213 100644 --- a/lib/node_modules/@stdlib/blas/base/zaxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/zaxpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zaxpy = require( '@stdlib/blas/base/zaxpy' ); +const zaxpy = require( '@stdlib/blas/base/zaxpy' ); ``` #### zaxpy( N, za, zx, strideX, zy, strideY ) @@ -35,24 +35,24 @@ var zaxpy = require( '@stdlib/blas/base/zaxpy' ); Scales values from `zx` by `za` and adds the result to `zy`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zaxpy( 3, za, zx, 1, zy, 1 ); -var z = zy.get( 0 ); +const z = zy.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns -1.0 -var im = imag( z ); +const im = imag( z ); // returns 7.0 ``` @@ -68,24 +68,24 @@ The function has the following parameters: The `N` and stride parameters determine how values from `zx` are scaled by `za` and added to `zy`. For example, to scale every other value in `zx` by `za` and add the result to every other value of `zy`, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zaxpy( 2, za, zx, 2, zy, 2 ); -var z = zy.get( 0 ); +const z = zy.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns -1.0 -var im = imag( z ); +const im = imag( z ); // returns 7.0 ``` @@ -94,32 +94,32 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Initial arrays... -var zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy0 = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy0 = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); // Define a scalar constant: -var za = new Complex128( 2.0, 2.0 ); +const za = new Complex128( 2.0, 2.0 ); // Create offset views... -var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var zy1 = new Complex128Array( zy0.buffer, zy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const zy1 = new Complex128Array( zy0.buffer, zy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Scales values of `zx0` by `za` starting from second index and add the result to `zy0` starting from third index... zaxpy( 2, za, zx1, 1, zy1, 1 ); -var z = zy0.get( 2 ); +const z = zy0.get( 2 ); // returns -var re = real( z ); +const re = real( z ); // returns -1.0 -var im = imag( z ); +const im = imag( z ); // returns 15.0 ``` @@ -128,24 +128,24 @@ var im = imag( z ); Scales values from `zx` by `za` and adds the result to `zy` using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zaxpy.ndarray( 3, za, zx, 1, 0, zy, 1, 0 ); -var z = zy.get( 0 ); +const z = zy.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns -1.0 -var im = imag( z ); +const im = imag( z ); // returns 7.0 ``` @@ -157,24 +157,24 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to scale values in the first input strided array starting from the second element and add the result to the second input array starting from the second element, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zaxpy.ndarray( 3, za, zx, 1, 1, zy, 1, 1 ); -var z = zy.get( 3 ); +const z = zy.get( 3 ); // returns -var re = real( z ); +const re = real( z ); // returns -1.0 -var im = imag( z ); +const im = imag( z ); // returns 31.0 ``` @@ -200,23 +200,23 @@ var im = imag( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zcopy = require( '@stdlib/blas/base/zcopy' ); -var zeros = require( '@stdlib/array/zeros' ); -var logEach = require( '@stdlib/console/log-each' ); -var zaxpy = require( '@stdlib/blas/base/zaxpy' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zcopy = require( '@stdlib/blas/base/zcopy' ); +const zeros = require( '@stdlib/array/zeros' ); +const logEach = require( '@stdlib/console/log-each' ); +const zaxpy = require( '@stdlib/blas/base/zaxpy' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var zx = filledarrayBy( 10, 'complex128', rand ); -var zy = filledarrayBy( 10, 'complex128', rand ); -var zyc = zcopy( zy.length, zy, 1, zeros( zy.length, 'complex128' ), 1 ); +const zx = filledarrayBy( 10, 'complex128', rand ); +const zy = filledarrayBy( 10, 'complex128', rand ); +const zyc = zcopy( zy.length, zy, 1, zeros( zy.length, 'complex128' ), 1 ); -var za = new Complex128( 2.0, 2.0 ); +const za = new Complex128( 2.0, 2.0 ); // Scale values from `zx` by `za` and add the result to `zy`: zaxpy( zx.length, za, zx, 1, zy, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/zcopy/README.md b/lib/node_modules/@stdlib/blas/base/zcopy/README.md index c1d154585339..5c6e6b70270f 100644 --- a/lib/node_modules/@stdlib/blas/base/zcopy/README.md +++ b/lib/node_modules/@stdlib/blas/base/zcopy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zcopy = require( '@stdlib/blas/base/zcopy' ); +const zcopy = require( '@stdlib/blas/base/zcopy' ); ``` #### zcopy( N, x, strideX, y, strideY ) @@ -35,22 +35,22 @@ var zcopy = require( '@stdlib/blas/base/zcopy' ); Copies values from `x` into `y`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zcopy( x.length, x, 1, y, 1 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 1.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 ``` @@ -65,22 +65,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zcopy( 2, x, -2, y, 1 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 5.0 -var im = imag( z ); +const im = imag( z ); // returns 6.0 ``` @@ -89,28 +89,28 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Initial arrays... -var x0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Copy in reverse order every other value from `x1` into `y1`... zcopy( 2, x1, -2, y1, 1 ); -var z = y0.get( 2 ); +const z = y0.get( 2 ); // returns -var re = real( z ); +const re = real( z ); // returns 7.0 -var im = imag( z ); +const im = imag( z ); // returns 8.0 ``` @@ -119,22 +119,22 @@ var im = imag( z ); Copies values from `x` into `y` using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zcopy.ndarray( x.length, x, 1, 0, y, 1, 0 ); -var z = y.get( 0 ); +const z = y.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 1.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 ``` @@ -146,22 +146,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,..., ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zcopy.ndarray( 2, x, 2, 1, y, -1, y.length-1 ); -var z = y.get( y.length-1 ); +const z = y.get( y.length-1 ); // returns -var re = real( z ); +const re = real( z ); // returns 3.0 -var im = imag( z ); +const im = imag( z ); // returns 4.0 ``` @@ -187,19 +187,19 @@ var im = imag( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zcopy = require( '@stdlib/blas/base/zcopy' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zcopy = require( '@stdlib/blas/base/zcopy' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var x = filledarrayBy( 10, 'complex128', rand ); +const x = filledarrayBy( 10, 'complex128', rand ); console.log( x.get( 0 ).toString() ); -var y = filledarrayBy( 10, 'complex128', rand ); +const y = filledarrayBy( 10, 'complex128', rand ); console.log( y.get( 0 ).toString() ); // Copy elements from `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/base/zdrot/README.md b/lib/node_modules/@stdlib/blas/base/zdrot/README.md index 465a2c1af975..44903a00fe7f 100644 --- a/lib/node_modules/@stdlib/blas/base/zdrot/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdrot/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zdrot = require( '@stdlib/blas/base/zdrot' ); +const zdrot = require( '@stdlib/blas/base/zdrot' ); ``` #### zdrot( N, zx, strideX, zy, strideY, c, s ) @@ -35,22 +35,22 @@ var zdrot = require( '@stdlib/blas/base/zdrot' ); Applies a plane rotation. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zdrot( zx.length, zx, 1, zy, 1, 0.8, 0.6 ); -var z = zy.get( 0 ); +let z = zy.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns ~-0.6 -var im = imag( z ); +let im = imag( z ); // returns ~-1.2 z = zx.get( 0 ); @@ -74,22 +74,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `zx` and `zy` are accessed at runtime. For example, to apply a plane rotation to every other element, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zdrot( 2, zx, 2, zy, 2, 0.8, 0.6 ); -var z = zy.get( 0 ); +let z = zy.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns ~-0.6 -var im = imag( z ); +let im = imag( z ); // returns ~-1.2 z = zx.get( 0 ); @@ -107,27 +107,27 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Initial arrays... -var zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var zy1 = new Complex128Array( zy0.buffer, zy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const zy1 = new Complex128Array( zy0.buffer, zy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element zdrot( 2, zx1, -2, zy1, 1, 0.8, 0.6 ); -var z = zy0.get( 2 ); +let z = zy0.get( 2 ); // returns -var re = real( z ); +let re = real( z ); // returns ~-4.2 -var im = imag( z ); +let im = imag( z ); // returns ~-4.8 z = zx0.get( 3 ); @@ -145,22 +145,22 @@ im = imag( z ); Applies a plane rotation using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zdrot.ndarray( zx.length, zx, 1, 0, zy, 1, 0, 0.8, 0.6 ); -var z = zy.get( 0 ); +let z = zy.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns ~-0.6 -var im = imag( z ); +let im = imag( z ); // returns ~-1.2 z = zx.get( 0 ); @@ -181,22 +181,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to apply a plane rotation to every other element starting from the second element, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zy = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zdrot.ndarray( 2, zx, 2, 1, zy, 2, 1, 0.8, 0.6 ); -var z = zy.get( 3 ); +let z = zy.get( 3 ); // returns -var re = real( z ); +let re = real( z ); // returns ~-4.2 -var im = imag( z ); +let im = imag( z ); // returns ~-4.8 z = zx.get( 1 ); @@ -231,24 +231,24 @@ im = imag( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zcopy = require( '@stdlib/blas/base/zcopy' ); -var zeros = require( '@stdlib/array/zeros' ); -var logEach = require( '@stdlib/console/log-each' ); -var zdrot = require( '@stdlib/blas/base/zdrot' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zcopy = require( '@stdlib/blas/base/zcopy' ); +const zeros = require( '@stdlib/array/zeros' ); +const logEach = require( '@stdlib/console/log-each' ); +const zdrot = require( '@stdlib/blas/base/zdrot' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } // Generate random input arrays: -var zx = filledarrayBy( 10, 'complex128', rand ); -var zxc = zcopy( zx.length, zx, 1, zeros( zx.length, 'complex128' ), 1 ); +const zx = filledarrayBy( 10, 'complex128', rand ); +const zxc = zcopy( zx.length, zx, 1, zeros( zx.length, 'complex128' ), 1 ); -var zy = filledarrayBy( 10, 'complex128', rand ); -var zyc = zcopy( zy.length, zy, 1, zeros( zy.length, 'complex128' ), 1 ); +const zy = filledarrayBy( 10, 'complex128', rand ); +const zyc = zcopy( zy.length, zy, 1, zeros( zy.length, 'complex128' ), 1 ); // Apply a plane rotation: zdrot( zx.length, zx, 1, zy, 1, 0.8, 0.6 ); diff --git a/lib/node_modules/@stdlib/blas/base/zscal/README.md b/lib/node_modules/@stdlib/blas/base/zscal/README.md index 79e88ad10d34..b4427c71a158 100644 --- a/lib/node_modules/@stdlib/blas/base/zscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zscal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zscal = require( '@stdlib/blas/base/zscal' ); +const zscal = require( '@stdlib/blas/base/zscal' ); ``` #### zscal( N, za, zx, strideX ) @@ -35,23 +35,23 @@ var zscal = require( '@stdlib/blas/base/zscal' ); Scales values from `zx` by `za`. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var za = new Complex128( 2.0, 0.0 ); +const zx = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const za = new Complex128( 2.0, 0.0 ); zscal( 3, za, zx, 1 ); -var z = zx.get( 0 ); +const z = zx.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 2.0 -var im = imag( z ); +const im = imag( z ); // returns 2.0 ``` @@ -65,23 +65,23 @@ The function has the following parameters: The `N` and stride parameters determine how values from `zx` are scaled by `za`. For example, to scale every other value in `zx` by `za`, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var za = new Complex128( 2.0, 0.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const za = new Complex128( 2.0, 0.0 ); zscal( 2, za, zx, 2 ); -var z = zx.get( 2 ); +const z = zx.get( 2 ); // returns -var re = real( z ); +const re = real( z ); // returns 10.0 -var im = imag( z ); +const im = imag( z ); // returns 12.0 ``` @@ -90,30 +90,30 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Initial array: -var zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Define a scalar constant: -var za = new Complex128( 2.0, 2.0 ); +const za = new Complex128( 2.0, 2.0 ); // Create an offset view: -var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Scales every other value from `zx1` by `za`... zscal( 3, za, zx1, 1 ); -var z = zx0.get( 1 ); +const z = zx0.get( 1 ); // returns -var re = real( z ); +const re = real( z ); // returns -2.0 -var im = imag( z ); +const im = imag( z ); // returns 14.0 ``` @@ -122,23 +122,23 @@ var im = imag( z ); Scales values from `zx` by `za` using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zscal.ndarray( 3, za, zx, 1, 0 ); -var z = zx.get( 0 ); +const z = zx.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns -2.0 -var im = imag( z ); +const im = imag( z ); // returns 6.0 ``` @@ -149,23 +149,23 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other value in the input strided array starting from the second element, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var za = new Complex128( 2.0, 2.0 ); +const zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const za = new Complex128( 2.0, 2.0 ); zscal.ndarray( 2, za, zx, 2, 1 ); -var z = zx.get( 3 ); +const z = zx.get( 3 ); // returns -var re = real( z ); +const re = real( z ); // returns -2.0 -var im = imag( z ); +const im = imag( z ); // returns 30.0 ``` @@ -191,19 +191,19 @@ var im = imag( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zscal = require( '@stdlib/blas/base/zscal' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zscal = require( '@stdlib/blas/base/zscal' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var zx = filledarrayBy( 10, 'complex128', rand ); +const zx = filledarrayBy( 10, 'complex128', rand ); console.log( zx.toString() ); -var za = new Complex128( 2.0, 2.0 ); +const za = new Complex128( 2.0, 2.0 ); console.log( za.toString() ); // Scales elements from `zx` by `za`: diff --git a/lib/node_modules/@stdlib/blas/base/zswap/README.md b/lib/node_modules/@stdlib/blas/base/zswap/README.md index 4b69e2b186cf..e11abbeccb1a 100644 --- a/lib/node_modules/@stdlib/blas/base/zswap/README.md +++ b/lib/node_modules/@stdlib/blas/base/zswap/README.md @@ -35,7 +35,7 @@ This BLAS level 1 routine interchanges complex double-precision floating-point v ## Usage ```javascript -var zswap = require( '@stdlib/blas/base/zswap' ); +const zswap = require( '@stdlib/blas/base/zswap' ); ``` #### zswap( N, x, strideX, y, strideY ) @@ -43,22 +43,22 @@ var zswap = require( '@stdlib/blas/base/zswap' ); Interchanges two complex double-precision floating-point vectors. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zswap( x.length, x, 1, y, 1 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 2.0 z = x.get( 0 ); @@ -82,22 +82,22 @@ The function has the following parameters: The `N` and stride parameters determine how values from `x` are interchanged with values from `y`. For example, to interchange in reverse order every other value in `x` into the first `N` elements of `y`, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zswap( 2, x, -2, y, 1 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 5.0 -var im = imag( z ); +let im = imag( z ); // returns 6.0 z = x.get( 0 ); @@ -115,28 +115,28 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Initial arrays... -var x0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Interchange in reverse order every other value from `x1` into `y1`... zswap( 2, x1, -2, y1, 1 ); -var z = y0.get( 2 ); +let z = y0.get( 2 ); // returns -var re = real( z ); +let re = real( z ); // returns 7.0 -var im = imag( z ); +let im = imag( z ); // returns 8.0 z = x0.get( 1 ); @@ -154,22 +154,22 @@ im = imag( z ); Interchanges two complex double-precision floating-point vectors using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); -var z = y.get( 0 ); +let z = y.get( 0 ); // returns -var re = real( z ); +let re = real( z ); // returns 1.0 -var im = imag( z ); +let im = imag( z ); // returns 2.0 z = x.get( 0 ); @@ -190,22 +190,22 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to interchange every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`, and so on, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const y = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); zswap.ndarray( 2, x, 2, 1, y, -1, y.length-1 ); -var z = y.get( y.length-1 ); +let z = y.get( y.length-1 ); // returns -var re = real( z ); +let re = real( z ); // returns 3.0 -var im = imag( z ); +let im = imag( z ); // returns 4.0 z = x.get( x.length-1 ); @@ -240,19 +240,19 @@ im = imag( z ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zswap = require( '@stdlib/blas/base/zswap' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zswap = require( '@stdlib/blas/base/zswap' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var x = filledarrayBy( 10, 'complex128', rand ); +const x = filledarrayBy( 10, 'complex128', rand ); console.log( x.get( 0 ).toString() ); -var y = filledarrayBy( 10, 'complex128', rand ); +const y = filledarrayBy( 10, 'complex128', rand ); console.log( y.get( 0 ).toString() ); // Swap elements in `x` into `y` starting from the end of `y`: diff --git a/lib/node_modules/@stdlib/blas/ddot/README.md b/lib/node_modules/@stdlib/blas/ddot/README.md index 122e0de701de..41b47e4b2fd7 100644 --- a/lib/node_modules/@stdlib/blas/ddot/README.md +++ b/lib/node_modules/@stdlib/blas/ddot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var ddot = require( '@stdlib/blas/ddot' ); +const ddot = require( '@stdlib/blas/ddot' ); ``` #### ddot( x, y\[, dim] ) @@ -56,16 +56,16 @@ var ddot = require( '@stdlib/blas/ddot' ); Calculates the dot product of two double-precision floating-point vectors `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); -var z = ddot( x, y ); +const z = ddot( x, y ); // returns -var v = z.get(); +const v = z.get(); // returns -5.0 ``` @@ -78,22 +78,22 @@ The function has the following parameters: If provided at least one input [`ndarray`][@stdlib/ndarray/ctor] having more than one dimension, the input [`ndarrays`][@stdlib/ndarray/ctor] are [broadcasted][@stdlib/ndarray/base/broadcast-shapes] to a common shape. For multi-dimensional input [`ndarrays`][@stdlib/ndarray/ctor], the function performs batched computation, such that the function computes the dot product for each pair of vectors in `x` and `y` according to the specified dimension index. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'shape': [ 2, 3 ] }; -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); -var z = ddot( x, y ); +const z = ddot( x, y ); // returns -var v1 = z.get( 0 ); +const v1 = z.get( 0 ); // returns 23.0 -var v2 = z.get( 1 ); +const v2 = z.get( 1 ); // returns -22.0 ``` @@ -123,26 +123,26 @@ var v2 = z.get( 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var ddot = require( '@stdlib/blas/ddot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ddot = require( '@stdlib/blas/ddot' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = array( discreteUniform( 10, 0, 100, opts ), { +const x = array( discreteUniform( 10, 0, 100, opts ), { 'shape': [ 5, 2 ] }); console.log( ndarray2array( x ) ); -var y = array( discreteUniform( 10, 0, 10, opts ), { +const y = array( discreteUniform( 10, 0, 10, opts ), { 'shape': x.shape }); console.log( ndarray2array( y ) ); -var z = ddot( x, y, -1 ); +const z = ddot( x, y, -1 ); console.log( ndarray2array( z ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/dswap/README.md b/lib/node_modules/@stdlib/blas/dswap/README.md index e3c85222fde2..3361e673df4d 100644 --- a/lib/node_modules/@stdlib/blas/dswap/README.md +++ b/lib/node_modules/@stdlib/blas/dswap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dswap = require( '@stdlib/blas/dswap' ); +const dswap = require( '@stdlib/blas/dswap' ); ``` #### dswap( x, y\[, dim] ) @@ -41,18 +41,18 @@ var dswap = require( '@stdlib/blas/dswap' ); Interchanges two double-precision floating-point vectors `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); dswap( x, y ); -var xbuf = x.data; +const xbuf = x.data; // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ] -var ybuf = y.data; +const ybuf = y.data; // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ``` @@ -65,19 +65,19 @@ The function has the following parameters: For multi-dimensional input [`ndarrays`][@stdlib/ndarray/ctor], the function performs batched computation, such that the function interchanges each pair of vectors in `x` and `y` according to the specified dimension index. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'shape': [ 2, 3 ] }; -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); -var v1 = x.get( 0, 0 ); +let v1 = x.get( 0, 0 ); // returns 4.0 -var v2 = y.get( 0, 0 ); +let v2 = y.get( 0, 0 ); // returns 2.0 dswap( x, y ); @@ -113,21 +113,21 @@ v2 = y.get( 0, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var dswap = require( '@stdlib/blas/dswap' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const dswap = require( '@stdlib/blas/dswap' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = array( discreteUniform( 10, 0, 100, opts ), { +const x = array( discreteUniform( 10, 0, 100, opts ), { 'shape': [ 5, 2 ] }); console.log( ndarray2array( x ) ); -var y = array( discreteUniform( 10, 0, 10, opts ), { +const y = array( discreteUniform( 10, 0, 10, opts ), { 'shape': x.shape }); console.log( ndarray2array( y ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/README.md b/lib/node_modules/@stdlib/blas/ext/README.md index 062b9138a777..7708dd72d2e6 100644 --- a/lib/node_modules/@stdlib/blas/ext/README.md +++ b/lib/node_modules/@stdlib/blas/ext/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var extblas = require( '@stdlib/blas/ext' ); +const extblas = require( '@stdlib/blas/ext' ); ``` #### extblas @@ -35,7 +35,7 @@ var extblas = require( '@stdlib/blas/ext' ); Namespace for extended basic linear algebra subprograms (BLAS). ```javascript -var o = extblas; +const o = extblas; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/blas/ext' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/blas/ext' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/README.md b/lib/node_modules/@stdlib/blas/ext/base/README.md index 36fa121ff1b3..1bec0bbc7b94 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var extblas = require( '@stdlib/blas/ext/base' ); +const extblas = require( '@stdlib/blas/ext/base' ); ``` #### extblas @@ -35,7 +35,7 @@ var extblas = require( '@stdlib/blas/ext/base' ); Namespace for "base" (i.e., lower-level) extensions to basic linear algebra subprograms (BLAS). ```javascript -var ns = extblas; +const ns = extblas; // returns {...} ``` @@ -183,8 +183,8 @@ var ns = extblas; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/blas/ext/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/blas/ext/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/cfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/cfill/README.md index 625acb7c6509..572455b534ca 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/cfill/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cfill = require( '@stdlib/blas/ext/base/cfill' ); +const cfill = require( '@stdlib/blas/ext/base/cfill' ); ``` #### cfill( N, alpha, x, strideX ) @@ -35,26 +35,26 @@ var cfill = require( '@stdlib/blas/ext/base/cfill' ); Fills a single-precision complex floating-point strided array `x` with a specified scalar constant `alpha`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex64Array( arr ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( arr ); -var alpha = new Complex64( 10.0, 10.0 ); +const alpha = new Complex64( 10.0, 10.0 ); cfill( x.length, alpha, x, 1 ); -var y = x.get( 0 ); +const y = x.get( 0 ); // returns -var re = realf( y ); +const re = realf( y ); // returns 10.0 -var im = imagf( y ); +const im = imagf( y ); // returns 10.0 ``` @@ -68,26 +68,26 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex64Array( arr ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( arr ); -var alpha = new Complex64( 10.0, 10.0 ); +const alpha = new Complex64( 10.0, 10.0 ); cfill( 2, alpha, x, 2 ); -var y = x.get( 0 ); +let y = x.get( 0 ); // returns -var re = realf( y ); +let re = realf( y ); // returns 10.0 -var im = imagf( y ); +let im = imagf( y ); // returns 10.0 y = x.get( 1 ); @@ -103,34 +103,34 @@ im = imagf( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); // Create the underlying floating-point array: -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Initial array: -var x0 = new Complex64Array( arr ); +const x0 = new Complex64Array( arr ); // Create an offset view: -var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Define a scalar constant: -var alpha = new Complex64( 10.0, 10.0 ); +const alpha = new Complex64( 10.0, 10.0 ); // Fill every other element: cfill( 2, alpha, x1, 2 ); -var y = x0.get( 0 ); +let y = x0.get( 0 ); // returns -var re = realf( y ); +let re = realf( y ); // returns 1.0 -var im = imagf( y ); +let im = imagf( y ); // returns 2.0 y = x0.get( 1 ); @@ -148,26 +148,26 @@ im = imagf( y ); Fills a single-precision complex floating-point strided array `x` with a specified scalar constant `alpha` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex64Array( arr ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( arr ); -var alpha = new Complex64( 10.0, 10.0 ); +const alpha = new Complex64( 10.0, 10.0 ); cfill.ndarray( x.length, alpha, x, 1, 0 ); -var y = x.get( 0 ); +const y = x.get( 0 ); // returns -var re = realf( y ); +const re = realf( y ); // returns 10.0 -var im = imagf( y ); +const im = imagf( y ); // returns 10.0 ``` @@ -178,26 +178,26 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last two elements of the strided array: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Complex64Array( arr ); +const arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Complex64Array( arr ); -var alpha = new Complex64( 10.0, 10.0 ); +const alpha = new Complex64( 10.0, 10.0 ); cfill.ndarray( 2, alpha, x, 1, x.length-2 ); -var y = x.get( 0 ); +let y = x.get( 0 ); // returns -var re = realf( y ); +let re = realf( y ); // returns 1.0 -var im = imagf( y ); +let im = imagf( y ); // returns 2.0 y = x.get( 1 ); @@ -240,16 +240,16 @@ im = imagf( y ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cfill = require( '@stdlib/blas/ext/base/cfill' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cfill = require( '@stdlib/blas/ext/base/cfill' ); -var xbuf = discreteUniform( 20, -100, 100, { +const xbuf = discreteUniform( 20, -100, 100, { 'dtype': 'float32' }); -var x = new Complex64Array( xbuf.buffer ); -var alpha = new Complex64( 10.0, 10.0 ); +const x = new Complex64Array( xbuf.buffer ); +const alpha = new Complex64( 10.0, 10.0 ); cfill( x.length, alpha, x, 1 ); console.log( x.get( 0 ).toString() ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md index 5ded85e045b3..805eeba9794f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dapx = require( '@stdlib/blas/ext/base/dapx' ); +const dapx = require( '@stdlib/blas/ext/base/dapx' ); ``` #### dapx( N, alpha, x, strideX ) @@ -35,9 +35,9 @@ var dapx = require( '@stdlib/blas/ext/base/dapx' ); Adds a scalar constant to each element in a double-precision floating-point strided array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dapx( x.length, 5.0, x, 1 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dapx( 4, 5.0, x, 2 ); // x => [ 3.0, 1.0, 8.0, -5.0, 9.0, 0.0, 4.0, -3.0 ] @@ -64,13 +64,13 @@ dapx( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Add a constant to every other element... dapx( 3, 5.0, x1, 2 ); @@ -82,9 +82,9 @@ dapx( 3, 5.0, x1, 2 ); Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dapx.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dapx.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ] @@ -126,10 +126,10 @@ dapx.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapx = require( '@stdlib/blas/ext/base/dapx' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapx = require( '@stdlib/blas/ext/base/dapx' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/README.md index c43e4b08765f..8cf0bb0bf948 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); +const dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); ``` #### dapxsum( N, alpha, x, strideX ) @@ -41,11 +41,11 @@ var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsum( x.length, 5.0, x, 1 ); +const v = dapxsum( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dapxsum( 4, 5.0, x, 2 ); +const v = dapxsum( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dapxsum( 4, 5.0, x1, 2 ); +const v = dapxsum( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = dapxsum( 4, 5.0, x1, 2 ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsum.ndarray( x.length, 5.0, x, 1, 0 ); +const v = dapxsum.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dapxsum.ndarray( 4, 5.0, x, 2, 1 ); +const v = dapxsum.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,15 +130,15 @@ var v = dapxsum.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' } ); console.log( x ); -var v = dapxsum( x.length, 5.0, x, 1 ); +const v = dapxsum( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/README.md index 69b401b8368e..3b6f0ea5611f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); +const dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); ``` #### dapxsumkbn( N, alpha, x, strideX ) @@ -41,11 +41,11 @@ var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsumkbn( x.length, 5.0, x, 1 ); +const v = dapxsumkbn( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to access every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dapxsumkbn( 4, 5.0, x, 2 ); +const v = dapxsumkbn( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dapxsumkbn( 4, 5.0, x1, 2 ); +const v = dapxsumkbn( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = dapxsumkbn( 4, 5.0, x1, 2 ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsumkbn.ndarray( x.length, 5.0, x, 1, 0 ); +const v = dapxsumkbn.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); +const v = dapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,15 +130,15 @@ var v = dapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); -var v = dapxsumkbn( x.length, 5.0, x, 1 ); +const v = dapxsumkbn( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/README.md index ae0c23051299..f64b36140130 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); +const dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); ``` #### dapxsumkbn2( N, alpha, x, strideX ) @@ -41,11 +41,11 @@ var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsumkbn2( x.length, 5.0, x, 1 ); +const v = dapxsumkbn2( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dapxsumkbn2( 4, 5.0, x, 2 ); +const v = dapxsumkbn2( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dapxsumkbn2( 4, 5.0, x1, 2 ); +const v = dapxsumkbn2( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = dapxsumkbn2( 4, 5.0, x1, 2 ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dapxsumkbn2.ndarray( x.length, 5.0, x, 1, 0 ); +const v = dapxsumkbn2.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); +const v = dapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,15 +130,15 @@ var v = dapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); -var v = dapxsumkbn2( x.length, 5.0, x, 1 ); +const v = dapxsumkbn2( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/README.md index 90edfdb6e1c5..44a8a1568c96 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); +const dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); ``` #### dapxsumors( N, alpha, x, strideX ) @@ -41,12 +41,12 @@ var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dapxsumors( N, 5.0, x, 1 ); +const v = dapxsumors( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -60,11 +60,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dapxsumors( 4, 5.0, x, 2 ); +const v = dapxsumors( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -73,12 +73,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dapxsumors( 4, 5.0, x1, 2 ); +const v = dapxsumors( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -87,12 +87,12 @@ var v = dapxsumors( 4, 5.0, x1, 2 ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dapxsumors.ndarray( N, 5.0, x, 1, 0 ); +const v = dapxsumors.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -103,11 +103,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dapxsumors.ndarray( 4, 5.0, x, 2, 1 ); +const v = dapxsumors.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -133,15 +133,15 @@ var v = dapxsumors.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); -var v = dapxsumors( x.length, 5.0, x, 1 ); +const v = dapxsumors( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/README.md index 5afec4d99f15..04b78b0b062d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); +const dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); ``` #### dapxsumpw( N, alpha, x, strideX ) @@ -41,12 +41,12 @@ var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dapxsumpw( N, 5.0, x, 1 ); +const v = dapxsumpw( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dapxsumpw( 4, 5.0, x, 2 ); +const v = dapxsumpw( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dapxsumpw( 4, 5.0, x1, 2 ); +const v = dapxsumpw( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,12 +86,12 @@ var v = dapxsumpw( 4, 5.0, x1, 2 ); Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dapxsumpw.ndarray( N, 5.0, x, 1, 0 ); +const v = dapxsumpw.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); +const v = dapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,15 +131,15 @@ var v = dapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); -var v = dapxsumpw( x.length, 5.0, x, 1 ); +const v = dapxsumpw( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md index f53c75b157c6..53b59f3ebd72 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); +const dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); ``` #### dasumpw( N, x, strideX ) @@ -56,12 +56,12 @@ var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dasumpw( N, x, 1 ); +const v = dasumpw( N, x, 1 ); // returns 5.0 ``` @@ -74,11 +74,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dasumpw( 4, x, 2 ); +const v = dasumpw( 4, x, 2 ); // returns 9.0 ``` @@ -87,12 +87,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dasumpw( 4, x1, 2 ); +const v = dasumpw( 4, x1, 2 ); // returns 9.0 ``` @@ -101,12 +101,12 @@ var v = dasumpw( 4, x1, 2 ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dasumpw.ndarray( N, x, 1, 0 ); +const v = dasumpw.ndarray( N, x, 1, 0 ); // returns 5.0 ``` @@ -117,11 +117,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of absolute values of every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dasumpw.ndarray( 4, x, 2, 1 ); +const v = dasumpw.ndarray( 4, x, 2, 1 ); // returns 9.0 ``` @@ -147,15 +147,15 @@ var v = dasumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); -var v = dasumpw( x.length, x, 1 ); +const v = dasumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcusum/README.md index 74c504f7ee92..51d42fcb35d7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcusum = require( '@stdlib/blas/ext/base/dcusum' ); +const dcusum = require( '@stdlib/blas/ext/base/dcusum' ); ``` #### dcusum( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcusum = require( '@stdlib/blas/ext/base/dcusum' ); Computes the cumulative sum of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float64Array( x.length ); dcusum( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcusum( 4, 0.0, x, 2, y, 1 ); +const v = dcusum( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcusum( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ dcusum( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -148,14 +148,14 @@ dcusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcusum = require( '@stdlib/blas/ext/base/dcusum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcusum = require( '@stdlib/blas/ext/base/dcusum' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); -var y = new Float64Array( x.length ); +const y = new Float64Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md index 4bdd3b9084c5..7c0bcb87c74c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); +const dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); ``` #### dcusumkbn( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float64Array( x.length ); dcusumkbn( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcusumkbn( 4, 0.0, x, 2, y, 1 ); +const v = dcusumkbn( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcusumkbn( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ dcusumkbn( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcusumkbn.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcusumkbn.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -148,14 +148,14 @@ dcusumkbn.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); -var y = new Float64Array( x.length ); +const y = new Float64Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md index 60925aa656d9..c3f082756ae9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); +const dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); ``` #### dcusumkbn2( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float64Array( x.length ); dcusumkbn2( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,14 +68,14 @@ The function has the following parameters: The `N` and stride parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var N = 4; +const N = 4; -var v = dcusumkbn2( N, 0.0, x, 2, y, 1 ); +const v = dcusumkbn2( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -84,17 +84,17 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = 4; +const N = 4; dcusumkbn2( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -105,10 +105,10 @@ dcusumkbn2( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcusumkbn2.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -122,12 +122,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); -var N = 4; +const N = 4; dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -154,14 +154,14 @@ dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); -var y = new Float64Array( x.length ); +const y = new Float64Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md index 525d7a93482c..cf38cb40c973 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); +const dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); ``` #### dcusumors( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float64Array( x.length ); dcusumors( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcusumors( 4, 0.0, x, 2, y, 1 ); +const v = dcusumors( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcusumors( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ dcusumors( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcusumors.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -149,14 +149,14 @@ dcusumors.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); -var y = new Float64Array( x.length ); +const y = new Float64Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/README.md index c5f2098bd117..fdce5795c9d2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); +const dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); ``` #### dcusumpw( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float64Array( x.length ); dcusumpw( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcusumpw( 4, 0.0, x, 2, y, 1 ); +const v = dcusumpw( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcusumpw( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ dcusumpw( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcusumpw.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcusumpw.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -149,14 +149,14 @@ dcusumpw.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); -var y = new Float64Array( x.length ); +const y = new Float64Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md index 58669f28d7b7..7a42b2723790 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dfill = require( '@stdlib/blas/ext/base/dfill' ); +const dfill = require( '@stdlib/blas/ext/base/dfill' ); ``` #### dfill( N, alpha, x, strideX ) @@ -35,9 +35,9 @@ var dfill = require( '@stdlib/blas/ext/base/dfill' ); Fills a double-precision floating-point strided array `x` with a specified scalar constant `alpha`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dfill( x.length, 5.0, x, 1 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dfill( 4, 5.0, x, 2 ); // x => [ 5.0, 1.0, 5.0, -5.0, 5.0, 0.0, 5.0, -3.0 ] @@ -64,13 +64,13 @@ dfill( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill every other element... dfill( 3, 5.0, x1, 2 ); @@ -82,9 +82,9 @@ dfill( 3, 5.0, x1, 2 ); Fills a double-precision floating-point strided array `x` with a specified scalar constant `alpha` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); dfill.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dfill.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ] @@ -126,10 +126,10 @@ dfill.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dfill = require( '@stdlib/blas/ext/base/dfill' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dfill = require( '@stdlib/blas/ext/base/dfill' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/README.md index 4dc05bcc22a0..9e6cd71b07d3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); +const dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); ``` #### dnanasum( N, x, strideX ) @@ -56,12 +56,12 @@ var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanasum( N, x, 1 ); +const v = dnanasum( N, x, 1 ); // returns 5.0 ``` @@ -74,11 +74,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) for every other element in the strided array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnanasum( 4, x, 2 ); +const v = dnanasum( 4, x, 2 ); // returns 5.0 ``` @@ -87,12 +87,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnanasum( 4, x1, 2 ); +const v = dnanasum( 4, x1, 2 ); // returns 9.0 ``` @@ -101,11 +101,11 @@ var v = dnanasum( 4, x1, 2 ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanasum.ndarray( 4, x, 1, 0 ); +const v = dnanasum.ndarray( 4, x, 1, 0 ); // returns 5.0 ``` @@ -116,11 +116,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of absolute values ([_L1_ norm][l1norm]) for every other value in the strided array starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnanasum.ndarray( 4, x, 2, 1 ); +const v = dnanasum.ndarray( 4, x, 2, 1 ); // returns 9.0 ``` @@ -145,11 +145,11 @@ var v = dnanasum.ndarray( 4, x, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -158,10 +158,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var v = dnanasum( x.length, x, 1 ); +const v = dnanasum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/README.md index 522eb711cad6..47929643ab2c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' ); +const dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' ); ``` #### dnanasumors( N, x, strideX ) @@ -56,12 +56,12 @@ var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanasumors( N, x, 1 ); +const v = dnanasumors( N, x, 1 ); // returns 5.0 ``` @@ -74,11 +74,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) for every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnanasumors( 4, x, 2 ); +const v = dnanasumors( 4, x, 2 ); // returns 5.0 ``` @@ -87,12 +87,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnanasumors( 4, x1, 2 ); +const v = dnanasumors( 4, x1, 2 ); // returns 9.0 ``` @@ -101,12 +101,12 @@ var v = dnanasumors( 4, x1, 2 ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanasumors.ndarray( N, x, 1, 0 ); +const v = dnanasumors.ndarray( N, x, 1, 0 ); // returns 5.0 ``` @@ -117,11 +117,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of absolute values ([_L1_ norm][l1norm]) for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnanasumors.ndarray( 4, x, 2, 1 ); +const v = dnanasumors.ndarray( 4, x, 2, 1 ); // returns 9.0 ``` @@ -147,10 +147,10 @@ var v = dnanasumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' ); function rand() { if ( bernoulli( 0.5 ) < 0.2 ) { @@ -159,10 +159,10 @@ function rand() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var v = dnanasumors( x.length, x, 1 ); +const v = dnanasumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/README.md index 4ce929b28943..5c0e23b124d9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' ); +const dnannsum = require( '@stdlib/blas/ext/base/dnannsum' ); ``` #### dnannsum( N, x, strideX, out, strideOut ) @@ -41,12 +41,12 @@ var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsum( x.length, x, 1, out, 1 ); +const v = dnannsum( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsum( 4, x, 2, out, 1 ); +const v = dnannsum( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dnannsum( 4, x1, 2, out1, 1 ); +const v = dnannsum( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -92,12 +92,12 @@ var v = dnannsum( 4, x1, 2, out1, 1 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsum.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dnannsum.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dnannsum.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dnannsum.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -139,11 +139,11 @@ var v = dnannsum.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnannsum = require( '@stdlib/blas/ext/base/dnannsum' ); function rand() { if ( bernoulli( 0.7 ) > 0 ) { @@ -152,10 +152,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dnannsum( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/README.md index c039427b8926..00b3491fbf03 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' ); +const dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' ); ``` #### dnannsumkbn( N, x, strideX, out, strideOut ) @@ -41,12 +41,12 @@ var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn( x.length, x, 1, out, 1 ); +const v = dnannsumkbn( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn( 4, x, 2, out, 1 ); +const v = dnannsumkbn( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dnannsumkbn( 4, x1, 2, out1, 1 ); +const v = dnannsumkbn( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -92,12 +92,12 @@ var v = dnannsumkbn( 4, x1, 2, out1, 1 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dnannsumkbn.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dnannsumkbn.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dnannsumkbn.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -139,11 +139,11 @@ var v = dnannsumkbn.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -152,10 +152,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dnannsumkbn( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/README.md index 68c79111bbcb..b50af3f1fe9e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' ); +const dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' ); ``` #### dnannsumkbn2( N, x, strideX, out, strideOut ) @@ -41,12 +41,12 @@ var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn2( x.length, x, 1, out, 1 ); +const v = dnannsumkbn2( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn2( 4, x, 2, out, 1 ); +const v = dnannsumkbn2( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dnannsumkbn2( 4, x1, 2, out1, 1 ); +const v = dnannsumkbn2( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -92,12 +92,12 @@ var v = dnannsumkbn2( 4, x1, 2, out1, 1 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumkbn2.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dnannsumkbn2.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dnannsumkbn2.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dnannsumkbn2.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -139,11 +139,11 @@ var v = dnannsumkbn2.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -152,10 +152,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dnannsumkbn2( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md index e257809e34d9..95a9b18e0442 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); +const dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); ``` #### dnannsumors( N, x, strideX, out, strideOut ) @@ -41,12 +41,12 @@ var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumors( x.length, x, 1, out, 1 ); +const v = dnannsumors( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumors( 4, x, 2, out, 1 ); +const v = dnannsumors( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dnannsumors( 4, x1, 2, out1, 1 ); +const v = dnannsumors( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -92,12 +92,12 @@ var v = dnannsumors( 4, x1, 2, out1, 1 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -140,12 +140,12 @@ var v = dnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var Float64Array = require( '@stdlib/array/float64' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const Float64Array = require( '@stdlib/array/float64' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -154,10 +154,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dnannsumors( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/README.md index 98bed025a670..85b13987bc76 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' ); +const dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' ); ``` #### dnannsumpw( N, x, strideX, out, strideOut ) @@ -41,12 +41,12 @@ var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumpw( x.length, x, 1, out, 1 ); +const v = dnannsumpw( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumpw( 4, x, 2, out, 1 ); +const v = dnannsumpw( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dnannsumpw( 4, x1, 2, out1, 1 ); +const v = dnannsumpw( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -92,12 +92,12 @@ var v = dnannsumpw( 4, x1, 2, out1, 1 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dnannsumpw.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dnannsumpw.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,12 +109,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dnannsumpw.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dnannsumpw.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -140,11 +140,11 @@ var v = dnannsumpw.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -153,10 +153,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dnannsumpw( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnansum/README.md index 1f73db2bc340..161a0fa1a313 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnansum = require( '@stdlib/blas/ext/base/dnansum' ); +const dnansum = require( '@stdlib/blas/ext/base/dnansum' ); ``` #### dnansum( N, x, strideX ) @@ -41,11 +41,11 @@ var dnansum = require( '@stdlib/blas/ext/base/dnansum' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansum( x.length, x, 1 ); +const v = dnansum( x.length, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnansum( 4, x, 2 ); +const v = dnansum( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnansum( 4, x1, 2 ); +const v = dnansum( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dnansum( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansum.ndarray( x.length, x, 1, 0 ); +const v = dnansum.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnansum.ndarray( 4, x, 2, 1 ); +const v = dnansum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,11 +129,11 @@ var v = dnansum.ndarray( 4, x, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnansum = require( '@stdlib/blas/ext/base/dnansum' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnansum = require( '@stdlib/blas/ext/base/dnansum' ); function clbk() { if ( bernoulli( 0.7 ) > 0 ) { @@ -142,10 +142,10 @@ function clbk() { return NaN; } -var x = filledarrayBy( 10, 'float64', clbk ); +const x = filledarrayBy( 10, 'float64', clbk ); console.log( x ); -var v = dnansum( x.length, x, 1 ); +const v = dnansum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/README.md index 72adc940aa20..2ffaa6fac963 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); +const dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); ``` #### dnansumkbn( N, x, strideX ) @@ -41,11 +41,11 @@ var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumkbn( x.length, x, 1 ); +const v = dnansumkbn( x.length, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnansumkbn( 4, x, 2 ); +const v = dnansumkbn( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnansumkbn( 4, x1, 2 ); +const v = dnansumkbn( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dnansumkbn( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumkbn.ndarray( x.length, x, 1, 0 ); +const v = dnansumkbn.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnansumkbn.ndarray( 4, x, 2, 1 ); +const v = dnansumkbn.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,10 +129,10 @@ var v = dnansumkbn.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); function clbk() { if ( bernoulli( 0.7 ) > 0 ) { @@ -141,10 +141,10 @@ function clbk() { return NaN; } -var x = filledarrayBy( 10, 'float64', clbk ); +const x = filledarrayBy( 10, 'float64', clbk ); console.log( x ); -var v = dnansumkbn( x.length, x, 1 ); +const v = dnansumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn2/README.md index 02286e1ed561..6dc2db2803b4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); +const dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); ``` #### dnansumkbn2( N, x, strideX ) @@ -41,11 +41,11 @@ var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumkbn2( x.length, x, 1 ); +const v = dnansumkbn2( x.length, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnansumkbn2( 4, x, 2 ); +const v = dnansumkbn2( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnansumkbn2( 4, x1, 2 ); +const v = dnansumkbn2( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dnansumkbn2( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumkbn2.ndarray( x.length, x, 1, 0 ); +const v = dnansumkbn2.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnansumkbn2.ndarray( 4, x, 2, 1 ); +const v = dnansumkbn2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,10 +129,10 @@ var v = dnansumkbn2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); function clbk() { if ( bernoulli( 0.7 ) > 0 ) { @@ -141,10 +141,10 @@ function clbk() { return NaN; } -var x = filledarrayBy( 10, 'float64', clbk ); +const x = filledarrayBy( 10, 'float64', clbk ); console.log( x ); -var v = dnansumkbn2( x.length, x, 1 ); +const v = dnansumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnansumors/README.md index 7be8b6679272..6b8ef28ab5a8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); +const dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); ``` #### dnansumors( N, x, strideX ) @@ -41,11 +41,11 @@ var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumors( x.length, x, 1 ); +const v = dnansumors( x.length, x, 1 ); // returns 1.0 ``` @@ -58,12 +58,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnansumors( 4, x, 2 ); +const v = dnansumors( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnansumors( 4, x1, 2 ); +const v = dnansumors( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dnansumors( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumors.ndarray( x.length, x, 1, 0 ); +const v = dnansumors.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other element starting from the second element, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnansumors.ndarray( 4, x, 2, 1 ); +const v = dnansumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,10 +131,10 @@ var v = dnansumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); function rand() { if ( bernoulli( 0.7 ) > 0 ) { @@ -143,10 +143,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var v = dnansumors( x.length, x, 1 ); +const v = dnansumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnansumpw/README.md index 5da44e732b3f..cae237b715fd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); +const dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); ``` #### dnansumpw( N, x, strideX ) @@ -41,11 +41,11 @@ var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumpw( x.length, x, 1 ); +const v = dnansumpw( x.length, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dnansumpw( 4, x, 2 ); +const v = dnansumpw( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnansumpw( 4, x1, 2 ); +const v = dnansumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dnansumpw( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnansumpw.ndarray( x.length, x, 1, 0 ); +const v = dnansumpw.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dnansumpw.ndarray( 4, x, 2, 1 ); +const v = dnansumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,10 +130,10 @@ var v = dnansumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); function rand() { if ( bernoulli( 0.7 ) > 0 ) { @@ -142,10 +142,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float64', rand ); +const x = filledarrayBy( 10, 'float64', rand ); console.log( x ); -var v = dnansumpw( x.length, x, 1 ); +const v = dnansumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/README.md b/lib/node_modules/@stdlib/blas/ext/base/drev/README.md index 3db61e54cde1..ae07e5f43b93 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var drev = require( '@stdlib/blas/ext/base/drev' ); +const drev = require( '@stdlib/blas/ext/base/drev' ); ``` #### drev( N, x, strideX ) @@ -35,9 +35,9 @@ var drev = require( '@stdlib/blas/ext/base/drev' ); Reverses a double-precision floating-point strided array `x` in-place. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); drev( x.length, x, 1 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -52,9 +52,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to reverse every other element: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); drev( 4, x, 2 ); // x => [ -1.0, 1.0, 4.0, -5.0, 3.0, 0.0, -2.0, -3.0 ] @@ -63,13 +63,13 @@ drev( 4, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Reverse every other element... drev( 3, x1, 2 ); @@ -81,9 +81,9 @@ drev( 3, x1, 2 ); Reverses a double-precision floating-point strided array `x` in-place using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); drev.ndarray( x.length, x, 1, 0 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -96,9 +96,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array: ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); drev.ndarray( 3, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ] @@ -126,10 +126,10 @@ drev.ndarray( 3, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var drev = require( '@stdlib/blas/ext/base/drev' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const drev = require( '@stdlib/blas/ext/base/drev' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/README.md index 84f8643b1c2d..f25f6b096b53 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); +const dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); ``` #### dsapxsum( N, alpha, x, strideX ) @@ -41,11 +41,11 @@ var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); Adds a scalar constant to each single-precision floating-point strided array element, and computes the sum using extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsapxsum( x.length, 5.0, x, 1 ); +const v = dsapxsum( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsapxsum( 4, 5.0, x, 2 ); +const v = dsapxsum( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsapxsum( 4, 5.0, x1, 2 ); +const v = dsapxsum( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = dsapxsum( 4, 5.0, x1, 2 ); Adds a scalar constant to each single-precision floating-point strided array element, and computes the sum using extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsapxsum.ndarray( x.length, 5.0, x, 1, 0 ); +const v = dsapxsum.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other element starting from the second element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsapxsum.ndarray( 4, 5.0, x, 2, 1 ); +const v = dsapxsum.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,15 +131,15 @@ var v = dsapxsum.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); -var x = discreteUniform( 10.0, -100, 100, { +const x = discreteUniform( 10.0, -100, 100, { 'dtype': 'float32' }); console.log( x ); -var v = dsapxsum( x.length, 5.0, x, 1 ); +const v = dsapxsum( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/README.md index 5157f89aae5d..4c9b22ee4246 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); +const dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); ``` #### dsapxsumpw( N, alpha, x, strideX ) @@ -41,11 +41,11 @@ var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsapxsumpw( x.length, 5.0, x, 1 ); +const v = dsapxsumpw( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsapxsumpw( 4, 5.0, x, 2 ); +const v = dsapxsumpw( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsapxsumpw( 4, 5.0, x1, 2 ); +const v = dsapxsumpw( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = dsapxsumpw( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsapxsumpw.ndarray( x.length, 5.0, x, 1, 0 ); +const v = dsapxsumpw.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access every other element starting from the second element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); +const v = dsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,15 +131,15 @@ var v = dsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); -var x = discreteUniform( 10.0, -100, 100, { +const x = discreteUniform( 10.0, -100, 100, { 'dtype': 'float32' }); console.log( x ); -var v = dsapxsumpw( x.length, 5.0, x, 1 ); +const v = dsapxsumpw( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/README.md index d81e533a1d82..122a51729c3e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); +const dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); ``` #### dsnannsumors( N, x, strideX, out, strideOut ) @@ -41,13 +41,13 @@ var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dsnannsumors( x.length, x, 1, out, 1 ); +const v = dsnannsumors( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -62,13 +62,13 @@ The function has the following parameters: The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dsnannsumors( 4, x, 2, out, 1 ); +const v = dsnannsumors( 4, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -77,16 +77,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var v = dsnannsumors( 4, x1, 2, out1, 1 ); +const v = dsnannsumors( 4, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -95,13 +95,13 @@ var v = dsnannsumors( 4, x1, 2, out1, 1 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation and alternative indexing semantics, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -113,13 +113,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element: ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); -var v = dsnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); +const v = dsnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -145,12 +145,12 @@ var v = dsnannsumors.ndarray( 4, x, 2, 1, out, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); function rand() { if ( bernoulli( 0.5 ) < 0.2 ) { @@ -159,10 +159,10 @@ function rand() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dsnannsumors( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsnansum/README.md index 02aa7a51da40..d88ddaa226ba 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); +const dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); ``` #### dsnansum( N, x, stride ) @@ -41,12 +41,12 @@ var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnansum( N, x, 1 ); +const v = dsnansum( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dsnansum( 4, x, 2 ); +const v = dsnansum( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsnansum( 4, x1, 2 ); +const v = dsnansum( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dsnansum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dsnansum.ndarray( 4, x, 1, 0 ); +const v = dsnansum.ndarray( 4, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsnansum.ndarray( 4, x, 2, 1 ); +const v = dsnansum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,10 +131,10 @@ var v = dsnansum.ndarray( 4, x, 2, 1 ); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); function clbk() { if ( bernoulli( 0.7 ) > 0 ) { @@ -143,10 +143,10 @@ function clbk() { return NaN; } -var x = filledarrayBy( 10, 'float64', clbk ); +const x = filledarrayBy( 10, 'float64', clbk ); console.log( x ); -var v = dsnansum( x.length, x, 1 ); +const v = dsnansum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/README.md index 477f900f3292..4b68cf899354 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); +const dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); ``` #### dsnansumors( N, x, stride ) @@ -41,12 +41,12 @@ var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnansumors( N, x, 1 ); +const v = dsnansumors( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dsnansumors( 4, x, 2 ); +const v = dsnansumors( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsnansumors( 4, x1, 2 ); +const v = dsnansumors( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dsnansumors( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dsnansumors.ndarray( 4, x, 1, 0 ); +const v = dsnansumors.ndarray( 4, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsnansumors.ndarray( 4, x, 2, 1 ); +const v = dsnansumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,10 +131,10 @@ var v = dsnansumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -143,10 +143,10 @@ function rand() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = dsnansumors( x.length, x, 1 ); +const v = dsnansumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/README.md index 211463dfa10b..04929306029e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); +const dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); ``` #### dsnansumpw( N, x, stride ) @@ -41,12 +41,12 @@ var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnansumpw( N, x, 1 ); +const v = dsnansumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = dsnansumpw( 4, x, 2 ); +const v = dsnansumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsnansumpw( 4, x1, 2 ); +const v = dsnansumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = dsnansumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnansumpw.ndarray( N, x, 1, 0 ); +const v = dsnansumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsnansumpw.ndarray( 4, x, 2, 1 ); +const v = dsnansumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,10 +132,10 @@ var v = dsnansumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -144,10 +144,10 @@ function rand() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = dsnansumpw( x.length, x, 1 ); +const v = dsnansumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/README.md index 11740f4e8611..ba07f0f95053 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); +const dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); ``` #### dsort2hp( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using heapsort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2hp( x.length, 1.0, x, 1, y, 1 ); @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const N = floor( x.length / 2 ); dsort2hp( N, -1.0, x, 2, y, 2 ); @@ -80,17 +80,17 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... dsort2hp( N, -1.0, x1, 2, y1, 2 ); @@ -107,10 +107,10 @@ console.log( y0 ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using heapsort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2hp.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -129,10 +129,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsort2hp.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -169,22 +169,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/README.md index 43385ef23133..61fad8ace31d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); +const dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); ``` #### dsort2ins( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using insertion sort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2ins( x.length, 1.0, x, 1, y, 1 ); @@ -61,10 +61,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2ins( 2, -1.0, x, 2, y, 2 ); @@ -78,15 +78,15 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... dsort2ins( 2, -1.0, x1, 2, y1, 2 ); @@ -103,10 +103,10 @@ console.log( y0 ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using insertion sort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2ins.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsort2ins.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -166,20 +166,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); - -var rand; -var sign; -var i; - -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/README.md index 7594cda0311c..68a150d4b849 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); +const dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); ``` #### dsort2sh( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using Shellsort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2sh( x.length, 1.0, x, 1, y, 1 ); @@ -61,10 +61,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2sh( 2, -1.0, x, 2, y, 2 ); @@ -78,15 +78,15 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... dsort2sh( 2, -1.0, x1, 2, y1, 2 ); @@ -103,10 +103,10 @@ console.log( y0 ); Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array `x` using Shellsort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); dsort2sh.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsort2sh.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -166,22 +166,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/README.md index 2fdd0e87234c..c40552e2e756 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' ); +const dsorthp = require( '@stdlib/blas/ext/base/dsorthp' ); ``` #### dsorthp( N, order, x, stride ) @@ -35,9 +35,9 @@ var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' ); Sorts a double-precision floating-point strided array `x` using heapsort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsorthp( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsorthp( 2, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -64,13 +64,13 @@ dsorthp( 2, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... dsorthp( 2, -1.0, x1, 2 ); @@ -82,9 +82,9 @@ dsorthp( 2, -1.0, x1, 2 ); Sorts a double-precision floating-point strided array `x` using heapsort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsorthp.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dsorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -131,20 +131,15 @@ dsorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' ); - -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsorthp = require( '@stdlib/blas/ext/base/dsorthp' ); + +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsortins/README.md index ee99f20c46ed..3fcd30caeb50 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsortins = require( '@stdlib/blas/ext/base/dsortins' ); +const dsortins = require( '@stdlib/blas/ext/base/dsortins' ); ``` #### dsortins( N, order, x, stride ) @@ -35,9 +35,9 @@ var dsortins = require( '@stdlib/blas/ext/base/dsortins' ); Sorts a double-precision floating-point strided array `x` using insertion sort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortins( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortins( 2, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -64,13 +64,13 @@ dsortins( 2, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... dsortins( 2, -1.0, x1, 2 ); @@ -82,9 +82,9 @@ dsortins( 2, -1.0, x1, 2 ); Sorts a double-precision floating-point strided array `x` using insertion sort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortins.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dsortins.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -132,11 +132,11 @@ dsortins.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var dsortins = require( '@stdlib/blas/ext/base/dsortins' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const dsortins = require( '@stdlib/blas/ext/base/dsortins' ); -var x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) ); +const x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) ); console.log( x ); dsortins( x.length, -1.0, x, -1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/README.md index 26a73d85ee9d..73cf5ab937ef 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' ); +const dsortsh = require( '@stdlib/blas/ext/base/dsortsh' ); ``` #### dsortsh( N, order, x, stride ) @@ -35,9 +35,9 @@ var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' ); Sorts a double-precision floating-point strided array `x` using Shellsort. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortsh( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortsh( 2, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -64,13 +64,13 @@ dsortsh( 2, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... dsortsh( 2, -1.0, x1, 2 ); @@ -82,9 +82,9 @@ dsortsh( 2, -1.0, x1, 2 ); Sorts a double-precision floating-point strided array `x` using Shellsort and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); dsortsh.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); dsortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -132,11 +132,11 @@ dsortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const dsortsh = require( '@stdlib/blas/ext/base/dsortsh' ); -var x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) ); +const x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) ); console.log( x ); dsortsh( x.length, -1.0, x, -1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dssum/README.md index 7444c74e3662..c5109c33f765 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dssum = require( '@stdlib/blas/ext/base/dssum' ); +const dssum = require( '@stdlib/blas/ext/base/dssum' ); ``` #### dssum( N, x, stride ) @@ -41,12 +41,12 @@ var dssum = require( '@stdlib/blas/ext/base/dssum' ); Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dssum( N, x, 1 ); +const v = dssum( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dssum( 4, x, 2 ); +const v = dssum( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dssum( 4, x1, 2 ); +const v = dssum( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dssum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dssum.ndarray( 3, x, 1, 0 ); +const v = dssum.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dssum.ndarray( 4, x, 2, 1 ); +const v = dssum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,14 +131,14 @@ var v = dssum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dssum = require( '@stdlib/blas/ext/base/dssum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dssum = require( '@stdlib/blas/ext/base/dssum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dssum( x.length, x, 1 ); +const v = dssum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dssumors/README.md index c3e6c3eaa174..35284e1f254b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dssumors = require( '@stdlib/blas/ext/base/dssumors' ); +const dssumors = require( '@stdlib/blas/ext/base/dssumors' ); ``` #### dssumors( N, x, stride ) @@ -41,11 +41,11 @@ var dssumors = require( '@stdlib/blas/ext/base/dssumors' ); Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dssumors( 3, x, 1 ); +const v = dssumors( 3, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dssumors( 4, x, 2 ); +const v = dssumors( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dssumors( 4, x1, 2 ); +const v = dssumors( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dssumors( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = dssumors.ndarray( 3, x, 1, 0 ); +const v = dssumors.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dssumors.ndarray( 4, x, 2, 1 ); +const v = dssumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,15 +130,15 @@ var v = dssumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dssumors = require( '@stdlib/blas/ext/base/dssumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dssumors = require( '@stdlib/blas/ext/base/dssumors' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dssumors( x.length, x, 1 ); +const v = dssumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md index 5c53e3713ff7..f8b1b76dd40d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); +const dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); ``` #### dssumpw( N, x, stride ) @@ -41,12 +41,12 @@ var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dssumpw( N, x, 1 ); +const v = dssumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in x are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dssumpw( 4, x, 2 ); +const v = dssumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dssumpw( 4, x1, 2 ); +const v = dssumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = dssumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dssumpw.ndarray( N, x, 1, 0 ); +const v = dssumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dssumpw.ndarray( 4, x, 2, 1 ); +const v = dssumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,14 +132,14 @@ var v = dssumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dssumpw( x.length, x, 1 ); +const v = dssumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsum/README.md index febeda650931..d2e629b4d1ce 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsum = require( '@stdlib/blas/ext/base/dsum' ); +const dsum = require( '@stdlib/blas/ext/base/dsum' ); ``` #### dsum( N, x, stride ) @@ -41,12 +41,12 @@ var dsum = require( '@stdlib/blas/ext/base/dsum' ); Computes the sum of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsum( N, x, 1 ); +const v = dsum( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsum( 4, x, 2 ); +const v = dsum( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsum( 4, x1, 2 ); +const v = dsum( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dsum( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsum.ndarray( 3, x, 1, 0 ); +const v = dsum.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsum.ndarray( 4, x, 2, 1 ); +const v = dsum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,14 +130,14 @@ var v = dsum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsum = require( '@stdlib/blas/ext/base/dsum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsum = require( '@stdlib/blas/ext/base/dsum' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dsum( x.length, x, 1 ); +const v = dsum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/README.md index bef6ea106656..e7c39c44a019 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); +const dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); ``` #### dsumkbn( N, x, stride ) @@ -41,12 +41,12 @@ var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); Computes the sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsumkbn( N, x, 1 ); +const v = dsumkbn( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsumkbn( 4, x, 2 ); +const v = dsumkbn( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsumkbn( 4, x1, 2 ); +const v = dsumkbn( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = dsumkbn( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsumkbn.ndarray( 3, x, 1, 0 ); +const v = dsumkbn.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsumkbn.ndarray( 4, x, 2, 1 ); +const v = dsumkbn.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,14 +130,14 @@ var v = dsumkbn.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dsumkbn( x.length, x, 1 ); +const v = dsumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/README.md index 20ea8a24b5db..98417bf42e4d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); +const dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); ``` #### dsumkbn2( N, x, stride ) @@ -41,11 +41,11 @@ var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsumkbn2( 3, x, 1 ); +const v = dsumkbn2( 3, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsumkbn2( 4, x, 2 ); +const v = dsumkbn2( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsumkbn2( 4, x1, 2 ); +const v = dsumkbn2( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = dsumkbn2( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dsumkbn2.ndarray( 3, x, 1, 0 ); +const v = dsumkbn2.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -100,12 +100,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsumkbn2.ndarray( 4, x, 2, 1 ); +const v = dsumkbn2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,14 +130,14 @@ var v = dsumkbn2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); console.log( x ); -var v = dsumkbn2( x.length, x, 1 ); +const v = dsumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsumors/README.md index a68ee7615de1..224c36a234bd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsumors = require( '@stdlib/blas/ext/base/dsumors' ); +const dsumors = require( '@stdlib/blas/ext/base/dsumors' ); ``` #### dsumors( N, x, stride ) @@ -41,12 +41,12 @@ var dsumors = require( '@stdlib/blas/ext/base/dsumors' ); Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsumors( N, x, 1 ); +const v = dsumors( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsumors( 4, x, 2 ); +const v = dsumors( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsumors( 4, x1, 2 ); +const v = dsumors( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = dsumors( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsumors.ndarray( N, x, 1, 0 ); +const v = dsumors.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsumors.ndarray( 4, x, 2, 1 ); +const v = dsumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,14 +132,14 @@ var v = dsumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsumors = require( '@stdlib/blas/ext/base/dsumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsumors = require( '@stdlib/blas/ext/base/dsumors' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dsumors( x.length, x, 1 ); +const v = dsumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dsumpw/README.md index 3c03cbc53312..2d8da8cc14c1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); +const dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); ``` #### dsumpw( N, x, stride ) @@ -41,12 +41,12 @@ var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); Computes the sum of double-precision floating-point strided array elements using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsumpw( N, x, 1 ); +const v = dsumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = dsumpw( 4, x, 2 ); +const v = dsumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dsumpw( 4, x1, 2 ); +const v = dsumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = dsumpw( 4, x1, 2 ); Computes the sum of double-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsumpw.ndarray( N, x, 1, 0 ); +const v = dsumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = dsumpw.ndarray( 4, x, 2, 1 ); +const v = dsumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,14 +132,14 @@ var v = dsumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); -var v = dsumpw( x.length, x, 1 ); +const v = dsumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapx/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapx/README.md index 6905d4cb1310..52c03d0d8163 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapx/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapx/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gapx = require( '@stdlib/blas/ext/base/gapx' ); +const gapx = require( '@stdlib/blas/ext/base/gapx' ); ``` #### gapx( N, alpha, x, stride ) @@ -35,7 +35,7 @@ var gapx = require( '@stdlib/blas/ext/base/gapx' ); Adds a constant `alpha` to each element in a strided array `x`. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gapx( x.length, 5.0, x, 1 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -51,10 +51,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to add a constant to every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); gapx( N, 5.0, x, 2 ); // x => [ 3.0, 1.0, 8.0, -5.0, 9.0, 0.0, 4.0, -3.0 ] @@ -63,15 +63,15 @@ gapx( N, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Add a constant to every other element... gapx( N, 5.0, x1, 2 ); @@ -83,7 +83,7 @@ gapx( N, 5.0, x1, 2 ); Adds a constant `alpha` to each element in a strided array `x` using alternative indexing semantics. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gapx.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -96,7 +96,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gapx.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ] @@ -124,20 +124,15 @@ gapx.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapx = require( '@stdlib/blas/ext/base/gapx' ); - -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapx = require( '@stdlib/blas/ext/base/gapx' ); + +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapxsum/README.md index a3aedab81bc0..f93a26f37334 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); +const gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); ``` #### gapxsum( N, alpha, x, stride ) @@ -41,10 +41,10 @@ var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); Adds a constant to each strided array element and computes the sum. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsum( N, 5.0, x, 1 ); +const v = gapxsum( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsum( N, 5.0, x, 2 ); +const v = gapxsum( N, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gapxsum( N, 5.0, x1, 2 ); +const v = gapxsum( N, 5.0, x1, 2 ); // returns 25.0 ``` @@ -88,10 +88,10 @@ var v = gapxsum( N, 5.0, x1, 2 ); Adds a constant to each strided array element and computes the sum using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsum.ndarray( N, 5.0, x, 1, 0 ); +const v = gapxsum.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsum.ndarray( N, 5.0, x, 2, 1 ); +const v = gapxsum.ndarray( N, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -133,21 +133,18 @@ var v = gapxsum.ndarray( N, 5.0, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gapxsum( x.length, 5.0, x, 1 ); +const v = gapxsum( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/README.md index c5f95d5278d5..f8e3844da041 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); +const gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); ``` #### gapxsumkbn( N, alpha, x, stride ) @@ -41,10 +41,10 @@ var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); Adds a constant to each strided array element and computes the sum using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumkbn( N, 5.0, x, 1 ); +const v = gapxsumkbn( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumkbn( N, 5.0, x, 2 ); +const v = gapxsumkbn( N, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gapxsumkbn( N, 5.0, x1, 2 ); +const v = gapxsumkbn( N, 5.0, x1, 2 ); // returns 25.0 ``` @@ -88,10 +88,10 @@ var v = gapxsumkbn( N, 5.0, x1, 2 ); Adds a constant to each strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumkbn.ndarray( N, 5.0, x, 1, 0 ); +const v = gapxsumkbn.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumkbn.ndarray( N, 5.0, x, 2, 1 ); +const v = gapxsumkbn.ndarray( N, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -133,21 +133,18 @@ var v = gapxsumkbn.ndarray( N, 5.0, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gapxsumkbn( x.length, 5.0, x, 1 ); +const v = gapxsumkbn( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/README.md index 48ea54f0c3b1..efde4d0bbd17 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); +const gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); ``` #### gapxsumkbn2( N, alpha, x, stride ) @@ -41,10 +41,10 @@ var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumkbn2( N, 5.0, x, 1 ); +const v = gapxsumkbn2( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumkbn2( N, 5.0, x, 2 ); +const v = gapxsumkbn2( N, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gapxsumkbn2( N, 5.0, x1, 2 ); +const v = gapxsumkbn2( N, 5.0, x1, 2 ); // returns 25.0 ``` @@ -88,10 +88,10 @@ var v = gapxsumkbn2( N, 5.0, x1, 2 ); Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumkbn2.ndarray( N, 5.0, x, 1, 0 ); +const v = gapxsumkbn2.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumkbn2.ndarray( N, 5.0, x, 2, 1 ); +const v = gapxsumkbn2.ndarray( N, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -133,21 +133,18 @@ var v = gapxsumkbn2.ndarray( N, 5.0, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gapxsumkbn2( x.length, 5.0, x, 1 ); +const v = gapxsumkbn2( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapxsumors/README.md index c1b502e4cbee..cd5805e2af8a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); +const gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); ``` #### gapxsumors( N, alpha, x, stride ) @@ -41,10 +41,10 @@ var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); Adds a constant to each strided array element and computes the sum using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumors( N, 5.0, x, 1 ); +const v = gapxsumors( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumors( N, 5.0, x, 2 ); +const v = gapxsumors( N, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gapxsumors( N, 5.0, x1, 2 ); +const v = gapxsumors( N, 5.0, x1, 2 ); // returns 25.0 ``` @@ -88,10 +88,10 @@ var v = gapxsumors( N, 5.0, x1, 2 ); Adds a constant to each strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumors.ndarray( N, 5.0, x, 1, 0 ); +const v = gapxsumors.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumors.ndarray( N, 5.0, x, 2, 1 ); +const v = gapxsumors.ndarray( N, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -134,21 +134,18 @@ var v = gapxsumors.ndarray( N, 5.0, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gapxsumors( x.length, 5.0, x, 1 ); +const v = gapxsumors( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/gapxsumpw/README.md index 59b57d225f79..85e45395048a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); +const gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); ``` #### gapxsumpw( N, alpha, x, stride ) @@ -41,10 +41,10 @@ var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); Adds a constant to each strided array element and computes the sum using pairwise summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumpw( N, 5.0, x, 1 ); +const v = gapxsumpw( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumpw( N, 5.0, x, 2 ); +const v = gapxsumpw( N, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gapxsumpw( N, 5.0, x1, 2 ); +const v = gapxsumpw( N, 5.0, x1, 2 ); // returns 25.0 ``` @@ -88,10 +88,10 @@ var v = gapxsumpw( N, 5.0, x1, 2 ); Adds a constant to each strided array element and computes the sum using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gapxsumpw.ndarray( N, 5.0, x, 1, 0 ); +const v = gapxsumpw.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gapxsumpw.ndarray( N, 5.0, x, 2, 1 ); +const v = gapxsumpw.ndarray( N, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -134,21 +134,18 @@ var v = gapxsumpw.ndarray( N, 5.0, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gapxsumpw( x.length, 5.0, x, 1 ); +const v = gapxsumpw( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/gasumpw/README.md index 5aee47372758..e227f27f809d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gasumpw/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); +const gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); ``` #### gasumpw( N, x, stride ) @@ -56,9 +56,9 @@ var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of strided array elements using pairwise summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = gasumpw( x.length, x, 1 ); +const v = gasumpw( x.length, x, 1 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of absolute values of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gasumpw( N, x, 2 ); +const v = gasumpw( N, x, 2 ); // returns 9.0 ``` @@ -85,15 +85,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gasumpw( N, x1, 2 ); +const v = gasumpw( N, x1, 2 ); // returns 9.0 ``` @@ -102,9 +102,9 @@ var v = gasumpw( N, x1, 2 ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = gasumpw.ndarray( x.length, x, 1, 0 ); +const v = gasumpw.ndarray( x.length, x, 1, 0 ); // returns 5.0 ``` @@ -115,12 +115,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of absolute values of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gasumpw.ndarray( N, x, 2, 1 ); +const v = gasumpw.ndarray( N, x, 2, 1 ); // returns 9.0 ``` @@ -147,21 +147,18 @@ var v = gasumpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gasumpw( x.length, x, 1 ); +const v = gasumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusum/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusum/README.md index 072bdd52f4e9..26bf42625330 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gcusum = require( '@stdlib/blas/ext/base/gcusum' ); +const gcusum = require( '@stdlib/blas/ext/base/gcusum' ); ``` #### gcusum( N, sum, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var gcusum = require( '@stdlib/blas/ext/base/gcusum' ); Computes the cumulative sum of strided array elements. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +let x = [ 1.0, -2.0, 2.0 ]; +let y = [ 0.0, 0.0, 0.0 ]; gcusum( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -66,14 +66,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); -var v = gcusum( N, 0.0, x, 2, y, 1 ); +const v = gcusum( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,18 +82,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); gcusum( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -104,8 +104,8 @@ gcusum( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of strided array elements using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; gcusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -119,12 +119,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); gcusum.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -152,18 +152,14 @@ gcusum.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gcusum = require( '@stdlib/blas/ext/base/gcusum' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gcusum = require( '@stdlib/blas/ext/base/gcusum' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md index a1212ae6b0d5..2b8d81084637 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); +const gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); ``` #### gcusumkbn( N, sum, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); Computes the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +let x = [ 1.0, -2.0, 2.0 ]; +let y = [ 0.0, 0.0, 0.0 ]; gcusumkbn( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -66,14 +66,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); -var v = gcusumkbn( N, 0.0, x, 2, y, 1 ); +const v = gcusumkbn( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,18 +82,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); gcusumkbn( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -104,8 +104,8 @@ gcusumkbn( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; gcusumkbn.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -119,12 +119,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -152,18 +152,14 @@ gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn2/README.md index 7a662798cd91..5c6ee08ac6a7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); +const gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); ``` #### gcusumkbn2( N, sum, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); Computes the cumulative sum of strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +let x = [ 1.0, -2.0, 2.0 ]; +let y = [ 0.0, 0.0, 0.0 ]; gcusumkbn2( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -66,14 +66,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); -var v = gcusumkbn2( N, 0.0, x, 2, y, 1 ); +const v = gcusumkbn2( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,18 +82,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); gcusumkbn2( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -104,8 +104,8 @@ gcusumkbn2( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; gcusumkbn2.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -119,12 +119,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); gcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -152,18 +152,14 @@ gcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumors/README.md index 6e308f32fa16..266694522a41 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' ); +const gcusumors = require( '@stdlib/blas/ext/base/gcusumors' ); ``` #### gcusumors( N, sum, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' ); Computes the cumulative sum of strided array elements using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +let x = [ 1.0, -2.0, 2.0 ]; +let y = [ 0.0, 0.0, 0.0 ]; gcusumors( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -66,14 +66,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); -var v = gcusumors( N, 0.0, x, 2, y, 1 ); +const v = gcusumors( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,18 +82,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); gcusumors( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -104,8 +104,8 @@ gcusumors( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; gcusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -119,12 +119,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); gcusumors.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -153,18 +153,14 @@ gcusumors.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gcusumors = require( '@stdlib/blas/ext/base/gcusumors' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumpw/README.md index dd4c707a395e..20679df4018b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' ); +const gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' ); ``` #### gcusumpw( N, sum, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' ); Computes the cumulative sum of strided array elements using pairwise summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +let x = [ 1.0, -2.0, 2.0 ]; +let y = [ 0.0, 0.0, 0.0 ]; gcusumpw( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -66,14 +66,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); -var v = gcusumpw( N, 0.0, x, 2, y, 1 ); +const v = gcusumpw( N, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,18 +82,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); gcusumpw( N, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -104,8 +104,8 @@ gcusumpw( N, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; gcusumpw.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -119,12 +119,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); gcusumpw.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -153,18 +153,14 @@ gcusumpw.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/README.md b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/README.md index 47f81ebe3805..ffb7a30d2023 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); +const gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); ``` #### gfillBy( N, x, stride, clbk\[, thisArg] ) @@ -39,7 +39,7 @@ function fill( v, i ) { return v * i; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gfillBy( x.length, x, 1, fill ); // x => [ 0.0, 1.0, 6.0, -15.0, 16.0, 0.0, -6.0, -21.0 ] @@ -68,30 +68,30 @@ function fill( v, i ) { return v * i; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var context = { +const context = { 'count': 0 }; gfillBy( x.length, x, 1, fill, context ); // x => [ 0.0, 1.0, 6.0, -15.0, 16.0, 0.0, -6.0, -21.0 ] -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to fill every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function fill( v, i ) { return v * i; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); gfillBy( N, x, 2, fill ); // x => [ 0.0, 1.0, 3.0, -5.0, 8.0, 0.0, -3.0, -3.0 ] @@ -100,19 +100,19 @@ gfillBy( N, x, 2, fill ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function fill( v, i ) { return v * i; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Fill every other element... gfillBy( N, x1, 2, fill ); @@ -128,7 +128,7 @@ function fill( v, i ) { return v * i; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gfillBy.ndarray( x.length, x, 1, 0, fill ); // x => [ 0.0, 1.0, 6.0, -15.0, 16.0, 0.0, -6.0, -21.0 ] @@ -145,7 +145,7 @@ function fill( v, i ) { return v * i; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gfillBy.ndarray( 3, x, 1, x.length-3, fill ); // x => [ 1.0, -2.0, 3.0, 0.0, 5.0, -12.0 ] @@ -174,14 +174,14 @@ gfillBy.ndarray( 3, x, 1, x.length-3, fill ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); function fill() { - var rand = round( randu()*100.0 ); - var sign = randu(); + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { @@ -190,7 +190,7 @@ function fill() { return sign * rand; } -var x = new Float64Array( 10 ); +const x = new Float64Array( 10 ); console.log( x ); gfillBy( x.length, x, 1, fill ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/gfill/README.md index 941ea9fc0e5e..532a9b828a7e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gfill = require( '@stdlib/blas/ext/base/gfill' ); +const gfill = require( '@stdlib/blas/ext/base/gfill' ); ``` #### gfill( N, alpha, x, stride ) @@ -35,7 +35,7 @@ var gfill = require( '@stdlib/blas/ext/base/gfill' ); Fills a strided array `x` with a specified scalar constant `alpha`. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gfill( x.length, 5.0, x, 1 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -51,10 +51,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to fill every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); gfill( N, 5.0, x, 2 ); // x => [ 5.0, 1.0, 5.0, -5.0, 5.0, 0.0, 5.0, -3.0 ] @@ -63,15 +63,15 @@ gfill( N, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Fill every other element... gfill( N, 5.0, x1, 2 ); @@ -83,7 +83,7 @@ gfill( N, 5.0, x1, 2 ); Fills a strided array `x` with a specified scalar constant `alpha` using alternative indexing semantics. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; gfill.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -96,7 +96,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gfill.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ] @@ -125,13 +125,12 @@ gfill.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gfill = require( '@stdlib/blas/ext/base/gfill' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gfill = require( '@stdlib/blas/ext/base/gfill' ); -var x = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = discreteUniform( -100, 100 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/README.md index 2c082e484954..6a3df855724a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); +const gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); ``` #### gnannsumkbn( N, x, strideX, out, strideOut ) @@ -41,10 +41,10 @@ var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var out = [ 0.0, 0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const out = [ 0.0, 0 ]; -var v = gnannsumkbn( x.length, x, 1, out, 1 ); +const v = gnannsumkbn( x.length, x, 1, out, 1 ); // returns [ 1.0, 3 ] ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ]; -var out = [ 0.0, 0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ]; +const out = [ 0.0, 0 ]; +const N = floor( x.length / 2 ); -var v = gnannsumkbn( N, x, 2, out, 1 ); +const v = gnannsumkbn( N, x, 2, out, 1 ); // returns [ 5.0, 2 ] ``` @@ -74,18 +74,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnannsumkbn( N, x1, 2, out1, 1 ); +const v = gnannsumkbn( N, x1, 2, out1, 1 ); // returns [ 5.0, 4 ] ``` @@ -94,10 +94,10 @@ var v = gnannsumkbn( N, x1, 2, out1, 1 ); Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var out = [ 0.0, 0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const out = [ 0.0, 0 ]; -var v = gnannsumkbn.ndarray( x.length, x, 1, 0, out, 1, 0 ); +const v = gnannsumkbn.ndarray( x.length, x, 1, 0, out, 1, 0 ); // returns [ 1.0, 3 ] ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var out = [ 0.0, 0.0, 0.0, 0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const out = [ 0.0, 0.0, 0.0, 0 ]; +const N = floor( x.length / 2 ); -var v = gnannsumkbn.ndarray( N, x, 2, 1, out, 2, 1 ); +const v = gnannsumkbn.ndarray( N, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 5.0, 0.0, 4 ] ``` @@ -140,16 +140,13 @@ var v = gnannsumkbn.ndarray( N, x, 2, 1, out, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -158,7 +155,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); gnannsumkbn( x.length, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansum/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnansum/README.md index e5633c61288d..910143ff890c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnansum = require( '@stdlib/blas/ext/base/gnansum' ); +const gnansum = require( '@stdlib/blas/ext/base/gnansum' ); ``` #### gnansum( N, x, stride ) @@ -41,10 +41,10 @@ var gnansum = require( '@stdlib/blas/ext/base/gnansum' ); Computes the sum of strided array elements, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansum( N, x, 1 ); +const v = gnansum( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansum( N, x, 2 ); +const v = gnansum( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnansum( N, x1, 2 ); +const v = gnansum( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gnansum( N, x1, 2 ); Computes the sum of strided array elements, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansum.ndarray( N, x, 1, 0 ); +const v = gnansum.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansum.ndarray( N, x, 2, 1 ); +const v = gnansum.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,16 +133,13 @@ var v = gnansum.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnansum = require( '@stdlib/blas/ext/base/gnansum' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnansum = require( '@stdlib/blas/ext/base/gnansum' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = gnansum( x.length, x, 1 ); +const v = gnansum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/README.md index 4855f7fc32f2..c8bd7d197da5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); +const gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); ``` #### gnansumkbn( N, x, stride ) @@ -41,10 +41,10 @@ var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumkbn( N, x, 1 ); +const v = gnansumkbn( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumkbn( N, x, 2 ); +const v = gnansumkbn( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnansumkbn( N, x1, 2 ); +const v = gnansumkbn( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gnansumkbn( N, x1, 2 ); Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumkbn.ndarray( N, x, 1, 0 ); +const v = gnansumkbn.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumkbn.ndarray( N, x, 2, 1 ); +const v = gnansumkbn.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,16 +133,13 @@ var v = gnansumkbn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = gnansumkbn( x.length, x, 1 ); +const v = gnansumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/README.md index b3556d9cf6ec..5b190828a6be 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); +const gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); ``` #### gnansumkbn2( N, x, stride ) @@ -41,10 +41,10 @@ var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumkbn2( N, x, 1 ); +const v = gnansumkbn2( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumkbn2( N, x, 2 ); +const v = gnansumkbn2( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnansumkbn2( N, x1, 2 ); +const v = gnansumkbn2( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gnansumkbn2( N, x1, 2 ); Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumkbn2.ndarray( N, x, 1, 0 ); +const v = gnansumkbn2.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumkbn2.ndarray( N, x, 2, 1 ); +const v = gnansumkbn2.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,16 +133,13 @@ var v = gnansumkbn2.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = gnansumkbn2( x.length, x, 1 ); +const v = gnansumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnansumors/README.md index 61e9bd52e8af..dc71696bfc81 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); +const gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); ``` #### gnansumors( N, x, stride ) @@ -41,10 +41,10 @@ var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumors( N, x, 1 ); +const v = gnansumors( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumors( N, x, 2 ); +const v = gnansumors( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnansumors( N, x1, 2 ); +const v = gnansumors( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gnansumors( N, x1, 2 ); Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumors.ndarray( N, x, 1, 0 ); +const v = gnansumors.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumors.ndarray( N, x, 2, 1 ); +const v = gnansumors.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -134,16 +134,13 @@ var v = gnansumors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -152,7 +149,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = gnansumors( x.length, x, 1 ); +const v = gnansumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/gnansumpw/README.md index ba6486d03d90..2d30a7af5537 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); +const gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); ``` #### gnansumpw( N, x, stride ) @@ -41,10 +41,10 @@ var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumpw( N, x, 1 ); +const v = gnansumpw( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumpw( N, x, 2 ); +const v = gnansumpw( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gnansumpw( N, x1, 2 ); +const v = gnansumpw( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gnansumpw( N, x1, 2 ); Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = gnansumpw.ndarray( N, x, 1, 0 ); +const v = gnansumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = gnansumpw.ndarray( N, x, 2, 1 ); +const v = gnansumpw.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -134,16 +134,13 @@ var v = gnansumpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -152,7 +149,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = gnansumpw( x.length, x, 1 ); +const v = gnansumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/grev/README.md b/lib/node_modules/@stdlib/blas/ext/base/grev/README.md index a5b0319ad45c..5070ef9550eb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/grev/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/grev/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var grev = require( '@stdlib/blas/ext/base/grev' ); +const grev = require( '@stdlib/blas/ext/base/grev' ); ``` #### grev( N, x, stride ) @@ -35,7 +35,7 @@ var grev = require( '@stdlib/blas/ext/base/grev' ); Reverses a strided array `x` in-place. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; grev( x.length, x, 1 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -50,10 +50,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to reverse every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); grev( N, x, 2 ); // x => [ -1.0, 1.0, 4.0, -5.0, 3.0, 0.0, -2.0, -3.0 ] @@ -62,15 +62,15 @@ grev( N, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Reverse every other element... grev( N, x1, 2 ); @@ -82,7 +82,7 @@ grev( N, x1, 2 ); Reverses a strided array `x` in-place using alternative indexing semantics. ```javascript -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; grev.ndarray( x.length, x, 1, 0 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -95,7 +95,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; grev.ndarray( 3, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ] @@ -125,12 +125,12 @@ grev.ndarray( 3, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var Float64Array = require( '@stdlib/array/float64' ); -var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); -var grev = require( '@stdlib/blas/ext/base/grev' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const Float64Array = require( '@stdlib/array/float64' ); +const gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); +const grev = require( '@stdlib/blas/ext/base/grev' ); -var x = gfillBy( 10, new Float64Array( 10 ), 1, discreteUniform( -100, 100 ) ); +const x = gfillBy( 10, new Float64Array( 10 ), 1, discreteUniform( -100, 100 ) ); console.log( x ); grev( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md index 24ea41b60cf7..827cc964eb54 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); +const gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); ``` #### gsort2hp( N, order, x, strideX, y, strideY ) @@ -35,8 +35,8 @@ var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using heapsort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2hp( x.length, 1.0, x, 1, y, 1 ); @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; +const N = floor( x.length / 2 ); gsort2hp( N, -1.0, x, 2, y, 2 ); @@ -77,17 +77,17 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsort2hp( N, -1.0, x1, 2, y1, 2 ); @@ -104,8 +104,8 @@ console.log( y0 ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using heapsort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2hp.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -124,8 +124,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; gsort2hp.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -164,22 +164,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort2ins/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsort2ins/README.md index 0fed89f9d951..129a73d3f3d6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort2ins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort2ins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); +const gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); ``` #### gsort2ins( N, order, x, strideX, y, strideY ) @@ -35,8 +35,8 @@ var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using insertion sort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2ins( x.length, 1.0, x, 1, y, 1 ); @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; +const N = floor( x.length / 2 ); gsort2ins( N, -1.0, x, 2, y, 2 ); @@ -77,17 +77,17 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsort2ins( N, -1.0, x1, 2, y1, 2 ); @@ -104,8 +104,8 @@ console.log( y0 ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using insertion sort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2ins.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -124,8 +124,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; gsort2ins.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -164,22 +164,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort2sh/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsort2sh/README.md index a3994a88fd78..c6f9e410ce14 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort2sh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort2sh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); +const gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); ``` #### gsort2sh( N, order, x, strideX, y, strideY ) @@ -35,8 +35,8 @@ var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using Shellsort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2sh( x.length, 1.0, x, 1, y, 1 ); @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; +const N = floor( x.length / 2 ); gsort2sh( N, -1.0, x, 2, y, 2 ); @@ -77,17 +77,17 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsort2sh( N, -1.0, x1, 2, y1, 2 ); @@ -104,8 +104,8 @@ console.log( y0 ); Simultaneously sorts two strided arrays based on the sort order of the first array `x` using Shellsort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0 ]; gsort2sh.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -124,8 +124,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const y = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; gsort2sh.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -164,22 +164,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsorthp/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsorthp/README.md index 02558dcc2f93..346da5a5f60b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsorthp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsorthp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' ); +const gsorthp = require( '@stdlib/blas/ext/base/gsorthp' ); ``` #### gsorthp( N, order, x, stride ) @@ -35,7 +35,7 @@ var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' ); Sorts a strided array `x` using heapsort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsorthp( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -51,10 +51,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const N = floor( x.length / 2 ); gsorthp( N, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -63,15 +63,15 @@ gsorthp( N, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsorthp( N, -1.0, x1, 2 ); @@ -83,7 +83,7 @@ gsorthp( N, -1.0, x1, 2 ); Sorts a strided array `x` using heapsort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsorthp.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -96,7 +96,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gsorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -129,20 +129,15 @@ gsorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' ); - -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsorthp = require( '@stdlib/blas/ext/base/gsorthp' ); + +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsortins/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsortins/README.md index cfccda3d0947..6863d8197824 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsortins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsortins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsortins = require( '@stdlib/blas/ext/base/gsortins' ); +const gsortins = require( '@stdlib/blas/ext/base/gsortins' ); ``` #### gsortins( N, order, x, stride ) @@ -35,7 +35,7 @@ var gsortins = require( '@stdlib/blas/ext/base/gsortins' ); Sorts a strided array `x` using insertion sort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsortins( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -51,10 +51,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const N = floor( x.length / 2 ); gsortins( N, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -63,15 +63,15 @@ gsortins( N, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsortins( N, -1.0, x1, 2 ); @@ -83,7 +83,7 @@ gsortins( N, -1.0, x1, 2 ); Sorts a strided array `x` using insertion sort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsortins.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -96,7 +96,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gsortins.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -130,20 +130,15 @@ gsortins.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsortins = require( '@stdlib/blas/ext/base/gsortins' ); - -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsortins = require( '@stdlib/blas/ext/base/gsortins' ); + +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsortsh/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsortsh/README.md index b23a0e4a1bea..b90985d0d858 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsortsh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsortsh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' ); +const gsortsh = require( '@stdlib/blas/ext/base/gsortsh' ); ``` #### gsortsh( N, order, x, stride ) @@ -35,7 +35,7 @@ var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' ); Sorts a strided array `x` using Shellsort. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsortsh( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -51,10 +51,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, -2.0, 3.0, -4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, -2.0, 3.0, -4.0 ]; +const N = floor( x.length / 2 ); gsortsh( N, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -63,15 +63,15 @@ gsortsh( N, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... gsortsh( N, -1.0, x1, 2 ); @@ -83,7 +83,7 @@ gsortsh( N, -1.0, x1, 2 ); Sorts a strided array `x` using Shellsort and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0 ]; gsortsh.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -96,7 +96,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; gsortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -130,20 +130,15 @@ gsortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' ); - -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsortsh = require( '@stdlib/blas/ext/base/gsortsh' ); + +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsum/README.md index 7d32459d5ad9..f49d2e8d3c96 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gsum = require( '@stdlib/blas/ext/base/gsum' ); +const gsum = require( '@stdlib/blas/ext/base/gsum' ); ``` #### gsum( N, x, stride ) @@ -41,10 +41,10 @@ var gsum = require( '@stdlib/blas/ext/base/gsum' ); Computes the sum of strided array elements. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsum( N, x, 1 ); +const v = gsum( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gsum( N, x, 2 ); +const v = gsum( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gsum( N, x1, 2 ); +const v = gsum( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gsum( N, x1, 2 ); Computes the sum of strided array elements using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsum.ndarray( N, x, 1, 0 ); +const v = gsum.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gsum.ndarray( N, x, 2, 1 ); +const v = gsum.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,21 +133,18 @@ var v = gsum.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsum = require( '@stdlib/blas/ext/base/gsum' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsum = require( '@stdlib/blas/ext/base/gsum' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gsum( x.length, x, 1 ); +const v = gsum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsumkbn/README.md index c02bc168f0ae..7e23731c0aa7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); +const gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); ``` #### gsumkbn( N, x, stride ) @@ -41,10 +41,10 @@ var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); Computes the sum of strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumkbn( N, x, 1 ); +const v = gsumkbn( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gsumkbn( N, x, 2 ); +const v = gsumkbn( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gsumkbn( N, x1, 2 ); +const v = gsumkbn( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gsumkbn( N, x1, 2 ); Computes the sum of strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumkbn.ndarray( N, x, 1, 0 ); +const v = gsumkbn.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gsumkbn.ndarray( N, x, 2, 1 ); +const v = gsumkbn.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,21 +133,18 @@ var v = gsumkbn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gsumkbn( x.length, x, 1 ); +const v = gsumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsumkbn2/README.md index a5f21c5005fe..b86aeb14c472 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); +const gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); ``` #### gsumkbn2( N, x, stride ) @@ -41,10 +41,10 @@ var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); Computes the sum of strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumkbn2( N, x, 1 ); +const v = gsumkbn2( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gsumkbn2( N, x, 2 ); +const v = gsumkbn2( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gsumkbn2( N, x1, 2 ); +const v = gsumkbn2( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gsumkbn2( N, x1, 2 ); Computes the sum of strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumkbn2.ndarray( N, x, 1, 0 ); +const v = gsumkbn2.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gsumkbn2.ndarray( N, x, 2, 1 ); +const v = gsumkbn2.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -133,21 +133,18 @@ var v = gsumkbn2.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gsumkbn2( x.length, x, 1 ); +const v = gsumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsumors/README.md index 5c9f837a28e0..0a9111843a90 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gsumors = require( '@stdlib/blas/ext/base/gsumors' ); +const gsumors = require( '@stdlib/blas/ext/base/gsumors' ); ``` #### gsumors( N, x, stride ) @@ -41,10 +41,10 @@ var gsumors = require( '@stdlib/blas/ext/base/gsumors' ); Computes the sum of strided array elements using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumors( N, x, 1 ); +const v = gsumors( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gsumors( N, x, 2 ); +const v = gsumors( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gsumors( N, x1, 2 ); +const v = gsumors( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gsumors( N, x1, 2 ); Computes the sum of strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumors.ndarray( N, x, 1, 0 ); +const v = gsumors.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gsumors.ndarray( N, x, 2, 1 ); +const v = gsumors.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -134,21 +134,18 @@ var v = gsumors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsumors = require( '@stdlib/blas/ext/base/gsumors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsumors = require( '@stdlib/blas/ext/base/gsumors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gsumors( x.length, x, 1 ); +const v = gsumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsumpw/README.md index 6761c1510b75..13c512d95321 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); +const gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); ``` #### gsumpw( N, x, stride ) @@ -41,10 +41,10 @@ var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); Computes the sum of strided array elements using pairwise summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumpw( N, x, 1 ); +const v = gsumpw( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the gsumpw of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = gsumpw( N, x, 2 ); +const v = gsumpw( N, x, 2 ); // returns 5.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = gsumpw( N, x1, 2 ); +const v = gsumpw( N, x1, 2 ); // returns 5.0 ``` @@ -88,10 +88,10 @@ var v = gsumpw( N, x1, 2 ); Computes the sum of strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = gsumpw.ndarray( N, x, 1, 0 ); +const v = gsumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = gsumpw.ndarray( N, x, 2, 1 ); +const v = gsumpw.ndarray( N, x, 2, 1 ); // returns 5.0 ``` @@ -134,21 +134,18 @@ var v = gsumpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); -var v = gsumpw( x.length, x, 1 ); +const v = gsumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapx/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapx/README.md index 4c14fd5482e7..4d9c3b488432 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapx/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapx/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sapx = require( '@stdlib/blas/ext/base/sapx' ); +const sapx = require( '@stdlib/blas/ext/base/sapx' ); ``` #### sapx( N, alpha, x, stride ) @@ -35,9 +35,9 @@ var sapx = require( '@stdlib/blas/ext/base/sapx' ); Adds a constant `alpha` to each element in a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sapx( x.length, 5.0, x, 1 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sapx( 4, 5.0, x, 2 ); // x => [ 3.0, 1.0, 8.0, -5.0, 9.0, 0.0, 4.0, -3.0 ] @@ -64,13 +64,13 @@ sapx( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array... -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Add a constant to every other element... sapx( 3, 5.0, x1, 2 ); @@ -82,9 +82,9 @@ sapx( 3, 5.0, x1, 2 ); Adds a constant `alpha` to each element in a single-precision floating-point strided array `x` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sapx.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); sapx.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ] @@ -126,11 +126,11 @@ sapx.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sapx = require( '@stdlib/blas/ext/base/sapx' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sapx = require( '@stdlib/blas/ext/base/sapx' ); -var x = filledarrayBy( 10, 'float32', uniform( -100.0, 100.0 ) ); +const x = filledarrayBy( 10, 'float32', uniform( -100.0, 100.0 ) ); console.log( x ); sapx( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapxsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapxsum/README.md index 7c7e27ae3ca7..a06cd379fdc7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapxsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapxsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); +const sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); ``` #### sapxsum( N, alpha, x, stride ) @@ -41,12 +41,12 @@ var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); Adds a constant to each single-precision floating-point strided array element and computes the sum. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsum( N, 5.0, x, 1 ); +const v = sapxsum( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sapxsum( 4, 5.0, x, 2 ); +const v = sapxsum( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sapxsum( 4, 5.0, x1, 2 ); +const v = sapxsum( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,12 +86,12 @@ var v = sapxsum( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsum.ndarray( N, 5.0, x, 1, 0 ); +const v = sapxsum.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sapxsum.ndarray( 4, 5.0, x, 2, 1 ); +const v = sapxsum.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,11 +131,11 @@ var v = sapxsum.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn/README.md index 6029f851c8dc..0fd9ff5c719b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' ); +const sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' ); ``` #### sapxsumkbn( N, alpha, x, stride ) @@ -41,11 +41,11 @@ var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sapxsumkbn( 3, 5.0, x, 1 ); +const v = sapxsumkbn( 3, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sapxsumkbn( 4, 5.0, x, 2 ); +const v = sapxsumkbn( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sapxsumkbn( 4, 5.0, x1, 2 ); +const v = sapxsumkbn( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = sapxsumkbn( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sapxsumkbn.ndarray( 3, 5.0, x, 1, 0 ); +const v = sapxsumkbn.ndarray( 3, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); +const v = sapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,14 +130,14 @@ var v = sapxsumkbn.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sapxsumkbn( x.length, 5.0, x, 1 ); +const v = sapxsumkbn( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn2/README.md index 7c4d4b9c89df..69999bb29171 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); +const sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); ``` #### sapxsumkbn2( N, alpha, x, stride ) @@ -41,12 +41,12 @@ var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsumkbn2( N, 5.0, x, 1 ); +const v = sapxsumkbn2( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sapxsumkbn2( 4, 5.0, x, 2 ); +const v = sapxsumkbn2( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sapxsumkbn2( 4, 5.0, x1, 2 ); +const v = sapxsumkbn2( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,12 +86,12 @@ var v = sapxsumkbn2( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsumkbn2.ndarray( N, 5.0, x, 1, 0 ); +const v = sapxsumkbn2.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); +const v = sapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,14 +131,14 @@ var v = sapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sapxsumkbn2( x.length, 5.0, x, 1 ); +const v = sapxsumkbn2( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapxsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapxsumors/README.md index cd44b6d90dd7..0168d6bcaaee 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapxsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapxsumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); +const sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); ``` #### sapxsumors( N, alpha, x, stride ) @@ -41,11 +41,11 @@ var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sapxsumors( x.length, 5.0, x, 1 ); +const v = sapxsumors( x.length, 5.0, x, 1 ); // returns 16.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sapxsumors( 4, 5.0, x, 2 ); +const v = sapxsumors( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sapxsumors( 4, 5.0, x1, 2 ); +const v = sapxsumors( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -85,11 +85,11 @@ var v = sapxsumors( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sapxsumors.ndarray( x.length, 5.0, x, 1, 0 ); +const v = sapxsumors.ndarray( x.length, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sapxsumors.ndarray( 4, 5.0, x, 2, 1 ); +const v = sapxsumors.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,15 +130,15 @@ var v = sapxsumors.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sapxsumors( x.length, 5.0, x, 1 ); +const v = sapxsumors( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapxsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/sapxsumpw/README.md index 2ea223b640e5..788664056dd2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapxsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sapxsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); +const sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); ``` #### sapxsumpw( N, alpha, x, stride ) @@ -41,12 +41,12 @@ var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsumpw( N, 5.0, x, 1 ); +const v = sapxsumpw( N, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sapxsumpw( 4, 5.0, x, 2 ); +const v = sapxsumpw( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sapxsumpw( 4, 5.0, x1, 2 ); +const v = sapxsumpw( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,12 +86,12 @@ var v = sapxsumpw( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sapxsumpw.ndarray( N, 5.0, x, 1, 0 ); +const v = sapxsumpw.ndarray( N, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); +const v = sapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,15 +131,15 @@ var v = sapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sapxsumpw( x.length, 5.0, x, 1 ); +const v = sapxsumpw( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/sasumpw/README.md index 71d4acba54ec..71c2a838d857 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sasumpw/README.md @@ -48,7 +48,7 @@ The [_L1_ norm][l1norm] is defined as ## Usage ```javascript -var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); +const sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); ``` #### sasumpw( N, x, stride ) @@ -56,12 +56,12 @@ var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of single-precision floating-point strided array elements using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sasumpw( N, x, 1 ); +const v = sasumpw( N, x, 1 ); // returns 5.0 ``` @@ -74,11 +74,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sasumpw( 4, x, 2 ); +const v = sasumpw( 4, x, 2 ); // returns 9.0 ``` @@ -87,12 +87,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sasumpw( 4, x1, 2 ); +const v = sasumpw( 4, x1, 2 ); // returns 9.0 ``` @@ -101,12 +101,12 @@ var v = sasumpw( 4, x1, 2 ); Computes the sum of absolute values ([_L1_ norm][l1norm]) of single-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sasumpw.ndarray( N, x, 1, 0 ); +const v = sasumpw.ndarray( N, x, 1, 0 ); // returns 5.0 ``` @@ -117,11 +117,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of absolute values of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sasumpw.ndarray( 4, x, 2, 1 ); +const v = sasumpw.ndarray( 4, x, 2, 1 ); // returns 9.0 ``` @@ -147,14 +147,14 @@ var v = sasumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sasumpw( x.length, x, 1 ); +const v = sasumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/scusum/README.md b/lib/node_modules/@stdlib/blas/ext/base/scusum/README.md index fc090f8e6bf8..c2dcb8de495d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/scusum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/scusum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scusum = require( '@stdlib/blas/ext/base/scusum' ); +const scusum = require( '@stdlib/blas/ext/base/scusum' ); ``` #### scusum( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scusum = require( '@stdlib/blas/ext/base/scusum' ); Computes the cumulative sum of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +let x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float32Array( x.length ); scusum( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scusum( 4, 0.0, x, 2, y, 1 ); +const v = scusum( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scusum( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ scusum( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -148,13 +148,13 @@ scusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scusum = require( '@stdlib/blas/ext/base/scusum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scusum = require( '@stdlib/blas/ext/base/scusum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); -var y = new Float32Array( x.length ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const y = new Float32Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/scusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/scusumkbn/README.md index 9959aa54cf6a..0d1c47cdf64f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/scusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/scusumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); +const scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); ``` #### scusumkbn( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +let x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float32Array( x.length ); scusumkbn( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,11 +68,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const Float32Array = require( '@stdlib/array/float32' ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scusumkbn( 4, 0.0, x, 2, y, 1 ); +const v = scusumkbn( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -81,15 +81,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scusumkbn( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -100,10 +100,10 @@ scusumkbn( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( 3 ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( 3 ); scusumkbn.ndarray( 3, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -117,10 +117,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, offset parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scusumkbn.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -147,14 +147,14 @@ scusumkbn.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 10 ) ); +const y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 10 ) ); console.log( y ); scusumkbn( x.length, 0.0, x, 1, y, -1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/scusumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/scusumkbn2/README.md index 76711bfe20aa..39202b7abf31 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/scusumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/scusumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); +const scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); ``` #### scusumkbn2( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +let x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float32Array( x.length ); scusumkbn2( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scusumkbn2( 4, 0.0, x, 2, y, 1 ); +const v = scusumkbn2( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scusumkbn2( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ scusumkbn2( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( 3 ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( 3 ); scusumkbn2.ndarray( 3, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, offset parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scusumkbn2.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -148,15 +148,15 @@ scusumkbn2.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 10 ) ); +const y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 10 ) ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/scusumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/scusumors/README.md index bc247cf7aae6..b4d410f6709a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/scusumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/scusumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scusumors = require( '@stdlib/blas/ext/base/scusumors' ); +const scusumors = require( '@stdlib/blas/ext/base/scusumors' ); ``` #### scusumors( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scusumors = require( '@stdlib/blas/ext/base/scusumors' ); Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +let x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float32Array( x.length ); scusumors( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scusumors( 4, 0.0, x, 2, y, 1 ); +const v = scusumors( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scusumors( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ scusumors( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, offset parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scusumors.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -149,13 +149,13 @@ scusumors.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scusumors = require( '@stdlib/blas/ext/base/scusumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scusumors = require( '@stdlib/blas/ext/base/scusumors' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); -var y = new Float32Array( x.length ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const y = new Float32Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/scusumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/scusumpw/README.md index 99de471245d3..c802d5ccee30 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/scusumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/scusumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' ); +const scusumpw = require( '@stdlib/blas/ext/base/scusumpw' ); ``` #### scusumpw( N, sum, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' ); Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +let x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +let y = new Float32Array( x.length ); scusumpw( x.length, 0.0, x, 1, y, 1 ); // y => [ 1.0, -1.0, 1.0 ] @@ -68,12 +68,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scusumpw( 4, 0.0, x, 2, y, 1 ); +const v = scusumpw( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -82,15 +82,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scusumpw( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] @@ -101,10 +101,10 @@ scusumpw( 4, 0.0, x1, -2, y1, 1 ); Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scusumpw.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -1.0, 1.0 ] @@ -118,10 +118,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scusumpw.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] @@ -149,13 +149,13 @@ scusumpw.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scusumpw = require( '@stdlib/blas/ext/base/scusumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); -var y = new Float32Array( x.length ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const y = new Float32Array( x.length ); console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdsapxsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdsapxsum/README.md index d432f453d087..77c0d5da7a50 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdsapxsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdsapxsum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' ); +const sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' ); ``` #### sdsapxsum( N, alpha, x, stride ) @@ -41,11 +41,11 @@ var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sdsapxsum( 3, 5.0, x, 1 ); +const v = sdsapxsum( 3, 5.0, x, 1 ); // returns 16.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sdsapxsum( 4, 5.0, x, 2 ); +const v = sdsapxsum( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdsapxsum( 4, 5.0, x1, 2 ); +const v = sdsapxsum( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -85,11 +85,11 @@ var v = sdsapxsum( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sdsapxsum.ndarray( 3, 5.0, x, 1, 0 ); +const v = sdsapxsum.ndarray( 3, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdsapxsum.ndarray( 4, 5.0, x, 2, 1 ); +const v = sdsapxsum.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -130,14 +130,14 @@ var v = sdsapxsum.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sdsapxsum( x.length, 5.0, x, 1 ); +const v = sdsapxsum( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdsapxsumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdsapxsumpw/README.md index 2e81b95e5a86..fdc118fd44f9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdsapxsumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdsapxsumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' ); +const sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' ); ``` #### sdsapxsumpw( N, alpha, x, stride ) @@ -41,11 +41,11 @@ var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' ); Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sdsapxsumpw( 3, 5.0, x, 1 ); +const v = sdsapxsumpw( 3, 5.0, x, 1 ); // returns 16.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sdsapxsumpw( 4, 5.0, x, 2 ); +const v = sdsapxsumpw( 4, 5.0, x, 2 ); // returns 25.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdsapxsumpw( 4, 5.0, x1, 2 ); +const v = sdsapxsumpw( 4, 5.0, x1, 2 ); // returns 25.0 ``` @@ -86,11 +86,11 @@ var v = sdsapxsumpw( 4, 5.0, x1, 2 ); Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sdsapxsumpw.ndarray( 3, 5.0, x, 1, 0 ); +const v = sdsapxsumpw.ndarray( 3, 5.0, x, 1, 0 ); // returns 16.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); +const v = sdsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); // returns 25.0 ``` @@ -131,14 +131,14 @@ var v = sdsapxsumpw.ndarray( 4, 5.0, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sdsapxsumpw( x.length, 5.0, x, 1 ); +const v = sdsapxsumpw( x.length, 5.0, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdsnansum/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdsnansum/README.md index e7143da00c09..cc5e40cadeff 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdsnansum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdsnansum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' ); +const sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' ); ``` #### sdsnansum( N, x, stride ) @@ -41,11 +41,11 @@ var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = sdsnansum( 4, x, 1 ); +const v = sdsnansum( 4, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = sdsnansum( 4, x, 2 ); +const v = sdsnansum( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdsnansum( 4, x1, 2 ); +const v = sdsnansum( 4, x1, 2 ); // returns 5.0 ``` @@ -85,12 +85,12 @@ var v = sdsnansum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnansum.ndarray( N, x, 1, 0 ); +const v = sdsnansum.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdsnansum.ndarray( 4, x, 2, 1 ); +const v = sdsnansum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,10 +131,10 @@ var v = sdsnansum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' ); function randOrNan() { if ( bernoulli() < 0.2 ) { @@ -143,10 +143,10 @@ function randOrNan() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', randOrNan ); +const x = filledarrayBy( 10, 'float32', randOrNan ); console.log( x ); -var v = sdsnansum( x.length, x, 1 ); +const v = sdsnansum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdsnansumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdsnansumpw/README.md index 40404308719d..3cd26483f2f8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdsnansumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdsnansumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' ); +const sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' ); ``` #### sdsnansumpw( N, x, stride ) @@ -41,12 +41,12 @@ var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnansumpw( N, x, 1 ); +const v = sdsnansumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = sdsnansumpw( 4, x, 2 ); +const v = sdsnansumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdsnansumpw( 4, x1, 2 ); +const v = sdsnansumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = sdsnansumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = sdsnansumpw.ndarray( x.length, x, 1, 0 ); +const v = sdsnansumpw.ndarray( x.length, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdsnansumpw.ndarray( 4, x, 2, 1 ); +const v = sdsnansumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,10 +131,10 @@ var v = sdsnansumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' ); function randOrNan() { if ( bernoulli() < 0.2 ) { @@ -143,10 +143,10 @@ function randOrNan() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', randOrNan ); +const x = filledarrayBy( 10, 'float32', randOrNan ); console.log( x ); -var v = sdsnansumpw( x.length, x, 1 ); +const v = sdsnansumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdssum/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdssum/README.md index b9059ef33e2d..8bfc9fa71edc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdssum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdssum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdssum = require( '@stdlib/blas/ext/base/sdssum' ); +const sdssum = require( '@stdlib/blas/ext/base/sdssum' ); ``` #### sdssum( N, x, stride ) @@ -41,12 +41,12 @@ var sdssum = require( '@stdlib/blas/ext/base/sdssum' ); Computes the sum of single-precision floating-point strided array elements using extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdssum( N, x, 1 ); +const v = sdssum( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sdssum( 4, x, 2 ); +const v = sdssum( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdssum( 4, x1, 2 ); +const v = sdssum( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = sdssum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdssum.ndarray( N, x, 1, 0 ); +const v = sdssum.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdssum.ndarray( 4, x, 2, 1 ); +const v = sdssum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,15 +132,15 @@ var v = sdssum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdssum = require( '@stdlib/blas/ext/base/sdssum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdssum = require( '@stdlib/blas/ext/base/sdssum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sdssum( x.length, x, 1 ); +const v = sdssum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sdssumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/sdssumpw/README.md index 793abd441c2a..875f9763ed89 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sdssumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sdssumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); +const sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); ``` #### sdssumpw( N, x, stride ) @@ -41,12 +41,12 @@ var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdssumpw( N, x, 1 ); +const v = sdssumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = sdssumpw( 4, x, 2 ); +const v = sdssumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = sdssumpw( 4, x1, 2 ); +const v = sdssumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = sdssumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = sdssumpw.ndarray( 3, x, 1, 0 ); +const v = sdssumpw.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = sdssumpw.ndarray( 4, x, 2, 1 ); +const v = sdssumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,14 +131,14 @@ var v = sdssumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = sdssumpw( x.length, x, 1 ); +const v = sdssumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/sfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/sfill/README.md index 7f894b7b5ff8..52b1c3bed53c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/sfill/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sfill = require( '@stdlib/blas/ext/base/sfill' ); +const sfill = require( '@stdlib/blas/ext/base/sfill' ); ``` #### sfill( N, alpha, x, strideX ) @@ -35,9 +35,9 @@ var sfill = require( '@stdlib/blas/ext/base/sfill' ); Fills a single-precision floating-point strided array `x` with a specified scalar constant `alpha`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sfill( x.length, 5.0, x, 1 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sfill( 4, 5.0, x, 2 ); // x => [ 5.0, 1.0, 5.0, -5.0, 5.0, 0.0, 5.0, -3.0 ] @@ -64,13 +64,13 @@ sfill( 4, 5.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array... -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill every other element... sfill( 3, 5.0, x1, 2 ); @@ -82,9 +82,9 @@ sfill( 3, 5.0, x1, 2 ); Fills a single-precision floating-point strided array `x` with a specified scalar constant `alpha` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); sfill.ndarray( x.length, 5.0, x, 1, 0 ); // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); sfill.ndarray( 3, 5.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ] @@ -126,10 +126,10 @@ sfill.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var sfill = require( '@stdlib/blas/ext/base/sfill' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const sfill = require( '@stdlib/blas/ext/base/sfill' ); -var x = discreteUniform( 10, -100, 100, { +const x = discreteUniform( 10, -100, 100, { 'dtype': 'float32' }); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/snansum/README.md b/lib/node_modules/@stdlib/blas/ext/base/snansum/README.md index 1fa67a830175..9759cac2b20d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/snansum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/snansum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snansum = require( '@stdlib/blas/ext/base/snansum' ); +const snansum = require( '@stdlib/blas/ext/base/snansum' ); ``` #### snansum( N, x, stride ) @@ -41,11 +41,11 @@ var snansum = require( '@stdlib/blas/ext/base/snansum' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snansum( 4, x, 1 ); +const v = snansum( 4, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = snansum( 4, x, 2 ); +const v = snansum( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = snansum( 4, x1, 2 ); +const v = snansum( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = snansum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snansum.ndarray( 4, x, 1, 0 ); +const v = snansum.ndarray( 4, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = snansum.ndarray( 4, x, 2, 1 ); +const v = snansum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,10 +129,10 @@ var v = snansum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var snansum = require( '@stdlib/blas/ext/base/snansum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const snansum = require( '@stdlib/blas/ext/base/snansum' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -141,10 +141,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = snansum( x.length, x, 1 ); +const v = snansum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/snansumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/snansumkbn/README.md index 8d60e302b975..db66a5f111c3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/snansumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/snansumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); +const snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); ``` #### snansumkbn( N, x, stride ) @@ -41,12 +41,12 @@ var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snansumkbn( N, x, 1 ); +const v = snansumkbn( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = snansumkbn( 4, x, 2 ); +const v = snansumkbn( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = snansumkbn( 4, x1, 2 ); +const v = snansumkbn( 4, x1, 2 ); // returns 5.0 ``` @@ -86,11 +86,11 @@ var v = snansumkbn( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snansumkbn.ndarray( 4, x, 1, 0 ); +const v = snansumkbn.ndarray( 4, x, 1, 0 ); // returns 1.0 ``` @@ -101,11 +101,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = snansumkbn.ndarray( 4, x, 2, 1 ); +const v = snansumkbn.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -130,10 +130,10 @@ var v = snansumkbn.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -142,10 +142,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = snansumkbn( x.length, x, 1 ); +const v = snansumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/snansumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/snansumkbn2/README.md index befddaa0ee67..d5cae1bfe7cd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/snansumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/snansumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); +const snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); ``` #### snansumkbn2( N, x, stride ) @@ -41,11 +41,11 @@ var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snansumkbn2( 4, x, 1 ); +const v = snansumkbn2( 4, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = snansumkbn2( 4, x, 2 ); +const v = snansumkbn2( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = snansumkbn2( 4, x1, 2 ); +const v = snansumkbn2( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = snansumkbn2( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snansumkbn2.ndarray( 4, x, 1, 0 ); +const v = snansumkbn2.ndarray( 4, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = snansumkbn2.ndarray( 4, x, 2, 1 ); +const v = snansumkbn2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,10 +129,10 @@ var v = snansumkbn2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { @@ -141,10 +141,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = snansumkbn2( x.length, x, 1 ); +const v = snansumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/snansumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/snansumors/README.md index 95c9f6665e35..0c3ccbd97362 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/snansumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/snansumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snansumors = require( '@stdlib/blas/ext/base/snansumors' ); +const snansumors = require( '@stdlib/blas/ext/base/snansumors' ); ``` #### snansumors( N, x, stride ) @@ -41,12 +41,12 @@ var snansumors = require( '@stdlib/blas/ext/base/snansumors' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snansumors( N, x, 1 ); +const v = snansumors( N, x, 1 ); // returns 1.0 ``` @@ -61,12 +61,12 @@ accessed at runtime. For example, to compute the sum of every other element in the strided array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var N = 4; +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const N = 4; -var v = snansumors( N, x, 2 ); +const v = snansumors( N, x, 2 ); // returns 5.0 ``` @@ -75,12 +75,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = snansumors( 4, x1, 2 ); +const v = snansumors( 4, x1, 2 ); // returns 5.0 ``` @@ -89,12 +89,12 @@ var v = snansumors( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snansumors.ndarray( N, x, 1, 0 ); +const v = snansumors.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -105,11 +105,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = snansumors.ndarray( 4, x, 2, 1 ); +const v = snansumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -135,10 +135,10 @@ var v = snansumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var snansumors = require( '@stdlib/blas/ext/base/snansumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const snansumors = require( '@stdlib/blas/ext/base/snansumors' ); function rand() { if ( bernoulli( 0.7 ) > 0 ) { @@ -147,10 +147,10 @@ function rand() { return NaN; } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = snansumors( x.length, x, 1 ); +const v = snansumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/snansumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/snansumpw/README.md index 7eb812cb24fb..55e5bb6e8151 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/snansumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/snansumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); +const snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); ``` #### snansumpw( N, x, stride ) @@ -41,12 +41,12 @@ var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snansumpw( N, x, 1 ); +const v = snansumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] ); -var v = snansumpw( 4, x, 2 ); +const v = snansumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = snansumpw( 4, x1, 2 ); +const v = snansumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = snansumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snansumpw.ndarray( N, x, 1, 0 ); +const v = snansumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = snansumpw.ndarray( 4, x, 2, 1 ); +const v = snansumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,10 +132,10 @@ var v = snansumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); function rand() { if ( bernoulli( 0.2 ) > 0 ) { @@ -144,10 +144,10 @@ function rand() { return discreteUniform( 0, 100 ); } -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); -var v = snansumpw( x.length, x, 1 ); +const v = snansumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/srev/README.md b/lib/node_modules/@stdlib/blas/ext/base/srev/README.md index d9b2cbd85f17..8ded8a7993ec 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/srev/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/srev/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var srev = require( '@stdlib/blas/ext/base/srev' ); +const srev = require( '@stdlib/blas/ext/base/srev' ); ``` #### srev( N, x, stride ) @@ -35,9 +35,9 @@ var srev = require( '@stdlib/blas/ext/base/srev' ); Reverses a single-precision floating-point strided array `x` in-place. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); srev( x.length, x, 1 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -52,9 +52,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to reverse every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); srev( 4, x, 2 ); // x => [ -1.0, 1.0, 4.0, -5.0, 3.0, 0.0, -2.0, -3.0 ] @@ -63,13 +63,13 @@ srev( 4, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array... -var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Reverse every other element... srev( 3, x1, 2 ); @@ -81,9 +81,9 @@ srev( 3, x1, 2 ); Reverses a single-precision floating-point strided array `x` in-place using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); srev.ndarray( x.length, x, 1, 0 ); // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ] @@ -96,9 +96,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); srev.ndarray( 3, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ] @@ -126,13 +126,13 @@ srev.ndarray( 3, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var srev = require( '@stdlib/blas/ext/base/srev' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const srev = require( '@stdlib/blas/ext/base/srev' ); -var rand = discreteUniform( -100, 100 ); +const rand = discreteUniform( -100, 100 ); -var x = filledarrayBy( 10, 'float32', rand ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); srev( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2hp/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssort2hp/README.md index af9e422f3c61..078b6f993f20 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2hp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2hp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); +const ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); ``` #### ssort2hp( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using heapsort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2hp( x.length, 1.0, x, 1, y, 1 ); @@ -61,10 +61,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2hp( 2, -1.0, x, 2, y, 2 ); @@ -78,15 +78,15 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... ssort2hp( 2, -1.0, x1, 2, y1, 2 ); @@ -103,10 +103,10 @@ console.log( y0 ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using heapsort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2hp.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); ssort2hp.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -165,20 +165,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); - -var rand; -var sign; -var i; - -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md index 6bd9409cd2aa..3599039e9b81 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); +const ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); ``` #### ssort2ins( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using insertion sort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2ins( x.length, 1.0, x, 1, y, 1 ); @@ -61,9 +61,9 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const Float32Array = require( '@stdlib/array/float32' ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2ins( 2, -1.0, x, 2, y, 2 ); @@ -77,15 +77,15 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... ssort2ins( 2, -1.0, x1, 2, y1, 2 ); @@ -102,10 +102,10 @@ console.log( y0 ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array the strided array using insertion sort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2ins.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -124,10 +124,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); ssort2ins.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -165,22 +165,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); - -var rand; -var sign; -var x; -var y; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2sh/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssort2sh/README.md index 0cd09a49dd48..6b05b93c424a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2sh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2sh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' ); +const ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' ); ``` #### ssort2sh( N, order, x, strideX, y, strideY ) @@ -35,10 +35,10 @@ var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using Shellsort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2sh( x.length, 1.0, x, 1, y, 1 ); @@ -61,10 +61,10 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2sh( 2, -1.0, x, 2, y, 2 ); @@ -78,15 +78,15 @@ console.log( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... ssort2sh( 2, -1.0, x1, 2, y1, 2 ); @@ -103,10 +103,10 @@ console.log( y0 ); Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using Shellsort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); ssort2sh.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 ); @@ -125,10 +125,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); ssort2sh.ndarray( 3, 1.0, x, 1, x.length-3, y, 1, y.length-3 ); @@ -166,20 +166,16 @@ console.log( y ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' ); - -var rand; -var sign; -var i; - -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); // index array +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssorthp/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssorthp/README.md index 5f0b462a8db9..3b8bd7828213 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssorthp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssorthp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' ); +const ssorthp = require( '@stdlib/blas/ext/base/ssorthp' ); ``` #### ssorthp( N, order, x, stride ) @@ -35,9 +35,9 @@ var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' ); Sorts a single-precision floating-point strided array using heapsort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssorthp( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssorthp( 2, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -64,13 +64,13 @@ ssorthp( 2, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // Sort every other element... ssorthp( 2, -1.0, x1, 2 ); @@ -82,9 +82,9 @@ ssorthp( 2, -1.0, x1, 2 ); Sorts a single-precision floating-point strided array using heapsort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssorthp.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); ssorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -131,12 +131,12 @@ ssorthp.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssorthp = require( '@stdlib/blas/ext/base/ssorthp' ); -var rand = discreteUniform( -100, 100 ); -var x = filledarrayBy( 10, 'float32', rand ); +const rand = discreteUniform( -100, 100 ); +const x = filledarrayBy( 10, 'float32', rand ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssortins/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssortins/README.md index 20d57a82e474..0d5334b6b9de 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssortins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssortins/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssortins = require( '@stdlib/blas/ext/base/ssortins' ); +const ssortins = require( '@stdlib/blas/ext/base/ssortins' ); ``` #### ssortins( N, order, x, stride ) @@ -35,9 +35,9 @@ var ssortins = require( '@stdlib/blas/ext/base/ssortins' ); Sorts a single-precision floating-point strided array `x` using insertion sort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssortins( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,9 +53,9 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssortins( 2, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -64,13 +64,13 @@ ssortins( 2, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Sort every other element... ssortins( 2, -1.0, x1, 2 ); @@ -82,9 +82,9 @@ ssortins( 2, -1.0, x1, 2 ); Sorts a single-precision floating-point strided array `x` using insertion sort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssortins.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -97,9 +97,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); ssortins.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -132,19 +132,15 @@ ssortins.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssortins = require( '@stdlib/blas/ext/base/ssortins' ); - -var rand; -var sign; -var i; - -var x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssortins = require( '@stdlib/blas/ext/base/ssortins' ); + +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssortsh/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssortsh/README.md index 069608bf7ddb..523c6dfad86b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssortsh/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssortsh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' ); +const ssortsh = require( '@stdlib/blas/ext/base/ssortsh' ); ``` #### ssortsh( N, order, x, stride ) @@ -35,9 +35,9 @@ var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' ); Sorts a single-precision floating-point strided array `x` using Shellsort. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssortsh( x.length, 1.0, x, 1 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -53,11 +53,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const N = floor( x.length / 2 ); ssortsh( N, -1.0, x, 2 ); // x => [ 3.0, -2.0, 1.0, -4.0 ] @@ -66,15 +66,15 @@ ssortsh( N, -1.0, x, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial array... -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Sort every other element... ssortsh( N, -1.0, x1, 2 ); @@ -86,9 +86,9 @@ ssortsh( N, -1.0, x1, 2 ); Sorts a single-precision floating-point strided array `x` using Shellsort and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); ssortsh.ndarray( x.length, 1.0, x, 1, 0 ); // x => [ -4.0, -2.0, 1.0, 3.0 ] @@ -101,9 +101,9 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); ssortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); // x => [ 1.0, -2.0, 3.0, -6.0, -4.0, 5.0 ] @@ -136,20 +136,15 @@ ssortsh.ndarray( 3, 1.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' ); - -var rand; -var sign; -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssortsh = require( '@stdlib/blas/ext/base/ssortsh' ); + +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { + const rand = round( randu()*100.0 ); + let sign = randu(); if ( sign < 0.5 ) { sign = -1.0; } else { diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssum/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssum/README.md index 0a1e56b9f959..62837f3fbb2f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssum/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssum = require( '@stdlib/blas/ext/base/ssum' ); +const ssum = require( '@stdlib/blas/ext/base/ssum' ); ``` #### ssum( N, x, stride ) @@ -41,12 +41,12 @@ var ssum = require( '@stdlib/blas/ext/base/ssum' ); Computes the sum of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssum( N, x, 1 ); +const v = ssum( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = ssum( 4, x, 2 ); +const v = ssum( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = ssum( 4, x1, 2 ); +const v = ssum( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = ssum( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssum.ndarray( N, x, 1, 0 ); +const v = ssum.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = ssum.ndarray( 4, x, 2, 1 ); +const v = ssum.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,14 +131,14 @@ var v = ssum.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssum = require( '@stdlib/blas/ext/base/ssum' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssum = require( '@stdlib/blas/ext/base/ssum' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = ssum( x.length, x, 1 ); +const v = ssum( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssumkbn/README.md index 1a9993dc975f..01c264f13087 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssumkbn/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); +const ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); ``` #### ssumkbn( N, x, stride ) @@ -41,12 +41,12 @@ var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); Computes the sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumkbn( N, x, 1 ); +const v = ssumkbn( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = ssumkbn( 4, x, 2 ); +const v = ssumkbn( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = ssumkbn( 4, x1, 2 ); +const v = ssumkbn( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = ssumkbn( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumkbn.ndarray( N, x, 1, 0 ); +const v = ssumkbn.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = ssumkbn.ndarray( 4, x, 2, 1 ); +const v = ssumkbn.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -131,14 +131,14 @@ var v = ssumkbn.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = ssumkbn( x.length, x, 1 ); +const v = ssumkbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssumkbn2/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssumkbn2/README.md index 559b9b5ba945..74aa18b6502c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssumkbn2/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssumkbn2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); +const ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); ``` #### ssumkbn2( N, x, stride ) @@ -41,11 +41,11 @@ var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = ssumkbn2( 3, x, 1 ); +const v = ssumkbn2( 3, x, 1 ); // returns 1.0 ``` @@ -58,11 +58,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = ssumkbn2( 4, x, 2 ); +const v = ssumkbn2( 4, x, 2 ); // returns 5.0 ``` @@ -71,12 +71,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = ssumkbn2( 4, x1, 2 ); +const v = ssumkbn2( 4, x1, 2 ); // returns 5.0 ``` @@ -85,11 +85,11 @@ var v = ssumkbn2( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = ssumkbn2.ndarray( 3, x, 1, 0 ); +const v = ssumkbn2.ndarray( 3, x, 1, 0 ); // returns 1.0 ``` @@ -100,11 +100,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in the strided array starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = ssumkbn2.ndarray( 4, x, 2, 1 ); +const v = ssumkbn2.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -129,14 +129,14 @@ var v = ssumkbn2.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = ssumkbn2( x.length, x, 1 ); +const v = ssumkbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssumors/README.md index 1bb2708c2ad7..cceca0e0a5d4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssumors/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssumors = require( '@stdlib/blas/ext/base/ssumors' ); +const ssumors = require( '@stdlib/blas/ext/base/ssumors' ); ``` #### ssumors( N, x, stride ) @@ -41,12 +41,12 @@ var ssumors = require( '@stdlib/blas/ext/base/ssumors' ); Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumors( N, x, 1 ); +const v = ssumors( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = ssumors( 4, x, 2 ); +const v = ssumors( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = ssumors( 4, x1, 2 ); +const v = ssumors( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = ssumors( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumors.ndarray( N, x, 1, 0 ); +const v = ssumors.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = ssumors.ndarray( 4, x, 2, 1 ); +const v = ssumors.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,14 +132,14 @@ var v = ssumors.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssumors = require( '@stdlib/blas/ext/base/ssumors' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssumors = require( '@stdlib/blas/ext/base/ssumors' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( -100.0, 100.0 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( -100.0, 100.0 ) ); console.log( x ); -var v = ssumors( x.length, x, 1 ); +const v = ssumors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssumpw/README.md index 0409c0431cc4..d0e6d91ff47b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssumpw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); +const ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); ``` #### ssumpw( N, x, stride ) @@ -41,12 +41,12 @@ var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); Computes the sum of single-precision floating-point strided array elements using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumpw( N, x, 1 ); +const v = ssumpw( N, x, 1 ); // returns 1.0 ``` @@ -59,11 +59,11 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var v = ssumpw( 4, x, 2 ); +const v = ssumpw( 4, x, 2 ); // returns 5.0 ``` @@ -72,12 +72,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = ssumpw( 4, x1, 2 ); +const v = ssumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -86,12 +86,12 @@ var v = ssumpw( 4, x1, 2 ); Computes the sum of single-precision floating-point strided array elements using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = ssumpw.ndarray( N, x, 1, 0 ); +const v = ssumpw.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,11 +102,11 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var v = ssumpw.ndarray( 4, x, 2, 1 ); +const v = ssumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -132,14 +132,14 @@ var v = ssumpw.ndarray( 4, x, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); -var v = ssumpw( x.length, x, 1 ); +const v = ssumpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/zfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/zfill/README.md index e7f654351051..c2e965f1d337 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/zfill/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var zfill = require( '@stdlib/blas/ext/base/zfill' ); +const zfill = require( '@stdlib/blas/ext/base/zfill' ); ``` #### zfill( N, alpha, x, strideX ) @@ -35,26 +35,26 @@ var zfill = require( '@stdlib/blas/ext/base/zfill' ); Fills a double-precision complex floating-point strided array `x` with a specified scalar constant `alpha`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex128Array( arr ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( arr ); -var alpha = new Complex128( 10.0, 10.0 ); +const alpha = new Complex128( 10.0, 10.0 ); zfill( x.length, alpha, x, 1 ); -var y = x.get( 0 ); +const y = x.get( 0 ); // returns -var re = real( y ); +const re = real( y ); // returns 10.0 -var im = imag( y ); +const im = imag( y ); // returns 10.0 ``` @@ -68,26 +68,26 @@ The function has the following parameters: The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex128Array( arr ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( arr ); -var alpha = new Complex128( 10.0, 10.0 ); +const alpha = new Complex128( 10.0, 10.0 ); zfill( 2, alpha, x, 2 ); -var y = x.get( 0 ); +let y = x.get( 0 ); // returns -var re = real( y ); +let re = real( y ); // returns 10.0 -var im = imag( y ); +let im = imag( y ); // returns 10.0 y = x.get( 1 ); @@ -103,34 +103,34 @@ im = imag( y ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Create the underlying floating-point array: -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Initial array: -var x0 = new Complex128Array( arr ); +const x0 = new Complex128Array( arr ); // Create an offset view: -var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Define a scalar constant: -var alpha = new Complex128( 10.0, 10.0 ); +const alpha = new Complex128( 10.0, 10.0 ); // Fill every other element: zfill( 2, alpha, x1, 2 ); -var y = x0.get( 0 ); +let y = x0.get( 0 ); // returns -var re = real( y ); +let re = real( y ); // returns 1.0 -var im = imag( y ); +let im = imag( y ); // returns 2.0 y = x0.get( 1 ); @@ -148,26 +148,26 @@ im = imag( y ); Fills a double-precision complex floating-point strided array `x` with a specified scalar constant `alpha` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var x = new Complex128Array( arr ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( arr ); -var alpha = new Complex128( 10.0, 10.0 ); +const alpha = new Complex128( 10.0, 10.0 ); zfill.ndarray( x.length, alpha, x, 1, 0 ); -var y = x.get( 0 ); +const y = x.get( 0 ); // returns -var re = real( y ); +const re = real( y ); // returns 10.0 -var im = imag( y ); +const im = imag( y ); // returns 10.0 ``` @@ -178,26 +178,26 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last two elements of the strided array ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x = new Complex128Array( arr ); +const arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x = new Complex128Array( arr ); -var alpha = new Complex128( 10.0, 10.0 ); +const alpha = new Complex128( 10.0, 10.0 ); zfill.ndarray( 2, alpha, x, 1, x.length-2 ); -var y = x.get( 0 ); +let y = x.get( 0 ); // returns -var re = real( y ); +let re = real( y ); // returns 1.0 -var im = imag( y ); +let im = imag( y ); // returns 2.0 y = x.get( 1 ); @@ -240,16 +240,16 @@ im = imag( y ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var zfill = require( '@stdlib/blas/ext/base/zfill' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const zfill = require( '@stdlib/blas/ext/base/zfill' ); -var xbuf = discreteUniform( 20, -100, 100, { +const xbuf = discreteUniform( 20, -100, 100, { 'dtype': 'float64' }); -var x = new Complex128Array( xbuf.buffer ); -var alpha = new Complex128( 10.0, 10.0 ); +const x = new Complex128Array( xbuf.buffer ); +const alpha = new Complex128( 10.0, 10.0 ); zfill( x.length, alpha, x, 1 ); console.log( x.get( 0 ).toString() ); diff --git a/lib/node_modules/@stdlib/blas/gdot/README.md b/lib/node_modules/@stdlib/blas/gdot/README.md index 78e64529d814..e03b6c010c10 100644 --- a/lib/node_modules/@stdlib/blas/gdot/README.md +++ b/lib/node_modules/@stdlib/blas/gdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var gdot = require( '@stdlib/blas/gdot' ); +const gdot = require( '@stdlib/blas/gdot' ); ``` #### gdot( x, y ) @@ -56,13 +56,13 @@ var gdot = require( '@stdlib/blas/gdot' ); Calculates the dot product of vectors `x` and `y`. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var array = require( '@stdlib/ndarray/array' ); +const Int32Array = require( '@stdlib/array/int32' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Int32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Int32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Int32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Int32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); -var z = gdot( x, y ); +const z = gdot( x, y ); // returns -5.0 ``` @@ -74,7 +74,7 @@ The function has the following parameters: If provided empty vectors, the function returns `0.0`. ```javascript -var z = gdot( [], [] ); +const z = gdot( [], [] ); // returns 0.0 ``` @@ -100,23 +100,22 @@ var z = gdot( [], [] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var gdot = require( '@stdlib/blas/gdot' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const gdot = require( '@stdlib/blas/gdot' ); -var rand1 = discreteUniform.factory( 0, 100 ); -var rand2 = discreteUniform.factory( 0, 10 ); +const rand1 = discreteUniform.factory( 0, 100 ); +const rand2 = discreteUniform.factory( 0, 10 ); -var x = []; -var y = []; -var i; -for ( i = 0; i < 10; i++ ) { +const x = []; +const y = []; +for ( let i = 0; i < 10; i++ ) { x.push( rand1() ); y.push( rand2() ); } console.log( x ); console.log( y ); -var z = gdot( x, y ); +const z = gdot( x, y ); console.log( z ); ``` diff --git a/lib/node_modules/@stdlib/blas/gswap/README.md b/lib/node_modules/@stdlib/blas/gswap/README.md index 45fa45ab53ec..7de58531c061 100644 --- a/lib/node_modules/@stdlib/blas/gswap/README.md +++ b/lib/node_modules/@stdlib/blas/gswap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var gswap = require( '@stdlib/blas/gswap' ); +const gswap = require( '@stdlib/blas/gswap' ); ``` #### gswap( x, y ) @@ -41,18 +41,18 @@ var gswap = require( '@stdlib/blas/gswap' ); Interchanges two vectors `x` and `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); gswap( x, y ); -var xbuf = x.data; +const xbuf = x.data; // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ] -var ybuf = y.data; +const ybuf = y.data; // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ``` @@ -83,16 +83,16 @@ The function has the following parameters: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var gswap = require( '@stdlib/blas/gswap' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const gswap = require( '@stdlib/blas/gswap' ); -var rand1 = discreteUniform( 0, 100 ); -var x = filledarrayBy( 10, 'generic', rand1 ); +const rand1 = discreteUniform( 0, 100 ); +const x = filledarrayBy( 10, 'generic', rand1 ); console.log( x ); -var rand2 = discreteUniform( 0, 10 ); -var y = filledarrayBy( 10, 'generic', rand2 ); +const rand2 = discreteUniform( 0, 10 ); +const y = filledarrayBy( 10, 'generic', rand2 ); console.log( y ); gswap( x, y ); diff --git a/lib/node_modules/@stdlib/blas/sdot/README.md b/lib/node_modules/@stdlib/blas/sdot/README.md index 3590f0f28b03..968bd727edab 100644 --- a/lib/node_modules/@stdlib/blas/sdot/README.md +++ b/lib/node_modules/@stdlib/blas/sdot/README.md @@ -48,7 +48,7 @@ The [dot product][dot-product] (or scalar product) is defined as ## Usage ```javascript -var sdot = require( '@stdlib/blas/sdot' ); +const sdot = require( '@stdlib/blas/sdot' ); ``` #### sdot( x, y\[, dim] ) @@ -56,16 +56,16 @@ var sdot = require( '@stdlib/blas/sdot' ); Calculates the dot product of two single-precision floating-point vectors `x` and `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var array = require( '@stdlib/ndarray/array' ); +const Float32Array = require( '@stdlib/array/float32' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); -var z = sdot( x, y ); +const z = sdot( x, y ); // returns -var v = z.get(); +const v = z.get(); // returns -5.0 ``` @@ -78,22 +78,22 @@ The function has the following parameters: If provided at least one input [`ndarray`][@stdlib/ndarray/ctor] having more than one dimension, the input [`ndarrays`][@stdlib/ndarray/ctor] are [broadcasted][@stdlib/ndarray/base/broadcast-shapes] to a common shape. For multi-dimensional input [`ndarrays`][@stdlib/ndarray/ctor], the function performs batched computation, such that the function computes the dot product for each pair of vectors in `x` and `y` according to the specified dimension index. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var array = require( '@stdlib/ndarray/array' ); +const Float32Array = require( '@stdlib/array/float32' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'shape': [ 2, 3 ] }; -var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); -var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); +const x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); +const y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); -var z = sdot( x, y ); +const z = sdot( x, y ); // returns -var v1 = z.get( 0 ); +const v1 = z.get( 0 ); // returns 23.0 -var v2 = z.get( 1 ); +const v2 = z.get( 1 ); // returns -22.0 ``` @@ -123,26 +123,26 @@ var v2 = z.get( 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var sdot = require( '@stdlib/blas/sdot' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const sdot = require( '@stdlib/blas/sdot' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = array( discreteUniform( 10, 0, 100, opts ), { +const x = array( discreteUniform( 10, 0, 100, opts ), { 'shape': [ 5, 2 ] }); console.log( ndarray2array( x ) ); -var y = array( discreteUniform( 10, 0, 10, opts ), { +const y = array( discreteUniform( 10, 0, 10, opts ), { 'shape': x.shape }); console.log( ndarray2array( y ) ); -var z = sdot( x, y, -1 ); +const z = sdot( x, y, -1 ); console.log( ndarray2array( z ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/sswap/README.md b/lib/node_modules/@stdlib/blas/sswap/README.md index 81d0baf2c3dc..7331538a3aa7 100644 --- a/lib/node_modules/@stdlib/blas/sswap/README.md +++ b/lib/node_modules/@stdlib/blas/sswap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sswap = require( '@stdlib/blas/sswap' ); +const sswap = require( '@stdlib/blas/sswap' ); ``` #### sswap( x, y\[, dim] ) @@ -41,18 +41,18 @@ var sswap = require( '@stdlib/blas/sswap' ); Interchanges two single-precision floating-point vectors `x` and `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var array = require( '@stdlib/ndarray/array' ); +const Float32Array = require( '@stdlib/array/float32' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); sswap( x, y ); -var xbuf = x.data; +const xbuf = x.data; // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ] -var ybuf = y.data; +const ybuf = y.data; // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ``` @@ -65,19 +65,19 @@ The function has the following parameters: For multi-dimensional input [`ndarrays`][@stdlib/ndarray/ctor], the function performs batched computation, such that the function interchanges each pair of vectors in `x` and `y` according to the specified dimension index. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var array = require( '@stdlib/ndarray/array' ); +const Float32Array = require( '@stdlib/array/float32' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'shape': [ 2, 3 ] }; -var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); -var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); +const x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); +const y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); -var v1 = x.get( 0, 0 ); +let v1 = x.get( 0, 0 ); // returns 4.0 -var v2 = y.get( 0, 0 ); +let v2 = y.get( 0, 0 ); // returns 2.0 sswap( x, y ); @@ -113,21 +113,21 @@ v2 = y.get( 0, 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var sswap = require( '@stdlib/blas/sswap' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const sswap = require( '@stdlib/blas/sswap' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = array( discreteUniform( 10, 0, 100, opts ), { +const x = array( discreteUniform( 10, 0, 100, opts ), { 'shape': [ 5, 2 ] }); console.log( ndarray2array( x ) ); -var y = array( discreteUniform( 10, 0, 10, opts ), { +const y = array( discreteUniform( 10, 0, 10, opts ), { 'shape': x.shape }); console.log( ndarray2array( y ) ); diff --git a/lib/node_modules/@stdlib/blas/tools/README.md b/lib/node_modules/@stdlib/blas/tools/README.md index f2164d3830f1..3be71f343dbd 100644 --- a/lib/node_modules/@stdlib/blas/tools/README.md +++ b/lib/node_modules/@stdlib/blas/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/blas/tools' ); +const ns = require( '@stdlib/blas/tools' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/blas/tools' ); Namespace for basic linear algebra subprograms (BLAS) tools. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/blas/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/blas/tools' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/blas/tools/swap-factory/README.md b/lib/node_modules/@stdlib/blas/tools/swap-factory/README.md index 9cfcdd7439cd..85afa5768f77 100644 --- a/lib/node_modules/@stdlib/blas/tools/swap-factory/README.md +++ b/lib/node_modules/@stdlib/blas/tools/swap-factory/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var factory = require( '@stdlib/blas/tools/swap-factory' ); +const factory = require( '@stdlib/blas/tools/swap-factory' ); ``` #### factory( base, dtype ) @@ -41,9 +41,9 @@ var factory = require( '@stdlib/blas/tools/swap-factory' ); Returns a function which interchanges two vectors. ```javascript -var dswap = require( '@stdlib/blas/base/dswap' ).ndarray; +const dswap = require( '@stdlib/blas/base/dswap' ).ndarray; -var swap = factory( dswap, 'float64' ); +const swap = factory( dswap, 'float64' ); ``` The function has the following parameters: @@ -56,21 +56,21 @@ The function has the following parameters: Interchanges two vectors. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); -var dswap = require( '@stdlib/blas/base/dswap' ).ndarray; +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); +const dswap = require( '@stdlib/blas/base/dswap' ).ndarray; -var swap = factory( dswap, 'float64' ); +const swap = factory( dswap, 'float64' ); -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); swap( x, y ); -var xbuf = x.data; +const xbuf = x.data; // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ] -var ybuf = y.data; +const ybuf = y.data; // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ``` @@ -83,22 +83,22 @@ The returned function has the following parameters: For multi-dimensional input [`ndarrays`][@stdlib/ndarray/ctor], the function performs batched computation, such that the function interchanges each pair of vectors in `x` and `y` according to the specified dimension index. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); -var dswap = require( '@stdlib/blas/base/dswap' ).ndarray; +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); +const dswap = require( '@stdlib/blas/base/dswap' ).ndarray; -var swap = factory( dswap, 'float64' ); +const swap = factory( dswap, 'float64' ); -var opts = { +const opts = { 'shape': [ 2, 3 ] }; -var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); -var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); +const x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); +const y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); -var v1 = x.get( 0, 0 ); +let v1 = x.get( 0, 0 ); // returns 4.0 -var v2 = y.get( 0, 0 ); +let v2 = y.get( 0, 0 ); // returns 2.0 swap( x, y ); @@ -135,24 +135,24 @@ For the returned function, ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var dswap = require( '@stdlib/blas/base/dswap' ).ndarray; -var factory = require( '@stdlib/blas/tools/swap-factory' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const dswap = require( '@stdlib/blas/base/dswap' ).ndarray; +const factory = require( '@stdlib/blas/tools/swap-factory' ); -var swap = factory( dswap, 'float64' ); +const swap = factory( dswap, 'float64' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var x = array( discreteUniform( 10, 0, 100, opts ), { +const x = array( discreteUniform( 10, 0, 100, opts ), { 'shape': [ 5, 2 ] }); console.log( ndarray2array( x ) ); -var y = array( discreteUniform( 10, 0, 10, opts ), { +const y = array( discreteUniform( 10, 0, 10, opts ), { 'shape': x.shape }); console.log( ndarray2array( y ) ); diff --git a/lib/node_modules/@stdlib/boolean/README.md b/lib/node_modules/@stdlib/boolean/README.md index b185d3009d7b..84c5b6506221 100644 --- a/lib/node_modules/@stdlib/boolean/README.md +++ b/lib/node_modules/@stdlib/boolean/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/boolean' ); +const ns = require( '@stdlib/boolean' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/boolean' ); Boolean namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/boolean' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/boolean' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/boolean/ctor/README.md b/lib/node_modules/@stdlib/boolean/ctor/README.md index 9250a7e77fd7..e3c733935ea6 100644 --- a/lib/node_modules/@stdlib/boolean/ctor/README.md +++ b/lib/node_modules/@stdlib/boolean/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Boolean = require( '@stdlib/boolean/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); ``` #### Boolean( value ) @@ -47,14 +47,14 @@ Returns a `Boolean` object, which is an object wrapper for a primitive boolean v ```javascript -var b = new Boolean( null ); +const b = new Boolean( null ); // returns ``` When invoked without `new`, the function converts an input value to a primitive boolean value. ```javascript -var b = Boolean( null ); +const b = Boolean( null ); // returns false ``` @@ -69,8 +69,8 @@ var b = Boolean( null ); Returns a string representation of the boolean value. ```javascript -var b = new Boolean( true ); -var str = b.toString(); +const b = new Boolean( true ); +const str = b.toString(); // returns 'true' ``` @@ -79,8 +79,8 @@ var str = b.toString(); Returns the primitive value of the boolean object. ```javascript -var b = new Boolean( true ); -var val = b.valueOf(); +let b = new Boolean( true ); +let val = b.valueOf(); // returns true b = new Boolean(); @@ -120,10 +120,10 @@ val = b.valueOf(); ```javascript -var format = require( '@stdlib/string/format' ); -var Bool = require( '@stdlib/boolean/ctor' ); +const format = require( '@stdlib/string/format' ); +const Bool = require( '@stdlib/boolean/ctor' ); -var values = [ +const values = [ '5', 5, 0, @@ -136,8 +136,7 @@ var values = [ {} ]; -var i; -for ( i = 0; i < values.length; i++ ) { +for ( let i = 0; i < values.length; i++ ) { console.log( format( '%s => %s', JSON.stringify( values[ i ] ), ( Bool( values[ i ] ) ) ? 'true' : 'false' ) ); } ``` diff --git a/lib/node_modules/@stdlib/buffer/README.md b/lib/node_modules/@stdlib/buffer/README.md index 83a852fb8c7a..ca380718d9ec 100644 --- a/lib/node_modules/@stdlib/buffer/README.md +++ b/lib/node_modules/@stdlib/buffer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/buffer' ); +const ns = require( '@stdlib/buffer' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/buffer' ); Buffer namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -70,8 +70,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/buffer' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/buffer' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/buffer/alloc-unsafe/README.md b/lib/node_modules/@stdlib/buffer/alloc-unsafe/README.md index fd58aa5b5a1c..16d60663ee66 100644 --- a/lib/node_modules/@stdlib/buffer/alloc-unsafe/README.md +++ b/lib/node_modules/@stdlib/buffer/alloc-unsafe/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); +const allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); ``` #### allocUnsafe( size ) @@ -45,7 +45,7 @@ var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); **Unsafely** allocates a [buffer][@stdlib/buffer/ctor] having a specified number of bytes. ```javascript -var buf = allocUnsafe( 10 ); +const buf = allocUnsafe( 10 ); // returns ``` @@ -75,14 +75,11 @@ var buf = allocUnsafe( 10 ); ```javascript -var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); - -var buf; -var i; +const allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); // Repeatedly unsafely allocate memory and inspect the buffer contents... -for ( i = 0; i < 100; i++ ) { - buf = allocUnsafe( 100 ); +for ( let i = 0; i < 100; i++ ) { + const buf = allocUnsafe( 100 ); console.log( buf.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/buffer/ctor/README.md b/lib/node_modules/@stdlib/buffer/ctor/README.md index 3d39794a1a2b..cdb8b68e6041 100644 --- a/lib/node_modules/@stdlib/buffer/ctor/README.md +++ b/lib/node_modules/@stdlib/buffer/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Buffer = require( '@stdlib/buffer/ctor' ); +const Buffer = require( '@stdlib/buffer/ctor' ); ``` #### Buffer( size ) @@ -47,7 +47,7 @@ Allocates a [`Buffer`][node-buffer] having a specified number of bytes. ```javascript -var b = new Buffer( 10 ); +const b = new Buffer( 10 ); // returns ``` @@ -58,7 +58,7 @@ Allocates a [`Buffer`][node-buffer] from an array of octets. ```javascript -var b = new Buffer( [ 1, 2, 3, 4 ] ); +const b = new Buffer( [ 1, 2, 3, 4 ] ); // returns [ 1, 2, 3, 4 ] ``` @@ -69,8 +69,8 @@ Copies [buffer][node-buffer] data to a new [`Buffer`][node-buffer] instance. ```javascript -var b1 = new Buffer( [ 1, 2, 3, 4 ] ); -var b2 = new Buffer( b1 ); +const b1 = new Buffer( [ 1, 2, 3, 4 ] ); +const b2 = new Buffer( b1 ); // returns [ 1, 2, 3, 4 ] ``` @@ -81,7 +81,7 @@ Returns a [`Buffer`][node-buffer] containing a provided `string`. ```javascript -var b = new Buffer( 'beep boop' ); +const b = new Buffer( 'beep boop' ); // returns ``` @@ -120,10 +120,9 @@ TODO: add methods ```javascript -var ctor = require( '@stdlib/buffer/ctor' ); +const ctor = require( '@stdlib/buffer/ctor' ); -var b; -var i; +let b; // Allocate uninitialized memory: if ( typeof ctor.alloc === 'function' ) { @@ -133,7 +132,7 @@ if ( typeof ctor.alloc === 'function' ) { } // Zero fill the buffer... -for ( i = 0; i < b.length; i++ ) { +for ( let i = 0; i < b.length; i++ ) { b[ i ] = 0; } console.log( b ); diff --git a/lib/node_modules/@stdlib/buffer/from-array/README.md b/lib/node_modules/@stdlib/buffer/from-array/README.md index 846dddd6623b..21d4387c0784 100644 --- a/lib/node_modules/@stdlib/buffer/from-array/README.md +++ b/lib/node_modules/@stdlib/buffer/from-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var array2buffer = require( '@stdlib/buffer/from-array' ); +const array2buffer = require( '@stdlib/buffer/from-array' ); ``` #### array2buffer( arr ) @@ -45,7 +45,7 @@ var array2buffer = require( '@stdlib/buffer/from-array' ); Allocates a [buffer][@stdlib/buffer/ctor] using an `array` (or array-like `object`) of octets. ```javascript -var buf = array2buffer( [ 1, 2, 3, 4 ] ); +const buf = array2buffer( [ 1, 2, 3, 4 ] ); // returns [ 1, 2, 3, 4 ] ``` @@ -70,24 +70,19 @@ var buf = array2buffer( [ 1, 2, 3, 4 ] ); ```javascript -var array2buffer = require( '@stdlib/buffer/from-array' ); - -var octets; -var buf; -var str; -var i; +const array2buffer = require( '@stdlib/buffer/from-array' ); // Define a string we want to convert to a buffer: -str = 'this is a string.'; +const str = 'this is a string.'; // Manually convert the string to an array of octets... -octets = new Array( str.length ); -for ( i = 0; i < str.length; i++ ) { +const octets = new Array( str.length ); +for ( let i = 0; i < str.length; i++ ) { octets[ i ] = str.charCodeAt( i ) % 256; } // Create a buffer from the octet array: -buf = array2buffer( octets ); +const buf = array2buffer( octets ); console.log( buf.toString() ); ``` diff --git a/lib/node_modules/@stdlib/buffer/from-arraybuffer/README.md b/lib/node_modules/@stdlib/buffer/from-arraybuffer/README.md index 07b95480308b..bcbc6a83a6e6 100644 --- a/lib/node_modules/@stdlib/buffer/from-arraybuffer/README.md +++ b/lib/node_modules/@stdlib/buffer/from-arraybuffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arraybuffer2buffer = require( '@stdlib/buffer/from-arraybuffer' ); +const arraybuffer2buffer = require( '@stdlib/buffer/from-arraybuffer' ); ``` #### arraybuffer2buffer( buf\[, byteOffset\[, length]] ) @@ -45,36 +45,36 @@ var arraybuffer2buffer = require( '@stdlib/buffer/from-arraybuffer' ); Allocates a [buffer][@stdlib/buffer/ctor] from an [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var ab = new ArrayBuffer( 10 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const ab = new ArrayBuffer( 10 ); -var buf = arraybuffer2buffer( ab ); +const buf = arraybuffer2buffer( ab ); // returns ``` By default, the function allocates a [buffer][@stdlib/buffer/ctor] starting from the first byte of the provided [`ArrayBuffer`][@stdlib/array/buffer]. To specify an alternative starting index, provide a `byteOffset`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var ab = new ArrayBuffer( 10 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const ab = new ArrayBuffer( 10 ); -var buf = arraybuffer2buffer( ab, 2 ); +const buf = arraybuffer2buffer( ab, 2 ); // returns -var len = buf.length; +const len = buf.length; // returns 8 ``` By default, the function allocates a [buffer][@stdlib/buffer/ctor] until the end of the provided [`ArrayBuffer`][@stdlib/array/buffer]. To allocate a specified number of [`ArrayBuffer`][@stdlib/array/buffer] bytes, provide a `length`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var ab = new ArrayBuffer( 10 ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const ab = new ArrayBuffer( 10 ); -var buf = arraybuffer2buffer( ab, 2, 4 ); +const buf = arraybuffer2buffer( ab, 2, 4 ); // returns -var len = buf.length; +const len = buf.length; // returns 4 ``` @@ -108,33 +108,28 @@ The behavior of this function varies across Node.js versions due to changes in t ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/base/randu' ); -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var arraybuffer2buffer = require( '@stdlib/buffer/from-arraybuffer' ); - -var high; -var view; -var low; -var buf; -var ab; -var i; +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/base/randu' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const arraybuffer2buffer = require( '@stdlib/buffer/from-arraybuffer' ); // Allocate an ArrayBuffer: -ab = new ArrayBuffer( 64 ); +const ab = new ArrayBuffer( 64 ); // Create a Float64 view and set random values: -view = new Float64Array( ab ); -for ( i = 0; i < view.length; i++ ) { +const view = new Float64Array( ab ); +for ( let i = 0; i < view.length; i++ ) { view[ i ] = randu(); } // Create a new buffer from the ArrayBuffer: -buf = arraybuffer2buffer( ab ); +const buf = arraybuffer2buffer( ab ); // Read the high and low words for each double: -for ( i = 0; i < view.length; i++ ) { +for ( let i = 0; i < view.length; i++ ) { + let high; + let low; if ( IS_LITTLE_ENDIAN ) { high = buf.readUInt32LE( (8*i)+4 ); low = buf.readUInt32LE( 8*i ); diff --git a/lib/node_modules/@stdlib/buffer/from-buffer/README.md b/lib/node_modules/@stdlib/buffer/from-buffer/README.md index 7d4f9396d0c3..4a6cf9f17e79 100644 --- a/lib/node_modules/@stdlib/buffer/from-buffer/README.md +++ b/lib/node_modules/@stdlib/buffer/from-buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var copyBuffer = require( '@stdlib/buffer/from-buffer' ); +const copyBuffer = require( '@stdlib/buffer/from-buffer' ); ``` #### copyBuffer( buffer ) @@ -45,12 +45,12 @@ var copyBuffer = require( '@stdlib/buffer/from-buffer' ); Copies [buffer][@stdlib/buffer/ctor] data to a new [`Buffer`][@stdlib/buffer/ctor] instance. ```javascript -var array2buffer = require( '@stdlib/buffer/from-array' ); +const array2buffer = require( '@stdlib/buffer/from-array' ); -var b1 = array2buffer( [ 1, 2, 3, 4 ] ); +const b1 = array2buffer( [ 1, 2, 3, 4 ] ); // returns [ 1, 2, 3, 4 ] -var b2 = copyBuffer( b1 ); +const b2 = copyBuffer( b1 ); // returns [ 1, 2, 3, 4 ] ``` @@ -75,27 +75,22 @@ var b2 = copyBuffer( b1 ); ```javascript -var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); -var copyBuffer = require( '@stdlib/buffer/from-buffer' ); - -var bool; -var b1; -var b2; -var i; +const allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); +const copyBuffer = require( '@stdlib/buffer/from-buffer' ); // Allocate a new buffer: -b1 = allocUnsafe( 10 ); +const b1 = allocUnsafe( 10 ); // Generate a new buffer from the existing buffer: -b2 = copyBuffer( b1 ); +const b2 = copyBuffer( b1 ); -bool = ( b2 === b1 ); +let bool = ( b2 === b1 ); // returns false bool = ( b2.length === b1.length ); // returns true -for ( i = 0; i < b2.length; i++ ) { +for ( let i = 0; i < b2.length; i++ ) { console.log( b2[ i ] === b1[ i ] ); // => true } diff --git a/lib/node_modules/@stdlib/buffer/from-string/README.md b/lib/node_modules/@stdlib/buffer/from-string/README.md index 4dfbc9f71f44..91f5190f3d15 100644 --- a/lib/node_modules/@stdlib/buffer/from-string/README.md +++ b/lib/node_modules/@stdlib/buffer/from-string/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); ``` #### string2buffer( str\[, encoding] ) @@ -45,14 +45,14 @@ var string2buffer = require( '@stdlib/buffer/from-string' ); Allocates a [buffer][@stdlib/buffer/ctor] containing a provided `string`. ```javascript -var buf = string2buffer( 'beep boop' ); +const buf = string2buffer( 'beep boop' ); // returns ``` The default character encoding is `utf8`. To specify an alternative encoding, provide an `encoding` argument. ```javascript -var buf = string2buffer( '7468697320697320612074c3a97374', 'hex' ); +const buf = string2buffer( '7468697320697320612074c3a97374', 'hex' ); // returns ``` @@ -86,19 +86,17 @@ The following `encodings` are supported: ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var string2buffer = require( '@stdlib/buffer/from-string' ); +const randu = require( '@stdlib/random/base/randu' ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); // Create a buffer from a string: -var buf = string2buffer( 'beep boop bop' ); +const buf = string2buffer( 'beep boop bop' ); console.log( buf.toString() ); // Generate random strings... -var i; -var j; -for ( i = 0; i < 100; i++ ) { - j = randint( 0, buf.length ); +for ( let i = 0; i < 100; i++ ) { + const j = randint( 0, buf.length ); if ( randu() < 2/buf.length ) { buf[ j ] = 32; // space } else { diff --git a/lib/node_modules/@stdlib/buffer/reviver/README.md b/lib/node_modules/@stdlib/buffer/reviver/README.md index 06af3e5cb9e5..a24e636d57cd 100644 --- a/lib/node_modules/@stdlib/buffer/reviver/README.md +++ b/lib/node_modules/@stdlib/buffer/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveBuffer = require( '@stdlib/buffer/reviver' ); +const reviveBuffer = require( '@stdlib/buffer/reviver' ); ``` #### reviveBuffer( key, value ) @@ -45,11 +45,11 @@ var reviveBuffer = require( '@stdlib/buffer/reviver' ); Revives a JSON-serialized [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"Buffer","data":[5,3]}'; +const str = '{"type":"Buffer","data":[5,3]}'; -var buf = parseJSON( str, reviveBuffer ); +const buf = parseJSON( str, reviveBuffer ); // returns [ 5, 3 ] ``` @@ -76,17 +76,17 @@ For details on the JSON serialization format, see [`@stdlib/buffer/to-json`][@st ```javascript -var array2buffer = require( '@stdlib/buffer/from-array' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var buffer2json = require( '@stdlib/buffer/to-json' ); -var reviveBuffer = require( '@stdlib/buffer/reviver' ); +const array2buffer = require( '@stdlib/buffer/from-array' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const buffer2json = require( '@stdlib/buffer/to-json' ); +const reviveBuffer = require( '@stdlib/buffer/reviver' ); -var buf = array2buffer( [ 1, 2 ] ); -var str = JSON.stringify( buffer2json( buf ) ); +const buf = array2buffer( [ 1, 2 ] ); +const str = JSON.stringify( buffer2json( buf ) ); console.log( str ); // => '{"type":"Buffer","data":[1,2]}' -var out = parseJSON( str, reviveBuffer ); +const out = parseJSON( str, reviveBuffer ); if ( out instanceof Error ) { throw out; } diff --git a/lib/node_modules/@stdlib/buffer/to-json/README.md b/lib/node_modules/@stdlib/buffer/to-json/README.md index f986ee4d7b4a..e815f93f39b7 100644 --- a/lib/node_modules/@stdlib/buffer/to-json/README.md +++ b/lib/node_modules/@stdlib/buffer/to-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var buffer2json = require( '@stdlib/buffer/to-json' ); +const buffer2json = require( '@stdlib/buffer/to-json' ); ``` #### buffer2json( buffer ) @@ -45,11 +45,11 @@ var buffer2json = require( '@stdlib/buffer/to-json' ); Returns a [JSON][json] representation of a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var array2buffer = require( '@stdlib/buffer/from-array' ); +const array2buffer = require( '@stdlib/buffer/from-array' ); -var buf = array2buffer( [ 1, 2 ] ); +const buf = array2buffer( [ 1, 2 ] ); -var json = buffer2json( buf ); +const json = buffer2json( buf ); /* returns { 'type': 'Buffer', @@ -81,13 +81,12 @@ For guidance on reviving a JSON-serialized [`Buffer`][@stdlib/buffer/ctor], see ```javascript -var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); -var randi = require( '@stdlib/random/base/discrete-uniform' ); -var buffer2json = require( '@stdlib/buffer/to-json' ); +const allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); +const randi = require( '@stdlib/random/base/discrete-uniform' ); +const buffer2json = require( '@stdlib/buffer/to-json' ); -var buf = allocUnsafe( 100 ); -var i; -for ( i = 0; i < buf.length; i++ ) { +const buf = allocUnsafe( 100 ); +for ( let i = 0; i < buf.length; i++ ) { buf[ i ] = randi( 0, 255 ); } diff --git a/lib/node_modules/@stdlib/cli/README.md b/lib/node_modules/@stdlib/cli/README.md index 05652421dddf..52608a5e47ff 100644 --- a/lib/node_modules/@stdlib/cli/README.md +++ b/lib/node_modules/@stdlib/cli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/cli' ); +const ns = require( '@stdlib/cli' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/cli' ); Command-line interface namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/cli' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/cli' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/cli/ctor/README.md b/lib/node_modules/@stdlib/cli/ctor/README.md index ffa50c17f606..4564fa4bc8a9 100644 --- a/lib/node_modules/@stdlib/cli/ctor/README.md +++ b/lib/node_modules/@stdlib/cli/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var CLI = require( '@stdlib/cli/ctor' ); +const CLI = require( '@stdlib/cli/ctor' ); ``` #### CLI( \[options] ) @@ -45,7 +45,7 @@ var CLI = require( '@stdlib/cli/ctor' ); Command-line interface (CLI) constructor. ```javascript -var cli = new CLI(); +const cli = new CLI(); // returns ``` @@ -62,18 +62,18 @@ The constructor accepts the following `options`: To provide package meta data, such as the package `name` and `version`, set the `pkg` option. ```javascript -var opts = { +const opts = { 'pkg': require( './package.json' ) }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // returns ``` To specify a particular command-line interface version (overriding package meta data), set the `version` option. ```javascript -var opts = { +const opts = { 'pkg': { 'name': 'beep', 'version': '1.1.1' @@ -81,7 +81,7 @@ var opts = { 'version': '1.1.1-beta' }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // returns cli.version(); @@ -91,13 +91,13 @@ cli.version(); By default, an instance sets the process title to either the first key in `pkg.bin` or to `pkg.name`. To explicitly set the process title, set the `title` option. ```javascript -var proc = require( 'process' ); +const proc = require( 'process' ); -var opts = { +const opts = { 'title': 'beep-boop' }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // returns console.log( proc.title ); @@ -107,11 +107,11 @@ console.log( proc.title ); To disable setting the process title, set the `title` option to `false`. ```javascript -var opts = { +const opts = { 'title': false }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // returns ``` @@ -120,7 +120,7 @@ When the command-line flag `--help` is set, a command-line interface instance pr ```javascript -var opts = { +const opts = { 'help': 'Usage: boop [options] ', 'argv': [ '/usr/local/bin/node', @@ -129,14 +129,14 @@ var opts = { ] }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // => Usage: boop [options] ``` By default, an instance resolves command-line arguments and flags via `process.argv`. To specify a custom set of command-line arguments, set the `argv` option. ```javascript -var opts = { +const opts = { 'argv': [ '/usr/local/bin/node', 'foo.js', @@ -146,16 +146,16 @@ var opts = { ] }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); -var args = cli.args(); +const args = cli.args(); // returns [ 'a', 'b', 'c' ] ``` To specify command-line argument parser options, such as command-line flag types and aliases, set the `options` option. ```javascript -var opts = { +const opts = { 'options': { 'boolean': [ 'help', @@ -183,9 +183,9 @@ var opts = { ] }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); -var flags = cli.flags(); +const flags = cli.flags(); /* returns { 'h': false, @@ -201,11 +201,11 @@ var flags = cli.flags(); By default, if provided sufficient package meta data (package `name` and `version`), an instance checks whether a newer version of a command-line interface exists in the package registry. If a newer version exists, an instance writes a message to `stdout` indicating that a newer version exists. To disable this check, set the `updates` option to `false`. ```javascript -var opts = { +const opts = { 'updates': false }; -var cli = new CLI( opts ); +const cli = new CLI( opts ); // returns ``` @@ -218,7 +218,7 @@ var cli = new CLI( opts ); Gracefully exits a command-line interface and the calling process. ```javascript -var cli = new CLI(); +const cli = new CLI(); // Gracefully exit: cli.close(); @@ -229,7 +229,7 @@ To specify an exit code, provide a `code` argument. ```javascript -var cli = new CLI(); +const cli = new CLI(); // Set the exit code to `1`: cli.close( 1 ); @@ -242,12 +242,12 @@ Prints an error message to `stderr` and exits a command-line interface and the c ```javascript -var cli = new CLI(); +const cli = new CLI(); // ... // Create a new error object: -var err = new Error( 'invalid argument' ); +const err = new Error( 'invalid argument' ); // Exit due to the error: cli.error( err ); @@ -258,12 +258,12 @@ When exiting due to an error, the default exit code is `1`. To specify an altern ```javascript -var cli = new CLI(); +const cli = new CLI(); // ... // Create a new error object: -var err = new Error( 'invalid argument' ); +const err = new Error( 'invalid argument' ); // Exit due to the error: cli.error( err, 2 ); @@ -274,7 +274,7 @@ cli.error( err, 2 ); Forcefully exits a command-line interface and the calling process. ```javascript -var cli = new CLI(); +const cli = new CLI(); // Forcefully exit: cli.exit(); @@ -285,7 +285,7 @@ To specify an exit code, provide a `code` argument. ```javascript -var cli = new CLI(); +const cli = new CLI(); // Set the exit code to `1`: cli.exit( 1 ); @@ -300,7 +300,7 @@ cli.exit( 1 ); Returns a list of command-line arguments. ```javascript -var cli = new CLI({ +const cli = new CLI({ 'argv': [ '/usr/local/bin/node', 'foo.js', @@ -311,7 +311,7 @@ var cli = new CLI({ ] }); -var args = cli.args(); +const args = cli.args(); // returns [ 'a', 'd' ] ``` @@ -320,7 +320,7 @@ var args = cli.args(); Returns command-line flags. ```javascript -var cli = new CLI({ +const cli = new CLI({ 'argv': [ '/usr/local/bin/node', 'foo.js', @@ -333,7 +333,7 @@ var cli = new CLI({ ] }); -var flags = cli.flags(); +const flags = cli.flags(); // returns { 'b': 'c', 'd': true, 'e': true, 'f': true, 'g': 'h' } ``` @@ -342,7 +342,7 @@ var flags = cli.flags(); Prints help text to `stderr` and then exits the calling process. ```javascript -var cli = new CLI({ +const cli = new CLI({ 'help': 'Usage: beep [options] ' }); @@ -357,7 +357,7 @@ By default, the process exits with an exit code equal to `0`. To exit with a dif Prints the command-line interface version to `stderr` and then exits the calling process. ```javascript -var cli = new CLI({ +const cli = new CLI({ 'version': '1.1.1' }); @@ -397,19 +397,19 @@ cli.version(); ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var CLI = require( '@stdlib/cli/ctor' ); -var main = require( './examples/fixtures/main.js' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const CLI = require( '@stdlib/cli/ctor' ); +const main = require( './examples/fixtures/main.js' ); // Load help text: -var fopts = { +const fopts = { 'encoding': 'utf8' }; -var help = readFileSync( join( __dirname, 'examples', 'fixtures', 'usage.txt' ), fopts ); +const help = readFileSync( join( __dirname, 'examples', 'fixtures', 'usage.txt' ), fopts ); // Set the command-line interface options: -var opts = { +const opts = { 'pkg': require( './package.json' ), 'options': require( './examples/fixtures/opts.json' ), 'help': help, @@ -418,7 +418,7 @@ var opts = { }; // Create a new command-line interface: -var cli = new CLI( opts ); +const cli = new CLI( opts ); // Run main: main( 'beep' ); diff --git a/lib/node_modules/@stdlib/complex/README.md b/lib/node_modules/@stdlib/complex/README.md index 242c4c0bc79d..3ad755c7cb5d 100644 --- a/lib/node_modules/@stdlib/complex/README.md +++ b/lib/node_modules/@stdlib/complex/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/complex' ); +const ns = require( '@stdlib/complex' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/complex' ); Complex number data types. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -83,8 +83,8 @@ The namespace contains the following APIs: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/base/README.md b/lib/node_modules/@stdlib/complex/base/README.md index 3fbc5a3649b5..68e61328223f 100644 --- a/lib/node_modules/@stdlib/complex/base/README.md +++ b/lib/node_modules/@stdlib/complex/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/base' ); +const complex = require( '@stdlib/complex/base' ); ``` #### complex @@ -35,7 +35,7 @@ var complex = require( '@stdlib/complex/base' ); Namespace containing "base" (i.e., lower-level) complex number functions. ```javascript -var ns = complex; +const ns = complex; // returns {...} ``` @@ -73,8 +73,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/base/cast-return/README.md b/lib/node_modules/@stdlib/complex/base/cast-return/README.md index 9ba76eaa1179..743bc2e1e7c8 100644 --- a/lib/node_modules/@stdlib/complex/base/cast-return/README.md +++ b/lib/node_modules/@stdlib/complex/base/cast-return/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var castReturn = require( '@stdlib/complex/base/cast-return' ); +const castReturn = require( '@stdlib/complex/base/cast-return' ); ``` #### castReturn( fcn, nargs, ctor ) @@ -45,10 +45,10 @@ var castReturn = require( '@stdlib/complex/base/cast-return' ); Returns a function which wraps a function and casts a function's return value to a complex number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var f = castReturn( addf, 2, Complex64 ); +const f = castReturn( addf, 2, Complex64 ); // returns ``` @@ -84,23 +84,23 @@ The function accepts the following arguments: ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var addf = require( '@stdlib/math/base/ops/addf' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var castReturn = require( '@stdlib/complex/base/cast-return' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const addf = require( '@stdlib/math/base/ops/addf' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const castReturn = require( '@stdlib/complex/base/cast-return' ); -var f = castReturn( addf, 2, Complex64 ); +const f = castReturn( addf, 2, Complex64 ); // ... -var z = f( 3.0, 4.0 ); +const z = f( 3.0, 4.0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 7.0 -var im = imagf( z ); +const im = imagf( z ); // returns 0.0 console.log( '%d + %di', re, im ); diff --git a/lib/node_modules/@stdlib/complex/base/parse/README.md b/lib/node_modules/@stdlib/complex/base/parse/README.md index 046d191905b6..9c1eebbb7ea2 100644 --- a/lib/node_modules/@stdlib/complex/base/parse/README.md +++ b/lib/node_modules/@stdlib/complex/base/parse/README.md @@ -36,20 +36,20 @@ limitations under the License. ## Usage -```js -var parse = require( '@stdlib/complex/base/parse' ); +```javascript +const parse = require( '@stdlib/complex/base/parse' ); ``` #### parse( str ) Parses a string representing a complex number into a complex like object. -```js -var parse = require( '@stdlib/complex/base/parse' ); +```javascript +const parse = require( '@stdlib/complex/base/parse' ); -var str = '5 + 3i'; +const str = '5 + 3i'; -var z = parse( str ); +const z = parse( str ); // returns <{re: 5, im: 3}> ``` @@ -73,13 +73,10 @@ var z = parse( str ); -```js -var parse = require( '@stdlib/complex/base/parse' ); +```javascript +const parse = require( '@stdlib/complex/base/parse' ); -var str; -var z; - -z = parse( '5 + 4i' ); +let z = parse( '5 + 4i' ); // returns {'re' : 5, 'im' : 4} z = parse( 'Infinity + 2.34i' ); diff --git a/lib/node_modules/@stdlib/complex/base/wrap-function/README.md b/lib/node_modules/@stdlib/complex/base/wrap-function/README.md index 4d6e26e540be..f5752d4228c2 100644 --- a/lib/node_modules/@stdlib/complex/base/wrap-function/README.md +++ b/lib/node_modules/@stdlib/complex/base/wrap-function/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var wrap = require( '@stdlib/complex/base/wrap-function' ); +const wrap = require( '@stdlib/complex/base/wrap-function' ); ``` #### wrap( fcn, nargs, ctor ) @@ -45,10 +45,10 @@ var wrap = require( '@stdlib/complex/base/wrap-function' ); Returns a function which wraps a function accepting complex number arguments to support providing both real and complex numbers. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); -var f = wrap( caddf, 2, Complex64 ); +const f = wrap( caddf, 2, Complex64 ); // returns ``` @@ -84,23 +84,23 @@ The function accepts the following arguments: ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var wrap = require( '@stdlib/complex/base/wrap-function' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const wrap = require( '@stdlib/complex/base/wrap-function' ); -var f = wrap( caddf, 2, Complex64 ); +const f = wrap( caddf, 2, Complex64 ); // ... -var z = f( 3.0, 4.0 ); +const z = f( 3.0, 4.0 ); // returns -var re = realf( z ); +const re = realf( z ); // returns 7.0 -var im = imagf( z ); +const im = imagf( z ); // returns 0.0 console.log( '%d + %di', re, im ); diff --git a/lib/node_modules/@stdlib/complex/cmplx/README.md b/lib/node_modules/@stdlib/complex/cmplx/README.md index 36773238777f..dc014ce0e306 100644 --- a/lib/node_modules/@stdlib/complex/cmplx/README.md +++ b/lib/node_modules/@stdlib/complex/cmplx/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/cmplx' ); +const complex = require( '@stdlib/complex/cmplx' ); ``` #### complex( real, imag\[, dtype] ) @@ -45,7 +45,7 @@ var complex = require( '@stdlib/complex/cmplx' ); Creates a complex number, where `real` and `imag` are the **real** and **imaginary** components, respectively. ```javascript -var z = complex( 5.0, 3.0 ); +const z = complex( 5.0, 3.0 ); // returns ``` @@ -55,7 +55,7 @@ By default, the function returns a [128-bit complex number][@stdlib/complex/floa - [`'float32'`][@stdlib/complex/float32/ctor]: store **real** and **imaginary** components as single-precision floating-point numbers. ```javascript -var z = complex( 5.0, 3.0, 'float32' ); +const z = complex( 5.0, 3.0, 'float32' ); // returns ``` @@ -80,15 +80,13 @@ var z = complex( 5.0, 3.0, 'float32' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var complex = require( '@stdlib/complex/cmplx' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const complex = require( '@stdlib/complex/cmplx' ); -var rand = discreteUniform( -50, 50 ); +const rand = discreteUniform( -50, 50 ); -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = complex( rand(), rand(), 'float64' ); +for ( let i = 0; i < 100; i++ ) { + const z = complex( rand(), rand(), 'float64' ); console.log( z.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/ctors/README.md b/lib/node_modules/@stdlib/complex/ctors/README.md index 98c299dc709c..9d1b8ac476f6 100644 --- a/lib/node_modules/@stdlib/complex/ctors/README.md +++ b/lib/node_modules/@stdlib/complex/ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/complex/ctors' ); +const ctors = require( '@stdlib/complex/ctors' ); ``` #### ctors( dtype ) @@ -45,7 +45,7 @@ var ctors = require( '@stdlib/complex/ctors' ); Returns a complex number constructor for a specified data type. ```javascript -var ctor = ctors( 'complex128' ); +const ctor = ctors( 'complex128' ); // returns ``` @@ -57,7 +57,7 @@ The function returns constructors for the following data types: If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ctor = ctors( 'complex' ); +const ctor = ctors( 'complex' ); // returns null ``` @@ -82,15 +82,13 @@ var ctor = ctors( 'complex' ); ```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var ctors = require( '@stdlib/complex/ctors' ); +const dtypes = require( '@stdlib/complex/dtypes' ); +const ctors = require( '@stdlib/complex/ctors' ); -var DTYPES = dtypes(); -var ctor; -var i; +const DTYPES = dtypes(); -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/complex/dtype/README.md b/lib/node_modules/@stdlib/complex/dtype/README.md index 040e96ff65cc..d6518426235a 100644 --- a/lib/node_modules/@stdlib/complex/dtype/README.md +++ b/lib/node_modules/@stdlib/complex/dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype = require( '@stdlib/complex/dtype' ); +const dtype = require( '@stdlib/complex/dtype' ); ``` #### dtype( value ) @@ -45,16 +45,16 @@ var dtype = require( '@stdlib/complex/dtype' ); Returns the [data type][@stdlib/complex/dtypes] of a complex number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var dt = dtype( new Complex128( 1.0, 2.0 ) ); +const dt = dtype( new Complex128( 1.0, 2.0 ) ); // returns 'complex128' ``` If provided an argument having an unknown or unsupported [data type][@stdlib/complex/dtypes], the function returns `null`. ```javascript -var dt = dtype( 'beep' ); +const dt = dtype( 'beep' ); // returns null ``` @@ -81,20 +81,16 @@ var dt = dtype( 'beep' ); ```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var ctors = require( '@stdlib/complex/ctors' ); -var dtype = require( '@stdlib/complex/dtype' ); +const dtypes = require( '@stdlib/complex/dtypes' ); +const ctors = require( '@stdlib/complex/ctors' ); +const dtype = require( '@stdlib/complex/dtype' ); // Get a list of supported complex number data types: -var DTYPES = dtypes(); - -// For each supported data type, create a complex number and confirm its data type... -var ctor; -var dt; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - dt = dtype( new ctor( 1.0, 2.0 ) ); +const DTYPES = dtypes(); + +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); + const dt = dtype( new ctor( 1.0, 2.0 ) ); console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt ); } ``` diff --git a/lib/node_modules/@stdlib/complex/dtypes/README.md b/lib/node_modules/@stdlib/complex/dtypes/README.md index dae36219ff36..c58b85aa9278 100644 --- a/lib/node_modules/@stdlib/complex/dtypes/README.md +++ b/lib/node_modules/@stdlib/complex/dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); +const dtypes = require( '@stdlib/complex/dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/complex/dtypes' ); Returns a list of complex number data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'complex64', 'complex128' ] ``` @@ -75,11 +75,10 @@ The output `array` contains the following data types: ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/complex/dtypes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const dtypes = require( '@stdlib/complex/dtypes' ); -var DTYPES = dtypes(); -var bool; +const DTYPES = dtypes(); function isdtype( str ) { if ( indexOf( DTYPES, str ) === -1 ) { @@ -88,7 +87,7 @@ function isdtype( str ) { return true; } -bool = isdtype( 'complex128' ); +let bool = isdtype( 'complex128' ); // returns true bool = isdtype( 'complex64' ); diff --git a/lib/node_modules/@stdlib/complex/float32/README.md b/lib/node_modules/@stdlib/complex/float32/README.md index 7977baa95ca2..498fe8387442 100644 --- a/lib/node_modules/@stdlib/complex/float32/README.md +++ b/lib/node_modules/@stdlib/complex/float32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/float32' ); +const complex = require( '@stdlib/complex/float32' ); ``` #### complex @@ -35,7 +35,7 @@ var complex = require( '@stdlib/complex/float32' ); Namespace containing single-precision complex floating-point number functions. ```javascript -var ns = complex; +const ns = complex; // returns {...} ``` @@ -90,8 +90,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float32' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/README.md b/lib/node_modules/@stdlib/complex/float32/base/README.md index 0530bf282491..726020341849 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/float32/base' ); +const complex = require( '@stdlib/complex/float32/base' ); ``` #### complex @@ -35,7 +35,7 @@ var complex = require( '@stdlib/complex/float32/base' ); Namespace containing base (i.e., lower-level) single-precision complex floating-point number functions. ```javascript -var ns = complex; +const ns = complex; // returns {...} ``` @@ -85,8 +85,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float32/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/add/README.md b/lib/node_modules/@stdlib/complex/float32/base/add/README.md index d50e2be39cf1..4e745bf1003e 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/add/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/add/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var add = require( '@stdlib/complex/float32/base/add' ); +const add = require( '@stdlib/complex/float32/base/add' ); ``` #### add( z1, z2 ) @@ -41,19 +41,19 @@ var add = require( '@stdlib/complex/float32/base/add' ); Adds two single-precision complex floating-point numbers. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var z = new Complex64( -1.5, 2.5 ); +const z = new Complex64( -1.5, 2.5 ); -var v = add( z, z ); +const v = add( z, z ); // returns -var re = realf( v ); +const re = realf( v ); // returns -3.0 -var im = imagf( v ); +const im = imagf( v ); // returns 5.0 ``` @@ -68,20 +68,16 @@ var im = imagf( v ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var add = require( '@stdlib/complex/float32/base/add' ); - -var rand = discreteUniform( -50, 50 ); - -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex64( rand(), rand() ); - z2 = new Complex64( rand(), rand() ); - z3 = add( z1, z2 ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const add = require( '@stdlib/complex/float32/base/add' ); + +const rand = discreteUniform( -50, 50 ); + +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex64( rand(), rand() ); + const z2 = new Complex64( rand(), rand() ); + const z3 = add( z1, z2 ); console.log( '(%s) + (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/README.md b/lib/node_modules/@stdlib/complex/float32/base/assert/README.md index 3d1e48eb2531..9f7593afaca3 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var assert = require( '@stdlib/complex/float32/base/assert' ); +const assert = require( '@stdlib/complex/float32/base/assert' ); ``` #### assert @@ -35,7 +35,7 @@ var assert = require( '@stdlib/complex/float32/base/assert' ); Namespace containing base (i.e., lower-level) single-precision complex floating-point number assertion functions. ```javascript -var ns = assert; +const ns = assert; // returns {...} ``` @@ -75,8 +75,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float32/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/is-equal/README.md b/lib/node_modules/@stdlib/complex/float32/base/assert/is-equal/README.md index fbe6615c8008..8d42c68348ad 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/is-equal/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/is-equal/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isEqualf = require( '@stdlib/complex/float32/base/assert/is-equal' ); +const isEqualf = require( '@stdlib/complex/float32/base/assert/is-equal' ); ``` #### isEqualf( z1, z2 ) @@ -45,12 +45,12 @@ var isEqualf = require( '@stdlib/complex/float32/base/assert/is-equal' ); Tests whether two single-precision complex floating-point numbers are equal. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( 5.0, 3.0 ); -var out = isEqualf( z1, z2 ); +const out = isEqualf( z1, z2 ); // returns true ``` @@ -75,12 +75,12 @@ var out = isEqualf( z1, z2 ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isEqualf = require( '@stdlib/complex/float32/base/assert/is-equal' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const isEqualf = require( '@stdlib/complex/float32/base/assert/is-equal' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isEqualf( z1, z2 ); +let z1 = new Complex64( 5.0, 3.0 ); +let z2 = new Complex64( 5.0, 3.0 ); +let out = isEqualf( z1, z2 ); // returns true z1 = new Complex64( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/is-not-equal/README.md b/lib/node_modules/@stdlib/complex/float32/base/assert/is-not-equal/README.md index 43672bcc8483..729dcacd322e 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/is-not-equal/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/is-not-equal/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isNotEqualf = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); +const isNotEqualf = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); ``` #### isNotEqualf( z1, z2 ) @@ -45,12 +45,12 @@ var isNotEqualf = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); Tests whether two single-precision complex floating-point numbers are not equal. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, -3.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( 5.0, -3.0 ); -var out = isNotEqualf( z1, z2 ); +const out = isNotEqualf( z1, z2 ); // returns true ``` @@ -75,12 +75,12 @@ var out = isNotEqualf( z1, z2 ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isNotEqualf = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const isNotEqualf = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isNotEqualf( z1, z2 ); +let z1 = new Complex64( 5.0, 3.0 ); +let z2 = new Complex64( 5.0, 3.0 ); +let out = isNotEqualf( z1, z2 ); // returns false z1 = new Complex64( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value-zero/README.md index b43f0e4a37fb..3275e5ff6ccb 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value-zero/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameValueZerof = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); +const isSameValueZerof = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); ``` #### isSameValueZerof( z1, z2 ) @@ -45,36 +45,36 @@ var isSameValueZerof = require( '@stdlib/complex/float32/base/assert/is-same-val Tests whether two single-precision complex floating-point numbers are the same value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValueZerof( z1, z2 ); +const out = isSameValueZerof( z1, z2 ); // returns true ``` In contrast to the strict equality operator `===`, the function treats `NaNs` as the same value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( NaN, NaN ); -var z2 = new Complex64( NaN, NaN ); +const z1 = new Complex64( NaN, NaN ); +const z2 = new Complex64( NaN, NaN ); -var out = isSameValueZerof( z1, z2 ); +const out = isSameValueZerof( z1, z2 ); // returns true ``` In contrast to the [SameValue Algorithm][@stdlib/complex/float32/base/assert/is-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( -0.0, 0.0 ); -var z2 = new Complex64( 0.0, -0.0 ); +const z1 = new Complex64( -0.0, 0.0 ); +const z2 = new Complex64( 0.0, -0.0 ); -var out = isSameValueZerof( z1, z2 ); +const out = isSameValueZerof( z1, z2 ); // returns true ``` @@ -99,12 +99,12 @@ var out = isSameValueZerof( z1, z2 ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isSameValueZerof = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const isSameValueZerof = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValueZerof( z1, z2 ); +let z1 = new Complex64( 5.0, 3.0 ); +let z2 = new Complex64( 5.0, 3.0 ); +let out = isSameValueZerof( z1, z2 ); // returns true z1 = new Complex64( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value/README.md b/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value/README.md index bf6d520f266d..397ab2883359 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/assert/is-same-value/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameValuef = require( '@stdlib/complex/float32/base/assert/is-same-value' ); +const isSameValuef = require( '@stdlib/complex/float32/base/assert/is-same-value' ); ``` #### isSameValuef( z1, z2 ) @@ -45,24 +45,24 @@ var isSameValuef = require( '@stdlib/complex/float32/base/assert/is-same-value' Tests whether two single-precision complex floating-point numbers are the same value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValuef( z1, z2 ); +const out = isSameValuef( z1, z2 ); // returns true ``` In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z1 = new Complex64( NaN, NaN ); -var z2 = new Complex64( NaN, NaN ); +let z1 = new Complex64( NaN, NaN ); +let z2 = new Complex64( NaN, NaN ); -var out = isSameValuef( z1, z2 ); +let out = isSameValuef( z1, z2 ); // returns true z1 = new Complex64( -0.0, 0.0 ); @@ -97,12 +97,12 @@ out = isSameValuef( z1, z2 ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isSameValuef = require( '@stdlib/complex/float32/base/assert/is-same-value' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const isSameValuef = require( '@stdlib/complex/float32/base/assert/is-same-value' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValuef( z1, z2 ); +let z1 = new Complex64( 5.0, 3.0 ); +let z2 = new Complex64( 5.0, 3.0 ); +let out = isSameValuef( z1, z2 ); // returns true z1 = new Complex64( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md index 8f84c9e03136..bdb80b6f2438 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mul = require( '@stdlib/complex/float32/base/mul' ); +const mul = require( '@stdlib/complex/float32/base/mul' ); ``` #### mul( z1, z2 ) @@ -41,20 +41,20 @@ var mul = require( '@stdlib/complex/float32/base/mul' ); Multiples two single-precision complex floating-point numbers. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( -2.0, 1.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( -2.0, 1.0 ); -var v = mul( z1, z2 ); +const v = mul( z1, z2 ); // returns -var re = realf( v ); +const re = realf( v ); // returns -13.0 -var im = imagf( v ); +const im = imagf( v ); // returns -1.0 ``` @@ -69,20 +69,16 @@ var im = imagf( v ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var mul = require( '@stdlib/complex/float32/base/mul' ); - -var rand = discreteUniform( -50, 50 ); - -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex64( rand(), rand() ); - z2 = new Complex64( rand(), rand() ); - z3 = mul( z1, z2 ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const mul = require( '@stdlib/complex/float32/base/mul' ); + +const rand = discreteUniform( -50, 50 ); + +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex64( rand(), rand() ); + const z2 = new Complex64( rand(), rand() ); + const z3 = mul( z1, z2 ); console.log( '(%s) * (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/conj/README.md b/lib/node_modules/@stdlib/complex/float32/conj/README.md index 563d07385528..2ba4ba696a76 100644 --- a/lib/node_modules/@stdlib/complex/float32/conj/README.md +++ b/lib/node_modules/@stdlib/complex/float32/conj/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var conj = require( '@stdlib/complex/float32/conj' ); +const conj = require( '@stdlib/complex/float32/conj' ); ``` #### conj( z ) @@ -45,13 +45,13 @@ var conj = require( '@stdlib/complex/float32/conj' ); Returns the [complex conjugate][complex-conjugate] of a single-precision complex floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z = new Complex64( 5.0, 3.0 ); -var str = z.toString(); +const z = new Complex64( 5.0, 3.0 ); +let str = z.toString(); // returns '5 + 3i' -var v = conj( z ); +const v = conj( z ); str = v.toString(); // returns '5 - 3i' ``` @@ -79,24 +79,22 @@ str = v.toString(); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( '@stdlib/complex/float32/conj' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const conj = require( '@stdlib/complex/float32/conj' ); function random() { return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); +const x = filledarrayBy( 100, 'complex64', random ); // returns // Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = x.get( i ); +for ( let i = 0; i < 100; i++ ) { + const z = x.get( i ); console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/ctor/README.md b/lib/node_modules/@stdlib/complex/float32/ctor/README.md index 95da2f9cedcb..0a84453b3132 100644 --- a/lib/node_modules/@stdlib/complex/float32/ctor/README.md +++ b/lib/node_modules/@stdlib/complex/float32/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); ``` #### Complex64( real, imag ) @@ -45,7 +45,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); 64-bit complex number constructor, where `real` and `imag` are the **real** and **imaginary** components, respectively. ```javascript -var z = new Complex64( 5.0, 3.0 ); +const z = new Complex64( 5.0, 3.0 ); // returns ``` @@ -58,7 +58,7 @@ var z = new Complex64( 5.0, 3.0 ); Size (in bytes) of each component. ```javascript -var nbytes = Complex64.BYTES_PER_ELEMENT; +const nbytes = Complex64.BYTES_PER_ELEMENT; // returns 4 ``` @@ -67,9 +67,9 @@ var nbytes = Complex64.BYTES_PER_ELEMENT; Size (in bytes) of each component. ```javascript -var z = new Complex64( 5.0, 3.0 ); +const z = new Complex64( 5.0, 3.0 ); -var nbytes = z.BYTES_PER_ELEMENT; +const nbytes = z.BYTES_PER_ELEMENT; // returns 4 ``` @@ -78,9 +78,9 @@ var nbytes = z.BYTES_PER_ELEMENT; Length (in bytes) of a complex number. ```javascript -var z = new Complex64( 5.0, 3.0 ); +const z = new Complex64( 5.0, 3.0 ); -var nbytes = z.byteLength; +const nbytes = z.byteLength; // returns 8 ``` @@ -93,9 +93,9 @@ A `Complex64` instance has the following properties... A **read-only** property returning the **real** component. ```javascript -var z = new Complex64( 5.0, 3.0 ); +const z = new Complex64( 5.0, 3.0 ); -var re = z.re; +const re = z.re; // returns 5.0 ``` @@ -104,9 +104,9 @@ var re = z.re; A **read-only** property returning the **imaginary** component. ```javascript -var z = new Complex64( 5.0, -3.0 ); +const z = new Complex64( 5.0, -3.0 ); -var im = z.im; +const im = z.im; // returns -3.0 ``` @@ -123,8 +123,8 @@ These methods do **not** mutate a `Complex64` instance and, instead, return a co Returns a `string` representation of a `Complex64` instance. ```javascript -var z = new Complex64( 5.0, 3.0 ); -var str = z.toString(); +let z = new Complex64( 5.0, 3.0 ); +let str = z.toString(); // returns '5 + 3i' z = new Complex64( -5.0, -3.0 ); @@ -137,9 +137,9 @@ str = z.toString(); Returns a [JSON][json] representation of a `Complex64` instance. [`JSON.stringify()`][mdn-json-stringify] implicitly calls this method when stringifying a `Complex64` instance. ```javascript -var z = new Complex64( 5.0, -3.0 ); +const z = new Complex64( 5.0, -3.0 ); -var o = z.toJSON(); +const o = z.toJSON(); /* { "type": "Complex64", @@ -180,9 +180,9 @@ To [revive][mdn-json-parse] a `Complex64` number from a [JSON][json] `string`, s ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z = new Complex64( 3.0, -2.0 ); +const z = new Complex64( 3.0, -2.0 ); console.log( 'type: %s', typeof z ); // => 'type: object' diff --git a/lib/node_modules/@stdlib/complex/float32/imag/README.md b/lib/node_modules/@stdlib/complex/float32/imag/README.md index 1cafccb696bf..482e3a1aba88 100644 --- a/lib/node_modules/@stdlib/complex/float32/imag/README.md +++ b/lib/node_modules/@stdlib/complex/float32/imag/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var imag = require( '@stdlib/complex/float32/imag' ); +const imag = require( '@stdlib/complex/float32/imag' ); ``` #### imag( z ) @@ -45,10 +45,10 @@ var imag = require( '@stdlib/complex/float32/imag' ); Returns the **imaginary** component of a single-precision complex floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z = new Complex64( 5.0, 3.0 ); -var im = imag( z ); +const z = new Complex64( 5.0, 3.0 ); +const im = imag( z ); // returns 3.0 ``` @@ -75,24 +75,22 @@ var im = imag( z ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const imag = require( '@stdlib/complex/float32/imag' ); function random() { return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); +const x = filledarrayBy( 100, 'complex64', random ); // returns // Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/parse/README.md b/lib/node_modules/@stdlib/complex/float32/parse/README.md index e65efffe0718..cd6730bde219 100644 --- a/lib/node_modules/@stdlib/complex/float32/parse/README.md +++ b/lib/node_modules/@stdlib/complex/float32/parse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); +const parseComplex64 = require( '@stdlib/complex/float32/parse' ); ``` #### parseComplex64( str ) @@ -45,19 +45,19 @@ var parseComplex64 = require( '@stdlib/complex/float32/parse' ); Parses a string representation of a 64-bit [complex number][@stdlib/complex/float32/ctor]. ```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const parseComplex64 = require( '@stdlib/complex/float32/parse' ); +const real = require( '@stdlib/complex/float32/real' ); +const imag = require( '@stdlib/complex/float32/imag' ); -var str = '5 + 3i'; +const str = '5 + 3i'; -var z = parseComplex64( str ); +const z = parseComplex64( str ); // returns -var re = real( z ); +const re = real( z ); // returns 5.0 -var im = imag( z ); +const im = imag( z ); // returns 3.0 ``` @@ -84,15 +84,15 @@ For details on the string format, see [Complex64][@stdlib/complex/float32/ctor]. ```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const parseComplex64 = require( '@stdlib/complex/float32/parse' ); +const isComplex64 = require( '@stdlib/assert/is-complex64' ); +const real = require( '@stdlib/complex/float32/real' ); +const imag = require( '@stdlib/complex/float32/imag' ); -var str = '1e3 - 2.75i'; +const str = '1e3 - 2.75i'; -var z = parseComplex64( str ); -var bool = isComplex64( z ); +const z = parseComplex64( str ); +let bool = isComplex64( z ); // returns true bool = ( real( z ) === 1e3 ); diff --git a/lib/node_modules/@stdlib/complex/float32/real/README.md b/lib/node_modules/@stdlib/complex/float32/real/README.md index 49dba00b5cd9..2c7de4d401dc 100644 --- a/lib/node_modules/@stdlib/complex/float32/real/README.md +++ b/lib/node_modules/@stdlib/complex/float32/real/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var real = require( '@stdlib/complex/float32/real' ); +const real = require( '@stdlib/complex/float32/real' ); ``` #### real( z ) @@ -45,10 +45,10 @@ var real = require( '@stdlib/complex/float32/real' ); Returns the **real** component of a single-precision complex floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z = new Complex64( 5.0, 3.0 ); -var re = real( z ); +const z = new Complex64( 5.0, 3.0 ); +const re = real( z ); // returns 5.0 ``` @@ -75,24 +75,22 @@ var re = real( z ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float32/real' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const real = require( '@stdlib/complex/float32/real' ); function random() { return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); +const x = filledarrayBy( 100, 'complex64', random ); // returns // Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); console.log( 'real(%s) = %d', z.toString(), real( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/reim/README.md b/lib/node_modules/@stdlib/complex/float32/reim/README.md index cb3db30b7f32..094763041da8 100644 --- a/lib/node_modules/@stdlib/complex/float32/reim/README.md +++ b/lib/node_modules/@stdlib/complex/float32/reim/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reim = require( '@stdlib/complex/float32/reim' ); +const reim = require( '@stdlib/complex/float32/reim' ); ``` #### reim( z ) @@ -45,10 +45,10 @@ var reim = require( '@stdlib/complex/float32/reim' ); Returns the **real** and **imaginary** components of a single-precision complex floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var z = new Complex64( 5.0, 3.0 ); -var out = reim( z ); +const z = new Complex64( 5.0, 3.0 ); +const out = reim( z ); // returns [ 5.0, 3.0 ] ``` @@ -75,26 +75,23 @@ var out = reim( z ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( '@stdlib/complex/float32/reim' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const reim = require( '@stdlib/complex/float32/reim' ); function random() { return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); +const x = filledarrayBy( 100, 'complex64', random ); // returns // Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); + const out = reim( z ); console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float32/reviver/README.md b/lib/node_modules/@stdlib/complex/float32/reviver/README.md index e3798d924514..eabae2f8bb29 100644 --- a/lib/node_modules/@stdlib/complex/float32/reviver/README.md +++ b/lib/node_modules/@stdlib/complex/float32/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); +const reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); ``` #### reviveComplex64( key, value ) @@ -45,11 +45,11 @@ var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); Revives a JSON-serialized 64-bit [complex number][@stdlib/complex/float32/ctor]. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"Complex64","re":5,"im":3}'; +const str = '{"type":"Complex64","re":5,"im":3}'; -var z = parseJSON( str, reviveComplex64 ); +const z = parseJSON( str, reviveComplex64 ); // returns ``` @@ -76,19 +76,19 @@ For details on the JSON serialization format, see [`Complex64`][@stdlib/complex/ ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); -var z = new Complex64( 5.0, 3.0 ); -var str = JSON.stringify( z ); +const z = new Complex64( 5.0, 3.0 ); +const str = JSON.stringify( z ); // returns '{"type":"Complex64","re":5,"im":3}' -var w = parseJSON( str, reviveComplex64 ); +const w = parseJSON( str, reviveComplex64 ); if ( w instanceof Error ) { throw w; } -var bool = ( w instanceof z.constructor ); +let bool = ( w instanceof z.constructor ); // returns true bool = ( w.re === z.re ); diff --git a/lib/node_modules/@stdlib/complex/float64/README.md b/lib/node_modules/@stdlib/complex/float64/README.md index 9b406240a789..84c52d18f2c6 100644 --- a/lib/node_modules/@stdlib/complex/float64/README.md +++ b/lib/node_modules/@stdlib/complex/float64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/float64' ); +const complex = require( '@stdlib/complex/float64' ); ``` #### complex @@ -35,7 +35,7 @@ var complex = require( '@stdlib/complex/float64' ); Namespace containing double-precision complex floating-point number functions. ```javascript -var ns = complex; +const ns = complex; // returns {...} ``` @@ -90,8 +90,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float64' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float64/base/README.md b/lib/node_modules/@stdlib/complex/float64/base/README.md index 016d6d474403..7e0a1e2136ae 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var complex = require( '@stdlib/complex/float64/base' ); +const complex = require( '@stdlib/complex/float64/base' ); ``` #### complex @@ -35,7 +35,7 @@ var complex = require( '@stdlib/complex/float64/base' ); Namespace containing base (i.e., lower-level) double-precision complex floating-point number functions. ```javascript -var ns = complex; +const ns = complex; // returns {...} ``` @@ -85,8 +85,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float64/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float64/base/add/README.md b/lib/node_modules/@stdlib/complex/float64/base/add/README.md index ce3a0e42c140..356780e9f6a2 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/add/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/add/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var add = require( '@stdlib/complex/float64/base/add' ); +const add = require( '@stdlib/complex/float64/base/add' ); ``` #### add( z1, z2 ) @@ -41,19 +41,19 @@ var add = require( '@stdlib/complex/float64/base/add' ); Adds two double-precision complex floating-point numbers. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z = new Complex128( -1.5, 2.5 ); +const z = new Complex128( -1.5, 2.5 ); -var v = add( z, z ); +const v = add( z, z ); // returns -var re = real( v ); +const re = real( v ); // returns -3.0 -var im = imag( v ); +const im = imag( v ); // returns 5.0 ``` @@ -68,20 +68,16 @@ var im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var add = require( '@stdlib/complex/float64/base/add' ); - -var rand = discreteUniform( -50, 50 ); - -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex128( rand(), rand() ); - z2 = new Complex128( rand(), rand() ); - z3 = add( z1, z2 ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const add = require( '@stdlib/complex/float64/base/add' ); + +const rand = discreteUniform( -50, 50 ); + +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex128( rand(), rand() ); + const z2 = new Complex128( rand(), rand() ); + const z3 = add( z1, z2 ); console.log( '(%s) + (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/README.md b/lib/node_modules/@stdlib/complex/float64/base/assert/README.md index 1edf1e95935f..24590471cebe 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var assert = require( '@stdlib/complex/float64/base/assert' ); +const assert = require( '@stdlib/complex/float64/base/assert' ); ``` #### assert @@ -35,7 +35,7 @@ var assert = require( '@stdlib/complex/float64/base/assert' ); Namespace containing base (i.e., lower-level) double-precision complex floating-point number assertion functions. ```javascript -var ns = assert; +const ns = assert; // returns {...} ``` @@ -75,8 +75,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/complex/float64/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/is-equal/README.md b/lib/node_modules/@stdlib/complex/float64/base/assert/is-equal/README.md index 39eb9cc7b3ae..a6da498c2311 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/is-equal/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/is-equal/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); +const isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); ``` #### isEqual( z1, z2 ) @@ -45,12 +45,12 @@ var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); Tests whether two double-precision complex floating-point numbers are equal. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( 5.0, 3.0 ); -var out = isEqual( z1, z2 ); +const out = isEqual( z1, z2 ); // returns true ``` @@ -75,12 +75,12 @@ var out = isEqual( z1, z2 ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isEqual( z1, z2 ); +let z1 = new Complex128( 5.0, 3.0 ); +let z2 = new Complex128( 5.0, 3.0 ); +let out = isEqual( z1, z2 ); // returns true z1 = new Complex128( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/is-not-equal/README.md b/lib/node_modules/@stdlib/complex/float64/base/assert/is-not-equal/README.md index 1d86c3703271..8a16d49d741d 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/is-not-equal/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/is-not-equal/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); +const isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); ``` #### isNotEqual( z1, z2 ) @@ -45,12 +45,12 @@ var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); Tests whether two double-precision complex floating-point numbers are not equal. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, -3.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( 5.0, -3.0 ); -var out = isNotEqual( z1, z2 ); +const out = isNotEqual( z1, z2 ); // returns true ``` @@ -75,12 +75,12 @@ var out = isNotEqual( z1, z2 ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isNotEqual( z1, z2 ); +let z1 = new Complex128( 5.0, 3.0 ); +let z2 = new Complex128( 5.0, 3.0 ); +let out = isNotEqual( z1, z2 ); // returns false z1 = new Complex128( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value-zero/README.md index e21a3bda45dc..743eff5698de 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value-zero/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); +const isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); ``` #### isSameValueZero( z1, z2 ) @@ -45,36 +45,36 @@ var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-valu Tests whether two double-precision complex floating-point numbers are the same value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValueZero( z1, z2 ); +const out = isSameValueZero( z1, z2 ); // returns true ``` In contrast to the strict equality operator `===`, the function treats `NaNs` as the same value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( NaN, NaN ); -var z2 = new Complex128( NaN, NaN ); +const z1 = new Complex128( NaN, NaN ); +const z2 = new Complex128( NaN, NaN ); -var out = isSameValueZero( z1, z2 ); +const out = isSameValueZero( z1, z2 ); // returns true ``` In contrast to the [SameValue Algorithm][@stdlib/complex/float64/base/assert/is-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( -0.0, 0.0 ); -var z2 = new Complex128( 0.0, -0.0 ); +const z1 = new Complex128( -0.0, 0.0 ); +const z2 = new Complex128( 0.0, -0.0 ); -var out = isSameValueZero( z1, z2 ); +const out = isSameValueZero( z1, z2 ); // returns true ``` @@ -99,12 +99,12 @@ var out = isSameValueZero( z1, z2 ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValueZero( z1, z2 ); +let z1 = new Complex128( 5.0, 3.0 ); +let z2 = new Complex128( 5.0, 3.0 ); +let out = isSameValueZero( z1, z2 ); // returns true z1 = new Complex128( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value/README.md b/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value/README.md index b87858736b6a..40915e49b99d 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/assert/is-same-value/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); +const isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); ``` #### isSameValue( z1, z2 ) @@ -45,24 +45,24 @@ var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ) Tests whether two double-precision complex floating-point numbers are the same value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValue( z1, z2 ); +const out = isSameValue( z1, z2 ); // returns true ``` In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z1 = new Complex128( NaN, NaN ); -var z2 = new Complex128( NaN, NaN ); +let z1 = new Complex128( NaN, NaN ); +let z2 = new Complex128( NaN, NaN ); -var out = isSameValue( z1, z2 ); +let out = isSameValue( z1, z2 ); // returns true z1 = new Complex128( -0.0, 0.0 ); @@ -97,12 +97,12 @@ out = isSameValue( z1, z2 ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValue( z1, z2 ); +let z1 = new Complex128( 5.0, 3.0 ); +let z2 = new Complex128( 5.0, 3.0 ); +let out = isSameValue( z1, z2 ); // returns true z1 = new Complex128( -5.0, -3.0 ); diff --git a/lib/node_modules/@stdlib/complex/float64/base/mul/README.md b/lib/node_modules/@stdlib/complex/float64/base/mul/README.md index 71d756d1f03f..db10443b1e72 100644 --- a/lib/node_modules/@stdlib/complex/float64/base/mul/README.md +++ b/lib/node_modules/@stdlib/complex/float64/base/mul/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mul = require( '@stdlib/complex/float64/base/mul' ); +const mul = require( '@stdlib/complex/float64/base/mul' ); ``` #### mul( z1, z2 ) @@ -41,20 +41,20 @@ var mul = require( '@stdlib/complex/float64/base/mul' ); Multiplies two double-precision complex floating-point numbers. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( -2.0, 1.0 ); -var v = mul( z1, z2 ); +const v = mul( z1, z2 ); // returns -var re = real( v ); +const re = real( v ); // returns -13.0 -var im = imag( v ); +const im = imag( v ); // returns -1.0 ``` @@ -69,20 +69,16 @@ var im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var mul = require( '@stdlib/complex/float64/base/mul' ); - -var rand = discreteUniform( -50, 50 ); - -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex128( rand(), rand() ); - z2 = new Complex128( rand(), rand() ); - z3 = mul( z1, z2 ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const mul = require( '@stdlib/complex/float64/base/mul' ); + +const rand = discreteUniform( -50, 50 ); + +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex128( rand(), rand() ); + const z2 = new Complex128( rand(), rand() ); + const z3 = mul( z1, z2 ); console.log( '(%s) * (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/conj/README.md b/lib/node_modules/@stdlib/complex/float64/conj/README.md index dff1b62af4ff..030744bba5e1 100644 --- a/lib/node_modules/@stdlib/complex/float64/conj/README.md +++ b/lib/node_modules/@stdlib/complex/float64/conj/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var conj = require( '@stdlib/complex/float64/conj' ); +const conj = require( '@stdlib/complex/float64/conj' ); ``` #### conj( z ) @@ -45,13 +45,13 @@ var conj = require( '@stdlib/complex/float64/conj' ); Returns the [complex conjugate][complex-conjugate] of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z = new Complex128( 5.0, 3.0 ); -var str = z.toString(); +const z = new Complex128( 5.0, 3.0 ); +let str = z.toString(); // returns '5 + 3i' -var v = conj( z ); +const v = conj( z ); str = v.toString(); // returns '5 - 3i' ``` @@ -79,24 +79,22 @@ str = v.toString(); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( '@stdlib/complex/float64/conj' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const conj = require( '@stdlib/complex/float64/conj' ); function random() { return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); +const x = filledarrayBy( 100, 'complex128', random ); // returns // Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/ctor/README.md b/lib/node_modules/@stdlib/complex/float64/ctor/README.md index a3fa69e1f780..4ccd977753e7 100644 --- a/lib/node_modules/@stdlib/complex/float64/ctor/README.md +++ b/lib/node_modules/@stdlib/complex/float64/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); ``` #### Complex128( real, imag ) @@ -45,7 +45,7 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' ); 128-bit complex number constructor, where `real` and `imag` are the **real** and **imaginary** components, respectively. ```javascript -var z = new Complex128( 5.0, 3.0 ); +const z = new Complex128( 5.0, 3.0 ); // returns ``` @@ -58,7 +58,7 @@ var z = new Complex128( 5.0, 3.0 ); Size (in bytes) of each component. ```javascript -var nbytes = Complex128.BYTES_PER_ELEMENT; +const nbytes = Complex128.BYTES_PER_ELEMENT; // returns 8 ``` @@ -67,9 +67,9 @@ var nbytes = Complex128.BYTES_PER_ELEMENT; Size (in bytes) of each component. ```javascript -var z = new Complex128( 5.0, 3.0 ); +const z = new Complex128( 5.0, 3.0 ); -var nbytes = z.BYTES_PER_ELEMENT; +const nbytes = z.BYTES_PER_ELEMENT; // returns 8 ``` @@ -78,9 +78,9 @@ var nbytes = z.BYTES_PER_ELEMENT; Length (in bytes) of a complex number. ```javascript -var z = new Complex128( 5.0, 3.0 ); +const z = new Complex128( 5.0, 3.0 ); -var nbytes = z.byteLength; +const nbytes = z.byteLength; // returns 16 ``` @@ -93,9 +93,9 @@ A `Complex128` instance has the following properties... A **read-only** property returning the **real** component. ```javascript -var z = new Complex128( 5.0, 3.0 ); +const z = new Complex128( 5.0, 3.0 ); -var re = z.re; +const re = z.re; // returns 5.0 ``` @@ -104,9 +104,9 @@ var re = z.re; A **read-only** property returning the **imaginary** component. ```javascript -var z = new Complex128( 5.0, -3.0 ); +const z = new Complex128( 5.0, -3.0 ); -var im = z.im; +const im = z.im; // returns -3.0 ``` @@ -123,8 +123,8 @@ These methods do **not** mutate a `Complex128` instance and, instead, return a c Returns a `string` representation of a `Complex128` instance. ```javascript -var z = new Complex128( 5.0, 3.0 ); -var str = z.toString(); +let z = new Complex128( 5.0, 3.0 ); +let str = z.toString(); // returns '5 + 3i' z = new Complex128( -5.0, -3.0 ); @@ -137,9 +137,9 @@ str = z.toString(); Returns a [JSON][json] representation of a `Complex128` instance. [`JSON.stringify()`][mdn-json-stringify] implicitly calls this method when stringifying a `Complex128` instance. ```javascript -var z = new Complex128( 5.0, -3.0 ); +const z = new Complex128( 5.0, -3.0 ); -var o = z.toJSON(); +const o = z.toJSON(); /* { "type": "Complex128", @@ -180,9 +180,9 @@ To [revive][mdn-json-parse] a `Complex128` number from a [JSON][json] `string`, ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z = new Complex128( 3.0, -2.0 ); +const z = new Complex128( 3.0, -2.0 ); console.log( 'type: %s', typeof z ); // => 'type: object' diff --git a/lib/node_modules/@stdlib/complex/float64/imag/README.md b/lib/node_modules/@stdlib/complex/float64/imag/README.md index 41078d4f3634..3005f46c92c7 100644 --- a/lib/node_modules/@stdlib/complex/float64/imag/README.md +++ b/lib/node_modules/@stdlib/complex/float64/imag/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var imag = require( '@stdlib/complex/float64/imag' ); +const imag = require( '@stdlib/complex/float64/imag' ); ``` #### imag( z ) @@ -45,10 +45,10 @@ var imag = require( '@stdlib/complex/float64/imag' ); Returns the **imaginary** component of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z = new Complex128( 5.0, 3.0 ); -var im = imag( z ); +const z = new Complex128( 5.0, 3.0 ); +const im = imag( z ); // returns 3.0 ``` @@ -75,24 +75,22 @@ var im = imag( z ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const imag = require( '@stdlib/complex/float64/imag' ); function random() { return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); +const x = filledarrayBy( 100, 'complex128', random ); // returns // Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/parse/README.md b/lib/node_modules/@stdlib/complex/float64/parse/README.md index d1cae8cbbc2b..91cf921392a3 100644 --- a/lib/node_modules/@stdlib/complex/float64/parse/README.md +++ b/lib/node_modules/@stdlib/complex/float64/parse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var parseComplex128 = require( '@stdlib/complex/float64/parse' ); +const parseComplex128 = require( '@stdlib/complex/float64/parse' ); ``` #### parseComplex128( str ) @@ -45,18 +45,18 @@ var parseComplex128 = require( '@stdlib/complex/float64/parse' ); Parses a string representation of a 128-bit [complex number][@stdlib/complex/float64/ctor]. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var str = '5 + 3i'; +const str = '5 + 3i'; -var z = parseComplex128( str ); +const z = parseComplex128( str ); // returns -var re = real( z ); +const re = real( z ); // returns 5.0 -var im = imag( z ); +const im = imag( z ); // returns 3.0 ``` @@ -83,15 +83,15 @@ For details on the string format, see [Complex128][@stdlib/complex/float64/ctor] ```javascript -var parseComplex128 = require( '@stdlib/complex/float64/parse' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const parseComplex128 = require( '@stdlib/complex/float64/parse' ); +const isComplex128 = require( '@stdlib/assert/is-complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var str = '1e3 - 2.75i'; +const str = '1e3 - 2.75i'; -var z = parseComplex128( str ); -var bool = isComplex128( z ); +const z = parseComplex128( str ); +let bool = isComplex128( z ); // returns true bool = ( real( z ) === 1e3 ); diff --git a/lib/node_modules/@stdlib/complex/float64/real/README.md b/lib/node_modules/@stdlib/complex/float64/real/README.md index 211bd103fad2..3c4c3ea70ca7 100644 --- a/lib/node_modules/@stdlib/complex/float64/real/README.md +++ b/lib/node_modules/@stdlib/complex/float64/real/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var real = require( '@stdlib/complex/float64/real' ); +const real = require( '@stdlib/complex/float64/real' ); ``` #### real( z ) @@ -45,10 +45,10 @@ var real = require( '@stdlib/complex/float64/real' ); Returns the **real** component of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z = new Complex128( 5.0, 3.0 ); -var re = real( z ); +const z = new Complex128( 5.0, 3.0 ); +const re = real( z ); // returns 5.0 ``` @@ -75,24 +75,22 @@ var re = real( z ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float64/real' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const real = require( '@stdlib/complex/float64/real' ); function random() { return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); +const x = filledarrayBy( 100, 'complex128', random ); // returns // Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); console.log( 'real(%s) = %d', z.toString(), real( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/reim/README.md b/lib/node_modules/@stdlib/complex/float64/reim/README.md index 83b139573f03..2292014d7a19 100644 --- a/lib/node_modules/@stdlib/complex/float64/reim/README.md +++ b/lib/node_modules/@stdlib/complex/float64/reim/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reim = require( '@stdlib/complex/float64/reim' ); +const reim = require( '@stdlib/complex/float64/reim' ); ``` #### reim( z ) @@ -45,10 +45,10 @@ var reim = require( '@stdlib/complex/float64/reim' ); Returns the **real** and **imaginary** components of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var z = new Complex128( 5.0, 3.0 ); -var out = reim( z ); +const z = new Complex128( 5.0, 3.0 ); +const out = reim( z ); // returns [ 5.0, 3.0 ] ``` @@ -75,26 +75,23 @@ var out = reim( z ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( '@stdlib/complex/float64/reim' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const reim = require( '@stdlib/complex/float64/reim' ); function random() { return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); } // Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); +const x = filledarrayBy( 100, 'complex128', random ); // returns // Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); +for ( let i = 0; i < x.length; i++ ) { + const z = x.get( i ); + const out = reim( z ); console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/complex/float64/reviver/README.md b/lib/node_modules/@stdlib/complex/float64/reviver/README.md index 0e050de3675d..4ca4b45dcc51 100644 --- a/lib/node_modules/@stdlib/complex/float64/reviver/README.md +++ b/lib/node_modules/@stdlib/complex/float64/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); +const reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); ``` #### reviveComplex128( key, value ) @@ -45,11 +45,11 @@ var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); Revives a JSON-serialized 128-bit [complex number][@stdlib/complex/float64/ctor]. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"Complex128","re":5,"im":3}'; +const str = '{"type":"Complex128","re":5,"im":3}'; -var z = parseJSON( str, reviveComplex128 ); +const z = parseJSON( str, reviveComplex128 ); // returns ``` @@ -76,19 +76,19 @@ For details on the JSON serialization format, see [`Complex128`][@stdlib/complex ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); +const z = new Complex128( 5.0, 3.0 ); +const str = JSON.stringify( z ); // returns '{"type":"Complex128","re":5,"im":3}' -var w = parseJSON( str, reviveComplex128 ); +const w = parseJSON( str, reviveComplex128 ); if ( w instanceof Error ) { throw w; } -var bool = ( w instanceof z.constructor ); +let bool = ( w instanceof z.constructor ); // returns true bool = ( w.re === z.re ); diff --git a/lib/node_modules/@stdlib/complex/promotion-rules/README.md b/lib/node_modules/@stdlib/complex/promotion-rules/README.md index 6e6e88a5e348..56b6fe527f73 100644 --- a/lib/node_modules/@stdlib/complex/promotion-rules/README.md +++ b/lib/node_modules/@stdlib/complex/promotion-rules/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var promotionRules = require( '@stdlib/complex/promotion-rules' ); +const promotionRules = require( '@stdlib/complex/promotion-rules' ); ``` #### promotionRules( \[dtype1, dtype2] ) @@ -45,27 +45,27 @@ var promotionRules = require( '@stdlib/complex/promotion-rules' ); If provided data types, returns the complex number [data type][@stdlib/complex/dtypes] with the smallest size and closest "kind" to which data types can be **safely** cast. ```javascript -var out = promotionRules( 'complex128', 'complex64' ); +const out = promotionRules( 'complex128', 'complex64' ); // returns 'complex128' ``` If not provided data types, the function returns a promotion table. ```javascript -var out = promotionRules(); +const out = promotionRules(); // returns {...} -var c128 = out[ 'complex128' ]; +const c128 = out[ 'complex128' ]; // returns {...} -var rule = c128[ 'uint32' ]; +const rule = c128[ 'uint32' ]; // returns 'complex128' ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = promotionRules( 'foo', 'complex128' ); +const out = promotionRules( 'foo', 'complex128' ); // returns null ``` @@ -94,25 +94,18 @@ var out = promotionRules( 'foo', 'complex128' ); ```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var promotionRules = require( '@stdlib/complex/promotion-rules' ); - -var DTYPES; -var dt1; -var dt2; -var dt; -var i; -var j; +const dtypes = require( '@stdlib/complex/dtypes' ); +const promotionRules = require( '@stdlib/complex/promotion-rules' ); // Get the list of supported data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the promotion rule for each pair of data types... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt1 = DTYPES[ i ]; + for ( let j = 0; j < DTYPES.length; j++ ) { + const dt2 = DTYPES[ j ]; + const dt = promotionRules( dt1, dt2 ); console.log( '(%s, %s) => %s', dt1, dt2, dt ); } } diff --git a/lib/node_modules/@stdlib/complex/reviver/README.md b/lib/node_modules/@stdlib/complex/reviver/README.md index 06976cfaf0e2..f91b65cc8a4d 100644 --- a/lib/node_modules/@stdlib/complex/reviver/README.md +++ b/lib/node_modules/@stdlib/complex/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveComplex = require( '@stdlib/complex/reviver' ); +const reviveComplex = require( '@stdlib/complex/reviver' ); ``` #### reviveComplex( key, value ) @@ -45,11 +45,11 @@ var reviveComplex = require( '@stdlib/complex/reviver' ); Revives a JSON-serialized `complex` number. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"Complex128","re":5,"im":3}'; +const str = '{"type":"Complex128","re":5,"im":3}'; -var z = parseJSON( str, reviveComplex ); +const z = parseJSON( str, reviveComplex ); // returns ``` @@ -76,19 +76,19 @@ For details on the JSON serialization format, see [`Complex128`][@stdlib/complex ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex = require( '@stdlib/complex/reviver' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const reviveComplex = require( '@stdlib/complex/reviver' ); -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); +const z = new Complex128( 5.0, 3.0 ); +const str = JSON.stringify( z ); // returns '{"type":"Complex128","re":5,"im":3}' -var w = parseJSON( str, reviveComplex ); +const w = parseJSON( str, reviveComplex ); if ( w instanceof Error ) { throw w; } -var bool = ( w instanceof z.constructor ); +let bool = ( w instanceof z.constructor ); // returns true bool = ( w.re === z.re ); diff --git a/lib/node_modules/@stdlib/console/README.md b/lib/node_modules/@stdlib/console/README.md index 56b1caf49dce..1207cbeb0049 100644 --- a/lib/node_modules/@stdlib/console/README.md +++ b/lib/node_modules/@stdlib/console/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/console' ); +const ns = require( '@stdlib/console' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/console' ); Console. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -63,8 +63,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/console' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/console' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/console/log-each/README.md b/lib/node_modules/@stdlib/console/log-each/README.md index 3670cfcbce0e..4ff8e6ea9119 100644 --- a/lib/node_modules/@stdlib/console/log-each/README.md +++ b/lib/node_modules/@stdlib/console/log-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var logEach = require( '@stdlib/console/log-each' ); +const logEach = require( '@stdlib/console/log-each' ); ``` #### logEach( str\[, ...args] ) @@ -45,8 +45,8 @@ var logEach = require( '@stdlib/console/log-each' ); Inserts array element values into a format string and prints the result. ```javascript -var x = [ 1, 2, 3 ]; -var y = [ 4, 5, 6 ]; +const x = [ 1, 2, 3 ]; +const y = [ 4, 5, 6 ]; logEach( '%d < %d ', x, y ); // e.g., => '1 < 4\n2 < 5\n3 < 6\n' @@ -55,8 +55,8 @@ logEach( '%d < %d ', x, y ); If an interpolated argument is not an array-like object, the argument is broadcasted for each iteration. ```javascript -var x = [ 1, 2, 3 ]; -var y = 4; +const x = [ 1, 2, 3 ]; +const y = 4; logEach( '%d < %d', x, y ); // e.g., => '1 < 4\n2 < 4\n3 < 4\n' @@ -88,17 +88,17 @@ logEach( '%d < %d', x, y ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var filledBy = require( '@stdlib/array/filled-by' ); -var map = require( '@stdlib/utils/map' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var logEach = require( '@stdlib/console/log-each' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const filledBy = require( '@stdlib/array/filled-by' ); +const map = require( '@stdlib/utils/map' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const logEach = require( '@stdlib/console/log-each' ); -var rand = discreteUniform( -50, 50 ); -var x = filledBy( 10, 'float64', rand ); +const rand = discreteUniform( -50, 50 ); +const x = filledBy( 10, 'float64', rand ); -var y = map( x, naryFunction( abs, 1 ) ); +const y = map( x, naryFunction( abs, 1 ) ); logEach( 'abs(%d) = %d', x, y ); ``` diff --git a/lib/node_modules/@stdlib/console/log/README.md b/lib/node_modules/@stdlib/console/log/README.md index 45ca947ad96b..1d7969aff08a 100644 --- a/lib/node_modules/@stdlib/console/log/README.md +++ b/lib/node_modules/@stdlib/console/log/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var log = require( '@stdlib/console/log' ); +const log = require( '@stdlib/console/log' ); ``` #### log( \[data]\[,...args] ) @@ -67,7 +67,7 @@ log( 'Hello, %s!', 'World' ); - In general, prefer formatting with [`@stdlib/string/format`][@stdlib/string/format], as string substitution support is not consistent across JavaScript environments. ```javascript - var format = require( '@stdlib/string/format' ); + const format = require( '@stdlib/string/format' ); log( format( '%s: %.2f', 'Foo', 3.14 ) ); ``` @@ -87,7 +87,7 @@ log( 'Hello, %s!', 'World' ); ```javascript -var log = require( '@stdlib/console/log' ); +const log = require( '@stdlib/console/log' ); log( 'Hello, World!' ); log( 'Hello, %s!', 'World' ); diff --git a/lib/node_modules/@stdlib/constants/README.md b/lib/node_modules/@stdlib/constants/README.md index 4e26885c128c..16916f3d358e 100644 --- a/lib/node_modules/@stdlib/constants/README.md +++ b/lib/node_modules/@stdlib/constants/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants' ); +const constants = require( '@stdlib/constants' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants' ); Namespace containing constants. ```javascript -var ns = constants; +const ns = constants; // returns {...} ``` @@ -76,10 +76,10 @@ Constants are split across the the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants' ); -var out = constants.float64.PI; +let out = constants.float64.PI; // returns ~3.142 out = constants.array.MAX_ARRAY_LENGTH; diff --git a/lib/node_modules/@stdlib/constants/array/README.md b/lib/node_modules/@stdlib/constants/array/README.md index fda7bc808253..9490fcfb92ee 100644 --- a/lib/node_modules/@stdlib/constants/array/README.md +++ b/lib/node_modules/@stdlib/constants/array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/array' ); +const constants = require( '@stdlib/constants/array' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/array' ); Array constants. ```javascript -var ns = constants; +const ns = constants; // returns {...} ``` @@ -63,8 +63,8 @@ var ns = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/array' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/array' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/array/max-array-length/README.md b/lib/node_modules/@stdlib/constants/array/max-array-length/README.md index 633b9cc1835a..afdd17e26422 100644 --- a/lib/node_modules/@stdlib/constants/array/max-array-length/README.md +++ b/lib/node_modules/@stdlib/constants/array/max-array-length/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' ); +const MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' ); ``` #### MAX_ARRAY_LENGTH @@ -45,7 +45,7 @@ var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' ); Maximum length for a generic array. ```javascript -var len = MAX_ARRAY_LENGTH; +const len = MAX_ARRAY_LENGTH; // returns 4294967295 ``` @@ -70,23 +70,21 @@ var len = MAX_ARRAY_LENGTH; ```javascript -var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' ); +const MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' ); function alloc( len ) { - var arr; - var i; if ( len > MAX_ARRAY_LENGTH ) { throw new RangeError( 'invalid argument. The maximum length for a generic array is '+MAX_ARRAY_LENGTH+'. To create a longer array-like data structure, consider either typed arrays or an array-like object.' ); } // Manually allocate to ensure "fast" elements... - arr = []; - for ( i = 0; i < len; i++ ) { + const arr = []; + for ( let i = 0; i < len; i++ ) { arr.push( 0 ); } return arr; } -var arr = alloc( 10 ); +let arr = alloc( 10 ); console.log( arr ); try { diff --git a/lib/node_modules/@stdlib/constants/array/max-typed-array-length/README.md b/lib/node_modules/@stdlib/constants/array/max-typed-array-length/README.md index 5819f730a97a..c758d22f403d 100644 --- a/lib/node_modules/@stdlib/constants/array/max-typed-array-length/README.md +++ b/lib/node_modules/@stdlib/constants/array/max-typed-array-length/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' ); +const MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' ); ``` #### MAX_TYPED_ARRAY_LENGTH @@ -45,7 +45,7 @@ var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-l Maximum length for a typed array. ```javascript -var len = MAX_TYPED_ARRAY_LENGTH; +const len = MAX_TYPED_ARRAY_LENGTH; // returns 9007199254740991 ``` @@ -72,25 +72,22 @@ var len = MAX_TYPED_ARRAY_LENGTH; ```javascript -var ctors = require( '@stdlib/array/ctors' ); -var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' ); +const ctors = require( '@stdlib/array/ctors' ); +const MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' ); function fill( dtype, len, value ) { - var ctor; - var arr; - var i; if ( len > MAX_TYPED_ARRAY_LENGTH ) { throw new RangeError( 'invalid argument. The maximum length for a typed array is '+MAX_TYPED_ARRAY_LENGTH+'.' ); } - ctor = ctors( dtype ); - arr = new ctor( len ); - for ( i = 0; i < len; i++ ) { + const ctor = ctors( dtype ); + const arr = new ctor( len ); + for ( let i = 0; i < len; i++ ) { arr[ i ] = value; } return arr; } -var arr = fill( 'float64', 10, 3.14 ); +let arr = fill( 'float64', 10, 3.14 ); console.log( arr ); try { diff --git a/lib/node_modules/@stdlib/constants/complex128/README.md b/lib/node_modules/@stdlib/constants/complex128/README.md index 0dfaf95bb975..77a31229c9b9 100644 --- a/lib/node_modules/@stdlib/constants/complex128/README.md +++ b/lib/node_modules/@stdlib/constants/complex128/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/complex128' ); +const constants = require( '@stdlib/constants/complex128' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/complex128' ); 128-bit complex number mathematical constants ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -64,8 +64,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/complex128' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/complex128' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/complex128/nan/README.md b/lib/node_modules/@stdlib/constants/complex128/nan/README.md index 2dce6056eec5..ae688c6b054d 100644 --- a/lib/node_modules/@stdlib/constants/complex128/nan/README.md +++ b/lib/node_modules/@stdlib/constants/complex128/nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX128_NAN = require( '@stdlib/constants/complex128/nan' ); +const COMPLEX128_NAN = require( '@stdlib/constants/complex128/nan' ); ``` #### COMPLEX128_NAN @@ -35,13 +35,13 @@ var COMPLEX128_NAN = require( '@stdlib/constants/complex128/nan' ); Canonical double-precision complex floating-point `NaN`. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var re = real( COMPLEX128_NAN ); +const re = real( COMPLEX128_NAN ); // returns NaN -var im = imag( COMPLEX128_NAN ); +const im = imag( COMPLEX128_NAN ); // returns NaN ``` @@ -56,21 +56,21 @@ var im = imag( COMPLEX128_NAN ); ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var COMPLEX128_NAN = require( '@stdlib/constants/complex128/nan' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const COMPLEX128_NAN = require( '@stdlib/constants/complex128/nan' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // returns -var v = x.get( 0 ); +let v = x.get( 0 ); // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns 2.0 x.fill( COMPLEX128_NAN ); diff --git a/lib/node_modules/@stdlib/constants/complex128/num-bytes/README.md b/lib/node_modules/@stdlib/constants/complex128/num-bytes/README.md index 33f6ec139a5f..25a908268b84 100644 --- a/lib/node_modules/@stdlib/constants/complex128/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/complex128/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX128_NUM_BYTES = require( '@stdlib/constants/complex128/num-bytes' ); +const COMPLEX128_NUM_BYTES = require( '@stdlib/constants/complex128/num-bytes' ); ``` #### COMPLEX128_NUM_BYTES @@ -35,7 +35,7 @@ var COMPLEX128_NUM_BYTES = require( '@stdlib/constants/complex128/num-bytes' ); Size (in bytes) of a 128-bit complex number. ```javascript -var bool = ( COMPLEX128_NUM_BYTES === 16 ); +const bool = ( COMPLEX128_NUM_BYTES === 16 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( COMPLEX128_NUM_BYTES === 16 ); ```javascript -var COMPLEX128_NUM_BYTES = require( '@stdlib/constants/complex128/num-bytes' ); +const COMPLEX128_NUM_BYTES = require( '@stdlib/constants/complex128/num-bytes' ); console.log( COMPLEX128_NUM_BYTES ); // => 16 diff --git a/lib/node_modules/@stdlib/constants/complex128/zero/README.md b/lib/node_modules/@stdlib/constants/complex128/zero/README.md index 3f0f07d985f1..b33df8d2b259 100644 --- a/lib/node_modules/@stdlib/constants/complex128/zero/README.md +++ b/lib/node_modules/@stdlib/constants/complex128/zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX128_ZERO = require( '@stdlib/constants/complex128/zero' ); +const COMPLEX128_ZERO = require( '@stdlib/constants/complex128/zero' ); ``` #### COMPLEX128_ZERO @@ -35,13 +35,13 @@ var COMPLEX128_ZERO = require( '@stdlib/constants/complex128/zero' ); Double-precision complex floating-point zero. ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var re = real( COMPLEX128_ZERO ); +const re = real( COMPLEX128_ZERO ); // returns 0.0 -var im = imag( COMPLEX128_ZERO ); +const im = imag( COMPLEX128_ZERO ); // returns 0.0 ``` @@ -56,21 +56,21 @@ var im = imag( COMPLEX128_ZERO ); ```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var Complex128Array = require( '@stdlib/array/complex128' ); -var COMPLEX128_ZERO = require( '@stdlib/constants/complex128/zero' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const COMPLEX128_ZERO = require( '@stdlib/constants/complex128/zero' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // returns -var v = x.get( 0 ); +let v = x.get( 0 ); // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns 2.0 x.fill( COMPLEX128_ZERO ); diff --git a/lib/node_modules/@stdlib/constants/complex64/README.md b/lib/node_modules/@stdlib/constants/complex64/README.md index 700ddb78746f..5d98a1ec1b1e 100644 --- a/lib/node_modules/@stdlib/constants/complex64/README.md +++ b/lib/node_modules/@stdlib/constants/complex64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/complex64' ); +const constants = require( '@stdlib/constants/complex64' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/complex64' ); Half-precision floating-point mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -64,8 +64,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/complex64' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/complex64' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/complex64/nan/README.md b/lib/node_modules/@stdlib/constants/complex64/nan/README.md index 7cb38e21fdff..00f93a19d43f 100644 --- a/lib/node_modules/@stdlib/constants/complex64/nan/README.md +++ b/lib/node_modules/@stdlib/constants/complex64/nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX64_NAN = require( '@stdlib/constants/complex64/nan' ); +const COMPLEX64_NAN = require( '@stdlib/constants/complex64/nan' ); ``` #### COMPLEX64_NAN @@ -35,13 +35,13 @@ var COMPLEX64_NAN = require( '@stdlib/constants/complex64/nan' ); Canonical single-precision complex floating-point `NaN`. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var re = realf( COMPLEX64_NAN ); +const re = realf( COMPLEX64_NAN ); // returns NaN -var im = imagf( COMPLEX64_NAN ); +const im = imagf( COMPLEX64_NAN ); // returns NaN ``` @@ -56,21 +56,21 @@ var im = imagf( COMPLEX64_NAN ); ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var COMPLEX64_NAN = require( '@stdlib/constants/complex64/nan' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const COMPLEX64_NAN = require( '@stdlib/constants/complex64/nan' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // returns -var v = x.get( 0 ); +let v = x.get( 0 ); // returns -var re = realf( v ); +let re = realf( v ); // returns 1.0 -var im = imagf( v ); +let im = imagf( v ); // returns 2.0 x.fill( COMPLEX64_NAN ); diff --git a/lib/node_modules/@stdlib/constants/complex64/num-bytes/README.md b/lib/node_modules/@stdlib/constants/complex64/num-bytes/README.md index 22c8fc4a3b3f..5c5fb796a7a9 100644 --- a/lib/node_modules/@stdlib/constants/complex64/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/complex64/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX64_NUM_BYTES = require( '@stdlib/constants/complex64/num-bytes' ); +const COMPLEX64_NUM_BYTES = require( '@stdlib/constants/complex64/num-bytes' ); ``` #### COMPLEX64_NUM_BYTES @@ -35,7 +35,7 @@ var COMPLEX64_NUM_BYTES = require( '@stdlib/constants/complex64/num-bytes' ); Size (in bytes) of a 64-bit complex number. ```javascript -var bool = ( COMPLEX64_NUM_BYTES === 8 ); +const bool = ( COMPLEX64_NUM_BYTES === 8 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( COMPLEX64_NUM_BYTES === 8 ); ```javascript -var COMPLEX64_NUM_BYTES = require( '@stdlib/constants/complex64/num-bytes' ); +const COMPLEX64_NUM_BYTES = require( '@stdlib/constants/complex64/num-bytes' ); console.log( COMPLEX64_NUM_BYTES ); // => 8 diff --git a/lib/node_modules/@stdlib/constants/complex64/zero/README.md b/lib/node_modules/@stdlib/constants/complex64/zero/README.md index 8618b5fa2bdc..b17b1fbad421 100644 --- a/lib/node_modules/@stdlib/constants/complex64/zero/README.md +++ b/lib/node_modules/@stdlib/constants/complex64/zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var COMPLEX64_ZERO = require( '@stdlib/constants/complex64/zero' ); +const COMPLEX64_ZERO = require( '@stdlib/constants/complex64/zero' ); ``` #### COMPLEX64_ZERO @@ -35,13 +35,13 @@ var COMPLEX64_ZERO = require( '@stdlib/constants/complex64/zero' ); Single-precision complex floating-point zero. ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var re = realf( COMPLEX64_ZERO ); +const re = realf( COMPLEX64_ZERO ); // returns 0.0 -var im = imagf( COMPLEX64_ZERO ); +const im = imagf( COMPLEX64_ZERO ); // returns 0.0 ``` @@ -56,21 +56,21 @@ var im = imagf( COMPLEX64_ZERO ); ```javascript -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var Complex64Array = require( '@stdlib/array/complex64' ); -var COMPLEX64_ZERO = require( '@stdlib/constants/complex64/zero' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const COMPLEX64_ZERO = require( '@stdlib/constants/complex64/zero' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); // returns -var v = x.get( 0 ); +let v = x.get( 0 ); // returns -var re = realf( v ); +let re = realf( v ); // returns 1.0 -var im = imagf( v ); +let im = imagf( v ); // returns 2.0 x.fill( COMPLEX64_ZERO ); diff --git a/lib/node_modules/@stdlib/constants/float16/README.md b/lib/node_modules/@stdlib/constants/float16/README.md index a356a0dc4330..c2da80c1c846 100644 --- a/lib/node_modules/@stdlib/constants/float16/README.md +++ b/lib/node_modules/@stdlib/constants/float16/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/float16' ); +const constants = require( '@stdlib/constants/float16' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/float16' ); Half-precision floating-point mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -74,8 +74,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/float16' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/float16' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/float16/cbrt-eps/README.md b/lib/node_modules/@stdlib/constants/float16/cbrt-eps/README.md index 7261dc7604a7..869bf06c3306 100644 --- a/lib/node_modules/@stdlib/constants/float16/cbrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float16/cbrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_CBRT_EPSILON = require( '@stdlib/constants/float16/cbrt-eps' ); +const FLOAT16_CBRT_EPSILON = require( '@stdlib/constants/float16/cbrt-eps' ); ``` #### FLOAT16_CBRT_EPSILON @@ -35,7 +35,7 @@ var FLOAT16_CBRT_EPSILON = require( '@stdlib/constants/float16/cbrt-eps' ); [Cube root][@stdlib/math/base/special/cbrt] of [half-precision floating-point epsilon][@stdlib/constants/float16/eps]. ```javascript -var bool = ( FLOAT16_CBRT_EPSILON === 0.09921256574801247 ); +const bool = ( FLOAT16_CBRT_EPSILON === 0.09921256574801247 ); // returns true ``` @@ -50,30 +50,22 @@ var bool = ( FLOAT16_CBRT_EPSILON === 0.09921256574801247 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var maxabs = require( '@stdlib/math/base/special/maxabs' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT16_CBRT_EPSILON = require( '@stdlib/constants/float16/cbrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const maxabs = require( '@stdlib/math/base/special/maxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT16_CBRT_EPSILON = require( '@stdlib/constants/float16/cbrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = FLOAT16_CBRT_EPSILON * maxabs( a, b ); + const delta = abs( a - b ); + const tol = FLOAT16_CBRT_EPSILON * maxabs( a, b ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + randu() - 0.5; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + randu() - 0.5; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float16/eps/README.md b/lib/node_modules/@stdlib/constants/float16/eps/README.md index 727448078e96..ca28ea48c30e 100644 --- a/lib/node_modules/@stdlib/constants/float16/eps/README.md +++ b/lib/node_modules/@stdlib/constants/float16/eps/README.md @@ -50,7 +50,7 @@ where `b` is the radix (base) and `p` is the precision (number of radix bits in ## Usage ```javascript -var FLOAT16_EPSILON = require( '@stdlib/constants/float16/eps' ); +const FLOAT16_EPSILON = require( '@stdlib/constants/float16/eps' ); ``` #### FLOAT16_EPSILON @@ -58,7 +58,7 @@ var FLOAT16_EPSILON = require( '@stdlib/constants/float16/eps' ); Difference between one and the smallest value greater than one that can be represented as a [half-precision floating-point number][half-precision-floating-point-format]. ```javascript -var bool = ( FLOAT16_EPSILON === 0.0009765625 ); +const bool = ( FLOAT16_EPSILON === 0.0009765625 ); // returns true ``` @@ -73,30 +73,22 @@ var bool = ( FLOAT16_EPSILON === 0.0009765625 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var maxabs = require( '@stdlib/math/base/special/maxabs' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT16_EPSILON = require( '@stdlib/constants/float16/eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const maxabs = require( '@stdlib/math/base/special/maxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT16_EPSILON = require( '@stdlib/constants/float16/eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = FLOAT16_EPSILON * maxabs( a, b ); + const delta = abs( a - b ); + const tol = FLOAT16_EPSILON * maxabs( a, b ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + (randu()*2.0e-3) - 1.0e-3; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + (randu()*2.0e-3) - 1.0e-3; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float16/exponent-bias/README.md b/lib/node_modules/@stdlib/constants/float16/exponent-bias/README.md index 4daf98f6375f..b196b9acd00b 100644 --- a/lib/node_modules/@stdlib/constants/float16/exponent-bias/README.md +++ b/lib/node_modules/@stdlib/constants/float16/exponent-bias/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_EXPONENT_BIAS = require( '@stdlib/constants/float16/exponent-bias' ); +const FLOAT16_EXPONENT_BIAS = require( '@stdlib/constants/float16/exponent-bias' ); ``` #### FLOAT16_EXPONENT_BIAS @@ -35,7 +35,7 @@ var FLOAT16_EXPONENT_BIAS = require( '@stdlib/constants/float16/exponent-bias' ) The bias of a [half-precision floating-point number's][half-precision-floating-point-format] exponent. ```javascript -var bool = ( FLOAT16_EXPONENT_BIAS === 15 ); +const bool = ( FLOAT16_EXPONENT_BIAS === 15 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT16_EXPONENT_BIAS === 15 ); ```javascript -var FLOAT16_EXPONENT_BIAS = require( '@stdlib/constants/float16/exponent-bias' ); +const FLOAT16_EXPONENT_BIAS = require( '@stdlib/constants/float16/exponent-bias' ); console.log( FLOAT16_EXPONENT_BIAS ); // => 15 diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float16/max-safe-integer/README.md index 554eeaefcf1e..6db9ce5a1087 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_MAX_SAFE_INTEGER = require( '@stdlib/constants/float16/max-safe-integer' ); +const FLOAT16_MAX_SAFE_INTEGER = require( '@stdlib/constants/float16/max-safe-integer' ); ``` #### FLOAT16_MAX_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT16_MAX_SAFE_INTEGER = require( '@stdlib/constants/float16/max-safe-inte The maximum [safe][safe-integers] [half-precision floating-point][half-precision-floating-point-format] integer. ```javascript -var bool = ( FLOAT16_MAX_SAFE_INTEGER === 2047 ); +const bool = ( FLOAT16_MAX_SAFE_INTEGER === 2047 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT16_MAX_SAFE_INTEGER === 2047 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT16_MAX_SAFE_INTEGER = require( '@stdlib/constants/float16/max-safe-integer' ); - -var max; -var x; -var i; - -max = pow( 2.0, 13 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * max ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT16_MAX_SAFE_INTEGER = require( '@stdlib/constants/float16/max-safe-integer' ); + +const max = pow( 2.0, 13 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * max ); if ( x > FLOAT16_MAX_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float16/max/README.md b/lib/node_modules/@stdlib/constants/float16/max/README.md index 6cc5aecdbd52..938bce588701 100644 --- a/lib/node_modules/@stdlib/constants/float16/max/README.md +++ b/lib/node_modules/@stdlib/constants/float16/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_MAX = require( '@stdlib/constants/float16/max' ); +const FLOAT16_MAX = require( '@stdlib/constants/float16/max' ); ``` #### FLOAT16_MAX @@ -35,7 +35,7 @@ var FLOAT16_MAX = require( '@stdlib/constants/float16/max' ); Maximum [single-precision floating-point number][half-precision-floating-point-format]. ```javascript -var bool = (FLOAT16_MAX === 65504.0 ); +const bool = (FLOAT16_MAX === 65504.0 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = (FLOAT16_MAX === 65504.0 ); ```javascript -var FLOAT16_MAX = require( '@stdlib/constants/float16/max' ); +const FLOAT16_MAX = require( '@stdlib/constants/float16/max' ); console.log( FLOAT16_MAX ); // => 65504.0 diff --git a/lib/node_modules/@stdlib/constants/float16/min-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float16/min-safe-integer/README.md index 749c852f2ef2..9761fe6899cf 100644 --- a/lib/node_modules/@stdlib/constants/float16/min-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float16/min-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_MIN_SAFE_INTEGER = require( '@stdlib/constants/float16/min-safe-integer' ); +const FLOAT16_MIN_SAFE_INTEGER = require( '@stdlib/constants/float16/min-safe-integer' ); ``` #### FLOAT16_MIN_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT16_MIN_SAFE_INTEGER = require( '@stdlib/constants/float16/min-safe-inte The minimum [safe][safe-integers] [half-precision floating-point][half-precision-floating-point-format] integer. ```javascript -var bool = ( FLOAT16_MIN_SAFE_INTEGER === -2047 ); +const bool = ( FLOAT16_MIN_SAFE_INTEGER === -2047 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT16_MIN_SAFE_INTEGER === -2047 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT16_MIN_SAFE_INTEGER = require( '@stdlib/constants/float16/min-safe-integer' ); - -var min; -var x; -var i; - -min = -pow( 2.0, 13 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * min ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT16_MIN_SAFE_INTEGER = require( '@stdlib/constants/float16/min-safe-integer' ); + +const min = -pow( 2.0, 13 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * min ); if ( x < FLOAT16_MIN_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float16/ninf/README.md b/lib/node_modules/@stdlib/constants/float16/ninf/README.md index 5809ae253f76..6438414f320e 100644 --- a/lib/node_modules/@stdlib/constants/float16/ninf/README.md +++ b/lib/node_modules/@stdlib/constants/float16/ninf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' ); +const FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' ); ``` #### FLOAT16_NINF @@ -36,7 +36,7 @@ var FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' ); ```javascript // FLOAT16_NINF is implicitly promoted to a double-precision floating-point number... -var bool = ( FLOAT16_NINF === -Infinity ); +const bool = ( FLOAT16_NINF === -Infinity ); // returns true ``` @@ -53,7 +53,7 @@ var bool = ( FLOAT16_NINF === -Infinity ); ```javascript -var FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' ); +const FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' ); console.log( FLOAT16_NINF ); // => -Infinity diff --git a/lib/node_modules/@stdlib/constants/float16/num-bytes/README.md b/lib/node_modules/@stdlib/constants/float16/num-bytes/README.md index 4010b55a48d0..94d64f7fdd42 100644 --- a/lib/node_modules/@stdlib/constants/float16/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/float16/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_NUM_BYTES = require( '@stdlib/constants/float16/num-bytes' ); +const FLOAT16_NUM_BYTES = require( '@stdlib/constants/float16/num-bytes' ); ``` #### FLOAT16_NUM_BYTES @@ -35,7 +35,7 @@ var FLOAT16_NUM_BYTES = require( '@stdlib/constants/float16/num-bytes' ); Size (in bytes) of a [half-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT16_NUM_BYTES === 2 ); +const bool = ( FLOAT16_NUM_BYTES === 2 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT16_NUM_BYTES === 2 ); ```javascript -var FLOAT16_NUM_BYTES = require( '@stdlib/constants/float16/num-bytes' ); +const FLOAT16_NUM_BYTES = require( '@stdlib/constants/float16/num-bytes' ); console.log( FLOAT16_NUM_BYTES ); // => 2 diff --git a/lib/node_modules/@stdlib/constants/float16/pinf/README.md b/lib/node_modules/@stdlib/constants/float16/pinf/README.md index 626411a346aa..158dfd6f350c 100644 --- a/lib/node_modules/@stdlib/constants/float16/pinf/README.md +++ b/lib/node_modules/@stdlib/constants/float16/pinf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_PINF = require( '@stdlib/constants/float16/pinf' ); +const FLOAT16_PINF = require( '@stdlib/constants/float16/pinf' ); ``` #### FLOAT16_PINF @@ -36,7 +36,7 @@ var FLOAT16_PINF = require( '@stdlib/constants/float16/pinf' ); ```javascript // FLOAT16_PINF is implicitly promoted to a double-precision floating-point number... -var bool = ( FLOAT16_PINF === Infinity ); +const bool = ( FLOAT16_PINF === Infinity ); // returns true ``` @@ -53,7 +53,7 @@ var bool = ( FLOAT16_PINF === Infinity ); ```javascript -var FLOAT16_PINF = require( '@stdlib/constants/float16/pinf' ); +const FLOAT16_PINF = require( '@stdlib/constants/float16/pinf' ); console.log( FLOAT16_PINF ); // => +Infinity diff --git a/lib/node_modules/@stdlib/constants/float16/precision/README.md b/lib/node_modules/@stdlib/constants/float16/precision/README.md index ad79ad0c3cb9..f559389cd299 100644 --- a/lib/node_modules/@stdlib/constants/float16/precision/README.md +++ b/lib/node_modules/@stdlib/constants/float16/precision/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_PRECISION = require( '@stdlib/constants/float16/precision' ); +const FLOAT16_PRECISION = require( '@stdlib/constants/float16/precision' ); ``` #### FLOAT16_PRECISION @@ -35,7 +35,7 @@ var FLOAT16_PRECISION = require( '@stdlib/constants/float16/precision' ); Effective number of bits in the [significand][significand] of a [half-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT16_PRECISION === 11 ); // including implicit bit +const bool = ( FLOAT16_PRECISION === 11 ); // including implicit bit // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT16_PRECISION === 11 ); // including implicit bit ```javascript -var FLOAT16_PRECISION = require( '@stdlib/constants/float16/precision' ); +const FLOAT16_PRECISION = require( '@stdlib/constants/float16/precision' ); console.log( FLOAT16_PRECISION ); // => 11 diff --git a/lib/node_modules/@stdlib/constants/float16/smallest-normal/README.md b/lib/node_modules/@stdlib/constants/float16/smallest-normal/README.md index 3b911a2639d7..5c19a737d547 100644 --- a/lib/node_modules/@stdlib/constants/float16/smallest-normal/README.md +++ b/lib/node_modules/@stdlib/constants/float16/smallest-normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_SMALLEST_NORMAL = require( '@stdlib/constants/float16/smallest-normal' ); +const FLOAT16_SMALLEST_NORMAL = require( '@stdlib/constants/float16/smallest-normal' ); ``` #### FLOAT16_SMALLEST_NORMAL @@ -35,7 +35,7 @@ var FLOAT16_SMALLEST_NORMAL = require( '@stdlib/constants/float16/smallest-norma Smallest positive **normalized** [half-precision floating-point number][half-precision-floating-point-format]. ```javascript -var bool = ( FLOAT16_SMALLEST_NORMAL === 6.103515625e-5 ); +const bool = ( FLOAT16_SMALLEST_NORMAL === 6.103515625e-5 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT16_SMALLEST_NORMAL === 6.103515625e-5 ); ```javascript -var FLOAT16_SMALLEST_NORMAL = require( '@stdlib/constants/float16/smallest-normal' ); +const FLOAT16_SMALLEST_NORMAL = require( '@stdlib/constants/float16/smallest-normal' ); console.log( FLOAT16_SMALLEST_NORMAL ); // => 6.103515625e-5 diff --git a/lib/node_modules/@stdlib/constants/float16/smallest-subnormal/README.md b/lib/node_modules/@stdlib/constants/float16/smallest-subnormal/README.md index 25491b8ec294..7af38803d1ee 100644 --- a/lib/node_modules/@stdlib/constants/float16/smallest-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float16/smallest-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT16_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float16/smallest-subnormal' ); +const FLOAT16_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float16/smallest-subnormal' ); ``` #### FLOAT16_SMALLEST_SUBNORMAL @@ -39,7 +39,7 @@ Smallest positive **denormalized** [half-precision floating-point number][half-p ```javascript -var bool = ( FLOAT16_SMALLEST_SUBNORMAL === 5.960464477539063e-8 ); +const bool = ( FLOAT16_SMALLEST_SUBNORMAL === 5.960464477539063e-8 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT16_SMALLEST_SUBNORMAL === 5.960464477539063e-8 ); ```javascript -var FLOAT16_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float16/smallest-subnormal' ); +const FLOAT16_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float16/smallest-subnormal' ); console.log( FLOAT16_SMALLEST_SUBNORMAL ); // => 5.960464477539063e-8 diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-eps/README.md b/lib/node_modules/@stdlib/constants/float16/sqrt-eps/README.md index 6bee5a14a5d6..5b16144b25ad 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT16_SQRT_EPSILON = require( '@stdlib/constants/float16/sqrt-eps' ); +const FLOAT16_SQRT_EPSILON = require( '@stdlib/constants/float16/sqrt-eps' ); ``` #### FLOAT16_SQRT_EPSILON @@ -35,7 +35,7 @@ var FLOAT16_SQRT_EPSILON = require( '@stdlib/constants/float16/sqrt-eps' ); [Square root][@stdlib/math/base/special/sqrt] of [half-precision floating-point epsilon][@stdlib/constants/float16/eps]. ```javascript -var bool = ( FLOAT16_SQRT_EPSILON === 0.03125 ); +const bool = ( FLOAT16_SQRT_EPSILON === 0.03125 ); // returns true ``` @@ -50,30 +50,22 @@ var bool = ( FLOAT16_SQRT_EPSILON === 0.03125 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var maxabs = require( '@stdlib/math/base/special/maxabs' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT16_SQRT_EPSILON = require( '@stdlib/constants/float16/sqrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const maxabs = require( '@stdlib/math/base/special/maxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT16_SQRT_EPSILON = require( '@stdlib/constants/float16/sqrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = FLOAT16_SQRT_EPSILON * maxabs( a, b ); + const delta = abs( a - b ); + const tol = FLOAT16_SQRT_EPSILON * maxabs( a, b ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + (randu()*0.2) - 0.1; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + (randu()*0.2) - 0.1; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float32/README.md b/lib/node_modules/@stdlib/constants/float32/README.md index 81956070b006..db3b3d524041 100644 --- a/lib/node_modules/@stdlib/constants/float32/README.md +++ b/lib/node_modules/@stdlib/constants/float32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/float32' ); +const constants = require( '@stdlib/constants/float32' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/float32' ); Single-precision floating-point mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -79,8 +79,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/float32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/float32' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/float32/abs-mask/README.md b/lib/node_modules/@stdlib/constants/float32/abs-mask/README.md index 312a41f89948..68cd42061335 100644 --- a/lib/node_modules/@stdlib/constants/float32/abs-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float32/abs-mask/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' ); +const FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' ); ``` #### FLOAT32_ABS_MASK @@ -36,7 +36,7 @@ Mask for excluding the sign bit of a [single-precision floating-point number][ie ```javascript // 0x7fffffff = 2147483647 => 0 11111111 11111111111111111111111 -var bool = ( FLOAT32_ABS_MASK === 0x7fffffff ); +const bool = ( FLOAT32_ABS_MASK === 0x7fffffff ); // returns true ``` @@ -57,16 +57,16 @@ var bool = ( FLOAT32_ABS_MASK === 0x7fffffff ); ```javascript -var toWord = require( '@stdlib/number/float32/base/to-word' ); -var fromWord = require( '@stdlib/number/float32/base/from-word' ); -var FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' ); +const toWord = require( '@stdlib/number/float32/base/to-word' ); +const fromWord = require( '@stdlib/number/float32/base/from-word' ); +const FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' ); -var x = -11.5; -var w = toWord( x ); // 1 10000010 01110000000000000000000 +const x = -11.5; +const w = toWord( x ); // 1 10000010 01110000000000000000000 // returns 3223781376 // Turn off the sign bit and leave other bits unchanged: -var out = w & FLOAT32_ABS_MASK; // 0 10000010 01110000000000000000000 +let out = w & FLOAT32_ABS_MASK; // 0 10000010 01110000000000000000000 // returns 1076297728 // Generate a new value: diff --git a/lib/node_modules/@stdlib/constants/float32/cbrt-eps/README.md b/lib/node_modules/@stdlib/constants/float32/cbrt-eps/README.md index 3e5bae5b0cb8..3b9b5784269f 100644 --- a/lib/node_modules/@stdlib/constants/float32/cbrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float32/cbrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_CBRT_EPS = require( '@stdlib/constants/float32/cbrt-eps' ); +const FLOAT32_CBRT_EPS = require( '@stdlib/constants/float32/cbrt-eps' ); ``` #### FLOAT32_CBRT_EPS @@ -35,7 +35,7 @@ var FLOAT32_CBRT_EPS = require( '@stdlib/constants/float32/cbrt-eps' ); [Cube root][@stdlib/math/base/special/cbrt] of [single-precision floating-point epsilon][@stdlib/constants/float32/eps]. ```javascript -var bool = ( FLOAT32_CBRT_EPS === 0.004921566694974899 ); +const bool = ( FLOAT32_CBRT_EPS === 0.004921566694974899 ); // returns true ``` @@ -50,31 +50,23 @@ var bool = ( FLOAT32_CBRT_EPS === 0.004921566694974899 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT32_CBRT_EPS = require( '@stdlib/constants/float32/cbrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT32_CBRT_EPS = require( '@stdlib/constants/float32/cbrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = float64ToFloat32( abs( a - b ) ); - tol = float64ToFloat32( FLOAT32_CBRT_EPS * max( abs( a ), abs( b ) ) ); + const delta = float64ToFloat32( abs( a - b ) ); + const tol = float64ToFloat32( FLOAT32_CBRT_EPS * max( abs( a ), abs( b ) ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = float64ToFloat32( randu()*10.0 ); - b = float64ToFloat32( a + (randu()*0.02) - 0.01 ); - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = float64ToFloat32( randu()*10.0 ); + const b = float64ToFloat32( a + (randu()*0.02) - 0.01 ); + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float32/eps/README.md b/lib/node_modules/@stdlib/constants/float32/eps/README.md index 103959100dd5..d3a2be328259 100644 --- a/lib/node_modules/@stdlib/constants/float32/eps/README.md +++ b/lib/node_modules/@stdlib/constants/float32/eps/README.md @@ -50,7 +50,7 @@ where `b` is the radix (base) and `p` is the precision (number of radix bits in ## Usage ```javascript -var FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); +const FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); ``` #### FLOAT32_EPS @@ -58,7 +58,7 @@ var FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); Difference between one and the smallest value greater than one that can be represented as a [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_EPS === 1.1920928955078125e-7 ); +const bool = ( FLOAT32_EPS === 1.1920928955078125e-7 ); // returns true ``` @@ -73,31 +73,23 @@ var bool = ( FLOAT32_EPS === 1.1920928955078125e-7 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = float64ToFloat32( abs( a - b ) ); - tol = float64ToFloat32( FLOAT32_EPS * max( abs( a ), abs( b ) ) ); + const delta = float64ToFloat32( abs( a - b ) ); + const tol = float64ToFloat32( FLOAT32_EPS * max( abs( a ), abs( b ) ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = float64ToFloat32( randu()*10.0 ); - b = float64ToFloat32( a + (randu()*2.0e-6) - 1.0e-6 ); - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = float64ToFloat32( randu()*10.0 ); + const b = float64ToFloat32( a + (randu()*2.0e-6) - 1.0e-6 ); + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float32/exponent-bias/README.md b/lib/node_modules/@stdlib/constants/float32/exponent-bias/README.md index 2f8d14d76810..78ab9c4a411c 100644 --- a/lib/node_modules/@stdlib/constants/float32/exponent-bias/README.md +++ b/lib/node_modules/@stdlib/constants/float32/exponent-bias/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' ); +const FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' ); ``` #### FLOAT32_EXPONENT_BIAS @@ -35,7 +35,7 @@ var FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' ) The bias of a [single-precision floating-point number's][ieee754] exponent. ```javascript -var bool = ( FLOAT32_EXPONENT_BIAS === 127 ); +const bool = ( FLOAT32_EXPONENT_BIAS === 127 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_EXPONENT_BIAS === 127 ); ```javascript -var FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' ); +const FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' ); console.log( FLOAT32_EXPONENT_BIAS ); // => 127 diff --git a/lib/node_modules/@stdlib/constants/float32/exponent-mask/README.md b/lib/node_modules/@stdlib/constants/float32/exponent-mask/README.md index 81c10793d207..f77856ca828c 100644 --- a/lib/node_modules/@stdlib/constants/float32/exponent-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float32/exponent-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_EXPONENT_MASK = require( '@stdlib/constants/float32/exponent-mask' ); +const FLOAT32_EXPONENT_MASK = require( '@stdlib/constants/float32/exponent-mask' ); ``` #### FLOAT32_EXPONENT_MASK @@ -40,7 +40,7 @@ Mask for the exponent of a [single-precision floating-point number][ieee754]. ```javascript // 0x7f800000 = 2139095040 => 0 11111111 00000000000000000000000 -var bool = ( FLOAT32_EXPONENT_MASK === 0x7f800000 ); +const bool = ( FLOAT32_EXPONENT_MASK === 0x7f800000 ); // returns true ``` @@ -61,15 +61,15 @@ var bool = ( FLOAT32_EXPONENT_MASK === 0x7f800000 ); ```javascript -var toWord = require( '@stdlib/number/float32/base/to-word' ); -var FLOAT32_EXPONENT_MASK = require( '@stdlib/constants/float32/exponent-mask' ); +const toWord = require( '@stdlib/number/float32/base/to-word' ); +const FLOAT32_EXPONENT_MASK = require( '@stdlib/constants/float32/exponent-mask' ); -var x = 11.5; -var w = toWord( x ); // 0 10000010 01110000000000000000000 +const x = 11.5; +const w = toWord( x ); // 0 10000010 01110000000000000000000 // returns 1094189056 // Mask off all bits except for the exponent bits: -var out = w & FLOAT32_EXPONENT_MASK; // 0 10000010 00000000000000000000000 +let out = w & FLOAT32_EXPONENT_MASK; // 0 10000010 00000000000000000000000 // returns 1090519040 // Mask on the exponent bits and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-pi/README.md b/lib/node_modules/@stdlib/constants/float32/fourth-pi/README.md index 459d53507d63..f512d455badc 100644 --- a/lib/node_modules/@stdlib/constants/float32/fourth-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float32/fourth-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_FOURTH_PI = require( '@stdlib/constants/float32/fourth-pi' ); +const FLOAT32_FOURTH_PI = require( '@stdlib/constants/float32/fourth-pi' ); ``` #### FLOAT32_FOURTH_PI @@ -35,7 +35,7 @@ var FLOAT32_FOURTH_PI = require( '@stdlib/constants/float32/fourth-pi' ); One fourth times the mathematical constant [π][pi]. ```javascript -var bool = ( FLOAT32_FOURTH_PI === 7.853981852531433e-1 ); +const bool = ( FLOAT32_FOURTH_PI === 7.853981852531433e-1 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_FOURTH_PI === 7.853981852531433e-1 ); ```javascript -var FLOAT32_FOURTH_PI = require( '@stdlib/constants/float32/fourth-pi' ); +const FLOAT32_FOURTH_PI = require( '@stdlib/constants/float32/fourth-pi' ); console.log( FLOAT32_FOURTH_PI ); // => 7.853981852531433e-1 diff --git a/lib/node_modules/@stdlib/constants/float32/half-ln-two/README.md b/lib/node_modules/@stdlib/constants/float32/half-ln-two/README.md index da0b2675a26f..21e1657e985c 100644 --- a/lib/node_modules/@stdlib/constants/float32/half-ln-two/README.md +++ b/lib/node_modules/@stdlib/constants/float32/half-ln-two/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_HALF_LN2 = require( '@stdlib/constants/float32/half-ln-two' ); +const FLOAT32_HALF_LN2 = require( '@stdlib/constants/float32/half-ln-two' ); ``` #### FLOAT32_HALF_LN2 @@ -35,7 +35,7 @@ var FLOAT32_HALF_LN2 = require( '@stdlib/constants/float32/half-ln-two' ); One half times the [natural logarithm][@stdlib/math/base/special/ln] of `2` as a single-precision floating-point number. ```javascript -var bool = ( FLOAT32_HALF_LN2 === 0.3465735912322998 ); +const bool = ( FLOAT32_HALF_LN2 === 0.3465735912322998 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_HALF_LN2 === 0.3465735912322998 ); ```javascript -var FLOAT32_HALF_LN2 = require( '@stdlib/constants/float32/half-ln-two' ); +const FLOAT32_HALF_LN2 = require( '@stdlib/constants/float32/half-ln-two' ); console.log( FLOAT32_HALF_LN2 ); // => 0.3465735912322998 diff --git a/lib/node_modules/@stdlib/constants/float32/half-pi/README.md b/lib/node_modules/@stdlib/constants/float32/half-pi/README.md index 6c0af23e7fa1..2227da9cbe69 100644 --- a/lib/node_modules/@stdlib/constants/float32/half-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float32/half-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_HALF_PI = require( '@stdlib/constants/float32/half-pi' ); +const FLOAT32_HALF_PI = require( '@stdlib/constants/float32/half-pi' ); ``` #### FLOAT32_HALF_PI @@ -35,7 +35,7 @@ var FLOAT32_HALF_PI = require( '@stdlib/constants/float32/half-pi' ); One half times the mathematical constant [π][pi]. ```javascript -var bool = ( FLOAT32_HALF_PI === 1.5707963705062866 ); +const bool = ( FLOAT32_HALF_PI === 1.5707963705062866 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_HALF_PI === 1.5707963705062866 ); ```javascript -var FLOAT32_HALF_PI = require( '@stdlib/constants/float32/half-pi' ); +const FLOAT32_HALF_PI = require( '@stdlib/constants/float32/half-pi' ); console.log( FLOAT32_HALF_PI ); // => 1.5707963705062866 diff --git a/lib/node_modules/@stdlib/constants/float32/max-base2-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float32/max-base2-exponent-subnormal/README.md index de187f0fee8a..433b965975f7 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-base2-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-base2-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/max-base2-exponent-subnormal' ); +const FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/max-base2-exponent-subnormal' ); ``` #### FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The maximum biased base 2 exponent for a subnormal [single-precision floating-po ```javascript -var bool = ( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL === -127 ); +const bool = ( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL === -127 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL === -127 ); ```javascript -var FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/max-base2-exponent-subnormal' ); +const FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/max-base2-exponent-subnormal' ); console.log( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL ); // => -127 diff --git a/lib/node_modules/@stdlib/constants/float32/max-base2-exponent/README.md b/lib/node_modules/@stdlib/constants/float32/max-base2-exponent/README.md index 04b8659f3c8b..3cb4f241e083 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-base2-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-base2-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float32/max-base2-exponent' ); +const FLOAT32_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float32/max-base2-exponent' ); ``` #### FLOAT32_MAX_BASE2_EXPONENT @@ -39,7 +39,7 @@ The maximum biased base 2 exponent for a [single-precision floating-point number ```javascript -var bool = ( FLOAT32_MAX_BASE2_EXPONENT === 127 ); +const bool = ( FLOAT32_MAX_BASE2_EXPONENT === 127 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( FLOAT32_MAX_BASE2_EXPONENT === 127 ); ```javascript -var FLOAT32_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float32/max-base2-exponent' ); +const FLOAT32_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float32/max-base2-exponent' ); console.log( FLOAT32_MAX_BASE2_EXPONENT ); // => 127 diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-fibonacci/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-fibonacci/README.md index 3b2d566a39f9..81b7a08e71e6 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-fibonacci/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-fibonacci/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float32/max-safe-fibonacci' ); +const FLOAT32_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float32/max-safe-fibonacci' ); ``` #### FLOAT32_MAX_SAFE_FIBONACCI @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] [Fibonacci number][fibonacci-number] when stor ```javascript -var bool = ( FLOAT32_MAX_SAFE_FIBONACCI === 14930352 ); +const bool = ( FLOAT32_MAX_SAFE_FIBONACCI === 14930352 ); // returns true ``` @@ -56,29 +56,21 @@ var bool = ( FLOAT32_MAX_SAFE_FIBONACCI === 14930352 ); ```javascript -var FLOAT32_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float32/max-safe-fibonacci' ); - -var v; -var i; +const FLOAT32_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float32/max-safe-fibonacci' ); function fibonacci( n ) { - var a; - var b; - var c; - var i; - - a = 1; - b = 1; - for ( i = 3; i <= n; i++ ) { - c = a + b; + let a = 1; + let b = 1; + for ( let i = 0; i <= n; i++ ) { + const c = a + b; a = b; b = c; } return b; } -for ( i = 0; i < 50; i++ ) { - v = fibonacci( i ); +for ( let i = 0; i < 50; i++ ) { + const v = fibonacci( i ); if ( v > FLOAT32_MAX_SAFE_FIBONACCI ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-integer/README.md index 3dab96393f2a..edf19bc523be 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_MAX_SAFE_INTEGER = require( '@stdlib/constants/float32/max-safe-integer' ); +const FLOAT32_MAX_SAFE_INTEGER = require( '@stdlib/constants/float32/max-safe-integer' ); ``` #### FLOAT32_MAX_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT32_MAX_SAFE_INTEGER = require( '@stdlib/constants/float32/max-safe-inte The maximum [safe][safe-integers] [single-precision floating-point][ieee754] integer. ```javascript -var bool = ( FLOAT32_MAX_SAFE_INTEGER === 16777215 ); +const bool = ( FLOAT32_MAX_SAFE_INTEGER === 16777215 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT32_MAX_SAFE_INTEGER === 16777215 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT32_MAX_SAFE_INTEGER = require( '@stdlib/constants/float32/max-safe-integer' ); - -var max; -var x; -var i; - -max = pow( 2.0, 26 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * max ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT32_MAX_SAFE_INTEGER = require( '@stdlib/constants/float32/max-safe-integer' ); + +const max = pow( 2.0, 26 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * max ); if ( x > FLOAT32_MAX_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-factorial/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-factorial/README.md index 0e3ce218388b..831a8df95b72 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-factorial/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-factorial/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float32/max-safe-nth-factorial' ); +const FLOAT32_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float32/max-safe-nth-factorial' ); ``` #### FLOAT32_MAX_SAFE_NTH_FACTORIAL @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [factorial][factorial] when stored in [sin ```javascript -var bool = ( FLOAT32_MAX_SAFE_NTH_FACTORIAL === 34 ); +const bool = ( FLOAT32_MAX_SAFE_NTH_FACTORIAL === 34 ); // returns true ``` @@ -56,23 +56,18 @@ var bool = ( FLOAT32_MAX_SAFE_NTH_FACTORIAL === 34 ); ```javascript -var FLOAT32_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float32/max-safe-nth-factorial' ); +const FLOAT32_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float32/max-safe-nth-factorial' ); function factorial( n ) { - var a; - var i; - - a = 1; - for ( i = 2; i <= n; i++ ) { + let a = 1; + for ( let i = 0; i <= n; i++ ) { a *= i; } return a; } -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = factorial( i ); +for ( let i = 0; i < 100; i++ ) { + const v = factorial( i ); if ( i > FLOAT32_MAX_SAFE_NTH_FACTORIAL ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-fibonacci/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-fibonacci/README.md index bdafa9622fb3..9abdcb66ece9 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-fibonacci/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-fibonacci/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-fibonacci' ); +const FLOAT32_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-fibonacci' ); ``` #### FLOAT32_MAX_SAFE_NTH_FIBONACCI @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [Fibonacci number][fibonacci-number] when ```javascript -var bool = ( FLOAT32_MAX_SAFE_NTH_FIBONACCI === 36 ); +const bool = ( FLOAT32_MAX_SAFE_NTH_FIBONACCI === 36 ); // returns true ``` @@ -56,17 +56,16 @@ var bool = ( FLOAT32_MAX_SAFE_NTH_FIBONACCI === 36 ); ```javascript -var FLOAT32_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-fibonacci' ); +const FLOAT32_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-fibonacci' ); function fibonacci( n ) { - var a; - var b; - var c; - var i; + let a; + let b; + let c; a = 1; b = 1; - for ( i = 3; i <= n; i++ ) { + for ( i = 0; i <= n; i++ ) { c = a + b; a = b; b = c; @@ -74,10 +73,8 @@ function fibonacci( n ) { return b; } -var v; -var i; -for ( i = 0; i < 50; i++ ) { - v = fibonacci( i ); +for ( let i = 0; i < 50; i++ ) { + const v = fibonacci( i ); if ( i > FLOAT32_MAX_SAFE_NTH_FIBONACCI ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float32/max/README.md b/lib/node_modules/@stdlib/constants/float32/max/README.md index bc925fee7937..70f1de436a1b 100644 --- a/lib/node_modules/@stdlib/constants/float32/max/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); +const FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); ``` #### FLOAT32_MAX @@ -35,7 +35,7 @@ var FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); Maximum [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_MAX === 3.4028234663852886e+38 ); +const bool = ( FLOAT32_MAX === 3.4028234663852886e+38 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_MAX === 3.4028234663852886e+38 ); ```javascript -var FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); +const FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); console.log( FLOAT32_MAX ); // => 3.4028234663852886e+38 diff --git a/lib/node_modules/@stdlib/constants/float32/min-base2-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float32/min-base2-exponent-subnormal/README.md index 7a6b803de198..3bea8416ba27 100644 --- a/lib/node_modules/@stdlib/constants/float32/min-base2-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float32/min-base2-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/min-base2-exponent-subnormal' ); +const FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/min-base2-exponent-subnormal' ); ``` #### FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The minimum biased base 2 exponent for a subnormal [single-precision floating-po ```javascript -var bool = ( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL === -149 ); +const bool = ( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL === -149 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL === -149 ); ```javascript -var FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/min-base2-exponent-subnormal' ); +const FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float32/min-base2-exponent-subnormal' ); console.log( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL ); // => -149 diff --git a/lib/node_modules/@stdlib/constants/float32/min-base2-exponent/README.md b/lib/node_modules/@stdlib/constants/float32/min-base2-exponent/README.md index 01ebe5241cbc..2ba2f537c4ff 100644 --- a/lib/node_modules/@stdlib/constants/float32/min-base2-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float32/min-base2-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float32/min-base2-exponent' ); +const FLOAT32_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float32/min-base2-exponent' ); ``` #### FLOAT32_MIN_BASE2_EXPONENT @@ -39,7 +39,7 @@ The minimum biased base 2 exponent for a normal [single-precision floating-point ```javascript -var bool = ( FLOAT32_MIN_BASE2_EXPONENT === -126 ); +const bool = ( FLOAT32_MIN_BASE2_EXPONENT === -126 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( FLOAT32_MIN_BASE2_EXPONENT === -126 ); ```javascript -var FLOAT32_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float32/min-base2-exponent' ); +const FLOAT32_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float32/min-base2-exponent' ); console.log( FLOAT32_MIN_BASE2_EXPONENT ); // => -126 diff --git a/lib/node_modules/@stdlib/constants/float32/min-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float32/min-safe-integer/README.md index 8b2c1ad9ea29..dc3468cc22fb 100644 --- a/lib/node_modules/@stdlib/constants/float32/min-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float32/min-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_MIN_SAFE_INTEGER = require( '@stdlib/constants/float32/min-safe-integer' ); +const FLOAT32_MIN_SAFE_INTEGER = require( '@stdlib/constants/float32/min-safe-integer' ); ``` #### FLOAT32_MIN_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT32_MIN_SAFE_INTEGER = require( '@stdlib/constants/float32/min-safe-inte The minimum [safe][safe-integers] [single-precision floating-point][ieee754] integer. ```javascript -var bool = ( FLOAT32_MIN_SAFE_INTEGER === -16777215 ); +const bool = ( FLOAT32_MIN_SAFE_INTEGER === -16777215 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT32_MIN_SAFE_INTEGER === -16777215 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT32_MIN_SAFE_INTEGER = require( '@stdlib/constants/float32/min-safe-integer' ); - -var min; -var x; -var i; - -min = -pow( 2.0, 26 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * min ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT32_MIN_SAFE_INTEGER = require( '@stdlib/constants/float32/min-safe-integer' ); + +const min = -pow( 2.0, 26 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * min ); if ( x < FLOAT32_MIN_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float32/nan/README.md b/lib/node_modules/@stdlib/constants/float32/nan/README.md index 2144f73efe3d..18a840fcec58 100644 --- a/lib/node_modules/@stdlib/constants/float32/nan/README.md +++ b/lib/node_modules/@stdlib/constants/float32/nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' ); +const FLOAT32_NAN = require( '@stdlib/constants/float32/nan' ); ``` #### FLOAT32_NAN @@ -35,7 +35,7 @@ var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' ); [Single-precision floating-point][ieee754] `NaN`. ```javascript -var bool = ( FLOAT32_NAN !== FLOAT32_NAN ); +const bool = ( FLOAT32_NAN !== FLOAT32_NAN ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_NAN !== FLOAT32_NAN ); ```javascript -var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' ); +const FLOAT32_NAN = require( '@stdlib/constants/float32/nan' ); console.log( FLOAT32_NAN ); // => NaN diff --git a/lib/node_modules/@stdlib/constants/float32/ninf/README.md b/lib/node_modules/@stdlib/constants/float32/ninf/README.md index 45f75bd5f522..0702c80227d7 100644 --- a/lib/node_modules/@stdlib/constants/float32/ninf/README.md +++ b/lib/node_modules/@stdlib/constants/float32/ninf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' ); +const FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' ); ``` #### FLOAT32_NINF @@ -36,7 +36,7 @@ var FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' ); ```javascript // FLOAT32_NINF is implicitly promoted to a double-precision floating-point number... -var bool = ( FLOAT32_NINF === -Infinity ); +const bool = ( FLOAT32_NINF === -Infinity ); // returns true ``` @@ -53,7 +53,7 @@ var bool = ( FLOAT32_NINF === -Infinity ); ```javascript -var FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' ); +const FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' ); console.log( FLOAT32_NINF ); // => -Infinity diff --git a/lib/node_modules/@stdlib/constants/float32/num-bytes/README.md b/lib/node_modules/@stdlib/constants/float32/num-bytes/README.md index fdc7aa725fb3..42bc04b3b110 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/float32/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_NUM_BYTES = require( '@stdlib/constants/float32/num-bytes' ); +const FLOAT32_NUM_BYTES = require( '@stdlib/constants/float32/num-bytes' ); ``` #### FLOAT32_NUM_BYTES @@ -35,7 +35,7 @@ var FLOAT32_NUM_BYTES = require( '@stdlib/constants/float32/num-bytes' ); Size (in bytes) of a [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_NUM_BYTES === 4 ); +const bool = ( FLOAT32_NUM_BYTES === 4 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_NUM_BYTES === 4 ); ```javascript -var FLOAT32_NUM_BYTES = require( '@stdlib/constants/float32/num-bytes' ); +const FLOAT32_NUM_BYTES = require( '@stdlib/constants/float32/num-bytes' ); console.log( FLOAT32_NUM_BYTES ); // => 4 diff --git a/lib/node_modules/@stdlib/constants/float32/phi/README.md b/lib/node_modules/@stdlib/constants/float32/phi/README.md index 3ecb2169f619..10796f7b766a 100644 --- a/lib/node_modules/@stdlib/constants/float32/phi/README.md +++ b/lib/node_modules/@stdlib/constants/float32/phi/README.md @@ -48,7 +48,7 @@ The [golden ratio][phi] can be defined algebraically as ## Usage ```javascript -var FLOAT32_PHI = require( '@stdlib/constants/float32/phi' ); +const FLOAT32_PHI = require( '@stdlib/constants/float32/phi' ); ``` #### FLOAT32_PHI @@ -56,7 +56,7 @@ var FLOAT32_PHI = require( '@stdlib/constants/float32/phi' ); The [golden ratio][phi-value]. ```javascript -var bool = ( FLOAT32_PHI === 1.6180340051651 ); +const bool = ( FLOAT32_PHI === 1.6180340051651 ); // returns true ``` @@ -73,7 +73,7 @@ var bool = ( FLOAT32_PHI === 1.6180340051651 ); ```javascript -var FLOAT32_PHI = require( '@stdlib/constants/float32/phi' ); +const FLOAT32_PHI = require( '@stdlib/constants/float32/phi' ); console.log( FLOAT32_PHI ); // => 1.6180340051651 diff --git a/lib/node_modules/@stdlib/constants/float32/pi/README.md b/lib/node_modules/@stdlib/constants/float32/pi/README.md index d09323920e77..b106fd77e64e 100644 --- a/lib/node_modules/@stdlib/constants/float32/pi/README.md +++ b/lib/node_modules/@stdlib/constants/float32/pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_PI = require( '@stdlib/constants/float32/pi' ); +const FLOAT32_PI = require( '@stdlib/constants/float32/pi' ); ``` #### FLOAT32_PI @@ -35,7 +35,7 @@ var FLOAT32_PI = require( '@stdlib/constants/float32/pi' ); The mathematical constant [π][pi]. ```javascript -var bool = ( FLOAT32_PI === 3.1415927410125732 ); +const bool = ( FLOAT32_PI === 3.1415927410125732 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_PI === 3.1415927410125732 ); ```javascript -var FLOAT32_PI = require( '@stdlib/constants/float32/pi' ); +const FLOAT32_PI = require( '@stdlib/constants/float32/pi' ); console.log( FLOAT32_PI ); // => 3.1415927410125732 diff --git a/lib/node_modules/@stdlib/constants/float32/pinf/README.md b/lib/node_modules/@stdlib/constants/float32/pinf/README.md index 5fb8493ad27d..cdd97254fecc 100644 --- a/lib/node_modules/@stdlib/constants/float32/pinf/README.md +++ b/lib/node_modules/@stdlib/constants/float32/pinf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_PINF = require( '@stdlib/constants/float32/pinf' ); +const FLOAT32_PINF = require( '@stdlib/constants/float32/pinf' ); ``` #### FLOAT32_PINF @@ -36,7 +36,7 @@ var FLOAT32_PINF = require( '@stdlib/constants/float32/pinf' ); ```javascript // FLOAT32_PINF is implicitly promoted to a double-precision floating-point number... -var bool = ( FLOAT32_PINF === Infinity ); +const bool = ( FLOAT32_PINF === Infinity ); // returns true ``` @@ -51,7 +51,7 @@ var bool = ( FLOAT32_PINF === Infinity ); ```javascript -var FLOAT32_PINF = require( '@stdlib/constants/float32/pinf' ); +const FLOAT32_PINF = require( '@stdlib/constants/float32/pinf' ); console.log( FLOAT32_PINF ); // => Infinity diff --git a/lib/node_modules/@stdlib/constants/float32/precision/README.md b/lib/node_modules/@stdlib/constants/float32/precision/README.md index cfe604bb635e..e082094210ef 100644 --- a/lib/node_modules/@stdlib/constants/float32/precision/README.md +++ b/lib/node_modules/@stdlib/constants/float32/precision/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_PRECISION = require( '@stdlib/constants/float32/precision' ); +const FLOAT32_PRECISION = require( '@stdlib/constants/float32/precision' ); ``` #### FLOAT32_PRECISION @@ -35,7 +35,7 @@ var FLOAT32_PRECISION = require( '@stdlib/constants/float32/precision' ); Effective number of bits in the [significand][significand] of a [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_PRECISION === 24 ); // including implicit bit +const bool = ( FLOAT32_PRECISION === 24 ); // including implicit bit // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_PRECISION === 24 ); // including implicit bit ```javascript -var FLOAT32_PRECISION = require( '@stdlib/constants/float32/precision' ); +const FLOAT32_PRECISION = require( '@stdlib/constants/float32/precision' ); console.log( FLOAT32_PRECISION ); // => 24 diff --git a/lib/node_modules/@stdlib/constants/float32/sign-mask/README.md b/lib/node_modules/@stdlib/constants/float32/sign-mask/README.md index 47b88c847026..9e240d21e068 100644 --- a/lib/node_modules/@stdlib/constants/float32/sign-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float32/sign-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_SIGN_MASK = require( '@stdlib/constants/float32/sign-mask' ); +const FLOAT32_SIGN_MASK = require( '@stdlib/constants/float32/sign-mask' ); ``` #### FLOAT32_SIGN_MASK @@ -40,7 +40,7 @@ Mask for the sign bit of a [single-precision floating-point number][ieee754]. ```javascript // 0x80000000 = 2147483648 => 1 00000000 00000000000000000000000 -var bool = ( FLOAT32_SIGN_MASK === 0x80000000 ); +const bool = ( FLOAT32_SIGN_MASK === 0x80000000 ); // returns true ``` @@ -67,16 +67,16 @@ var bool = ( FLOAT32_SIGN_MASK === 0x80000000 ); ```javascript -var toWord = require( '@stdlib/number/float32/base/to-word' ); -var fromWord = require( '@stdlib/number/float32/base/from-word' ); -var FLOAT32_SIGN_MASK = require( '@stdlib/constants/float32/sign-mask' ); +const toWord = require( '@stdlib/number/float32/base/to-word' ); +const fromWord = require( '@stdlib/number/float32/base/from-word' ); +const FLOAT32_SIGN_MASK = require( '@stdlib/constants/float32/sign-mask' ); -var x = -11.5; -var w = toWord( x ); // 1 10000010 01110000000000000000000 +const x = -11.5; +const w = toWord( x ); // 1 10000010 01110000000000000000000 // returns 3223781376 // Mask off all bits except for the sign bit: -var out = (w & FLOAT32_SIGN_MASK)>>>0; // 1 00000000 00000000000000000000000 +let out = (w & FLOAT32_SIGN_MASK)>>>0; // 1 00000000 00000000000000000000000 // returns 2147483648 // Turn off the sign bit and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float32/significand-mask/README.md b/lib/node_modules/@stdlib/constants/float32/significand-mask/README.md index 576a3bf50376..943f6e7d528b 100644 --- a/lib/node_modules/@stdlib/constants/float32/significand-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float32/significand-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' ); +const FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' ); ``` #### FLOAT32_SIGNIFICAND_MASK @@ -40,7 +40,7 @@ Mask for the significand of a [single-precision floating-point number][ieee754]. ```javascript // 0x007fffff = 8388607 => 0 00000000 11111111111111111111111 -var bool = ( FLOAT32_SIGNIFICAND_MASK === 0x007fffff ); +const bool = ( FLOAT32_SIGNIFICAND_MASK === 0x007fffff ); // returns true ``` @@ -61,15 +61,15 @@ var bool = ( FLOAT32_SIGNIFICAND_MASK === 0x007fffff ); ```javascript -var toWord = require( '@stdlib/number/float32/base/to-word' ); -var FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' ); +const toWord = require( '@stdlib/number/float32/base/to-word' ); +const FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' ); -var x = 11.5; -var w = toWord( x ); // 0 10000010 01110000000000000000000 +const x = 11.5; +const w = toWord( x ); // 0 10000010 01110000000000000000000 // returns 1094189056 // Mask off all bits except for the significand bits: -var out = w & FLOAT32_SIGNIFICAND_MASK; // 0 00000000 01110000000000000000000 +let out = w & FLOAT32_SIGNIFICAND_MASK; // 0 00000000 01110000000000000000000 // returns 3670016 // Mask on the significand bits and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float32/smallest-normal/README.md b/lib/node_modules/@stdlib/constants/float32/smallest-normal/README.md index bf4c9df0d602..b90b6d45fd46 100644 --- a/lib/node_modules/@stdlib/constants/float32/smallest-normal/README.md +++ b/lib/node_modules/@stdlib/constants/float32/smallest-normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/float32/smallest-normal' ); +const FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/float32/smallest-normal' ); ``` #### FLOAT32_SMALLEST_NORMAL @@ -35,7 +35,7 @@ var FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/float32/smallest-norma Smallest positive **normalized** [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_SMALLEST_NORMAL === 1.1754943508222875e-38 ); +const bool = ( FLOAT32_SMALLEST_NORMAL === 1.1754943508222875e-38 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_SMALLEST_NORMAL === 1.1754943508222875e-38 ); ```javascript -var FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/float32/smallest-normal' ); +const FLOAT32_SMALLEST_NORMAL = require( '@stdlib/constants/float32/smallest-normal' ); console.log( FLOAT32_SMALLEST_NORMAL ); // => 1.1754943508222875e-38 diff --git a/lib/node_modules/@stdlib/constants/float32/smallest-subnormal/README.md b/lib/node_modules/@stdlib/constants/float32/smallest-subnormal/README.md index 48cc050d27b8..14b05d3de30a 100644 --- a/lib/node_modules/@stdlib/constants/float32/smallest-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float32/smallest-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT32_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float32/smallest-subnormal' ); +const FLOAT32_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float32/smallest-subnormal' ); ``` #### FLOAT32_SMALLEST_SUBNORMAL @@ -39,7 +39,7 @@ Smallest positive **denormalized** [single-precision floating-point number][ieee ```javascript -var bool = ( FLOAT32_SMALLEST_SUBNORMAL === 1.401298464324817e-45 ); +const bool = ( FLOAT32_SMALLEST_SUBNORMAL === 1.401298464324817e-45 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT32_SMALLEST_SUBNORMAL === 1.401298464324817e-45 ); ```javascript -var FLOAT32_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float32/smallest-subnormal' ); +const FLOAT32_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float32/smallest-subnormal' ); console.log( FLOAT32_SMALLEST_SUBNORMAL ); // => 1.401298464324817e-45 diff --git a/lib/node_modules/@stdlib/constants/float32/sqrt-eps/README.md b/lib/node_modules/@stdlib/constants/float32/sqrt-eps/README.md index f520c5c6d135..649efbb6afbc 100644 --- a/lib/node_modules/@stdlib/constants/float32/sqrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float32/sqrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_SQRT_EPS = require( '@stdlib/constants/float32/sqrt-eps' ); +const FLOAT32_SQRT_EPS = require( '@stdlib/constants/float32/sqrt-eps' ); ``` #### FLOAT32_SQRT_EPS @@ -35,7 +35,7 @@ var FLOAT32_SQRT_EPS = require( '@stdlib/constants/float32/sqrt-eps' ); [Square root][@stdlib/math/base/special/sqrt] of [single-precision floating-point epsilon][@stdlib/constants/float32/eps]. ```javascript -var bool = ( FLOAT32_SQRT_EPS === 0.0003452669770922512 ); +const bool = ( FLOAT32_SQRT_EPS === 0.0003452669770922512 ); // returns true ``` @@ -50,31 +50,23 @@ var bool = ( FLOAT32_SQRT_EPS === 0.0003452669770922512 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var randu = require( '@stdlib/random/base/randu' ); -var FLOAT32_SQRT_EPS = require( '@stdlib/constants/float32/sqrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const FLOAT32_SQRT_EPS = require( '@stdlib/constants/float32/sqrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = float64ToFloat32( abs( a - b ) ); - tol = float64ToFloat32( FLOAT32_SQRT_EPS * max( abs( a ), abs( b ) ) ); + const delta = float64ToFloat32( abs( a - b ) ); + const tol = float64ToFloat32( FLOAT32_SQRT_EPS * max( abs( a ), abs( b ) ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = float64ToFloat32( randu()*10.0 ); - b = float64ToFloat32( a + (randu()*2.0e-2) - 1.0e-2 ); - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = float64ToFloat32( randu()*10.0 ); + const b = float64ToFloat32( a + (randu()*2.0e-2) - 1.0e-2 ); + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d', a, ( bool ) ? 'is' : 'is not', b ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float32/two-pi/README.md b/lib/node_modules/@stdlib/constants/float32/two-pi/README.md index b71a91206ac1..f608d7024ed2 100644 --- a/lib/node_modules/@stdlib/constants/float32/two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float32/two-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT32_TWO_PI = require( '@stdlib/constants/float32/two-pi' ); +const FLOAT32_TWO_PI = require( '@stdlib/constants/float32/two-pi' ); ``` #### FLOAT32_TWO_PI @@ -35,7 +35,7 @@ var FLOAT32_TWO_PI = require( '@stdlib/constants/float32/two-pi' ); The mathematical constant [π][@stdlib/constants/float32/pi] times 2. ```javascript -var bool = ( FLOAT32_TWO_PI === 6.2831854820251465 ); +const bool = ( FLOAT32_TWO_PI === 6.2831854820251465 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT32_TWO_PI === 6.2831854820251465 ); ```javascript -var FLOAT32_TWO_PI = require( '@stdlib/constants/float32/two-pi' ); +const FLOAT32_TWO_PI = require( '@stdlib/constants/float32/two-pi' ); console.log( FLOAT32_TWO_PI ); // => 6.2831854820251465 diff --git a/lib/node_modules/@stdlib/constants/float64/README.md b/lib/node_modules/@stdlib/constants/float64/README.md index 49232a22867a..522150e6334d 100644 --- a/lib/node_modules/@stdlib/constants/float64/README.md +++ b/lib/node_modules/@stdlib/constants/float64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/float64' ); +const constants = require( '@stdlib/constants/float64' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/float64' ); Double-precision floating-point mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -122,8 +122,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/float64' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/float64' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/float64/apery/README.md b/lib/node_modules/@stdlib/constants/float64/apery/README.md index e1e7b88a92b1..13532fd023be 100644 --- a/lib/node_modules/@stdlib/constants/float64/apery/README.md +++ b/lib/node_modules/@stdlib/constants/float64/apery/README.md @@ -50,7 +50,7 @@ where `ζ(s)` is the [Riemann zeta function][@stdlib/math/base/special/riemann-z ## Usage ```javascript -var APERY = require( '@stdlib/constants/float64/apery' ); +const APERY = require( '@stdlib/constants/float64/apery' ); ``` #### APERY @@ -58,7 +58,7 @@ var APERY = require( '@stdlib/constants/float64/apery' ); [Apéry's constant][apery-constant]. ```javascript -var bool = ( APERY === 1.2020569031595942 ); +const bool = ( APERY === 1.2020569031595942 ); // returns true ``` @@ -75,7 +75,7 @@ var bool = ( APERY === 1.2020569031595942 ); ```javascript -var APERY = require( '@stdlib/constants/float64/apery' ); +const APERY = require( '@stdlib/constants/float64/apery' ); console.log( APERY ); // => 1.2020569031595942 diff --git a/lib/node_modules/@stdlib/constants/float64/catalan/README.md b/lib/node_modules/@stdlib/constants/float64/catalan/README.md index 01111f05c0bc..29592a783b97 100644 --- a/lib/node_modules/@stdlib/constants/float64/catalan/README.md +++ b/lib/node_modules/@stdlib/constants/float64/catalan/README.md @@ -48,7 +48,7 @@ C = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^2} = \frac{1}{1^2} - \frac{1}{3^2 ## Usage ```javascript -var CATALAN = require( '@stdlib/constants/float64/catalan' ); +const CATALAN = require( '@stdlib/constants/float64/catalan' ); ``` #### CATALAN @@ -56,7 +56,7 @@ var CATALAN = require( '@stdlib/constants/float64/catalan' ); [Catalan's constant][catalan-constant]. ```javascript -var bool = ( CATALAN === 0.915965594177219 ); +const bool = ( CATALAN === 0.915965594177219 ); // returns true ``` @@ -73,7 +73,7 @@ var bool = ( CATALAN === 0.915965594177219 ); ```javascript -var CATALAN = require( '@stdlib/constants/float64/catalan' ); +const CATALAN = require( '@stdlib/constants/float64/catalan' ); console.log( CATALAN ); // => 0.915965594177219 diff --git a/lib/node_modules/@stdlib/constants/float64/cbrt-eps/README.md b/lib/node_modules/@stdlib/constants/float64/cbrt-eps/README.md index 15b1fc7b07b9..e192929e312a 100644 --- a/lib/node_modules/@stdlib/constants/float64/cbrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float64/cbrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var CBRT_EPS = require( '@stdlib/constants/float64/cbrt-eps' ); +const CBRT_EPS = require( '@stdlib/constants/float64/cbrt-eps' ); ``` #### CBRT_EPS @@ -35,7 +35,7 @@ var CBRT_EPS = require( '@stdlib/constants/float64/cbrt-eps' ); [Cube root][@stdlib/math/base/special/cbrt] of [double-precision floating-point epsilon][@stdlib/constants/float64/eps]. ```javascript -var bool = ( CBRT_EPS === 0.0000060554544523933395 ); +const bool = ( CBRT_EPS === 0.0000060554544523933395 ); // returns true ``` @@ -50,30 +50,22 @@ var bool = ( CBRT_EPS === 0.0000060554544523933395 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var randu = require( '@stdlib/random/base/randu' ); -var CBRT_EPS = require( '@stdlib/constants/float64/cbrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const randu = require( '@stdlib/random/base/randu' ); +const CBRT_EPS = require( '@stdlib/constants/float64/cbrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = CBRT_EPS * max( abs( a ), abs( b ) ); + const delta = abs( a - b ); + const tol = CBRT_EPS * max( abs( a ), abs( b ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + (randu()*5.0e-7) - 2.5e-7; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + (randu()*5.0e-7) - 2.5e-7; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d. Delta: %d.', a, ( bool ) ? 'is' : 'is not', b, abs( a - b ) ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float64/e/README.md b/lib/node_modules/@stdlib/constants/float64/e/README.md index 0ec69e84247b..706829d36b85 100644 --- a/lib/node_modules/@stdlib/constants/float64/e/README.md +++ b/lib/node_modules/@stdlib/constants/float64/e/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var E = require( '@stdlib/constants/float64/e' ); +const E = require( '@stdlib/constants/float64/e' ); ``` #### E @@ -35,7 +35,7 @@ var E = require( '@stdlib/constants/float64/e' ); The mathematical constant [_e_][e], also known as Euler's number or Napier's constant. [_e_][e] is the base of the natural logarithm. ```javascript -var bool = ( E === 2.718281828459045 ); +const bool = ( E === 2.718281828459045 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( E === 2.718281828459045 ); ```javascript -var E = require( '@stdlib/constants/float64/e' ); +const E = require( '@stdlib/constants/float64/e' ); console.log( E ); // => 2.718281828459045 diff --git a/lib/node_modules/@stdlib/constants/float64/eps/README.md b/lib/node_modules/@stdlib/constants/float64/eps/README.md index bc42fa84bfb1..b8ce03dad071 100644 --- a/lib/node_modules/@stdlib/constants/float64/eps/README.md +++ b/lib/node_modules/@stdlib/constants/float64/eps/README.md @@ -50,7 +50,7 @@ where `b` is the radix (base) and `p` is the precision (number of radix bits in ## Usage ```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); +const EPS = require( '@stdlib/constants/float64/eps' ); ``` #### EPS @@ -58,7 +58,7 @@ var EPS = require( '@stdlib/constants/float64/eps' ); Difference between one and the smallest value greater than one that can be represented as a [double-precision floating-point number][ieee754]. ```javascript -var bool = ( EPS === 2.220446049250313e-16 ); +const bool = ( EPS === 2.220446049250313e-16 ); // returns true ``` @@ -73,30 +73,22 @@ var bool = ( EPS === 2.220446049250313e-16 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = EPS * max( abs( a ), abs( b ) ); + const delta = abs( a - b ); + const tol = EPS * max( abs( a ), abs( b ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + (randu()*5.0e-15) - 2.5e-15; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + (randu()*5.0e-15) - 2.5e-15; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d. Delta: %d.', a, ( bool ) ? 'is' : 'is not', b, abs( a - b ) ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float64/eulergamma/README.md b/lib/node_modules/@stdlib/constants/float64/eulergamma/README.md index d5892b2dec39..96826714c89a 100644 --- a/lib/node_modules/@stdlib/constants/float64/eulergamma/README.md +++ b/lib/node_modules/@stdlib/constants/float64/eulergamma/README.md @@ -48,7 +48,7 @@ The [Euler-Mascheroni][eulergamma] constant `gamma` (also known as "Euler's cons ## Usage ```javascript -var EULERGAMMA = require( '@stdlib/constants/float64/eulergamma' ); +const EULERGAMMA = require( '@stdlib/constants/float64/eulergamma' ); ``` #### EULERGAMMA @@ -56,7 +56,7 @@ var EULERGAMMA = require( '@stdlib/constants/float64/eulergamma' ); The [Euler-Mascheroni][eulergamma] constant. ```javascript -var bool = ( EULERGAMMA === 0.5772156649015329 ); +const bool = ( EULERGAMMA === 0.5772156649015329 ); // returns true ``` @@ -73,7 +73,7 @@ var bool = ( EULERGAMMA === 0.5772156649015329 ); ```javascript -var EULERGAMMA = require( '@stdlib/constants/float64/eulergamma' ); +const EULERGAMMA = require( '@stdlib/constants/float64/eulergamma' ); console.log( EULERGAMMA ); // => 0.5772156649015329 diff --git a/lib/node_modules/@stdlib/constants/float64/exponent-bias/README.md b/lib/node_modules/@stdlib/constants/float64/exponent-bias/README.md index bbca43fdf27c..740eb81f4fe0 100644 --- a/lib/node_modules/@stdlib/constants/float64/exponent-bias/README.md +++ b/lib/node_modules/@stdlib/constants/float64/exponent-bias/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' ); +const FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' ); ``` #### FLOAT64_EXPONENT_BIAS @@ -35,7 +35,7 @@ var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' ) The bias of a [double-precision floating-point number's][ieee754] exponent. ```javascript -var bool = ( FLOAT64_EXPONENT_BIAS === 1023 ); +const bool = ( FLOAT64_EXPONENT_BIAS === 1023 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_EXPONENT_BIAS === 1023 ); ```javascript -var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' ); +const FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' ); console.log( FLOAT64_EXPONENT_BIAS ); // => 1023 diff --git a/lib/node_modules/@stdlib/constants/float64/fourth-pi/README.md b/lib/node_modules/@stdlib/constants/float64/fourth-pi/README.md index cd2eb6687673..8c9e105ff951 100644 --- a/lib/node_modules/@stdlib/constants/float64/fourth-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/fourth-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FOURTH_PI = require( '@stdlib/constants/float64/fourth-pi' ); +const FOURTH_PI = require( '@stdlib/constants/float64/fourth-pi' ); ``` #### FOURTH_PI @@ -35,7 +35,7 @@ var FOURTH_PI = require( '@stdlib/constants/float64/fourth-pi' ); One fourth times the mathematical constant [π][pi]. ```javascript -var bool = ( FOURTH_PI === 7.85398163397448309616e-1 ); +const bool = ( FOURTH_PI === 7.85398163397448309616e-1 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FOURTH_PI === 7.85398163397448309616e-1 ); ```javascript -var FOURTH_PI = require( '@stdlib/constants/float64/fourth-pi' ); +const FOURTH_PI = require( '@stdlib/constants/float64/fourth-pi' ); console.log( FOURTH_PI ); // => 7.85398163397448309616e-1 diff --git a/lib/node_modules/@stdlib/constants/float64/fourth-root-eps/README.md b/lib/node_modules/@stdlib/constants/float64/fourth-root-eps/README.md index 3e6d2e254472..b056d722785b 100644 --- a/lib/node_modules/@stdlib/constants/float64/fourth-root-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float64/fourth-root-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FOURTH_ROOT_EPS = require( '@stdlib/constants/float64/fourth-root-eps' ); +const FOURTH_ROOT_EPS = require( '@stdlib/constants/float64/fourth-root-eps' ); ``` #### FOURTH_ROOT_EPS @@ -35,7 +35,7 @@ var FOURTH_ROOT_EPS = require( '@stdlib/constants/float64/fourth-root-eps' ); [Fourth root][nth-root] of [double-precision floating-point epsilon][@stdlib/constants/float64/eps]. ```javascript -var bool = ( FOURTH_ROOT_EPS === 0.0001220703125 ); +const bool = ( FOURTH_ROOT_EPS === 0.0001220703125 ); // returns true ``` @@ -50,9 +50,9 @@ var bool = ( FOURTH_ROOT_EPS === 0.0001220703125 ); ```javascript -var FOURTH_ROOT_EPS = require( '@stdlib/constants/float64/fourth-root-eps' ); +const FOURTH_ROOT_EPS = require( '@stdlib/constants/float64/fourth-root-eps' ); -var out = FOURTH_ROOT_EPS; +const out = FOURTH_ROOT_EPS; // returns 0.0001220703125 ``` diff --git a/lib/node_modules/@stdlib/constants/float64/gamma-lanczos-g/README.md b/lib/node_modules/@stdlib/constants/float64/gamma-lanczos-g/README.md index 686ff4476f5d..5c940a7390f9 100644 --- a/lib/node_modules/@stdlib/constants/float64/gamma-lanczos-g/README.md +++ b/lib/node_modules/@stdlib/constants/float64/gamma-lanczos-g/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var GAMMA_LANCZOS_G = require( '@stdlib/constants/float64/gamma-lanczos-g' ); +const GAMMA_LANCZOS_G = require( '@stdlib/constants/float64/gamma-lanczos-g' ); ``` #### GAMMA_LANCZOS_G @@ -41,7 +41,7 @@ var GAMMA_LANCZOS_G = require( '@stdlib/constants/float64/gamma-lanczos-g' ); Arbitrary constant `g` to be used in [Lanczos approximation][lanczos-approximation] functions. ```javascript -var bool = ( GAMMA_LANCZOS_G === 10.900511 ); +const bool = ( GAMMA_LANCZOS_G === 10.900511 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( GAMMA_LANCZOS_G === 10.900511 ); ```javascript -var GAMMA_LANCZOS_G = require( '@stdlib/constants/float64/gamma-lanczos-g' ); +const GAMMA_LANCZOS_G = require( '@stdlib/constants/float64/gamma-lanczos-g' ); console.log( GAMMA_LANCZOS_G ); // => 10.900511 diff --git a/lib/node_modules/@stdlib/constants/float64/glaisher-kinkelin/README.md b/lib/node_modules/@stdlib/constants/float64/glaisher-kinkelin/README.md index 389ee6086d4f..b6625744da8c 100644 --- a/lib/node_modules/@stdlib/constants/float64/glaisher-kinkelin/README.md +++ b/lib/node_modules/@stdlib/constants/float64/glaisher-kinkelin/README.md @@ -65,7 +65,7 @@ is the [K-function][k-function]. ## Usage ```javascript -var GLAISHER = require( '@stdlib/constants/float64/glaisher-kinkelin' ); +const GLAISHER = require( '@stdlib/constants/float64/glaisher-kinkelin' ); ``` #### GLAISHER @@ -73,7 +73,7 @@ var GLAISHER = require( '@stdlib/constants/float64/glaisher-kinkelin' ); The [Glaisher-Kinkelin][glaisher-constant] constant. ```javascript -var bool = ( GLAISHER === 1.2824271291006226 ); +const bool = ( GLAISHER === 1.2824271291006226 ); // returns true ``` @@ -90,7 +90,7 @@ var bool = ( GLAISHER === 1.2824271291006226 ); ```javascript -var GLAISHER = require( '@stdlib/constants/float64/glaisher-kinkelin' ); +const GLAISHER = require( '@stdlib/constants/float64/glaisher-kinkelin' ); console.log( 'Glaisher\'s constant: %d', GLAISHER ); // => 'Glaisher\'s constant: 1.2824271291006226' diff --git a/lib/node_modules/@stdlib/constants/float64/half-ln-two/README.md b/lib/node_modules/@stdlib/constants/float64/half-ln-two/README.md index 4e0fc32e9018..512ffda3d723 100644 --- a/lib/node_modules/@stdlib/constants/float64/half-ln-two/README.md +++ b/lib/node_modules/@stdlib/constants/float64/half-ln-two/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var HALF_LN2 = require( '@stdlib/constants/float64/half-ln-two' ); +const HALF_LN2 = require( '@stdlib/constants/float64/half-ln-two' ); ``` #### HALF_LN2 @@ -35,7 +35,7 @@ var HALF_LN2 = require( '@stdlib/constants/float64/half-ln-two' ); One half times the [natural logarithm][@stdlib/math/base/special/ln] of `2`. ```javascript -var bool = ( HALF_LN2 === 3.46573590279972654709e-01 ); +const bool = ( HALF_LN2 === 3.46573590279972654709e-01 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( HALF_LN2 === 3.46573590279972654709e-01 ); ```javascript -var HALF_LN2 = require( '@stdlib/constants/float64/half-ln-two' ); +const HALF_LN2 = require( '@stdlib/constants/float64/half-ln-two' ); console.log( HALF_LN2 ); // => 3.46573590279972654709e-01 diff --git a/lib/node_modules/@stdlib/constants/float64/half-pi/README.md b/lib/node_modules/@stdlib/constants/float64/half-pi/README.md index ae0d4f389fe3..7bed5acc53c4 100644 --- a/lib/node_modules/@stdlib/constants/float64/half-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/half-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var HALF_PI = require( '@stdlib/constants/float64/half-pi' ); +const HALF_PI = require( '@stdlib/constants/float64/half-pi' ); ``` #### HALF_PI @@ -35,7 +35,7 @@ var HALF_PI = require( '@stdlib/constants/float64/half-pi' ); One half times the mathematical constant [π][pi]. ```javascript -var bool = ( HALF_PI === 1.5707963267948966 ); +const bool = ( HALF_PI === 1.5707963267948966 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( HALF_PI === 1.5707963267948966 ); ```javascript -var HALF_PI = require( '@stdlib/constants/float64/half-pi' ); +const HALF_PI = require( '@stdlib/constants/float64/half-pi' ); console.log( HALF_PI ); // => 1.5707963267948966 diff --git a/lib/node_modules/@stdlib/constants/float64/high-word-abs-mask/README.md b/lib/node_modules/@stdlib/constants/float64/high-word-abs-mask/README.md index d25df2659ead..6819aa5aef82 100644 --- a/lib/node_modules/@stdlib/constants/float64/high-word-abs-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float64/high-word-abs-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' ); +const FLOAT64_HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' ); ``` #### FLOAT64_HIGH_WORD_ABS_MASK @@ -40,7 +40,7 @@ High word mask for excluding the sign bit of a [double-precision floating-point ```javascript // 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111 -var bool = ( FLOAT64_HIGH_WORD_ABS_MASK === 0x7fffffff ); +const bool = ( FLOAT64_HIGH_WORD_ABS_MASK === 0x7fffffff ); // returns true ``` @@ -67,17 +67,17 @@ var bool = ( FLOAT64_HIGH_WORD_ABS_MASK === 0x7fffffff ); ```javascript -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); -var getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); -var fromWords = require( '@stdlib/number/float64/base/from-words' ); -var FLOAT64_HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); +const getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); +const fromWords = require( '@stdlib/number/float64/base/from-words' ); +const FLOAT64_HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' ); -var x = -11.5; -var hi = getHighWord( x ); // 1 10000000010 01110000000000000000 +const x = -11.5; +const hi = getHighWord( x ); // 1 10000000010 01110000000000000000 // returns 3223781376 // Turn off the sign bit and leave other bits unchanged: -var out = hi & FLOAT64_HIGH_WORD_ABS_MASK; // 0 10000000010 01110000000000000000 +let out = hi & FLOAT64_HIGH_WORD_ABS_MASK; // 0 10000000010 01110000000000000000 // returns 1076297728 // Generate a new value: diff --git a/lib/node_modules/@stdlib/constants/float64/high-word-exponent-mask/README.md b/lib/node_modules/@stdlib/constants/float64/high-word-exponent-mask/README.md index ad329ebe930e..704fca39a3dc 100644 --- a/lib/node_modules/@stdlib/constants/float64/high-word-exponent-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float64/high-word-exponent-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); +const FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); ``` #### FLOAT64_HIGH_WORD_EXPONENT_MASK @@ -40,7 +40,7 @@ High word mask for the exponent of a [double-precision floating-point number][ie ```javascript // 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 -var bool = ( FLOAT64_HIGH_WORD_EXPONENT_MASK === 0x7ff00000 ); +const bool = ( FLOAT64_HIGH_WORD_EXPONENT_MASK === 0x7ff00000 ); // returns true ``` @@ -67,15 +67,15 @@ var bool = ( FLOAT64_HIGH_WORD_EXPONENT_MASK === 0x7ff00000 ); ```javascript -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); -var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); +const FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); -var x = 11.5; -var hi = getHighWord( x ); // 0 10000000010 01110000000000000000 +const x = 11.5; +const hi = getHighWord( x ); // 0 10000000010 01110000000000000000 // returns 1076297728 // Mask off all bits except for the exponent bits: -var out = hi & FLOAT64_HIGH_WORD_EXPONENT_MASK; // 0 10000000010 00000000000000000000 +let out = hi & FLOAT64_HIGH_WORD_EXPONENT_MASK; // 0 10000000010 00000000000000000000 // returns 1075838976 // Mask on the exponent bits and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float64/high-word-sign-mask/README.md b/lib/node_modules/@stdlib/constants/float64/high-word-sign-mask/README.md index ada036a1fb27..6e04de6d06e7 100644 --- a/lib/node_modules/@stdlib/constants/float64/high-word-sign-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float64/high-word-sign-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_HIGH_WORD_SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' ); +const FLOAT64_HIGH_WORD_SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' ); ``` #### FLOAT64_HIGH_WORD_SIGN_MASK @@ -40,7 +40,7 @@ High word mask for the sign bit of a [double-precision floating-point number][ie ```javascript // 0x80000000 = 2147483648 => 1 00000000000 00000000000000000000 -var bool = ( FLOAT64_HIGH_WORD_SIGN_MASK === 0x80000000 ); +const bool = ( FLOAT64_HIGH_WORD_SIGN_MASK === 0x80000000 ); // returns true ``` @@ -67,17 +67,17 @@ var bool = ( FLOAT64_HIGH_WORD_SIGN_MASK === 0x80000000 ); ```javascript -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); -var getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); -var fromWords = require( '@stdlib/number/float64/base/from-words' ); -var FLOAT64_HIGH_WORD_SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); +const getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); +const fromWords = require( '@stdlib/number/float64/base/from-words' ); +const FLOAT64_HIGH_WORD_SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' ); -var x = -11.5; -var hi = getHighWord( x ); // 1 10000000010 01110000000000000000 +const x = -11.5; +const hi = getHighWord( x ); // 1 10000000010 01110000000000000000 // returns 3223781376 // Mask off all bits except for the sign bit: -var out = (hi & FLOAT64_HIGH_WORD_SIGN_MASK)>>>0; // 1 00000000000 00000000000000000000 +let out = (hi & FLOAT64_HIGH_WORD_SIGN_MASK)>>>0; // 1 00000000000 00000000000000000000 // returns 2147483648 // Turn off the sign bit and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float64/high-word-significand-mask/README.md b/lib/node_modules/@stdlib/constants/float64/high-word-significand-mask/README.md index 5e82e671c77c..699b06d36fd1 100644 --- a/lib/node_modules/@stdlib/constants/float64/high-word-significand-mask/README.md +++ b/lib/node_modules/@stdlib/constants/float64/high-word-significand-mask/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); +const FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); ``` #### FLOAT64_HIGH_WORD_SIGNIFICAND_MASK @@ -40,7 +40,7 @@ High word mask for the significand of a [double-precision floating-point number] ```javascript // 0x000fffff = 1048575 => 0 00000000000 11111111111111111111 -var bool = ( FLOAT64_HIGH_WORD_SIGNIFICAND_MASK === 0x000fffff ); +const bool = ( FLOAT64_HIGH_WORD_SIGNIFICAND_MASK === 0x000fffff ); // returns true ``` @@ -67,15 +67,15 @@ var bool = ( FLOAT64_HIGH_WORD_SIGNIFICAND_MASK === 0x000fffff ); ```javascript -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); -var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); +const FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); -var x = 11.5; -var hi = getHighWord( x ); // 0 10000000010 01110000000000000000 +const x = 11.5; +const hi = getHighWord( x ); // 0 10000000010 01110000000000000000 // returns 1076297728 // Mask off all bits except for the significand bits: -var out = hi & FLOAT64_HIGH_WORD_SIGNIFICAND_MASK; // 0 00000000000 01110000000000000000 +let out = hi & FLOAT64_HIGH_WORD_SIGNIFICAND_MASK; // 0 00000000000 01110000000000000000 // returns 458752 // Mask on the significand bits and leave other bits unchanged: diff --git a/lib/node_modules/@stdlib/constants/float64/ln-half/README.md b/lib/node_modules/@stdlib/constants/float64/ln-half/README.md index 54c85a7b7919..07532f36717c 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-half/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-half/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN_HALF = require( '@stdlib/constants/float64/ln-half' ); +const LN_HALF = require( '@stdlib/constants/float64/ln-half' ); ``` #### LN_HALF @@ -35,7 +35,7 @@ var LN_HALF = require( '@stdlib/constants/float64/ln-half' ); [Natural logarithm][@stdlib/math/base/special/ln] of `1/2`. ```javascript -var bool = ( LN_HALF === -0.6931471805599453 ); +const bool = ( LN_HALF === -0.6931471805599453 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN_HALF === -0.6931471805599453 ); ```javascript -var LN_HALF = require( '@stdlib/constants/float64/ln-half' ); +const LN_HALF = require( '@stdlib/constants/float64/ln-half' ); console.log( LN_HALF ); // => -0.6931471805599453 diff --git a/lib/node_modules/@stdlib/constants/float64/ln-pi/README.md b/lib/node_modules/@stdlib/constants/float64/ln-pi/README.md index 481d4223aadd..6f5173b5ae09 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN_PI = require( '@stdlib/constants/float64/ln-pi' ); +const LN_PI = require( '@stdlib/constants/float64/ln-pi' ); ``` #### LN_PI @@ -35,7 +35,7 @@ var LN_PI = require( '@stdlib/constants/float64/ln-pi' ); Natural logarithm of the mathematical constant [π][pi]. ```javascript -var bool = ( LN_PI === 1.1447298858494002 ); +const bool = ( LN_PI === 1.1447298858494002 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN_PI === 1.1447298858494002 ); ```javascript -var LN_PI = require( '@stdlib/constants/float64/ln-pi' ); +const LN_PI = require( '@stdlib/constants/float64/ln-pi' ); console.log( LN_PI ); // => 1.1447298858494002 diff --git a/lib/node_modules/@stdlib/constants/float64/ln-sqrt-two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/ln-sqrt-two-pi/README.md index e7460c151458..3f7fec68835a 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-sqrt-two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-sqrt-two-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' ); +const LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' ); ``` #### LN_SQRT_TWO_PI @@ -35,7 +35,7 @@ var LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' ); [Natural logarithm][@stdlib/math/base/special/ln] of the [square root][@stdlib/math/base/special/sqrt] of [2π][@stdlib/constants/float64/pi]. ```javascript -var bool = ( LN_SQRT_TWO_PI === 0.9189385332046728 ); +const bool = ( LN_SQRT_TWO_PI === 0.9189385332046728 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN_SQRT_TWO_PI === 0.9189385332046728 ); ```javascript -var LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' ); +const LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' ); console.log( LN_SQRT_TWO_PI ); // => 0.9189385332046728 diff --git a/lib/node_modules/@stdlib/constants/float64/ln-ten/README.md b/lib/node_modules/@stdlib/constants/float64/ln-ten/README.md index 4d7663612e9d..d1ffbcc8244b 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-ten/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-ten/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN10 = require( '@stdlib/constants/float64/ln-ten' ); +const LN10 = require( '@stdlib/constants/float64/ln-ten' ); ``` #### LN10 @@ -35,7 +35,7 @@ var LN10 = require( '@stdlib/constants/float64/ln-ten' ); [Natural logarithm][@stdlib/math/base/special/ln] of `10`. ```javascript -var bool = ( LN10 === 2.302585092994046 ); +const bool = ( LN10 === 2.302585092994046 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN10 === 2.302585092994046 ); ```javascript -var LN10 = require( '@stdlib/constants/float64/ln-ten' ); +const LN10 = require( '@stdlib/constants/float64/ln-ten' ); console.log( LN10 ); // => 2.302585092994046 diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/README.md index 017dec7c7cb1..877392285f28 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-two-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN_TWO_PI = require( '@stdlib/constants/float64/ln-two-pi' ); +const LN_TWO_PI = require( '@stdlib/constants/float64/ln-two-pi' ); ``` #### LN_TWO_PI @@ -35,7 +35,7 @@ var LN_TWO_PI = require( '@stdlib/constants/float64/ln-two-pi' ); [Natural logarithm][@stdlib/math/base/special/ln] of `2π`. ```javascript -var bool = ( LN_TWO_PI === 1.8378770664093456 ); +const bool = ( LN_TWO_PI === 1.8378770664093456 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN_TWO_PI === 1.8378770664093456 ); ```javascript -var LN_TWO_PI = require( '@stdlib/constants/float64/ln-two-pi' ); +const LN_TWO_PI = require( '@stdlib/constants/float64/ln-two-pi' ); console.log( LN_TWO_PI ); // => 1.8378770664093456 diff --git a/lib/node_modules/@stdlib/constants/float64/ln-two/README.md b/lib/node_modules/@stdlib/constants/float64/ln-two/README.md index 280df9c96d7f..f4c1cd3c2dfa 100644 --- a/lib/node_modules/@stdlib/constants/float64/ln-two/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ln-two/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LN2 = require( '@stdlib/constants/float64/ln-two' ); +const LN2 = require( '@stdlib/constants/float64/ln-two' ); ``` #### LN2 @@ -35,7 +35,7 @@ var LN2 = require( '@stdlib/constants/float64/ln-two' ); [Natural logarithm][@stdlib/math/base/special/ln] of `2`. ```javascript -var bool = ( LN2 === 0.6931471805599453 ); +const bool = ( LN2 === 0.6931471805599453 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LN2 === 0.6931471805599453 ); ```javascript -var LN2 = require( '@stdlib/constants/float64/ln-two' ); +const LN2 = require( '@stdlib/constants/float64/ln-two' ); console.log( LN2 ); // => 0.6931471805599453 diff --git a/lib/node_modules/@stdlib/constants/float64/log10-e/README.md b/lib/node_modules/@stdlib/constants/float64/log10-e/README.md index 26c663a406eb..a6f7cbdf68b6 100644 --- a/lib/node_modules/@stdlib/constants/float64/log10-e/README.md +++ b/lib/node_modules/@stdlib/constants/float64/log10-e/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LOG10E = require( '@stdlib/constants/float64/log10-e' ); +const LOG10E = require( '@stdlib/constants/float64/log10-e' ); ``` #### LOG10E @@ -35,7 +35,7 @@ var LOG10E = require( '@stdlib/constants/float64/log10-e' ); Base 10 logarithm of the mathematical constant [_e_][eulers-number]. ```javascript -var bool = ( LOG10E === 0.4342944819032518 ); +const bool = ( LOG10E === 0.4342944819032518 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LOG10E === 0.4342944819032518 ); ```javascript -var LOG10E = require( '@stdlib/constants/float64/log10-e' ); +const LOG10E = require( '@stdlib/constants/float64/log10-e' ); console.log( LOG10E ); // => 0.4342944819032518 diff --git a/lib/node_modules/@stdlib/constants/float64/log2-e/README.md b/lib/node_modules/@stdlib/constants/float64/log2-e/README.md index 5c318933d043..9bbb23b80421 100644 --- a/lib/node_modules/@stdlib/constants/float64/log2-e/README.md +++ b/lib/node_modules/@stdlib/constants/float64/log2-e/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LOG2E = require( '@stdlib/constants/float64/log2-e' ); +const LOG2E = require( '@stdlib/constants/float64/log2-e' ); ``` #### LOG2E @@ -35,7 +35,7 @@ var LOG2E = require( '@stdlib/constants/float64/log2-e' ); Base 2 logarithm of the mathematical constant [_e_][eulers-number]. ```javascript -var bool = ( LOG2E === 1.4426950408889634 ); +const bool = ( LOG2E === 1.4426950408889634 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( LOG2E === 1.4426950408889634 ); ```javascript -var LOG2E = require( '@stdlib/constants/float64/log2-e' ); +const LOG2E = require( '@stdlib/constants/float64/log2-e' ); console.log( LOG2E ); // => 1.4426950408889634 diff --git a/lib/node_modules/@stdlib/constants/float64/max-base10-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float64/max-base10-exponent-subnormal/README.md index 72d31fbbf52e..f7affb1dbca5 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-base10-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-base10-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base10-exponent-subnormal' ); +const FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base10-exponent-subnormal' ); ``` #### FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The maximum base 10 exponent for a subnormal [double-precision floating-point nu ```javascript -var bool = ( FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL === -308 ); +const bool = ( FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL === -308 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL === -308 ); ```javascript -var FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base10-exponent-subnormal' ); +const FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base10-exponent-subnormal' ); console.log( FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL ); // => -308 diff --git a/lib/node_modules/@stdlib/constants/float64/max-base10-exponent/README.md b/lib/node_modules/@stdlib/constants/float64/max-base10-exponent/README.md index 4e0f4cd7cbc9..28ca40462f61 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-base10-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-base10-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_BASE10_EXPONENT = require( '@stdlib/constants/float64/max-base10-exponent' ); +const FLOAT64_MAX_BASE10_EXPONENT = require( '@stdlib/constants/float64/max-base10-exponent' ); ``` #### FLOAT64_MAX_BASE10_EXPONENT @@ -39,7 +39,7 @@ The maximum base 10 exponent for a [double-precision floating-point number][ieee ```javascript -var bool = ( FLOAT64_MAX_BASE10_EXPONENT === 308 ); +const bool = ( FLOAT64_MAX_BASE10_EXPONENT === 308 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MAX_BASE10_EXPONENT === 308 ); ```javascript -var FLOAT64_MAX_BASE10_EXPONENT = require( '@stdlib/constants/float64/max-base10-exponent' ); +const FLOAT64_MAX_BASE10_EXPONENT = require( '@stdlib/constants/float64/max-base10-exponent' ); console.log( FLOAT64_MAX_BASE10_EXPONENT ); // => 308 diff --git a/lib/node_modules/@stdlib/constants/float64/max-base2-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float64/max-base2-exponent-subnormal/README.md index 055fc3abb96e..65d64f1fcf56 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-base2-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-base2-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' ); +const FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' ); ``` #### FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The maximum biased base 2 exponent for a subnormal [double-precision floating-po ```javascript -var bool = ( FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL === -1023 ); +const bool = ( FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL === -1023 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL === -1023 ); ```javascript -var FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' ); +const FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' ); console.log( FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL ); // => -1023 diff --git a/lib/node_modules/@stdlib/constants/float64/max-base2-exponent/README.md b/lib/node_modules/@stdlib/constants/float64/max-base2-exponent/README.md index de9908348fd1..d319bd1ab6dc 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-base2-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-base2-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' ); +const FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' ); ``` #### FLOAT64_MAX_BASE2_EXPONENT @@ -39,7 +39,7 @@ The maximum biased base 2 exponent for a [double-precision floating-point number ```javascript -var bool = ( FLOAT64_MAX_BASE2_EXPONENT === 1023 ); +const bool = ( FLOAT64_MAX_BASE2_EXPONENT === 1023 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MAX_BASE2_EXPONENT === 1023 ); ```javascript -var FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' ); +const FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' ); console.log( FLOAT64_MAX_BASE2_EXPONENT ); // => 1023 diff --git a/lib/node_modules/@stdlib/constants/float64/max-ln/README.md b/lib/node_modules/@stdlib/constants/float64/max-ln/README.md index c3e42f2bdf93..9cda7350fdc4 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-ln/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-ln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MAX_LN = require( '@stdlib/constants/float64/max-ln' ); +const FLOAT64_MAX_LN = require( '@stdlib/constants/float64/max-ln' ); ``` #### FLOAT64_MAX_LN @@ -35,7 +35,7 @@ var FLOAT64_MAX_LN = require( '@stdlib/constants/float64/max-ln' ); [Natural logarithm][natural-logarithm] of the maximum [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_MAX_LN === 709.782712893384 ); +const bool = ( FLOAT64_MAX_LN === 709.782712893384 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_MAX_LN === 709.782712893384 ); ```javascript -var FLOAT64_MAX_LN = require( '@stdlib/constants/float64/max-ln' ); +const FLOAT64_MAX_LN = require( '@stdlib/constants/float64/max-ln' ); console.log( FLOAT64_MAX_LN ); // => 709.782712893384 diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-fibonacci/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-fibonacci/README.md index 896a63b89b4b..52519318a6b3 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-fibonacci/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-fibonacci/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float64/max-safe-fibonacci' ); +const FLOAT64_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float64/max-safe-fibonacci' ); ``` #### FLOAT64_MAX_SAFE_FIBONACCI @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] [Fibonacci number][fibonacci-number] when stor ```javascript -var bool = ( FLOAT64_MAX_SAFE_FIBONACCI === 8944394323791464 ); +const bool = ( FLOAT64_MAX_SAFE_FIBONACCI === 8944394323791464 ); // returns true ``` @@ -56,29 +56,21 @@ var bool = ( FLOAT64_MAX_SAFE_FIBONACCI === 8944394323791464 ); ```javascript -var FLOAT64_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float64/max-safe-fibonacci' ); - -var v; -var i; +const FLOAT64_MAX_SAFE_FIBONACCI = require( '@stdlib/constants/float64/max-safe-fibonacci' ); function fibonacci( n ) { - var a; - var b; - var c; - var i; - - a = 1; - b = 1; - for ( i = 3; i <= n; i++ ) { - c = a + b; + let a = 1; + let b = 1; + for ( i = 0; i <= n; i++ ) { + const c = a + b; a = b; b = c; } return b; } -for ( i = 0; i < 100; i++ ) { - v = fibonacci( i ); +for ( let i = 0; i < 100; i++ ) { + const v = fibonacci( i ); if ( v > FLOAT64_MAX_SAFE_FIBONACCI ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-integer/README.md index a640d228f5d1..b43d22295f21 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); +const FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); ``` #### FLOAT64_MAX_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-inte The maximum [safe][safe-integers] [double-precision floating-point][ieee754] integer. ```javascript -var bool = ( FLOAT64_MAX_SAFE_INTEGER === 9007199254740991 ); +const bool = ( FLOAT64_MAX_SAFE_INTEGER === 9007199254740991 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT64_MAX_SAFE_INTEGER === 9007199254740991 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); - -var max; -var x; -var i; - -max = pow( 2.0, 55 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * max ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); + +const max = pow( 2.0, 55 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * max ); if ( x > FLOAT64_MAX_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-lucas/README.md index 0b5e265595df..3de30e8512ec 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-lucas/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MAX_SAFE_LUCAS = require( '@stdlib/constants/float64/max-safe-lucas' ); +const FLOAT64_MAX_SAFE_LUCAS = require( '@stdlib/constants/float64/max-safe-lucas' ); ``` #### FLOAT64_MAX_SAFE_LUCAS @@ -35,7 +35,7 @@ var FLOAT64_MAX_SAFE_LUCAS = require( '@stdlib/constants/float64/max-safe-lucas' The maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [double-precision floating-point][ieee754] format. ```javascript -var bool = ( FLOAT64_MAX_SAFE_LUCAS === 7639424778862807 ); +const bool = ( FLOAT64_MAX_SAFE_LUCAS === 7639424778862807 ); // returns true ``` @@ -50,32 +50,24 @@ var bool = ( FLOAT64_MAX_SAFE_LUCAS === 7639424778862807 ); ```javascript -var FLOAT64_MAX_SAFE_LUCAS = require( '@stdlib/constants/float64/max-safe-lucas' ); - -var v; -var i; +const FLOAT64_MAX_SAFE_LUCAS = require( '@stdlib/constants/float64/max-safe-lucas' ); function lucas( n ) { - var a; - var b; - var c; - var i; - - a = 2; + let a = 2; if ( n === 0 ) { return a; } - b = 1; - for ( i = 2; i <= n; i++ ) { - c = a + b; + let b = 1; + for ( let i = 0; i <= n; i++ ) { + const c = a + b; a = b; b = c; } return b; } -for ( i = 0; i < 100; i++ ) { - v = lucas( i ); +for ( let i = 0; i < 100; i++ ) { + const v = lucas( i ); if ( v > FLOAT64_MAX_SAFE_LUCAS ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-double-factorial/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-double-factorial/README.md index cad0305044c4..2069b429dd35 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-double-factorial/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-double-factorial/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' ); +const FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' ); ``` #### FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [double factorial][double-factorial] when ```javascript -var bool = ( FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL === 301 ); +const bool = ( FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL === 301 ); // returns true ``` @@ -56,23 +56,18 @@ var bool = ( FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL === 301 ); ```javascript -var FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' ); +const FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' ); function factorial( n ) { - var a; - var i; - - a = 1; - for ( i = n; i >= 2; i -= 2 ) { + let a = 1; + for ( let i = 0; i >= 2; i -= 2 ) { a *= i; } return a; } -var v; -var i; -for ( i = 0; i < 400; i++ ) { - v = factorial( i ); +for ( let i = 0; i < 400; i++ ) { + const v = factorial( i ); if ( i > FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-factorial/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-factorial/README.md index 196f5e7f4379..84b47be5845e 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-factorial/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-factorial/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' ); +const FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' ); ``` #### FLOAT64_MAX_SAFE_NTH_FACTORIAL @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [factorial][factorial] when stored in [dou ```javascript -var bool = ( FLOAT64_MAX_SAFE_NTH_FACTORIAL === 170 ); +const bool = ( FLOAT64_MAX_SAFE_NTH_FACTORIAL === 170 ); // returns true ``` @@ -56,21 +56,18 @@ var bool = ( FLOAT64_MAX_SAFE_NTH_FACTORIAL === 170 ); ```javascript -var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' ); +const FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-factorial' ); function factorial( n ) { - var a; - var i; - - a = 1; - for ( i = 2; i <= n; i++ ) { + let a = 1; + for ( i = 0; i <= n; i++ ) { a *= i; } return a; } -for ( i = 0; i < 200; i++ ) { - v = factorial( i ); +for ( let i = 0; i < 200; i++ ) { + const v = factorial( i ); if ( i > FLOAT64_MAX_SAFE_NTH_FACTORIAL ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-fibonacci/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-fibonacci/README.md index d91539bd3ccc..41046e21c3c2 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-fibonacci/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-fibonacci/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float64/max-safe-nth-fibonacci' ); +const FLOAT64_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float64/max-safe-nth-fibonacci' ); ``` #### FLOAT64_MAX_SAFE_NTH_FIBONACCI @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [Fibonacci number][fibonacci-number] when ```javascript -var bool = ( FLOAT64_MAX_SAFE_NTH_FIBONACCI === 78 ); +const bool = ( FLOAT64_MAX_SAFE_NTH_FIBONACCI === 78 ); // returns true ``` @@ -56,29 +56,21 @@ var bool = ( FLOAT64_MAX_SAFE_NTH_FIBONACCI === 78 ); ```javascript -var FLOAT64_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float64/max-safe-nth-fibonacci' ); - -var v; -var i; +const FLOAT64_MAX_SAFE_NTH_FIBONACCI = require( '@stdlib/constants/float64/max-safe-nth-fibonacci' ); function fibonacci( n ) { - var a; - var b; - var c; - var i; - - a = 1; - b = 1; - for ( i = 3; i <= n; i++ ) { - c = a + b; + let a = 1; + let b = 1; + for ( i = 0; i <= n; i++ ) { + const c = a + b; a = b; b = c; } return b; } -for ( i = 0; i < 100; i++ ) { - v = fibonacci( i ); +for ( let i = 0; i < 100; i++ ) { + const v = fibonacci( i ); if ( i > FLOAT64_MAX_SAFE_NTH_FIBONACCI ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-lucas/README.md b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-lucas/README.md index 2b5f2f9b91d2..e363462daf99 100644 --- a/lib/node_modules/@stdlib/constants/float64/max-safe-nth-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max-safe-nth-lucas/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MAX_SAFE_NTH_LUCAS = require( '@stdlib/constants/float64/max-safe-nth-lucas' ); +const FLOAT64_MAX_SAFE_NTH_LUCAS = require( '@stdlib/constants/float64/max-safe-nth-lucas' ); ``` #### FLOAT64_MAX_SAFE_NTH_LUCAS @@ -39,7 +39,7 @@ The maximum [safe][safe-integers] nth [Lucas number][lucas-number] when stored i ```javascript -var bool = ( FLOAT64_MAX_SAFE_NTH_LUCAS === 76 ); +const bool = ( FLOAT64_MAX_SAFE_NTH_LUCAS === 76 ); // returns true ``` @@ -56,32 +56,24 @@ var bool = ( FLOAT64_MAX_SAFE_NTH_LUCAS === 76 ); ```javascript -var FLOAT64_MAX_SAFE_NTH_LUCAS = require( '@stdlib/constants/float64/max-safe-nth-lucas' ); - -var v; -var i; +const FLOAT64_MAX_SAFE_NTH_LUCAS = require( '@stdlib/constants/float64/max-safe-nth-lucas' ); function lucas( n ) { - var a; - var b; - var c; - var i; - - a = 2; + let a = 2; if ( n === 0 ) { return a; } - b = 1; - for ( i = 2; i <= n; i++ ) { - c = a + b; + let b = 1; + for ( i = 0; i <= n; i++ ) { + const c = a + b; a = b; b = c; } return b; } -for ( i = 0; i < 100; i++ ) { - v = lucas( i ); +for ( let i = 0; i < 100; i++ ) { + const v = lucas( i ); if ( i > FLOAT64_MAX_SAFE_NTH_LUCAS ) { console.log( 'Unsafe: %d', v ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/max/README.md b/lib/node_modules/@stdlib/constants/float64/max/README.md index 6d473e20c4db..8529e9dcd4d1 100644 --- a/lib/node_modules/@stdlib/constants/float64/max/README.md +++ b/lib/node_modules/@stdlib/constants/float64/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); +const FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); ``` #### FLOAT64_MAX @@ -35,7 +35,7 @@ var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); Maximum [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_MAX === 1.7976931348623157e+308 ); +const bool = ( FLOAT64_MAX === 1.7976931348623157e+308 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_MAX === 1.7976931348623157e+308 ); ```javascript -var FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); +const FLOAT64_MAX = require( '@stdlib/constants/float64/max' ); console.log( FLOAT64_MAX ); // => 1.7976931348623157e+308 diff --git a/lib/node_modules/@stdlib/constants/float64/min-base10-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float64/min-base10-exponent-subnormal/README.md index 13857c08981b..86f8c8e675fc 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-base10-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-base10-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' ); +const FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' ); ``` #### FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The minimum base 10 exponent for a subnormal [double-precision floating-point nu ```javascript -var bool = ( FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL === -324 ); +const bool = ( FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL === -324 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL === -324 ); ```javascript -var FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' ); +const FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' ); console.log( FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL ); // => -324 diff --git a/lib/node_modules/@stdlib/constants/float64/min-base10-exponent/README.md b/lib/node_modules/@stdlib/constants/float64/min-base10-exponent/README.md index a64581984080..8f8efb2ffae3 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-base10-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-base10-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MIN_BASE10_EXPONENT = require( '@stdlib/constants/float64/min-base10-exponent' ); +const FLOAT64_MIN_BASE10_EXPONENT = require( '@stdlib/constants/float64/min-base10-exponent' ); ``` #### FLOAT64_MIN_BASE10_EXPONENT @@ -39,7 +39,7 @@ The minimum base 10 exponent for a normal [double-precision floating-point numbe ```javascript -var bool = ( FLOAT64_MIN_BASE10_EXPONENT === -308 ); +const bool = ( FLOAT64_MIN_BASE10_EXPONENT === -308 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MIN_BASE10_EXPONENT === -308 ); ```javascript -var FLOAT64_MIN_BASE10_EXPONENT = require( '@stdlib/constants/float64/min-base10-exponent' ); +const FLOAT64_MIN_BASE10_EXPONENT = require( '@stdlib/constants/float64/min-base10-exponent' ); console.log( FLOAT64_MIN_BASE10_EXPONENT ); // => -308 diff --git a/lib/node_modules/@stdlib/constants/float64/min-base2-exponent-subnormal/README.md b/lib/node_modules/@stdlib/constants/float64/min-base2-exponent-subnormal/README.md index 3f438bc354be..2b02e8c04aa6 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-base2-exponent-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-base2-exponent-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' ); +const FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' ); ``` #### FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL @@ -39,7 +39,7 @@ The minimum biased base 2 exponent for a subnormal [double-precision floating-po ```javascript -var bool = ( FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL === -1074 ); +const bool = ( FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL === -1074 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL === -1074 ); ```javascript -var FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' ); +const FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' ); console.log( FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL ); // => -1074 diff --git a/lib/node_modules/@stdlib/constants/float64/min-base2-exponent/README.md b/lib/node_modules/@stdlib/constants/float64/min-base2-exponent/README.md index f735491fc9c3..97c4132d8b2b 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-base2-exponent/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-base2-exponent/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent' ); +const FLOAT64_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent' ); ``` #### FLOAT64_MIN_BASE2_EXPONENT @@ -39,7 +39,7 @@ The minimum biased base 2 exponent for a normal [double-precision floating-point ```javascript -var bool = ( FLOAT64_MIN_BASE2_EXPONENT === -1022 ); +const bool = ( FLOAT64_MIN_BASE2_EXPONENT === -1022 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_MIN_BASE2_EXPONENT === -1022 ); ```javascript -var FLOAT64_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent' ); +const FLOAT64_MIN_BASE2_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent' ); console.log( FLOAT64_MIN_BASE2_EXPONENT ); // => -1022 diff --git a/lib/node_modules/@stdlib/constants/float64/min-ln/README.md b/lib/node_modules/@stdlib/constants/float64/min-ln/README.md index 214f4d330b11..3015913aee73 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-ln/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-ln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MIN_LN = require( '@stdlib/constants/float64/min-ln' ); +const FLOAT64_MIN_LN = require( '@stdlib/constants/float64/min-ln' ); ``` #### FLOAT64_MIN_LN @@ -35,7 +35,7 @@ var FLOAT64_MIN_LN = require( '@stdlib/constants/float64/min-ln' ); [Natural logarithm][natural-logarithm] of the smallest **normalized** [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_MIN_LN === -708.3964185322641 ); +const bool = ( FLOAT64_MIN_LN === -708.3964185322641 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_MIN_LN === -708.3964185322641 ); ```javascript -var FLOAT64_MIN_LN = require( '@stdlib/constants/float64/min-ln' ); +const FLOAT64_MIN_LN = require( '@stdlib/constants/float64/min-ln' ); console.log( FLOAT64_MIN_LN ); // => -708.3964185322641 diff --git a/lib/node_modules/@stdlib/constants/float64/min-safe-integer/README.md b/lib/node_modules/@stdlib/constants/float64/min-safe-integer/README.md index 27fa7b17048a..1d458fd51885 100644 --- a/lib/node_modules/@stdlib/constants/float64/min-safe-integer/README.md +++ b/lib/node_modules/@stdlib/constants/float64/min-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-integer' ); +const FLOAT64_MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-integer' ); ``` #### FLOAT64_MIN_SAFE_INTEGER @@ -35,7 +35,7 @@ var FLOAT64_MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-inte The minimum [safe][safe-integers] [double-precision floating-point][ieee754] integer. ```javascript -var bool = ( FLOAT64_MIN_SAFE_INTEGER === -9007199254740991 ); +const bool = ( FLOAT64_MIN_SAFE_INTEGER === -9007199254740991 ); // returns true ``` @@ -50,18 +50,14 @@ var bool = ( FLOAT64_MIN_SAFE_INTEGER === -9007199254740991 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var FLOAT64_MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-integer' ); - -var min; -var x; -var i; - -min = -pow( 2.0, 55 ); -for ( i = 0; i < 100; i++ ) { - x = round( randu() * min ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const FLOAT64_MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-integer' ); + +const min = -pow( 2.0, 55 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * min ); if ( x < FLOAT64_MIN_SAFE_INTEGER ) { console.log( 'Unsafe: %d', x ); } else { diff --git a/lib/node_modules/@stdlib/constants/float64/nan/README.md b/lib/node_modules/@stdlib/constants/float64/nan/README.md index fb4aed288650..114ce920f8ac 100644 --- a/lib/node_modules/@stdlib/constants/float64/nan/README.md +++ b/lib/node_modules/@stdlib/constants/float64/nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_NAN = require( '@stdlib/constants/float64/nan' ); +const FLOAT64_NAN = require( '@stdlib/constants/float64/nan' ); ``` #### FLOAT64_NAN @@ -35,7 +35,7 @@ var FLOAT64_NAN = require( '@stdlib/constants/float64/nan' ); [Double-precision floating-point][ieee754] `NaN`. ```javascript -var bool = ( FLOAT64_NAN !== FLOAT64_NAN ); +const bool = ( FLOAT64_NAN !== FLOAT64_NAN ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_NAN !== FLOAT64_NAN ); ```javascript -var FLOAT64_NAN = require( '@stdlib/constants/float64/nan' ); +const FLOAT64_NAN = require( '@stdlib/constants/float64/nan' ); console.log( FLOAT64_NAN ); // => NaN diff --git a/lib/node_modules/@stdlib/constants/float64/ninf/README.md b/lib/node_modules/@stdlib/constants/float64/ninf/README.md index f5fa27bc67b6..aff17310dcb7 100644 --- a/lib/node_modules/@stdlib/constants/float64/ninf/README.md +++ b/lib/node_modules/@stdlib/constants/float64/ninf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' ); +const FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' ); ``` #### FLOAT64_NINF @@ -35,7 +35,7 @@ var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' ); [Double-precision floating-point][ieee754] negative infinity. ```javascript -var bool = ( FLOAT64_NINF === -Infinity ); +const bool = ( FLOAT64_NINF === -Infinity ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_NINF === -Infinity ); ```javascript -var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' ); +const FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' ); console.log( FLOAT64_NINF ); // => -Infinity diff --git a/lib/node_modules/@stdlib/constants/float64/num-bytes/README.md b/lib/node_modules/@stdlib/constants/float64/num-bytes/README.md index 8b75e034df6d..5be751bed72f 100644 --- a/lib/node_modules/@stdlib/constants/float64/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/float64/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_NUM_BYTES = require( '@stdlib/constants/float64/num-bytes' ); +const FLOAT64_NUM_BYTES = require( '@stdlib/constants/float64/num-bytes' ); ``` #### FLOAT64_NUM_BYTES @@ -35,7 +35,7 @@ var FLOAT64_NUM_BYTES = require( '@stdlib/constants/float64/num-bytes' ); Size (in bytes) of a [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_NUM_BYTES === 8 ); +const bool = ( FLOAT64_NUM_BYTES === 8 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_NUM_BYTES === 8 ); ```javascript -var FLOAT64_NUM_BYTES = require( '@stdlib/constants/float64/num-bytes' ); +const FLOAT64_NUM_BYTES = require( '@stdlib/constants/float64/num-bytes' ); console.log( FLOAT64_NUM_BYTES ); // => 8 diff --git a/lib/node_modules/@stdlib/constants/float64/num-high-word-significand-bits/README.md b/lib/node_modules/@stdlib/constants/float64/num-high-word-significand-bits/README.md index 34464e453068..5e513c741d31 100644 --- a/lib/node_modules/@stdlib/constants/float64/num-high-word-significand-bits/README.md +++ b/lib/node_modules/@stdlib/constants/float64/num-high-word-significand-bits/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float64/num-high-word-significand-bits' ); +const FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float64/num-high-word-significand-bits' ); ``` #### FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS @@ -39,7 +39,7 @@ Number of significand bits in the high word of a [double-precision floating-poin ```javascript -var bool = ( FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS === 20 ); +const bool = ( FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS === 20 ); // returns true ``` @@ -56,7 +56,7 @@ var bool = ( FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS === 20 ); ```javascript -var FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float64/num-high-word-significand-bits' ); +const FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float64/num-high-word-significand-bits' ); console.log( FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS ); // => 20 diff --git a/lib/node_modules/@stdlib/constants/float64/phi/README.md b/lib/node_modules/@stdlib/constants/float64/phi/README.md index 2b4c900da18e..20e8e394f70b 100644 --- a/lib/node_modules/@stdlib/constants/float64/phi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/phi/README.md @@ -48,7 +48,7 @@ The [golden ratio][phi] can be defined algebraically as ## Usage ```javascript -var PHI = require( '@stdlib/constants/float64/phi' ); +const PHI = require( '@stdlib/constants/float64/phi' ); ``` #### PHI @@ -56,7 +56,7 @@ var PHI = require( '@stdlib/constants/float64/phi' ); The [golden ratio][phi-value]. ```javascript -var bool = ( PHI === 1.618033988749895 ); +const bool = ( PHI === 1.618033988749895 ); // returns true ``` @@ -73,7 +73,7 @@ var bool = ( PHI === 1.618033988749895 ); ```javascript -var PHI = require( '@stdlib/constants/float64/phi' ); +const PHI = require( '@stdlib/constants/float64/phi' ); console.log( PHI ); // => 1.618033988749895 diff --git a/lib/node_modules/@stdlib/constants/float64/pi-squared/README.md b/lib/node_modules/@stdlib/constants/float64/pi-squared/README.md index aa3284e528b9..25911e2a591c 100644 --- a/lib/node_modules/@stdlib/constants/float64/pi-squared/README.md +++ b/lib/node_modules/@stdlib/constants/float64/pi-squared/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PI_SQUARED = require( '@stdlib/constants/float64/pi-squared' ); +const PI_SQUARED = require( '@stdlib/constants/float64/pi-squared' ); ``` #### PI_SQUARED @@ -35,7 +35,7 @@ var PI_SQUARED = require( '@stdlib/constants/float64/pi-squared' ); Square of the mathematical constant [π][@stdlib/constants/float64/pi]. ```javascript -var bool = ( PI_SQUARED === 9.869604401089358 ); +const bool = ( PI_SQUARED === 9.869604401089358 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( PI_SQUARED === 9.869604401089358 ); ```javascript -var PI_SQUARED = require( '@stdlib/constants/float64/pi-squared' ); +const PI_SQUARED = require( '@stdlib/constants/float64/pi-squared' ); console.log( PI_SQUARED ); // => 9.869604401089358 diff --git a/lib/node_modules/@stdlib/constants/float64/pi/README.md b/lib/node_modules/@stdlib/constants/float64/pi/README.md index 6020a2b8f288..9b226202ec03 100644 --- a/lib/node_modules/@stdlib/constants/float64/pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PI = require( '@stdlib/constants/float64/pi' ); +const PI = require( '@stdlib/constants/float64/pi' ); ``` #### PI @@ -35,7 +35,7 @@ var PI = require( '@stdlib/constants/float64/pi' ); The mathematical constant [π][pi]. ```javascript -var bool = ( PI === 3.141592653589793 ); +const bool = ( PI === 3.141592653589793 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( PI === 3.141592653589793 ); ```javascript -var PI = require( '@stdlib/constants/float64/pi' ); +const PI = require( '@stdlib/constants/float64/pi' ); console.log( PI ); // => 3.141592653589793 diff --git a/lib/node_modules/@stdlib/constants/float64/pinf/README.md b/lib/node_modules/@stdlib/constants/float64/pinf/README.md index cc7dc4db3798..ee7b9fe90eec 100644 --- a/lib/node_modules/@stdlib/constants/float64/pinf/README.md +++ b/lib/node_modules/@stdlib/constants/float64/pinf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' ); +const FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' ); ``` #### FLOAT64_PINF @@ -35,7 +35,7 @@ var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' ); [Double-precision floating-point][ieee754] positive infinity. ```javascript -var bool = ( FLOAT64_PINF === Infinity ); +const bool = ( FLOAT64_PINF === Infinity ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_PINF === Infinity ); ```javascript -var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' ); +const FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' ); console.log( FLOAT64_PINF ); // => Infinity diff --git a/lib/node_modules/@stdlib/constants/float64/precision/README.md b/lib/node_modules/@stdlib/constants/float64/precision/README.md index a4def1b4b06e..7e389b22aa44 100644 --- a/lib/node_modules/@stdlib/constants/float64/precision/README.md +++ b/lib/node_modules/@stdlib/constants/float64/precision/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_PRECISION = require( '@stdlib/constants/float64/precision' ); +const FLOAT64_PRECISION = require( '@stdlib/constants/float64/precision' ); ``` #### FLOAT64_PRECISION @@ -35,7 +35,7 @@ var FLOAT64_PRECISION = require( '@stdlib/constants/float64/precision' ); Effective number of bits in the [significand][significand] of a [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_PRECISION === 53 ); // including implicit bit +const bool = ( FLOAT64_PRECISION === 53 ); // including implicit bit // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_PRECISION === 53 ); // including implicit bit ```javascript -var FLOAT64_PRECISION = require( '@stdlib/constants/float64/precision' ); +const FLOAT64_PRECISION = require( '@stdlib/constants/float64/precision' ); console.log( FLOAT64_PRECISION ); // => 53 diff --git a/lib/node_modules/@stdlib/constants/float64/smallest-normal/README.md b/lib/node_modules/@stdlib/constants/float64/smallest-normal/README.md index 295a2d0162ac..3b107e44cf7b 100644 --- a/lib/node_modules/@stdlib/constants/float64/smallest-normal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/smallest-normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' ); +const FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' ); ``` ##### FLOAT64_SMALLEST_NORMAL @@ -35,7 +35,7 @@ var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-norma Smallest positive **normalized** [double-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT64_SMALLEST_NORMAL === 2.2250738585072014e-308 ); +const bool = ( FLOAT64_SMALLEST_NORMAL === 2.2250738585072014e-308 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( FLOAT64_SMALLEST_NORMAL === 2.2250738585072014e-308 ); ```javascript -var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' ); +const FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' ); console.log( FLOAT64_SMALLEST_NORMAL ); // => 2.2250738585072014e-308 diff --git a/lib/node_modules/@stdlib/constants/float64/smallest-subnormal/README.md b/lib/node_modules/@stdlib/constants/float64/smallest-subnormal/README.md index dc961a8adf63..b0580f1f1890 100644 --- a/lib/node_modules/@stdlib/constants/float64/smallest-subnormal/README.md +++ b/lib/node_modules/@stdlib/constants/float64/smallest-subnormal/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var FLOAT64_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float64/smallest-subnormal' ); +const FLOAT64_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float64/smallest-subnormal' ); ``` ##### FLOAT64_SMALLEST_SUBNORMAL @@ -39,7 +39,7 @@ Smallest positive **denormalized** [double-precision floating-point number][ieee ```javascript -var bool = ( FLOAT64_SMALLEST_SUBNORMAL === 4.940656458412465e-324 ); +const bool = ( FLOAT64_SMALLEST_SUBNORMAL === 4.940656458412465e-324 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = ( FLOAT64_SMALLEST_SUBNORMAL === 4.940656458412465e-324 ); ```javascript -var FLOAT64_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float64/smallest-subnormal' ); +const FLOAT64_SMALLEST_SUBNORMAL = require( '@stdlib/constants/float64/smallest-subnormal' ); console.log( FLOAT64_SMALLEST_SUBNORMAL ); // => ~4.94e-324 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-eps/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-eps/README.md index 09a0523aa867..5c2477acf93c 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-eps/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_EPS = require( '@stdlib/constants/float64/sqrt-eps' ); +const SQRT_EPS = require( '@stdlib/constants/float64/sqrt-eps' ); ``` #### SQRT_EPS @@ -35,7 +35,7 @@ var SQRT_EPS = require( '@stdlib/constants/float64/sqrt-eps' ); [Square root][@stdlib/math/base/special/sqrt] of [double-precision floating-point epsilon][@stdlib/constants/float64/eps]. ```javascript -var bool = ( SQRT_EPS === 0.14901161193847656e-7 ); +const bool = ( SQRT_EPS === 0.14901161193847656e-7 ); // returns true ``` @@ -50,30 +50,22 @@ var bool = ( SQRT_EPS === 0.14901161193847656e-7 ); ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var randu = require( '@stdlib/random/base/randu' ); -var SQRT_EPS = require( '@stdlib/constants/float64/sqrt-eps' ); - -var bool; -var a; -var b; -var i; +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const randu = require( '@stdlib/random/base/randu' ); +const SQRT_EPS = require( '@stdlib/constants/float64/sqrt-eps' ); function isApprox( a, b ) { - var delta; - var tol; - - delta = abs( a - b ); - tol = SQRT_EPS * max( abs( a ), abs( b ) ); + const delta = abs( a - b ); + const tol = SQRT_EPS * max( abs( a ), abs( b ) ); return ( delta <= tol ); } -for ( i = 0; i < 100; i++ ) { - a = randu() * 10.0; - b = a + (randu()*5.0e-7) - 2.5e-7; - bool = isApprox( a, b ); +for ( let i = 0; i < 100; i++ ) { + const a = randu() * 10.0; + const b = a + (randu()*5.0e-7) - 2.5e-7; + const bool = isApprox( a, b ); console.log( '%d %s approximately equal to %d. Delta: %d.', a, ( bool ) ? 'is' : 'is not', b, abs( a - b ) ); } ``` diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-half-pi/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-half-pi/README.md index 906aa935ac27..5f5df59b1073 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-half-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-half-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_HALF_PI = require( '@stdlib/constants/float64/sqrt-half-pi' ); +const SQRT_HALF_PI = require( '@stdlib/constants/float64/sqrt-half-pi' ); ``` #### SQRT_HALF_PI @@ -35,7 +35,7 @@ var SQRT_HALF_PI = require( '@stdlib/constants/float64/sqrt-half-pi' ); Square root of the mathematical constant [π][@stdlib/constants/float64/pi] divided by `2`. ```javascript -var bool = ( SQRT_HALF_PI === 1.2533141373155003 ); +const bool = ( SQRT_HALF_PI === 1.2533141373155003 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT_HALF_PI === 1.2533141373155003 ); ```javascript -var SQRT_HALF_PI = require( '@stdlib/constants/float64/sqrt-half-pi' ); +const SQRT_HALF_PI = require( '@stdlib/constants/float64/sqrt-half-pi' ); console.log( SQRT_HALF_PI ); // => 1.2533141373155003 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-half/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-half/README.md index 003e724f643d..7700f8eac1e0 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-half/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-half/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_HALF = require( '@stdlib/constants/float64/sqrt-half' ); +const SQRT_HALF = require( '@stdlib/constants/float64/sqrt-half' ); ``` #### SQRT_HALF @@ -35,7 +35,7 @@ var SQRT_HALF = require( '@stdlib/constants/float64/sqrt-half' ); [Square root][@stdlib/math/base/special/sqrt] of `1/2`. ```javascript -var bool = ( SQRT_HALF === 0.7071067811865476 ); +const bool = ( SQRT_HALF === 0.7071067811865476 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT_HALF === 0.7071067811865476 ); ```javascript -var SQRT_HALF = require( '@stdlib/constants/float64/sqrt-half' ); +const SQRT_HALF = require( '@stdlib/constants/float64/sqrt-half' ); console.log( SQRT_HALF ); // => 0.7071067811865476 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-phi/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-phi/README.md index eadb521f9bb2..fbcc3a59e462 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-phi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-phi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_PHI = require( '@stdlib/constants/float64/sqrt-phi' ); +const SQRT_PHI = require( '@stdlib/constants/float64/sqrt-phi' ); ``` #### SQRT_PHI @@ -35,7 +35,7 @@ var SQRT_PHI = require( '@stdlib/constants/float64/sqrt-phi' ); Square root of the [golden ratio][@stdlib/constants/float64/phi]. ```javascript -var bool = ( SQRT_PHI === 1.272019649514069 ); +const bool = ( SQRT_PHI === 1.272019649514069 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT_PHI === 1.272019649514069 ); ```javascript -var SQRT_PHI = require( '@stdlib/constants/float64/sqrt-phi' ); +const SQRT_PHI = require( '@stdlib/constants/float64/sqrt-phi' ); console.log( SQRT_PHI ); // => 1.272019649514069 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-pi/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-pi/README.md index d6c2e094c7b2..f1c0c294cb47 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_PI = require( '@stdlib/constants/float64/sqrt-pi' ); +const SQRT_PI = require( '@stdlib/constants/float64/sqrt-pi' ); ``` #### SQRT_PI @@ -35,7 +35,7 @@ var SQRT_PI = require( '@stdlib/constants/float64/sqrt-pi' ); Square root of the mathematical constant [π][@stdlib/constants/float64/pi]. ```javascript -var bool = ( SQRT_PI === 1.7724538509055160 ); +const bool = ( SQRT_PI === 1.7724538509055160 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT_PI === 1.7724538509055160 ); ```javascript -var SQRT_PI = require( '@stdlib/constants/float64/sqrt-pi' ); +const SQRT_PI = require( '@stdlib/constants/float64/sqrt-pi' ); console.log( SQRT_PI ); // => 1.7724538509055160 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-three/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-three/README.md index 7f89be1429af..1a3a1d5f0677 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-three/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-three/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT3 = require( '@stdlib/constants/float64/sqrt-three' ); +const SQRT3 = require( '@stdlib/constants/float64/sqrt-three' ); ``` #### SQRT3 @@ -35,7 +35,7 @@ var SQRT3 = require( '@stdlib/constants/float64/sqrt-three' ); [Square root][@stdlib/math/base/special/sqrt] of `3`. ```javascript -var bool = ( SQRT3 === 1.7320508075688772 ); +const bool = ( SQRT3 === 1.7320508075688772 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT3 === 1.7320508075688772 ); ```javascript -var SQRT3 = require( '@stdlib/constants/float64/sqrt-three' ); +const SQRT3 = require( '@stdlib/constants/float64/sqrt-three' ); console.log( SQRT3 ); // => 1.7320508075688772 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-two-pi/README.md index afed4d348eb1..85bce37a8a3c 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-two-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT_TWO_PI = require( '@stdlib/constants/float64/sqrt-two-pi' ); +const SQRT_TWO_PI = require( '@stdlib/constants/float64/sqrt-two-pi' ); ``` #### SQRT_TWO_PI @@ -35,7 +35,7 @@ var SQRT_TWO_PI = require( '@stdlib/constants/float64/sqrt-two-pi' ); Square root of the mathematical constant [π][@stdlib/constants/float64/pi] times `2`. ```javascript -var bool = ( SQRT_TWO_PI === 2.5066282746310007 ); +const bool = ( SQRT_TWO_PI === 2.5066282746310007 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT_TWO_PI === 2.5066282746310007 ); ```javascript -var SQRT_TWO_PI = require( '@stdlib/constants/float64/sqrt-two-pi' ); +const SQRT_TWO_PI = require( '@stdlib/constants/float64/sqrt-two-pi' ); console.log( SQRT_TWO_PI ); // => 2.5066282746310007 diff --git a/lib/node_modules/@stdlib/constants/float64/sqrt-two/README.md b/lib/node_modules/@stdlib/constants/float64/sqrt-two/README.md index 94f9bb888cc7..eeded2b72813 100644 --- a/lib/node_modules/@stdlib/constants/float64/sqrt-two/README.md +++ b/lib/node_modules/@stdlib/constants/float64/sqrt-two/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); +const SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); ``` #### SQRT2 @@ -35,7 +35,7 @@ var SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); [Square root][@stdlib/math/base/special/sqrt] of `2`. ```javascript -var bool = ( SQRT2 === 1.4142135623730951 ); +const bool = ( SQRT2 === 1.4142135623730951 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( SQRT2 === 1.4142135623730951 ); ```javascript -var SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); +const SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); console.log( SQRT2 ); // => 1.4142135623730951 diff --git a/lib/node_modules/@stdlib/constants/float64/two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/two-pi/README.md index 9357f00ab5d7..8cd957571788 100644 --- a/lib/node_modules/@stdlib/constants/float64/two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/two-pi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); ``` #### TWO_PI @@ -35,7 +35,7 @@ var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); The mathematical constant [π][@stdlib/constants/float64/pi] times `2`. ```javascript -var bool = ( TWO_PI === 6.283185307179586 ); +const bool = ( TWO_PI === 6.283185307179586 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( TWO_PI === 6.283185307179586 ); ```javascript -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); console.log( TWO_PI ); // => 6.283185307179586 diff --git a/lib/node_modules/@stdlib/constants/int16/README.md b/lib/node_modules/@stdlib/constants/int16/README.md index 6283915279d5..bcad8b7557fe 100644 --- a/lib/node_modules/@stdlib/constants/int16/README.md +++ b/lib/node_modules/@stdlib/constants/int16/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/int16' ); +const constants = require( '@stdlib/constants/int16' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/int16' ); 16-bit signed integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -64,8 +64,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/int16' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/int16' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/int16/max/README.md b/lib/node_modules/@stdlib/constants/int16/max/README.md index aadbdd201fcb..09b00e6e1fd6 100644 --- a/lib/node_modules/@stdlib/constants/int16/max/README.md +++ b/lib/node_modules/@stdlib/constants/int16/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT16_MAX = require( '@stdlib/constants/int16/max' ); +const INT16_MAX = require( '@stdlib/constants/int16/max' ); ``` #### INT16_MAX @@ -35,7 +35,7 @@ var INT16_MAX = require( '@stdlib/constants/int16/max' ); Maximum signed 16-bit integer. ```javascript -var bool = ( INT16_MAX === 32767 ); +const bool = ( INT16_MAX === 32767 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT16_MAX === 32767 ); ```javascript -var INT16_MAX = require( '@stdlib/constants/int16/max' ); +const INT16_MAX = require( '@stdlib/constants/int16/max' ); console.log( INT16_MAX ); // => 32767 diff --git a/lib/node_modules/@stdlib/constants/int16/min/README.md b/lib/node_modules/@stdlib/constants/int16/min/README.md index fa722fade1e3..ffb384c54355 100644 --- a/lib/node_modules/@stdlib/constants/int16/min/README.md +++ b/lib/node_modules/@stdlib/constants/int16/min/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT16_MIN = require( '@stdlib/constants/int16/min' ); +const INT16_MIN = require( '@stdlib/constants/int16/min' ); ``` #### INT16_MIN @@ -35,7 +35,7 @@ var INT16_MIN = require( '@stdlib/constants/int16/min' ); Minimum signed 16-bit integer. ```javascript -var bool = ( INT16_MIN === -32768 ); +const bool = ( INT16_MIN === -32768 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT16_MIN === -32768 ); ```javascript -var INT16_MIN = require( '@stdlib/constants/int16/min' ); +const INT16_MIN = require( '@stdlib/constants/int16/min' ); console.log( INT16_MIN ); // => -32768 diff --git a/lib/node_modules/@stdlib/constants/int16/num-bytes/README.md b/lib/node_modules/@stdlib/constants/int16/num-bytes/README.md index af841742324c..28847d421a41 100644 --- a/lib/node_modules/@stdlib/constants/int16/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/int16/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT16_NUM_BYTES = require( '@stdlib/constants/int16/num-bytes' ); +const INT16_NUM_BYTES = require( '@stdlib/constants/int16/num-bytes' ); ``` #### INT16_NUM_BYTES @@ -35,7 +35,7 @@ var INT16_NUM_BYTES = require( '@stdlib/constants/int16/num-bytes' ); Size (in bytes) of a 16-bit signed integer. ```javascript -var bool = ( INT16_NUM_BYTES === 2 ); +const bool = ( INT16_NUM_BYTES === 2 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT16_NUM_BYTES === 2 ); ```javascript -var INT16_NUM_BYTES = require( '@stdlib/constants/int16/num-bytes' ); +const INT16_NUM_BYTES = require( '@stdlib/constants/int16/num-bytes' ); console.log( INT16_NUM_BYTES ); // => 2 diff --git a/lib/node_modules/@stdlib/constants/int32/README.md b/lib/node_modules/@stdlib/constants/int32/README.md index 557ed96bce8b..62a2852dca47 100644 --- a/lib/node_modules/@stdlib/constants/int32/README.md +++ b/lib/node_modules/@stdlib/constants/int32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/int32' ); +const constants = require( '@stdlib/constants/int32' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/int32' ); 32-bit signed integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -64,8 +64,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/int32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/int32' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/int32/max/README.md b/lib/node_modules/@stdlib/constants/int32/max/README.md index a2a96d708717..46c019befe22 100644 --- a/lib/node_modules/@stdlib/constants/int32/max/README.md +++ b/lib/node_modules/@stdlib/constants/int32/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT32_MAX = require( '@stdlib/constants/int32/max' ); +const INT32_MAX = require( '@stdlib/constants/int32/max' ); ``` #### INT32_MAX @@ -35,7 +35,7 @@ var INT32_MAX = require( '@stdlib/constants/int32/max' ); Maximum [signed 32-bit integer][max-int32]. ```javascript -var bool = ( INT32_MAX === 2147483647 ); +const bool = ( INT32_MAX === 2147483647 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT32_MAX === 2147483647 ); ```javascript -var INT32_MAX = require( '@stdlib/constants/int32/max' ); +const INT32_MAX = require( '@stdlib/constants/int32/max' ); console.log( INT32_MAX ); // => 2147483647 diff --git a/lib/node_modules/@stdlib/constants/int32/min/README.md b/lib/node_modules/@stdlib/constants/int32/min/README.md index d4091d2444a7..451a8e259e3a 100644 --- a/lib/node_modules/@stdlib/constants/int32/min/README.md +++ b/lib/node_modules/@stdlib/constants/int32/min/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT32_MIN = require( '@stdlib/constants/int32/min' ); +const INT32_MIN = require( '@stdlib/constants/int32/min' ); ``` #### INT32_MIN @@ -35,7 +35,7 @@ var INT32_MIN = require( '@stdlib/constants/int32/min' ); Minimum signed 32-bit integer. ```javascript -var bool = ( INT32_MIN === -2147483648 ); +const bool = ( INT32_MIN === -2147483648 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT32_MIN === -2147483648 ); ```javascript -var INT32_MIN = require( '@stdlib/constants/int32/min' ); +const INT32_MIN = require( '@stdlib/constants/int32/min' ); console.log( INT32_MIN ); // => -2147483648 diff --git a/lib/node_modules/@stdlib/constants/int32/num-bytes/README.md b/lib/node_modules/@stdlib/constants/int32/num-bytes/README.md index 246454de0b3e..a08c8afe53e2 100644 --- a/lib/node_modules/@stdlib/constants/int32/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/int32/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT32_NUM_BYTES = require( '@stdlib/constants/int32/num-bytes' ); +const INT32_NUM_BYTES = require( '@stdlib/constants/int32/num-bytes' ); ``` #### INT32_NUM_BYTES @@ -35,7 +35,7 @@ var INT32_NUM_BYTES = require( '@stdlib/constants/int32/num-bytes' ); Size (in bytes) of a 32-bit signed integer. ```javascript -var bool = ( INT32_NUM_BYTES === 4 ); +const bool = ( INT32_NUM_BYTES === 4 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT32_NUM_BYTES === 4 ); ```javascript -var INT32_NUM_BYTES = require( '@stdlib/constants/int32/num-bytes' ); +const INT32_NUM_BYTES = require( '@stdlib/constants/int32/num-bytes' ); console.log( INT32_NUM_BYTES ); // => 4 diff --git a/lib/node_modules/@stdlib/constants/int8/README.md b/lib/node_modules/@stdlib/constants/int8/README.md index 164430055885..c5f4b54fd27c 100644 --- a/lib/node_modules/@stdlib/constants/int8/README.md +++ b/lib/node_modules/@stdlib/constants/int8/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/int8' ); +const constants = require( '@stdlib/constants/int8' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/int8' ); 8-bit signed integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -64,8 +64,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/int8' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/int8' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/int8/max/README.md b/lib/node_modules/@stdlib/constants/int8/max/README.md index 0b8ba940a5d4..7965a8d5ddee 100644 --- a/lib/node_modules/@stdlib/constants/int8/max/README.md +++ b/lib/node_modules/@stdlib/constants/int8/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT8_MAX = require( '@stdlib/constants/int8/max' ); +const INT8_MAX = require( '@stdlib/constants/int8/max' ); ``` #### INT8_MAX @@ -35,7 +35,7 @@ var INT8_MAX = require( '@stdlib/constants/int8/max' ); Maximum 8-bit signed integer. ```javascript -var bool = ( INT8_MAX === 127 ); +const bool = ( INT8_MAX === 127 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT8_MAX === 127 ); ```javascript -var INT8_MAX = require( '@stdlib/constants/int8/max' ); +const INT8_MAX = require( '@stdlib/constants/int8/max' ); console.log( INT8_MAX ); // => 127 diff --git a/lib/node_modules/@stdlib/constants/int8/min/README.md b/lib/node_modules/@stdlib/constants/int8/min/README.md index 80af52eead0a..3a5c387adb2a 100644 --- a/lib/node_modules/@stdlib/constants/int8/min/README.md +++ b/lib/node_modules/@stdlib/constants/int8/min/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT8_MIN = require( '@stdlib/constants/int8/min' ); +const INT8_MIN = require( '@stdlib/constants/int8/min' ); ``` #### INT8_MIN @@ -35,7 +35,7 @@ var INT8_MIN = require( '@stdlib/constants/int8/min' ); Minimum signed 8-bit integer. ```javascript -var bool = ( INT8_MIN === -128 ); +const bool = ( INT8_MIN === -128 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT8_MIN === -128 ); ```javascript -var INT8_MIN = require( '@stdlib/constants/int8/min' ); +const INT8_MIN = require( '@stdlib/constants/int8/min' ); console.log( INT8_MIN ); // => -128 diff --git a/lib/node_modules/@stdlib/constants/int8/num-bytes/README.md b/lib/node_modules/@stdlib/constants/int8/num-bytes/README.md index 25231f6c6236..9728a01f06bf 100644 --- a/lib/node_modules/@stdlib/constants/int8/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/int8/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var INT8_NUM_BYTES = require( '@stdlib/constants/int8/num-bytes' ); +const INT8_NUM_BYTES = require( '@stdlib/constants/int8/num-bytes' ); ``` #### INT8_NUM_BYTES @@ -35,7 +35,7 @@ var INT8_NUM_BYTES = require( '@stdlib/constants/int8/num-bytes' ); Size (in bytes) of an 8-bit signed integer. ```javascript -var bool = ( INT8_NUM_BYTES === 1 ); +const bool = ( INT8_NUM_BYTES === 1 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( INT8_NUM_BYTES === 1 ); ```javascript -var INT8_NUM_BYTES = require( '@stdlib/constants/int8/num-bytes' ); +const INT8_NUM_BYTES = require( '@stdlib/constants/int8/num-bytes' ); console.log( INT8_NUM_BYTES ); // => 1 diff --git a/lib/node_modules/@stdlib/constants/path/README.md b/lib/node_modules/@stdlib/constants/path/README.md index 09ba4c3b7fc3..db455dbd755f 100644 --- a/lib/node_modules/@stdlib/constants/path/README.md +++ b/lib/node_modules/@stdlib/constants/path/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/path' ); +const constants = require( '@stdlib/constants/path' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/path' ); Namespace containing path constants. ```javascript -var ns = constants; +const ns = constants; // returns {...} ``` @@ -67,8 +67,8 @@ var ns = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/path' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/path' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/path/delimiter-posix/README.md b/lib/node_modules/@stdlib/constants/path/delimiter-posix/README.md index 56898e2348f9..209149364b14 100644 --- a/lib/node_modules/@stdlib/constants/path/delimiter-posix/README.md +++ b/lib/node_modules/@stdlib/constants/path/delimiter-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_DELIMITER_POSIX = require( '@stdlib/constants/path/delimiter-posix' ); +const PATH_DELIMITER_POSIX = require( '@stdlib/constants/path/delimiter-posix' ); ``` #### PATH_DELIMITER_POSIX @@ -35,7 +35,7 @@ var PATH_DELIMITER_POSIX = require( '@stdlib/constants/path/delimiter-posix' ); POSIX path delimiter. ```javascript -var delimiter = PATH_DELIMITER_POSIX; +const delimiter = PATH_DELIMITER_POSIX; // returns ':' ``` @@ -50,10 +50,10 @@ var delimiter = PATH_DELIMITER_POSIX; ```javascript -var PATH_DELIMITER_POSIX = require( '@stdlib/constants/path/delimiter-posix' ); +const PATH_DELIMITER_POSIX = require( '@stdlib/constants/path/delimiter-posix' ); -var PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'; -var paths = PATH.split( PATH_DELIMITER_POSIX ); +const PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'; +const paths = PATH.split( PATH_DELIMITER_POSIX ); // returns ['/usr/bin','/bin','/usr/sbin','/sbin','/usr/local/bin'] ``` diff --git a/lib/node_modules/@stdlib/constants/path/delimiter-win32/README.md b/lib/node_modules/@stdlib/constants/path/delimiter-win32/README.md index 7c31589d33c6..5d04a41a68a7 100644 --- a/lib/node_modules/@stdlib/constants/path/delimiter-win32/README.md +++ b/lib/node_modules/@stdlib/constants/path/delimiter-win32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_DELIMITER_WIN32 = require( '@stdlib/constants/path/delimiter-win32' ); +const PATH_DELIMITER_WIN32 = require( '@stdlib/constants/path/delimiter-win32' ); ``` #### PATH_DELIMITER_WIN32 @@ -35,7 +35,7 @@ var PATH_DELIMITER_WIN32 = require( '@stdlib/constants/path/delimiter-win32' ); Windows path delimiter. ```javascript -var delimiter = PATH_DELIMITER_WIN32; +const delimiter = PATH_DELIMITER_WIN32; // returns ';' ``` @@ -50,10 +50,10 @@ var delimiter = PATH_DELIMITER_WIN32; ```javascript -var PATH_DELIMITER_WIN32 = require( '@stdlib/constants/path/delimiter-win32' ); +const PATH_DELIMITER_WIN32 = require( '@stdlib/constants/path/delimiter-win32' ); -var PATH = 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\'; -var paths = PATH.split( PATH_DELIMITER_WIN32 ); +const PATH = 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\'; +const paths = PATH.split( PATH_DELIMITER_WIN32 ); // returns ['C:\\Windows\\system32','C:\\Windows','C:\\Program Files\\node\\'] ``` diff --git a/lib/node_modules/@stdlib/constants/path/delimiter/README.md b/lib/node_modules/@stdlib/constants/path/delimiter/README.md index 027fe201fb6a..149a4b30a283 100644 --- a/lib/node_modules/@stdlib/constants/path/delimiter/README.md +++ b/lib/node_modules/@stdlib/constants/path/delimiter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_DELIMITER = require( '@stdlib/constants/path/delimiter' ); +const PATH_DELIMITER = require( '@stdlib/constants/path/delimiter' ); ``` #### PATH_DELIMITER @@ -35,9 +35,9 @@ var PATH_DELIMITER = require( '@stdlib/constants/path/delimiter' ); Platform-specific path delimiter. ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var bool; +let bool; if ( IS_WINDOWS ) { bool = ( PATH_DELIMITER === ';' ); // returns true @@ -58,16 +58,16 @@ if ( IS_WINDOWS ) { ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var PATH_DELIMITER = require( '@stdlib/constants/path/delimiter' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const PATH_DELIMITER = require( '@stdlib/constants/path/delimiter' ); -var PATH; +let PATH; if ( IS_WINDOWS ) { PATH = 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\'; } else { PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'; } -var paths = PATH.split( PATH_DELIMITER ); +const paths = PATH.split( PATH_DELIMITER ); console.log( paths ); // => [...] ``` diff --git a/lib/node_modules/@stdlib/constants/path/sep-posix/README.md b/lib/node_modules/@stdlib/constants/path/sep-posix/README.md index bbbe2fc35843..9ec6d8fbbcc8 100644 --- a/lib/node_modules/@stdlib/constants/path/sep-posix/README.md +++ b/lib/node_modules/@stdlib/constants/path/sep-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_SEP_POSIX = require( '@stdlib/constants/path/sep-posix' ); +const PATH_SEP_POSIX = require( '@stdlib/constants/path/sep-posix' ); ``` #### PATH_SEP_POSIX @@ -35,7 +35,7 @@ var PATH_SEP_POSIX = require( '@stdlib/constants/path/sep-posix' ); POSIX path segment separator. ```javascript -var sep = PATH_SEP_POSIX; +const sep = PATH_SEP_POSIX; // returns '/' ``` @@ -50,10 +50,10 @@ var sep = PATH_SEP_POSIX; ```javascript -var PATH_SEP_POSIX = require( '@stdlib/constants/path/sep-posix' ); +const PATH_SEP_POSIX = require( '@stdlib/constants/path/sep-posix' ); -var path = 'foo/bar/baz'; -var parts = path.split( PATH_SEP_POSIX ); +let path = 'foo/bar/baz'; +let parts = path.split( PATH_SEP_POSIX ); // returns ['foo','bar','baz'] path = 'foo\\bar\\baz'; diff --git a/lib/node_modules/@stdlib/constants/path/sep-win32/README.md b/lib/node_modules/@stdlib/constants/path/sep-win32/README.md index 870bbdb3615d..4f97eaccd7cd 100644 --- a/lib/node_modules/@stdlib/constants/path/sep-win32/README.md +++ b/lib/node_modules/@stdlib/constants/path/sep-win32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_SEP_WIN32 = require( '@stdlib/constants/path/sep-win32' ); +const PATH_SEP_WIN32 = require( '@stdlib/constants/path/sep-win32' ); ``` #### PATH_SEP_WIN32 @@ -35,7 +35,7 @@ var PATH_SEP_WIN32 = require( '@stdlib/constants/path/sep-win32' ); Windows path segment separator. ```javascript -var sep = PATH_SEP_WIN32; +const sep = PATH_SEP_WIN32; // returns '\\' ``` @@ -50,10 +50,10 @@ var sep = PATH_SEP_WIN32; ```javascript -var PATH_SEP_WIN32 = require( '@stdlib/constants/path/sep-win32' ); +const PATH_SEP_WIN32 = require( '@stdlib/constants/path/sep-win32' ); -var path = 'foo\\bar\\baz'; -var parts = path.split( PATH_SEP_WIN32 ); +let path = 'foo\\bar\\baz'; +let parts = path.split( PATH_SEP_WIN32 ); // returns ['foo','bar','baz'] path = 'foo/bar/baz'; diff --git a/lib/node_modules/@stdlib/constants/path/sep/README.md b/lib/node_modules/@stdlib/constants/path/sep/README.md index b8839595f38a..7c8d998a5f3d 100644 --- a/lib/node_modules/@stdlib/constants/path/sep/README.md +++ b/lib/node_modules/@stdlib/constants/path/sep/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PATH_SEP = require( '@stdlib/constants/path/sep' ); +const PATH_SEP = require( '@stdlib/constants/path/sep' ); ``` #### PATH_SEP @@ -35,9 +35,9 @@ var PATH_SEP = require( '@stdlib/constants/path/sep' ); Platform-specific path segment separator. ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var bool; +let bool; if ( IS_WINDOWS ) { bool = ( PATH_SEP === '\\' ); // returns true @@ -58,16 +58,16 @@ if ( IS_WINDOWS ) { ```javascript -var IS_WINDOWS = require( '@stdlib/assert/is-windows' ); -var PATH_SEP = require( '@stdlib/constants/path/sep' ); +const IS_WINDOWS = require( '@stdlib/assert/is-windows' ); +const PATH_SEP = require( '@stdlib/constants/path/sep' ); -var path; +let path; if ( IS_WINDOWS ) { path = 'foo\\bar\\baz'; } else { path = 'foo/bar/baz'; } -var parts = path.split( PATH_SEP ); +const parts = path.split( PATH_SEP ); console.log( parts ); // => ['foo','bar','baz'] ``` diff --git a/lib/node_modules/@stdlib/constants/time/README.md b/lib/node_modules/@stdlib/constants/time/README.md index 44ddfee46af1..a098d4e33fca 100644 --- a/lib/node_modules/@stdlib/constants/time/README.md +++ b/lib/node_modules/@stdlib/constants/time/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/time' ); +const constants = require( '@stdlib/constants/time' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/time' ); Time constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -76,8 +76,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/time' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/time' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/time/hours-in-day/README.md b/lib/node_modules/@stdlib/constants/time/hours-in-day/README.md index 86b650317bab..07dff260d341 100644 --- a/lib/node_modules/@stdlib/constants/time/hours-in-day/README.md +++ b/lib/node_modules/@stdlib/constants/time/hours-in-day/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); +const HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); ``` #### HOURS_IN_DAY @@ -35,7 +35,7 @@ var HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); Number of hours in a day. ```javascript -var bool = ( HOURS_IN_DAY === 24 ); +const bool = ( HOURS_IN_DAY === 24 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( HOURS_IN_DAY === 24 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); - -var hrs; -var d; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); function days2hours( days ) { return days * HOURS_IN_DAY; } -for ( i = 0; i < 10; i++ ) { - d = roundn( randu()*20.0, -2 ); - hrs = days2hours( d ); +for ( let i = 0; i < 10; i++ ) { + const d = roundn( randu()*20.0, -2 ); + const hrs = days2hours( d ); console.log( '%d days => %d hours', d, hrs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/hours-in-week/README.md b/lib/node_modules/@stdlib/constants/time/hours-in-week/README.md index 2801124532ff..542359b38ce9 100644 --- a/lib/node_modules/@stdlib/constants/time/hours-in-week/README.md +++ b/lib/node_modules/@stdlib/constants/time/hours-in-week/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var HOURS_IN_WEEK = require( '@stdlib/constants/time/hours-in-week' ); +const HOURS_IN_WEEK = require( '@stdlib/constants/time/hours-in-week' ); ``` #### HOURS_IN_WEEK @@ -35,7 +35,7 @@ var HOURS_IN_WEEK = require( '@stdlib/constants/time/hours-in-week' ); Number of hours in a week. ```javascript -var bool = ( HOURS_IN_WEEK === 168 ); +const bool = ( HOURS_IN_WEEK === 168 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( HOURS_IN_WEEK === 168 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var HOURS_IN_WEEK = require( '@stdlib/constants/time/hours-in-week' ); - -var hrs; -var w; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const HOURS_IN_WEEK = require( '@stdlib/constants/time/hours-in-week' ); function wks2hours( wks ) { return wks * HOURS_IN_WEEK; } -for ( i = 0; i < 10; i++ ) { - w = roundn( randu()*20.0, -2 ); - hrs = wks2hours( w ); +for ( let i = 0; i < 10; i++ ) { + const w = roundn( randu()*20.0, -2 ); + const hrs = wks2hours( w ); console.log( '%d wks => %d hours', w, hrs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/milliseconds-in-day/README.md b/lib/node_modules/@stdlib/constants/time/milliseconds-in-day/README.md index a04f4d7a34a3..3dbb0ca8f944 100644 --- a/lib/node_modules/@stdlib/constants/time/milliseconds-in-day/README.md +++ b/lib/node_modules/@stdlib/constants/time/milliseconds-in-day/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); +const MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); ``` #### MILLISECONDS_IN_DAY @@ -35,7 +35,7 @@ var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' Number of milliseconds in a day. ```javascript -var bool = ( MILLISECONDS_IN_DAY === 86400000 ); +const bool = ( MILLISECONDS_IN_DAY === 86400000 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MILLISECONDS_IN_DAY === 86400000 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); - -var ms; -var d; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); function days2ms( days ) { return days * MILLISECONDS_IN_DAY; } -for ( i = 0; i < 10; i++ ) { - d = roundn( randu()*20.0, -2 ); - ms = days2ms( d ); +for ( let i = 0; i < 10; i++ ) { + const d = roundn( randu()*20.0, -2 ); + const ms = days2ms( d ); console.log( '%d days => %d milliseconds', d, ms ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/milliseconds-in-hour/README.md b/lib/node_modules/@stdlib/constants/time/milliseconds-in-hour/README.md index 7dd76e4f5b53..87160d4d65cf 100644 --- a/lib/node_modules/@stdlib/constants/time/milliseconds-in-hour/README.md +++ b/lib/node_modules/@stdlib/constants/time/milliseconds-in-hour/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MILLISECONDS_IN_HOUR = require( '@stdlib/constants/time/milliseconds-in-hour' ); +const MILLISECONDS_IN_HOUR = require( '@stdlib/constants/time/milliseconds-in-hour' ); ``` #### MILLISECONDS_IN_HOUR @@ -35,7 +35,7 @@ var MILLISECONDS_IN_HOUR = require( '@stdlib/constants/time/milliseconds-in-hour Number of milliseconds in an hour. ```javascript -var bool = ( MILLISECONDS_IN_HOUR === 3600000 ); +const bool = ( MILLISECONDS_IN_HOUR === 3600000 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MILLISECONDS_IN_HOUR === 3600000 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MILLISECONDS_IN_HOUR = require( '@stdlib/constants/time/milliseconds-in-hour' ); - -var ms; -var h; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MILLISECONDS_IN_HOUR = require( '@stdlib/constants/time/milliseconds-in-hour' ); function hrs2ms( hrs ) { return hrs * MILLISECONDS_IN_HOUR; } -for ( i = 0; i < 10; i++ ) { - h = roundn( randu()*20.0, -2 ); - ms = hrs2ms( h ); +for ( let i = 0; i < 10; i++ ) { + const h = roundn( randu()*20.0, -2 ); + const ms = hrs2ms( h ); console.log( '%d hours => %d milliseconds', h, ms ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/milliseconds-in-minute/README.md b/lib/node_modules/@stdlib/constants/time/milliseconds-in-minute/README.md index 66797979102b..4f9120f789c4 100644 --- a/lib/node_modules/@stdlib/constants/time/milliseconds-in-minute/README.md +++ b/lib/node_modules/@stdlib/constants/time/milliseconds-in-minute/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MILLISECONDS_IN_MINUTE = require( '@stdlib/constants/time/milliseconds-in-minute' ); +const MILLISECONDS_IN_MINUTE = require( '@stdlib/constants/time/milliseconds-in-minute' ); ``` #### MILLISECONDS_IN_MINUTE @@ -35,7 +35,7 @@ var MILLISECONDS_IN_MINUTE = require( '@stdlib/constants/time/milliseconds-in-mi Number of milliseconds in a minute. ```javascript -var bool = ( MILLISECONDS_IN_MINUTE === 60000 ); +const bool = ( MILLISECONDS_IN_MINUTE === 60000 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MILLISECONDS_IN_MINUTE === 60000 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MILLISECONDS_IN_MINUTE = require( '@stdlib/constants/time/milliseconds-in-minute' ); - -var ms; -var m; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MILLISECONDS_IN_MINUTE = require( '@stdlib/constants/time/milliseconds-in-minute' ); function mins2ms( mins ) { return mins * MILLISECONDS_IN_MINUTE; } -for ( i = 0; i < 10; i++ ) { - m = roundn( randu()*20.0, -2 ); - ms = mins2ms( m ); +for ( let i = 0; i < 10; i++ ) { + const m = roundn( randu()*20.0, -2 ); + const ms = mins2ms( m ); console.log( '%d mins => %d milliseconds', m, ms ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/milliseconds-in-second/README.md b/lib/node_modules/@stdlib/constants/time/milliseconds-in-second/README.md index 4587df18714a..21c443c7a7f5 100644 --- a/lib/node_modules/@stdlib/constants/time/milliseconds-in-second/README.md +++ b/lib/node_modules/@stdlib/constants/time/milliseconds-in-second/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MILLISECONDS_IN_SECOND = require( '@stdlib/constants/time/milliseconds-in-second' ); +const MILLISECONDS_IN_SECOND = require( '@stdlib/constants/time/milliseconds-in-second' ); ``` #### MILLISECONDS_IN_SECOND @@ -35,7 +35,7 @@ var MILLISECONDS_IN_SECOND = require( '@stdlib/constants/time/milliseconds-in-se Number of milliseconds in a second. ```javascript -var bool = ( MILLISECONDS_IN_SECOND === 1000 ); +const bool = ( MILLISECONDS_IN_SECOND === 1000 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MILLISECONDS_IN_SECOND === 1000 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MILLISECONDS_IN_SECOND = require( '@stdlib/constants/time/milliseconds-in-second' ); - -var ms; -var s; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MILLISECONDS_IN_SECOND = require( '@stdlib/constants/time/milliseconds-in-second' ); function secs2ms( secs ) { return secs * MILLISECONDS_IN_SECOND; } -for ( i = 0; i < 10; i++ ) { - s = roundn( randu()*20.0, -2 ); - ms = secs2ms( s ); +for ( let i = 0; i < 10; i++ ) { + const s = roundn( randu()*20.0, -2 ); + const ms = secs2ms( s ); console.log( '%d seconds => %d milliseconds', s, ms ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/milliseconds-in-week/README.md b/lib/node_modules/@stdlib/constants/time/milliseconds-in-week/README.md index e60f7c08a247..9a4e72fb73ce 100644 --- a/lib/node_modules/@stdlib/constants/time/milliseconds-in-week/README.md +++ b/lib/node_modules/@stdlib/constants/time/milliseconds-in-week/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MILLISECONDS_IN_WEEK = require( '@stdlib/constants/time/milliseconds-in-week' ); +const MILLISECONDS_IN_WEEK = require( '@stdlib/constants/time/milliseconds-in-week' ); ``` #### MILLISECONDS_IN_WEEK @@ -35,7 +35,7 @@ var MILLISECONDS_IN_WEEK = require( '@stdlib/constants/time/milliseconds-in-week Number of milliseconds in a week. ```javascript -var bool = ( MILLISECONDS_IN_WEEK === 604800000 ); +const bool = ( MILLISECONDS_IN_WEEK === 604800000 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MILLISECONDS_IN_WEEK === 604800000 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MILLISECONDS_IN_WEEK = require( '@stdlib/constants/time/milliseconds-in-week' ); - -var ms; -var w; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MILLISECONDS_IN_WEEK = require( '@stdlib/constants/time/milliseconds-in-week' ); function wks2ms( wks ) { return wks * MILLISECONDS_IN_WEEK; } -for ( i = 0; i < 10; i++ ) { - w = roundn( randu()*20.0, -2 ); - ms = wks2ms( w ); +for ( let i = 0; i < 10; i++ ) { + const w = roundn( randu()*20.0, -2 ); + const ms = wks2ms( w ); console.log( '%d weeks => %d milliseconds', w, ms ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/minutes-in-day/README.md b/lib/node_modules/@stdlib/constants/time/minutes-in-day/README.md index a3cce9d7beef..9990671cd394 100644 --- a/lib/node_modules/@stdlib/constants/time/minutes-in-day/README.md +++ b/lib/node_modules/@stdlib/constants/time/minutes-in-day/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MINUTES_IN_DAY = require( '@stdlib/constants/time/minutes-in-day' ); +const MINUTES_IN_DAY = require( '@stdlib/constants/time/minutes-in-day' ); ``` #### MINUTES_IN_DAY @@ -35,7 +35,7 @@ var MINUTES_IN_DAY = require( '@stdlib/constants/time/minutes-in-day' ); Number of minutes in a day. ```javascript -var bool = ( MINUTES_IN_DAY === 1440 ); +const bool = ( MINUTES_IN_DAY === 1440 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MINUTES_IN_DAY === 1440 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MINUTES_IN_DAY = require( '@stdlib/constants/time/minutes-in-day' ); - -var d; -var m; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MINUTES_IN_DAY = require( '@stdlib/constants/time/minutes-in-day' ); function days2mins( days ) { return days * MINUTES_IN_DAY; } -for ( i = 0; i < 10; i++ ) { - d = roundn( randu()*20.0, -2 ); - m = days2mins( d ); +for ( let i = 0; i < 10; i++ ) { + const d = roundn( randu()*20.0, -2 ); + const m = days2mins( d ); console.log( '%d days => %d minutes', d, m ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/minutes-in-hour/README.md b/lib/node_modules/@stdlib/constants/time/minutes-in-hour/README.md index b8c274b216b5..57bb65365b8c 100644 --- a/lib/node_modules/@stdlib/constants/time/minutes-in-hour/README.md +++ b/lib/node_modules/@stdlib/constants/time/minutes-in-hour/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MINUTES_IN_HOUR = require( '@stdlib/constants/time/minutes-in-hour' ); +const MINUTES_IN_HOUR = require( '@stdlib/constants/time/minutes-in-hour' ); ``` #### MINUTES_IN_HOUR @@ -35,7 +35,7 @@ var MINUTES_IN_HOUR = require( '@stdlib/constants/time/minutes-in-hour' ); Number of minutes in an hour. ```javascript -var bool = ( MINUTES_IN_HOUR === 60 ); +const bool = ( MINUTES_IN_HOUR === 60 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MINUTES_IN_HOUR === 60 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MINUTES_IN_HOUR = require( '@stdlib/constants/time/minutes-in-hour' ); - -var h; -var m; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MINUTES_IN_HOUR = require( '@stdlib/constants/time/minutes-in-hour' ); function hrs2mins( hrs ) { return hrs * MINUTES_IN_HOUR; } -for ( i = 0; i < 10; i++ ) { - h = roundn( randu()*20.0, -2 ); - m = hrs2mins( h ); +for ( let i = 0; i < 10; i++ ) { + const h = roundn( randu()*20.0, -2 ); + const m = hrs2mins( h ); console.log( '%d hours => %d minutes', h, m ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/minutes-in-week/README.md b/lib/node_modules/@stdlib/constants/time/minutes-in-week/README.md index d6ae2b4c9f4b..af21ece34d06 100644 --- a/lib/node_modules/@stdlib/constants/time/minutes-in-week/README.md +++ b/lib/node_modules/@stdlib/constants/time/minutes-in-week/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MINUTES_IN_WEEK = require( '@stdlib/constants/time/minutes-in-week' ); +const MINUTES_IN_WEEK = require( '@stdlib/constants/time/minutes-in-week' ); ``` #### MINUTES_IN_WEEK @@ -35,7 +35,7 @@ var MINUTES_IN_WEEK = require( '@stdlib/constants/time/minutes-in-week' ); Number of minutes in a week. ```javascript -var bool = ( MINUTES_IN_WEEK === 10080 ); +const bool = ( MINUTES_IN_WEEK === 10080 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MINUTES_IN_WEEK === 10080 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MINUTES_IN_WEEK = require( '@stdlib/constants/time/minutes-in-week' ); - -var w; -var m; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MINUTES_IN_WEEK = require( '@stdlib/constants/time/minutes-in-week' ); function wks2mins( wks ) { return wks * MINUTES_IN_WEEK; } -for ( i = 0; i < 10; i++ ) { - w = roundn( randu()*20.0, -2 ); - m = wks2mins( w ); +for ( let i = 0; i < 10; i++ ) { + const w = roundn( randu()*20.0, -2 ); + const m = wks2mins( w ); console.log( '%d weeks => %d minutes', w, m ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/months-in-year/README.md b/lib/node_modules/@stdlib/constants/time/months-in-year/README.md index cd07d1f22a45..4fb7237eb163 100644 --- a/lib/node_modules/@stdlib/constants/time/months-in-year/README.md +++ b/lib/node_modules/@stdlib/constants/time/months-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var MONTHS_IN_YEAR = require( '@stdlib/constants/time/months-in-year' ); +const MONTHS_IN_YEAR = require( '@stdlib/constants/time/months-in-year' ); ``` #### MONTHS_IN_YEAR @@ -35,7 +35,7 @@ var MONTHS_IN_YEAR = require( '@stdlib/constants/time/months-in-year' ); Number of months in a year. ```javascript -var bool = ( MONTHS_IN_YEAR === 12 ); +const bool = ( MONTHS_IN_YEAR === 12 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( MONTHS_IN_YEAR === 12 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var MONTHS_IN_YEAR = require( '@stdlib/constants/time/months-in-year' ); - -var mons; -var yrs; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const MONTHS_IN_YEAR = require( '@stdlib/constants/time/months-in-year' ); function yrs2mons( yrs ) { return yrs * MONTHS_IN_YEAR; } -for ( i = 0; i < 10; i++ ) { - yrs = roundn( randu()*20.0, -2 ); - mons = yrs2mons( yrs ); +for ( let i = 0; i < 10; i++ ) { + const yrs = roundn( randu()*20.0, -2 ); + const mons = yrs2mons( yrs ); console.log( '%d years => %d months', yrs, mons ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/seconds-in-day/README.md b/lib/node_modules/@stdlib/constants/time/seconds-in-day/README.md index 70b99fdf7f44..14e05408846f 100644 --- a/lib/node_modules/@stdlib/constants/time/seconds-in-day/README.md +++ b/lib/node_modules/@stdlib/constants/time/seconds-in-day/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SECONDS_IN_DAY = require( '@stdlib/constants/time/seconds-in-day' ); +const SECONDS_IN_DAY = require( '@stdlib/constants/time/seconds-in-day' ); ``` #### SECONDS_IN_DAY @@ -35,7 +35,7 @@ var SECONDS_IN_DAY = require( '@stdlib/constants/time/seconds-in-day' ); Number of seconds in a day. ```javascript -var bool = ( SECONDS_IN_DAY === 86400 ); +const bool = ( SECONDS_IN_DAY === 86400 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( SECONDS_IN_DAY === 86400 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var SECONDS_IN_DAY = require( '@stdlib/constants/time/seconds-in-day' ); - -var days; -var secs; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const SECONDS_IN_DAY = require( '@stdlib/constants/time/seconds-in-day' ); function days2secs( days ) { return days * SECONDS_IN_DAY; } -for ( i = 0; i < 10; i++ ) { - days = roundn( randu()*20.0, -2 ); - secs = days2secs( days ); +for ( let i = 0; i < 10; i++ ) { + const days = roundn( randu()*20.0, -2 ); + const secs = days2secs( days ); console.log( '%d days => %d seconds', days, secs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/seconds-in-hour/README.md b/lib/node_modules/@stdlib/constants/time/seconds-in-hour/README.md index 595ea6cc7522..bdb78057829f 100644 --- a/lib/node_modules/@stdlib/constants/time/seconds-in-hour/README.md +++ b/lib/node_modules/@stdlib/constants/time/seconds-in-hour/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SECONDS_IN_HOUR = require( '@stdlib/constants/time/seconds-in-hour' ); +const SECONDS_IN_HOUR = require( '@stdlib/constants/time/seconds-in-hour' ); ``` #### SECONDS_IN_HOUR @@ -35,7 +35,7 @@ var SECONDS_IN_HOUR = require( '@stdlib/constants/time/seconds-in-hour' ); Number of seconds in an hour. ```javascript -var bool = ( SECONDS_IN_HOUR === 3600 ); +const bool = ( SECONDS_IN_HOUR === 3600 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( SECONDS_IN_HOUR === 3600 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var SECONDS_IN_HOUR = require( '@stdlib/constants/time/seconds-in-hour' ); - -var secs; -var hrs; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const SECONDS_IN_HOUR = require( '@stdlib/constants/time/seconds-in-hour' ); function hrs2secs( hrs ) { return hrs * SECONDS_IN_HOUR; } -for ( i = 0; i < 10; i++ ) { - hrs = roundn( randu()*20.0, -2 ); - secs = hrs2secs( hrs ); +for ( let i = 0; i < 10; i++ ) { + const hrs = roundn( randu()*20.0, -2 ); + const secs = hrs2secs( hrs ); console.log( '%d hours => %d seconds', hrs, secs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/seconds-in-minute/README.md b/lib/node_modules/@stdlib/constants/time/seconds-in-minute/README.md index ca954ddd4e46..05be1dd7194a 100644 --- a/lib/node_modules/@stdlib/constants/time/seconds-in-minute/README.md +++ b/lib/node_modules/@stdlib/constants/time/seconds-in-minute/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SECONDS_IN_MINUTE = require( '@stdlib/constants/time/seconds-in-minute' ); +const SECONDS_IN_MINUTE = require( '@stdlib/constants/time/seconds-in-minute' ); ``` #### SECONDS_IN_MINUTE @@ -35,7 +35,7 @@ var SECONDS_IN_MINUTE = require( '@stdlib/constants/time/seconds-in-minute' ); Number of seconds in a minute. ```javascript -var bool = ( SECONDS_IN_MINUTE === 60 ); +const bool = ( SECONDS_IN_MINUTE === 60 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( SECONDS_IN_MINUTE === 60 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var SECONDS_IN_MINUTE = require( '@stdlib/constants/time/seconds-in-minute' ); - -var secs; -var mins; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const SECONDS_IN_MINUTE = require( '@stdlib/constants/time/seconds-in-minute' ); function mins2secs( mins ) { return mins * SECONDS_IN_MINUTE; } -for ( i = 0; i < 10; i++ ) { - mins = roundn( randu()*20.0, -2 ); - secs = mins2secs( mins ); +for ( let i = 0; i < 10; i++ ) { + const mins = roundn( randu()*20.0, -2 ); + const secs = mins2secs( mins ); console.log( '%d minutes => %d seconds', mins, secs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/time/seconds-in-week/README.md b/lib/node_modules/@stdlib/constants/time/seconds-in-week/README.md index d0ad9862b21a..fbe42b5fe037 100644 --- a/lib/node_modules/@stdlib/constants/time/seconds-in-week/README.md +++ b/lib/node_modules/@stdlib/constants/time/seconds-in-week/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var SECONDS_IN_WEEK = require( '@stdlib/constants/time/seconds-in-week' ); +const SECONDS_IN_WEEK = require( '@stdlib/constants/time/seconds-in-week' ); ``` #### SECONDS_IN_WEEK @@ -35,7 +35,7 @@ var SECONDS_IN_WEEK = require( '@stdlib/constants/time/seconds-in-week' ); Number of seconds in a week. ```javascript -var bool = ( SECONDS_IN_WEEK === 604800 ); +const bool = ( SECONDS_IN_WEEK === 604800 ); // returns true ``` @@ -60,21 +60,17 @@ var bool = ( SECONDS_IN_WEEK === 604800 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var SECONDS_IN_WEEK = require( '@stdlib/constants/time/seconds-in-week' ); - -var secs; -var wks; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const SECONDS_IN_WEEK = require( '@stdlib/constants/time/seconds-in-week' ); function wks2secs( wks ) { return wks * SECONDS_IN_WEEK; } -for ( i = 0; i < 10; i++ ) { - wks = roundn( randu()*20.0, -2 ); - secs = wks2secs( wks ); +for ( let i = 0; i < 10; i++ ) { + const wks = roundn( randu()*20.0, -2 ); + const secs = wks2secs( wks ); console.log( '%d weeks => %d seconds', wks, secs ); } ``` diff --git a/lib/node_modules/@stdlib/constants/uint16/README.md b/lib/node_modules/@stdlib/constants/uint16/README.md index 764487681552..82f2cfba5c07 100644 --- a/lib/node_modules/@stdlib/constants/uint16/README.md +++ b/lib/node_modules/@stdlib/constants/uint16/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/uint16' ); +const constants = require( '@stdlib/constants/uint16' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/uint16' ); 16-bit unsigned integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -63,8 +63,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/uint16' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/uint16' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/uint16/max/README.md b/lib/node_modules/@stdlib/constants/uint16/max/README.md index 556558742a7f..a2ec0a476ef9 100644 --- a/lib/node_modules/@stdlib/constants/uint16/max/README.md +++ b/lib/node_modules/@stdlib/constants/uint16/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT16_MAX = require( '@stdlib/constants/uint16/max' ); +const UINT16_MAX = require( '@stdlib/constants/uint16/max' ); ``` #### UINT16_MAX @@ -35,7 +35,7 @@ var UINT16_MAX = require( '@stdlib/constants/uint16/max' ); Maximum unsigned 16-bit integer. ```javascript -var bool = ( UINT16_MAX === 65535 ); +const bool = ( UINT16_MAX === 65535 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( UINT16_MAX === 65535 ); ```javascript -var UINT16_MAX = require( '@stdlib/constants/uint16/max' ); +const UINT16_MAX = require( '@stdlib/constants/uint16/max' ); console.log( UINT16_MAX ); // => 65535 diff --git a/lib/node_modules/@stdlib/constants/uint16/num-bytes/README.md b/lib/node_modules/@stdlib/constants/uint16/num-bytes/README.md index fdd6958a08d7..efc0fe7a2325 100644 --- a/lib/node_modules/@stdlib/constants/uint16/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/uint16/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT16_NUM_BYTES = require( '@stdlib/constants/uint16/num-bytes' ); +const UINT16_NUM_BYTES = require( '@stdlib/constants/uint16/num-bytes' ); ``` #### UINT16_NUM_BYTES @@ -35,7 +35,7 @@ var UINT16_NUM_BYTES = require( '@stdlib/constants/uint16/num-bytes' ); Size (in bytes) of a 16-bit unsigned integer. ```javascript -var bool = ( UINT16_NUM_BYTES === 2 ); +const bool = ( UINT16_NUM_BYTES === 2 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( UINT16_NUM_BYTES === 2 ); ```javascript -var UINT16_NUM_BYTES = require( '@stdlib/constants/uint16/num-bytes' ); +const UINT16_NUM_BYTES = require( '@stdlib/constants/uint16/num-bytes' ); console.log( UINT16_NUM_BYTES ); // => 2 diff --git a/lib/node_modules/@stdlib/constants/uint32/README.md b/lib/node_modules/@stdlib/constants/uint32/README.md index afdec38c1a5d..2619b02ff0aa 100644 --- a/lib/node_modules/@stdlib/constants/uint32/README.md +++ b/lib/node_modules/@stdlib/constants/uint32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/uint32' ); +const constants = require( '@stdlib/constants/uint32' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/uint32' ); 32-bit unsigned integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -63,8 +63,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/uint32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/uint32' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/uint32/max/README.md b/lib/node_modules/@stdlib/constants/uint32/max/README.md index ca8f19a992b0..c295f58a221d 100644 --- a/lib/node_modules/@stdlib/constants/uint32/max/README.md +++ b/lib/node_modules/@stdlib/constants/uint32/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT32_MAX = require( '@stdlib/constants/uint32/max' ); +const UINT32_MAX = require( '@stdlib/constants/uint32/max' ); ``` #### UINT32_MAX @@ -35,7 +35,7 @@ var UINT32_MAX = require( '@stdlib/constants/uint32/max' ); Maximum unsigned 32-bit `integer`. ```javascript -var bool = ( UINT32_MAX === 4294967295 ); +const bool = ( UINT32_MAX === 4294967295 ); // returns true ``` @@ -62,7 +62,7 @@ var bool = ( UINT32_MAX === 4294967295 ); ```javascript -var UINT32_MAX = require( '@stdlib/constants/uint32/max' ); +const UINT32_MAX = require( '@stdlib/constants/uint32/max' ); console.log( UINT32_MAX ); // => 4294967295 diff --git a/lib/node_modules/@stdlib/constants/uint32/num-bytes/README.md b/lib/node_modules/@stdlib/constants/uint32/num-bytes/README.md index 28dfd16d54f5..b5d96b746fb6 100644 --- a/lib/node_modules/@stdlib/constants/uint32/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/uint32/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT32_NUM_BYTES = require( '@stdlib/constants/uint32/num-bytes' ); +const UINT32_NUM_BYTES = require( '@stdlib/constants/uint32/num-bytes' ); ``` #### UINT32_NUM_BYTES @@ -35,7 +35,7 @@ var UINT32_NUM_BYTES = require( '@stdlib/constants/uint32/num-bytes' ); Size (in bytes) of a 32-bit unsigned integer. ```javascript -var bool = ( UINT32_NUM_BYTES === 4 ); +const bool = ( UINT32_NUM_BYTES === 4 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( UINT32_NUM_BYTES === 4 ); ```javascript -var UINT32_NUM_BYTES = require( '@stdlib/constants/uint32/num-bytes' ); +const UINT32_NUM_BYTES = require( '@stdlib/constants/uint32/num-bytes' ); console.log( UINT32_NUM_BYTES ); // => 4 diff --git a/lib/node_modules/@stdlib/constants/uint8/README.md b/lib/node_modules/@stdlib/constants/uint8/README.md index f305666ad5b6..5407054be07a 100644 --- a/lib/node_modules/@stdlib/constants/uint8/README.md +++ b/lib/node_modules/@stdlib/constants/uint8/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/uint8' ); +const constants = require( '@stdlib/constants/uint8' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/uint8' ); 8-bit unsigned integer mathematical constants. ```javascript -var c = constants; +const c = constants; // returns {...} ``` @@ -63,8 +63,8 @@ var c = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/uint8' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/uint8' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/uint8/max/README.md b/lib/node_modules/@stdlib/constants/uint8/max/README.md index 3fde58750a7f..fab6af1bf37f 100644 --- a/lib/node_modules/@stdlib/constants/uint8/max/README.md +++ b/lib/node_modules/@stdlib/constants/uint8/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT8_MAX = require( '@stdlib/constants/uint8/max' ); +const UINT8_MAX = require( '@stdlib/constants/uint8/max' ); ``` #### UINT8_MAX @@ -35,7 +35,7 @@ var UINT8_MAX = require( '@stdlib/constants/uint8/max' ); Maximum unsigned 8-bit integer. ```javascript -var bool = ( UINT8_MAX === 255 ); +const bool = ( UINT8_MAX === 255 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( UINT8_MAX === 255 ); ```javascript -var UINT8_MAX = require( '@stdlib/constants/uint8/max' ); +const UINT8_MAX = require( '@stdlib/constants/uint8/max' ); console.log( UINT8_MAX ); // => 255 diff --git a/lib/node_modules/@stdlib/constants/uint8/num-bytes/README.md b/lib/node_modules/@stdlib/constants/uint8/num-bytes/README.md index 6b9b8ced0f52..2a64f01f841c 100644 --- a/lib/node_modules/@stdlib/constants/uint8/num-bytes/README.md +++ b/lib/node_modules/@stdlib/constants/uint8/num-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UINT8_NUM_BYTES = require( '@stdlib/constants/uint8/num-bytes' ); +const UINT8_NUM_BYTES = require( '@stdlib/constants/uint8/num-bytes' ); ``` #### UINT8_NUM_BYTES @@ -35,7 +35,7 @@ var UINT8_NUM_BYTES = require( '@stdlib/constants/uint8/num-bytes' ); Size (in bytes) of an 8-bit unsigned integer. ```javascript -var bool = ( UINT8_NUM_BYTES === 1 ); +const bool = ( UINT8_NUM_BYTES === 1 ); // returns true ``` @@ -52,7 +52,7 @@ var bool = ( UINT8_NUM_BYTES === 1 ); ```javascript -var UINT8_NUM_BYTES = require( '@stdlib/constants/uint8/num-bytes' ); +const UINT8_NUM_BYTES = require( '@stdlib/constants/uint8/num-bytes' ); console.log( UINT8_NUM_BYTES ); // => 1 diff --git a/lib/node_modules/@stdlib/constants/unicode/README.md b/lib/node_modules/@stdlib/constants/unicode/README.md index f13311cb1720..a634569df0bf 100644 --- a/lib/node_modules/@stdlib/constants/unicode/README.md +++ b/lib/node_modules/@stdlib/constants/unicode/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constants = require( '@stdlib/constants/unicode' ); +const constants = require( '@stdlib/constants/unicode' ); ``` #### constants @@ -35,7 +35,7 @@ var constants = require( '@stdlib/constants/unicode' ); Namespace containing Unicode constants. ```javascript -var ns = constants; +const ns = constants; // returns {...} ``` @@ -63,8 +63,8 @@ var ns = constants; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var constants = require( '@stdlib/constants/unicode' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const constants = require( '@stdlib/constants/unicode' ); console.log( objectKeys( constants ) ); ``` diff --git a/lib/node_modules/@stdlib/constants/unicode/max-bmp/README.md b/lib/node_modules/@stdlib/constants/unicode/max-bmp/README.md index 1b96934c4193..056a83bd3883 100644 --- a/lib/node_modules/@stdlib/constants/unicode/max-bmp/README.md +++ b/lib/node_modules/@stdlib/constants/unicode/max-bmp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); +const UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); ``` #### UNICODE_MAX_BMP @@ -35,7 +35,7 @@ var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); Maximum [Unicode][unicode] code point in the Basic Multilingual Plane (BMP). ```javascript -var bool = ( UNICODE_MAX_BMP === 65535 ); +const bool = ( UNICODE_MAX_BMP === 65535 ); // returns true ``` @@ -50,16 +50,13 @@ var bool = ( UNICODE_MAX_BMP === 65535 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = floor( randu() * UNICODE_MAX_BMP ); +for ( let i = 0; i < 100; i++ ) { + const x = floor( randu() * UNICODE_MAX_BMP ); console.log( fromCodePoint( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/constants/unicode/max/README.md b/lib/node_modules/@stdlib/constants/unicode/max/README.md index c7740aa8e122..8ec17e3d9931 100644 --- a/lib/node_modules/@stdlib/constants/unicode/max/README.md +++ b/lib/node_modules/@stdlib/constants/unicode/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UNICODE_MAX = require( '@stdlib/constants/unicode/max' ); +const UNICODE_MAX = require( '@stdlib/constants/unicode/max' ); ``` #### UNICODE_MAX @@ -35,7 +35,7 @@ var UNICODE_MAX = require( '@stdlib/constants/unicode/max' ); Maximum [Unicode][unicode] code point. ```javascript -var bool = ( UNICODE_MAX === 1114111 ); +const bool = ( UNICODE_MAX === 1114111 ); // returns true ``` @@ -50,16 +50,13 @@ var bool = ( UNICODE_MAX === 1114111 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var UNICODE_MAX = require( '@stdlib/constants/unicode/max' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const UNICODE_MAX = require( '@stdlib/constants/unicode/max' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = floor( randu() * UNICODE_MAX ); +for ( let i = 0; i < 100; i++ ) { + const x = floor( randu() * UNICODE_MAX ); console.log( fromCodePoint( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/README.md b/lib/node_modules/@stdlib/datasets/README.md index 82bf7ab41b5e..f504f4242002 100644 --- a/lib/node_modules/@stdlib/datasets/README.md +++ b/lib/node_modules/@stdlib/datasets/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var datasets = require( '@stdlib/datasets' ); +const datasets = require( '@stdlib/datasets' ); ``` #### datasets( name\[, options] ) @@ -35,7 +35,7 @@ var datasets = require( '@stdlib/datasets' ); Returns standard library datasets. ```javascript -var data = datasets( 'MONTH_NAMES_EN' ); +const data = datasets( 'MONTH_NAMES_EN' ); /* returns [ 'January', @@ -57,11 +57,11 @@ var data = datasets( 'MONTH_NAMES_EN' ); The function forwards provided `options` to the dataset interface specified by `name`. ```javascript -var opts = { +const opts = { 'data': 'cities' }; -var data = datasets( 'MINARD_NAPOLEONS_MARCH', opts ); +const data = datasets( 'MINARD_NAPOLEONS_MARCH', opts ); /* returns [ {'lon': 24,'lat': 55,'city': 'Kowno', @@ -101,9 +101,9 @@ var data = datasets( 'MINARD_NAPOLEONS_MARCH', opts ); ```javascript -var datasets = require( '@stdlib/datasets' ); +const datasets = require( '@stdlib/datasets' ); -var data = datasets( 'MONTH_NAMES_EN' ); +const data = datasets( 'MONTH_NAMES_EN' ); console.log( data ); ``` diff --git a/lib/node_modules/@stdlib/datasets/afinn-111/README.md b/lib/node_modules/@stdlib/datasets/afinn-111/README.md index 17bd05b81080..eff983179ad1 100644 --- a/lib/node_modules/@stdlib/datasets/afinn-111/README.md +++ b/lib/node_modules/@stdlib/datasets/afinn-111/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var afinn111 = require( '@stdlib/datasets/afinn-111' ); +const afinn111 = require( '@stdlib/datasets/afinn-111' ); ``` #### afinn111() @@ -35,7 +35,7 @@ var afinn111 = require( '@stdlib/datasets/afinn-111' ); Returns a [list][afinn] of `2477` English words (and phrases) rated for [valence][valence]. Negative words have a negative [valence][valence] (`[-5,0)`). Positive words have a positive [valence][valence] (`(0,5]`). Neutral words have a [valence][valence] of `0`. ```javascript -var words = afinn111(); +const words = afinn111(); /* returns [ ['abandon',-2], @@ -81,19 +81,14 @@ var words = afinn111(); ```javascript -var afinn111 = require( '@stdlib/datasets/afinn-111' ); +const afinn111 = require( '@stdlib/datasets/afinn-111' ); -var words; -var dict; -var len; -var i; - -words = afinn111(); +const words = afinn111(); // Convert to a dictionary... -len = words.length; -dict = {}; -for ( i = 0; i < len; i++ ) { +const len = words.length; +const dict = {}; +for ( let i = 0; i < len; i++ ) { dict[ words[i][0] ] = words[i][1]; } console.dir( dict ); diff --git a/lib/node_modules/@stdlib/datasets/afinn-96/README.md b/lib/node_modules/@stdlib/datasets/afinn-96/README.md index 1b42091852c7..727e251eb66e 100644 --- a/lib/node_modules/@stdlib/datasets/afinn-96/README.md +++ b/lib/node_modules/@stdlib/datasets/afinn-96/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var afinn96 = require( '@stdlib/datasets/afinn-96' ); +const afinn96 = require( '@stdlib/datasets/afinn-96' ); ``` #### afinn96() @@ -35,7 +35,7 @@ var afinn96 = require( '@stdlib/datasets/afinn-96' ); Returns a [list][afinn] of `1468` unique English words (and phrases) rated for [valence][valence]. Negative words have a negative [valence][valence] (`[-5,0)`). Positive words have a positive [valence][valence] (`(0,5]`). Neutral words have a [valence][valence] of `0`. ```javascript -var words = afinn96(); +const words = afinn96(); /* returns [ ['abandon',-2], @@ -83,19 +83,14 @@ var words = afinn96(); ```javascript -var afinn96 = require( '@stdlib/datasets/afinn-96' ); +const afinn96 = require( '@stdlib/datasets/afinn-96' ); -var words; -var dict; -var len; -var i; - -words = afinn96(); +const words = afinn96(); // Convert to a dictionary... -len = words.length; -dict = {}; -for ( i = 0; i < len; i++ ) { +const len = words.length; +const dict = {}; +for ( let i = 0; i < len; i++ ) { dict[ words[i][0] ] = words[i][1]; } console.dir( dict ); diff --git a/lib/node_modules/@stdlib/datasets/anscombes-quartet/README.md b/lib/node_modules/@stdlib/datasets/anscombes-quartet/README.md index 7386c3065cb4..a558ff0d5f77 100644 --- a/lib/node_modules/@stdlib/datasets/anscombes-quartet/README.md +++ b/lib/node_modules/@stdlib/datasets/anscombes-quartet/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var data = require( '@stdlib/datasets/anscombes-quartet' ); +const data = require( '@stdlib/datasets/anscombes-quartet' ); ``` #### data() @@ -43,7 +43,7 @@ var data = require( '@stdlib/datasets/anscombes-quartet' ); Returns [Anscombe's quartet][anscombes-quartet], which is comprised of `4` individual datasets, where each individual dataset is an `array` of `[x,y]` tuples. ```javascript -var d = data(); +const d = data(); /* returns [ [ @@ -115,7 +115,7 @@ var d = data(); ```javascript -var data = require( '@stdlib/datasets/anscombes-quartet' ); +const data = require( '@stdlib/datasets/anscombes-quartet' ); console.log( data() ); ``` diff --git a/lib/node_modules/@stdlib/datasets/berndt-cps-wages-1985/README.md b/lib/node_modules/@stdlib/datasets/berndt-cps-wages-1985/README.md index 6c3037411a62..605cda39a517 100644 --- a/lib/node_modules/@stdlib/datasets/berndt-cps-wages-1985/README.md +++ b/lib/node_modules/@stdlib/datasets/berndt-cps-wages-1985/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cps = require( '@stdlib/datasets/berndt-cps-wages-1985' ); +const cps = require( '@stdlib/datasets/berndt-cps-wages-1985' ); ``` #### cps() @@ -41,7 +41,7 @@ var cps = require( '@stdlib/datasets/berndt-cps-wages-1985' ); Returns a random sample of 534 workers from the Current Population Survey (CPS) from 1985, including their wages and and other characteristics. ```javascript -var data = cps(); +const data = cps(); // returns [{...},{...},...] ``` @@ -80,35 +80,28 @@ Each `array` element has the following eleven fields: ```javascript -var Plot = require( '@stdlib/plot' ); -var dataset = require( '@stdlib/datasets/berndt-cps-wages-1985' ); +const Plot = require( '@stdlib/plot' ); +const dataset = require( '@stdlib/datasets/berndt-cps-wages-1985' ); -var data; -var plot; -var opts; -var x; -var y; -var i; - -data = dataset(); +const data = dataset(); // Extract wage data... -x = []; -y = []; -for ( i = 0; i < data.length; i++ ) { +const x = []; +const y = []; +for ( let i = 0; i < data.length; i++ ) { x.push( data[ i ].age ); y.push( data[ i ].wage ); } // Create a plot instance: -opts = { +const opts = { 'lineStyle': 'none', 'symbols': 'closed-circle', 'xLabel': 'Age', 'yLabel': 'Wage', 'title': 'Age vs Wage' }; -plot = new Plot( [ x ], [ y ], opts ); +const plot = new Plot( [ x ], [ y ], opts ); ```
diff --git a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1969-1988/README.md b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1969-1988/README.md index 6867223ce51d..add0f303b06d 100644 --- a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1969-1988/README.md +++ b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1969-1988/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1969-1988' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1969-1988' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1969-1988' ); Returns US birth data from 1969 to 1988, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics. ```javascript -var data = dataset(); +const data = dataset(); // returns [ {...}, ... ] ``` @@ -68,8 +68,8 @@ Each element in the returned database has the following fields: ```javascript -var incrmean = require( '@stdlib/stats/incr/mean' ); -var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1969-1988' ); +const incrmean = require( '@stdlib/stats/incr/mean' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1969-1988' ); function mean( a, b ) { return ( a + b ) / 2.0; @@ -86,19 +86,16 @@ function reldiff( a, b ) { */ // Retrieve the data: -var data = dataset(); +const data = dataset(); // Initialize arrays for storing births for particular day numbers: -var d6or20 = [ [], [], [], [], [], [], [] ]; -var d13 = [ [], [], [], [], [], [], [] ]; +const d6or20 = [ [], [], [], [], [], [], [] ]; +const d13 = [ [], [], [], [], [], [], [] ]; // Extract the day number data... -var d; -var w; -var i; -for ( i = 0; i < data.length; i++ ) { - d = data[ i ].date_of_month; - w = data[ i ].day_of_week; +for ( let i = 0; i < data.length; i++ ) { + const d = data[ i ].date_of_month; + const w = data[ i ].day_of_week; if ( d === 6 ) { // Average of days 6 and 20 for the same month: d6or20[ w-1 ].push( mean( data[ i ].births, data[ i+14 ].births ) ); @@ -108,27 +105,23 @@ for ( i = 0; i < data.length; i++ ) { } // Initialize accumulators for computing the average relative difference... -var means = []; -for ( i = 0; i < 7; i++ ) { +const means = []; +for ( let i = 0; i < 7; i++ ) { means.push( incrmean() ); } // Compute the average relative difference between days 6/20 with day 13... -var l1; -var l2; -var mu; -var j; -for ( i = 0; i < 7; i++ ) { - l1 = d13[ i ]; - l2 = d6or20[ i ]; - mu = means[ i ]; - for ( j = 0; j < l1.length; j++ ) { +for ( let i = 0; i < 7; i++ ) { + const l1 = d13[ i ]; + const l2 = d6or20[ i ]; + const mu = means[ i ]; + for ( let j = 0; j < l1.length; j++ ) { mu( reldiff( l1[ j ], l2[ j ] ) ); } } // Print the results... -for ( i = 0; i < 7; i++ ) { +for ( let i = 0; i < 7; i++ ) { console.log( '%d: %d%', i+1, means[ i ]().toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1994-2003/README.md b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1994-2003/README.md index bfcf9df03033..dadb1f9ca639 100644 --- a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1994-2003/README.md +++ b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-births-1994-2003/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1994-2003' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1994-2003' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1994-2003' ); Returns US birth data from 1994 to 2003, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics. ```javascript -var data = dataset(); +const data = dataset(); // returns [ {...}, ... ] ``` @@ -58,8 +58,8 @@ Each element in the returned database has the following fields: ```javascript -var incrmean = require( '@stdlib/stats/incr/mean' ); -var dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1994-2003' ); +const incrmean = require( '@stdlib/stats/incr/mean' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-births-1994-2003' ); function mean( a, b ) { return ( a + b ) / 2.0; @@ -76,19 +76,16 @@ function reldiff( a, b ) { */ // Retrieve the data: -var data = dataset(); +const data = dataset(); // Initialize arrays for storing births for particular day numbers: -var d6or20 = [ [], [], [], [], [], [], [] ]; -var d13 = [ [], [], [], [], [], [], [] ]; +const d6or20 = [ [], [], [], [], [], [], [] ]; +const d13 = [ [], [], [], [], [], [], [] ]; // Extract the day number data... -var d; -var w; -var i; -for ( i = 0; i < data.length; i++ ) { - d = data[ i ].date_of_month; - w = data[ i ].day_of_week; +for ( let i = 0; i < data.length; i++ ) { + const d = data[ i ].date_of_month; + const w = data[ i ].day_of_week; if ( d === 6 ) { // Average of days 6 and 20 for the same month: d6or20[ w-1 ].push( mean( data[ i ].births, data[ i+14 ].births ) ); @@ -98,27 +95,23 @@ for ( i = 0; i < data.length; i++ ) { } // Initialize accumulators for computing the average relative difference... -var means = []; -for ( i = 0; i < 7; i++ ) { +const means = []; +for ( let i = 0; i < 7; i++ ) { means.push( incrmean() ); } // Compute the average relative difference between days 6/20 with day 13... -var l1; -var l2; -var mu; -var j; -for ( i = 0; i < 7; i++ ) { - l1 = d13[ i ]; - l2 = d6or20[ i ]; - mu = means[ i ]; - for ( j = 0; j < l1.length; j++ ) { +for ( let i = 0; i < 7; i++ ) { + const l1 = d13[ i ]; + const l2 = d6or20[ i ]; + const mu = means[ i ]; + for ( let j = 0; j < l1.length; j++ ) { mu( reldiff( l1[ j ], l2[ j ] ) ); } } // Print the results... -for ( i = 0; i < 7; i++ ) { +for ( let i = 0; i < 7; i++ ) { console.log( '%d: %d%', i+1, means[ i ]().toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/README.md b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/README.md index a0a1ee5c5935..d6ddd9ef69d1 100644 --- a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/README.md +++ b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-20 Returns US infant mortality data, by race, from 1915 to 2013, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics. ```javascript -var data = dataset(); +const data = dataset(); // returns { 'black': [...], 'white': [...] } ``` @@ -60,18 +60,16 @@ var data = dataset(); ```javascript -var dataset = require( '@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013' ); +const dataset = require( '@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013' ); // Retrieve the data: -var data = dataset(); -var b = data.black; -var w = data.white; +const data = dataset(); +const b = data.black; +const w = data.white; // Compute the relative infant mortality rate for blacks versus whites... -var r; -var i; -for ( i = 0; i < b.length; i++ ) { - r = b[ i ] / w[ i ]; +for ( let i = 0; i < b.length; i++ ) { + const r = b[ i ] / w[ i ]; console.log( '%d', r.toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/cmudict/README.md b/lib/node_modules/@stdlib/datasets/cmudict/README.md index 41ec9cef0417..955f9530d6e5 100644 --- a/lib/node_modules/@stdlib/datasets/cmudict/README.md +++ b/lib/node_modules/@stdlib/datasets/cmudict/README.md @@ -35,7 +35,7 @@ The [Carnegie Mellon University Pronouncing Dictionary (CMUDict)][cmudict], crea ## Usage ```javascript -var cmudict = require( '@stdlib/datasets/cmudict' ); +const cmudict = require( '@stdlib/datasets/cmudict' ); ``` #### cmudict( \[options] ) @@ -43,7 +43,7 @@ var cmudict = require( '@stdlib/datasets/cmudict' ); Returns datasets from the [Carnegie Mellon Pronouncing Dictionary (CMUdict)][cmudict]. ```javascript -var data = cmudict(); +const data = cmudict(); /* returns { 'dict': {...}, @@ -66,11 +66,11 @@ The function accepts the following `options`: To only return the main pronouncing dictionary, set the `data` option to `dict`. ```javascript -var opts = { +const opts = { 'data': 'dict' }; -var data = cmudict( opts ); +const data = cmudict( opts ); /* returns { 'A': 'AH0', @@ -84,11 +84,11 @@ var data = cmudict( opts ); To return only sound articulation manners, set the `data` option to `phones`. ```javascript -var opts = { +const opts = { 'data': 'phones' }; -var data = cmudict( opts ); +const data = cmudict( opts ); /* returns { 'AA': 'vowel', @@ -102,11 +102,11 @@ var data = cmudict( opts ); To return only ARPABET symbols used by the dictionary, set the `data` option to `symbols`. ```javascript -var opts = { +const opts = { 'data': 'symbols' }; -var data = cmudict( opts ); +const data = cmudict( opts ); /* returns [ 'AA', @@ -120,11 +120,11 @@ var data = cmudict( opts ); To return only the verbal pronunciations of punctuation marks, set the `data` option to `vp`. ```javascript -var opts = { +const opts = { 'data': 'vp' }; -var data = cmudict( opts ); +const data = cmudict( opts ); /* returns { '!exclamation-point': 'EH2 K S K L AH0 M EY1 SH AH0 N P OY2 N T', @@ -157,9 +157,9 @@ var data = cmudict( opts ); ```javascript -var cmudict = require( '@stdlib/datasets/cmudict' ); +const cmudict = require( '@stdlib/datasets/cmudict' ); -var opts = {}; +const opts = {}; opts.data = 'phones'; console.dir( cmudict( opts ) ); diff --git a/lib/node_modules/@stdlib/datasets/dale-chall-new/README.md b/lib/node_modules/@stdlib/datasets/dale-chall-new/README.md index f9ac7c95c410..527af5f39847 100644 --- a/lib/node_modules/@stdlib/datasets/dale-chall-new/README.md +++ b/lib/node_modules/@stdlib/datasets/dale-chall-new/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var words = require( '@stdlib/datasets/dale-chall-new' ); +const words = require( '@stdlib/datasets/dale-chall-new' ); ``` #### words() @@ -35,7 +35,7 @@ var words = require( '@stdlib/datasets/dale-chall-new' ); Returns a [list][@chall:1995a] of familiar American-English words. ```javascript -var data = words(); +const data = words(); /* returns [ 'a', @@ -61,18 +61,16 @@ var data = words(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var words = require( '@stdlib/datasets/dale-chall-new' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const words = require( '@stdlib/datasets/dale-chall-new' ); -var data = words(); -var len = data.length; -var idx; -var i; +const data = words(); +const len = data.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/emoji-code-picto/README.md b/lib/node_modules/@stdlib/datasets/emoji-code-picto/README.md index cf58a37dfd67..a1d9a76739b6 100644 --- a/lib/node_modules/@stdlib/datasets/emoji-code-picto/README.md +++ b/lib/node_modules/@stdlib/datasets/emoji-code-picto/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var table = require( '@stdlib/datasets/emoji-code-picto' ); +const table = require( '@stdlib/datasets/emoji-code-picto' ); ``` #### table() @@ -35,10 +35,10 @@ var table = require( '@stdlib/datasets/emoji-code-picto' ); Returns an object mapping emoji codes to pictographs. ```javascript -var t = table(); +const t = table(); // returns {...} -var p = t[ ':smile:' ]; +let p = t[ ':smile:' ]; // returns '😄' p = t[ ':unicorn:' ]; @@ -66,21 +66,17 @@ p = t[ ':unicorn:' ]; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var table = require( '@stdlib/datasets/emoji-code-picto' ); - -var codes; -var tbl; -var i; +const objectKeys = require( '@stdlib/utils/keys' ); +const table = require( '@stdlib/datasets/emoji-code-picto' ); // Get the data: -tbl = table(); +const tbl = table(); // Get the emoji codes: -codes = objectKeys( tbl ); +const codes = objectKeys( tbl ); // Print out all the corresponding pictographs... -for ( i = 0; i < codes.length; i++ ) { +for ( let i = 0; i < codes.length; i++ ) { console.log( codes[ i ] + ' => ' + tbl[ codes[ i ] ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/emoji-picto-code/README.md b/lib/node_modules/@stdlib/datasets/emoji-picto-code/README.md index 38d6da3de2f7..01c5645c6177 100644 --- a/lib/node_modules/@stdlib/datasets/emoji-picto-code/README.md +++ b/lib/node_modules/@stdlib/datasets/emoji-picto-code/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var table = require( '@stdlib/datasets/emoji-picto-code' ); +const table = require( '@stdlib/datasets/emoji-picto-code' ); ``` #### table() @@ -35,10 +35,10 @@ var table = require( '@stdlib/datasets/emoji-picto-code' ); Returns an object mapping emoji pictographs to codes. ```javascript -var t = table(); +const t = table(); // returns {...} -var p = t[ '😄' ]; +let p = t[ '😄' ]; // returns [ ':smile:' ] p = t[ '🦄' ]; @@ -66,21 +66,17 @@ p = t[ '🦄' ]; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var table = require( '@stdlib/datasets/emoji-picto-code' ); - -var picto; -var tbl; -var i; +const objectKeys = require( '@stdlib/utils/keys' ); +const table = require( '@stdlib/datasets/emoji-picto-code' ); // Get the data: -tbl = table(); +const tbl = table(); // Get the emoji pictographs: -picto = objectKeys( tbl ); +const picto = objectKeys( tbl ); // Print out all the corresponding codes... -for ( i = 0; i < picto.length; i++ ) { +for ( let i = 0; i < picto.length; i++ ) { console.log( picto[ i ] + ' => ' + tbl[ picto[ i ] ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/emoji/README.md b/lib/node_modules/@stdlib/datasets/emoji/README.md index 0d7404b187c8..7f7b6978f06e 100644 --- a/lib/node_modules/@stdlib/datasets/emoji/README.md +++ b/lib/node_modules/@stdlib/datasets/emoji/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var emoji = require( '@stdlib/datasets/emoji' ); +const emoji = require( '@stdlib/datasets/emoji' ); ``` #### emoji() @@ -35,7 +35,7 @@ var emoji = require( '@stdlib/datasets/emoji' ); Returns an emoji database. ```javascript -var data = emoji(); +const data = emoji(); // returns [ {...}, ... ] ``` @@ -70,22 +70,16 @@ In addition, for those emoji supporting skin tones, an element may have the foll ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var emoji = require( '@stdlib/datasets/emoji' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const emoji = require( '@stdlib/datasets/emoji' ); -var data; -var len; -var idx; -var d; -var i; - -data = emoji(); -len = data.length; +const data = emoji(); +const len = data.length; // Select random emoji... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - d = data[ idx ]; +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const d = data[ idx ]; console.log( d.emoji + ' => ' + d.codes[ 0 ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/female-first-names-en/README.md b/lib/node_modules/@stdlib/datasets/female-first-names-en/README.md index aeb52cf8e9d5..05e6579f51b0 100644 --- a/lib/node_modules/@stdlib/datasets/female-first-names-en/README.md +++ b/lib/node_modules/@stdlib/datasets/female-first-names-en/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var names = require( '@stdlib/datasets/female-first-names-en' ); +const names = require( '@stdlib/datasets/female-first-names-en' ); ``` #### names() @@ -35,7 +35,7 @@ var names = require( '@stdlib/datasets/female-first-names-en' ); Returns a [list][@ward:2002a] of common female first names (also known as [given][given-name] or personal names) in English speaking countries. ```javascript -var data = names(); +const data = names(); /* returns [ 'Aaren', @@ -65,18 +65,16 @@ var data = names(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var names = require( '@stdlib/datasets/female-first-names-en' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const names = require( '@stdlib/datasets/female-first-names-en' ); -var data = names(); -var len = data.length; -var idx; -var i; +const data = names(); +const len = data.length; // Select random names from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/fivethirtyeight-ffq/README.md b/lib/node_modules/@stdlib/datasets/fivethirtyeight-ffq/README.md index 412a796d14c2..d2d01ecaf096 100644 --- a/lib/node_modules/@stdlib/datasets/fivethirtyeight-ffq/README.md +++ b/lib/node_modules/@stdlib/datasets/fivethirtyeight-ffq/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/fivethirtyeight-ffq' ); +const dataset = require( '@stdlib/datasets/fivethirtyeight-ffq' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/fivethirtyeight-ffq' ); Returns [_FiveThirtyEight_][fivethirtyeight-nutrition-studies] reader responses to a food frequency questionnaire ([FFQ][ffq]). ```javascript -var data = dataset(); +const data = dataset(); // returns [ {...}, ... ] ``` @@ -60,10 +60,10 @@ var data = dataset(); ```javascript -var bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); -var inmap = require( '@stdlib/utils/inmap' ); -var ttest2 = require( '@stdlib/stats/ttest2' ); -var dataset = require( '@stdlib/datasets/fivethirtyeight-ffq' ); +const bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); +const inmap = require( '@stdlib/utils/inmap' ); +const ttest2 = require( '@stdlib/stats/ttest2' ); +const dataset = require( '@stdlib/datasets/fivethirtyeight-ffq' ); function predicate( v ) { return ( v.diabetes === 1 ); @@ -78,18 +78,18 @@ function createAccessor( field ) { } // Retrieve the data: -var data = dataset(); +const data = dataset(); // Split the data into two groups based on whether a respondent has diabetes: -var groups = bifurcateBy( data, predicate ); +const groups = bifurcateBy( data, predicate ); // For each group, extract the frequency of green salad consumption: -var mapFcn = createAccessor( 'greensaladfreq' ); -var g1 = inmap( groups[ 0 ].slice(), mapFcn ); -var g2 = inmap( groups[ 1 ].slice(), mapFcn ); +const mapFcn = createAccessor( 'greensaladfreq' ); +const g1 = inmap( groups[ 0 ].slice(), mapFcn ); +const g2 = inmap( groups[ 1 ].slice(), mapFcn ); // Perform a two-sample two-sided Student's t-test to determine if green salad consumption is different between the two groups: -var results = ttest2( g1, g2 ); +const results = ttest2( g1, g2 ); console.log( results.print() ); ``` diff --git a/lib/node_modules/@stdlib/datasets/frb-sf-wage-rigidity/README.md b/lib/node_modules/@stdlib/datasets/frb-sf-wage-rigidity/README.md index ddd6587dd6ab..760799340b7b 100644 --- a/lib/node_modules/@stdlib/datasets/frb-sf-wage-rigidity/README.md +++ b/lib/node_modules/@stdlib/datasets/frb-sf-wage-rigidity/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var wages = require( '@stdlib/datasets/frb-sf-wage-rigidity' ); +const wages = require( '@stdlib/datasets/frb-sf-wage-rigidity' ); ``` #### wages() @@ -41,7 +41,7 @@ var wages = require( '@stdlib/datasets/frb-sf-wage-rigidity' ); Returns [wage rates][@frbsf:wagerigidity] for U.S. workers that have not changed jobs within the year. ```javascript -var data = wages(); +const data = wages(); // returns [{...},{...},...] ``` @@ -70,22 +70,14 @@ Each `array` element has the following fields: ```javascript -var Chart = require( '@stdlib/plot/sparklines/unicode/tristate' ); -var wages = require( '@stdlib/datasets/frb-sf-wage-rigidity' ); - -var chart; -var opts; -var data; -var v1; -var v2; -var d; -var i; - -data = wages(); -d = new Array( data.length ); -v1 = data[ 0 ].all_workers; -for ( i = 1; i < data.length; i++ ) { - v2 = data[ i ].all_workers; +const Chart = require( '@stdlib/plot/sparklines/unicode/tristate' ); +const wages = require( '@stdlib/datasets/frb-sf-wage-rigidity' ); + +const data = wages(); +const d = new Array( data.length ); +let v1 = data[ 0 ].all_workers; +for ( let i = 1; i < data.length; i++ ) { + const v2 = data[ i ].all_workers; if ( v2 === null ) { d[ i ] = NaN; } else if ( v2 < v1 ) { @@ -98,10 +90,10 @@ for ( i = 1; i < data.length; i++ ) { v1 = v2; } -opts = { +const opts = { 'data': d }; -chart = new Chart( opts ); +const chart = new Chart( opts ); console.log( chart.render() ); ``` diff --git a/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices-corrected/README.md b/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices-corrected/README.md index 7541e49d934e..ea3d96ec7389 100644 --- a/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices-corrected/README.md +++ b/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices-corrected/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/harrison-boston-house-prices-corrected' ); +const dataset = require( '@stdlib/datasets/harrison-boston-house-prices-corrected' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/harrison-boston-house-prices-corrected' Returns a (corrected) dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978). ```javascript -var data = dataset(); +const data = dataset(); /* returns [ { @@ -103,35 +103,27 @@ var data = dataset(); ```javascript -var Plot = require( '@stdlib/plot' ); -var dataset = require( '@stdlib/datasets/harrison-boston-house-prices-corrected' ); - -var data; -var plot; -var opts; -var x; -var y; -var i; - -data = dataset(); +const Plot = require( '@stdlib/plot' ); +const dataset = require( '@stdlib/datasets/harrison-boston-house-prices-corrected' ); +const data = dataset(); // Extract housing data... -x = []; -y = []; -for ( i = 0; i < data.length; i++ ) { +const x = []; +const y = []; +for ( let i = 0; i < data.length; i++ ) { x.push( data[ i ].rm ); y.push( data[ i ].cmedv ); } // Create a plot instance: -opts = { +const opts = { 'lineStyle': 'none', 'symbols': 'closed-circle', 'xLabel': 'Average Number of Rooms', 'yLabel': 'Corrected Median Value', 'title': 'Number of Rooms vs Median Value' }; -plot = new Plot( [ x ], [ y ], opts ); +const plot = new Plot( [ x ], [ y ], opts ); // Render the plot: console.log( plot.render( 'html' ) ); diff --git a/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices/README.md b/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices/README.md index f440eedb75d2..4911951e36bb 100644 --- a/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices/README.md +++ b/lib/node_modules/@stdlib/datasets/harrison-boston-house-prices/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/harrison-boston-house-prices' ); +const dataset = require( '@stdlib/datasets/harrison-boston-house-prices' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/harrison-boston-house-prices' ); Returns a dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978). ```javascript -var data = dataset(); +const data = dataset(); /* returns [ { @@ -101,35 +101,28 @@ var data = dataset(); ```javascript -var Plot = require( '@stdlib/plot' ); -var dataset = require( '@stdlib/datasets/harrison-boston-house-prices' ); +const Plot = require( '@stdlib/plot' ); +const dataset = require( '@stdlib/datasets/harrison-boston-house-prices' ); -var data; -var plot; -var opts; -var x; -var y; -var i; - -data = dataset(); +const data = dataset(); // Extract housing data... -x = []; -y = []; -for ( i = 0; i < data.length; i++ ) { +const x = []; +const y = []; +for ( let i = 0; i < data.length; i++ ) { x.push( data[ i ].rm ); y.push( data[ i ].medv ); } // Create a plot instance: -opts = { +const opts = { 'lineStyle': 'none', 'symbols': 'closed-circle', 'xLabel': 'Average Number of Rooms', 'yLabel': 'Median Value', 'title': 'Number of Rooms vs Median Value' }; -plot = new Plot( [ x ], [ y ], opts ); +const plot = new Plot( [ x ], [ y ], opts ); // Render the plot: console.log( plot.render( 'html' ) ); diff --git a/lib/node_modules/@stdlib/datasets/herndon-venus-semidiameters/README.md b/lib/node_modules/@stdlib/datasets/herndon-venus-semidiameters/README.md index c229230e9e19..360b07a310cd 100644 --- a/lib/node_modules/@stdlib/datasets/herndon-venus-semidiameters/README.md +++ b/lib/node_modules/@stdlib/datasets/herndon-venus-semidiameters/README.md @@ -35,7 +35,7 @@ Herndon's observations are a classic dataset commonly used in examples demonstra ## Usage ```javascript -var data = require( '@stdlib/datasets/herndon-venus-semidiameters' ); +const data = require( '@stdlib/datasets/herndon-venus-semidiameters' ); ``` #### data() @@ -43,7 +43,7 @@ var data = require( '@stdlib/datasets/herndon-venus-semidiameters' ); Returns fifteen observations of the vertical semidiameter of Venus, made by Lieutenant Herndon, with the meridian circle at Washington, in the year 1846. ```javascript -var d = data(); +const d = data(); // returns [ -0.30, -0.44, ..., 0.39, 0.10 ] ``` @@ -58,25 +58,20 @@ var d = data(); ```javascript -var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); -var data = require( '@stdlib/datasets/herndon-venus-semidiameters' ); - -var opts; -var acc; -var d; -var i; +const incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); +const data = require( '@stdlib/datasets/herndon-venus-semidiameters' ); // Get the data: -d = data(); +const d = data(); // Create a new accumulator for detecting an outlier using Grubbs' test: -opts = { +const opts = { 'init': d.length }; -acc = incrgrubbs( opts ); +const acc = incrgrubbs( opts ); // Update the accumulator... -for ( i = 0; i < d.length; i++ ) { +for ( let i = 0; i < d.length; i++ ) { acc( d[ i ] ); } diff --git a/lib/node_modules/@stdlib/datasets/img-acanthus-mollis/README.md b/lib/node_modules/@stdlib/datasets/img-acanthus-mollis/README.md index e7d679043f6f..cf82e19e9aa9 100644 --- a/lib/node_modules/@stdlib/datasets/img-acanthus-mollis/README.md +++ b/lib/node_modules/@stdlib/datasets/img-acanthus-mollis/README.md @@ -46,7 +46,7 @@ Image of Karl Blossfeldt's gelatin silver print [_Acanthus mollis_][@blossfeldt: ## Usage ```javascript -var image = require( '@stdlib/datasets/img-acanthus-mollis' ); +const image = require( '@stdlib/datasets/img-acanthus-mollis' ); ``` #### image() @@ -54,7 +54,7 @@ var image = require( '@stdlib/datasets/img-acanthus-mollis' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -71,9 +71,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-acanthus-mollis' ); +const image = require( '@stdlib/datasets/img-acanthus-mollis' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-airplane-from-above/README.md b/lib/node_modules/@stdlib/datasets/img-airplane-from-above/README.md index 56ed2bb7c58c..404ab3208dcd 100644 --- a/lib/node_modules/@stdlib/datasets/img-airplane-from-above/README.md +++ b/lib/node_modules/@stdlib/datasets/img-airplane-from-above/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-airplane-from-above' ); +const image = require( '@stdlib/datasets/img-airplane-from-above' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-airplane-from-above' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-airplane-from-above' ); +const image = require( '@stdlib/datasets/img-airplane-from-above' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-allium-oreophilum/README.md b/lib/node_modules/@stdlib/datasets/img-allium-oreophilum/README.md index 9319c64d4b2d..30f7e7b58a8b 100644 --- a/lib/node_modules/@stdlib/datasets/img-allium-oreophilum/README.md +++ b/lib/node_modules/@stdlib/datasets/img-allium-oreophilum/README.md @@ -46,7 +46,7 @@ Image of Karl Blossfeldt's gelatin silver print [_Allium ostrowskianum_][@blossf ## Usage ```javascript -var image = require( '@stdlib/datasets/img-allium-oreophilum' ); +const image = require( '@stdlib/datasets/img-allium-oreophilum' ); ``` #### image() @@ -54,7 +54,7 @@ var image = require( '@stdlib/datasets/img-allium-oreophilum' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -71,9 +71,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-allium-oreophilum' ); +const image = require( '@stdlib/datasets/img-allium-oreophilum' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-black-canyon/README.md b/lib/node_modules/@stdlib/datasets/img-black-canyon/README.md index 0b5b4a2e25fa..75732735d5fd 100644 --- a/lib/node_modules/@stdlib/datasets/img-black-canyon/README.md +++ b/lib/node_modules/@stdlib/datasets/img-black-canyon/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-black-canyon' ); +const image = require( '@stdlib/datasets/img-black-canyon' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-black-canyon' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-black-canyon' ); +const image = require( '@stdlib/datasets/img-black-canyon' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-dust-bowl-home/README.md b/lib/node_modules/@stdlib/datasets/img-dust-bowl-home/README.md index 035907683814..7f5cfe050f83 100644 --- a/lib/node_modules/@stdlib/datasets/img-dust-bowl-home/README.md +++ b/lib/node_modules/@stdlib/datasets/img-dust-bowl-home/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-dust-bowl-home' ); +const image = require( '@stdlib/datasets/img-dust-bowl-home' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-dust-bowl-home' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-dust-bowl-home' ); +const image = require( '@stdlib/datasets/img-dust-bowl-home' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-french-alpine-landscape/README.md b/lib/node_modules/@stdlib/datasets/img-french-alpine-landscape/README.md index bd103ab2fa39..9c93be666300 100644 --- a/lib/node_modules/@stdlib/datasets/img-french-alpine-landscape/README.md +++ b/lib/node_modules/@stdlib/datasets/img-french-alpine-landscape/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-french-alpine-landscape' ); +const image = require( '@stdlib/datasets/img-french-alpine-landscape' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-french-alpine-landscape' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-french-alpine-landscape' ); +const image = require( '@stdlib/datasets/img-french-alpine-landscape' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-locomotion-house-cat/README.md b/lib/node_modules/@stdlib/datasets/img-locomotion-house-cat/README.md index 5152a68f7c3a..94079c4f2eb7 100644 --- a/lib/node_modules/@stdlib/datasets/img-locomotion-house-cat/README.md +++ b/lib/node_modules/@stdlib/datasets/img-locomotion-house-cat/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-locomotion-house-cat' ); +const image = require( '@stdlib/datasets/img-locomotion-house-cat' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-locomotion-house-cat' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-locomotion-house-cat' ); +const image = require( '@stdlib/datasets/img-locomotion-house-cat' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-locomotion-nude-male/README.md b/lib/node_modules/@stdlib/datasets/img-locomotion-nude-male/README.md index 7424426b2b60..1de6fd9acc2b 100644 --- a/lib/node_modules/@stdlib/datasets/img-locomotion-nude-male/README.md +++ b/lib/node_modules/@stdlib/datasets/img-locomotion-nude-male/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-locomotion-nude-male' ); +const image = require( '@stdlib/datasets/img-locomotion-nude-male' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-locomotion-nude-male' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image; +const img = image; // returns ``` @@ -69,9 +69,9 @@ var img = image; ```javascript -var image = require( '@stdlib/datasets/img-locomotion-nude-male' ); +const image = require( '@stdlib/datasets/img-locomotion-nude-male' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-march-pastoral/README.md b/lib/node_modules/@stdlib/datasets/img-march-pastoral/README.md index eb5c5a6f01c8..1ec9ffc14175 100644 --- a/lib/node_modules/@stdlib/datasets/img-march-pastoral/README.md +++ b/lib/node_modules/@stdlib/datasets/img-march-pastoral/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-march-pastoral' ); +const image = require( '@stdlib/datasets/img-march-pastoral' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-march-pastoral' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image; +const img = image; // returns ``` @@ -69,9 +69,9 @@ var img = image; ```javascript -var image = require( '@stdlib/datasets/img-march-pastoral' ); +const image = require( '@stdlib/datasets/img-march-pastoral' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/img-nagasaki-boats/README.md b/lib/node_modules/@stdlib/datasets/img-nagasaki-boats/README.md index fe5e6f24487f..aa02c9bc764d 100644 --- a/lib/node_modules/@stdlib/datasets/img-nagasaki-boats/README.md +++ b/lib/node_modules/@stdlib/datasets/img-nagasaki-boats/README.md @@ -44,7 +44,7 @@ limitations under the License. ## Usage ```javascript -var image = require( '@stdlib/datasets/img-nagasaki-boats' ); +const image = require( '@stdlib/datasets/img-nagasaki-boats' ); ``` #### image() @@ -52,7 +52,7 @@ var image = require( '@stdlib/datasets/img-nagasaki-boats' ); Returns a [buffer][@stdlib/buffer/ctor] containing image data. ```javascript -var img = image(); +const img = image(); // returns ``` @@ -69,9 +69,9 @@ var img = image(); ```javascript -var image = require( '@stdlib/datasets/img-nagasaki-boats' ); +const image = require( '@stdlib/datasets/img-nagasaki-boats' ); -var img = image(); +const img = image(); console.log( img ); ``` diff --git a/lib/node_modules/@stdlib/datasets/liu-negative-opinion-words-en/README.md b/lib/node_modules/@stdlib/datasets/liu-negative-opinion-words-en/README.md index 377c1cedebcb..545fc400ff35 100644 --- a/lib/node_modules/@stdlib/datasets/liu-negative-opinion-words-en/README.md +++ b/lib/node_modules/@stdlib/datasets/liu-negative-opinion-words-en/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var words = require( '@stdlib/datasets/liu-negative-opinion-words-en' ); +const words = require( '@stdlib/datasets/liu-negative-opinion-words-en' ); ``` #### words() @@ -35,7 +35,7 @@ var words = require( '@stdlib/datasets/liu-negative-opinion-words-en' ); Returns a [list][sentiment-lexicon] of negative opinion words. ```javascript -var list = words(); +const list = words(); /* returns [ '2-faced', @@ -80,18 +80,16 @@ var list = words(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var words = require( '@stdlib/datasets/liu-negative-opinion-words-en' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const words = require( '@stdlib/datasets/liu-negative-opinion-words-en' ); -var list = words(); -var len = list.length; -var idx; -var i; +const list = words(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/liu-positive-opinion-words-en/README.md b/lib/node_modules/@stdlib/datasets/liu-positive-opinion-words-en/README.md index 1b2a3d8f5a5f..a1161c8e1b3d 100644 --- a/lib/node_modules/@stdlib/datasets/liu-positive-opinion-words-en/README.md +++ b/lib/node_modules/@stdlib/datasets/liu-positive-opinion-words-en/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var words = require( '@stdlib/datasets/liu-positive-opinion-words-en' ); +const words = require( '@stdlib/datasets/liu-positive-opinion-words-en' ); ``` #### words() @@ -35,7 +35,7 @@ var words = require( '@stdlib/datasets/liu-positive-opinion-words-en' ); Returns a [list][sentiment-lexicon] of positive opinion words. ```javascript -var list = words(); +const list = words(); /* returns [ 'a+', @@ -79,18 +79,16 @@ var list = words(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var words = require( '@stdlib/datasets/liu-positive-opinion-words-en' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const words = require( '@stdlib/datasets/liu-positive-opinion-words-en' ); -var list = words(); -var len = list.length; -var idx; -var i; +const list = words(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/male-first-names-en/README.md b/lib/node_modules/@stdlib/datasets/male-first-names-en/README.md index e2c99bd6cd5b..9e91b0fdea7e 100644 --- a/lib/node_modules/@stdlib/datasets/male-first-names-en/README.md +++ b/lib/node_modules/@stdlib/datasets/male-first-names-en/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var names = require( '@stdlib/datasets/male-first-names-en' ); +const names = require( '@stdlib/datasets/male-first-names-en' ); ``` #### names() @@ -35,7 +35,7 @@ var names = require( '@stdlib/datasets/male-first-names-en' ); Returns a [list][@ward:2002a] of common male first names (also known as [given][given-name] or personal names) in English speaking countries. ```javascript -var data = names(); +const data = names(); /* returns [ 'Aaron', @@ -64,18 +64,16 @@ var data = names(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var names = require( '@stdlib/datasets/male-first-names-en' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const names = require( '@stdlib/datasets/male-first-names-en' ); -var data = names(); -var len = data.length; -var idx; -var i; +const data = names(); +const len = data.length; // Select random names from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/minard-napoleons-march/README.md b/lib/node_modules/@stdlib/datasets/minard-napoleons-march/README.md index 42c7e4937447..5579b9311deb 100644 --- a/lib/node_modules/@stdlib/datasets/minard-napoleons-march/README.md +++ b/lib/node_modules/@stdlib/datasets/minard-napoleons-march/README.md @@ -42,7 +42,7 @@ limitations under the License. ## Usage ```javascript -var minard = require( '@stdlib/datasets/minard-napoleons-march' ); +const minard = require( '@stdlib/datasets/minard-napoleons-march' ); ``` #### minard( \[options] ) @@ -50,7 +50,7 @@ var minard = require( '@stdlib/datasets/minard-napoleons-march' ); Data for [Charles Joseph Minard][minard]'s famous cartographic depiction of Napoleon's Russian [campaign of 1812][campaign-of-1812]. ```javascript -var data = minard(); +const data = minard(); /* returns { 'army': [ @@ -292,11 +292,11 @@ The function accepts the following `options`: To return only army size data, set the `data` option to `army`. ```javascript -var opts = { +const opts = { 'data': 'army' }; -var data = minard( opts ); +const data = minard( opts ); /* returns [ {'lon': 24,'lat': 54.9,'size': 340000,'direction': 'A','division': 1}, @@ -354,11 +354,11 @@ var data = minard( opts ); To return only city locations, set the `data` option to `cities`. ```javascript -var opts = { +const opts = { 'data': 'cities' }; -var data = minard( opts ); +const data = minard( opts ); /* returns [ {'lon': 24,'lat': 55,'city': 'Kowno', @@ -388,11 +388,11 @@ var data = minard( opts ); To return only temperature data, set the `data` option to `temperature`. ```javascript -var opts = { +const opts = { 'data': 'temperature' }; -var data = minard( opts ); +const data = minard( opts ); /* returns [ {'lon': 37.6,'temp': 0,'date': '18 Oct 1812'}, @@ -411,11 +411,11 @@ var data = minard( opts ); To return only the army size label locations, set the `data` option to `labels`. ```javascript -var opts = { +const opts = { 'data': 'labels' }; -var data = minard( opts ); +const data = minard( opts ); /* returns [ {'lon': 24,'lat': 54.9,'size': 422000,'division': 1}, @@ -447,11 +447,11 @@ var data = minard( opts ); To return only the river data, set the `data` option to `rivers`. ```javascript -var opts = { +const opts = { 'data': 'rivers' }; -var data = minard( opts ); +const data = minard( opts ); /* returns { 'type': 'FeatureCollection', @@ -594,9 +594,9 @@ var data = minard( opts ); ```javascript -var minard = require( '@stdlib/datasets/minard-napoleons-march' ); +const minard = require( '@stdlib/datasets/minard-napoleons-march' ); -var opts = {}; +const opts = {}; opts.data = 'army'; console.dir( minard( opts ) ); diff --git a/lib/node_modules/@stdlib/datasets/moby-dick/README.md b/lib/node_modules/@stdlib/datasets/moby-dick/README.md index 9c8aa145671f..ce8638313a3a 100644 --- a/lib/node_modules/@stdlib/datasets/moby-dick/README.md +++ b/lib/node_modules/@stdlib/datasets/moby-dick/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var text = require( '@stdlib/datasets/moby-dick' ); +const text = require( '@stdlib/datasets/moby-dick' ); ``` #### text() @@ -41,7 +41,7 @@ var text = require( '@stdlib/datasets/moby-dick' ); Returns the text of _Moby Dick_. ```javascript -var data = text(); +const data = text(); // returns [{...},{...},...] ``` @@ -64,13 +64,10 @@ Each `array` element has the following fields: ```javascript -var text = require( '@stdlib/datasets/moby-dick' ); +const text = require( '@stdlib/datasets/moby-dick' ); -var data; -var i; - -data = text(); -for ( i = 0; i < data.length; i++ ) { +const data = text(); +for ( let i = 0; i < data.length; i++ ) { console.log( 'Character Count: %d', data[ i ].text.length ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/month-names-en/README.md b/lib/node_modules/@stdlib/datasets/month-names-en/README.md index 584e0c09ef84..9867d1cc2864 100644 --- a/lib/node_modules/@stdlib/datasets/month-names-en/README.md +++ b/lib/node_modules/@stdlib/datasets/month-names-en/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var months = require( '@stdlib/datasets/month-names-en' ); +const months = require( '@stdlib/datasets/month-names-en' ); ``` #### months() @@ -35,7 +35,7 @@ var months = require( '@stdlib/datasets/month-names-en' ); Returns a list of month names (English). ```javascript -var list = months(); +const list = months(); /* returns [ 'January', @@ -67,20 +67,15 @@ var list = months(); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var months = require( '@stdlib/datasets/month-names-en' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const months = require( '@stdlib/datasets/month-names-en' ); -var list; -var len; -var idx; -var i; - -list = months(); -len = list.length; +const list = months(); +const len = list.length; // Select random months from the list... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/nightingales-rose/README.md b/lib/node_modules/@stdlib/datasets/nightingales-rose/README.md index 24be66874e48..4ac5059f7083 100644 --- a/lib/node_modules/@stdlib/datasets/nightingales-rose/README.md +++ b/lib/node_modules/@stdlib/datasets/nightingales-rose/README.md @@ -42,7 +42,7 @@ limitations under the License. ## Usage ```javascript -var rose = require( '@stdlib/datasets/nightingales-rose' ); +const rose = require( '@stdlib/datasets/nightingales-rose' ); ``` #### rose() @@ -50,7 +50,7 @@ var rose = require( '@stdlib/datasets/nightingales-rose' ); Returns dataset for [Florence Nightingale][nightingale]'s famous [polar area diagram][polar-area-diagram]. ```javascript -var data = rose(); +const data = rose(); /* returns [ { @@ -76,19 +76,14 @@ var data = rose(); ```javascript -var rose = require( '@stdlib/datasets/nightingales-rose' ); +const rose = require( '@stdlib/datasets/nightingales-rose' ); -var scalar; -var data; -var d; -var i; - -data = rose(); +const data = rose(); // As done by Nightingale, calculate the average annual mortality per 1000 for each cause. See http://understandinguncertainty.org/node/214. -for ( i = 0; i < data.length; i++ ) { - d = data[ i ]; - scalar = 1000.0 * 12.0 / d.army_size; +for ( let i = 0; i < data.length; i++ ) { + const d = data[ i ]; + const scalar = 1000.0 * 12.0 / d.army_size; d.disease *= scalar; d.wounds *= scalar; d.other *= scalar; diff --git a/lib/node_modules/@stdlib/datasets/pace-boston-house-prices/README.md b/lib/node_modules/@stdlib/datasets/pace-boston-house-prices/README.md index 95f78c3841b8..b30ea1675bda 100644 --- a/lib/node_modules/@stdlib/datasets/pace-boston-house-prices/README.md +++ b/lib/node_modules/@stdlib/datasets/pace-boston-house-prices/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/pace-boston-house-prices' ); +const dataset = require( '@stdlib/datasets/pace-boston-house-prices' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/pace-boston-house-prices' ); Returns a (corrected) dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978). ```javascript -var data = dataset(); +const data = dataset(); /* returns [ { @@ -117,35 +117,28 @@ var data = dataset(); ```javascript -var Plot = require( '@stdlib/plot' ); -var dataset = require( '@stdlib/datasets/pace-boston-house-prices' ); +const Plot = require( '@stdlib/plot' ); +const dataset = require( '@stdlib/datasets/pace-boston-house-prices' ); -var data; -var plot; -var opts; -var x; -var y; -var i; - -data = dataset(); +const data = dataset(); // Extract housing data... -x = []; -y = []; -for ( i = 0; i < data.length; i++ ) { +const x = []; +const y = []; +for ( let i = 0; i < data.length; i++ ) { x.push( data[ i ].rm ); y.push( data[ i ].cmedv ); } // Create a plot instance: -opts = { +const opts = { 'lineStyle': 'none', 'symbols': 'closed-circle', 'xLabel': 'Average Number of Rooms', 'yLabel': 'Corrected Median Value', 'title': 'Number of Rooms vs Median Value' }; -plot = new Plot( [ x ], [ y ], opts ); +const plot = new Plot( [ x ], [ y ], opts ); // Render the plot: console.log( plot.render( 'html' ) ); diff --git a/lib/node_modules/@stdlib/datasets/primes-100k/README.md b/lib/node_modules/@stdlib/datasets/primes-100k/README.md index 59039757cbea..e7bcf7305bb9 100644 --- a/lib/node_modules/@stdlib/datasets/primes-100k/README.md +++ b/lib/node_modules/@stdlib/datasets/primes-100k/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var primes = require( '@stdlib/datasets/primes-100k' ); +const primes = require( '@stdlib/datasets/primes-100k' ); ``` #### primes() @@ -35,7 +35,7 @@ var primes = require( '@stdlib/datasets/primes-100k' ); Returns a list containing the first 100,000 prime numbers. ```javascript -var list = primes(); +const list = primes(); // returns [ 2, 3, 5, ... ] ``` @@ -52,20 +52,15 @@ var list = primes(); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var primes = require( '@stdlib/datasets/primes-100k' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const primes = require( '@stdlib/datasets/primes-100k' ); -var list; -var len; -var idx; -var i; - -list = primes(); -len = list.length; +const list = primes(); +const len = list.length; // Select random primes from the list... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-fin/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-fin/README.md index b1a14f0c2144..e86fc5f4019f 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-fin/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-fin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-fin' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-fin' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-fin' ); Returns a list of 747 Finnish [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'aiemmin', @@ -65,18 +65,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-fin' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-fin' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-fr/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-fr/README.md index 881b3da74e64..3ed685161a21 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-fr/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-fr/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-fr' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-fr' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-fr' ); Returns a list of 463 French [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -71,18 +71,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-fr' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-fr' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-ger/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-ger/README.md index 34406b29eb0f..a76fd075e440 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-ger/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-ger/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-ger' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-ger' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-ger' ); Returns a list of 583 German [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -67,18 +67,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-ger' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-ger' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-it/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-it/README.md index 952eb1a26c69..dac6cb708e4b 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-it/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-it/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-it' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-it' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-it' ); Returns a list of 399 Italian [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -66,18 +66,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-it' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-it' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-por/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-por/README.md index dc47b4725339..891889142507 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-por/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-por/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-por' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-por' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-por' ); Returns a list of 356 Portuguese [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -66,18 +66,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-por' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-por' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-sp/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-sp/README.md index b6b1361eb413..27f5963bf5ce 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-sp/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-sp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-sp' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-sp' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-sp' ); Returns a list of 307 Spanish [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -66,18 +66,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-sp' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-sp' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/savoy-stopwords-swe/README.md b/lib/node_modules/@stdlib/datasets/savoy-stopwords-swe/README.md index 4333b53aa15e..e5803452dcfe 100644 --- a/lib/node_modules/@stdlib/datasets/savoy-stopwords-swe/README.md +++ b/lib/node_modules/@stdlib/datasets/savoy-stopwords-swe/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/savoy-stopwords-swe' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-swe' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/savoy-stopwords-swe' ); Returns a list of 386 Swedish [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'aderton', @@ -66,18 +66,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/savoy-stopwords-swe' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/savoy-stopwords-swe' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/sotu/README.md b/lib/node_modules/@stdlib/datasets/sotu/README.md index 36a47f064bce..8269d30ae98a 100644 --- a/lib/node_modules/@stdlib/datasets/sotu/README.md +++ b/lib/node_modules/@stdlib/datasets/sotu/README.md @@ -35,7 +35,7 @@ The [State of the Union][sotu] address is an annual speech given by the Presiden ## Usage ```javascript -var sotu = require( '@stdlib/datasets/sotu' ); +const sotu = require( '@stdlib/datasets/sotu' ); ``` #### sotu( \[options] ) @@ -43,7 +43,7 @@ var sotu = require( '@stdlib/datasets/sotu' ); Returns [State of the Union][sotu] addresses. ```javascript -var speeches = sotu(); +const speeches = sotu(); // returns [{...},{...},...] ``` @@ -64,7 +64,7 @@ The function accepts the following `options`: To retrieve speeches by one or more Presidents, set the `name` option. ```javascript -var speeches = sotu({ +let speeches = sotu({ 'name': 'Barack Obama' }); // returns [{...},{...},...] @@ -81,7 +81,7 @@ speeches = sotu({ To retrieve speeches from Presidents belonging to a particular political party, set the `party` option. ```javascript -var speeches = sotu({ +let speeches = sotu({ 'party': 'Democratic' }); // returns [{...},{...},...] @@ -109,7 +109,7 @@ The following parties are recognized: To retrieve speeches from one or more years, set the `year` option. ```javascript -var speeches = sotu({ +let speeches = sotu({ 'year': 2009 }); // returns [{...}] @@ -126,7 +126,7 @@ speeches = sotu({ To specify a range of consecutive years, set the `range` option, where the first element corresponds to the starting year and the second element corresponds to the final year. ```javascript -var speeches = sotu({ +const speeches = sotu({ 'range': [ 2009, 2016 ] }); // returns [{...},{...},...] @@ -157,12 +157,10 @@ var speeches = sotu({ ```javascript -var sotu = require( '@stdlib/datasets/sotu' ); - -var speeches; +const sotu = require( '@stdlib/datasets/sotu' ); // Get a range of speeches: -speeches = sotu({ +let speeches = sotu({ 'range': [ 2009, 2013 ] }); // returns [...] diff --git a/lib/node_modules/@stdlib/datasets/spache-revised/README.md b/lib/node_modules/@stdlib/datasets/spache-revised/README.md index c45f5c459079..6a28c358a7d9 100644 --- a/lib/node_modules/@stdlib/datasets/spache-revised/README.md +++ b/lib/node_modules/@stdlib/datasets/spache-revised/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var words = require( '@stdlib/datasets/spache-revised' ); +const words = require( '@stdlib/datasets/spache-revised' ); ``` #### words() @@ -35,7 +35,7 @@ var words = require( '@stdlib/datasets/spache-revised' ); Returns a [list][@klare:1974a] of simple American-English words (revised Spache). ```javascript -var data = words(); +const data = words(); /* returns [ 'a', @@ -60,18 +60,16 @@ var data = words(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var words = require( '@stdlib/datasets/spache-revised' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const words = require( '@stdlib/datasets/spache-revised' ); -var data = words(); -var len = data.length; -var idx; -var i; +const data = words(); +const len = data.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/spam-assassin/README.md b/lib/node_modules/@stdlib/datasets/spam-assassin/README.md index 60fbcf3f0084..9493ce49f6c7 100644 --- a/lib/node_modules/@stdlib/datasets/spam-assassin/README.md +++ b/lib/node_modules/@stdlib/datasets/spam-assassin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var corpus = require( '@stdlib/datasets/spam-assassin' ); +const corpus = require( '@stdlib/datasets/spam-assassin' ); ``` #### corpus() @@ -41,7 +41,7 @@ var corpus = require( '@stdlib/datasets/spam-assassin' ); Returns the [Spam Assassin][spam-assassin] public mail corpus. ```javascript -var data = corpus(); +const data = corpus(); // returns [{...},{...},...] ``` @@ -78,13 +78,10 @@ The `checksum` object contains the following fields: ```javascript -var corpus = require( '@stdlib/datasets/spam-assassin' ); +const corpus = require( '@stdlib/datasets/spam-assassin' ); -var data; -var i; - -data = corpus(); -for ( i = 0; i < data.length; i++ ) { +const data = corpus(); +for ( let i = 0; i < data.length; i++ ) { console.log( 'Character Count: %d', data[ i ].text.length ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/ssa-us-births-2000-2014/README.md b/lib/node_modules/@stdlib/datasets/ssa-us-births-2000-2014/README.md index 925027daa320..744ff31b46c0 100644 --- a/lib/node_modules/@stdlib/datasets/ssa-us-births-2000-2014/README.md +++ b/lib/node_modules/@stdlib/datasets/ssa-us-births-2000-2014/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/ssa-us-births-2000-2014' ); +const dataset = require( '@stdlib/datasets/ssa-us-births-2000-2014' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/ssa-us-births-2000-2014' ); Returns US birth data from 2000 to 2014, as provided by the Social Security Administration. ```javascript -var data = dataset(); +const data = dataset(); // returns [ {...}, ... ] ``` @@ -58,8 +58,8 @@ Each element in the returned database has the following fields: ```javascript -var incrmean = require( '@stdlib/stats/incr/mean' ); -var dataset = require( '@stdlib/datasets/ssa-us-births-2000-2014' ); +const incrmean = require( '@stdlib/stats/incr/mean' ); +const dataset = require( '@stdlib/datasets/ssa-us-births-2000-2014' ); function mean( a, b ) { return ( a + b ) / 2.0; @@ -76,19 +76,16 @@ function reldiff( a, b ) { */ // Retrieve the data: -var data = dataset(); +const data = dataset(); // Initialize arrays for storing births for particular day numbers: -var d6or20 = [ [], [], [], [], [], [], [] ]; -var d13 = [ [], [], [], [], [], [], [] ]; +const d6or20 = [ [], [], [], [], [], [], [] ]; +const d13 = [ [], [], [], [], [], [], [] ]; // Extract the day number data... -var d; -var w; -var i; -for ( i = 0; i < data.length; i++ ) { - d = data[ i ].date_of_month; - w = data[ i ].day_of_week; +for ( let i = 0; i < data.length; i++ ) { + const d = data[ i ].date_of_month; + const w = data[ i ].day_of_week; if ( d === 6 ) { // Average of days 6 and 20 for the same month: d6or20[ w-1 ].push( mean( data[ i ].births, data[ i+14 ].births ) ); @@ -98,27 +95,23 @@ for ( i = 0; i < data.length; i++ ) { } // Initialize accumulators for computing the average relative difference... -var means = []; -for ( i = 0; i < 7; i++ ) { +const means = []; +for ( let i = 0; i < 7; i++ ) { means.push( incrmean() ); } // Compute the average relative difference between days 6/20 with day 13... -var l1; -var l2; -var mu; -var j; -for ( i = 0; i < 7; i++ ) { - l1 = d13[ i ]; - l2 = d6or20[ i ]; - mu = means[ i ]; - for ( j = 0; j < l1.length; j++ ) { +for ( let i = 0; i < 7; i++ ) { + const l1 = d13[ i ]; + const l2 = d6or20[ i ]; + const mu = means[ i ]; + for ( let j = 0; j < l1.length; j++ ) { mu( reldiff( l1[ j ], l2[ j ] ) ); } } // Print the results... -for ( i = 0; i < 7; i++ ) { +for ( let i = 0; i < 7; i++ ) { console.log( '%d: %d%', i+1, means[ i ]().toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/standard-card-deck/README.md b/lib/node_modules/@stdlib/datasets/standard-card-deck/README.md index b8034a89216e..2c92e8718fd6 100644 --- a/lib/node_modules/@stdlib/datasets/standard-card-deck/README.md +++ b/lib/node_modules/@stdlib/datasets/standard-card-deck/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cards = require( '@stdlib/datasets/standard-card-deck' ); +const cards = require( '@stdlib/datasets/standard-card-deck' ); ``` #### cards() @@ -35,7 +35,7 @@ var cards = require( '@stdlib/datasets/standard-card-deck' ); Returns a list of two or three letter abbreviations for each card in a standard 52-card deck. ```javascript -var list = cards(); +const list = cards(); // returns [ 'AC', '2C', '3C', ... ] ``` @@ -73,20 +73,15 @@ Suit abbreviations: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cards = require( '@stdlib/datasets/standard-card-deck' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const cards = require( '@stdlib/datasets/standard-card-deck' ); -var list; -var len; -var idx; -var i; - -list = cards(); -len = list.length; +const list = cards(); +const len = list.length; // Select random cards from the list... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/stopwords-en/README.md b/lib/node_modules/@stdlib/datasets/stopwords-en/README.md index 02248eec7f29..09b85c5cfa81 100644 --- a/lib/node_modules/@stdlib/datasets/stopwords-en/README.md +++ b/lib/node_modules/@stdlib/datasets/stopwords-en/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var stopwords = require( '@stdlib/datasets/stopwords-en' ); +const stopwords = require( '@stdlib/datasets/stopwords-en' ); ``` #### stopwords() @@ -41,7 +41,7 @@ var stopwords = require( '@stdlib/datasets/stopwords-en' ); Returns a list of 301 english [stop words][stopwords]. ```javascript -var list = stopwords(); +const list = stopwords(); /* returns [ 'a', @@ -65,18 +65,16 @@ var list = stopwords(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var stopwords = require( '@stdlib/datasets/stopwords-en' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const stopwords = require( '@stdlib/datasets/stopwords-en' ); -var list = stopwords(); -var len = list.length; -var idx; -var i; +const list = stopwords(); +const len = list.length; // Select random words from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/suthaharan-multi-hop-sensor-network/README.md b/lib/node_modules/@stdlib/datasets/suthaharan-multi-hop-sensor-network/README.md index 3b1f3fba1a70..fce4e69d4705 100644 --- a/lib/node_modules/@stdlib/datasets/suthaharan-multi-hop-sensor-network/README.md +++ b/lib/node_modules/@stdlib/datasets/suthaharan-multi-hop-sensor-network/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/suthaharan-multi-hop-sensor-network' ); +const dataset = require( '@stdlib/datasets/suthaharan-multi-hop-sensor-network' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/suthaharan-multi-hop-sensor-network' ); Returns a dataset consisting of labeled wireless sensor network data set collected from a multi-hop wireless sensor network deployment using TelosB motes. ```javascript -var data = dataset(); +const data = dataset(); /* returns [ { @@ -76,25 +76,19 @@ var data = dataset(); ```javascript -var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); -var data = require( '@stdlib/datasets/suthaharan-multi-hop-sensor-network' ); - -var acc; -var d; -var i; -var j; -var k; +const incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); +const data = require( '@stdlib/datasets/suthaharan-multi-hop-sensor-network' ); // Get the sensor data: -d = data(); +const d = data(); // For each mote, test for an outlier temperature measurement... -i = 0; -for ( j = 0; j < 4; j++ ) { - k = j + 1; +let i = 0; +for ( let j = 0; j < 4; j++ ) { + const k = j + 1; // Create a new accumulator for performing Grubbs' test: - acc = incrgrubbs(); + const acc = incrgrubbs(); // Update the accumulator with temperature data... while ( i < d.length && d[ i ].mote_id === k ) { diff --git a/lib/node_modules/@stdlib/datasets/suthaharan-single-hop-sensor-network/README.md b/lib/node_modules/@stdlib/datasets/suthaharan-single-hop-sensor-network/README.md index 3c4679f81a24..f64c96b36eab 100644 --- a/lib/node_modules/@stdlib/datasets/suthaharan-single-hop-sensor-network/README.md +++ b/lib/node_modules/@stdlib/datasets/suthaharan-single-hop-sensor-network/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dataset = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); +const dataset = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); ``` #### dataset() @@ -35,7 +35,7 @@ var dataset = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ) Returns a dataset consisting of labeled wireless sensor network data set collected from a simple single-hop wireless sensor network deployment using TelosB motes. ```javascript -var data = dataset(); +const data = dataset(); /* returns [ { @@ -76,25 +76,19 @@ var data = dataset(); ```javascript -var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); -var data = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); - -var acc; -var d; -var i; -var j; -var k; +const incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); +const data = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); // Get the sensor data: -d = data(); +const d = data(); // For each mote, test for an outlier temperature measurement... -i = 0; -for ( j = 0; j < 4; j++ ) { - k = j + 1; +let i = 0; +for ( let j = 0; j < 4; j++ ) { + const k = j + 1; // Create a new accumulator for performing Grubbs' test: - acc = incrgrubbs(); + const acc = incrgrubbs(); // Update the accumulator with temperature data... while ( i < d.length && d[ i ].mote_id === k ) { diff --git a/lib/node_modules/@stdlib/datasets/us-states-abbr/README.md b/lib/node_modules/@stdlib/datasets/us-states-abbr/README.md index fd6a0e211ba6..d02bd89e69da 100644 --- a/lib/node_modules/@stdlib/datasets/us-states-abbr/README.md +++ b/lib/node_modules/@stdlib/datasets/us-states-abbr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var abbr = require( '@stdlib/datasets/us-states-abbr' ); +const abbr = require( '@stdlib/datasets/us-states-abbr' ); ``` #### abbr() @@ -35,7 +35,7 @@ var abbr = require( '@stdlib/datasets/us-states-abbr' ); Returns a list of US state two-letter abbreviations in alphabetical order according to state name. ```javascript -var data = abbr(); +const data = abbr(); /* returns [ 'AL', @@ -105,18 +105,16 @@ var data = abbr(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var abbr = require( '@stdlib/datasets/us-states-abbr' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const abbr = require( '@stdlib/datasets/us-states-abbr' ); -var data = abbr(); -var len = data.length; -var idx; -var i; +const data = abbr(); +const len = data.length; // Select random abbreviations from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/us-states-capitals-names/README.md b/lib/node_modules/@stdlib/datasets/us-states-capitals-names/README.md index 1954eb970624..fa6efddc4fdf 100644 --- a/lib/node_modules/@stdlib/datasets/us-states-capitals-names/README.md +++ b/lib/node_modules/@stdlib/datasets/us-states-capitals-names/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var table = require( '@stdlib/datasets/us-states-capitals-names' ); +const table = require( '@stdlib/datasets/us-states-capitals-names' ); ``` #### table() @@ -35,7 +35,7 @@ var table = require( '@stdlib/datasets/us-states-capitals-names' ); Returns an object mapping US state capitals to state names. ```javascript -var t = table(); +const t = table(); /* returns { 'Montgomery': 'Alabama', @@ -103,23 +103,19 @@ var t = table(); ```javascript -var capitalize = require( '@stdlib/string/capitalize' ); -var table = require( '@stdlib/datasets/us-states-capitals-names' ); +const capitalize = require( '@stdlib/string/capitalize' ); +const table = require( '@stdlib/datasets/us-states-capitals-names' ); -var tbl = table(); +const tbl = table(); function getState( capital ) { - var state; - var parts; - var i; - // Ensure the first letter of each word comprising a capital is capitalized... - parts = capital.split( ' ' ); - for ( i = 0; i < parts.length; i++ ) { + const parts = capital.split( ' ' ); + for ( let i = 0; i < parts.length; i++ ) { parts[ i ] = capitalize( parts[ i ] ); } // Get the state name: - state = tbl[ parts.join( ' ' ) ]; + const state = tbl[ parts.join( ' ' ) ]; // Ensure a valid capital name was provided... if ( state === void 0 ) { diff --git a/lib/node_modules/@stdlib/datasets/us-states-capitals/README.md b/lib/node_modules/@stdlib/datasets/us-states-capitals/README.md index 974c394bfb27..3e55116d5bc7 100644 --- a/lib/node_modules/@stdlib/datasets/us-states-capitals/README.md +++ b/lib/node_modules/@stdlib/datasets/us-states-capitals/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var capitals = require( '@stdlib/datasets/us-states-capitals' ); +const capitals = require( '@stdlib/datasets/us-states-capitals' ); ``` #### capitals() @@ -35,7 +35,7 @@ var capitals = require( '@stdlib/datasets/us-states-capitals' ); Returns a list of US state capitals in alphabetical order according to state name. ```javascript -var data = capitals(); +const data = capitals(); /* returns [ 'Montgomery', @@ -105,18 +105,16 @@ var data = capitals(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var capitals = require( '@stdlib/datasets/us-states-capitals' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const capitals = require( '@stdlib/datasets/us-states-capitals' ); -var data = capitals(); -var len = data.length; -var idx; -var i; +const data = capitals(); +const len = data.length; // Select random capitals from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/datasets/us-states-names-capitals/README.md b/lib/node_modules/@stdlib/datasets/us-states-names-capitals/README.md index c949334250fd..2339684d8b1a 100644 --- a/lib/node_modules/@stdlib/datasets/us-states-names-capitals/README.md +++ b/lib/node_modules/@stdlib/datasets/us-states-names-capitals/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var table = require( '@stdlib/datasets/us-states-names-capitals' ); +const table = require( '@stdlib/datasets/us-states-names-capitals' ); ``` #### table() @@ -35,7 +35,7 @@ var table = require( '@stdlib/datasets/us-states-names-capitals' ); Returns an object mapping US state names to state capitals. ```javascript -var t = table(); +const t = table(); /* returns { 'Alabama': 'Montgomery', @@ -103,23 +103,19 @@ var t = table(); ```javascript -var capitalize = require( '@stdlib/string/capitalize' ); -var table = require( '@stdlib/datasets/us-states-names-capitals' ); +const capitalize = require( '@stdlib/string/capitalize' ); +const table = require( '@stdlib/datasets/us-states-names-capitals' ); -var tbl = table(); +const tbl = table(); function getCapital( state ) { - var capital; - var parts; - var i; - // Ensure the first letter of each word comprising a state name is capitalized... - parts = state.split( ' ' ); - for ( i = 0; i < parts.length; i++ ) { + const parts = state.split( ' ' ); + for ( let i = 0; i < parts.length; i++ ) { parts[ i ] = capitalize( parts[ i ] ); } // Get the state capital: - capital = tbl[ parts.join( ' ' ) ]; + const capital = tbl[ parts.join( ' ' ) ]; // Ensure a valid state name was provided... if ( capital === void 0 ) { diff --git a/lib/node_modules/@stdlib/datasets/us-states-names/README.md b/lib/node_modules/@stdlib/datasets/us-states-names/README.md index 8f877d307aa7..208ff6329a42 100644 --- a/lib/node_modules/@stdlib/datasets/us-states-names/README.md +++ b/lib/node_modules/@stdlib/datasets/us-states-names/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var names = require( '@stdlib/datasets/us-states-names' ); +const names = require( '@stdlib/datasets/us-states-names' ); ``` #### names() @@ -35,7 +35,7 @@ var names = require( '@stdlib/datasets/us-states-names' ); Returns a list of US state names in alphabetical order. ```javascript -var data = names(); +const data = names(); /* returns [ 'Alabama', @@ -105,18 +105,16 @@ var data = names(); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var names = require( '@stdlib/datasets/us-states-names' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const names = require( '@stdlib/datasets/us-states-names' ); -var data = names(); -var len = data.length; -var idx; -var i; +const data = names(); +const len = data.length; // Select random names from the list... -for ( i = 0; i < 100; i++ ) { - idx = floor( randu()*len ); +for ( let i = 0; i < 100; i++ ) { + const idx = floor( randu()*len ); console.log( data[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/error/README.md b/lib/node_modules/@stdlib/error/README.md index 28d4aaf28368..1023adc4237f 100644 --- a/lib/node_modules/@stdlib/error/README.md +++ b/lib/node_modules/@stdlib/error/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/error' ); +const ns = require( '@stdlib/error' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/error' ); Errors. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -63,8 +63,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/error' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/error' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/error/reviver/README.md b/lib/node_modules/@stdlib/error/reviver/README.md index f5d751cd59ff..bf82191e5daa 100644 --- a/lib/node_modules/@stdlib/error/reviver/README.md +++ b/lib/node_modules/@stdlib/error/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveError = require( '@stdlib/error/reviver' ); +const reviveError = require( '@stdlib/error/reviver' ); ``` #### reviveError( key, value ) @@ -45,11 +45,11 @@ var reviveError = require( '@stdlib/error/reviver' ); Revives a JSON-serialized [error][@stdlib/error/to-json] object. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"TypeError","message":"beep"}'; +const str = '{"type":"TypeError","message":"beep"}'; -var err = parseJSON( str, reviveError ); +const err = parseJSON( str, reviveError ); // returns ``` @@ -88,14 +88,14 @@ For details on the JSON serialization format, see [`@stdlib/error/to-json`][@std ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var err2json = require( '@stdlib/error/to-json' ); -var reviveError = require( '@stdlib/error/reviver' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const err2json = require( '@stdlib/error/to-json' ); +const reviveError = require( '@stdlib/error/reviver' ); -var err1 = new SyntaxError( 'bad syntax' ); +const err1 = new SyntaxError( 'bad syntax' ); // returns -var json = err2json( err1 ); +const json = err2json( err1 ); /* e.g., returns { 'type': 'SyntaxError', @@ -105,13 +105,13 @@ var json = err2json( err1 ); } */ -var str = JSON.stringify( json ); +const str = JSON.stringify( json ); // e.g., returns '{"type":"SyntaxError","name":"SyntaxError","message":"bad syntax","stack":"..."}' -var err2 = parseJSON( str, reviveError ); +const err2 = parseJSON( str, reviveError ); // returns -var bool = ( err1.message === err2.message ); +let bool = ( err1.message === err2.message ); // returns true bool = ( err1.stack === err2.stack ); diff --git a/lib/node_modules/@stdlib/error/to-json/README.md b/lib/node_modules/@stdlib/error/to-json/README.md index ade66f4ab882..ba353aa5a98a 100644 --- a/lib/node_modules/@stdlib/error/to-json/README.md +++ b/lib/node_modules/@stdlib/error/to-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var error2json = require( '@stdlib/error/to-json' ); +const error2json = require( '@stdlib/error/to-json' ); ``` #### error2json( error ) @@ -45,9 +45,9 @@ var error2json = require( '@stdlib/error/to-json' ); Returns a [JSON][json] representation of an [`error`][mdn-error] object. ```javascript -var err = new Error( 'beep' ); +const err = new Error( 'beep' ); -var json = error2json( err ); +const json = error2json( err ); /* e.g., returns { 'type': 'Error', @@ -76,11 +76,11 @@ The function also serializes **all** `enumerable` properties. ```javascript -var err = new Error( 'beep' ); +const err = new Error( 'beep' ); err.a = 'b'; err.c = { 'd': 'e' }; -var json = error2json( err ); +const json = error2json( err ); /* e.g., returns { 'type': 'Error', @@ -127,9 +127,9 @@ var json = error2json( err ); CustomError.prototype = Object.create( TypeError.prototype ); CustomError.prototype.constructor = CustomError; - var err = new CustomError( 'boop' ); + const err = new CustomError( 'boop' ); - var json = error2json( err ); + const json = error2json( err ); /* e.g., returns { 'type': 'TypeError', @@ -153,10 +153,10 @@ var json = error2json( err ); ```javascript -var error2json = require( '@stdlib/error/to-json' ); +const error2json = require( '@stdlib/error/to-json' ); -var err = new Error( 'beep' ); -var out = error2json( err ); +let err = new Error( 'beep' ); +let out = error2json( err ); /* e.g., returns { 'type': 'Error', diff --git a/lib/node_modules/@stdlib/error/tools/README.md b/lib/node_modules/@stdlib/error/tools/README.md index 4c733d2741b4..bb9e41f301de 100644 --- a/lib/node_modules/@stdlib/error/tools/README.md +++ b/lib/node_modules/@stdlib/error/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tools = require( '@stdlib/error/tools' ); +const tools = require( '@stdlib/error/tools' ); ``` #### tools @@ -35,7 +35,7 @@ var tools = require( '@stdlib/error/tools' ); Namespace containing error tools. ```javascript -var o = tools; +const o = tools; // returns {...} ``` @@ -70,8 +70,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var tools = require( '@stdlib/error/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const tools = require( '@stdlib/error/tools' ); console.log( objectKeys( tools ) ); ``` diff --git a/lib/node_modules/@stdlib/error/tools/database/README.md b/lib/node_modules/@stdlib/error/tools/database/README.md index c6427a5e9b41..a5a61048dbfc 100644 --- a/lib/node_modules/@stdlib/error/tools/database/README.md +++ b/lib/node_modules/@stdlib/error/tools/database/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var database = require( '@stdlib/error/tools/database' ); +const database = require( '@stdlib/error/tools/database' ); ``` #### database() @@ -35,7 +35,7 @@ var database = require( '@stdlib/error/tools/database' ); Returns a mapping of standard library error codes to their corresponding error messages. ```javascript -var db = database(); +const db = database(); // returns {...} ``` @@ -50,20 +50,20 @@ var db = database(); ```javascript -var invertObject = require( '@stdlib/utils/object-inverse' ); -var replace = require( '@stdlib/string/replace' ); -var database = require( '@stdlib/error/tools/database' ); +const invertObject = require( '@stdlib/utils/object-inverse' ); +const replace = require( '@stdlib/string/replace' ); +const database = require( '@stdlib/error/tools/database' ); -var db = database(); -var errorMap = invertObject( db ); -var RE_ERR_MSG = /Error\( '([^']+)' \)/; +const db = database(); +const errorMap = invertObject( db ); +const RE_ERR_MSG = /Error\( '([^']+)' \)/; function replacer( match, p1 ) { return 'Error( formatProdErrorMessage( \'' + errorMap[ p1 ] + '\' ) )'; } -var code = 'throw new Error( \'insufficient input arguments. Must provide at least one iterator function.\' );'; -var transformed = replace( code, RE_ERR_MSG, replacer ); +const code = 'throw new Error( \'insufficient input arguments. Must provide at least one iterator function.\' );'; +const transformed = replace( code, RE_ERR_MSG, replacer ); // returns 'throw new Error( formatProdErrorMessage( \'04\' ) );' ``` diff --git a/lib/node_modules/@stdlib/error/tools/fmtprodmsg-factory/README.md b/lib/node_modules/@stdlib/error/tools/fmtprodmsg-factory/README.md index 1bb4066c1e03..2a700601f733 100644 --- a/lib/node_modules/@stdlib/error/tools/fmtprodmsg-factory/README.md +++ b/lib/node_modules/@stdlib/error/tools/fmtprodmsg-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fmtprodmsgFactory = require( '@stdlib/error/tools/fmtprodmsg-factory' ); +const fmtprodmsgFactory = require( '@stdlib/error/tools/fmtprodmsg-factory' ); ``` #### fmtprodmsgFactory( \[options] ) @@ -35,11 +35,11 @@ var fmtprodmsgFactory = require( '@stdlib/error/tools/fmtprodmsg-factory' ); Returns a `function` which formats an error message for production. ```javascript -var opts = {}; -var fcn = fmtprodmsgFactory( opts ); +const opts = {}; +const fcn = fmtprodmsgFactory( opts ); // returns -var msg = fcn( '3' ); +const msg = fcn( '3' ); // returns 'Minified stdlib error code: 3. Visit https://stdlib.io/docs/api/latest/error-decoder.html?code=3 for the full message.' ``` @@ -51,28 +51,28 @@ The function accepts the following `options`: To set a custom URL, use the `url` option: ```javascript -var opts = { +const opts = { 'url': 'https://stdlib.io/error-decoder.html' }; -var fcn = fmtprodmsgFactory( opts ); +const fcn = fmtprodmsgFactory( opts ); // returns -var msg = fcn( '8' ); +const msg = fcn( '8' ); // returns 'Minified stdlib error code: 8. Visit https://stdlib.io/error-decoder.html?code=8 for the full message.' ``` To change the error message template, use the `message` option: ```javascript -var opts = { +const opts = { 'message': 'Error code: {{code}}. See: {{url}}.' }; -var fcn = fmtprodmsgFactory( opts ); +const fcn = fmtprodmsgFactory( opts ); // returns -var msg = fcn( '27', 'foo', 'bar' ); +const msg = fcn( '27', 'foo', 'bar' ); // returns 'Error code: 27. See: https://stdlib.io/docs/api/latest/error-decoder.html?code=27&arg[]=foo&arg[]=bar.' ``` @@ -87,10 +87,10 @@ var msg = fcn( '27', 'foo', 'bar' ); ```javascript -var fmtprodmsgFactory = require( '@stdlib/error/tools/fmtprodmsg-factory' ); +const fmtprodmsgFactory = require( '@stdlib/error/tools/fmtprodmsg-factory' ); -var formatProdErrorMessage = fmtprodmsgFactory(); -var msg = formatProdErrorMessage( '3', 'foo' ); +const formatProdErrorMessage = fmtprodmsgFactory(); +let msg = formatProdErrorMessage( '3', 'foo' ); // returns 'Minified stdlib error code: 3. Visit https://stdlib.io/docs/api/latest/error-decoder.html?code=3&arg[]=foo for the full message.' msg = formatProdErrorMessage( '5', 'foo', 'bar' ); diff --git a/lib/node_modules/@stdlib/error/tools/fmtprodmsg/README.md b/lib/node_modules/@stdlib/error/tools/fmtprodmsg/README.md index eecb1a436de2..fa32f77e4e65 100644 --- a/lib/node_modules/@stdlib/error/tools/fmtprodmsg/README.md +++ b/lib/node_modules/@stdlib/error/tools/fmtprodmsg/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fmtprodmsg = require( '@stdlib/error/tools/fmtprodmsg' ); +const fmtprodmsg = require( '@stdlib/error/tools/fmtprodmsg' ); ``` #### fmtprodmsg( code, ...args ) @@ -35,7 +35,7 @@ var fmtprodmsg = require( '@stdlib/error/tools/fmtprodmsg' ); Formats an error message for production. ```javascript -var msg = fmtprodmsg( '27', 'foo', 'bar' ); +const msg = fmtprodmsg( '27', 'foo', 'bar' ); // returns 'https://stdlib.io/e/27?arg[]=foo&arg[]=bar' ``` @@ -58,9 +58,9 @@ var msg = fmtprodmsg( '27', 'foo', 'bar' ); ```javascript -var fmtprodmsg = require( '@stdlib/error/tools/fmtprodmsg' ); +const fmtprodmsg = require( '@stdlib/error/tools/fmtprodmsg' ); -var msg = fmtprodmsg( '3', 'foo' ); +let msg = fmtprodmsg( '3', 'foo' ); // returns 'https://stdlib.io/e?code=3&arg[]=foo' msg = fmtprodmsg( '5', 'foo', 'bar' ); diff --git a/lib/node_modules/@stdlib/error/tools/id2msg/README.md b/lib/node_modules/@stdlib/error/tools/id2msg/README.md index 1b74e6d45f77..1000b49a36c7 100644 --- a/lib/node_modules/@stdlib/error/tools/id2msg/README.md +++ b/lib/node_modules/@stdlib/error/tools/id2msg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var id2msg = require( '@stdlib/error/tools/id2msg' ); +const id2msg = require( '@stdlib/error/tools/id2msg' ); ``` #### id2msg( id ) @@ -45,14 +45,14 @@ var id2msg = require( '@stdlib/error/tools/id2msg' ); Returns an error message corresponding to a provided two-character error identifier. ```javascript -var v = id2msg( '8t' ); +const v = id2msg( '8t' ); // e.g., returns 'invalid option. `%s` option must be an array. Option: `%s`.' ``` If provided an unrecognized error identifier, the function returns `null`. ```javascript -var v = id2msg( 'beep_boop' ); +const v = id2msg( 'beep_boop' ); // returns null ``` @@ -79,13 +79,9 @@ var v = id2msg( 'beep_boop' ); ```javascript -var id2msg = require( '@stdlib/error/tools/id2msg' ); +const id2msg = require( '@stdlib/error/tools/id2msg' ); -var list; -var v; -var i; - -list = [ +const list = [ '01', '03', '8t', @@ -93,8 +89,8 @@ list = [ '9W' ]; -for ( i = 0; i < list.length; i++ ) { - v = list[ i ]; +for ( let i = 0; i < list.length; i++ ) { + const v = list[ i ]; console.log( 'id: "%s". msg: "%s".', v, id2msg( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/error/tools/id2pkg/README.md b/lib/node_modules/@stdlib/error/tools/id2pkg/README.md index 75f8ff1f83e0..4e362a226052 100644 --- a/lib/node_modules/@stdlib/error/tools/id2pkg/README.md +++ b/lib/node_modules/@stdlib/error/tools/id2pkg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var id2pkg = require( '@stdlib/error/tools/id2pkg' ); +const id2pkg = require( '@stdlib/error/tools/id2pkg' ); ``` #### id2pkg( id ) @@ -45,14 +45,14 @@ var id2pkg = require( '@stdlib/error/tools/id2pkg' ); Returns the package name associated with a specified error identifier prefix. ```javascript -var v = id2pkg( '0H5' ); +const v = id2pkg( '0H5' ); // returns '@stdlib/math/base/special/sin' ``` If provided an unrecognized error identifier prefix, the function returns `null`. ```javascript -var v = id2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); +const v = id2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,17 @@ var v = id2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var id2pkg = require( '@stdlib/error/tools/id2pkg' ); +const id2pkg = require( '@stdlib/error/tools/id2pkg' ); -var list; -var len; -var v; -var i; - -list = [ +const list = [ '001', '0A3', '0Ab' ]; -len = list.length; +const len = list.length; -for ( i = 0; i < len; i++ ) { - v = list[ i ]; +for ( let i = 0; i < len; i++ ) { + const v = list[ i ]; console.log( 'id: %s. pkg: %s.', v, id2pkg( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/error/tools/msg2id/README.md b/lib/node_modules/@stdlib/error/tools/msg2id/README.md index 59dfe88ba30d..5e0dfeb3216b 100644 --- a/lib/node_modules/@stdlib/error/tools/msg2id/README.md +++ b/lib/node_modules/@stdlib/error/tools/msg2id/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var msg2id = require( '@stdlib/error/tools/msg2id' ); +const msg2id = require( '@stdlib/error/tools/msg2id' ); ``` #### msg2id( msg ) @@ -45,14 +45,14 @@ var msg2id = require( '@stdlib/error/tools/msg2id' ); Returns a two-character error identifier corresponding to a provided error message. ```javascript -var v = msg2id( 'invalid value. `%s` must be a number. Value: `%s`.' ); +const v = msg2id( 'invalid value. `%s` must be a number. Value: `%s`.' ); // e.g., returns '6d' ``` If provided an unrecognized error message, the function returns `null`. ```javascript -var v = msg2id( 'beep boop baz' ); +const v = msg2id( 'beep boop baz' ); // returns null ``` @@ -77,19 +77,15 @@ var v = msg2id( 'beep boop baz' ); ```javascript -var msg2id = require( '@stdlib/error/tools/msg2id' ); +const msg2id = require( '@stdlib/error/tools/msg2id' ); -var list; -var v; -var i; - -list = [ +const list = [ 'invalid argument. First argument must be a number and not `NaN`. Value: `%s`.', 'invalid argument. First argument must be a positive integer. Value: `%s`.' ]; -for ( i = 0; i < list.length; i++ ) { - v = list[ i ]; +for ( let i = 0; i < list.length; i++ ) { + const v = list[ i ]; console.log( 'msg: "%s". id: "%s".', v, msg2id( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/error/tools/pkg2id/README.md b/lib/node_modules/@stdlib/error/tools/pkg2id/README.md index 52dafdc6be77..ae909916732b 100644 --- a/lib/node_modules/@stdlib/error/tools/pkg2id/README.md +++ b/lib/node_modules/@stdlib/error/tools/pkg2id/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pkg2id = require( '@stdlib/error/tools/pkg2id' ); +const pkg2id = require( '@stdlib/error/tools/pkg2id' ); ``` #### pkg2id( pkg ) @@ -45,14 +45,14 @@ var pkg2id = require( '@stdlib/error/tools/pkg2id' ); Returns the error identifier prefix associated with a specified package name. ```javascript -var v = pkg2id( '@stdlib/math/base/special/sin' ); +const v = pkg2id( '@stdlib/math/base/special/sin' ); // returns '0YK' ``` If provided an unrecognized `pkg`, the function returns `null`. ```javascript -var v = pkg2id( 'unrecognized_pkg_beep_boop_bop_bip' ); +const v = pkg2id( 'unrecognized_pkg_beep_boop_bop_bip' ); // returns null ``` @@ -69,7 +69,7 @@ var v = pkg2id( 'unrecognized_pkg_beep_boop_bop_bip' ); - The function supports providing both internal and standalone package names. ```javascript - var v = pkg2id( '@stdlib/math-base-special-sin' ); + const v = pkg2id( '@stdlib/math-base-special-sin' ); // returns '0YK' ``` @@ -88,14 +88,14 @@ var v = pkg2id( 'unrecognized_pkg_beep_boop_bop_bip' ); ```javascript -var formatProdErrorMessage = require( '@stdlib/error/tools/fmtprodmsg' ); -var pkg2id = require( '@stdlib/error/tools/pkg2id' ); +const formatProdErrorMessage = require( '@stdlib/error/tools/fmtprodmsg' ); +const pkg2id = require( '@stdlib/error/tools/pkg2id' ); -var prefix = pkg2id( '@stdlib/math/base/special/sin' ); -var errorCode = '23'; -var code = prefix + errorCode; +const prefix = pkg2id( '@stdlib/math/base/special/sin' ); +const errorCode = '23'; +const code = prefix + errorCode; -var msg = formatProdErrorMessage( code ); +const msg = formatProdErrorMessage( code ); console.log( msg ); // => ``` diff --git a/lib/node_modules/@stdlib/fs/README.md b/lib/node_modules/@stdlib/fs/README.md index 3c9439237285..5fa15274c081 100644 --- a/lib/node_modules/@stdlib/fs/README.md +++ b/lib/node_modules/@stdlib/fs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fs = require( '@stdlib/fs' ); +const fs = require( '@stdlib/fs' ); ``` #### fs @@ -35,7 +35,7 @@ var fs = require( '@stdlib/fs' ); Namespace for filesystem APIs. ```javascript -var f = fs; +const f = fs; // returns {...} ``` @@ -74,8 +74,8 @@ var f = fs; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var fs = require( '@stdlib/fs' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const fs = require( '@stdlib/fs' ); console.log( objectKeys( fs ) ); ``` diff --git a/lib/node_modules/@stdlib/fs/append-file/README.md b/lib/node_modules/@stdlib/fs/append-file/README.md index 592f619dabc9..910657f51a94 100644 --- a/lib/node_modules/@stdlib/fs/append-file/README.md +++ b/lib/node_modules/@stdlib/fs/append-file/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var appendFile = require( '@stdlib/fs/append-file' ); +const appendFile = require( '@stdlib/fs/append-file' ); ``` #### appendFile( file, data\[, options], clbk ) @@ -35,9 +35,9 @@ var appendFile = require( '@stdlib/fs/append-file' ); Asynchronously appends `data` to a `file`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); appendFile( fpath, 'beep boop\n', onAppend ); @@ -52,10 +52,10 @@ function onAppend( error ) { The `data` argument may be either a `string` or a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var join = require( 'path' ).join; -var string2buffer = require( '@stdlib/buffer/from-string' ); +const join = require( 'path' ).join; +const string2buffer = require( '@stdlib/buffer/from-string' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); appendFile( fpath, string2buffer( 'beep boop\n' ), onAppend ); @@ -74,11 +74,11 @@ The function accepts the same `options` and has the same defaults as [`fs.append Synchronously appends `data` to a `file`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var err = appendFile.sync( fpath, 'beep boop\n' ); +const err = appendFile.sync( fpath, 'beep boop\n' ); if ( err instanceof Error ) { throw err; } @@ -99,7 +99,7 @@ The function accepts the same `options` and has the same defaults as [`fs.append ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); // Check for directory path existence to prevent an error being thrown... if ( fs.existsSync( '/path/to' ) ) { @@ -112,10 +112,10 @@ The function accepts the same `options` and has the same defaults as [`fs.append ```javascript - var appendFile = require( '@stdlib/fs/append-file' ); + const appendFile = require( '@stdlib/fs/append-file' ); // Explicitly handle the error... - var err = appendFile.sync( '/path/to/file.txt', 'boop beep\n' ); + const err = appendFile.sync( '/path/to/file.txt', 'boop beep\n' ); if ( err instanceof Error ) { // You choose what to do... throw err; @@ -133,14 +133,14 @@ The function accepts the same `options` and has the same defaults as [`fs.append ```javascript -var join = require( 'path' ).join; -var appendFile = require( '@stdlib/fs/append-file' ); +const join = require( 'path' ).join; +const appendFile = require( '@stdlib/fs/append-file' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); // Synchronously append data to a file: -var error = appendFile.sync( fpath, 'beep boop\n', 'utf8' ); +const error = appendFile.sync( fpath, 'beep boop\n', 'utf8' ); // Function successfully executes and returns null console.log( error instanceof Error ); diff --git a/lib/node_modules/@stdlib/fs/close/README.md b/lib/node_modules/@stdlib/fs/close/README.md index ae477a7c3499..39c63581837a 100644 --- a/lib/node_modules/@stdlib/fs/close/README.md +++ b/lib/node_modules/@stdlib/fs/close/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var close = require( '@stdlib/fs/close' ); +const close = require( '@stdlib/fs/close' ); ``` #### close( fd, clbk ) @@ -39,9 +39,9 @@ Asynchronously closes a file descriptor, so that the file descriptor no longer r ```javascript -var openSync = require( '@stdlib/fs/open' ).sync; +const openSync = require( '@stdlib/fs/open' ).sync; -var fd = openSync( __filename ); +const fd = openSync( __filename ); close( fd, done ); function done( error ) { @@ -58,11 +58,11 @@ Synchronously closes a file descriptor. ```javascript -var openSync = require( '@stdlib/fs/open' ).sync; +const openSync = require( '@stdlib/fs/open' ).sync; -var fd = openSync( __filename ); +const fd = openSync( __filename ); -var err = close.sync( fd ); +const err = close.sync( fd ); if ( err instanceof Error ) { throw err; } @@ -91,19 +91,17 @@ if ( err instanceof Error ) { ```javascript -var join = require( 'path' ).join; -var openSync = require( '@stdlib/fs/open' ).sync; -var close = require( '@stdlib/fs/close' ); - -var err; +const join = require( 'path' ).join; +const openSync = require( '@stdlib/fs/open' ).sync; +const close = require( '@stdlib/fs/close' ); /* Sync */ -var fd = openSync( join( __dirname, 'package.json' ), 'r+' ); +let fd = openSync( join( __dirname, 'package.json' ), 'r+' ); if ( fd instanceof Error ) { console.error( fd.message ); } else { - err = close.sync( fd ); + const err = close.sync( fd ); // returns undefined if ( err instanceof Error ) { diff --git a/lib/node_modules/@stdlib/fs/exists/README.md b/lib/node_modules/@stdlib/fs/exists/README.md index 137a34b04b4a..1af11a8b3648 100644 --- a/lib/node_modules/@stdlib/fs/exists/README.md +++ b/lib/node_modules/@stdlib/fs/exists/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exists = require( '@stdlib/fs/exists' ); +const exists = require( '@stdlib/fs/exists' ); ``` #### exists( path, clbk ) @@ -68,7 +68,7 @@ function done( error, bool ) { Synchronously tests whether a path exists on the filesystem. ```javascript -var bool = exists.sync( __dirname ); +const bool = exists.sync( __dirname ); // returns ``` @@ -83,10 +83,10 @@ var bool = exists.sync( __dirname ); - The following is considered an anti-pattern: ```javascript - var path = require( 'path' ); - var readFileSync = require( '@stdlib/fs/read-file' ).sync; + const path = require( 'path' ); + const readFileSync = require( '@stdlib/fs/read-file' ).sync; - var file = path.join( __dirname, 'foo.js' ); + const file = path.join( __dirname, 'foo.js' ); if ( exists.sync( __dirname ) ) { file = readFileSync( file ); } @@ -97,10 +97,10 @@ var bool = exists.sync( __dirname ); Instead, the following pattern is preferred, where `errors` are handled explicitly: ```javascript - var path = require( 'path' ); - var readFileSync = require( '@stdlib/fs/read-file' ).sync; + const path = require( 'path' ); + const readFileSync = require( '@stdlib/fs/read-file' ).sync; - var file = path.join( __dirname, 'foo.js' ); + const file = path.join( __dirname, 'foo.js' ); try { file = readFileSync( file ); } catch ( error ) { @@ -114,10 +114,10 @@ var bool = exists.sync( __dirname ); ```javascript - var path = require( 'path' ); - var writeFileSync = require( '@stdlib/fs/write-file' ).sync; + const path = require( 'path' ); + const writeFileSync = require( '@stdlib/fs/write-file' ).sync; - var file = path.join( __dirname, 'foo.js' ); + const file = path.join( __dirname, 'foo.js' ); if ( exists.sync( file ) ) { console.log( 'Don\'t overwrite the file!' ); } else { @@ -138,7 +138,7 @@ var bool = exists.sync( __dirname ); ```javascript -var exists = require( '@stdlib/fs/exists' ); +const exists = require( '@stdlib/fs/exists' ); /* Sync */ diff --git a/lib/node_modules/@stdlib/fs/open/README.md b/lib/node_modules/@stdlib/fs/open/README.md index 497479136ec5..217935d984aa 100644 --- a/lib/node_modules/@stdlib/fs/open/README.md +++ b/lib/node_modules/@stdlib/fs/open/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var open = require( '@stdlib/fs/open' ); +const open = require( '@stdlib/fs/open' ); ``` #### open( path\[, flags\[, mode]], clbk ) @@ -39,7 +39,7 @@ Asynchronously opens a file. ```javascript -var closeSync = require( '@stdlib/fs/close' ).sync; +const closeSync = require( '@stdlib/fs/close' ).sync; open( __filename, onOpen ); @@ -61,9 +61,9 @@ Synchronously opens a `file`. ```javascript -var closeSync = require( '@stdlib/fs/close' ).sync; +const closeSync = require( '@stdlib/fs/close' ).sync; -var fd = open.sync( __filename ); +const fd = open.sync( __filename ); if ( fd instanceof Error ) { console.error( fd.message ); } else { @@ -86,10 +86,10 @@ The function has the same default parameters as [`fs.openSync()`][node-fs]. ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); - var fpath = '/path/to/file.js'; - var fd; + const fpath = '/path/to/file.js'; + let fd; // Check for existence to prevent an error being thrown... if ( fs.existsSync( fpath ) ) { @@ -102,12 +102,12 @@ The function has the same default parameters as [`fs.openSync()`][node-fs]. ```javascript - var open = require( '@stdlib/fs/open' ); + const open = require( '@stdlib/fs/open' ); - var fpath = '/path/to/file.js'; + const fpath = '/path/to/file.js'; // Explicitly handle the error... - var fd = open.sync( fpath ); + const fd = open.sync( fpath ); if ( fd instanceof Error ) { // You choose what to do... console.error( fd.message ); @@ -127,13 +127,13 @@ The function has the same default parameters as [`fs.openSync()`][node-fs]. ```javascript -var join = require( 'path' ).join; -var closeSync = require( '@stdlib/fs/close' ).sync; -var open = require( '@stdlib/fs/open' ); +const join = require( 'path' ).join; +const closeSync = require( '@stdlib/fs/close' ).sync; +const open = require( '@stdlib/fs/open' ); /* Sync */ -var fd = open.sync( join( __dirname, 'package.json' ), 'r+' ); +let fd = open.sync( join( __dirname, 'package.json' ), 'r+' ); // returns if ( fd instanceof Error ) { diff --git a/lib/node_modules/@stdlib/fs/read-dir/README.md b/lib/node_modules/@stdlib/fs/read-dir/README.md index 30b3f34be611..4ebb2db32f35 100644 --- a/lib/node_modules/@stdlib/fs/read-dir/README.md +++ b/lib/node_modules/@stdlib/fs/read-dir/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readDir = require( '@stdlib/fs/read-dir' ); +const readDir = require( '@stdlib/fs/read-dir' ); ``` #### readDir( path, clbk ) @@ -52,7 +52,7 @@ function onRead( error, data ) { Synchronously reads the contents of a directory. ```javascript -var out = readDir.sync( __dirname ); +const out = readDir.sync( __dirname ); if ( out instanceof Error ) { throw out; } @@ -70,10 +70,12 @@ console.log( out ); - The difference between this module and [`fs.readdirSync()`][fs] is that [`fs.readdirSync()`][fs] will throw if an `error` is encountered (e.g., if given a non-existent `path`) and this module will return an `error`. Hence, the following anti-pattern + + ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); - var dir = '/path/to/dir'; + let dir = '/path/to/dir'; // Check for existence to prevent an error being thrown... if ( fs.existsSync( dir ) ) { @@ -84,9 +86,9 @@ console.log( out ); can be replaced by an approach which addresses existence via `error` handling. ```javascript - var readDir = require( '@stdlib/fs/read-dir' ); + const readDir = require( '@stdlib/fs/read-dir' ); - var dir = '/path/to/dir'; + let dir = '/path/to/dir'; // Explicitly handle the error... dir = readDir.sync( dir ); @@ -104,14 +106,16 @@ console.log( out ); ## Examples + + ```javascript -var readDir = require( '@stdlib/fs/read-dir' ); +const readDir = require( '@stdlib/fs/read-dir' ); /* Sync */ -var out = readDir.sync( __dirname ); +let out = readDir.sync( __dirname ); // returns console.log( out instanceof Error ); diff --git a/lib/node_modules/@stdlib/fs/read-file-list/README.md b/lib/node_modules/@stdlib/fs/read-file-list/README.md index 692a5689ad11..f14663d68a72 100644 --- a/lib/node_modules/@stdlib/fs/read-file-list/README.md +++ b/lib/node_modules/@stdlib/fs/read-file-list/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readFileList = require( '@stdlib/fs/read-file-list' ); +const readFileList = require( '@stdlib/fs/read-file-list' ); ``` #### readFileList( filepaths\[, options], clbk ) @@ -58,11 +58,12 @@ The function accepts the same options as [`readFile()`][@stdlib/fs/read-file]. Synchronously reads the entire contents of each file in a file list. ```javascript -var out = readFileList.sync( [ __filename ] ); -if ( out instanceof Error ) { - throw out; +const readFileList = require( '@stdlib/fs/read-file-list' ); +const files = readFileList.sync( [ __filename ], 'utf8' ); +if ( files instanceof Error ) { + throw files; } -console.dir( out ); +console.log( files ); // => [{...}] ``` @@ -79,11 +80,11 @@ The function accepts the same options as [`readFile.sync()`][@stdlib/fs/read-fil ```javascript -var readFileList = require( '@stdlib/fs/read-file-list' ); +const readFileList = require( '@stdlib/fs/read-file-list' ); /* Sync */ -var files = readFileList.sync( [ __filename ], 'utf8' ); +let files = readFileList.sync( [ __filename ], 'utf8' ); // returns console.log( files instanceof Error ); diff --git a/lib/node_modules/@stdlib/fs/read-file/README.md b/lib/node_modules/@stdlib/fs/read-file/README.md index 237a9531d1f2..9b445a6de70e 100644 --- a/lib/node_modules/@stdlib/fs/read-file/README.md +++ b/lib/node_modules/@stdlib/fs/read-file/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readFile = require( '@stdlib/fs/read-file' ); +const readFile = require( '@stdlib/fs/read-file' ); ``` #### readFile( file\[, options], clbk ) @@ -52,7 +52,7 @@ The function accepts the same `options` and has the same defaults as [`fs.readFi Synchronously reads the entire contents of a `file`. ```javascript -var out = readFile.sync( __filename ); +const out = readFile.sync( __filename ); if ( out instanceof Error ) { throw out; } @@ -73,9 +73,9 @@ The function accepts the same `options` and has the same defaults as [`fs.readFi ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); - var file = '/path/to/file.js'; + let file = '/path/to/file.js'; // Check for existence to prevent an error being thrown... if ( fs.existsSync( file ) ) { @@ -86,9 +86,9 @@ The function accepts the same `options` and has the same defaults as [`fs.readFi can be replaced by an approach which addresses existence via `error` handling. ```javascript - var readFile = require( '@stdlib/fs/read-file' ); + const readFile = require( '@stdlib/fs/read-file' ); - var file = '/path/to/file.js'; + const file = '/path/to/file.js'; // Explicitly handle the error... file = readFile.sync( file ); @@ -109,11 +109,11 @@ The function accepts the same `options` and has the same defaults as [`fs.readFi ```javascript -var readFile = require( '@stdlib/fs/read-file' ); +const readFile = require( '@stdlib/fs/read-file' ); /* Sync */ -var file = readFile.sync( __filename, 'utf8' ); +let file = readFile.sync( __filename, 'utf8' ); // returns console.log( file instanceof Error ); diff --git a/lib/node_modules/@stdlib/fs/read-json/README.md b/lib/node_modules/@stdlib/fs/read-json/README.md index 0af9e598e8d3..34cae0646a48 100644 --- a/lib/node_modules/@stdlib/fs/read-json/README.md +++ b/lib/node_modules/@stdlib/fs/read-json/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readJSON = require( '@stdlib/fs/read-json' ); +const readJSON = require( '@stdlib/fs/read-json' ); ``` @@ -37,7 +37,7 @@ var readJSON = require( '@stdlib/fs/read-json' ); Asynchronously reads a file as [JSON][json]. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; readJSON( join( __dirname, 'package.json' ), onJSON ); @@ -58,7 +58,7 @@ The function accepts the following `options`: The `options` parameter may also be a `string` specifying the file `encoding`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; readJSON( join( __dirname, 'package.json' ), 'utf8', onJSON ); @@ -75,10 +75,10 @@ function onJSON( error, data ) { Synchronously reads a file as [JSON][json]. ```javascript -var join = require( 'path' ).join; -var instanceOf = require( '@stdlib/assert/instance-of' ); +const join = require( 'path' ).join; +const instanceOf = require( '@stdlib/assert/instance-of' ); -var out = readJSON.sync( join( __dirname, 'package.json' ) ); +const out = readJSON.sync( join( __dirname, 'package.json' ) ); if ( instanceOf( out, Error ) ) { throw out; } @@ -108,13 +108,13 @@ The function accepts the same `options` as [`readJSON()`](#read-json) above. ```javascript -var join = require( 'path' ).join; -var readJSON = require( '@stdlib/fs/read-json' ); +const join = require( 'path' ).join; +const readJSON = require( '@stdlib/fs/read-json' ); -var file = join( __dirname, 'package.json' ); +const file = join( __dirname, 'package.json' ); // Synchronously read file contents... -var data = readJSON.sync( file, 'utf8' ); +let data = readJSON.sync( file, 'utf8' ); // returns data = readJSON.sync( 'beepboop', { diff --git a/lib/node_modules/@stdlib/fs/read-ndjson/README.md b/lib/node_modules/@stdlib/fs/read-ndjson/README.md index cc37df68b10c..d8befbec5317 100644 --- a/lib/node_modules/@stdlib/fs/read-ndjson/README.md +++ b/lib/node_modules/@stdlib/fs/read-ndjson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readNDJSON = require( '@stdlib/fs/read-ndjson' ); +const readNDJSON = require( '@stdlib/fs/read-ndjson' ); ``` @@ -37,7 +37,7 @@ var readNDJSON = require( '@stdlib/fs/read-ndjson' ); Asynchronously reads a file as [newline-delimited JSON][ndjson]. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; readNDJSON( join( __dirname, 'examples', 'fixtures', 'file.ndjson' ), clbk ); @@ -58,7 +58,7 @@ The function accepts the following `options`: The `options` parameter may also be a string specifying the file `encoding`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; readNDJSON( join( __dirname, 'examples', 'fixtures', 'file.ndjson' ), 'utf8', clbk ); @@ -75,10 +75,10 @@ function clbk( error, data ) { Synchronously reads a file as [newline-delimited JSON][ndjson]. ```javascript -var join = require( 'path' ).join; -var instanceOf = require( '@stdlib/assert/instance-of' ); +const join = require( 'path' ).join; +const instanceOf = require( '@stdlib/assert/instance-of' ); -var out = readNDJSON.sync( join( __dirname, 'examples', 'fixtures', 'file.ndjson' ) ); +const out = readNDJSON.sync( join( __dirname, 'examples', 'fixtures', 'file.ndjson' ) ); if ( instanceOf( out, Error ) ) { throw out; } @@ -108,13 +108,13 @@ The function accepts the same `options` as [`readNDJSON()`](#read-ndjson) above. ```javascript -var join = require( 'path' ).join; -var readNDJSON = require( '@stdlib/fs/read-ndjson' ); +const join = require( 'path' ).join; +const readNDJSON = require( '@stdlib/fs/read-ndjson' ); -var file = join( __dirname, 'examples', 'fixtures', 'file.ndjson' ); +const file = join( __dirname, 'examples', 'fixtures', 'file.ndjson' ); // Synchronously read file contents... -var data = readNDJSON.sync( file, 'utf8' ); +let data = readNDJSON.sync( file, 'utf8' ); // returns [...] data = readNDJSON.sync( 'beepboop', { diff --git a/lib/node_modules/@stdlib/fs/read-wasm/README.md b/lib/node_modules/@stdlib/fs/read-wasm/README.md index 9c239bd4698f..daae15b2d11f 100644 --- a/lib/node_modules/@stdlib/fs/read-wasm/README.md +++ b/lib/node_modules/@stdlib/fs/read-wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var readWASM = require( '@stdlib/fs/read-wasm' ); +const readWASM = require( '@stdlib/fs/read-wasm' ); ``` @@ -37,9 +37,9 @@ var readWASM = require( '@stdlib/fs/read-wasm' ); Asynchronously reads a file as [WebAssembly][webassembly]. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); readWASM( fpath, onRead ); function onRead( error, buf ) { @@ -59,11 +59,11 @@ The function accepts the following `options`: Synchronously reads a file as [WebAssembly][webassembly]. ```javascript -var join = require( 'path' ).join; -var instanceOf = require( '@stdlib/assert/instance-of' ); +const join = require( 'path' ).join; +const instanceOf = require( '@stdlib/assert/instance-of' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); -var out = readWASM.sync( fpath ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); +const out = readWASM.sync( fpath ); if ( instanceOf( out, Error ) ) { throw out; } @@ -96,19 +96,18 @@ The function accepts the same `options` as [`readWASM()`](#read-wasm) above. ```javascript -var join = require( 'path' ).join; -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); -var readWASM = require( '@stdlib/fs/read-wasm' ); +const join = require( 'path' ).join; +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const readWASM = require( '@stdlib/fs/read-wasm' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.wasm' ); readWASM( fpath, onRead ); function onRead( error, wasm ) { - var bool; if ( error ) { throw error; } - bool = hasWebAssemblySupport(); + const bool = hasWebAssemblySupport(); // If WebAssembly is supported, create a WebAssembly module instance... if ( bool ) { diff --git a/lib/node_modules/@stdlib/fs/rename/README.md b/lib/node_modules/@stdlib/fs/rename/README.md index 36bb63a185db..6a5baba5bf71 100644 --- a/lib/node_modules/@stdlib/fs/rename/README.md +++ b/lib/node_modules/@stdlib/fs/rename/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rename = require( '@stdlib/fs/rename' ); +const rename = require( '@stdlib/fs/rename' ); ``` #### rename( oldPath, newPath, clbk ) @@ -37,9 +37,9 @@ Asynchronously renames a file specified by `oldPath` to `newPath`. ```javascript -var join = require( 'path' ).join; -var oldPath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var newPath = join( __dirname, 'examples', 'fixtures', 'tmp.txt' ); +const join = require( 'path' ).join; +const oldPath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const newPath = join( __dirname, 'examples', 'fixtures', 'tmp.txt' ); rename( oldPath, newPath, done ); @@ -57,11 +57,11 @@ Synchronously renames a file specified by `oldPath` to `newPath`. ```javascript -var join = require( 'path' ).join; -var oldPath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var newPath = join( __dirname, 'examples', 'fixtures', 'tmp.txt' ); +const join = require( 'path' ).join; +const oldPath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const newPath = join( __dirname, 'examples', 'fixtures', 'tmp.txt' ); -var err = rename.sync( oldPath, newPath ); +const err = rename.sync( oldPath, newPath ); if ( err instanceof Error ) { throw err; } @@ -93,10 +93,12 @@ if ( err instanceof Error ) { - The difference between `rename.sync` and [`fs.rename()`][node-fs] is that [`fs.renameSync()`][node-fs] will throw if an `error` is encountered (e.g., if given a non-existent path) and this API will return an `error`. Hence, the following anti-pattern + + ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); // Check for path existence to prevent an error being thrown... if ( fs.existsSync( '/path/to/file.txt' ) ) { @@ -109,10 +111,10 @@ if ( err instanceof Error ) { ```javascript - var rename = require( '@stdlib/fs/rename' ); + const rename = require( '@stdlib/fs/rename' ); // Explicitly handle the error... - var err = rename.sync( '/path/to/file.txt', '/path/to/tmp.txt' ); + const err = rename.sync( '/path/to/file.txt', '/path/to/tmp.txt' ); if ( err instanceof Error ) { // You choose what to do... throw err; @@ -130,16 +132,16 @@ if ( err instanceof Error ) { ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var writeFile = require( '@stdlib/fs/write-file' ).sync; -var exists = require( '@stdlib/fs/exists' ).sync; -var unlink = require( '@stdlib/fs/unlink' ).sync; -var rename = require( '@stdlib/fs/rename' ).sync; - -var src = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var tmp = join( __dirname, 'examples', 'tmp.txt' ); -var dest = join( __dirname, 'examples', 'foo.txt' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const writeFile = require( '@stdlib/fs/write-file' ).sync; +const exists = require( '@stdlib/fs/exists' ).sync; +const unlink = require( '@stdlib/fs/unlink' ).sync; +const rename = require( '@stdlib/fs/rename' ).sync; + +const src = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const tmp = join( __dirname, 'examples', 'tmp.txt' ); +const dest = join( __dirname, 'examples', 'foo.txt' ); // Create a temporary file: writeFile( tmp, readFile( src ) ); diff --git a/lib/node_modules/@stdlib/fs/resolve-parent-path-by/README.md b/lib/node_modules/@stdlib/fs/resolve-parent-path-by/README.md index 6430bcd181b1..ed1546a5e7f7 100644 --- a/lib/node_modules/@stdlib/fs/resolve-parent-path-by/README.md +++ b/lib/node_modules/@stdlib/fs/resolve-parent-path-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var resolveParentPathBy = require( '@stdlib/fs/resolve-parent-path-by' ); +const resolveParentPathBy = require( '@stdlib/fs/resolve-parent-path-by' ); ``` @@ -40,7 +40,7 @@ Asynchronously resolves a path according to a `predicate` function by walking pa resolveParentPathBy( 'package.json', predicate, onPath ); function predicate( path, next ) { - var bool = ( /\/test\//.test( path ) === false ); + const bool = ( /\/test\//.test( path ) === false ); next( null, bool ); } @@ -60,13 +60,13 @@ The function accepts the following `options`: By default, the function begins walking from the current working directory. To specify an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': __dirname }; resolveParentPathBy( 'package.json', opts, predicate, onPath ); function predicate( path, next ) { - var bool = ( /\/test\//.test( path ) === false ); + const bool = ( /\/test\//.test( path ) === false ); next( null, bool ); } @@ -97,7 +97,7 @@ function predicate( path ) { return ( /\/test\//.test( path ) === false ); } -var path = resolveParentPathBy.sync( 'package.json', predicate ); +const path = resolveParentPathBy.sync( 'package.json', predicate ); // e.g., returns '...' ``` @@ -136,23 +136,23 @@ If unable to resolve a path, the function returns `null` as the path result. ```javascript -var resolveParentPathBy = require( '@stdlib/fs/resolve-parent-path-by' ); +const resolveParentPathBy = require( '@stdlib/fs/resolve-parent-path-by' ); -var opts = { +const opts = { 'dir': __dirname }; /* Sync */ function predicateSync( path ) { - var pkg = require( path ); + const pkg = require( path ); if ( pkg.name !== '@stdlib/stdlib' ) { return false; } return true; } -var out = resolveParentPathBy.sync( 'package.json', opts, predicateSync ); +let out = resolveParentPathBy.sync( 'package.json', opts, predicateSync ); console.log( out ); // e.g., => '...' @@ -166,7 +166,7 @@ function predicateAsync( path, next ) { setTimeout( onTimeout, 0 ); function onTimeout() { - var pkg = require( path ); + const pkg = require( path ); if ( pkg.name !== '@stdlib/stdlib' ) { return next( null, false ); } diff --git a/lib/node_modules/@stdlib/fs/resolve-parent-path/README.md b/lib/node_modules/@stdlib/fs/resolve-parent-path/README.md index 1a97df3a8d2c..13b1b32fd180 100644 --- a/lib/node_modules/@stdlib/fs/resolve-parent-path/README.md +++ b/lib/node_modules/@stdlib/fs/resolve-parent-path/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var resolveParentPath = require( '@stdlib/fs/resolve-parent-path' ); +const resolveParentPath = require( '@stdlib/fs/resolve-parent-path' ); ``` @@ -55,7 +55,7 @@ The function accepts the following `options`: By default, the function begins walking from the current working directory. To specify an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': __dirname }; resolveParentPath( 'package.json', opts, onPath ); @@ -74,7 +74,7 @@ function onPath( error, path ) { Synchronously resolves a path by walking parent directories. ```javascript -var path = resolveParentPath.sync( 'package.json' ); +const path = resolveParentPath.sync( 'package.json' ); // returns '...' ``` @@ -102,15 +102,15 @@ The function accepts the same `options` as [`resolveParentPath()`](#resolve-pare ```javascript -var resolveParentPath = require( '@stdlib/fs/resolve-parent-path' ); +const resolveParentPath = require( '@stdlib/fs/resolve-parent-path' ); -var opts = { +const opts = { 'dir': __dirname }; /* Sync */ -var out = resolveParentPath.sync( 'package.json', opts ); +let out = resolveParentPath.sync( 'package.json', opts ); // returns '...' out = resolveParentPath.sync( 'non_existent_basename' ); diff --git a/lib/node_modules/@stdlib/fs/resolve-parent-paths/README.md b/lib/node_modules/@stdlib/fs/resolve-parent-paths/README.md index 4ae39ceaed28..7f0a6c057b8c 100644 --- a/lib/node_modules/@stdlib/fs/resolve-parent-paths/README.md +++ b/lib/node_modules/@stdlib/fs/resolve-parent-paths/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var resolveParentPaths = require( '@stdlib/fs/resolve-parent-paths' ); +const resolveParentPaths = require( '@stdlib/fs/resolve-parent-paths' ); ``` @@ -64,7 +64,7 @@ The function accepts the following `options`: By default, the function begins walking from the current working directory. To specify an alternative directory, set the `dir` option. ```javascript -var opts = { +const opts = { 'dir': __dirname }; resolveParentPaths( [ 'package.json' ], opts, onPaths ); @@ -81,7 +81,7 @@ function onPaths( error, paths ) { By default, the function requires that a directory contains matches for all provided paths before returning results. To specify an alternative operation mode, set the `mode` option. ```javascript -var opts = { +const opts = { 'dir': __dirname, 'mode': 'first' }; @@ -101,7 +101,7 @@ function onPaths( error, paths ) { Synchronously resolves paths from a set of paths by walking parent directories. ```javascript -var paths = resolveParentPaths.sync( [ 'package.json', 'README.md' ] ); +const paths = resolveParentPaths.sync( [ 'package.json', 'README.md' ] ); // returns [...] ``` @@ -129,15 +129,15 @@ The function accepts the same `options` as [`resolveParentPaths()`](#resolve-par ```javascript -var resolveParentPaths = require( '@stdlib/fs/resolve-parent-paths' ); +const resolveParentPaths = require( '@stdlib/fs/resolve-parent-paths' ); -var opts = { +const opts = { 'dir': __dirname }; /* Sync */ -var out = resolveParentPaths.sync( [ 'package.json', 'README.md' ], opts ); +let out = resolveParentPaths.sync( [ 'package.json', 'README.md' ], opts ); // returns [...] out = resolveParentPaths.sync( [ 'non_existent_basename' ], opts ); diff --git a/lib/node_modules/@stdlib/fs/unlink/README.md b/lib/node_modules/@stdlib/fs/unlink/README.md index 1e861ff03ede..225ce3322581 100644 --- a/lib/node_modules/@stdlib/fs/unlink/README.md +++ b/lib/node_modules/@stdlib/fs/unlink/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var unlink = require( '@stdlib/fs/unlink' ); +const unlink = require( '@stdlib/fs/unlink' ); ``` #### unlink( path, clbk ) @@ -37,8 +37,8 @@ Asynchronously removes a directory entry specified by `path`. ```javascript -var join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const join = require( 'path' ).join; +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); unlink( fpath, done ); @@ -56,10 +56,10 @@ Synchronously removes a directory entry specified by `path`. ```javascript -var join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const join = require( 'path' ).join; +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var err = unlink.sync( fpath ); +const err = unlink.sync( fpath ); if ( err instanceof Error ) { throw err; } @@ -83,10 +83,12 @@ if ( err instanceof Error ) { - The difference between `unlink.sync` and [`fs.unlinkSync()`][node-fs] is that [`fs.unlinkSync()`][node-fs] will throw if an `error` is encountered (e.g., if given a non-existent path) and this API will return an `error`. Hence, the following anti-pattern + + ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); // Check for path existence to prevent an error being thrown... if ( fs.existsSync( '/path/to' ) ) { @@ -99,10 +101,10 @@ if ( err instanceof Error ) { ```javascript - var unlink = require( '@stdlib/fs/unlink' ); + const unlink = require( '@stdlib/fs/unlink' ); // Explicitly handle the error... - var err = unlink.sync( '/path/to/file.txt' ); + const err = unlink.sync( '/path/to/file.txt' ); if ( err instanceof Error ) { // You choose what to do... throw err; @@ -120,14 +122,14 @@ if ( err instanceof Error ) { ```javascript -var join = require( 'path' ).join; -var readFile = require( '@stdlib/fs/read-file' ).sync; -var writeFile = require( '@stdlib/fs/write-file' ).sync; -var exists = require( '@stdlib/fs/exists' ).sync; -var unlink = require( '@stdlib/fs/unlink' ).sync; - -var src = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var dest = join( __dirname, 'examples', 'tmp.txt' ); +const join = require( 'path' ).join; +const readFile = require( '@stdlib/fs/read-file' ).sync; +const writeFile = require( '@stdlib/fs/write-file' ).sync; +const exists = require( '@stdlib/fs/exists' ).sync; +const unlink = require( '@stdlib/fs/unlink' ).sync; + +const src = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const dest = join( __dirname, 'examples', 'tmp.txt' ); // Create a temporary file: writeFile( dest, readFile( src ) ); diff --git a/lib/node_modules/@stdlib/fs/write-file/README.md b/lib/node_modules/@stdlib/fs/write-file/README.md index 3c54061fae66..8b117536e14a 100644 --- a/lib/node_modules/@stdlib/fs/write-file/README.md +++ b/lib/node_modules/@stdlib/fs/write-file/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writeFile = require( '@stdlib/fs/write-file' ); +const writeFile = require( '@stdlib/fs/write-file' ); ``` #### writeFile( file, data\[, options], clbk ) @@ -35,9 +35,9 @@ var writeFile = require( '@stdlib/fs/write-file' ); Asynchronously writes `data` to a `file`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); writeFile( fpath, 'beep boop\n', onWrite ); @@ -51,10 +51,10 @@ function onWrite( error ) { The `data` argument may be either a `string` or a [`Buffer`][@stdlib/buffer/ctor]. ```javascript -var join = require( 'path' ).join; -var string2buffer = require( '@stdlib/buffer/from-string' ); +const join = require( 'path' ).join; +const string2buffer = require( '@stdlib/buffer/from-string' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); writeFile( fpath, string2buffer( 'beep boop\n' ), onWrite ); @@ -72,11 +72,11 @@ The function accepts the same `options` and has the same defaults as [`fs.writeF Synchronously writes `data` to a `file`. ```javascript -var join = require( 'path' ).join; +const join = require( 'path' ).join; -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); -var err = writeFile.sync( fpath, 'beep boop\n' ); +const err = writeFile.sync( fpath, 'beep boop\n' ); if ( err instanceof Error ) { throw err; } @@ -94,10 +94,12 @@ The function accepts the same `options` and has the same defaults as [`fs.writeF - The difference between this `writeFile.sync` and [`fs.writeFileSync()`][node-fs] is that [`fs.writeFileSync()`][node-fs] will throw if an `error` is encountered (e.g., if given a non-existent directory path) and this API will return an `error`. Hence, the following anti-pattern + + ```javascript - var fs = require( 'fs' ); + const fs = require( 'fs' ); // Check for directory path existence to prevent an error being thrown... if ( fs.existsSync( '/path/to' ) ) { @@ -110,10 +112,10 @@ The function accepts the same `options` and has the same defaults as [`fs.writeF ```javascript - var writeFile = require( '@stdlib/fs/write-file' ); + const writeFile = require( '@stdlib/fs/write-file' ); // Explicitly handle the error... - var err = writeFile.sync( '/path/to/file.txt', 'beep boop\n' ); + const err = writeFile.sync( '/path/to/file.txt', 'beep boop\n' ); if ( err instanceof Error ) { // You choose what to do... throw err; @@ -131,13 +133,13 @@ The function accepts the same `options` and has the same defaults as [`fs.writeF ```javascript -var join = require( 'path' ).join; -var writeFile = require( '@stdlib/fs/write-file' ); +const join = require( 'path' ).join; +const writeFile = require( '@stdlib/fs/write-file' ); -var fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); +const fpath = join( __dirname, 'examples', 'fixtures', 'file.txt' ); // Synchronously write data to a file: -var err = writeFile.sync( fpath, 'beep boop\n', 'utf8' ); +const err = writeFile.sync( fpath, 'beep boop\n', 'utf8' ); // returns null console.log( err instanceof Error ); diff --git a/lib/node_modules/@stdlib/function/README.md b/lib/node_modules/@stdlib/function/README.md index 7668854a577d..d7ebb900dd9f 100644 --- a/lib/node_modules/@stdlib/function/README.md +++ b/lib/node_modules/@stdlib/function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/function' ); +const ns = require( '@stdlib/function' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/function' ); Function namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -65,8 +65,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/function' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/function' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/function/ctor/README.md b/lib/node_modules/@stdlib/function/ctor/README.md index 63e39ca60d38..94321550927b 100644 --- a/lib/node_modules/@stdlib/function/ctor/README.md +++ b/lib/node_modules/@stdlib/function/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Function = require( '@stdlib/function/ctor' ); +const Function = require( '@stdlib/function/ctor' ); ``` #### Function( \[...argNames,] body ) @@ -45,9 +45,9 @@ var Function = require( '@stdlib/function/ctor' ); Returns a new [function][mdn-function] object. ```javascript -var greet = new Function( 'name', 'return "Hello, "+name+"!"' ); +const greet = new Function( 'name', 'return "Hello, "+name+"!"' ); -var v = greet( 'Jane' ); +const v = greet( 'Jane' ); // returns 'Hello, Jane!' ``` @@ -64,8 +64,8 @@ Argument names must be strings corresponding to valid JavaScript parameters (i.e A number representing the number of arguments expected by the function. ```javascript -var greet = new Function( 'name', 'return "Hello, "+name+"!"' ); -var v = greet.length; +const greet = new Function( 'name', 'return "Hello, "+name+"!"' ); +const v = greet.length; // returns 1 ``` @@ -79,11 +79,11 @@ var v = greet.length; function greet( name ) { return 'Hello, '+name+'!'; } -var v = greet.name; +let v = greet.name; // returns 'greet' // Functions created with the Function constructor are anonymous: -var fcn = new Function( 'name', 'return "Hello, "+name+"!"' ); +const fcn = new Function( 'name', 'return "Hello, "+name+"!"' ); v = fcn.name; // returns 'anonymous' ``` @@ -98,7 +98,7 @@ v = fcn.name; function greet( name ) { return 'Hello, '+name+'!'; } -var proto = greet.prototype; +const proto = greet.prototype; // returns {} ``` @@ -119,11 +119,11 @@ function add( x, y ) { return this.initial + x + y; } -var ctx = { +const ctx = { 'initial': 10 }; -var v = add.apply( ctx, [ 1, 2 ] ); +const v = add.apply( ctx, [ 1, 2 ] ); // returns 13 ``` @@ -137,9 +137,9 @@ Returns a new function which invokes the original function with the given `this` function add( x, y ) { return x + y; } -var add1 = add.bind( null, 1 ); +const add1 = add.bind( null, 1 ); -var v = add1( 2 ); +const v = add1( 2 ); // returns 3 ``` @@ -156,11 +156,11 @@ function add( x, y ) { return this.initial + x + y; } -var ctx = { +const ctx = { 'initial': 10 }; -var v = add.call( ctx, 1, 2 ); +const v = add.call( ctx, 1, 2 ); // returns 13 ``` @@ -174,7 +174,7 @@ Returns a string representing the function. function add( x, y ) { return x + y; } -var v = add.toString(); +const v = add.toString(); // e.g., returns 'function add( x, y ) {\n return x + y;\n}' ``` @@ -206,11 +206,11 @@ var v = add.toString(); ```javascript -var Function = require( '@stdlib/function/ctor' ); +const Function = require( '@stdlib/function/ctor' ); -var add = new Function( 'x', 'y', 'return x + y' ); +const add = new Function( 'x', 'y', 'return x + y' ); -var v = add( 1, 2 ); +const v = add( 1, 2 ); // returns 3 ``` diff --git a/lib/node_modules/@stdlib/function/to-string/README.md b/lib/node_modules/@stdlib/function/to-string/README.md index ac142eab165f..04f675bd1145 100644 --- a/lib/node_modules/@stdlib/function/to-string/README.md +++ b/lib/node_modules/@stdlib/function/to-string/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var function2string = require( '@stdlib/function/to-string' ); +const function2string = require( '@stdlib/function/to-string' ); ``` #### function2string( fcn ) @@ -49,7 +49,7 @@ function add( x, y ) { return x + y; } -var str = function2string( add ); +const str = function2string( add ); // e.g., returns 'function add( x, y ) {\n return x + y;\n}' ``` @@ -88,15 +88,15 @@ var str = function2string( add ); ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var erf = require( '@stdlib/math/base/special/erf' ); -var daxpy = require( '@stdlib/blas/base/daxpy' ); -var kebabcase = require( '@stdlib/string/kebabcase' ); -var randu = require( '@stdlib/random/base/randu' ); -var format = require( '@stdlib/string/format' ); -var function2string = require( '@stdlib/function/to-string' ); - -var fcns = [ +const ndarray = require( '@stdlib/ndarray/ctor' ); +const erf = require( '@stdlib/math/base/special/erf' ); +const daxpy = require( '@stdlib/blas/base/daxpy' ); +const kebabcase = require( '@stdlib/string/kebabcase' ); +const randu = require( '@stdlib/random/base/randu' ); +const format = require( '@stdlib/string/format' ); +const function2string = require( '@stdlib/function/to-string' ); + +const fcns = [ [ 'ndarray', ndarray ], [ 'erf', erf ], [ 'daxpy', daxpy ], @@ -106,8 +106,7 @@ var fcns = [ [ 'function2string', function2string ] ]; -var i; -for ( i = 0; i < fcns.length; i++ ) { +for ( let i = 0; i < fcns.length; i++ ) { console.log( format( 'Function: %s\n\n%s\n', fcns[ i ][ 0 ], function2string( fcns[ i ][ 1 ] ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/iter/README.md b/lib/node_modules/@stdlib/iter/README.md index b040ff738a1c..2e5bef0f8c9d 100644 --- a/lib/node_modules/@stdlib/iter/README.md +++ b/lib/node_modules/@stdlib/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/iter' ); +const ns = require( '@stdlib/iter' ); ``` #### ns @@ -35,9 +35,9 @@ var ns = require( '@stdlib/iter' ); Namespace containing iterator utilities. ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); +const objectKeys = require( '@stdlib/utils/keys' ); -var keys = objectKeys( ns ); +const keys = objectKeys( ns ); // e.g., returns [ 'iterAny', 'iterAnyBy', ... ] ``` @@ -115,40 +115,37 @@ var keys = objectKeys( ns ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var uncapitalize = require( '@stdlib/string/uncapitalize' ); -var replace = require( '@stdlib/string/replace' ); -var contains = require( '@stdlib/assert/contains' ); -var randu = require( '@stdlib/random/iter/randu' ); -var ns = require( '@stdlib/iter' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const uncapitalize = require( '@stdlib/string/uncapitalize' ); +const replace = require( '@stdlib/string/replace' ); +const contains = require( '@stdlib/assert/contains' ); +const randu = require( '@stdlib/random/iter/randu' ); +const ns = require( '@stdlib/iter' ); // Create a fluent interface for chaining together iterator operations... // Retrieve all the iterator utility names: -var keys = objectKeys( ns ); +const keys = objectKeys( ns ); // Define a list of utilities to exclude from the fluent API: -var exclude = [ 'iterFlow', 'iterPipeline', 'iterThunk' ]; +const exclude = [ 'iterFlow', 'iterPipeline', 'iterThunk' ]; // Map each utility name to a fluent interface method... -var methods = {}; -var key; -var k; -var i; -for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; +const methods = {}; +for ( let i = 0; i < keys.length; i++ ) { + const key = keys[ i ]; if ( contains( exclude, key ) ) { continue; } - k = uncapitalize( replace( key, /^iter/, '' ) ); + const k = uncapitalize( replace( key, /^iter/, '' ) ); methods[ k ] = ns[ key ]; } // Create a fluent interface: -var FluentIterator = ns.iterFlow( methods ); +const FluentIterator = ns.iterFlow( methods ); // Create a new fluent interface iterator: -var it1 = new FluentIterator( randu() ); +const it1 = new FluentIterator( randu() ); // Define a predicate function for filtering values: function predicate( v ) { @@ -166,13 +163,13 @@ function log( v ) { } // Chain together a sequence of operations: -var it2 = it1.filter( predicate ) +const it2 = it1.filter( predicate ) .map( transform ) .head( 10 ) .forEach( log ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it2.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/advance/README.md b/lib/node_modules/@stdlib/iter/advance/README.md index ee7e0b54e9a9..c24d9dd81072 100644 --- a/lib/node_modules/@stdlib/iter/advance/README.md +++ b/lib/node_modules/@stdlib/iter/advance/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAdvance = require( '@stdlib/iter/advance' ); +const iterAdvance = require( '@stdlib/iter/advance' ); ``` #### iterAdvance( iterator\[, n] ) @@ -45,30 +45,30 @@ var iterAdvance = require( '@stdlib/iter/advance' ); Eagerly advances and returns a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var it = iterAdvance( arr ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const it = iterAdvance( arr ); -var bool = ( it === arr ); +const bool = ( it === arr ); // returns true -var v = it.next().done; +const v = it.next().done; // returns true ``` By default, the function **eagerly** consumes an entire [`iterator`][mdn-iterator-protocol] (i.e., `n == 1e308`). To limit the number of iterations, provide a second argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var it = iterAdvance( arr, 4 ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const it = iterAdvance( arr, 4 ); -var bool = ( it === arr ); +let bool = ( it === arr ); // returns true -var v = it.next().value; +const v = it.next().value; // returns 1 bool = it.next().done; @@ -90,12 +90,12 @@ bool = it.next().done; - This function is equivalent to performing manual iteration using a `while` loop. ```javascript - var array2iterator = require( '@stdlib/array/to-iterator' ); + const array2iterator = require( '@stdlib/array/to-iterator' ); - var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); + const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); - var i = 0; - var v; + let i = 0; + let v; while ( i < 4 ) { v = arr.next(); if ( v.done ) { @@ -107,7 +107,7 @@ bool = it.next().done; v = arr.next().value; // returns 1 - var bool = arr.next().done; + const bool = arr.next().done; // returns true ``` @@ -124,21 +124,21 @@ bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterLength = require( '@stdlib/iter/length' ); -var iterAdvance = require( '@stdlib/iter/advance' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterLength = require( '@stdlib/iter/length' ); +const iterAdvance = require( '@stdlib/iter/advance' ); // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var it1 = randu( opts ); +const it1 = randu( opts ); // Discard the first 10 values: -var it2 = iterAdvance( it1, 10 ); +const it2 = iterAdvance( it1, 10 ); // Determine the iterator length: -var len = iterLength( it2 ); +const len = iterLength( it2 ); // returns 90 ``` diff --git a/lib/node_modules/@stdlib/iter/any-by/README.md b/lib/node_modules/@stdlib/iter/any-by/README.md index 47a1fc87d709..efff17ab42cb 100644 --- a/lib/node_modules/@stdlib/iter/any-by/README.md +++ b/lib/node_modules/@stdlib/iter/any-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAnyBy = require( '@stdlib/iter/any-by' ); +const iterAnyBy = require( '@stdlib/iter/any-by' ); ``` #### iterAnyBy( iterator, predicate\[, thisArg] ) @@ -45,28 +45,28 @@ var iterAnyBy = require( '@stdlib/iter/any-by' ); Tests whether at least one [iterated][mdn-iterator-protocol] value passes a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var bool = iterAnyBy( arr, predicate ); +const bool = iterAnyBy( arr, predicate ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `false`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate() { return true; } -var bool = iterAnyBy( array2iterator( [] ), predicate ); +const bool = iterAnyBy( array2iterator( [] ), predicate ); // returns false ``` @@ -78,23 +78,23 @@ A `predicate` function is provided two arguments: To set the execution context of the `predicate` function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); +const arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var bool = iterAnyBy( arr, predicate, ctx ); +const bool = iterAnyBy( arr, predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -123,21 +123,21 @@ var n = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterAnyBy = require( '@stdlib/iter/any-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterAnyBy = require( '@stdlib/iter/any-by' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Determine if any values exceed a threshold: -var bool = iterAnyBy( riter, threshold ); +const bool = iterAnyBy( riter, threshold ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/any/README.md b/lib/node_modules/@stdlib/iter/any/README.md index dca159884b33..bab56eabe666 100644 --- a/lib/node_modules/@stdlib/iter/any/README.md +++ b/lib/node_modules/@stdlib/iter/any/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAny = require( '@stdlib/iter/any' ); +const iterAny = require( '@stdlib/iter/any' ); ``` #### iterAny( iterator ) @@ -45,20 +45,20 @@ var iterAny = require( '@stdlib/iter/any' ); Tests whether at least one [iterated][mdn-iterator-protocol] value is truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var bool = iterAny( arr ); +const bool = iterAny( arr ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `false`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var bool = iterAny( array2iterator( [] ) ); +const bool = iterAny( array2iterator( [] ) ); // returns false ``` @@ -83,25 +83,25 @@ var bool = iterAny( array2iterator( [] ) ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterAny = require( '@stdlib/iter/any' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterAny = require( '@stdlib/iter/any' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Determine if any values are "truthy": -var bool = iterAny( miter ); +const bool = iterAny( miter ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/concat/README.md b/lib/node_modules/@stdlib/iter/concat/README.md index 1d264a01568f..fea64204a4b3 100644 --- a/lib/node_modules/@stdlib/iter/concat/README.md +++ b/lib/node_modules/@stdlib/iter/concat/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterConcat = require( '@stdlib/iter/concat' ); +const iterConcat = require( '@stdlib/iter/concat' ); ``` #### iterConcat( iter0, ...iterator ) @@ -45,15 +45,15 @@ var iterConcat = require( '@stdlib/iter/concat' ); Returns an [iterator][mdn-iterator-protocol] which iterates over the values of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 1, 2 ] ); -var it2 = array2iterator( [ 3, 4 ] ); +const it1 = array2iterator( [ 1, 2 ] ); +const it2 = array2iterator( [ 3, 4 ] ); -var it = iterConcat( it1, it2 ); +const it = iterConcat( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -65,7 +65,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -99,27 +99,27 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var randn = require( '@stdlib/random/iter/randn' ); -var iterConcat = require( '@stdlib/iter/concat' ); +const randu = require( '@stdlib/random/iter/randu' ); +const randn = require( '@stdlib/random/iter/randn' ); +const iterConcat = require( '@stdlib/iter/concat' ); // Create a seeded iterator for generating uniformly distributed pseudorandom numbers: -var runif = randu({ +const runif = randu({ 'seed': 1234, 'iter': 10 }); // Create a seeded iterator for generating normally distributed pseudorandom numbers: -var rnorm = randn({ +const rnorm = randn({ 'seed': 1234, 'iter': 10 }); // Create an iterator which concatenates iterators: -var it = iterConcat( runif, rnorm ); +const it = iterConcat( runif, rnorm ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/constant/README.md b/lib/node_modules/@stdlib/iter/constant/README.md index 7d7e7a183973..d62ff19d80bd 100644 --- a/lib/node_modules/@stdlib/iter/constant/README.md +++ b/lib/node_modules/@stdlib/iter/constant/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterConstant = require( '@stdlib/iter/constant' ); +const iterConstant = require( '@stdlib/iter/constant' ); ``` #### iterConstant( value\[, options] ) @@ -45,10 +45,10 @@ var iterConstant = require( '@stdlib/iter/constant' ); Returns an iterator which always returns the same value. ```javascript -var it = iterConstant( 3.14 ); +const it = iterConstant( 3.14 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.14 v = it.next().value; @@ -72,19 +72,19 @@ The function supports the following `options`: By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterConstant( 3.14, opts ); +const it = iterConstant( 3.14, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.14 v = it.next().value; // returns 3.14 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -101,18 +101,18 @@ var bool = it.next().done; - When provided an `object` reference, the returned iterator always returns the same reference. ```javascript - var arr = [ 1, 2, 3, 4 ]; + const arr = [ 1, 2, 3, 4 ]; - var it = iterConstant( arr ); + const it = iterConstant( arr ); // returns - var v1 = it.next().value; + const v1 = it.next().value; // returns [ 1, 2, 3, 4 ] - var bool = ( v1 === arr ); + let bool = ( v1 === arr ); // returns true - var v2 = it.next().value; + const v2 = it.next().value; // returns [ 1, 2, 3, 4 ] bool = ( v2 === arr ); @@ -138,17 +138,17 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var iterConstant = require( '@stdlib/iter/constant' ); +const randu = require( '@stdlib/random/base/randu' ); +const iterConstant = require( '@stdlib/iter/constant' ); // Create an iterator: -var opts = { +const opts = { 'iter': 10 }; -var it = iterConstant( randu(), opts ); +const it = iterConstant( randu(), opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/counter/README.md b/lib/node_modules/@stdlib/iter/counter/README.md index 6e667c49d8d5..0f19c99d5c11 100644 --- a/lib/node_modules/@stdlib/iter/counter/README.md +++ b/lib/node_modules/@stdlib/iter/counter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCounter = require( '@stdlib/iter/counter' ); +const iterCounter = require( '@stdlib/iter/counter' ); ``` #### iterCounter( iterator ) @@ -45,12 +45,12 @@ var iterCounter = require( '@stdlib/iter/counter' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the number of [iterated][mdn-iterator-protocol] values (i.e., the cumulative count). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCounter( array2iterator( [ 10, 20, 30, 40 ] ) ); +const it = iterCounter( array2iterator( [ 10, 20, 30, 40 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -92,20 +92,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCounter = require( '@stdlib/iter/counter' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCounter = require( '@stdlib/iter/counter' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which iteratively computes the number of iterated values: -var it = iterCounter( rand ); +const it = iterCounter( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/cuany-by/README.md b/lib/node_modules/@stdlib/iter/cuany-by/README.md index 4d5a558dadfe..a48b41c2eb5e 100644 --- a/lib/node_modules/@stdlib/iter/cuany-by/README.md +++ b/lib/node_modules/@stdlib/iter/cuany-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuAnyBy = require( '@stdlib/iter/cuany-by' ); +const iterCuAnyBy = require( '@stdlib/iter/cuany-by' ); ``` #### iterCuAnyBy( iterator, predicate\[, thisArg] ) @@ -45,17 +45,17 @@ var iterCuAnyBy = require( '@stdlib/iter/cuany-by' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether at least one iterated value passes a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); +const arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); -var it = iterCuAnyBy( arr, predicate ); +const it = iterCuAnyBy( arr, predicate ); -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -70,7 +70,7 @@ v = it.next().value; v = it.next().value; // returns true -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -89,21 +89,21 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v < 0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterCuAnyBy( array2iterator( [ 1, 2, -1, 4 ] ), predicate, ctx ); +const it = iterCuAnyBy( array2iterator( [ 1, 2, -1, 4 ] ), predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -115,7 +115,7 @@ v = it.next().value; v = it.next().value; // returns true -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -144,24 +144,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCuAnyBy = require( '@stdlib/iter/cuany-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCuAnyBy = require( '@stdlib/iter/cuany-by' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which cumulatively tests whether at least one iterated value passes a test implemented by a predicate function: -var it = iterCuAnyBy( riter, threshold ); +const it = iterCuAnyBy( riter, threshold ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cuany/README.md b/lib/node_modules/@stdlib/iter/cuany/README.md index 9dd8c8e9d4d0..97887d862359 100644 --- a/lib/node_modules/@stdlib/iter/cuany/README.md +++ b/lib/node_modules/@stdlib/iter/cuany/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuAny = require( '@stdlib/iter/cuany' ); +const iterCuAny = require( '@stdlib/iter/cuany' ); ``` #### iterCuAny( iterator ) @@ -45,14 +45,14 @@ var iterCuAny = require( '@stdlib/iter/cuany' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether at least one iterated value is truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); +const arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); -var it = iterCuAny( arr ); +const it = iterCuAny( arr ); // returns -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -67,7 +67,7 @@ v = it.next().value; v = it.next().value; // returns true -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,28 +97,28 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterCuAny = require( '@stdlib/iter/cuany' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterCuAny = require( '@stdlib/iter/cuany' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Create an iterator which cumulatively tests whether at least one iterated value is truthy: -var it = iterCuAny( miter ); +const it = iterCuAny( miter ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cuevery-by/README.md b/lib/node_modules/@stdlib/iter/cuevery-by/README.md index 4cf25c970dbd..5c678ac1c1a3 100644 --- a/lib/node_modules/@stdlib/iter/cuevery-by/README.md +++ b/lib/node_modules/@stdlib/iter/cuevery-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuEveryBy = require( '@stdlib/iter/cuevery-by' ); +const iterCuEveryBy = require( '@stdlib/iter/cuevery-by' ); ``` #### iterCuEveryBy( iterator, predicate\[, thisArg] ) @@ -45,17 +45,17 @@ var iterCuEveryBy = require( '@stdlib/iter/cuevery-by' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether every iterated value passes a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); +const arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); -var it = iterCuEveryBy( arr, predicate ); +const it = iterCuEveryBy( arr, predicate ); -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -70,7 +70,7 @@ v = it.next().value; v = it.next().value; // returns false -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -89,21 +89,21 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterCuEveryBy( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); +const it = iterCuEveryBy( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -115,7 +115,7 @@ v = it.next().value; v = it.next().value; // returns true -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -144,24 +144,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCuEveryBy = require( '@stdlib/iter/cuevery-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCuEveryBy = require( '@stdlib/iter/cuevery-by' ); function threshold( r ) { return ( r > 0.05 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which cumulatively tests whether every iterated value passes a test: -var it = iterCuEveryBy( riter, threshold ); +const it = iterCuEveryBy( riter, threshold ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cuevery/README.md b/lib/node_modules/@stdlib/iter/cuevery/README.md index 65ce2dc0d870..9b094d030345 100644 --- a/lib/node_modules/@stdlib/iter/cuevery/README.md +++ b/lib/node_modules/@stdlib/iter/cuevery/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuEvery = require( '@stdlib/iter/cuevery' ); +const iterCuEvery = require( '@stdlib/iter/cuevery' ); ``` #### iterCuEvery( iterator ) @@ -45,14 +45,14 @@ var iterCuEvery = require( '@stdlib/iter/cuevery' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether every iterated value is truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); +const arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); -var it = iterCuEvery( arr ); +const it = iterCuEvery( arr ); // returns -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -67,7 +67,7 @@ v = it.next().value; v = it.next().value; // returns false -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,28 +97,28 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterCuEvery = require( '@stdlib/iter/cuevery' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterCuEvery = require( '@stdlib/iter/cuevery' ); function threshold( r ) { return ( r > 0.1 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Create an iterator which cumulatively tests whether every iterated value is truthy: -var it = iterCuEvery( miter ); +const it = iterCuEvery( miter ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cunone-by/README.md b/lib/node_modules/@stdlib/iter/cunone-by/README.md index 8b05241778fa..4437b72df549 100644 --- a/lib/node_modules/@stdlib/iter/cunone-by/README.md +++ b/lib/node_modules/@stdlib/iter/cunone-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuNoneBy = require( '@stdlib/iter/cunone-by' ); +const iterCuNoneBy = require( '@stdlib/iter/cunone-by' ); ``` #### iterCuNoneBy( iterator, predicate\[, thisArg] ) @@ -45,17 +45,17 @@ var iterCuNoneBy = require( '@stdlib/iter/cunone-by' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether every iterated value fails a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); +const arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); -var it = iterCuNoneBy( arr, predicate ); +const it = iterCuNoneBy( arr, predicate ); -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -70,7 +70,7 @@ v = it.next().value; v = it.next().value; // returns false -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -89,21 +89,21 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v < 0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterCuNoneBy( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); +const it = iterCuNoneBy( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -115,7 +115,7 @@ v = it.next().value; v = it.next().value; // returns true -var count = ctx.count; +const count = ctx.count; // returns 4 ``` @@ -144,24 +144,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCuNoneBy = require( '@stdlib/iter/cunone-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCuNoneBy = require( '@stdlib/iter/cunone-by' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which cumulatively tests whether every iterated value fails a test: -var it = iterCuNoneBy( riter, threshold ); +const it = iterCuNoneBy( riter, threshold ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cunone/README.md b/lib/node_modules/@stdlib/iter/cunone/README.md index 0145cb4ca50c..15c76066a1ee 100644 --- a/lib/node_modules/@stdlib/iter/cunone/README.md +++ b/lib/node_modules/@stdlib/iter/cunone/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuNone = require( '@stdlib/iter/cunone' ); +const iterCuNone = require( '@stdlib/iter/cunone' ); ``` #### iterCuNone( iterator ) @@ -45,14 +45,14 @@ var iterCuNone = require( '@stdlib/iter/cunone' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether every iterated value is falsy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); +const arr = array2iterator( [ 0, 0, 0, 1, 0 ] ); -var it = iterCuNone( arr ); +const it = iterCuNone( arr ); // returns -var v = it.next().value; +let v = it.next().value; // returns true v = it.next().value; @@ -67,7 +67,7 @@ v = it.next().value; v = it.next().value; // returns false -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,28 +97,28 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterCuNone = require( '@stdlib/iter/cunone' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterCuNone = require( '@stdlib/iter/cunone' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Create an iterator which cumulatively tests whether every iterated value is falsy: -var it = iterCuNone( miter ); +const it = iterCuNone( miter ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cusome-by/README.md b/lib/node_modules/@stdlib/iter/cusome-by/README.md index 95fee4c4755b..de69998e32b0 100644 --- a/lib/node_modules/@stdlib/iter/cusome-by/README.md +++ b/lib/node_modules/@stdlib/iter/cusome-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuSomeBy = require( '@stdlib/iter/cusome-by' ); +const iterCuSomeBy = require( '@stdlib/iter/cusome-by' ); ``` #### iterCuSomeBy( iterator, n, predicate\[, thisArg] ) @@ -45,17 +45,17 @@ var iterCuSomeBy = require( '@stdlib/iter/cusome-by' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether at least `n` iterated values pass a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function isPositive( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 0, 1, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 1, 1 ] ); -var it = iterCuSomeBy( arr, 2, isPositive ); +const it = iterCuSomeBy( arr, 2, isPositive ); -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -70,7 +70,7 @@ v = it.next().value; v = it.next().value; // returns true -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -89,23 +89,23 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); +const arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var it = iterCuSomeBy( arr, 3, predicate, ctx ); +const it = iterCuSomeBy( arr, 3, predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -120,7 +120,7 @@ v = it.next().value; v = it.next().value; // returns true -var count = ctx.count; +const count = ctx.count; // returns 5 ``` @@ -149,24 +149,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCuSomeBy = require( '@stdlib/iter/cusome-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCuSomeBy = require( '@stdlib/iter/cusome-by' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which tracks whether at least two values have exceeded the threshold: -var it = iterCuSomeBy( riter, 2, threshold ); +const it = iterCuSomeBy( riter, 2, threshold ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/cusome/README.md b/lib/node_modules/@stdlib/iter/cusome/README.md index 3309743604c1..0a422f427fc2 100644 --- a/lib/node_modules/@stdlib/iter/cusome/README.md +++ b/lib/node_modules/@stdlib/iter/cusome/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCuSome = require( '@stdlib/iter/cusome' ); +const iterCuSome = require( '@stdlib/iter/cusome' ); ``` #### iterCuSome( iterator, n ) @@ -45,13 +45,13 @@ var iterCuSome = require( '@stdlib/iter/cusome' ); Returns an [iterator][mdn-iterator-protocol] which cumulatively tests whether at least `n` iterated values are truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 1, 1, 0 ] ); +const arr = array2iterator( [ 0, 0, 1, 1, 0 ] ); -var it = iterCuSome( arr, 2 ); +const it = iterCuSome( arr, 2 ); -var v = it.next().value; +let v = it.next().value; // returns false v = it.next().value; @@ -66,7 +66,7 @@ v = it.next().value; v = it.next().value; // returns true -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -96,28 +96,28 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterCuSome = require( '@stdlib/iter/cusome' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterCuSome = require( '@stdlib/iter/cusome' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Create an iterator which cumulatively tests whether at least 5 iterated values are truthy: -var it = iterCuSome( miter, 5 ); +const it = iterCuSome( miter, 5 ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/datespace/README.md b/lib/node_modules/@stdlib/iter/datespace/README.md index 1f791717ce83..ee91abd087f9 100644 --- a/lib/node_modules/@stdlib/iter/datespace/README.md +++ b/lib/node_modules/@stdlib/iter/datespace/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDatespace = require( '@stdlib/iter/datespace' ); +const iterDatespace = require( '@stdlib/iter/datespace' ); ``` #### iterDatespace( start, stop\[, N]\[, options] ) @@ -45,13 +45,13 @@ var iterDatespace = require( '@stdlib/iter/datespace' ); Returns an iterator which returns evenly spaced `Date` objects over a specified interval. ```javascript -var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); +const MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); -var start = ( new Date() ).getTime(); -var it = iterDatespace( start, start+MILLISECONDS_IN_DAY ); +const start = ( new Date() ).getTime(); +const it = iterDatespace( start, start+MILLISECONDS_IN_DAY ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -75,13 +75,13 @@ The function accepts the following `options`: By default, the iterator returns `100` values. To return an alternative number of values over the specified interval, provide an `N` argument. ```javascript -var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); +const MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); -var start = ( new Date() ).getTime(); -var it = iterDatespace( start, start+MILLISECONDS_IN_DAY, 3 ); +const start = ( new Date() ).getTime(); +const it = iterDatespace( start, start+MILLISECONDS_IN_DAY, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -90,17 +90,17 @@ v = it.next().value; v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` The returned iterator is guaranteed to return the `start` and `stop` values. Beware, however, that values between `start` and `stop` are subject to rounding errors. For example, ```javascript -var it = iterDatespace( 1417503655000, 1417503655001, 3 ); +const it = iterDatespace( 1417503655000, 1417503655001, 3 ); // returns -var v = it.next().value.getTime(); +let v = it.next().value.getTime(); // returns 1417503655000 v = it.next().value.getTime(); @@ -115,13 +115,13 @@ where sub-millisecond values are truncated by the `Date` constructor. Duplicate By default, fractional timestamps are floored. To specify that timestamps always be rounded up or to the nearest millisecond when converted to `Date` objects, set the round option. ```javascript -var opts = { +let opts = { 'round': 'ceil' }; -var it = iterDatespace( 1417503655000, 1417503655001, 3, opts ); +let it = iterDatespace( 1417503655000, 1417503655001, 3, opts ); // returns -var v = it.next().value.getTime(); +let v = it.next().value.getTime(); // returns 1417503655000 v = it.next().value.getTime(); @@ -172,17 +172,17 @@ v = it.next().value.getTime(); ```javascript -var MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); -var HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); -var iterDatespace = require( '@stdlib/iter/datespace' ); +const MILLISECONDS_IN_DAY = require( '@stdlib/constants/time/milliseconds-in-day' ); +const HOURS_IN_DAY = require( '@stdlib/constants/time/hours-in-day' ); +const iterDatespace = require( '@stdlib/iter/datespace' ); // Create an iterator which returns a Date object for each hour in the next 24 hours: -var start = new Date(); -var end = new Date( start.getTime()+MILLISECONDS_IN_DAY ); -var it = iterDatespace( start, end, HOURS_IN_DAY+1 ); +const start = new Date(); +const end = new Date( start.getTime()+MILLISECONDS_IN_DAY ); +const it = iterDatespace( start, end, HOURS_IN_DAY+1 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/dedupe-by/README.md b/lib/node_modules/@stdlib/iter/dedupe-by/README.md index 3164e4139e57..7f1457e6d110 100644 --- a/lib/node_modules/@stdlib/iter/dedupe-by/README.md +++ b/lib/node_modules/@stdlib/iter/dedupe-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDedupeBy = require( '@stdlib/iter/dedupe-by' ); +const iterDedupeBy = require( '@stdlib/iter/dedupe-by' ); ``` #### iterDedupeBy( iterator, \[limit,] fcn ) @@ -45,17 +45,17 @@ var iterDedupeBy = require( '@stdlib/iter/dedupe-by' ); Returns an [iterator][mdn-iterator-protocol] which removes consecutive values that resolve to the same value according to a provided function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v; } -var arr = array2iterator( [ 1, 1, 2, 3, 3, 3, 4, 4 ] ); -var it = iterDedupeBy( arr, fcn ); +const arr = array2iterator( [ 1, 1, 2, 3, 3, 3, 4, 4 ] ); +const it = iterDedupeBy( arr, fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -67,7 +67,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -87,17 +87,17 @@ The callback function is provided five arguments: The returned [iterator][mdn-iterator-protocol] removes **consecutive** values which resolve to the same value and does **not** return globally "unique" values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v; } -var arr = array2iterator( [ 1, 1, 2, 1, 1, 2 ] ); -var it = iterDedupeBy( arr, fcn ); +const arr = array2iterator( [ 1, 1, 2, 1, 1, 2 ] ); +const it = iterDedupeBy( arr, fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -109,24 +109,24 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` To specify the number of allowed consecutive duplicated values, provide a `limit` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v; } -var arr = array2iterator( [ 1, 1, 2, 3, 3, 3, 3, 4, 4, 4 ] ); -var it = iterDedupeBy( arr, 2, fcn ); +const arr = array2iterator( [ 1, 1, 2, 3, 3, 3, 3, 4, 4, 4 ] ); +const it = iterDedupeBy( arr, 2, fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -147,7 +147,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -176,9 +176,9 @@ var bool = it.next().done; ```javascript -var randi = require( '@stdlib/random/iter/discrete-uniform' ); -var iterDedupe = require( '@stdlib/iter/dedupe' ); -var iterDedupeBy = require( '@stdlib/iter/dedupe-by' ); +const randi = require( '@stdlib/random/iter/discrete-uniform' ); +const iterDedupe = require( '@stdlib/iter/dedupe' ); +const iterDedupeBy = require( '@stdlib/iter/dedupe-by' ); function fcn( curr, sprev, dprev, i, acc ) { if ( curr < dprev ) { @@ -192,19 +192,19 @@ function fcn( curr, sprev, dprev, i, acc ) { } // Create a seeded iterator for generating pseudorandom integers: -var rand = randi( 1, 10, { +const rand = randi( 1, 10, { 'seed': 1234, 'iter': 100 }); // Create an iterator which removes consecutive duplicated values: -var deduped = iterDedupe( rand ); +const deduped = iterDedupe( rand ); // Create an iterator which forces consecutive values to follow an alternating less than, greater than pattern: -var it = iterDedupeBy( deduped, fcn ); +const it = iterDedupeBy( deduped, fcn ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/dedupe/README.md b/lib/node_modules/@stdlib/iter/dedupe/README.md index d35682259ff3..2262b8bde295 100644 --- a/lib/node_modules/@stdlib/iter/dedupe/README.md +++ b/lib/node_modules/@stdlib/iter/dedupe/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDedupe = require( '@stdlib/iter/dedupe' ); +const iterDedupe = require( '@stdlib/iter/dedupe' ); ``` #### iterDedupe( iterator\[, limit] ) @@ -45,12 +45,12 @@ var iterDedupe = require( '@stdlib/iter/dedupe' ); Returns an [iterator][mdn-iterator-protocol] which removes consecutive duplicated values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDedupe( array2iterator( [ 1, 1, 2, 3, 3, 3, 4, 4 ] ) ); +const it = iterDedupe( array2iterator( [ 1, 1, 2, 3, 3, 3, 4, 4 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -62,7 +62,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -74,12 +74,12 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the The returned [iterator][mdn-iterator-protocol] removes **consecutive** duplicated values and does **not** return globally unique values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDedupe( array2iterator( [ 1, 1, 2, 1, 1, 2 ] ) ); +const it = iterDedupe( array2iterator( [ 1, 1, 2, 1, 1, 2 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -91,19 +91,19 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` To specify the number of allowed consecutive duplicated values, provide a second argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDedupe( array2iterator( [ 1, 1, 2, 3, 3, 3, 3, 4, 4, 4 ] ), 2 ); +const it = iterDedupe( array2iterator( [ 1, 1, 2, 3, 3, 3, 3, 4, 4, 4 ] ), 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -124,7 +124,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -141,12 +141,12 @@ var bool = it.next().done; - `NaN` values are considered **distinct**. ```javascript - var array2iterator = require( '@stdlib/array/to-iterator' ); + const array2iterator = require( '@stdlib/array/to-iterator' ); - var it = iterDedupe( array2iterator( [ NaN, NaN, NaN, NaN ] ) ); + const it = iterDedupe( array2iterator( [ NaN, NaN, NaN, NaN ] ) ); // returns - var v = it.next().value; + let v = it.next().value; // returns NaN v = it.next().value; @@ -158,19 +158,19 @@ var bool = it.next().done; v = it.next().value; // returns NaN - var bool = it.next().done; + const bool = it.next().done; // returns true ``` - Uniqueness is determined according to strict equality. Accordingly, objects are **not** checked for deep equality. ```javascript - var array2iterator = require( '@stdlib/array/to-iterator' ); + const array2iterator = require( '@stdlib/array/to-iterator' ); - var it = iterDedupe( array2iterator( [ {}, {}, {}, {} ] ) ); + const it = iterDedupe( array2iterator( [ {}, {}, {}, {} ] ) ); // returns - var v = it.next().value; + let v = it.next().value; // returns {} v = it.next().value; @@ -182,7 +182,7 @@ var bool = it.next().done; v = it.next().value; // returns {} - var bool = it.next().done; + const bool = it.next().done; // returns true ``` @@ -201,20 +201,20 @@ var bool = it.next().done; ```javascript -var randi = require( '@stdlib/random/iter/discrete-uniform' ); -var iterDedupe = require( '@stdlib/iter/dedupe' ); +const randi = require( '@stdlib/random/iter/discrete-uniform' ); +const iterDedupe = require( '@stdlib/iter/dedupe' ); // Create a seeded iterator for generating pseudorandom integers on the interval [1,3]: -var rand = randi( 1, 3, { +const rand = randi( 1, 3, { 'seed': 1234, 'iter': 100 }); // Create an iterator which limits "runs" to at most 3 values: -var it = iterDedupe( rand, 3 ); +const it = iterDedupe( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/do-until-each/README.md b/lib/node_modules/@stdlib/iter/do-until-each/README.md index fad705536b94..107a69cc3c66 100644 --- a/lib/node_modules/@stdlib/iter/do-until-each/README.md +++ b/lib/node_modules/@stdlib/iter/do-until-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDoUntilEach = require( '@stdlib/iter/do-until-each' ); +const iterDoUntilEach = require( '@stdlib/iter/do-until-each' ); ``` #### iterDoUntilEach( iterator, predicate, fcn\[, thisArg] ) @@ -45,7 +45,7 @@ var iterDoUntilEach = require( '@stdlib/iter/do-until-each' ); Returns an iterator which invokes a function for each iterated value **before** returning the iterated value until either a `predicate` function returns `true` or the iterator has iterated over all values. Note that the condition is evaluated **after** executing `fcn`; thus, `fcn` **always** executes at least once. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v > 2; @@ -57,10 +57,11 @@ function assert( v ) { } } -var it = iterDoUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const iterator = array2iterator( [ 1, 2, 3, 4 ] ); +const it = iterDoUntilEach( iterator, predicate, assert ); // returns {} -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -83,7 +84,7 @@ Both the `predicate` function and the function to invoke for each iterated value - **index**: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v > 2; @@ -95,10 +96,11 @@ function assert( v, i ) { } } -var it = iterDoUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const iterator = array2iterator( [ 1, 2, 3, 4 ] ); +const it = iterDoUntilEach( iterator, predicate, assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -115,7 +117,7 @@ To set the execution context for `fcn`, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { this.count += 1; @@ -128,14 +130,15 @@ function predicate( v ) { return v > 2; } -var c = { +const c = { 'count': 0 }; -var it = iterDoUntilEach( array2iterator( [ 1, 2, 3 ] ), predicate, assert, c ); +const iterator = array2iterator( [ 1, 2, 3 ] ); +const it = iterDoUntilEach( iterator, predicate, assert, c ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -144,7 +147,7 @@ r = it.next().value; r = it.next().value; // returns undefined -var count = c.count; +const count = c.count; // returns 3 ``` @@ -173,9 +176,9 @@ var count = c.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var iterDoUntilEach = require( '@stdlib/iter/do-until-each' ); +const randu = require( '@stdlib/random/iter/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const iterDoUntilEach = require( '@stdlib/iter/do-until-each' ); function assert( v ) { if ( isnan( v ) ) { @@ -188,16 +191,16 @@ function predicate( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which validates generated numbers: -var it = iterDoUntilEach( rand, predicate, assert ); +const it = iterDoUntilEach( rand, predicate, assert ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/do-while-each/README.md b/lib/node_modules/@stdlib/iter/do-while-each/README.md index 6fdef20c1353..6d01c5529ae0 100644 --- a/lib/node_modules/@stdlib/iter/do-while-each/README.md +++ b/lib/node_modules/@stdlib/iter/do-while-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); +const iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); ``` #### iterDoWhileEach( iterator, predicate, fcn\[, thisArg] ) @@ -45,8 +45,8 @@ var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); Returns an iterator which invokes a function for each iterated value before returning the iterated value until either a predicate function returns false or the iterator has iterated over all values. The condition is evaluated after executing the provided function (fcn). ```javascript -var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v < 3; @@ -58,10 +58,11 @@ function assert( v ) { } } -var it = iterDoWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const iterator = array2iterator( [ 1, 2, 3, 4 ] ); +const it = iterDoWhileEach( iterator, predicate, assert ); // returns {} -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -84,8 +85,8 @@ Both the `predicate` function and the function to invoke for each iterated value - **index**: iteration index (zero-based) ```javascript -var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v < 3; @@ -97,10 +98,11 @@ function assert( v, i ) { } } -var it = iterDoWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const iterator = array2iterator( [ 1, 2, 3, 4 ] ); +const it = iterDoWhileEach( iterator, predicate, assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -116,8 +118,8 @@ To set the execution context for `fcn`, provide a `thisArg`. ```javascript -var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { this.count += 1; @@ -130,15 +132,15 @@ function predicate( v ) { return v < 3; } -var ctx = { +const ctx = { 'count': 0 }; -var iterator = array2iterator( [ 1, 2, 3 ] ); -var it = iterDoWhileEach( iterator, predicate, assert, ctx ); +const iterator = array2iterator( [ 1, 2, 3 ] ); +const it = iterDoWhileEach( iterator, predicate, assert, ctx ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -147,7 +149,7 @@ r = it.next().value; r = it.next().value; // returns undefined -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -176,9 +178,9 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); +const randu = require( '@stdlib/random/iter/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const iterDoWhileEach = require( '@stdlib/iter/do-while-each' ); function assert( v ) { if ( isnan( v ) ) { @@ -191,16 +193,16 @@ function predicate( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which validates generated numbers: -var it = iterDoWhileEach( rand, predicate, assert ); +const it = iterDoWhileEach( rand, predicate, assert ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/empty/README.md b/lib/node_modules/@stdlib/iter/empty/README.md index 594476dd6193..0b93a5424152 100644 --- a/lib/node_modules/@stdlib/iter/empty/README.md +++ b/lib/node_modules/@stdlib/iter/empty/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEmpty = require( '@stdlib/iter/empty' ); +const iterEmpty = require( '@stdlib/iter/empty' ); ``` #### iterEmpty() @@ -45,10 +45,10 @@ var iterEmpty = require( '@stdlib/iter/empty' ); Returns an "empty" iterator (i.e., an iterator which never returns an iterated value). ```javascript -var it = iterEmpty(); +const it = iterEmpty(); // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -82,13 +82,13 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterEmpty = require( '@stdlib/iter/empty' ); +const iterEmpty = require( '@stdlib/iter/empty' ); // Create an iterator: -var it = iterEmpty(); +const it = iterEmpty(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/every-by/README.md b/lib/node_modules/@stdlib/iter/every-by/README.md index 435d629d5a3e..d70613a6af50 100644 --- a/lib/node_modules/@stdlib/iter/every-by/README.md +++ b/lib/node_modules/@stdlib/iter/every-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEveryBy = require( '@stdlib/iter/every-by' ); +const iterEveryBy = require( '@stdlib/iter/every-by' ); ``` #### iterEveryBy( iterator, predicate\[, thisArg] ) @@ -45,28 +45,28 @@ var iterEveryBy = require( '@stdlib/iter/every-by' ); Tests whether every [iterated][mdn-iterator-protocol] value **passes** a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 1, 1, 1, 1, 1 ] ); +const arr = array2iterator( [ 1, 1, 1, 1, 1 ] ); -var bool = iterEveryBy( arr, predicate ); +const bool = iterEveryBy( arr, predicate ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate() { return true; } -var bool = iterEveryBy( array2iterator( [] ), predicate ); +const bool = iterEveryBy( array2iterator( [] ), predicate ); // returns true ``` @@ -78,23 +78,23 @@ A `predicate` function is provided two arguments: To set the execution context of the `predicate` function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); +const arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var bool = iterEveryBy( arr, predicate, ctx ); +const bool = iterEveryBy( arr, predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -123,21 +123,21 @@ var n = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterEveryBy = require( '@stdlib/iter/every-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterEveryBy = require( '@stdlib/iter/every-by' ); function threshold( r ) { return ( r < 0.99 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Determine if all values are below a threshold: -var bool = iterEveryBy( riter, threshold ); +const bool = iterEveryBy( riter, threshold ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/every/README.md b/lib/node_modules/@stdlib/iter/every/README.md index ce4002d9ac4f..03c65fcfe320 100644 --- a/lib/node_modules/@stdlib/iter/every/README.md +++ b/lib/node_modules/@stdlib/iter/every/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEvery = require( '@stdlib/iter/every' ); +const iterEvery = require( '@stdlib/iter/every' ); ``` #### iterEvery( iterator ) @@ -45,20 +45,20 @@ var iterEvery = require( '@stdlib/iter/every' ); Tests whether all [iterated][mdn-iterator-protocol] values are truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 1, 1, 1, 0 ] ); +const arr = array2iterator( [ 1, 1, 1, 1, 0 ] ); -var bool = iterEvery( arr ); +const bool = iterEvery( arr ); // returns false ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var bool = iterEvery( array2iterator( [] ) ); +const bool = iterEvery( array2iterator( [] ) ); // returns true ``` @@ -83,25 +83,25 @@ var bool = iterEvery( array2iterator( [] ) ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterEvery = require( '@stdlib/iter/every' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterEvery = require( '@stdlib/iter/every' ); function threshold( r ) { return ( r <= 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Determine if all values are "truthy": -var bool = iterEvery( miter ); +const bool = iterEvery( miter ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/fill/README.md b/lib/node_modules/@stdlib/iter/fill/README.md index aaed21626441..34e5374eb417 100644 --- a/lib/node_modules/@stdlib/iter/fill/README.md +++ b/lib/node_modules/@stdlib/iter/fill/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFill = require( '@stdlib/iter/fill' ); +const iterFill = require( '@stdlib/iter/fill' ); ``` #### iterFill( iterator, value\[, begin\[, end]] ) @@ -45,12 +45,12 @@ var iterFill = require( '@stdlib/iter/fill' ); Returns an [iterator][mdn-iterator-protocol] which replaces all values from a provided [`iterator`][mdn-iterator-protocol] from a `begin` index to an `end` index with a static `value`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14 ); +const it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.14 v = it.next().value; @@ -70,12 +70,12 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the By default, the returned [iterator][mdn-iterator-protocol] replaces/fills a provided [iterator's][mdn-iterator-protocol] first iterated value through an [iterator's][mdn-iterator-protocol] last iterated value. To specify an alternative start iteration index at which to begin filling (zero-based and **inclusive**), provide a `begin` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 2 ); +const it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -87,19 +87,19 @@ v = it.next().value; v = it.next().value; // returns 3.14 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` By default, the returned [iterator][mdn-iterator-protocol] continues filling until it replaces all of a provided [iterator's][mdn-iterator-protocol] iterated values. To specify an end iteration index at which to stop filling (zero-based and **non-inclusive**), provide an `end` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 1, 3 ); +const it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 1, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -111,19 +111,19 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `begin` is greater than or equal to `end`, the returned [iterator][mdn-iterator-protocol] does not replace any iterated values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 3, 1 ); +const it = iterFill( array2iterator( [ 1, 2, 3, 4 ] ), 3.14, 3, 1 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -135,7 +135,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -165,20 +165,20 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterFill = require( '@stdlib/iter/fill' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterFill = require( '@stdlib/iter/fill' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 100 }); // Create an iterator which replaces a subsequence of 10 generated numbers: -var it = iterFill( rand, 3.14, 10, 20 ); +const it = iterFill( rand, 3.14, 10, 20 ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/filter-map/README.md b/lib/node_modules/@stdlib/iter/filter-map/README.md index c73b4c5f6709..4749c8734fb7 100644 --- a/lib/node_modules/@stdlib/iter/filter-map/README.md +++ b/lib/node_modules/@stdlib/iter/filter-map/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFilterMap = require( '@stdlib/iter/filter-map' ); +const iterFilterMap = require( '@stdlib/iter/filter-map' ); ``` #### iterFilterMap( iterator, fcn\[, thisArg] ) @@ -45,7 +45,7 @@ var iterFilterMap = require( '@stdlib/iter/filter-map' ); Returns an [iterator][mdn-iterator-protocol] which both filters **and** maps the values of another [`iterator`][mdn-iterator-protocol] according to a callback function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { if ( v > 2 ) { @@ -53,16 +53,16 @@ function fcn( v ) { } } -var it = iterFilterMap( array2iterator( [ 1, 3, 2, 4 ] ), fcn ); +const it = iterFilterMap( array2iterator( [ 1, 3, 2, 4 ] ), fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 30 v = it.next().value; // returns 40 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -77,7 +77,7 @@ The callback function is provided two arguments: - **index**: iteration index (zero-based). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i ) { if ( i >= 2 ) { @@ -85,16 +85,16 @@ function fcn( v, i ) { } } -var it = iterFilterMap( array2iterator( [ 3, 4, 1, 2 ] ), fcn ); +const it = iterFilterMap( array2iterator( [ 3, 4, 1, 2 ] ), fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10 v = it.next().value; // returns 20 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -103,7 +103,7 @@ To set the callback function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { this.count += 1; @@ -112,14 +112,14 @@ function fcn( v ) { } } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterFilterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); +const it = iterFilterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 10 v = it.next().value; @@ -128,7 +128,7 @@ v = it.next().value; v = it.next().value; // returns 30 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -158,8 +158,8 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterFilterMap = require( '@stdlib/iter/filter-map' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterFilterMap = require( '@stdlib/iter/filter-map' ); function fcn( v ) { if ( v > 0.5 ) { @@ -168,16 +168,16 @@ function fcn( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 20 }); // Create an iterator which both filters and maps the generated numbers: -var it = iterFilterMap( rand, fcn ); +const it = iterFilterMap( rand, fcn ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/filter/README.md b/lib/node_modules/@stdlib/iter/filter/README.md index b07b723961f5..97a6452c2a46 100644 --- a/lib/node_modules/@stdlib/iter/filter/README.md +++ b/lib/node_modules/@stdlib/iter/filter/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFilter = require( '@stdlib/iter/filter' ); +const iterFilter = require( '@stdlib/iter/filter' ); ``` #### iterFilter( iterator, predicate\[, thisArg] ) @@ -45,22 +45,22 @@ var iterFilter = require( '@stdlib/iter/filter' ); Returns an [iterator][mdn-iterator-protocol] which filters the values of another [`iterator`][mdn-iterator-protocol] according to a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 2 ); } -var it = iterFilter( array2iterator( [ 1, 3, 2, 4 ] ), predicate ); +const it = iterFilter( array2iterator( [ 1, 3, 2, 4 ] ), predicate ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -75,22 +75,22 @@ The `predicate` function is provided two arguments: - **index**: iteration index (zero-based). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v, i ) { return ( i >= 2 ); } -var it = iterFilter( array2iterator( [ 3, 4, 1, 2 ] ), predicate ); +const it = iterFilter( array2iterator( [ 3, 4, 1, 2 ] ), predicate ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -99,21 +99,21 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterFilter( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); +const it = iterFilter( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -122,7 +122,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -151,24 +151,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterFilter = require( '@stdlib/iter/filter' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterFilter = require( '@stdlib/iter/filter' ); function predicate( v ) { return ( v > 0.5 ); } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 20 }); // Create an iterator which filters the generated numbers: -var it = iterFilter( rand, predicate ); +const it = iterFilter( rand, predicate ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/first/README.md b/lib/node_modules/@stdlib/iter/first/README.md index 467dd06c3e29..7ca5733980a9 100644 --- a/lib/node_modules/@stdlib/iter/first/README.md +++ b/lib/node_modules/@stdlib/iter/first/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFirst = require( '@stdlib/iter/first' ); +const iterFirst = require( '@stdlib/iter/first' ); ``` #### iterFirst( iterator ) @@ -45,20 +45,20 @@ var iterFirst = require( '@stdlib/iter/first' ); Returns the first [iterated][mdn-iterator-protocol] value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 0, 0, 0, 0 ] ); +const arr = array2iterator( [ 1, 0, 0, 0, 0 ] ); -var v = iterFirst( arr ); +const v = iterFirst( arr ); // returns 1 ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any [iterated][mdn-iterator-protocol] values, the function returns `undefined`. ```javascript -var iterEmpty = require( '@stdlib/iter/empty' ); +const iterEmpty = require( '@stdlib/iter/empty' ); -var v = iterFirst( iterEmpty() ); +const v = iterFirst( iterEmpty() ); // returns undefined ``` @@ -87,25 +87,25 @@ var v = iterFirst( iterEmpty() ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterFirst = require( '@stdlib/iter/first' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterFirst = require( '@stdlib/iter/first' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Return the first threshold result: -var bool = iterFirst( miter ); +const bool = iterFirst( miter ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/flow/README.md b/lib/node_modules/@stdlib/iter/flow/README.md index 92cf1e5621d9..c69c12cd0202 100644 --- a/lib/node_modules/@stdlib/iter/flow/README.md +++ b/lib/node_modules/@stdlib/iter/flow/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFlow = require( '@stdlib/iter/flow' ); +const iterFlow = require( '@stdlib/iter/flow' ); ``` #### iterFlow( methods ) @@ -45,11 +45,11 @@ var iterFlow = require( '@stdlib/iter/flow' ); Returns a fluent interface [iterator][mdn-iterator-protocol] constructor with a customized `prototype` based on provided `methods`. ```javascript -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); // Create a mini-fluent interface having just the methods `head` and `some`: -var FluentIterator = iterFlow({ +const FluentIterator = iterFlow({ 'head': iterHead, 'some': iterSome }); @@ -77,24 +77,24 @@ If an [iterator][mdn-iterator-protocol] function returns an [iterator][mdn-itera Returns a new fluent interface [iterator][mdn-iterator-protocol] from a source [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); // Create a mini-fluent interface having just the methods `head` and `some`: -var FluentIterator = iterFlow({ +const FluentIterator = iterFlow({ 'head': iterHead, 'some': iterSome }); // Create a source iterator: -var src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); +const src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); // Convert the source iterator to a fluent interface iterator: -var it = new FluentIterator( src ); +const it = new FluentIterator( src ); // Test if at least 3 of the first 5 iterated values are truthy: -var bool = it.head( 5 ).some( 3 ); +const bool = it.head( 5 ).some( 3 ); // returns true ``` @@ -103,27 +103,27 @@ var bool = it.head( 5 ).some( 3 ); Returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); // Create a mini-fluent interface having just the methods `head` and `some`: -var FluentIterator = iterFlow({ +const FluentIterator = iterFlow({ 'head': iterHead, 'some': iterSome }); // Create a source iterator: -var src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); +const src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); // Create a fluent interface iterator: -var it1 = new FluentIterator( src ); +const it1 = new FluentIterator( src ); // Invoke the `head` method to return an iterator limited to the first 5 source values: -var it2 = it1.head( 5 ); +const it2 = it1.head( 5 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it2.next(); if ( v.done ) { @@ -138,27 +138,27 @@ while ( true ) { Closes a fluent interface [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); // Create a mini-fluent interface having just the methods `head` and `some`: -var FluentIterator = iterFlow({ +const FluentIterator = iterFlow({ 'head': iterHead, 'some': iterSome }); // Create a source iterator: -var src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); +const src = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); // Create a fluent interface iterator: -var it1 = new FluentIterator( src ); +const it1 = new FluentIterator( src ); // Invoke the `head` method to return an iterator limited to the first 5 source values: -var it2 = it1.head( 5 ); +const it2 = it1.head( 5 ); // Get the first value: -var v = it2.next().value; +let v = it2.next().value; // returns 0 // Get the second value: @@ -170,7 +170,7 @@ v = it2.next().value; // returns 1 // Close the iterator: -var bool = it2.return().done; +const bool = it2.return().done; // returns true // Attempt to get the fourth value: @@ -209,24 +209,24 @@ v = it2.next().value; ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); -var iterFlow = require( '@stdlib/iter/flow' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); +const iterFlow = require( '@stdlib/iter/flow' ); // Create a "fluent" interface: -var FluentIterator = iterFlow({ +const FluentIterator = iterFlow({ 'head': iterHead, 'some': iterSome }); // Create a source iterator: -var arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); +let arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 1, 0, 1 ] ); // Create a new iterator: -var it = new FluentIterator( arr ); +let it = new FluentIterator( arr ); -var bool = it.head( 5 ).some( 3 ); +let bool = it.head( 5 ).some( 3 ); // returns true // Create another source iterator: diff --git a/lib/node_modules/@stdlib/iter/for-each/README.md b/lib/node_modules/@stdlib/iter/for-each/README.md index 00b73b26648a..1713aeabe824 100644 --- a/lib/node_modules/@stdlib/iter/for-each/README.md +++ b/lib/node_modules/@stdlib/iter/for-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterForEach = require( '@stdlib/iter/for-each' ); +const iterForEach = require( '@stdlib/iter/for-each' ); ``` #### iterForEach( iterator, fcn\[, thisArg] ) @@ -45,7 +45,7 @@ var iterForEach = require( '@stdlib/iter/for-each' ); Returns an iterator which invokes a `function` for each iterated value **before** returning the iterated value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { if ( v !== v ) { @@ -53,10 +53,10 @@ function assert( v ) { } } -var it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert ); +const it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -79,7 +79,7 @@ The invoked function is provided two arguments: - **index**: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v, i ) { if ( i < 0 ) { @@ -87,10 +87,10 @@ function assert( v, i ) { } } -var it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert ); +const it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -105,7 +105,7 @@ r = it.next().value; To set the execution context for `fcn`, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { this.count += 1; @@ -114,14 +114,14 @@ function assert( v ) { } } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert, ctx ); +const it = iterForEach( array2iterator( [ 1, 2, 3, 4 ] ), assert, ctx ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -130,7 +130,7 @@ r = it.next().value; r = it.next().value; // returns 3 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -159,9 +159,9 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var iterForEach = require( '@stdlib/iter/for-each' ); +const randu = require( '@stdlib/random/iter/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const iterForEach = require( '@stdlib/iter/for-each' ); function assert( v ) { if ( isnan( v ) ) { @@ -170,16 +170,16 @@ function assert( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which validates generated numbers: -var it = iterForEach( rand, assert ); +const it = iterForEach( rand, assert ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/head/README.md b/lib/node_modules/@stdlib/iter/head/README.md index 523e52a025e3..524f5840abe7 100644 --- a/lib/node_modules/@stdlib/iter/head/README.md +++ b/lib/node_modules/@stdlib/iter/head/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterHead = require( '@stdlib/iter/head' ); +const iterHead = require( '@stdlib/iter/head' ); ``` #### iterHead( iterator, n ) @@ -45,18 +45,18 @@ var iterHead = require( '@stdlib/iter/head' ); Returns an [iterator][mdn-iterator-protocol] which returns the first `n` values of a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterHead( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); +const it = iterHead( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -91,19 +91,19 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterHead = require( '@stdlib/iter/head' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterHead = require( '@stdlib/iter/head' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234 }); // Create an iterator which returns the first 10 generated numbers: -var it = iterHead( rand, 10 ); +const it = iterHead( rand, 10 ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/incrspace/README.md b/lib/node_modules/@stdlib/iter/incrspace/README.md index 87b258cafa17..7cf536cbd7ac 100644 --- a/lib/node_modules/@stdlib/iter/incrspace/README.md +++ b/lib/node_modules/@stdlib/iter/incrspace/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterIncrspace = require( '@stdlib/iter/incrspace' ); +const iterIncrspace = require( '@stdlib/iter/incrspace' ); ``` #### iterIncrspace( start, stop\[, increment] ) @@ -45,10 +45,10 @@ var iterIncrspace = require( '@stdlib/iter/incrspace' ); Returns an iterator which returns evenly spaced numbers according to a specified `increment`. ```javascript -var it = iterIncrspace( 0, 100 ); +const it = iterIncrspace( 0, 100 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: By default, the iterator returns values incremented by `1`. To adjust value spacing, provide an `increment` argument. ```javascript -var it = iterIncrspace( 0, 5, 2 ); +const it = iterIncrspace( 0, 5, 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -80,7 +80,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,10 +97,10 @@ var bool = it.next().done; - The returned iterator is guaranteed to return the `start` value, but does **not** include the `stop` value. Beware, however, that values subsequent to the `start` value are subject to floating-point rounding errors. For example, ```javascript - var it = iterIncrspace( 0.1, 0.9, 0.2 ); + const it = iterIncrspace( 0.1, 0.9, 0.2 ); // returns - var v = it.next().value; + let v = it.next().value; // returns 0.1 v = it.next().value; @@ -113,21 +113,21 @@ var bool = it.next().done; If you desire more control over value precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); - var iterMap = require( '@stdlib/iter/map' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); + const iterMap = require( '@stdlib/iter/map' ); function round( v ) { return roundn( v, -2 ); } // Create an iterator returning values subject to floating-point errors: - var it1 = iterIncrspace( 0.1, 1.1, 0.2 ); + const it1 = iterIncrspace( 0.1, 1.1, 0.2 ); // Create an iterator to round each value to the nearest hundredth: - var it2 = iterMap( it1, roundn ); + const it2 = iterMap( it1, roundn ); // Perform manual iteration... - var v; + let v; while ( true ) { v = it2.next(); if ( v.done ) { @@ -152,13 +152,13 @@ var bool = it.next().done; ```javascript -var iterIncrspace = require( '@stdlib/iter/incrspace' ); +const iterIncrspace = require( '@stdlib/iter/incrspace' ); // Create an iterator which is subject to floating-point rounding errors: -var it = iterIncrspace( 0.0, 1.01, 0.02 ); +const it = iterIncrspace( 0.0, 1.01, 0.02 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/intersection-by-hash/README.md b/lib/node_modules/@stdlib/iter/intersection-by-hash/README.md index 38941ef050e2..6fe75ec5ddd7 100644 --- a/lib/node_modules/@stdlib/iter/intersection-by-hash/README.md +++ b/lib/node_modules/@stdlib/iter/intersection-by-hash/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterIntersectionByHash = require( '@stdlib/iter/intersection-by-hash' ); +const iterIntersectionByHash = require( '@stdlib/iter/intersection-by-hash' ); ``` #### iterIntersectionByHash( iter0, ...iterator, hashFcn\[, thisArg] ) @@ -45,22 +45,22 @@ var iterIntersectionByHash = require( '@stdlib/iter/intersection-by-hash' ); Returns an [iterator][mdn-iterator-protocol] which returns the intersection of two or more [iterators][mdn-iterator-protocol] according to a hash function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function hashFcn( v ) { return v.toString(); } -var it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); -var it2 = array2iterator( [ 3, 4, 3 ] ); +const it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); +const it2 = array2iterator( [ 3, 4, 3 ] ); -var it = iterIntersectionByHash( it1, it2, hashFcn ); +const it = iterIntersectionByHash( it1, it2, hashFcn ); // returns -var v = it.next().value; +const v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -78,20 +78,20 @@ To set the execution context of the hash function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function hashFcn( v ) { this.count += 1; return JSON.stringify( v ); } -var values1 = [ +const values1 = [ { 'v': 2 }, { 'v': 1 }, { 'v': 1 }, { 'v': 2 } ]; -var values2 = [ +const values2 = [ { 'v': 4 }, { 'v': 3 }, { 'v': 4 }, @@ -100,23 +100,23 @@ var values2 = [ { 'v': 2 } ]; -var it1 = array2iterator( values1 ); -var it2 = array2iterator( values2 ); +const it1 = array2iterator( values1 ); +const it2 = array2iterator( values2 ); -var ctx = { +const ctx = { 'count': 0 }; -var it = iterIntersectionByHash( it1, it2, hashFcn, ctx ); +const it = iterIntersectionByHash( it1, it2, hashFcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns { 'v': 2 } v = it.next().value; // returns { 'v': 1 } -var bool = it.next().done; +let bool = it.next().done; // returns true bool = ( ctx.count > 0 ); @@ -151,9 +151,9 @@ bool = ( ctx.count > 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterIntersectionByHash = require( '@stdlib/iter/intersection-by-hash' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterIntersectionByHash = require( '@stdlib/iter/intersection-by-hash' ); function mapFcn( v ) { return { @@ -166,24 +166,24 @@ function hashFcn( v ) { } // Create seeded iterators which can generate 1000 pseudorandom numbers: -var rand1 = discreteUniform( 1, 10, { +const rand1 = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); -var rand2 = discreteUniform( 6, 15, { +const rand2 = discreteUniform( 6, 15, { 'seed': 1234, 'iter': 1000 }); // Create iterators which map each number to an object: -var miter1 = iterMap( rand1, mapFcn ); -var miter2 = iterMap( rand2, mapFcn ); +const miter1 = iterMap( rand1, mapFcn ); +const miter2 = iterMap( rand2, mapFcn ); // Create an iterator which returns the intersection of the above iterators: -var it = iterIntersectionByHash( miter1, miter2, hashFcn ); +const it = iterIntersectionByHash( miter1, miter2, hashFcn ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/intersection/README.md b/lib/node_modules/@stdlib/iter/intersection/README.md index e40f22101fe8..95586d2963f0 100644 --- a/lib/node_modules/@stdlib/iter/intersection/README.md +++ b/lib/node_modules/@stdlib/iter/intersection/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterIntersection = require( '@stdlib/iter/intersection' ); +const iterIntersection = require( '@stdlib/iter/intersection' ); ``` #### iterIntersection( iter0, ...iterator ) @@ -45,18 +45,18 @@ var iterIntersection = require( '@stdlib/iter/intersection' ); Returns an [iterator][mdn-iterator-protocol] which returns the intersection of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); -var it2 = array2iterator( [ 3, 4, 3 ] ); +const it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); +const it2 = array2iterator( [ 3, 4, 3 ] ); -var it = iterIntersection( it1, it2 ); +const it = iterIntersection( it1, it2 ); // returns -var v = it.next().value; +const v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -93,24 +93,24 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterIntersection = require( '@stdlib/iter/intersection' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterIntersection = require( '@stdlib/iter/intersection' ); // Create seeded iterators which can generate 1000 pseudorandom numbers: -var rand1 = discreteUniform( 1, 10, { +const rand1 = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); -var rand2 = discreteUniform( 6, 15, { +const rand2 = discreteUniform( 6, 15, { 'seed': 1234, 'iter': 1000 }); // Create an iterator which returns the intersection of the seeded iterators: -var it = iterIntersection( rand1, rand2 ); +const it = iterIntersection( rand1, rand2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/last/README.md b/lib/node_modules/@stdlib/iter/last/README.md index 76982987f60b..6830af0cf524 100644 --- a/lib/node_modules/@stdlib/iter/last/README.md +++ b/lib/node_modules/@stdlib/iter/last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLast = require( '@stdlib/iter/last' ); +const iterLast = require( '@stdlib/iter/last' ); ``` #### iterLast( iterator ) @@ -45,20 +45,20 @@ var iterLast = require( '@stdlib/iter/last' ); Consumes an entire [iterator][mdn-iterator-protocol] and returns the last [iterated][mdn-iterator-protocol] value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var v = iterLast( arr ); +const v = iterLast( arr ); // returns 1 ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any [iterated][mdn-iterator-protocol] values, the function returns `undefined`. ```javascript -var iterEmpty = require( '@stdlib/iter/empty' ); +const iterEmpty = require( '@stdlib/iter/empty' ); -var v = iterLast( iterEmpty() ); +const v = iterLast( iterEmpty() ); // returns undefined ``` @@ -83,25 +83,25 @@ var v = iterLast( iterEmpty() ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterLast = require( '@stdlib/iter/last' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterLast = require( '@stdlib/iter/last' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Return the last threshold result: -var bool = iterLast( miter ); +const bool = iterLast( miter ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/length/README.md b/lib/node_modules/@stdlib/iter/length/README.md index 47c1881f965d..3da289d19e96 100644 --- a/lib/node_modules/@stdlib/iter/length/README.md +++ b/lib/node_modules/@stdlib/iter/length/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLength = require( '@stdlib/iter/length' ); +const iterLength = require( '@stdlib/iter/length' ); ``` #### iterLength( iterator ) @@ -45,20 +45,20 @@ var iterLength = require( '@stdlib/iter/length' ); Consumes an entire [iterator][mdn-iterator-protocol] and returns the number of [iterated][mdn-iterator-protocol] values (i.e., the [iterator][mdn-iterator-protocol] length). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var len = iterLength( arr ); +const len = iterLength( arr ); // returns 5 ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any [iterated][mdn-iterator-protocol] values, the function returns `0`. ```javascript -var iterEmpty = require( '@stdlib/iter/empty' ); +const iterEmpty = require( '@stdlib/iter/empty' ); -var len = iterLength( iterEmpty() ); +const len = iterLength( iterEmpty() ); // returns 0 ``` @@ -83,17 +83,17 @@ var len = iterLength( iterEmpty() ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterLength = require( '@stdlib/iter/length' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterLength = require( '@stdlib/iter/length' ); // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var iter = randu( opts ); +const iter = randu( opts ); // Determine the iterator length: -var len = iterLength( iter ); +const len = iterLength( iter ); // returns 100 ``` diff --git a/lib/node_modules/@stdlib/iter/linspace/README.md b/lib/node_modules/@stdlib/iter/linspace/README.md index 700adaf0d1f8..148df4977adb 100644 --- a/lib/node_modules/@stdlib/iter/linspace/README.md +++ b/lib/node_modules/@stdlib/iter/linspace/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLinspace = require( '@stdlib/iter/linspace' ); +const iterLinspace = require( '@stdlib/iter/linspace' ); ``` #### iterLinspace( start, stop\[, N] ) @@ -45,10 +45,10 @@ var iterLinspace = require( '@stdlib/iter/linspace' ); Returns an iterator which returns evenly spaced numbers over a specified interval. ```javascript -var it = iterLinspace( 0, 99 ); +const it = iterLinspace( 0, 99 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: By default, the iterator returns `100` values. To return an alternative number of values over the specified interval, provide an `N` argument. ```javascript -var it = iterLinspace( 0, 10, 3 ); +const it = iterLinspace( 0, 10, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -80,7 +80,7 @@ v = it.next().value; v = it.next().value; // returns 10 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,10 +97,10 @@ var bool = it.next().done; - The returned iterator is guaranteed to return the `start` and `stop` values. Beware, however, that values between the `start` and `stop` are subject to floating-point rounding errors. For example, ```javascript - var it = iterLinspace( 0.0, 1.0, 3 ); + const it = iterLinspace( 0.0, 1.0, 3 ); // returns - var v = it.next().value; + let v = it.next().value; // returns 0 v = it.next().value; @@ -113,21 +113,21 @@ var bool = it.next().done; where the second iterated value is only guaranteed to be **approximately** equal to `0.5`. If you desire more control over value precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); - var iterMap = require( '@stdlib/iter/map' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); + const iterMap = require( '@stdlib/iter/map' ); function round( v ) { return roundn( v, -2 ); } // Create an iterator returning values subject to floating-point errors: - var it1 = iterLinspace( 0.0, 1.0, 21 ); + const it1 = iterLinspace( 0.0, 1.0, 21 ); // Create an iterator to round each value to the nearest hundredth: - var it2 = iterMap( it1, roundn ); + const it2 = iterMap( it1, roundn ); // Perform manual iteration... - var v; + let v; while ( true ) { v = it2.next(); if ( v.done ) { @@ -152,13 +152,13 @@ var bool = it.next().done; ```javascript -var iterLinspace = require( '@stdlib/iter/linspace' ); +const iterLinspace = require( '@stdlib/iter/linspace' ); // Create a "countdown" iterator: -var it = iterLinspace( 100, 0, 101 ); +const it = iterLinspace( 100, 0, 101 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/logspace/README.md b/lib/node_modules/@stdlib/iter/logspace/README.md index 3c8a82255914..d6c15ccec901 100644 --- a/lib/node_modules/@stdlib/iter/logspace/README.md +++ b/lib/node_modules/@stdlib/iter/logspace/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLogspace = require( '@stdlib/iter/logspace' ); +const iterLogspace = require( '@stdlib/iter/logspace' ); ``` #### iterLogspace( start, stop\[, N]\[, options] ) @@ -45,10 +45,10 @@ var iterLogspace = require( '@stdlib/iter/logspace' ); Returns an iterator which returns evenly spaced numbers on a log scale. ```javascript -var it = iterLogspace( 0, 10 ); +const it = iterLogspace( 0, 10 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -72,10 +72,10 @@ The function accepts the following `options`: By default, the iterator returns `100` values. To return an alternative number of values, provide an `N` argument. ```javascript -var it = iterLogspace( 0, 2, 3 ); +const it = iterLogspace( 0, 2, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -84,20 +84,20 @@ v = it.next().value; v = it.next().value; // returns 100 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` To specify an alternative log base, provide a `base` option. ```javascript -var opts = { +const opts = { 'base': 2 }; -var it = iterLogspace( 0, 10, 11, opts ); +const it = iterLogspace( 0, 10, 11, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -135,16 +135,16 @@ v = it.next().value; ```javascript -var iterLogspace = require( '@stdlib/iter/logspace' ); +const iterLogspace = require( '@stdlib/iter/logspace' ); // Create a base-2 iterator: -var opts = { +const opts = { 'base': 2 }; -var it = iterLogspace( 0, 16, 17, opts ); +const it = iterLogspace( 0, 16, 17, opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/map/README.md b/lib/node_modules/@stdlib/iter/map/README.md index 3b80c857fc98..d96f5fb7f77d 100644 --- a/lib/node_modules/@stdlib/iter/map/README.md +++ b/lib/node_modules/@stdlib/iter/map/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMap = require( '@stdlib/iter/map' ); +const iterMap = require( '@stdlib/iter/map' ); ``` #### iterMap( iterator, fcn\[, thisArg] ) @@ -45,16 +45,16 @@ var iterMap = require( '@stdlib/iter/map' ); Returns an [iterator][mdn-iterator-protocol] which invokes a `function` for each iterated value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v * 10.0; } -var it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); +const it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); // returns -var r = it.next().value; +let r = it.next().value; // returns 10.0 r = it.next().value; @@ -77,16 +77,16 @@ The invoked `function` is provided two arguments: - **index**: iteration index (zero-based). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i ) { return v * (i+1); } -var it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); +const it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -103,21 +103,21 @@ To set the function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { this.count += 1; return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); +const it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); // returns -var r = it.next().value; +let r = it.next().value; // returns 10.0 r = it.next().value; @@ -126,7 +126,7 @@ r = it.next().value; r = it.next().value; // returns 30.0 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -155,24 +155,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); function scale( v ) { return v * 10.0; } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which scales the generated numbers: -var it = iterMap( rand, scale ); +const it = iterMap( rand, scale ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/mapn/README.md b/lib/node_modules/@stdlib/iter/mapn/README.md index b9083c6cf15d..362e1bd55a0d 100644 --- a/lib/node_modules/@stdlib/iter/mapn/README.md +++ b/lib/node_modules/@stdlib/iter/mapn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMapN = require( '@stdlib/iter/mapn' ); +const iterMapN = require( '@stdlib/iter/mapn' ); ``` #### iterMapN( iter0, ...iterator, fcn\[, thisArg] ) @@ -45,25 +45,25 @@ var iterMapN = require( '@stdlib/iter/mapn' ); Returns an [iterator][mdn-iterator-protocol] which transforms iterated values from two or more [iterators][mdn-iterator-protocol] by applying the iterated values as arguments to a provided function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function transform( x, y ) { return x + y; } -var it1 = array2iterator( [ 1.0, 2.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var it = iterMapN( it1, it2, transform ); +const it = iterMapN( it1, it2, transform ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.0 v = it.next().value; // returns 6.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -78,25 +78,25 @@ The invoked `function` is provided `N+1` arguments, where `N` is the number of p - `index`: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function transform( x, y, i ) { return x + y + i; } -var it1 = array2iterator( [ 1.0, 2.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var it = iterMapN( it1, it2, transform ); +const it = iterMapN( it1, it2, transform ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.0 v = it.next().value; // returns 7.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -105,32 +105,32 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function transform( x, y ) { this.count += 1; return x + y; } -var it1 = array2iterator( [ 1.0, 2.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var it = iterMapN( it1, it2, transform, ctx ); +const it = iterMapN( it1, it2, transform, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.0 v = it.next().value; // returns 6.0 -var bool = it.next().done; +const bool = it.next().done; // returns true -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -160,32 +160,32 @@ var count = ctx.count; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterMapN = require( '@stdlib/iter/mapn' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterMapN = require( '@stdlib/iter/mapn' ); function add( x, y ) { return x + y; } // Create an iterator which generates a sine wave: -var sine1 = iterSineWave({ +const sine1 = iterSineWave({ 'period': 50, 'offset': 0, 'iter': 100 }); // Create another iterator which generates a higher frequency sine wave: -var sine2 = iterSineWave({ +const sine2 = iterSineWave({ 'period': 10, 'offset': 0, 'iter': 100 }); // Create an iterator which adds the two waveforms: -var it = iterMapN( sine1, sine2, add ); +const it = iterMapN( sine1, sine2, add ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/none-by/README.md b/lib/node_modules/@stdlib/iter/none-by/README.md index 316c49837810..f020103d7b7a 100644 --- a/lib/node_modules/@stdlib/iter/none-by/README.md +++ b/lib/node_modules/@stdlib/iter/none-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterNoneBy = require( '@stdlib/iter/none-by' ); +const iterNoneBy = require( '@stdlib/iter/none-by' ); ``` #### iterNoneBy( iterator, predicate\[, thisArg] ) @@ -45,28 +45,28 @@ var iterNoneBy = require( '@stdlib/iter/none-by' ); Tests whether every [iterated][mdn-iterator-protocol] value **fails** a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v <= 0 ); } -var arr = array2iterator( [ 1, 1, 1, 1, 1 ] ); +const arr = array2iterator( [ 1, 1, 1, 1, 1 ] ); -var bool = iterNoneBy( arr, predicate ); +const bool = iterNoneBy( arr, predicate ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate() { return true; } -var bool = iterNoneBy( array2iterator( [] ), predicate ); +const bool = iterNoneBy( array2iterator( [] ), predicate ); // returns true ``` @@ -78,23 +78,23 @@ A `predicate` function is provided two arguments: To set the execution context of the `predicate` function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v <= 0 ); } -var arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); +const arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var bool = iterNoneBy( arr, predicate, ctx ); +const bool = iterNoneBy( arr, predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -123,21 +123,21 @@ var n = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterNoneBy = require( '@stdlib/iter/none-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterNoneBy = require( '@stdlib/iter/none-by' ); function threshold( r ) { return ( r >= 0.99 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Determine if all values are below a threshold: -var bool = iterNoneBy( riter, threshold ); +const bool = iterNoneBy( riter, threshold ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/none/README.md b/lib/node_modules/@stdlib/iter/none/README.md index 79573295e9fd..efea83acf101 100644 --- a/lib/node_modules/@stdlib/iter/none/README.md +++ b/lib/node_modules/@stdlib/iter/none/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterNone = require( '@stdlib/iter/none' ); +const iterNone = require( '@stdlib/iter/none' ); ``` #### iterNone( iterator ) @@ -45,20 +45,20 @@ var iterNone = require( '@stdlib/iter/none' ); Tests whether all [iterated][mdn-iterator-protocol] values are falsy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); +const arr = array2iterator( [ 0, 0, 0, 0, 1 ] ); -var bool = iterNone( arr ); +const bool = iterNone( arr ); // returns false ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var bool = iterNone( array2iterator( [] ) ); +const bool = iterNone( array2iterator( [] ) ); // returns true ``` @@ -83,25 +83,25 @@ var bool = iterNone( array2iterator( [] ) ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterNone = require( '@stdlib/iter/none' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterNone = require( '@stdlib/iter/none' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Determine if all values are "falsy": -var bool = iterNone( miter ); +const bool = iterNone( miter ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/nth/README.md b/lib/node_modules/@stdlib/iter/nth/README.md index c4e42da38aba..2138a4631395 100644 --- a/lib/node_modules/@stdlib/iter/nth/README.md +++ b/lib/node_modules/@stdlib/iter/nth/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterNth = require( '@stdlib/iter/nth' ); +const iterNth = require( '@stdlib/iter/nth' ); ``` #### iterNth( iterator, n ) @@ -45,22 +45,22 @@ var iterNth = require( '@stdlib/iter/nth' ); Returns the nth [iterated][mdn-iterator-protocol] value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); +const arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); -var v = iterNth( arr, 3 ); +const v = iterNth( arr, 3 ); // returns 1 ``` If `n` exceeds the total number of [iterated][mdn-iterator-protocol] values, the function returns `undefined`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); +const arr = array2iterator( [ 0, 0, 1, 0, 0 ] ); -var v = iterNth( arr, 10 ); +const v = iterNth( arr, 10 ); // returns undefined ``` @@ -85,25 +85,25 @@ var v = iterNth( arr, 10 ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterNth = require( '@stdlib/iter/nth' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterNth = require( '@stdlib/iter/nth' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Return the 50th threshold result: -var bool = iterNth( miter, 50 ); +const bool = iterNth( miter, 50 ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/pipeline-thunk/README.md b/lib/node_modules/@stdlib/iter/pipeline-thunk/README.md index a7ee56479906..51572d60d02d 100644 --- a/lib/node_modules/@stdlib/iter/pipeline-thunk/README.md +++ b/lib/node_modules/@stdlib/iter/pipeline-thunk/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); +const iterThunk = require( '@stdlib/iter/pipeline-thunk' ); ``` #### iterThunk( iterFcn\[, ...args] ) @@ -45,13 +45,13 @@ var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); Returns an [iterator][mdn-iterator-protocol] "thunk". ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterSome = require( '@stdlib/iter/some' ); -var thunk = iterThunk( iterSome, 3 ); +const thunk = iterThunk( iterSome, 3 ); -var arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); -var bool = thunk( arr ); +let arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); +let bool = thunk( arr ); // returns true arr = array2iterator( [ 0, 0, 1, 0, 1 ] ); @@ -106,19 +106,19 @@ Accordingly, this function implements left-to-right [partial application][@stdli ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterSome = require( '@stdlib/iter/some' ); -var iterPipeline = require( '@stdlib/iter/pipeline' ); -var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterSome = require( '@stdlib/iter/some' ); +const iterPipeline = require( '@stdlib/iter/pipeline' ); +const iterThunk = require( '@stdlib/iter/pipeline-thunk' ); function threshold( r ) { return ( r > 0.95 ); } // Create a pipeline which tests whether at least 5% of values exceed a threshold: -var p = iterPipeline( +const p = iterPipeline( // Apply a threshold to iterated values: iterThunk( iterMap, threshold ), @@ -130,16 +130,11 @@ var p = iterPipeline( ); // Define the number of random number sequences to analyze: -var N = 100; +const N = 100; -// Initialize a counter for sequences satisfying the 5% threshold: -var count = 0; - -// Perform analysis... -var bool; -var i; -for ( i = 0; i < N; i++ ) { - bool = p( randu() ); +let count = 0; +for ( let i = 0; i < N; i++ ) { + const bool = p( randu() ); if ( bool ) { count += 1; } diff --git a/lib/node_modules/@stdlib/iter/pipeline/README.md b/lib/node_modules/@stdlib/iter/pipeline/README.md index 54dc025d2f85..1fc52bb99940 100644 --- a/lib/node_modules/@stdlib/iter/pipeline/README.md +++ b/lib/node_modules/@stdlib/iter/pipeline/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterPipeline = require( '@stdlib/iter/pipeline' ); +const iterPipeline = require( '@stdlib/iter/pipeline' ); ``` #### iterPipeline( iterFcn0\[, ...iterFcn] ) @@ -45,23 +45,23 @@ var iterPipeline = require( '@stdlib/iter/pipeline' ); Returns an [iterator][mdn-iterator-protocol] pipeline. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterThunk = require( '@stdlib/iter/pipeline-thunk' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); // Convert iterator functions to unary functions which accept an iterator: -var it1 = iterThunk( iterHead, 5 ); -var it2 = iterThunk( iterSome, 3 ); +const it1 = iterThunk( iterHead, 5 ); +const it2 = iterThunk( iterSome, 3 ); // Create an iterator pipeline: -var p = iterPipeline( it1, it2 ); +const p = iterPipeline( it1, it2 ); // Create a source iterator: -var arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 ] ); +let arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 ] ); // Provide the source iterator to our iterator pipeline: -var bool = p( arr ); +let bool = p( arr ); // returns true // Create a new source iterator: @@ -75,18 +75,18 @@ bool = p( arr ); The function accepts [iterator][mdn-iterator-protocol] functions provided as separate arguments **or** as a single argument consisting of an array of [iterator][mdn-iterator-protocol] functions. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterSome = require( '@stdlib/iter/some' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const iterThunk = require( '@stdlib/iter/pipeline-thunk' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterSome = require( '@stdlib/iter/some' ); -var it1 = iterThunk( iterHead, 5 ); -var it2 = iterThunk( iterSome, 3 ); +const it1 = iterThunk( iterHead, 5 ); +const it2 = iterThunk( iterSome, 3 ); -var p = iterPipeline( [ it1, it2 ] ); +const p = iterPipeline( [ it1, it2 ] ); -var arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 ] ); -var bool = p( arr ); +let arr = array2iterator( [ 0, 0, 1, 1, 1, 0, 0, 0, 1, 1 ] ); +let bool = p( arr ); // returns true arr = array2iterator( [ 0, 0, 1, 0, 1, 0, 0, 0, 1, 1 ] ); @@ -124,19 +124,19 @@ bool = p( arr ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterHead = require( '@stdlib/iter/head' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterSome = require( '@stdlib/iter/some' ); -var iterThunk = require( '@stdlib/iter/pipeline-thunk' ); -var iterPipeline = require( '@stdlib/iter/pipeline' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterHead = require( '@stdlib/iter/head' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterSome = require( '@stdlib/iter/some' ); +const iterThunk = require( '@stdlib/iter/pipeline-thunk' ); +const iterPipeline = require( '@stdlib/iter/pipeline' ); function threshold( r ) { return ( r > 0.95 ); } // Create a pipeline which tests whether at least 5% of values exceed a threshold: -var p = iterPipeline( +const p = iterPipeline( // Apply a threshold to iterated values: iterThunk( iterMap, threshold ), @@ -148,16 +148,11 @@ var p = iterPipeline( ); // Define the number of random number sequences to analyze: -var N = 100; +const N = 100; -// Initialize a counter for sequences satisfying the 5% threshold: -var count = 0; - -// Perform analysis... -var bool; -var i; -for ( i = 0; i < N; i++ ) { - bool = p( randu() ); +let count = 0; +for ( let i = 0; i < N; i++ ) { + const bool = p( randu() ); if ( bool ) { count += 1; } diff --git a/lib/node_modules/@stdlib/iter/pop/README.md b/lib/node_modules/@stdlib/iter/pop/README.md index e0b4895581cb..218a3f92b3b0 100644 --- a/lib/node_modules/@stdlib/iter/pop/README.md +++ b/lib/node_modules/@stdlib/iter/pop/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterPop = require( '@stdlib/iter/pop' ); +const iterPop = require( '@stdlib/iter/pop' ); ``` #### iterPop( iterator\[, clbk\[, thisArg]] ) @@ -45,12 +45,12 @@ var iterPop = require( '@stdlib/iter/pop' ); Returns an [iterator][mdn-iterator-protocol] which skips the last value of a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ) ); +const it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -59,7 +59,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,17 +71,17 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the To invoke a callback upon skipping the last value of a provided [`iterator`][mdn-iterator-protocol], provide a `clbk` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function onPop( v ) { console.log( v ); // => 4 } -var it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ), onPop ); +const it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ), onPop ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -90,7 +90,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -103,20 +103,20 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function onPop() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ), onPop, ctx ); +const it = iterPop( array2iterator( [ 1, 2, 3, 4 ] ), onPop, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -125,7 +125,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +let bool = it.next().done; // returns true bool = ( ctx.count === 1 ); @@ -157,20 +157,20 @@ bool = ( ctx.count === 1 ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterPop = require( '@stdlib/iter/pop' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterPop = require( '@stdlib/iter/pop' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which skips the last number: -var it = iterPop( rand ); +const it = iterPop( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/push/README.md b/lib/node_modules/@stdlib/iter/push/README.md index 28cc0daa11bb..8bfec5338420 100644 --- a/lib/node_modules/@stdlib/iter/push/README.md +++ b/lib/node_modules/@stdlib/iter/push/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterPush = require( '@stdlib/iter/push' ); +const iterPush = require( '@stdlib/iter/push' ); ``` #### iterPush( iterator, ...items ) @@ -45,12 +45,12 @@ var iterPush = require( '@stdlib/iter/push' ); Returns an [iterator][mdn-iterator-protocol] which appends additional values to the **end** of a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterPush( array2iterator( [ 1, 2 ] ), 3, 4 ); +const it = iterPush( array2iterator( [ 1, 2 ] ), 3, 4 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -62,7 +62,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -96,20 +96,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterPush = require( '@stdlib/iter/push' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterPush = require( '@stdlib/iter/push' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator with appended values: -var it = iterPush( rand, 'beep', 'boop' ); +const it = iterPush( rand, 'beep', 'boop' ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/reject/README.md b/lib/node_modules/@stdlib/iter/reject/README.md index 128efd3c5b5c..05acae6efff2 100644 --- a/lib/node_modules/@stdlib/iter/reject/README.md +++ b/lib/node_modules/@stdlib/iter/reject/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterReject = require( '@stdlib/iter/reject' ); +const iterReject = require( '@stdlib/iter/reject' ); ``` #### iterReject( iterator, predicate\[, thisArg] ) @@ -45,22 +45,22 @@ var iterReject = require( '@stdlib/iter/reject' ); Returns an [iterator][mdn-iterator-protocol] which rejects the values of another [`iterator`][mdn-iterator-protocol] according to a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 2 ); } -var it = iterReject( array2iterator( [ 1, 3, 2, 4 ] ), predicate ); +const it = iterReject( array2iterator( [ 1, 3, 2, 4 ] ), predicate ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -75,22 +75,22 @@ The `predicate` function is provided two arguments: - `index`: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v, i ) { return ( i >= 2 ); } -var it = iterReject( array2iterator( [ 3, 4, 1, 2 ] ), predicate ); +const it = iterReject( array2iterator( [ 3, 4, 1, 2 ] ), predicate ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -99,21 +99,21 @@ To set the `predicate` function execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 10 ); } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterReject( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); +const it = iterReject( array2iterator( [ 1, 2, 3, 4 ] ), predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -122,7 +122,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -151,24 +151,24 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterReject = require( '@stdlib/iter/reject' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterReject = require( '@stdlib/iter/reject' ); function predicate( v ) { return ( v > 0.5 ); } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 20 }); // Create an iterator which filters the generated numbers: -var it = iterReject( rand, predicate ); +const it = iterReject( rand, predicate ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/replicate-by/README.md b/lib/node_modules/@stdlib/iter/replicate-by/README.md index 7520f24774e0..4be0ff2c57af 100644 --- a/lib/node_modules/@stdlib/iter/replicate-by/README.md +++ b/lib/node_modules/@stdlib/iter/replicate-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterReplicateBy = require( '@stdlib/iter/replicate-by' ); +const iterReplicateBy = require( '@stdlib/iter/replicate-by' ); ``` #### iterReplicateBy( iterator, fcn\[, thisArg] ) @@ -45,16 +45,16 @@ var iterReplicateBy = require( '@stdlib/iter/replicate-by' ); Returns an [iterator][mdn-iterator-protocol] which replicates each iterated value according to a provided function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i ) { return i + 1; } -var it = iterReplicateBy( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); +const it = iterReplicateBy( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -94,21 +94,21 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i ) { this.count += 1; return i + 1; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterReplicateBy( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); +const it = iterReplicateBy( array2iterator( [ 1, 2, 3, 4 ] ), fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -120,7 +120,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var count = ctx.count; +const count = ctx.count; // returns 3 ``` @@ -151,21 +151,21 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var iterReplicateBy = require( '@stdlib/iter/replicate-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const iterReplicateBy = require( '@stdlib/iter/replicate-by' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which replicates each generated number a random number of times: -var it = iterReplicateBy( rand, discreteUniform.factory( 1, 10 ) ); +const it = iterReplicateBy( rand, discreteUniform.factory( 1, 10 ) ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/replicate/README.md b/lib/node_modules/@stdlib/iter/replicate/README.md index 26985f7046ae..43a6f45de26e 100644 --- a/lib/node_modules/@stdlib/iter/replicate/README.md +++ b/lib/node_modules/@stdlib/iter/replicate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterReplicate = require( '@stdlib/iter/replicate' ); +const iterReplicate = require( '@stdlib/iter/replicate' ); ``` #### iterReplicate( iterator, n ) @@ -45,12 +45,12 @@ var iterReplicate = require( '@stdlib/iter/replicate' ); Returns an [iterator][mdn-iterator-protocol] which replicates each iterated value `n` times. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterReplicate( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); +const it = iterReplicate( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -101,20 +101,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterReplicate = require( '@stdlib/iter/replicate' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterReplicate = require( '@stdlib/iter/replicate' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which replicates each generated number 3 times: -var it = iterReplicate( rand, 3 ); +const it = iterReplicate( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/shift/README.md b/lib/node_modules/@stdlib/iter/shift/README.md index b0b0dc4b8ddb..80b698c3cb8e 100644 --- a/lib/node_modules/@stdlib/iter/shift/README.md +++ b/lib/node_modules/@stdlib/iter/shift/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterShift = require( '@stdlib/iter/shift' ); +const iterShift = require( '@stdlib/iter/shift' ); ``` #### iterShift( iterator\[, clbk\[, thisArg]] ) @@ -45,12 +45,12 @@ var iterShift = require( '@stdlib/iter/shift' ); Returns an [iterator][mdn-iterator-protocol] which skips the first value of a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ) ); +const it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -59,7 +59,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,17 +71,17 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the To invoke a callback upon skipping the first value of a provided [`iterator`][mdn-iterator-protocol], provide a `clbk` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function onShift( v ) { console.log( v ); // => 1 } -var it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ), onShift ); +const it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ), onShift ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -90,7 +90,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -103,20 +103,20 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function onShift() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ), onShift, ctx ); +const it = iterShift( array2iterator( [ 1, 2, 3, 4 ] ), onShift, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -125,7 +125,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +let bool = it.next().done; // returns true bool = ( ctx.count === 1 ); @@ -157,20 +157,20 @@ bool = ( ctx.count === 1 ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterShift = require( '@stdlib/iter/shift' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterShift = require( '@stdlib/iter/shift' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which skips the first number: -var it = iterShift( rand ); +const it = iterShift( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/slice/README.md b/lib/node_modules/@stdlib/iter/slice/README.md index f301e6f0c09f..18969f2a3201 100644 --- a/lib/node_modules/@stdlib/iter/slice/README.md +++ b/lib/node_modules/@stdlib/iter/slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSlice = require( '@stdlib/iter/slice' ); +const iterSlice = require( '@stdlib/iter/slice' ); ``` #### iterSlice( iterator\[, begin\[, end]] ) @@ -45,12 +45,12 @@ var iterSlice = require( '@stdlib/iter/slice' ); Returns an [iterator][mdn-iterator-protocol] which returns a subsequence of iterated values from a provided [iterator][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ) ); +const it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -70,48 +70,48 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the By default, the returned [iterator][mdn-iterator-protocol] returns a provided [iterator's][mdn-iterator-protocol] first iterated value through an [iterator's][mdn-iterator-protocol] last iterated value. To specify an alternative start iteration index (zero-based and **inclusive**), provide a `begin` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); +const it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` By default, the returned [iterator][mdn-iterator-protocol] continues iterating until it consumes all of a provided [iterator's][mdn-iterator-protocol] iterated values. To specify an end iteration index (zero-based and **non-inclusive**), provide an `end` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 1, 3 ); +const it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 1, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` If `begin` is greater than or equal to `end`, the returned [iterator][mdn-iterator-protocol] does not return any iterated values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 3, 1 ); +const it = iterSlice( array2iterator( [ 1, 2, 3, 4 ] ), 3, 1 ); // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -140,19 +140,19 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterSlice = require( '@stdlib/iter/slice' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterSlice = require( '@stdlib/iter/slice' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234 }); // Create an iterator which returns a subsequence of 10 generated numbers: -var it = iterSlice( rand, 10, 20 ); +const it = iterSlice( rand, 10, 20 ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/some-by/README.md b/lib/node_modules/@stdlib/iter/some-by/README.md index 27805a61cc9f..1e86665eaf98 100644 --- a/lib/node_modules/@stdlib/iter/some-by/README.md +++ b/lib/node_modules/@stdlib/iter/some-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSomeBy = require( '@stdlib/iter/some-by' ); +const iterSomeBy = require( '@stdlib/iter/some-by' ); ``` #### iterSomeBy( iterator, n, predicate\[, thisArg] ) @@ -45,28 +45,28 @@ var iterSomeBy = require( '@stdlib/iter/some-by' ); Tests whether at least `n` [iterated][mdn-iterator-protocol] values **pass** a test implemented by a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return ( v > 0 ); } -var arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); +const arr = array2iterator( [ 1, 1, 1, 0, 1 ] ); -var bool = iterSomeBy( arr, 4, predicate ); +const bool = iterSomeBy( arr, 4, predicate ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `false`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate() { return true; } -var bool = iterSomeBy( array2iterator( [] ), 1, predicate ); +const bool = iterSomeBy( array2iterator( [] ), 1, predicate ); // returns false ``` @@ -78,23 +78,23 @@ A `predicate` function is provided two arguments: To set the execution context of the `predicate` function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { this.count += 1; return ( v > 0 ); } -var arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); +const arr = array2iterator( [ 1, 1, 0, 1, 1 ] ); -var ctx = { +const ctx = { 'count': 0 }; -var bool = iterSomeBy( arr, 3, predicate, ctx ); +const bool = iterSomeBy( arr, 3, predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 4 ``` @@ -123,21 +123,21 @@ var n = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterSomeBy = require( '@stdlib/iter/some-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterSomeBy = require( '@stdlib/iter/some-by' ); function threshold( r ) { return ( r >= 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Determine if at least 5 values exceed a threshold: -var bool = iterSomeBy( riter, 5, threshold ); +const bool = iterSomeBy( riter, 5, threshold ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/some/README.md b/lib/node_modules/@stdlib/iter/some/README.md index 77da1954955e..5fe47243554e 100644 --- a/lib/node_modules/@stdlib/iter/some/README.md +++ b/lib/node_modules/@stdlib/iter/some/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSome = require( '@stdlib/iter/some' ); +const iterSome = require( '@stdlib/iter/some' ); ``` #### iterSome( iterator, n ) @@ -45,20 +45,20 @@ var iterSome = require( '@stdlib/iter/some' ); Tests whether at least `n` [iterated][mdn-iterator-protocol] values are truthy. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); +const arr = array2iterator( [ 0, 0, 1, 1, 1 ] ); -var bool = iterSome( arr, 3 ); +const bool = iterSome( arr, 3 ); // returns true ``` If a provided [`iterator`][mdn-iterator-protocol] does not return any iterated values, the function returns `false`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var bool = iterSome( array2iterator( [] ), 1 ); +const bool = iterSome( array2iterator( [] ), 1 ); // returns false ``` @@ -83,25 +83,25 @@ var bool = iterSome( array2iterator( [] ), 1 ); ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterSome = require( '@stdlib/iter/some' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterSome = require( '@stdlib/iter/some' ); function threshold( r ) { return ( r > 0.95 ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +const opts = { 'iter': 100 }; -var riter = randu( opts ); +const riter = randu( opts ); // Create an iterator which applies a threshold to generated numbers: -var miter = iterMap( riter, threshold ); +const miter = iterMap( riter, threshold ); // Determine if at least 5 values are "truthy": -var bool = iterSome( miter, 5 ); +const bool = iterSome( miter, 5 ); // returns console.log( bool ); diff --git a/lib/node_modules/@stdlib/iter/step/README.md b/lib/node_modules/@stdlib/iter/step/README.md index 1485c154569b..d4ffd152d72d 100644 --- a/lib/node_modules/@stdlib/iter/step/README.md +++ b/lib/node_modules/@stdlib/iter/step/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterStep = require( '@stdlib/iter/step' ); +const iterStep = require( '@stdlib/iter/step' ); ``` #### iterStep( start, increment\[, N] ) @@ -45,10 +45,10 @@ var iterStep = require( '@stdlib/iter/step' ); Returns an iterator which returns a sequence of numbers according to a specified `increment`. ```javascript -var it = iterStep( 0, 2 ); +const it = iterStep( 0, 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of returned values, provide a third argument. ```javascript -var it = iterStep( 0, 2, 3 ); +const it = iterStep( 0, 2, 3 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -80,7 +80,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -97,10 +97,10 @@ var bool = it.next().done; - The returned iterator is guaranteed to return the `start` value. Beware, however, that values subsequent to the `start` value are subject to floating-point rounding errors. For example, ```javascript - var it = iterStep( 0.1, 0.2 ); + const it = iterStep( 0.1, 0.2 ); // returns - var v = it.next().value; + let v = it.next().value; // returns 0.1 v = it.next().value; @@ -113,21 +113,21 @@ var bool = it.next().done; If you desire more control over value precision, consider using [roundn][@stdlib/math/base/special/roundn]: ```javascript - var roundn = require( '@stdlib/math/base/special/roundn' ); - var iterMap = require( '@stdlib/iter/map' ); + const roundn = require( '@stdlib/math/base/special/roundn' ); + const iterMap = require( '@stdlib/iter/map' ); function round( v ) { return roundn( v, -2 ); } // Create an iterator returning values subject to floating-point errors: - var it1 = iterStep( 0.1, 0.2, 10 ); + const it1 = iterStep( 0.1, 0.2, 10 ); // Create an iterator to round each value to the nearest hundredth: - var it2 = iterMap( it1, roundn ); + const it2 = iterMap( it1, roundn ); // Perform manual iteration... - var v; + let v; while ( true ) { v = it2.next(); if ( v.done ) { @@ -152,13 +152,13 @@ var bool = it.next().done; ```javascript -var iterStep = require( '@stdlib/iter/step' ); +const iterStep = require( '@stdlib/iter/step' ); // Create an iterator which is subject to floating-point rounding errors: -var it = iterStep( 0.0, 0.02, 50 ); +const it = iterStep( 0.0, 0.02, 50 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/strided-by/README.md b/lib/node_modules/@stdlib/iter/strided-by/README.md index 389604e29948..caea4e7c663e 100644 --- a/lib/node_modules/@stdlib/iter/strided-by/README.md +++ b/lib/node_modules/@stdlib/iter/strided-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterStridedBy = require( '@stdlib/iter/strided-by' ); +const iterStridedBy = require( '@stdlib/iter/strided-by' ); ``` #### iterStridedBy( iterator, fcn\[, offset\[, eager]]\[, thisArg] ) @@ -45,17 +45,17 @@ var iterStridedBy = require( '@stdlib/iter/strided-by' ); Returns an [iterator][mdn-iterator-protocol] which steps according to a provided callback function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function stride( v, i ) { return (i % 10) + 1; } -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStridedBy( arr, stride ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStridedBy( arr, stride ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -84,22 +84,22 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function stride( v, i ) { this.count += 1; return (i % 10) + 1; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStridedBy( arr, stride, ctx ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStridedBy( arr, stride, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -111,24 +111,24 @@ v = it.next().value; v = it.next().value; // returns 8 -var count = ctx.count; +const count = ctx.count; // returns 4 ``` To skip the first `N` values of a provided [`iterator`][mdn-iterator-protocol], provide an `offset` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function stride( v, i ) { return (i % 10) + 1; } -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStridedBy( arr, stride, 1 ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStridedBy( arr, stride, 1 ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2 r = it.next().value; @@ -143,17 +143,17 @@ r = it.next().value; By default, the returned [iterator][mdn-iterator-protocol] defers consuming the first `N` input [`iterator`][mdn-iterator-protocol] values until the first value of the returned [iterator][mdn-iterator-protocol] is consumed. To eagerly advance the input [`iterator`][mdn-iterator-protocol], set the `eager` argument to `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function stride() { return 1; } -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStridedBy( arr, stride, 4, true ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStridedBy( arr, stride, 4, true ); // returns -var r = it.next().value; +let r = it.next().value; // returns 5 r = it.next().value; @@ -191,26 +191,26 @@ r = it.next().value; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var iterStridedBy = require( '@stdlib/iter/strided-by' ); +const randu = require( '@stdlib/random/iter/randu' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const iterStridedBy = require( '@stdlib/iter/strided-by' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create a PRNG for generating pseudorandom integers on the interval [1,10]: -var randi = discreteUniform( 1, 10, { +const randi = discreteUniform( 1, 10, { 'seed': 4321 }); // Create an iterator which randomly selects input iterator values: -var it = iterStridedBy( rand, randi ); +const it = iterStridedBy( rand, randi ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/strided/README.md b/lib/node_modules/@stdlib/iter/strided/README.md index 6d1a8dcf5599..388059937b60 100644 --- a/lib/node_modules/@stdlib/iter/strided/README.md +++ b/lib/node_modules/@stdlib/iter/strided/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterStrided = require( '@stdlib/iter/strided' ); +const iterStrided = require( '@stdlib/iter/strided' ); ``` #### iterStrided( iterator, stride\[, offset\[, eager]] ) @@ -45,13 +45,13 @@ var iterStrided = require( '@stdlib/iter/strided' ); Returns an [iterator][mdn-iterator-protocol] which steps by a specified amount. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStrided( arr, 2 ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStrided( arr, 2 ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -71,13 +71,13 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the To skip the first `N` values of a provided [`iterator`][mdn-iterator-protocol], provide an `offset` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStrided( arr, 2, 1 ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStrided( arr, 2, 1 ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2 r = it.next().value; @@ -92,13 +92,13 @@ r = it.next().value; By default, the returned [iterator][mdn-iterator-protocol] defers consuming the first `N` input [`iterator`][mdn-iterator-protocol] values until the first value of the returned [iterator][mdn-iterator-protocol] is consumed. To eagerly advance the input [`iterator`][mdn-iterator-protocol], set the `eager` argument to `true`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); -var it = iterStrided( arr, 1, 4, true ); +const arr = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8 ] ); +const it = iterStrided( arr, 1, 4, true ); // returns -var r = it.next().value; +let r = it.next().value; // returns 5 r = it.next().value; @@ -135,20 +135,20 @@ r = it.next().value; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterStrided = require( '@stdlib/iter/strided' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterStrided = require( '@stdlib/iter/strided' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which returns every other random number: -var it = iterStrided( rand, 2 ); +const it = iterStrided( rand, 2 ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/to-array-view-right/README.md b/lib/node_modules/@stdlib/iter/to-array-view-right/README.md index 543f8ea0b4a9..f4f2c3b3489c 100644 --- a/lib/node_modules/@stdlib/iter/to-array-view-right/README.md +++ b/lib/node_modules/@stdlib/iter/to-array-view-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterator2arrayviewRight = require( '@stdlib/iter/to-array-view-right' ); +const iterator2arrayviewRight = require( '@stdlib/iter/to-array-view-right' ); ``` #### iterator2arrayviewRight( iterator, dest\[, begin\[, end]]\[, mapFcn\[, thisArg]] ) @@ -45,76 +45,76 @@ var iterator2arrayviewRight = require( '@stdlib/iter/to-array-view-right' ); Fills an array-like `object` view from right to left with values returned from an `iterator`. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ) ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ) ); // returns [ 0, 0, 0, 0, 0, 0, 4, 3, 2, 1 ] ``` The `begin` and `end` arguments define the starting (inclusive) and ending (non-inclusive) indices of the array view. By default, the function begins filling from the last element of a provided array-like `object` (i.e., from the "end"). To specify an alternative view end, provide an `end` argument (zero-based and non-inclusive). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 0, 4 ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 0, 4 ); // returns [ 4, 3, 2, 1, 0, 0, 0, 0, 0, 0 ] ``` If `end` is less than `0`, the last view element is resolved relative to the last element of the provided array-like `object`. For example, the following achieves the same behavior as the previous example ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 0, -6 ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 0, -6 ); // returns [ 4, 3, 2, 1, 0, 0, 0, 0, 0, 0 ] ``` By default, the function fills through the first element of the provided array-like `object`. To specify an alternative view beginning, provide a `begin` argument (zero-based and inclusive). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 3 ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), 3 ); // returns [ 0, 0, 0, 7, 6, 5, 4, 3, 2, 1 ] ``` If `begin` is less than `0`, the first view element index is resolved relative to the last element of the provided array-like `object`. For example, the following achieves the same behavior as the previous example ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), -7 ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 10 ), -7 ); // returns [ 0, 0, 0, 7, 6, 5, 4, 3, 2, 1 ] ``` To invoke a function for each iterated value, provide a callback function. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v * 10.0; } -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayviewRight( iter, new Float64Array( 4 ), fcn ); +const arr = iterator2arrayviewRight( iter, new Float64Array( 4 ), fcn ); // returns [ 40.0, 30.0, 20.0, 10.0 ] ``` @@ -125,38 +125,39 @@ The invoked function is provided three arguments: - **n**: iteration index (zero-based). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i, n ) { return v * (n+1); } -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayviewRight( iter, new Uint8Array( 4 ), fcn ); +const arr = iterator2arrayviewRight( iter, new Uint8Array( 4 ), fcn ); // returns [ 16, 9, 4, 1 ] ``` To set the callback function execution context, provide a `thisArg`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); function fcn( v ) { this.count += 1; return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = iterator2arrayviewRight( randu(), new Float64Array( 10 ), fcn, ctx ); +const x = new Float64Array( 10 ); +const arr = iterator2arrayviewRight( randu(), x, fcn, ctx ); // returns -var count = ctx.count; +const count = ctx.count; // returns 10 ``` @@ -186,22 +187,22 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); -var iterator2arrayviewRight = require( '@stdlib/iter/to-array-view-right' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterator2arrayviewRight = require( '@stdlib/iter/to-array-view-right' ); function scale( v, i, n ) { return v * (n+1) * 10.0; } // Create an iterator for generating uniformly distributed pseudorandom numbers: -var it = randu(); +const it = randu(); // Fill an array view with scaled iterator values: -var arr = iterator2arrayviewRight( it, new Float64Array( 100 ), 40, 60, scale ); +const x = new Float64Array( 100 ); +const arr = iterator2arrayviewRight( it, x, 40, 60, scale ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); } ``` diff --git a/lib/node_modules/@stdlib/iter/to-array-view/README.md b/lib/node_modules/@stdlib/iter/to-array-view/README.md index e48d067bc689..c01c6e987e25 100644 --- a/lib/node_modules/@stdlib/iter/to-array-view/README.md +++ b/lib/node_modules/@stdlib/iter/to-array-view/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterator2arrayview = require( '@stdlib/iter/to-array-view' ); +const iterator2arrayview = require( '@stdlib/iter/to-array-view' ); ``` #### iterator2arrayview( iterator, dest\[, begin\[, end]]\[, mapFcn\[, thisArg]] ) @@ -45,76 +45,76 @@ var iterator2arrayview = require( '@stdlib/iter/to-array-view' ); Fills an array-like `object` view with values returned from an `iterator`. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 10 ) ); +const arr = iterator2arrayview( iter, new Uint8Array( 10 ) ); // returns [ 1, 2, 3, 4, 0, 0, 0, 0, 0, 0 ] ``` By default, the function begins filling from the first element of a provided array-like `object`. To specify an alternative starting index, provide a `begin` argument (zero-based and inclusive). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 10 ), 3 ); +const arr = iterator2arrayview( iter, new Uint8Array( 10 ), 3 ); // returns [ 0, 0, 0, 1, 2, 3, 4, 0, 0, 0 ] ``` If `begin` is less than `0`, the starting index is resolved relative to the last element of the provided array-like `object`. For example, the following achieves the same behavior as the previous example ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 10 ), -7 ); +const arr = iterator2arrayview( iter, new Uint8Array( 10 ), -7 ); // returns [ 0, 0, 0, 1, 2, 3, 4, 0, 0, 0 ] ``` By default, the function assumes that a view extends through the last element of a provided array-like `object`. To specify an alternative last view element, provide an `end` argument (zero-based and non-inclusive). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 10 ), 0, 4 ); +const arr = iterator2arrayview( iter, new Uint8Array( 10 ), 0, 4 ); // returns [ 1, 2, 3, 4, 0, 0, 0, 0, 0, 0 ] ``` If `end` is less than `0`, the last view element is resolved relative to the last element of the provided array-like `object`. For example, the following achieves the same behavior as the previous example ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); +const iter = array2iterator( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 10 ), 0, -6 ); +const arr = iterator2arrayview( iter, new Uint8Array( 10 ), 0, -6 ); // returns [ 1, 2, 3, 4, 0, 0, 0, 0, 0, 0 ] ``` To invoke a function for each iterated value, provide a callback function. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v * 10.0; } -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayview( iter, new Float64Array( 4 ), fcn ); +const arr = iterator2arrayview( iter, new Float64Array( 4 ), fcn ); // returns [ 10.0, 20.0, 30.0, 40.0 ] ``` @@ -125,38 +125,39 @@ The invoked function is provided three arguments: - **n**: iteration count (zero-based). ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var array2iterator = require( '@stdlib/array/to-iterator' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v, i ) { return v * (i+1); } -var iter = array2iterator( [ 1, 2, 3, 4 ] ); +const iter = array2iterator( [ 1, 2, 3, 4 ] ); -var arr = iterator2arrayview( iter, new Uint8Array( 4 ), fcn ); +const arr = iterator2arrayview( iter, new Uint8Array( 4 ), fcn ); // returns [ 1, 4, 9, 16 ] ``` To set the callback function execution context, provide a `thisArg`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); function fcn( v ) { this.count += 1; return v * 10.0; } -var ctx = { +const ctx = { 'count': 0 }; -var arr = iterator2arrayview( randu(), new Float64Array( 10 ), fcn, ctx ); +const x = new Float64Array( 10 ); +const arr = iterator2arrayview( randu(), x, fcn, ctx ); // returns -var count = ctx.count; +const count = ctx.count; // returns 10 ``` @@ -186,22 +187,22 @@ var count = ctx.count; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randu = require( '@stdlib/random/iter/randu' ); -var iterator2arrayview = require( '@stdlib/iter/to-array-view' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterator2arrayview = require( '@stdlib/iter/to-array-view' ); function scale( v, i ) { return v * (i+1); } // Create an iterator for generating uniformly distributed pseudorandom numbers: -var it = randu(); +const it = randu(); // Fill an array view with scaled iterator values: -var arr = iterator2arrayview( it, new Float64Array( 100 ), 40, 60, scale ); +const x = new Float64Array( 100 ); +const arr = iterator2arrayview( it, x, 40, 60, scale ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); } ``` diff --git a/lib/node_modules/@stdlib/iter/union/README.md b/lib/node_modules/@stdlib/iter/union/README.md index 97ee0476c270..0a257ecee9f5 100644 --- a/lib/node_modules/@stdlib/iter/union/README.md +++ b/lib/node_modules/@stdlib/iter/union/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUnion = require( '@stdlib/iter/union' ); +const iterUnion = require( '@stdlib/iter/union' ); ``` #### iterUnion( iter0, ...iterator ) @@ -45,15 +45,15 @@ var iterUnion = require( '@stdlib/iter/union' ); Returns an [iterator][mdn-iterator-protocol] which returns the union of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); -var it2 = array2iterator( [ 3, 4, 3 ] ); +const it1 = array2iterator( [ 2, 1, 1, 2, 4 ] ); +const it2 = array2iterator( [ 3, 4, 3 ] ); -var it = iterUnion( it1, it2 ); +const it = iterUnion( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -65,7 +65,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -101,24 +101,24 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterUnion = require( '@stdlib/iter/union' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterUnion = require( '@stdlib/iter/union' ); // Create seeded iterators which can generate 1000 pseudorandom numbers: -var rand1 = discreteUniform( 1, 10, { +const rand1 = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); -var rand2 = discreteUniform( 6, 15, { +const rand2 = discreteUniform( 6, 15, { 'seed': 1234, 'iter': 1000 }); // Create an iterator which returns the union of the seeded iterators: -var it = iterUnion( rand1, rand2 ); +const it = iterUnion( rand1, rand2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/unique-by-hash/README.md b/lib/node_modules/@stdlib/iter/unique-by-hash/README.md index f454d558460e..963a6f10e6ce 100644 --- a/lib/node_modules/@stdlib/iter/unique-by-hash/README.md +++ b/lib/node_modules/@stdlib/iter/unique-by-hash/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUniqueByHash = require( '@stdlib/iter/unique-by-hash' ); +const iterUniqueByHash = require( '@stdlib/iter/unique-by-hash' ); ``` #### iterUniqueByHash( iterator, hashFcn\[, thisArg] ) @@ -45,18 +45,18 @@ var iterUniqueByHash = require( '@stdlib/iter/unique-by-hash' ); Returns an [iterator][mdn-iterator-protocol] which returns unique values according to a hash function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function hashFcn( v ) { return v; } -var src = array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ); +const src = array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ); -var it = iterUniqueByHash( src, hashFcn ); +const it = iterUniqueByHash( src, hashFcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -68,7 +68,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -86,14 +86,14 @@ To set the execution context of the hash function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function hashFcn( v ) { this.count += 1; return JSON.stringify( v ); } -var values = [ +const values = [ { 'v': 2 }, { 'v': 1 }, { 'v': 1 }, @@ -104,16 +104,16 @@ var values = [ { 'v': 3 } ]; -var src = array2iterator( values ); +const src = array2iterator( values ); -var ctx = { +const ctx = { 'count': 0 }; -var it = iterUniqueByHash( src, hashFcn, ctx ); +const it = iterUniqueByHash( src, hashFcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns { 'v': 2 } v = it.next().value; @@ -125,7 +125,7 @@ v = it.next().value; v = it.next().value; // returns { 'v': 3 } -var bool = it.next().done; +let bool = it.next().done; // returns true bool = ( ctx.count > 0 ); @@ -159,9 +159,9 @@ bool = ( ctx.count > 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterMap = require( '@stdlib/iter/map' ); -var iterUniqueByHash = require( '@stdlib/iter/unique-by-hash' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterMap = require( '@stdlib/iter/map' ); +const iterUniqueByHash = require( '@stdlib/iter/unique-by-hash' ); function mapFcn( v ) { return { @@ -174,19 +174,19 @@ function hashFcn( v ) { } // Create a seeded iterator which can generate 1000 pseudorandom numbers: -var rand = discreteUniform( 1, 10, { +const rand = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); // Create an iterator which maps each number to an object: -var miter = iterMap( rand, mapFcn ); +const miter = iterMap( rand, mapFcn ); // Create an iterator which returns unique (object) values: -var it = iterUniqueByHash( miter, hashFcn ); +const it = iterUniqueByHash( miter, hashFcn ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/unique-by/README.md b/lib/node_modules/@stdlib/iter/unique-by/README.md index 5f3f273a6e74..63895baa140c 100644 --- a/lib/node_modules/@stdlib/iter/unique-by/README.md +++ b/lib/node_modules/@stdlib/iter/unique-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUniqueBy = require( '@stdlib/iter/unique-by' ); +const iterUniqueBy = require( '@stdlib/iter/unique-by' ); ``` #### iterUniqueBy( iterator, predicate\[, thisArg] ) @@ -45,18 +45,18 @@ var iterUniqueBy = require( '@stdlib/iter/unique-by' ); Returns an [iterator][mdn-iterator-protocol] which returns unique values according to a `predicate` function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( a, b ) { return ( a !== b ); } -var src = array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ); +const src = array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ); -var it = iterUniqueBy( src, predicate ); +const it = iterUniqueBy( src, predicate ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -68,7 +68,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -87,14 +87,14 @@ To set the execution context of the `predicate` function, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( a, b ) { this.count += 1; return ( a.v !== b.v ); } -var values = [ +const values = [ { 'v': 2 }, { 'v': 1 }, { 'v': 1 }, @@ -105,16 +105,16 @@ var values = [ { 'v': 3 } ]; -var src = array2iterator( values ); +const src = array2iterator( values ); -var ctx = { +const ctx = { 'count': 0 }; -var it = iterUniqueBy( src, predicate, ctx ); +const it = iterUniqueBy( src, predicate, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns { 'v': 2 } v = it.next().value; @@ -126,7 +126,7 @@ v = it.next().value; v = it.next().value; // returns { 'v': 3 } -var bool = it.next().done; +let bool = it.next().done; // returns true bool = ( ctx.count > 0 ); @@ -161,24 +161,24 @@ bool = ( ctx.count > 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterUniqueBy = require( '@stdlib/iter/unique-by' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterUniqueBy = require( '@stdlib/iter/unique-by' ); function predicate( a, b ) { return ( a !== b ); } // Create a seeded iterator which can generate 1000 pseudorandom numbers: -var rand = discreteUniform( 1, 10, { +const rand = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); // Create an iterator which returns unique values: -var it = iterUniqueBy( rand, predicate ); +const it = iterUniqueBy( rand, predicate ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/unique/README.md b/lib/node_modules/@stdlib/iter/unique/README.md index 695b746ffc09..68855af8be22 100644 --- a/lib/node_modules/@stdlib/iter/unique/README.md +++ b/lib/node_modules/@stdlib/iter/unique/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUnique = require( '@stdlib/iter/unique' ); +const iterUnique = require( '@stdlib/iter/unique' ); ``` #### iterUnique( iterator ) @@ -45,12 +45,12 @@ var iterUnique = require( '@stdlib/iter/unique' ); Returns an [iterator][mdn-iterator-protocol] which returns unique values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterUnique( array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ) ); +const it = iterUnique( array2iterator( [ 2, 1, 1, 2, 4, 3, 4, 3 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -62,7 +62,7 @@ v = it.next().value; v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -98,20 +98,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterUnique = require( '@stdlib/iter/unique' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterUnique = require( '@stdlib/iter/unique' ); // Create a seeded iterator which can generate 1000 pseudorandom numbers: -var rand = discreteUniform( 1, 10, { +const rand = discreteUniform( 1, 10, { 'seed': 1234, 'iter': 1000 }); // Create an iterator which returns unique values: -var it = iterUnique( rand ); +const it = iterUnique( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/unitspace/README.md b/lib/node_modules/@stdlib/iter/unitspace/README.md index 6dbb845de254..6b411541bceb 100644 --- a/lib/node_modules/@stdlib/iter/unitspace/README.md +++ b/lib/node_modules/@stdlib/iter/unitspace/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUnitspace = require( '@stdlib/iter/unitspace' ); +const iterUnitspace = require( '@stdlib/iter/unitspace' ); ``` #### iterUnitspace( start\[, stop] ) @@ -45,10 +45,10 @@ var iterUnitspace = require( '@stdlib/iter/unitspace' ); Returns an iterator which returns numbers incremented by `1`. ```javascript -var it = iterUnitspace( -5 ); +const it = iterUnitspace( -5 ); // returns -var v = it.next().value; +let v = it.next().value; // returns -5 v = it.next().value; @@ -68,10 +68,10 @@ The returned iterator protocol-compliant object has the following properties: By default, the stopping value is `+infinity`, and, hence, the returned iterator is an infinite iterator (i.e., the iterator never ends). To specify an alternative stopping value, provide a second argument. ```javascript -var it = iterUnitspace( 0, 2 ); +const it = iterUnitspace( 0, 2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -80,7 +80,7 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -110,13 +110,13 @@ var bool = it.next().done; ```javascript -var iterUnitspace = require( '@stdlib/iter/unitspace' ); +const iterUnitspace = require( '@stdlib/iter/unitspace' ); // Create an iterator: -var it = iterUnitspace( -50, 50 ); +const it = iterUnitspace( -50, 50 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/unshift/README.md b/lib/node_modules/@stdlib/iter/unshift/README.md index 4e8ebd6a6f16..fd4f3a9f4e47 100644 --- a/lib/node_modules/@stdlib/iter/unshift/README.md +++ b/lib/node_modules/@stdlib/iter/unshift/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUnshift = require( '@stdlib/iter/unshift' ); +const iterUnshift = require( '@stdlib/iter/unshift' ); ``` #### iterUnshift( iterator, ...items ) @@ -45,12 +45,12 @@ var iterUnshift = require( '@stdlib/iter/unshift' ); Returns an [iterator][mdn-iterator-protocol] which prepends values to the **beginning** of a provided [`iterator`][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterUnshift( array2iterator( [ 1, 2 ] ), 3, 4 ); +const it = iterUnshift( array2iterator( [ 1, 2 ] ), 3, 4 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; @@ -62,7 +62,7 @@ v = it.next().value; v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -96,20 +96,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterUnshift = require( '@stdlib/iter/unshift' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterUnshift = require( '@stdlib/iter/unshift' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator with prepended values: -var it = iterUnshift( rand, 'beep', 'boop' ); +const it = iterUnshift( rand, 'beep', 'boop' ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/iter/until-each/README.md b/lib/node_modules/@stdlib/iter/until-each/README.md index 34359e1ef4c4..1a685c9ae00d 100644 --- a/lib/node_modules/@stdlib/iter/until-each/README.md +++ b/lib/node_modules/@stdlib/iter/until-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterUntilEach = require( '@stdlib/iter/until-each' ); +const iterUntilEach = require( '@stdlib/iter/until-each' ); ``` #### iterUntilEach( iterator, predicate, fcn\[, thisArg] ) @@ -45,7 +45,7 @@ var iterUntilEach = require( '@stdlib/iter/until-each' ); Returns an iterator which invokes a function for each iterated value **before** returning the iterated value until either a `predicate` function returns `true` or the iterator has iterated over all values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v > 2; @@ -57,10 +57,10 @@ function assert( v ) { } } -var it = iterUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const it = iterUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); // returns {} -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -83,7 +83,7 @@ Both the `predicate` function and the function to invoke for each iterated value - **index**: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v > 2; @@ -95,10 +95,10 @@ function assert( v, i ) { } } -var it = iterUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const it = iterUntilEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -115,7 +115,7 @@ To set the execution context for `fcn`, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { this.count += 1; @@ -128,20 +128,21 @@ function predicate( v ) { return v > 2; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterUntilEach( array2iterator( [ 1, 2, 3 ] ), predicate, assert, ctx ); +const iterator = array2iterator( [ 1, 2, 3 ] ); +const it = iterUntilEach( iterator, predicate, assert, ctx ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; // returns 2 -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -170,9 +171,9 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var iterUntilEach = require( '@stdlib/iter/until-each' ); +const randu = require( '@stdlib/random/iter/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const iterUntilEach = require( '@stdlib/iter/until-each' ); function assert( v ) { if ( isnan( v ) ) { @@ -185,16 +186,16 @@ function predicate( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which validates generated numbers: -var it = iterUntilEach( rand, predicate, assert ); +const it = iterUntilEach( rand, predicate, assert ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/iter/while-each/README.md b/lib/node_modules/@stdlib/iter/while-each/README.md index 485998c40c77..fd0c5538dc3f 100644 --- a/lib/node_modules/@stdlib/iter/while-each/README.md +++ b/lib/node_modules/@stdlib/iter/while-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterWhileEach = require( '@stdlib/iter/while-each' ); +const iterWhileEach = require( '@stdlib/iter/while-each' ); ``` #### iterWhileEach( iterator, predicate, fcn\[, thisArg] ) @@ -45,7 +45,7 @@ var iterWhileEach = require( '@stdlib/iter/while-each' ); Returns an iterator which invokes a function for each iterated value **before** returning the iterated value until either a `predicate` function returns `false` or the iterator has iterated over all values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v < 3; @@ -57,10 +57,10 @@ function assert( v ) { } } -var it = iterWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const it = iterWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); // returns {} -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -83,7 +83,7 @@ Both the `predicate` function and the function to invoke for each iterated value - **index**: iteration index (zero-based) ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function predicate( v ) { return v < 3; @@ -95,10 +95,10 @@ function assert( v, i ) { } } -var it = iterWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); +const it = iterWhileEach( array2iterator( [ 1, 2, 3, 4 ] ), predicate, assert ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -115,7 +115,7 @@ To set the execution context for `fcn`, provide a `thisArg`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function assert( v ) { this.count += 1; @@ -128,20 +128,21 @@ function predicate( v ) { return v < 3; } -var ctx = { +const ctx = { 'count': 0 }; -var it = iterWhileEach( array2iterator( [ 1, 2, 3 ] ), predicate, assert, ctx ); +const iterator = array2iterator( [ 1, 2, 3 ] ); +const it = iterWhileEach( iterator, predicate, assert, ctx ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; // returns 2 -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -170,9 +171,9 @@ var count = ctx.count; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var iterWhileEach = require( '@stdlib/iter/while-each' ); +const randu = require( '@stdlib/random/iter/randu' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); +const iterWhileEach = require( '@stdlib/iter/while-each' ); function assert( v ) { if ( isnan( v ) ) { @@ -185,16 +186,16 @@ function predicate( v ) { } // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which validates generated numbers: -var it = iterWhileEach( rand, predicate, assert ); +const it = iterWhileEach( rand, predicate, assert ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/lapack/README.md b/lib/node_modules/@stdlib/lapack/README.md index 1088f87c9fed..67fa7fbbfdc9 100644 --- a/lib/node_modules/@stdlib/lapack/README.md +++ b/lib/node_modules/@stdlib/lapack/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lapack = require( '@stdlib/lapack' ); +const lapack = require( '@stdlib/lapack' ); ``` #### lapack @@ -35,7 +35,7 @@ var lapack = require( '@stdlib/lapack' ); Namespace for linear algebra package (LAPACK) routines. ```javascript -var o = lapack; +const o = lapack; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var lapack = require( '@stdlib/lapack' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const lapack = require( '@stdlib/lapack' ); console.log( objectKeys( lapack ) ); ``` diff --git a/lib/node_modules/@stdlib/lapack/base/README.md b/lib/node_modules/@stdlib/lapack/base/README.md index 85d0d9d170dd..974bc075348d 100644 --- a/lib/node_modules/@stdlib/lapack/base/README.md +++ b/lib/node_modules/@stdlib/lapack/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lapack = require( '@stdlib/lapack/base' ); +const lapack = require( '@stdlib/lapack/base' ); ``` #### lapack @@ -35,7 +35,7 @@ var lapack = require( '@stdlib/lapack/base' ); Namespace for "base" (i.e., lower-level) linear algebra package (LAPACK) routines. ```javascript -var o = lapack; +const o = lapack; // returns {...} ``` @@ -69,8 +69,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var lapack = require( '@stdlib/lapack/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const lapack = require( '@stdlib/lapack/base' ); console.log( objectKeys( lapack ) ); ``` diff --git a/lib/node_modules/@stdlib/lapack/base/dge-trans/README.md b/lib/node_modules/@stdlib/lapack/base/dge-trans/README.md index d60b174f9731..48ce00d2401a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dge-trans/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dge-trans/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dgetrans = require( '@stdlib/lapack/base/dge-trans' ); +const dgetrans = require( '@stdlib/lapack/base/dge-trans' ); ``` #### dgetrans( order, M, N, A, LDA, out, LDO ) @@ -35,10 +35,10 @@ var dgetrans = require( '@stdlib/lapack/base/dge-trans' ); Converts a matrix from row-major layout to column-major layout or vice versa. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var out = new Float64Array( 6 ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let out = new Float64Array( 6 ); out = dgetrans( 'row-major', 2, 3, A, 3, out, 2 ); // returns [ 1.0, 4.0, 2.0, 5.0, 3.0, 6.0 ] @@ -59,15 +59,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var Out0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const Out0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); // Create offset views... -var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var Out1 = new Float64Array( Out0.buffer, Out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const Out1 = new Float64Array( Out0.buffer, Out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dgetrans( 'row-major', 2, 2, A1, 2, Out1, 2 ); // Out0 => [ 0.0, 1.0, 3.0, 2.0, 4.0 ] @@ -78,10 +78,10 @@ dgetrans( 'row-major', 2, 2, A1, 2, Out1, 2 ); Converts a matrix from row-major layout to column-major layout or vice versa using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var out = new Float64Array( 6 ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let out = new Float64Array( 6 ); out = dgetrans.ndarray( 2, 3, A, 3, 1, 0, out, 2, 1, 0 ); // returns [ 1.0, 4.0, 2.0, 5.0, 3.0, 6.0 ] @@ -103,10 +103,10 @@ The function has the following parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); +const A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); dgetrans.ndarray( 2, 2, A, 2, 1, 1, out, 2, 1, 2 ); // out => [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] @@ -135,25 +135,25 @@ dgetrans.ndarray( 2, 2, A, 2, 1, 1, out, 2, 1, 2 ); ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dgetrans = require( '@stdlib/lapack/base/dge-trans' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dgetrans = require( '@stdlib/lapack/base/dge-trans' ); -var shapeA = [ 2, 3 ]; -var shapeOut = [ 3, 2 ]; +const shapeA = [ 2, 3 ]; +const shapeOut = [ 3, 2 ]; // Row-major layout... -var order = 'row-major'; +let order = 'row-major'; -var stridesA = shape2strides( shapeA, order ); -var stridesOut = shape2strides( shapeOut, order ); +let stridesA = shape2strides( shapeA, order ); +let stridesOut = shape2strides( shapeOut, order ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); console.log( ndarray2array( A, shapeA, stridesA, 0, order ) ); -var out = new Float64Array( numel( shapeA ) ); +let out = new Float64Array( numel( shapeA ) ); out = dgetrans( order, shapeA[0], shapeA[1], A, stridesA[0], out, stridesOut[0] ); console.log( ndarray2array( out, shapeOut, stridesOut, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlacpy/README.md b/lib/node_modules/@stdlib/lapack/base/dlacpy/README.md index 7459e8145024..68ef998bdc5b 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlacpy/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlacpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dlacpy = require( '@stdlib/lapack/base/dlacpy' ); +const dlacpy = require( '@stdlib/lapack/base/dlacpy' ); ``` #### dlacpy( order, uplo, M, N, A, LDA, B, LDB ) @@ -35,10 +35,10 @@ var dlacpy = require( '@stdlib/lapack/base/dlacpy' ); Copies all or part of a matrix `A` to another matrix `B`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float64Array( 4 ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float64Array( 4 ); dlacpy( 'row-major', 'all', 2, 2, A, 2, B, 2 ); // B => [ 1.0, 2.0, 3.0, 4.0 ] @@ -60,15 +60,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var A0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var B0 = new Float64Array( 5 ); +const A0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const B0 = new Float64Array( 5 ); // Create offset views... -var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dlacpy( 'row-major', 'all', 2, 2, A1, 2, B1, 2 ); // B0 => [ 0.0, 2.0, 3.0, 4.0, 5.0 ] @@ -79,10 +79,10 @@ dlacpy( 'row-major', 'all', 2, 2, A1, 2, B1, 2 ); Copies all or part of a matrix `A` to another matrix `B` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); dlacpy.ndarray( 'all', 2, 2, A, 2, 1, 0, B, 2, 1, 0 ); // B => [ 1.0, 2.0, 3.0, 4.0 ] @@ -105,10 +105,10 @@ The function has the following parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float64Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); +const A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float64Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); dlacpy.ndarray( 'all', 2, 2, A, 2, 1, 1, B, 2, 1, 2 ); // B => [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] @@ -135,24 +135,24 @@ dlacpy.ndarray( 'all', 2, 2, A, 2, 1, 1, B, 2, 1, 2 ); ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var uniform = require( '@stdlib/random/array/discrete-uniform' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var dlacpy = require( '@stdlib/lapack/base/dlacpy' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const uniform = require( '@stdlib/random/array/discrete-uniform' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const dlacpy = require( '@stdlib/lapack/base/dlacpy' ); -var shape = [ 5, 8 ]; -var order = 'row-major'; -var strides = shape2strides( shape, order ); +const shape = [ 5, 8 ]; +const order = 'row-major'; +const strides = shape2strides( shape, order ); -var N = numel( shape ); +const N = numel( shape ); -var A = uniform( N, -10, 10, { +const A = uniform( N, -10, 10, { 'dtype': 'float64' }); console.log( ndarray2array( A, shape, strides, 0, order ) ); -var B = uniform( N, -10, 10, { +const B = uniform( N, -10, 10, { 'dtype': 'float64' }); console.log( ndarray2array( B, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlamch/README.md b/lib/node_modules/@stdlib/lapack/base/dlamch/README.md index 1d43f1f1eb20..038f61f91169 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlamch/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlamch/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dlamch = require( '@stdlib/lapack/base/dlamch' ); +const dlamch = require( '@stdlib/lapack/base/dlamch' ); ``` #### dlamch( cmach ) @@ -35,7 +35,7 @@ var dlamch = require( '@stdlib/lapack/base/dlamch' ); Determines double-precision floating-point machine parameters. ```javascript -var out = dlamch( 'E' ); +const out = dlamch( 'E' ); // returns 1.1102230246251565e-16 ``` @@ -75,9 +75,9 @@ The function has the following parameters: ```javascript -var dlamch = require( '@stdlib/lapack/base/dlamch' ); +const dlamch = require( '@stdlib/lapack/base/dlamch' ); -var out = dlamch( 'E' ); +let out = dlamch( 'E' ); console.log( 'Precision: %d', out ); out = dlamch( 'S' ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlassq/README.md b/lib/node_modules/@stdlib/lapack/base/dlassq/README.md index 049bf474e341..b7ab7bfd15dd 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlassq/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlassq/README.md @@ -46,7 +46,7 @@ where $x_i = X_{(i-1) \cdot \textrm{sx}}$ and $\textrm{sx}$ is the stride of `X` ## Usage ```javascript -var dlassq = require( '@stdlib/lapack/base/dlassq' ); +const dlassq = require( '@stdlib/lapack/base/dlassq' ); ``` #### dlassq( N, X, strideX, scale, sumsq ) @@ -54,11 +54,11 @@ var dlassq = require( '@stdlib/lapack/base/dlassq' ); Returns an updated sum of squares represented in scaled form. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var out = dlassq( 4, X, 1, 1.0, 0.0 ); +const out = dlassq( 4, X, 1, 1.0, 0.0 ); // returns [ 1.0, 30.0 ] ``` @@ -75,16 +75,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var X0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const X0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); // Create an offset view: -var X1 = new Float64Array( X0.buffer, X0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const X1 = new Float64Array( X0.buffer, X0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the sum of squares: -var out = dlassq( X1.length, X1, 1, 1.0, 0.0 ); +const out = dlassq( X1.length, X1, 1, 1.0, 0.0 ); // returns [ 1.0, 30.0 ] ``` @@ -95,10 +95,10 @@ The returned [`Float64Array`][mdn-float64array] contains an updated scale factor Returns an updated sum of squares represented in scaled form using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( [ 0.0, 0.0 ] ); +const X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( [ 0.0, 0.0 ] ); dlassq.ndarray( 4, X, 1, 0, 1.0, 0.0, out, 1, 0 ); // out => [ 1.0, 30.0 ] @@ -116,10 +116,10 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var X = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ] ); -var out = new Float64Array( [ 0.0, 0.0, 999.9, 0.0, 999.9 ] ); +const X = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ] ); +const out = new Float64Array( [ 0.0, 0.0, 999.9, 0.0, 999.9 ] ); dlassq.ndarray( 4, X, 2, 0, 1.0, 0.0, out, 2, 1 ); // out => [ 0.0, 1.0, 999.9, 30.0, 999.9 ] @@ -146,15 +146,15 @@ dlassq.ndarray( 4, X, 2, 0, 1.0, 0.0, out, 2, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dlassq = require( '@stdlib/lapack/base/dlassq' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dlassq = require( '@stdlib/lapack/base/dlassq' ); -var X = discreteUniform( 10, -10, 10, { +const X = discreteUniform( 10, -10, 10, { 'dtype': 'float64' }); console.log( X ); -var out = dlassq( X.length, X, 1, 1.0, 0.0 ); +const out = dlassq( X.length, X, 1, 1.0, 0.0 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/lapack/base/dlaswp/README.md b/lib/node_modules/@stdlib/lapack/base/dlaswp/README.md index d4696884c82b..be3154d1ce37 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaswp/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlaswp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dlaswp = require( '@stdlib/lapack/base/dlaswp' ); +const dlaswp = require( '@stdlib/lapack/base/dlaswp' ); ``` #### dlaswp( N, A, LDA, k1, k2, IPIV, incx ) @@ -35,11 +35,11 @@ var dlaswp = require( '@stdlib/lapack/base/dlaswp' ); Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); dlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -59,11 +59,11 @@ The function has the following parameters: The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order, ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); dlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -72,11 +72,11 @@ dlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`, ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 999, 0, 999, 1 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 999, 0, 999, 1 ] ); dlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -87,16 +87,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var IPIV0 = new Int32Array( [ 0, 2, 0, 1] ); +const A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const IPIV0 = new Int32Array( [ 0, 2, 0, 1] ); // Create offset views... -var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var IPIV1 = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const IPIV1 = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dlaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); // A0 => [ 0.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -107,11 +107,11 @@ dlaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -136,11 +136,11 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var IPIV = new Int32Array( [ 0, 0, 2, 0, 1 ] ); +const A = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const IPIV = new Int32Array( [ 0, 0, 2, 0, 1 ] ); dlaswp.ndarray( 2, A, 2, 1, 4, 0, 2, 1, IPIV, 1, 2 ); // A => [ 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -169,23 +169,23 @@ dlaswp.ndarray( 2, A, 2, 1, 4, 0, 2, 1, IPIV, 1, 2 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Int32Array = require( '@stdlib/array/int32' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var dlaswp = require( '@stdlib/lapack/base/dlaswp' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int32Array = require( '@stdlib/array/int32' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const dlaswp = require( '@stdlib/lapack/base/dlaswp' ); // Specify matrix meta data: -var shape = [ 4, 2 ]; -var strides = [ 1, 4 ]; -var offset = 0; -var order = 'column-major'; +const shape = [ 4, 2 ]; +const strides = [ 1, 4 ]; +const offset = 0; +const order = 'column-major'; // Create a matrix stored in linear memory: -var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); console.log( ndarray2array( A, shape, strides, offset, order ) ); // Define a vector of pivot indices: -var IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); +const IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); // Interchange rows: dlaswp( order, shape[ 1 ], A, strides[ 1 ], 0, shape[ 0 ]-1, IPIV, 1 ); diff --git a/lib/node_modules/@stdlib/lapack/base/dpttrf/README.md b/lib/node_modules/@stdlib/lapack/base/dpttrf/README.md index 89026cde78f3..a80b883558a0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dpttrf/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dpttrf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dpttrf = require( '@stdlib/lapack/base/dpttrf' ); +const dpttrf = require( '@stdlib/lapack/base/dpttrf' ); ``` #### dpttrf( N, D, E ) @@ -35,10 +35,10 @@ var dpttrf = require( '@stdlib/lapack/base/dpttrf' ); Computes the `L * D * L^T` factorization of a real symmetric positive definite tridiagonal matrix `A`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var D = new Float64Array( [ 4.0, 5.0, 6.0 ] ); -var E = new Float64Array( [ 1.0, 2.0 ] ); +const D = new Float64Array( [ 4.0, 5.0, 6.0 ] ); +const E = new Float64Array( [ 1.0, 2.0 ] ); dpttrf( 3, D, E ); // D => [ 4, 4.75, ~5.15789 ] @@ -56,15 +56,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var D0 = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] ); -var E0 = new Float64Array( [ 0.0, 1.0, 2.0 ] ); +const D0 = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] ); +const E0 = new Float64Array( [ 0.0, 1.0, 2.0 ] ); // Create offset views... -var D1 = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var E1 = new Float64Array( E0.buffer, E0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const D1 = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const E1 = new Float64Array( E0.buffer, E0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dpttrf( 3, D1, E1 ); // D0 => [ 0.0, 4.0, 4.75, ~5.15789 ] @@ -76,10 +76,10 @@ dpttrf( 3, D1, E1 ); Computes the `L * D * L^T` factorization of a real symmetric positive definite tridiagonal matrix `A` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var D = new Float64Array( [ 4.0, 5.0, 6.0 ] ); -var E = new Float64Array( [ 1.0, 2.0 ] ); +const D = new Float64Array( [ 4.0, 5.0, 6.0 ] ); +const E = new Float64Array( [ 1.0, 2.0 ] ); dpttrf.ndarray( 3, D, 1, 0, E, 1, 0 ); // D => [ 4, 4.75, ~5.15789 ] @@ -98,10 +98,10 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var D = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] ); -var E = new Float64Array( [ 0.0, 1.0, 2.0 ] ); +const D = new Float64Array( [ 0.0, 4.0, 5.0, 6.0 ] ); +const E = new Float64Array( [ 0.0, 1.0, 2.0 ] ); dpttrf.ndarray( 3, D, 1, 1, E, 1, 1 ); // D => [ 0.0, 4.0, 4.75, ~5.15789 ] @@ -138,20 +138,20 @@ dpttrf.ndarray( 3, D, 1, 1, E, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var dpttrf = require( '@stdlib/lapack/base/dpttrf' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const dpttrf = require( '@stdlib/lapack/base/dpttrf' ); -var opts = { +const opts = { 'dtype': 'float64' }; -var D = discreteUniform( 5, 1, 5, opts ); +const D = discreteUniform( 5, 1, 5, opts ); console.log( D ); -var E = discreteUniform( D.length-1, 1, 5, opts ); +const E = discreteUniform( D.length-1, 1, 5, opts ); console.log( E ); // Perform the `L * D * L^T` factorization: -var info = dpttrf( D.length, D, E ); +const info = dpttrf( D.length, D, E ); console.log( D ); console.log( E ); console.log( info ); diff --git a/lib/node_modules/@stdlib/lapack/base/sge-trans/README.md b/lib/node_modules/@stdlib/lapack/base/sge-trans/README.md index e0be1568b98f..9200e8b4b149 100644 --- a/lib/node_modules/@stdlib/lapack/base/sge-trans/README.md +++ b/lib/node_modules/@stdlib/lapack/base/sge-trans/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sgetrans = require( '@stdlib/lapack/base/sge-trans' ); +const sgetrans = require( '@stdlib/lapack/base/sge-trans' ); ``` #### sgetrans( order, M, N, A, LDA, out, LDO ) @@ -35,10 +35,10 @@ var sgetrans = require( '@stdlib/lapack/base/sge-trans' ); Converts a matrix from row-major layout to column-major layout or vice versa. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var out = new Float32Array( 6 ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let out = new Float32Array( 6 ); out = sgetrans( 'row-major', 2, 3, A, 3, out, 2 ); // returns [ 1.0, 4.0, 2.0, 5.0, 3.0, 6.0 ] @@ -59,15 +59,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var A0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var Out0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const A0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const Out0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); // Create offset views... -var A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var Out1 = new Float32Array( Out0.buffer, Out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const Out1 = new Float32Array( Out0.buffer, Out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element sgetrans( 'row-major', 2, 2, A1, 2, Out1, 2 ); // Out0 => [ 0.0, 1.0, 3.0, 2.0, 4.0 ] @@ -78,10 +78,10 @@ sgetrans( 'row-major', 2, 2, A1, 2, Out1, 2 ); Converts a matrix from row-major layout to column-major layout or vice versa using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var out = new Float32Array( 6 ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let out = new Float32Array( 6 ); out = sgetrans.ndarray( 2, 3, A, 3, 1, 0, out, 2, 1, 0 ); // returns [ 1.0, 4.0, 2.0, 5.0, 3.0, 6.0 ] @@ -103,10 +103,10 @@ The function has the following parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var out = new Float32Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); +const A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const out = new Float32Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); sgetrans.ndarray( 2, 2, A, 2, 1, 1, out, 2, 1, 2 ); // out => [ 0.0, 0.0, 1.0, 3.0, 2.0, 4.0 ] @@ -135,25 +135,25 @@ sgetrans.ndarray( 2, 2, A, 2, 1, 1, out, 2, 1, 2 ); ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sgetrans = require( '@stdlib/lapack/base/sge-trans' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sgetrans = require( '@stdlib/lapack/base/sge-trans' ); -var shapeA = [ 2, 3 ]; -var shapeOut = [ 3, 2 ]; +const shapeA = [ 2, 3 ]; +const shapeOut = [ 3, 2 ]; // Row-major layout... -var order = 'row-major'; +let order = 'row-major'; -var stridesA = shape2strides( shapeA, order ); -var stridesOut = shape2strides( shapeOut, order ); +let stridesA = shape2strides( shapeA, order ); +let stridesOut = shape2strides( shapeOut, order ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +let A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); console.log( ndarray2array( A, shapeA, stridesA, 0, order ) ); -var out = new Float32Array( numel( shapeA ) ); +let out = new Float32Array( numel( shapeA ) ); out = sgetrans( order, shapeA[0], shapeA[1], A, stridesA[0], out, stridesOut[0] ); console.log( ndarray2array( out, shapeOut, stridesOut, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/slacpy/README.md b/lib/node_modules/@stdlib/lapack/base/slacpy/README.md index 714c75e7a87e..c3302c16280a 100644 --- a/lib/node_modules/@stdlib/lapack/base/slacpy/README.md +++ b/lib/node_modules/@stdlib/lapack/base/slacpy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var slacpy = require( '@stdlib/lapack/base/slacpy' ); +const slacpy = require( '@stdlib/lapack/base/slacpy' ); ``` #### slacpy( order, uplo, M, N, A, LDA, B, LDB ) @@ -35,10 +35,10 @@ var slacpy = require( '@stdlib/lapack/base/slacpy' ); Copies all or part of a matrix `A` to another matrix `B`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float32Array( 4 ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float32Array( 4 ); slacpy( 'row-major', 'all', 2, 2, A, 2, B, 2 ); // B => [ 1.0, 2.0, 3.0, 4.0 ] @@ -60,15 +60,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var A0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var B0 = new Float32Array( 5 ); +const A0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const B0 = new Float32Array( 5 ); // Create offset views... -var A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var B1 = new Float32Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const B1 = new Float32Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element slacpy( 'row-major', 'all', 2, 2, A1, 2, B1, 2 ); // B0 => [ 0.0, 2.0, 3.0, 4.0, 5.0 ] @@ -79,10 +79,10 @@ slacpy( 'row-major', 'all', 2, 2, A1, 2, B1, 2 ); Copies all or part of a matrix `A` to another matrix `B` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); slacpy.ndarray( 'all', 2, 2, A, 2, 1, 0, B, 2, 1, 0 ); // B => [ 1.0, 2.0, 3.0, 4.0 ] @@ -105,10 +105,10 @@ The function has the following parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); -var B = new Float32Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); +const A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +const B = new Float32Array( [ 0.0, 0.0, 11.0, 312.0, 53.0, 412.0 ] ); slacpy.ndarray( 'all', 2, 2, A, 2, 1, 1, B, 2, 1, 2 ); // B => [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] @@ -135,24 +135,24 @@ slacpy.ndarray( 'all', 2, 2, A, 2, 1, 1, B, 2, 1, 2 ); ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var uniform = require( '@stdlib/random/array/discrete-uniform' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var slacpy = require( '@stdlib/lapack/base/slacpy' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const uniform = require( '@stdlib/random/array/discrete-uniform' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const slacpy = require( '@stdlib/lapack/base/slacpy' ); -var shape = [ 5, 8 ]; -var order = 'row-major'; -var strides = shape2strides( shape, order ); +const shape = [ 5, 8 ]; +const order = 'row-major'; +const strides = shape2strides( shape, order ); -var N = numel( shape ); +const N = numel( shape ); -var A = uniform( N, -10, 10, { +const A = uniform( N, -10, 10, { 'dtype': 'float32' }); console.log( ndarray2array( A, shape, strides, 0, order ) ); -var B = uniform( N, -10, 10, { +const B = uniform( N, -10, 10, { 'dtype': 'float32' }); console.log( ndarray2array( B, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/slaswp/README.md b/lib/node_modules/@stdlib/lapack/base/slaswp/README.md index a84977c3e16e..c5b2ae9b4f46 100644 --- a/lib/node_modules/@stdlib/lapack/base/slaswp/README.md +++ b/lib/node_modules/@stdlib/lapack/base/slaswp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var slaswp = require( '@stdlib/lapack/base/slaswp' ); +const slaswp = require( '@stdlib/lapack/base/slaswp' ); ``` #### slaswp( N, A, LDA, k1, k2, IPIV, incx ) @@ -35,11 +35,11 @@ var slaswp = require( '@stdlib/lapack/base/slaswp' ); Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); slaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -59,11 +59,11 @@ The function has the following parameters: The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order, ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); slaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -72,11 +72,11 @@ slaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`, ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 999, 0, 999, 1 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 999, 0, 999, 1 ] ); slaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -87,16 +87,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var A0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var IPIV0 = new Int32Array( [ 0, 2, 0, 1] ); +const A0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const IPIV0 = new Int32Array( [ 0, 2, 0, 1] ); // Create offset views... -var A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var IPIV1 = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const A1 = new Float32Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const IPIV1 = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element slaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); // A0 => [ 0.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -107,11 +107,11 @@ slaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var IPIV = new Int32Array( [ 2, 0, 1 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] +const IPIV = new Int32Array( [ 2, 0, 1 ] ); slaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -136,11 +136,11 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var IPIV = new Int32Array( [ 0, 0, 2, 0, 1 ] ); +const A = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const IPIV = new Int32Array( [ 0, 0, 2, 0, 1 ] ); slaswp.ndarray( 2, A, 2, 1, 4, 0, 2, 1, IPIV, 1, 2 ); // A => [ 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] @@ -169,23 +169,23 @@ slaswp.ndarray( 2, A, 2, 1, 4, 0, 2, 1, IPIV, 1, 2 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Int32Array = require( '@stdlib/array/int32' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var slaswp = require( '@stdlib/lapack/base/slaswp' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Int32Array = require( '@stdlib/array/int32' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const slaswp = require( '@stdlib/lapack/base/slaswp' ); // Specify matrix meta data: -var shape = [ 4, 2 ]; -var strides = [ 1, 4 ]; -var offset = 0; -var order = 'column-major'; +const shape = [ 4, 2 ]; +const strides = [ 1, 4 ]; +const offset = 0; +const order = 'column-major'; // Create a matrix stored in linear memory: -var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); console.log( ndarray2array( A, shape, strides, offset, order ) ); // Define a vector of pivot indices: -var IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); +const IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); // Interchange rows: slaswp( order, shape[ 1 ], A, strides[ 1 ], 0, shape[ 0 ]-1, IPIV, 1 ); diff --git a/lib/node_modules/@stdlib/lapack/base/spttrf/README.md b/lib/node_modules/@stdlib/lapack/base/spttrf/README.md index b267ad710e3f..415486026a34 100644 --- a/lib/node_modules/@stdlib/lapack/base/spttrf/README.md +++ b/lib/node_modules/@stdlib/lapack/base/spttrf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var spttrf = require( '@stdlib/lapack/base/spttrf' ); +const spttrf = require( '@stdlib/lapack/base/spttrf' ); ``` #### spttrf( N, D, E ) @@ -35,10 +35,10 @@ var spttrf = require( '@stdlib/lapack/base/spttrf' ); Computes the `L * D * L^T` factorization of a real symmetric positive definite tridiagonal matrix `A`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var D = new Float32Array( [ 4.0, 5.0, 6.0 ] ); -var E = new Float32Array( [ 1.0, 2.0 ] ); +const D = new Float32Array( [ 4.0, 5.0, 6.0 ] ); +const E = new Float32Array( [ 1.0, 2.0 ] ); spttrf( 3, D, E ); // D => [ 4, 4.75, ~5.15789 ] @@ -56,15 +56,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var D0 = new Float32Array( [ 0.0, 4.0, 5.0, 6.0 ] ); -var E0 = new Float32Array( [ 0.0, 1.0, 2.0 ] ); +const D0 = new Float32Array( [ 0.0, 4.0, 5.0, 6.0 ] ); +const E0 = new Float32Array( [ 0.0, 1.0, 2.0 ] ); // Create offset views... -var D1 = new Float32Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var E1 = new Float32Array( E0.buffer, E0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const D1 = new Float32Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const E1 = new Float32Array( E0.buffer, E0.BYTES_PER_ELEMENT*1 ); // start at 2nd element spttrf( 3, D1, E1 ); // D0 => [ 0.0, 4.0, 4.75, ~5.15789 ] @@ -76,10 +76,10 @@ spttrf( 3, D1, E1 ); Computes the `L * D * L^T` factorization of a real symmetric positive definite tridiagonal matrix `A` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var D = new Float32Array( [ 4.0, 5.0, 6.0 ] ); -var E = new Float32Array( [ 1.0, 2.0 ] ); +const D = new Float32Array( [ 4.0, 5.0, 6.0 ] ); +const E = new Float32Array( [ 1.0, 2.0 ] ); spttrf.ndarray( 3, D, 1, 0, E, 1, 0 ); // D => [ 4, 4.75, ~5.15789 ] @@ -98,10 +98,10 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var D = new Float32Array( [ 0.0, 4.0, 5.0, 6.0 ] ); -var E = new Float32Array( [ 0.0, 1.0, 2.0 ] ); +const D = new Float32Array( [ 0.0, 4.0, 5.0, 6.0 ] ); +const E = new Float32Array( [ 0.0, 1.0, 2.0 ] ); spttrf.ndarray( 3, D, 1, 1, E, 1, 1 ); // D => [ 0.0, 4.0, 4.75, ~5.15789 ] @@ -138,20 +138,20 @@ spttrf.ndarray( 3, D, 1, 1, E, 1, 1 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var spttrf = require( '@stdlib/lapack/base/spttrf' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const spttrf = require( '@stdlib/lapack/base/spttrf' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var D = discreteUniform( 5, 1, 5, opts ); +const D = discreteUniform( 5, 1, 5, opts ); console.log( D ); -var E = discreteUniform( D.length-1, 1, 5, opts ); +const E = discreteUniform( D.length-1, 1, 5, opts ); console.log( E ); // Perform the `L * D * L^T` factorization: -var info = spttrf( D.length, D, E ); +const info = spttrf( D.length, D, E ); console.log( D ); console.log( E ); console.log( info ); diff --git a/lib/node_modules/@stdlib/math/README.md b/lib/node_modules/@stdlib/math/README.md index 6049bb70e753..61ae44d1d8ef 100644 --- a/lib/node_modules/@stdlib/math/README.md +++ b/lib/node_modules/@stdlib/math/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var math = require( '@stdlib/math' ); +const math = require( '@stdlib/math' ); ``` #### math @@ -35,7 +35,7 @@ var math = require( '@stdlib/math' ); Namespace containing math functions. ```javascript -var m = math; +const m = math; // returns {...} ``` @@ -68,8 +68,8 @@ The namespace consists of the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var math = require( '@stdlib/math' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const math = require( '@stdlib/math' ); console.log( objectKeys( math ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/README.md b/lib/node_modules/@stdlib/math/base/README.md index 2cdb419aa997..2058ce8368d3 100644 --- a/lib/node_modules/@stdlib/math/base/README.md +++ b/lib/node_modules/@stdlib/math/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var math = require( '@stdlib/math/base' ); +const math = require( '@stdlib/math/base' ); ``` #### math @@ -35,7 +35,7 @@ var math = require( '@stdlib/math/base' ); Namespace containing "base" (i.e., lower-level) math functions. ```javascript -var ns = math; +const ns = math; // returns {...} ``` @@ -76,8 +76,8 @@ The namespace has the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/README.md b/lib/node_modules/@stdlib/math/base/assert/README.md index 326248f3f421..6b49f3013a72 100644 --- a/lib/node_modules/@stdlib/math/base/assert/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/base/assert' ); +const ns = require( '@stdlib/math/base/assert' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/base/assert' ); Namespace containing "base" (i.e., lower-level) math assertion utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -90,8 +90,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/int32-is-even/README.md b/lib/node_modules/@stdlib/math/base/assert/int32-is-even/README.md index 2945bcb9fcbe..48c8fcba393c 100644 --- a/lib/node_modules/@stdlib/math/base/assert/int32-is-even/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/int32-is-even/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEven = require( '@stdlib/math/base/assert/int32-is-even' ); +const isEven = require( '@stdlib/math/base/assert/int32-is-even' ); ``` #### isEven( x ) @@ -35,7 +35,7 @@ var isEven = require( '@stdlib/math/base/assert/int32-is-even' ); Tests if 32-bit integer is even. ```javascript -var bool = isEven( 5 ); +let bool = isEven( 5 ); // returns false bool = isEven( -2 ); @@ -62,17 +62,13 @@ bool = isEven( 0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var isEven = require( '@stdlib/math/base/assert/int32-is-even' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const isEven = require( '@stdlib/math/base/assert/int32-is-even' ); -var bool; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ); - bool = isEven( x ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ); + const bool = isEven( x ); console.log( '%d is %s', x, ( bool ) ? 'even' : 'not even' ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md b/lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md index 2f4f79387df4..a60312de5a49 100644 --- a/lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isOdd = require( '@stdlib/math/base/assert/int32-is-odd' ); +const isOdd = require( '@stdlib/math/base/assert/int32-is-odd' ); ``` #### isOdd( x ) @@ -35,7 +35,7 @@ var isOdd = require( '@stdlib/math/base/assert/int32-is-odd' ); Tests if 32-bit integer is odd. ```javascript -var bool = isOdd( 5 ); +let bool = isOdd( 5 ); // returns true bool = isOdd( -2 ); @@ -62,17 +62,13 @@ bool = isOdd( 0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var isOdd = require( '@stdlib/math/base/assert/int32-is-odd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const isOdd = require( '@stdlib/math/base/assert/int32-is-odd' ); -var bool; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ); - bool = isOdd( x ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ); + const bool = isOdd( x ); console.log( '%d is %s', x, ( bool ) ? 'odd' : 'not odd' ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/is-composite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-composite/README.md index 2dbdb89f6924..c4c8f8c3d7c2 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-composite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-composite/README.md @@ -35,7 +35,7 @@ A **composite number** is defined as a positive integer value greater than `1` w ## Usage ```javascript -var isComposite = require( '@stdlib/math/base/assert/is-composite' ); +const isComposite = require( '@stdlib/math/base/assert/is-composite' ); ``` #### isComposite( x ) @@ -43,7 +43,7 @@ var isComposite = require( '@stdlib/math/base/assert/is-composite' ); Tests if a number is a composite. ```javascript -var bool = isComposite( 4.0 ); +const bool = isComposite( 4.0 ); // returns true ``` @@ -64,9 +64,9 @@ var bool = isComposite( 4.0 ); ```javascript -var isComposite = require( '@stdlib/math/base/assert/is-composite' ); +const isComposite = require( '@stdlib/math/base/assert/is-composite' ); -var bool = isComposite( 4.0 ); +let bool = isComposite( 4.0 ); // returns true bool = isComposite( 7.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-coprime/README.md b/lib/node_modules/@stdlib/math/base/assert/is-coprime/README.md index 9ef94a1cafa2..8ca9783fb0b3 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-coprime/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-coprime/README.md @@ -35,7 +35,7 @@ Two integers `a` and `b` are said to be **coprime** (or **relatively prime** or ## Usage ```javascript -var isCoprime = require( '@stdlib/math/base/assert/is-coprime' ); +const isCoprime = require( '@stdlib/math/base/assert/is-coprime' ); ``` #### isCoprime( a, b ) @@ -43,7 +43,7 @@ var isCoprime = require( '@stdlib/math/base/assert/is-coprime' ); Tests if two numbers are [coprime][coprime-integers]. ```javascript -var bool = isCoprime( 14.0, 15.0 ); +let bool = isCoprime( 14.0, 15.0 ); // returns true bool = isCoprime( 14.0, 21.0 ); @@ -67,9 +67,9 @@ bool = isCoprime( 14.0, 21.0 ); ```javascript -var isCoprime = require( '@stdlib/math/base/assert/is-coprime' ); +const isCoprime = require( '@stdlib/math/base/assert/is-coprime' ); -var bool = isCoprime( 5.0, 7.0 ); +let bool = isCoprime( 5.0, 7.0 ); // returns true bool = isCoprime( 5.0, 15.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-even/README.md b/lib/node_modules/@stdlib/math/base/assert/is-even/README.md index 6b2ae2fac241..d63a8e603eea 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isEven = require( '@stdlib/math/base/assert/is-even' ); +const isEven = require( '@stdlib/math/base/assert/is-even' ); ``` #### isEven( x ) @@ -35,7 +35,7 @@ var isEven = require( '@stdlib/math/base/assert/is-even' ); Tests if a **finite** `numeric` value is an even number. ```javascript -var bool = isEven( 5.0 ); +let bool = isEven( 5.0 ); // returns false bool = isEven( -2.0 ); @@ -67,7 +67,7 @@ bool = isEven( NaN ); ); } - var bool = check( Infinity ); + let bool = check( Infinity ); // returns false bool = check( -Infinity ); @@ -85,17 +85,13 @@ bool = isEven( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var isEven = require( '@stdlib/math/base/assert/is-even' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const isEven = require( '@stdlib/math/base/assert/is-even' ); -var bool; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ); - bool = isEven( x ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ); + const bool = isEven( x ); console.log( '%d is %s', x, ( bool ) ? 'even' : 'not even' ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-finite/README.md index 74545b7d9613..d64e732e85e6 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isfinite = require( '@stdlib/math/base/assert/is-finite' ); +const isfinite = require( '@stdlib/math/base/assert/is-finite' ); ``` #### isfinite( x ) @@ -35,7 +35,7 @@ var isfinite = require( '@stdlib/math/base/assert/is-finite' ); Tests if a double-precision floating-point `numeric` value is finite. ```javascript -var bool = isfinite( 3.14 ); +let bool = isfinite( 3.14 ); // returns true bool = isfinite( Infinity ); @@ -59,11 +59,11 @@ bool = isfinite( NaN ); ```javascript -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isfinite = require( '@stdlib/math/base/assert/is-finite' ); +const PINF = require( '@stdlib/constants/float64/pinf' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); +const isfinite = require( '@stdlib/math/base/assert/is-finite' ); -var bool = isfinite( 5.0 ); +let bool = isfinite( 5.0 ); // returns true bool = isfinite( -2.0e64 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/README.md b/lib/node_modules/@stdlib/math/base/assert/is-finitef/README.md index fa0d55440103..58904199da78 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isfinitef = require( '@stdlib/math/base/assert/is-finitef' ); +const isfinitef = require( '@stdlib/math/base/assert/is-finitef' ); ``` #### isfinitef( x ) @@ -35,7 +35,7 @@ var isfinitef = require( '@stdlib/math/base/assert/is-finitef' ); Tests if a single-precision floating-point `numeric` value is finite. ```javascript -var bool = isfinitef( 3.14 ); +let bool = isfinitef( 3.14 ); // returns true bool = isfinitef( Infinity ); @@ -59,11 +59,11 @@ bool = isfinitef( NaN ); ```javascript -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isfinitef = require( '@stdlib/math/base/assert/is-finitef' ); +const PINF = require( '@stdlib/constants/float32/pinf' ); +const NINF = require( '@stdlib/constants/float32/ninf' ); +const isfinitef = require( '@stdlib/math/base/assert/is-finitef' ); -var bool = isfinitef( 5.0 ); +let bool = isfinitef( 5.0 ); // returns true bool = isfinitef( -2.0e32 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-infinite/README.md index 6a3720b9d2e9..b828615bd827 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); +const isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); ``` #### isInfinite( x ) @@ -35,7 +35,7 @@ var isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); Tests if a double-precision floating-point `numeric` value is infinite. ```javascript -var bool = isInfinite( Infinity ); +let bool = isInfinite( Infinity ); // returns true bool = isInfinite( -Infinity ); @@ -53,11 +53,11 @@ bool = isInfinite( -Infinity ); ```javascript -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); +const PINF = require( '@stdlib/constants/float64/pinf' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); +const isInfinite = require( '@stdlib/math/base/assert/is-infinite' ); -var bool = isInfinite( PINF ); +let bool = isInfinite( PINF ); // returns true bool = isInfinite( NINF ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/README.md b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/README.md index f7b28b26ec6e..a3ed9663cafc 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' ); +const isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' ); ``` #### isInfinitef( x ) @@ -35,7 +35,7 @@ var isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' ); Tests if a single-precision floating-point `numeric` value is infinite. ```javascript -var bool = isInfinitef( Infinity ); +let bool = isInfinitef( Infinity ); // returns true bool = isInfinitef( -Infinity ); @@ -53,11 +53,11 @@ bool = isInfinitef( -Infinity ); ```javascript -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' ); +const PINF = require( '@stdlib/constants/float32/pinf' ); +const NINF = require( '@stdlib/constants/float32/ninf' ); +const isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' ); -var bool = isInfinitef( PINF ); +let bool = isInfinitef( PINF ); // returns true bool = isInfinitef( NINF ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-integer/README.md index 3823622d0e81..adafa90e9005 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isInteger = require( '@stdlib/math/base/assert/is-integer' ); +const isInteger = require( '@stdlib/math/base/assert/is-integer' ); ``` #### isInteger( x ) @@ -35,7 +35,7 @@ var isInteger = require( '@stdlib/math/base/assert/is-integer' ); Tests if a finite [double-precision floating-point number][ieee754] is an integer. ```javascript -var bool = isInteger( 1.0 ); +const bool = isInteger( 1.0 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = isInteger( 1.0 ); ); } - var bool = check( Infinity ); + let bool = check( Infinity ); // returns false bool = check( -Infinity ); @@ -76,9 +76,9 @@ var bool = isInteger( 1.0 ); ```javascript -var isInteger = require( '@stdlib/math/base/assert/is-integer' ); +const isInteger = require( '@stdlib/math/base/assert/is-integer' ); -var bool = isInteger( -5.0 ); +let bool = isInteger( -5.0 ); // returns true bool = isInteger( 3.14 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integerf/README.md b/lib/node_modules/@stdlib/math/base/assert/is-integerf/README.md index a2e3a5780908..f82ddccbb417 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integerf/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-integerf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isIntegerf = require( '@stdlib/math/base/assert/is-integerf' ); +const isIntegerf = require( '@stdlib/math/base/assert/is-integerf' ); ``` #### isIntegerf( x ) @@ -35,7 +35,7 @@ var isIntegerf = require( '@stdlib/math/base/assert/is-integerf' ); Tests if a finite [single-precision floating-point number][ieee754] is an integer. ```javascript -var bool = isIntegerf( 1.0 ); +const bool = isIntegerf( 1.0 ); // returns true ``` @@ -58,7 +58,7 @@ var bool = isIntegerf( 1.0 ); ); } - var bool = check( Infinity ); + let bool = check( Infinity ); // returns false bool = check( -Infinity ); @@ -76,9 +76,9 @@ var bool = isIntegerf( 1.0 ); ```javascript -var isIntegerf = require( '@stdlib/math/base/assert/is-integerf' ); +const isIntegerf = require( '@stdlib/math/base/assert/is-integerf' ); -var bool = isIntegerf( -5.0 ); +let bool = isIntegerf( -5.0 ); // returns true bool = isIntegerf( 3.14 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nan/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nan/README.md index fa4762584f29..f4fbbd8e6e59 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); ``` #### isnan( x ) @@ -35,7 +35,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); Tests if a double-precision floating-point `numeric` value is `NaN`. ```javascript -var bool = isnan( NaN ); +const bool = isnan( NaN ); // returns true ``` @@ -50,9 +50,9 @@ var bool = isnan( NaN ); ```javascript -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +const isnan = require( '@stdlib/math/base/assert/is-nan' ); -var bool = isnan( NaN ); +let bool = isnan( NaN ); // returns true bool = isnan( 5.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nanf/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nanf/README.md index 504b428b8ff2..b9adaa84c66e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +const isnanf = require( '@stdlib/math/base/assert/is-nanf' ); ``` #### isnanf( x ) @@ -35,7 +35,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); Tests if a single-precision floating-point `numeric` value is `NaN`. ```javascript -var bool = isnanf( NaN ); +const bool = isnanf( NaN ); // returns true ``` @@ -50,9 +50,9 @@ var bool = isnanf( NaN ); ```javascript -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +const isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var bool = isnanf( NaN ); +let bool = isnanf( NaN ); // returns true bool = isnanf( 5.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md index 6421879b6583..e033996a37e5 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeFinite = require( '@stdlib/math/base/assert/is-negative-finite' ); +const isNegativeFinite = require( '@stdlib/math/base/assert/is-negative-finite' ); ``` #### isNegativeFinite( x ) @@ -35,7 +35,7 @@ var isNegativeFinite = require( '@stdlib/math/base/assert/is-negative-finite' ); Tests if a double-precision floating-point `numeric` value is a negative finite number. ```javascript -var bool = isNegativeFinite( -3.14 ); +let bool = isNegativeFinite( -3.14 ); // returns true bool = isNegativeFinite( 2.0 ); @@ -59,9 +59,9 @@ bool = isNegativeFinite( 2.0 ); ```javascript -var isNegativeFinite = require( '@stdlib/math/base/assert/is-negative-finite' ); +const isNegativeFinite = require( '@stdlib/math/base/assert/is-negative-finite' ); -var bool = isNegativeFinite( -3.14 ); +let bool = isNegativeFinite( -3.14 ); // returns true bool = isNegativeFinite( 3.14 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-negative-integer/README.md index 5c2c0f3aafed..e1b0f58b55bd 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' ); +const isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' ); ``` #### isNegativeInteger( x ) @@ -35,7 +35,7 @@ var isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' Tests if a finite [double-precision floating-point number][ieee754] is a negative `integer`. ```javascript -var bool = isNegativeInteger( -1.0 ); +let bool = isNegativeInteger( -1.0 ); // returns true bool = isNegativeInteger( 0.0 ); @@ -63,7 +63,7 @@ bool = isNegativeInteger( 10.0 ); ); } - var bool = check( -Infinity ); + const bool = check( -Infinity ); // returns false ``` @@ -78,9 +78,9 @@ bool = isNegativeInteger( 10.0 ); ```javascript -var isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' ); +const isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' ); -var bool = isNegativeInteger( -5.0 ); +let bool = isNegativeInteger( -5.0 ); // returns true bool = isNegativeInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/README.md b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/README.md index a3022b567e9b..57ac3139043e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); +const isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); ``` #### isNegativeZero( x ) @@ -35,7 +35,7 @@ var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); Tests if a double-precision floating-point `numeric` value is negative zero. ```javascript -var bool = isNegativeZero( -0.0 ); +let bool = isNegativeZero( -0.0 ); // returns true bool = isNegativeZero( 0.0 ); @@ -53,9 +53,9 @@ bool = isNegativeZero( 0.0 ); ```javascript -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); +const isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var bool = isNegativeZero( -0.0 ); +let bool = isNegativeZero( -0.0 ); // returns true bool = isNegativeZero( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/README.md b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/README.md index c408c712d8f6..9fabab1c40eb 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); +const isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); ``` #### isNegativeZerof( x ) @@ -35,7 +35,7 @@ var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); Tests if a single-precision floating-point `numeric` value is negative zero. ```javascript -var bool = isNegativeZerof( -0.0 ); +let bool = isNegativeZerof( -0.0 ); // returns true bool = isNegativeZerof( 0.0 ); @@ -53,9 +53,9 @@ bool = isNegativeZerof( 0.0 ); ```javascript -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); +const isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); -var bool = isNegativeZerof( -0.0 ); +let bool = isNegativeZerof( -0.0 ); // returns true bool = isNegativeZerof( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/README.md index f2dc444ef93f..697096539de6 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeFinite = require( '@stdlib/math/base/assert/is-nonnegative-finite' ); +const isNonNegativeFinite = require( '@stdlib/math/base/assert/is-nonnegative-finite' ); ``` #### isNonNegativeFinite( x ) @@ -35,7 +35,7 @@ var isNonNegativeFinite = require( '@stdlib/math/base/assert/is-nonnegative-fini Tests if a `numeric` value is a nonnegative finite number. ```javascript -var bool = isNonNegativeFinite( 3.14 ); +let bool = isNonNegativeFinite( 3.14 ); // returns true bool = isNonNegativeFinite( -2.0 ); @@ -59,9 +59,9 @@ bool = isNonNegativeFinite( -2.0 ); ```javascript -var isNonNegativeFinite = require( '@stdlib/math/base/assert/is-nonnegative-finite' ); +const isNonNegativeFinite = require( '@stdlib/math/base/assert/is-nonnegative-finite' ); -var bool = isNonNegativeFinite( 5.0 ); +let bool = isNonNegativeFinite( 5.0 ); // returns true bool = isNonNegativeFinite( 3.14 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/README.md index bdaadc5523a0..c9ce59c8f484 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); +const isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); ``` #### isNonNegativeInteger( x ) @@ -35,7 +35,7 @@ var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-int Tests if a finite [double-precision floating-point number][ieee754] is a nonnegative integer. ```javascript -var bool = isNonNegativeInteger( 1.0 ); +let bool = isNonNegativeInteger( 1.0 ); // returns true bool = isNonNegativeInteger( 0.0 ); @@ -63,14 +63,14 @@ bool = isNonNegativeInteger( -10.0 ); ); } - var bool = check( Infinity ); + const bool = check( Infinity ); // returns false ``` - The function does **not** distinguish between positive and negative `zero`. ```javascript - var bool = isNonNegativeInteger( 0.0 ); + let bool = isNonNegativeInteger( 0.0 ); // returns true bool = isNonNegativeInteger( -0.0 ); @@ -88,9 +88,9 @@ bool = isNonNegativeInteger( -10.0 ); ```javascript -var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); +const isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); -var bool = isNonNegativeInteger( 5.0 ); +let bool = isNonNegativeInteger( 5.0 ); // returns true bool = isNonNegativeInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integerf/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integerf/README.md index 6958a8adcf88..3a5a0c33f969 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integerf/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-integerf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonNegativeIntegerf = require( '@stdlib/math/base/assert/is-nonnegative-integerf' ); +const isNonNegativeIntegerf = require( '@stdlib/math/base/assert/is-nonnegative-integerf' ); ``` #### isNonNegativeIntegerf( x ) @@ -35,7 +35,7 @@ var isNonNegativeIntegerf = require( '@stdlib/math/base/assert/is-nonnegative-in Tests if a finite [single-precision floating-point number][ieee754] is a nonnegative integer. ```javascript -var bool = isNonNegativeIntegerf( 1.0 ); +let bool = isNonNegativeIntegerf( 1.0 ); // returns true bool = isNonNegativeIntegerf( 0.0 ); @@ -63,14 +63,14 @@ bool = isNonNegativeIntegerf( -10.0 ); ); } - var bool = check( Infinity ); + const bool = check( Infinity ); // returns false ``` - The function does **not** distinguish between positive and negative `zero`. ```javascript - var bool = isNonNegativeIntegerf( 0.0 ); + let bool = isNonNegativeIntegerf( 0.0 ); // returns true bool = isNonNegativeIntegerf( -0.0 ); @@ -88,9 +88,9 @@ bool = isNonNegativeIntegerf( -10.0 ); ```javascript -var isNonNegativeIntegerf = require( '@stdlib/math/base/assert/is-nonnegative-integerf' ); +const isNonNegativeIntegerf = require( '@stdlib/math/base/assert/is-nonnegative-integerf' ); -var bool = isNonNegativeIntegerf( 5.0 ); +let bool = isNonNegativeIntegerf( 5.0 ); // returns true bool = isNonNegativeIntegerf( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-finite/README.md index fbc57c28d95d..221d73d80430 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveFinite = require( '@stdlib/math/base/assert/is-nonpositive-finite' ); +const isNonPositiveFinite = require( '@stdlib/math/base/assert/is-nonpositive-finite' ); ``` #### isNonPositiveFinite( x ) @@ -35,7 +35,7 @@ var isNonPositiveFinite = require( '@stdlib/math/base/assert/is-nonpositive-fini Tests if a `numeric` value is a nonpositive finite number. ```javascript -var bool = isNonPositiveFinite( -3.14 ); +let bool = isNonPositiveFinite( -3.14 ); // returns true bool = isNonPositiveFinite( 2.0 ); @@ -59,9 +59,9 @@ bool = isNonPositiveFinite( 2.0 ); ```javascript -var isNonPositiveFinite = require( '@stdlib/math/base/assert/is-nonpositive-finite' ); +const isNonPositiveFinite = require( '@stdlib/math/base/assert/is-nonpositive-finite' ); -var bool = isNonPositiveFinite( -3.14 ); +let bool = isNonPositiveFinite( -3.14 ); // returns true bool = isNonPositiveFinite( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-integer/README.md index 1b6f2c8b7897..0945d59ca540 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonpositive-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isNonPositiveInteger = require( '@stdlib/math/base/assert/is-nonpositive-integer' ); +const isNonPositiveInteger = require( '@stdlib/math/base/assert/is-nonpositive-integer' ); ``` #### isNonPositiveInteger( x ) @@ -35,7 +35,7 @@ var isNonPositiveInteger = require( '@stdlib/math/base/assert/is-nonpositive-int Tests if a finite [double-precision floating-point number][ieee754] is a nonpositive `integer`. ```javascript -var bool = isNonPositiveInteger( -1.0 ); +let bool = isNonPositiveInteger( -1.0 ); // returns true bool = isNonPositiveInteger( 0.0 ); @@ -63,14 +63,14 @@ bool = isNonPositiveInteger( 10.0 ); ); } - var bool = check( -Infinity ); + const bool = check( -Infinity ); // returns false ``` - The function does **not** distinguish between positive and negative `zero`. ```javascript - var bool = isNonPositiveInteger( 0.0 ); + let bool = isNonPositiveInteger( 0.0 ); // returns true bool = isNonPositiveInteger( -0.0 ); @@ -88,9 +88,9 @@ bool = isNonPositiveInteger( 10.0 ); ```javascript -var isNonPositiveInteger = require( '@stdlib/math/base/assert/is-nonpositive-integer' ); +const isNonPositiveInteger = require( '@stdlib/math/base/assert/is-nonpositive-integer' ); -var bool = isNonPositiveInteger( -5.0 ); +let bool = isNonPositiveInteger( -5.0 ); // returns true bool = isNonPositiveInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-odd/README.md b/lib/node_modules/@stdlib/math/base/assert/is-odd/README.md index ed74decb478c..38a07df7f95a 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-odd/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-odd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isOdd = require( '@stdlib/math/base/assert/is-odd' ); +const isOdd = require( '@stdlib/math/base/assert/is-odd' ); ``` #### isOdd( x ) @@ -35,7 +35,7 @@ var isOdd = require( '@stdlib/math/base/assert/is-odd' ); Tests if a **finite** double-precision floating-point number is an odd number. ```javascript -var bool = isOdd( 5.0 ); +let bool = isOdd( 5.0 ); // returns true bool = isOdd( -2.0 ); @@ -67,7 +67,7 @@ bool = isOdd( NaN ); ); } - var bool = check( Infinity ); + let bool = check( Infinity ); // returns false bool = check( -Infinity ); @@ -85,17 +85,12 @@ bool = isOdd( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var isOdd = require( '@stdlib/math/base/assert/is-odd' ); - -var bool; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ); - bool = isOdd( x ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const isOdd = require( '@stdlib/math/base/assert/is-odd' ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ); + const bool = isOdd( x ); console.log( '%d is %s', x, ( bool ) ? 'odd' : 'not odd' ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/is-positive-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-positive-finite/README.md index 04a4d71e68b7..d003c14dd539 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-positive-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-positive-finite/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveFinite = require( '@stdlib/math/base/assert/is-positive-finite' ); +const isPositiveFinite = require( '@stdlib/math/base/assert/is-positive-finite' ); ``` #### isPositiveFinite( x ) @@ -35,7 +35,7 @@ var isPositiveFinite = require( '@stdlib/math/base/assert/is-positive-finite' ); Tests if a double-precision floating-point `numeric` value is a positive finite number. ```javascript -var bool = isPositiveFinite( 3.14 ); +let bool = isPositiveFinite( 3.14 ); // returns true bool = isPositiveFinite( -2.0 ); @@ -59,9 +59,9 @@ bool = isPositiveFinite( -2.0 ); ```javascript -var isPositiveFinite = require( '@stdlib/math/base/assert/is-positive-finite' ); +const isPositiveFinite = require( '@stdlib/math/base/assert/is-positive-finite' ); -var bool = isPositiveFinite( 3.14 ); +let bool = isPositiveFinite( 3.14 ); // returns true bool = isPositiveFinite( -2.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-positive-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-positive-integer/README.md index 598d47d7fa62..e7a938fd6f56 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-positive-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-positive-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' ); +const isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' ); ``` #### isPositiveInteger( x ) @@ -35,7 +35,7 @@ var isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' Tests if a finite [double-precision floating-point number][ieee754] is a positive `integer`. ```javascript -var bool = isPositiveInteger( 1.0 ); +let bool = isPositiveInteger( 1.0 ); // returns true bool = isPositiveInteger( 0.0 ); @@ -63,7 +63,7 @@ bool = isPositiveInteger( -10.0 ); ); } - var bool = check( Infinity ); + const bool = check( Infinity ); // returns false ``` @@ -78,9 +78,9 @@ bool = isPositiveInteger( -10.0 ); ```javascript -var isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' ); +const isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' ); -var bool = isPositiveInteger( 5.0 ); +let bool = isPositiveInteger( 5.0 ); // returns true bool = isPositiveInteger( 0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-positive-zero/README.md b/lib/node_modules/@stdlib/math/base/assert/is-positive-zero/README.md index 42ccf94dc9d6..575b20171239 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-positive-zero/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-positive-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); +const isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); ``` #### isPositiveZero( x ) @@ -35,7 +35,7 @@ var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); Tests if a double-precision floating-point `numeric` value is positive zero. ```javascript -var bool = isPositiveZero( 0.0 ); +let bool = isPositiveZero( 0.0 ); // returns true bool = isPositiveZero( -0.0 ); @@ -53,9 +53,9 @@ bool = isPositiveZero( -0.0 ); ```javascript -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); +const isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var bool = isPositiveZero( 0.0 ); +let bool = isPositiveZero( 0.0 ); // returns true bool = isPositiveZero( -0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-positive-zerof/README.md b/lib/node_modules/@stdlib/math/base/assert/is-positive-zerof/README.md index a3d86f607232..c360d11afd3d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-positive-zerof/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-positive-zerof/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); +const isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); ``` #### isPositiveZerof( x ) @@ -35,7 +35,7 @@ var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); Tests if a single-precision floating-point `numeric` value is positive zero. ```javascript -var bool = isPositiveZerof( 0.0 ); +let bool = isPositiveZerof( 0.0 ); // returns true bool = isPositiveZerof( -0.0 ); @@ -53,9 +53,9 @@ bool = isPositiveZerof( -0.0 ); ```javascript -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); +const isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); -var bool = isPositiveZerof( 0.0 ); +let bool = isPositiveZerof( 0.0 ); // returns true bool = isPositiveZerof( -0.0 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-prime/README.md b/lib/node_modules/@stdlib/math/base/assert/is-prime/README.md index c6de58a6fdde..67d7ba85eac1 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-prime/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-prime/README.md @@ -35,7 +35,7 @@ A **prime number** is defined as an integer value greater than `1` which is only ## Usage ```javascript -var isPrime = require( '@stdlib/math/base/assert/is-prime' ); +const isPrime = require( '@stdlib/math/base/assert/is-prime' ); ``` #### isPrime( x ) @@ -43,7 +43,7 @@ var isPrime = require( '@stdlib/math/base/assert/is-prime' ); Tests if a number is a prime. ```javascript -var bool = isPrime( 7.0 ); +const bool = isPrime( 7.0 ); // returns true ``` @@ -64,9 +64,9 @@ var bool = isPrime( 7.0 ); ```javascript -var isPrime = require( '@stdlib/math/base/assert/is-prime' ); +const isPrime = require( '@stdlib/math/base/assert/is-prime' ); -var bool = isPrime( 11.0 ); +let bool = isPrime( 11.0 ); // returns true bool = isPrime( 3.14 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-probability/README.md b/lib/node_modules/@stdlib/math/base/assert/is-probability/README.md index c3bd4e5641e9..ceb4c8be80c8 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-probability/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-probability/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isProbability = require( '@stdlib/math/base/assert/is-probability' ); +const isProbability = require( '@stdlib/math/base/assert/is-probability' ); ``` #### isProbability( x ) @@ -35,7 +35,7 @@ var isProbability = require( '@stdlib/math/base/assert/is-probability' ); Tests if a double-precision floating-point number is a probability. ```javascript -var bool = isProbability( 0.5 ); +let bool = isProbability( 0.5 ); // returns true bool = isProbability( 3.14 ); @@ -56,16 +56,12 @@ bool = isProbability( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var isProbability = require( '@stdlib/math/base/assert/is-probability' ); +const randu = require( '@stdlib/random/base/randu' ); +const isProbability = require( '@stdlib/math/base/assert/is-probability' ); -var bool; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*2.0 ) - 1.0; - bool = isProbability( x ); +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*2.0 ) - 1.0; + const bool = isProbability( x ); console.log( '%d is %s', x, ( bool ) ? 'a probability' : 'not a probability' ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/assert/is-safe-integer/README.md b/lib/node_modules/@stdlib/math/base/assert/is-safe-integer/README.md index 185236c160a6..994b547747c0 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-safe-integer/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-safe-integer/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSafeInteger = require( '@stdlib/math/base/assert/is-safe-integer' ); +const isSafeInteger = require( '@stdlib/math/base/assert/is-safe-integer' ); ``` #### isSafeInteger( x ) @@ -35,7 +35,7 @@ var isSafeInteger = require( '@stdlib/math/base/assert/is-safe-integer' ); Tests if a finite [double-precision floating-point number][ieee754] is a safe `integer`. ```javascript -var bool = isSafeInteger( 1.0 ); +const bool = isSafeInteger( 1.0 ); // returns true ``` @@ -50,16 +50,16 @@ var bool = isSafeInteger( 1.0 ); - An integer valued number is "safe" when the number can be exactly represented as a [double-precision floating-point number][ieee754]. For example, ```javascript - var MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); + const MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' ); // returns 9007199254740991 - var x = 9007199254740992; + const x = 9007199254740992; // returns 9007199254740992 - var y = 9007199254740993; + const y = 9007199254740993; // returns 9007199254740992 - var bool = ( x === y ); + const bool = ( x === y ); // returns true ``` @@ -76,9 +76,9 @@ var bool = isSafeInteger( 1.0 ); ```javascript -var isSafeInteger = require( '@stdlib/math/base/assert/is-safe-integer' ); +const isSafeInteger = require( '@stdlib/math/base/assert/is-safe-integer' ); -var bool = isSafeInteger( -5.0 ); +let bool = isSafeInteger( -5.0 ); // returns true bool = isSafeInteger( 2.0e200 ); diff --git a/lib/node_modules/@stdlib/math/base/assert/uint32-is-pow2/README.md b/lib/node_modules/@stdlib/math/base/assert/uint32-is-pow2/README.md index 485c1fd32db4..807829dccd00 100644 --- a/lib/node_modules/@stdlib/math/base/assert/uint32-is-pow2/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/uint32-is-pow2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isPow2Uint32 = require( '@stdlib/math/base/assert/uint32-is-pow2' ); +const isPow2Uint32 = require( '@stdlib/math/base/assert/uint32-is-pow2' ); ``` #### isPow2Uint32( x ) @@ -35,7 +35,7 @@ var isPow2Uint32 = require( '@stdlib/math/base/assert/uint32-is-pow2' ); Tests whether `x` is a power of 2. ```javascript -var bool = isPow2Uint32( 2 ); +let bool = isPow2Uint32( 2 ); // returns true bool = isPow2Uint32( 5 ); @@ -59,11 +59,9 @@ bool = isPow2Uint32( 5 ); ```javascript -var isPow2Uint32 = require( '@stdlib/math/base/assert/uint32-is-pow2' ); +const isPow2Uint32 = require( '@stdlib/math/base/assert/uint32-is-pow2' ); -var i; - -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( 'isPow2( %d ) = %s', i, isPow2Uint32( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/napi/README.md b/lib/node_modules/@stdlib/math/base/napi/README.md index 00808ad8ba9b..bd22d69212d8 100644 --- a/lib/node_modules/@stdlib/math/base/napi/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/base/napi' ); +const ns = require( '@stdlib/math/base/napi' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/base/napi' ); Namespace for C APIs for registering a Node-API module exporting interfaces. ```javascript -var napi = ns; +const napi = ns; // returns {...} ``` @@ -68,8 +68,8 @@ The namespace contains the following packages: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/base/napi' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/base/napi' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/napi/binary/README.md b/lib/node_modules/@stdlib/math/base/napi/binary/README.md index 884541964c0b..add06cd6f22d 100644 --- a/lib/node_modules/@stdlib/math/base/napi/binary/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/binary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/math/base/napi/binary' ); +const headerDir = require( '@stdlib/math/base/napi/binary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/math/base/napi/binary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/math/base/napi/binary' ); +const headerDir = require( '@stdlib/math/base/napi/binary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/math/base/napi/quaternary/README.md b/lib/node_modules/@stdlib/math/base/napi/quaternary/README.md index f30e652ac7e2..51bf31a7a7b5 100644 --- a/lib/node_modules/@stdlib/math/base/napi/quaternary/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/quaternary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/math/base/napi/quaternary' ); +const headerDir = require( '@stdlib/math/base/napi/quaternary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/math/base/napi/quaternary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/math/base/napi/quaternary' ); +const headerDir = require( '@stdlib/math/base/napi/quaternary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/math/base/napi/quinary/README.md b/lib/node_modules/@stdlib/math/base/napi/quinary/README.md index 66ec59bdb3c0..073f055587c9 100644 --- a/lib/node_modules/@stdlib/math/base/napi/quinary/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/quinary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/math/base/napi/quinary' ); +const headerDir = require( '@stdlib/math/base/napi/quinary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/math/base/napi/quinary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/math/base/napi/quinary' ); +const headerDir = require( '@stdlib/math/base/napi/quinary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/math/base/napi/ternary/README.md b/lib/node_modules/@stdlib/math/base/napi/ternary/README.md index 4dca5fb065f2..95bd61c6baa4 100644 --- a/lib/node_modules/@stdlib/math/base/napi/ternary/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/ternary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/math/base/napi/ternary' ); +const headerDir = require( '@stdlib/math/base/napi/ternary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/math/base/napi/ternary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/math/base/napi/ternary' ); +const headerDir = require( '@stdlib/math/base/napi/ternary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/math/base/napi/unary/README.md b/lib/node_modules/@stdlib/math/base/napi/unary/README.md index 83918fe74e6c..2646806e35f7 100644 --- a/lib/node_modules/@stdlib/math/base/napi/unary/README.md +++ b/lib/node_modules/@stdlib/math/base/napi/unary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/math/base/napi/unary' ); +const headerDir = require( '@stdlib/math/base/napi/unary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/math/base/napi/unary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/math/base/napi/unary' ); +const headerDir = require( '@stdlib/math/base/napi/unary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/math/base/ops/README.md b/lib/node_modules/@stdlib/math/base/ops/README.md index 5c82bca38cc6..95f249396a55 100644 --- a/lib/node_modules/@stdlib/math/base/ops/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/base/ops' ); +const ns = require( '@stdlib/math/base/ops' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/base/ops' ); Namespace for "base" (i.e., lower-level) math operators. ```javascript -var operators = ns; +const operators = ns; // returns {...} ``` @@ -83,8 +83,8 @@ The namespace contains the following functions: ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var ns = require( '@stdlib/math/base/ops' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const ns = require( '@stdlib/math/base/ops' ); // Operations for double-precision floating point numbers: console.log( ns.add( 1.25, 0.45 ) ); @@ -101,8 +101,8 @@ console.log( ns.divf( 1.2, 0.4 ) ); // => 3.0 // Operations for complex numbers: -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( -2.0, 1.0 ); console.log( ns.cmul( z1, z2 ) ); // { 're': -13.0, 'im': -1.0 } // => diff --git a/lib/node_modules/@stdlib/math/base/ops/add/README.md b/lib/node_modules/@stdlib/math/base/ops/add/README.md index 42af16729b88..2f78f7c2e0b6 100644 --- a/lib/node_modules/@stdlib/math/base/ops/add/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/add/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); ``` #### add( x, y ) @@ -45,7 +45,7 @@ var add = require( '@stdlib/math/base/ops/add' ); Computes the sum of two double-precision floating-point numbers. ```javascript -var v = add( -1.0, 5.0 ); +let v = add( -1.0, 5.0 ); // returns 4.0 v = add( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = add( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var add = require( '@stdlib/math/base/ops/add' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d + %d = %d', x, y, add( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/add3/README.md b/lib/node_modules/@stdlib/math/base/ops/add3/README.md index f8d1e5e5aa15..2583104d8002 100644 --- a/lib/node_modules/@stdlib/math/base/ops/add3/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/add3/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var add3 = require( '@stdlib/math/base/ops/add3' ); +const add3 = require( '@stdlib/math/base/ops/add3' ); ``` #### add3( x, y, z ) @@ -45,7 +45,7 @@ var add3 = require( '@stdlib/math/base/ops/add3' ); Computes the sum of three double-precision floating-point numbers. ```javascript -var v = add3( -1.0, 5.0, 2.0 ); +let v = add3( -1.0, 5.0, 2.0 ); // returns 6.0 v = add3( 2.0, 5.0, 2.0 ); @@ -82,16 +82,15 @@ v = add3( NaN, NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledBy = require( '@stdlib/array/base/filled-by' ); -var add3 = require( '@stdlib/math/base/ops/add3' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledBy = require( '@stdlib/array/base/filled-by' ); +const add3 = require( '@stdlib/math/base/ops/add3' ); -var x = filledBy( 100, rand( -50, 50 ) ); -var y = filledBy( x.length, rand( -50, 50 ) ); -var z = filledBy( x.length, rand( -50, 50 ) ); +const x = filledBy( 100, rand( -50, 50 ) ); +const y = filledBy( x.length, rand( -50, 50 ) ); +const z = filledBy( x.length, rand( -50, 50 ) ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( '%d + %d + %d = %d', x[i], y[i], z[i], add3( x[i], y[i], z[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/add4/README.md b/lib/node_modules/@stdlib/math/base/ops/add4/README.md index 2460a4cf1474..ed7eb53a4fbb 100644 --- a/lib/node_modules/@stdlib/math/base/ops/add4/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/add4/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var add4 = require( '@stdlib/math/base/ops/add4' ); +const add4 = require( '@stdlib/math/base/ops/add4' ); ``` #### add4( x, y, z, w ) @@ -45,7 +45,7 @@ var add4 = require( '@stdlib/math/base/ops/add4' ); Computes the sum of four double-precision floating-point numbers. ```javascript -var v = add4( -1.0, 5.0, 2.0, -3.0 ); +let v = add4( -1.0, 5.0, 2.0, -3.0 ); // returns 3.0 v = add4( 2.0, 5.0, 2.0, -3.0 ); @@ -82,17 +82,16 @@ v = add4( NaN, NaN, NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledBy = require( '@stdlib/array/base/filled-by' ); -var add4 = require( '@stdlib/math/base/ops/add4' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledBy = require( '@stdlib/array/base/filled-by' ); +const add4 = require( '@stdlib/math/base/ops/add4' ); -var x = filledBy( 100, rand( -50, 50 ) ); -var y = filledBy( x.length, rand( -50, 50 ) ); -var z = filledBy( x.length, rand( -50, 50 ) ); -var w = filledBy( x.length, rand( -50, 50 ) ); +const x = filledBy( 100, rand( -50, 50 ) ); +const y = filledBy( x.length, rand( -50, 50 ) ); +const z = filledBy( x.length, rand( -50, 50 ) ); +const w = filledBy( x.length, rand( -50, 50 ) ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( '%d + %d + %d + %d = %d', x[i], y[i], z[i], w[i], add4( x[i], y[i], z[i], w[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/add5/README.md b/lib/node_modules/@stdlib/math/base/ops/add5/README.md index 46aecd606bd5..0a24bc5a7267 100644 --- a/lib/node_modules/@stdlib/math/base/ops/add5/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/add5/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var add5 = require( '@stdlib/math/base/ops/add5' ); +const add5 = require( '@stdlib/math/base/ops/add5' ); ``` #### add5( x, y, z, w, u ) @@ -45,7 +45,7 @@ var add5 = require( '@stdlib/math/base/ops/add5' ); Computes the sum of five double-precision floating-point numbers. ```javascript -var v = add5( -1.0, 5.0, 2.0, -3.0, 4.0 ); +let v = add5( -1.0, 5.0, 2.0, -3.0, 4.0 ); // returns 7.0 v = add5( 2.0, 5.0, 2.0, -3.0, 4.0 ); @@ -82,18 +82,17 @@ v = add5( NaN, NaN, NaN, NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledBy = require( '@stdlib/array/base/filled-by' ); -var add5 = require( '@stdlib/math/base/ops/add5' ); - -var x = filledBy( 100, rand( -50, 50 ) ); -var y = filledBy( x.length, rand( -50, 50 ) ); -var z = filledBy( x.length, rand( -50, 50 ) ); -var w = filledBy( x.length, rand( -50, 50 ) ); -var u = filledBy( x.length, rand( -50, 50 ) ); - -var i; -for ( i = 0; i < x.length; i++ ) { +const rand = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledBy = require( '@stdlib/array/base/filled-by' ); +const add5 = require( '@stdlib/math/base/ops/add5' ); + +const x = filledBy( 100, rand( -50, 50 ) ); +const y = filledBy( x.length, rand( -50, 50 ) ); +const z = filledBy( x.length, rand( -50, 50 ) ); +const w = filledBy( x.length, rand( -50, 50 ) ); +const u = filledBy( x.length, rand( -50, 50 ) ); + +for ( let i = 0; i < x.length; i++ ) { console.log( '%d + %d + %d + %d + %d = %d', x[i], y[i], z[i], w[i], u[i], add5( x[i], y[i], z[i], w[i], u[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/addf/README.md b/lib/node_modules/@stdlib/math/base/ops/addf/README.md index 00d3b5a47243..ec359b1dc767 100644 --- a/lib/node_modules/@stdlib/math/base/ops/addf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/addf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var addf = require( '@stdlib/math/base/ops/addf' ); +const addf = require( '@stdlib/math/base/ops/addf' ); ``` #### addf( x, y ) @@ -45,7 +45,7 @@ var addf = require( '@stdlib/math/base/ops/addf' ); Computes the sum of two single-precision floating-point numbers. ```javascript -var v = addf( -1.0, 5.0 ); +let v = addf( -1.0, 5.0 ); // returns 4.0 v = addf( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = addf( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d + %d = %d', x, y, addf( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/cdiv/README.md b/lib/node_modules/@stdlib/math/base/ops/cdiv/README.md index d0b4c4207d65..8f106b02093a 100644 --- a/lib/node_modules/@stdlib/math/base/ops/cdiv/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/cdiv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cdiv = require( '@stdlib/math/base/ops/cdiv' ); +const cdiv = require( '@stdlib/math/base/ops/cdiv' ); ``` #### cdiv( z1, z2 ) @@ -41,20 +41,20 @@ var cdiv = require( '@stdlib/math/base/ops/cdiv' ); Divides two double-precision complex floating-point numbers. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z1 = new Complex128( -13.0, -1.0 ); -var z2 = new Complex128( -2.0, 1.0 ); +const z1 = new Complex128( -13.0, -1.0 ); +const z2 = new Complex128( -2.0, 1.0 ); -var v = cdiv( z1, z2 ); +const v = cdiv( z1, z2 ); // returns -var re = real( v ); +const re = real( v ); // returns 5.0 -var im = imag( v ); +const im = imag( v ); // returns 3.0 ``` @@ -69,26 +69,22 @@ var im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cdiv = require( '@stdlib/math/base/ops/cdiv' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cdiv = require( '@stdlib/math/base/ops/cdiv' ); function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); + const re = discreteUniform( -50, 50 ); + const im = discreteUniform( -50, 50 ); return new Complex128( re, im ); } -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = randomComplex(); - z2 = randomComplex(); - z3 = cdiv( z1, z2 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = randomComplex(); + const z2 = randomComplex(); + const z3 = cdiv( z1, z2 ); console.log( '(%s) / (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/cneg/README.md b/lib/node_modules/@stdlib/math/base/ops/cneg/README.md index 6d006c8ba9dd..4ef7ee75bc9d 100644 --- a/lib/node_modules/@stdlib/math/base/ops/cneg/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/cneg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var cneg = require( '@stdlib/math/base/ops/cneg' ); +const cneg = require( '@stdlib/math/base/ops/cneg' ); ``` #### cneg( z ) @@ -45,19 +45,19 @@ var cneg = require( '@stdlib/math/base/ops/cneg' ); Negates a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z = new Complex128( -4.2, 5.5 ); +let z = new Complex128( -4.2, 5.5 ); -var out = cneg( z ); +let out = cneg( z ); // returns -var re = real( out ); +let re = real( out ); // returns 4.2 -var im = imag( out ); +let im = imag( out ); // returns -5.5 z = new Complex128( 0.0, 0.0 ); @@ -104,23 +104,19 @@ im = imag( out ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cneg = require( '@stdlib/math/base/ops/cneg' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const cneg = require( '@stdlib/math/base/ops/cneg' ); function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); + const re = discreteUniform( -50, 50 ); + const im = discreteUniform( -50, 50 ); return new Complex128( re, im ); } -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cneg( z ); +for ( let i = 0; i < 100; i++ ) { + const z = randomComplex(); + const o = cneg( z ); console.log( 'negate(%s) = %s', z.toString(), o.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/cnegf/README.md b/lib/node_modules/@stdlib/math/base/ops/cnegf/README.md index 5377f5e50d6e..754343d8d57e 100644 --- a/lib/node_modules/@stdlib/math/base/ops/cnegf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/cnegf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var cnegf = require( '@stdlib/math/base/ops/cnegf' ); +const cnegf = require( '@stdlib/math/base/ops/cnegf' ); ``` #### cnegf( z ) @@ -45,19 +45,19 @@ var cnegf = require( '@stdlib/math/base/ops/cnegf' ); Negates a single-precision complex floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var z = new Complex64( -4.0, 5.0 ); +let z = new Complex64( -4.0, 5.0 ); -var out = cnegf( z ); +let out = cnegf( z ); // returns -var re = realf( out ); +let re = realf( out ); // returns 4.0 -var im = imagf( out ); +let im = imagf( out ); // returns -5.0 z = new Complex64( 0.0, 0.0 ); @@ -104,23 +104,19 @@ im = imagf( out ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cnegf = require( '@stdlib/math/base/ops/cnegf' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const cnegf = require( '@stdlib/math/base/ops/cnegf' ); function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); + const re = discreteUniform( -50, 50 ); + const im = discreteUniform( -50, 50 ); return new Complex64( re, im ); } -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cnegf( z ); +for ( let i = 0; i < 100; i++ ) { + const z = randomComplex(); + const o = cnegf( z ); console.log( 'negate(%s) = %s', z.toString(), o.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/csub/README.md b/lib/node_modules/@stdlib/math/base/ops/csub/README.md index c67edba6df71..f43e539a74d2 100644 --- a/lib/node_modules/@stdlib/math/base/ops/csub/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/csub/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var csub = require( '@stdlib/math/base/ops/csub' ); +const csub = require( '@stdlib/math/base/ops/csub' ); ``` #### csub( z1, z2 ) @@ -41,20 +41,20 @@ var csub = require( '@stdlib/math/base/ops/csub' ); Subtracts two double-precision complex floating-point numbers. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); +const z1 = new Complex128( 5.0, 3.0 ); +const z2 = new Complex128( -2.0, 1.0 ); -var v = csub( z1, z2 ); +const v = csub( z1, z2 ); // returns -var re = real( v ); +const re = real( v ); // returns 7.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -69,21 +69,15 @@ var im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var csub = require( '@stdlib/math/base/ops/csub' ); - -var rand; -var z1; -var z2; -var z3; -var i; - -rand = discreteUniform( -50, 50 ); -for ( i = 0; i < 100; i++ ) { - z1 = new Complex128( rand(), rand() ); - z2 = new Complex128( rand(), rand() ); - z3 = csub( z1, z2 ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const csub = require( '@stdlib/math/base/ops/csub' ); + +const rand = discreteUniform( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex128( rand(), rand() ); + const z2 = new Complex128( rand(), rand() ); + const z3 = csub( z1, z2 ); console.log( '(%s) - (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/csubf/README.md b/lib/node_modules/@stdlib/math/base/ops/csubf/README.md index 94b7f96fb915..d8a5c4f3bfa9 100644 --- a/lib/node_modules/@stdlib/math/base/ops/csubf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/csubf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var csubf = require( '@stdlib/math/base/ops/csubf' ); +const csubf = require( '@stdlib/math/base/ops/csubf' ); ``` #### csubf( z1, z2 ) @@ -41,20 +41,20 @@ var csubf = require( '@stdlib/math/base/ops/csubf' ); Subtracts two single-precision complex floating-point numbers. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const realf = require( '@stdlib/complex/float32/real' ); +const imagf = require( '@stdlib/complex/float32/imag' ); -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( -2.0, 1.0 ); +const z1 = new Complex64( 5.0, 3.0 ); +const z2 = new Complex64( -2.0, 1.0 ); -var v = csubf( z1, z2 ); +const v = csubf( z1, z2 ); // returns -var re = realf( v ); +const re = realf( v ); // returns 7.0 -var im = imagf( v ); +const im = imagf( v ); // returns 2.0 ``` @@ -69,21 +69,15 @@ var im = imagf( v ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var csubf = require( '@stdlib/math/base/ops/csubf' ); - -var rand; -var z1; -var z2; -var z3; -var i; - -rand = discreteUniform( -50, 50 ); -for ( i = 0; i < 100; i++ ) { - z1 = new Complex64( rand(), rand() ); - z2 = new Complex64( rand(), rand() ); - z3 = csubf( z1, z2 ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const csubf = require( '@stdlib/math/base/ops/csubf' ); + +const rand = discreteUniform( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex64( rand(), rand() ); + const z2 = new Complex64( rand(), rand() ); + const z3 = csubf( z1, z2 ); console.log( '(%s) - (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/div/README.md b/lib/node_modules/@stdlib/math/base/ops/div/README.md index bc2f5d41eb51..60e22f48664c 100644 --- a/lib/node_modules/@stdlib/math/base/ops/div/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/div/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var div = require( '@stdlib/math/base/ops/div' ); +const div = require( '@stdlib/math/base/ops/div' ); ``` #### div( x, y ) @@ -45,7 +45,7 @@ var div = require( '@stdlib/math/base/ops/div' ); Divides two double-precision floating-point numbers. ```javascript -var v = div( -1.0, 5.0 ); +let v = div( -1.0, 5.0 ); // returns -0.2 v = div( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = div( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var div = require( '@stdlib/math/base/ops/div' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const div = require( '@stdlib/math/base/ops/div' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d / %d = %d', x, y, div( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/divf/README.md b/lib/node_modules/@stdlib/math/base/ops/divf/README.md index 610fbc86a70d..aa5f0a1e6754 100644 --- a/lib/node_modules/@stdlib/math/base/ops/divf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/divf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var divf = require( '@stdlib/math/base/ops/divf' ); +const divf = require( '@stdlib/math/base/ops/divf' ); ``` #### divf( x, y ) @@ -45,7 +45,7 @@ var divf = require( '@stdlib/math/base/ops/divf' ); Divides two single-precision floating-point numbers. ```javascript -var v = divf( -1.0, 5.0 ); +let v = divf( -1.0, 5.0 ); // returns ~-0.2 v = divf( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = divf( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var divf = require( '@stdlib/math/base/ops/divf' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const divf = require( '@stdlib/math/base/ops/divf' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d / %d = %d', x, y, divf( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/imul/README.md b/lib/node_modules/@stdlib/math/base/ops/imul/README.md index b5f7cadd6391..0d5a4c5d635b 100644 --- a/lib/node_modules/@stdlib/math/base/ops/imul/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/imul/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var imul = require( '@stdlib/math/base/ops/imul' ); +const imul = require( '@stdlib/math/base/ops/imul' ); ``` #### imul( a, b ) @@ -41,7 +41,7 @@ var imul = require( '@stdlib/math/base/ops/imul' ); Performs C-like multiplication of two signed 32-bit integers. ```javascript -var v = imul( -10|0, 4|0 ); +let v = imul( -10|0, 4|0 ); // returns -40 v = imul( 1073741824|0, -5|0 ); // 2^30 * -5 = -5368709120 => 32-bit integer overflow @@ -71,23 +71,17 @@ v = imul( 1073741824|0, -5|0 ); // 2^30 * -5 = -5368709120 => 32-bit integer ove ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var INT32_MIN = require( '@stdlib/constants/int32/min' ); -var INT32_MAX = require( '@stdlib/constants/int32/max' ); -var imul = require( '@stdlib/math/base/ops/imul' ); - -var randi; -var a; -var b; -var y; -var i; - -randi = discreteUniform( INT32_MIN, INT32_MAX ); - -for ( i = 0; i < 100; i++ ) { - a = randi()|0; - b = randi()|0; - y = imul( a, b ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const INT32_MIN = require( '@stdlib/constants/int32/min' ); +const INT32_MAX = require( '@stdlib/constants/int32/max' ); +const imul = require( '@stdlib/math/base/ops/imul' ); + +const randi = discreteUniform( INT32_MIN, INT32_MAX ); + +for ( let i = 0; i < 100; i++ ) { + const a = randi()|0; + const b = randi()|0; + const y = imul( a, b ); console.log( '%d x %d = %d', a, b, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/imuldw/README.md b/lib/node_modules/@stdlib/math/base/ops/imuldw/README.md index 954e206c3782..872bca55b869 100644 --- a/lib/node_modules/@stdlib/math/base/ops/imuldw/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/imuldw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var imuldw = require( '@stdlib/math/base/ops/imuldw' ); +const imuldw = require( '@stdlib/math/base/ops/imuldw' ); ``` #### imuldw( a, b ) @@ -41,7 +41,7 @@ var imuldw = require( '@stdlib/math/base/ops/imuldw' ); Multiplies two signed 32-bit integers and returns an `array` of two signed 32-bit integers which represents the signed 64-bit integer product. ```javascript -var v = imuldw( 1, 10 ); +let v = imuldw( 1, 10 ); // returns [ 0, 10 ] v = imuldw( 0x80000000|0, 0x40000000|0 ); // -(2^31) * 2^30 = -2305843009213694000 => 32-bit integer overflow @@ -53,12 +53,12 @@ v = imuldw( 0x80000000|0, 0x40000000|0 ); // -(2^31) * 2^30 = -23058430092136940 Multiplies two signed 32-bit integers and assigns results representing the signed 64-bit integer product to a provided output array. ```javascript -var out = [ 0, 0 ]; +const out = [ 0, 0 ]; -var v = imuldw.assign( 1, 10, out, 1, 0 ); +const v = imuldw.assign( 1, 10, out, 1, 0 ); // returns [ 0, 10 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -83,16 +83,12 @@ var bool = ( v === out ); ```javascript -var lpad = require( '@stdlib/string/left-pad' ); -var imuldw = require( '@stdlib/math/base/ops/imuldw' ); +const lpad = require( '@stdlib/string/left-pad' ); +const imuldw = require( '@stdlib/math/base/ops/imuldw' ); -var i; -var j; -var y; - -for ( i = 0x7FFFFFF0; i < 0x7FFFFFFF; i++ ) { - for ( j = i; j < 0x7FFFFFFF; j++) { - y = imuldw( i|0, j|0 ); +for ( let i = 0x7FFFFFF0; i < 0x7FFFFFFF; i++ ) { + for ( let j = i; j < 0x7FFFFFFF; j++ ) { + const y = imuldw( i|0, j|0 ); console.log( '%d x %d = 0x%s%s', i|0, j|0, lpad( ( y[0] >>> 0 ).toString( 16 ), 8, '0'), lpad( ( y[1] >>> 0 ).toString( 16 ), 8, '0' ) ); } } diff --git a/lib/node_modules/@stdlib/math/base/ops/mul/README.md b/lib/node_modules/@stdlib/math/base/ops/mul/README.md index 800e20adae4a..807512abbee7 100644 --- a/lib/node_modules/@stdlib/math/base/ops/mul/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/mul/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mul = require( '@stdlib/math/base/ops/mul' ); +const mul = require( '@stdlib/math/base/ops/mul' ); ``` #### mul( x, y ) @@ -45,7 +45,7 @@ var mul = require( '@stdlib/math/base/ops/mul' ); Multiplies two double-precision floating-point numbers. ```javascript -var v = mul( -1.0, 5.0 ); +let v = mul( -1.0, 5.0 ); // returns -5.0 v = mul( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = mul( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var mul = require( '@stdlib/math/base/ops/mul' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const mul = require( '@stdlib/math/base/ops/mul' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d x %d = %d', x, y, mul( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/mulf/README.md b/lib/node_modules/@stdlib/math/base/ops/mulf/README.md index 14ae2acc4015..06d4b6485d7a 100644 --- a/lib/node_modules/@stdlib/math/base/ops/mulf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/mulf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mulf = require( '@stdlib/math/base/ops/mulf' ); +const mulf = require( '@stdlib/math/base/ops/mulf' ); ``` #### mulf( x, y ) @@ -45,7 +45,7 @@ var mulf = require( '@stdlib/math/base/ops/mulf' ); Multiplies two single-precision floating-point numbers. ```javascript -var v = mulf( -1.0, 5.0 ); +let v = mulf( -1.0, 5.0 ); // returns -5.0 v = mulf( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = mulf( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var mulf = require( '@stdlib/math/base/ops/mulf' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const mulf = require( '@stdlib/math/base/ops/mulf' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d x %d = %d', x, y, mulf( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/sub/README.md b/lib/node_modules/@stdlib/math/base/ops/sub/README.md index d37c59e18af8..0b7b23808379 100644 --- a/lib/node_modules/@stdlib/math/base/ops/sub/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/sub/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sub = require( '@stdlib/math/base/ops/sub' ); +const sub = require( '@stdlib/math/base/ops/sub' ); ``` #### sub( x, y ) @@ -45,7 +45,7 @@ var sub = require( '@stdlib/math/base/ops/sub' ); Subtracts two double-precision floating-point numbers. ```javascript -var v = sub( -1.0, 5.0 ); +let v = sub( -1.0, 5.0 ); // returns -6.0 v = sub( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = sub( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var sub = require( '@stdlib/math/base/ops/sub' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const sub = require( '@stdlib/math/base/ops/sub' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d - %d = %d', x, y, sub( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/subf/README.md b/lib/node_modules/@stdlib/math/base/ops/subf/README.md index 21aff7afbe3c..b0cb95912b34 100644 --- a/lib/node_modules/@stdlib/math/base/ops/subf/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/subf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var subf = require( '@stdlib/math/base/ops/subf' ); +const subf = require( '@stdlib/math/base/ops/subf' ); ``` #### subf( x, y ) @@ -45,7 +45,7 @@ var subf = require( '@stdlib/math/base/ops/subf' ); Subtracts two single-precision floating-point numbers. ```javascript -var v = subf( -1.0, 5.0 ); +let v = subf( -1.0, 5.0 ); // returns -6.0 v = subf( 2.0, 5.0 ); @@ -82,16 +82,12 @@ v = subf( NaN, NaN ); ```javascript -var rand = require( '@stdlib/random/base/discrete-uniform' ); -var subf = require( '@stdlib/math/base/ops/subf' ); +const rand = require( '@stdlib/random/base/discrete-uniform' ); +const subf = require( '@stdlib/math/base/ops/subf' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = rand( -50, 50 ); - y = rand( -50, 50 ); +for ( let i = 0; i < 100; i++ ) { + const x = rand( -50, 50 ); + const y = rand( -50, 50 ); console.log( '%d - %d = %d', x, y, subf( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/umul/README.md b/lib/node_modules/@stdlib/math/base/ops/umul/README.md index c4abbba4f5fd..922ff8595ad4 100644 --- a/lib/node_modules/@stdlib/math/base/ops/umul/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/umul/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var umul = require( '@stdlib/math/base/ops/umul' ); +const umul = require( '@stdlib/math/base/ops/umul' ); ``` #### umul( a, b ) @@ -41,7 +41,7 @@ var umul = require( '@stdlib/math/base/ops/umul' ); Performs C-like multiplication of two unsigned 32-bit integers. ```javascript -var v = umul( 10>>>0, 4>>>0 ); +let v = umul( 10>>>0, 4>>>0 ); // returns 40 v = umul( 2147483648>>>0, 5>>>0 ); // 2^31 * 5 = 10737418240 => 32-bit integer overflow @@ -71,22 +71,16 @@ v = umul( 2147483648>>>0, 5>>>0 ); // 2^31 * 5 = 10737418240 => 32-bit integer o ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var UINT32_MAX = require( '@stdlib/constants/uint32/max' ); -var umul = require( '@stdlib/math/base/ops/umul' ); - -var randi; -var a; -var b; -var y; -var i; - -randi = discreteUniform( 0, UINT32_MAX ); - -for ( i = 0; i < 100; i++ ) { - a = randi()>>>0; - b = randi()>>>0; - y = umul( a, b ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const UINT32_MAX = require( '@stdlib/constants/uint32/max' ); +const umul = require( '@stdlib/math/base/ops/umul' ); + +const randi = discreteUniform( 0, UINT32_MAX ); + +for ( let i = 0; i < 100; i++ ) { + const a = randi()>>>0; + const b = randi()>>>0; + const y = umul( a, b ); console.log( '%d x %d = %d', a, b, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/ops/umuldw/README.md b/lib/node_modules/@stdlib/math/base/ops/umuldw/README.md index 63be1813c715..83f908a3681a 100644 --- a/lib/node_modules/@stdlib/math/base/ops/umuldw/README.md +++ b/lib/node_modules/@stdlib/math/base/ops/umuldw/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var umuldw = require( '@stdlib/math/base/ops/umuldw' ); +const umuldw = require( '@stdlib/math/base/ops/umuldw' ); ``` #### umuldw( a, b ) @@ -41,7 +41,7 @@ var umuldw = require( '@stdlib/math/base/ops/umuldw' ); Multiplies two unsigned 32-bit integers and returns an `array` of two unsigned 32-bit integers (in big endian order) which represents the unsigned 64-bit integer product. ```javascript -var v = umuldw( 1, 10 ); +let v = umuldw( 1, 10 ); // returns [ 0, 10 ] v = umuldw( 0x80000000, 0x80000000 ); // 2^31 * 2^31 = 4611686018427388000 => 32-bit integer overflow @@ -53,12 +53,12 @@ v = umuldw( 0x80000000, 0x80000000 ); // 2^31 * 2^31 = 4611686018427388000 => 32 Multiplies two unsigned 32-bit integers and assigns results representing the unsigned 64-bit integer product (in big endian order) to a provided output array. ```javascript -var out = [ 0, 0 ]; +const out = [ 0, 0 ]; -var v = umuldw.assign( 1, 10, out, 1, 0 ); +const v = umuldw.assign( 1, 10, out, 1, 0 ); // returns [ 0, 10 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -83,16 +83,12 @@ var bool = ( v === out ); ```javascript -var lpad = require( '@stdlib/string/left-pad' ); -var umuldw = require( '@stdlib/math/base/ops/umuldw' ); +const lpad = require( '@stdlib/string/left-pad' ); +const umuldw = require( '@stdlib/math/base/ops/umuldw' ); -var i; -var j; -var y; - -for ( i = 0xFFFFFFF0; i < 0xFFFFFFFF; i++ ) { - for ( j = i; j < 0xFFFFFFFF; j++) { - y = umuldw( i, j ); +for ( let i = 0xFFFFFFF0; i < 0xFFFFFFFF; i++ ) { + for ( let j = i; j < 0xFFFFFFFF; j++ ) { + const y = umuldw( i, j ); console.log( '%d x %d = 0x%s%s', i, j, lpad( y[0].toString( 16 ), 8, '0' ), lpad( y[1].toString( 16 ), 8, '0' ) ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/README.md b/lib/node_modules/@stdlib/math/base/special/README.md index 40c4289ad8eb..6262ca9208c4 100644 --- a/lib/node_modules/@stdlib/math/base/special/README.md +++ b/lib/node_modules/@stdlib/math/base/special/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var special = require( '@stdlib/math/base/special' ); +const special = require( '@stdlib/math/base/special' ); ``` #### special @@ -35,7 +35,7 @@ var special = require( '@stdlib/math/base/special' ); Namespace for "base" (i.e., lower-level) special math functions. ```javascript -var fcns = special; +const fcns = special; // returns {...} ``` @@ -378,8 +378,8 @@ Finally, the namespace exports the following kernel functions, which are mainly ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var special = require( '@stdlib/math/base/special' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const special = require( '@stdlib/math/base/special' ); console.log( objectKeys( special ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/special/abs/README.md b/lib/node_modules/@stdlib/math/base/special/abs/README.md index 870794b898df..9050e1a48a82 100644 --- a/lib/node_modules/@stdlib/math/base/special/abs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/abs/README.md @@ -48,7 +48,7 @@ The [absolute value][absolute-value] is defined as ## Usage ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); ``` #### abs( x ) @@ -56,7 +56,7 @@ var abs = require( '@stdlib/math/base/special/abs' ); Computes the [absolute value][absolute-value] of a double-precision floating-point number. ```javascript -var v = abs( -1.0 ); +let v = abs( -1.0 ); // returns 1.0 v = abs( 2.0 ); @@ -83,15 +83,14 @@ v = abs( NaN ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = discreteUniform( 100, -100, 100, { +const x = discreteUniform( 100, -100, 100, { 'dtype': 'float64' }); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'abs(%d) = %d', x[ i ], abs( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/abs2/README.md b/lib/node_modules/@stdlib/math/base/special/abs2/README.md index f7f01d156985..3b391e4eebb6 100644 --- a/lib/node_modules/@stdlib/math/base/special/abs2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/abs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var abs2 = require( '@stdlib/math/base/special/abs2' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); ``` #### abs2( x ) @@ -41,7 +41,7 @@ var abs2 = require( '@stdlib/math/base/special/abs2' ); Computes the squared [absolute value][absolute-value] of a double-precision floating-point number. ```javascript -var v = abs2( -1.0 ); +let v = abs2( -1.0 ); // returns 1.0 v = abs2( 2.0 ); @@ -68,15 +68,12 @@ v = abs2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ) - 50.0; console.log( 'abs2(%d) = %d', x, abs2( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/abs2f/README.md b/lib/node_modules/@stdlib/math/base/special/abs2f/README.md index 60fec191fb7c..2ad275581a2f 100644 --- a/lib/node_modules/@stdlib/math/base/special/abs2f/README.md +++ b/lib/node_modules/@stdlib/math/base/special/abs2f/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var abs2f = require( '@stdlib/math/base/special/abs2f' ); +const abs2f = require( '@stdlib/math/base/special/abs2f' ); ``` #### abs2f( x ) @@ -41,7 +41,7 @@ var abs2f = require( '@stdlib/math/base/special/abs2f' ); Computes the squared [absolute value][absolute-value] of a single-precision floating-point number. ```javascript -var v = abs2f( -1.0 ); +let v = abs2f( -1.0 ); // returns 1.0 v = abs2f( 2.0 ); @@ -68,15 +68,12 @@ v = abs2f( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var abs2f = require( '@stdlib/math/base/special/abs2f' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const abs2f = require( '@stdlib/math/base/special/abs2f' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ) - 50.0; console.log( 'abs2f(%d) = %d', x, abs2f( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/absf/README.md b/lib/node_modules/@stdlib/math/base/special/absf/README.md index 0faf7ecfdbca..2b3221e9f283 100644 --- a/lib/node_modules/@stdlib/math/base/special/absf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/absf/README.md @@ -48,7 +48,7 @@ The [absolute value][absolute-value] is defined as ## Usage ```javascript -var absf = require( '@stdlib/math/base/special/absf' ); +const absf = require( '@stdlib/math/base/special/absf' ); ``` #### absf( x ) @@ -56,7 +56,7 @@ var absf = require( '@stdlib/math/base/special/absf' ); Computes the [absolute value][absolute-value] of a single-precision floating-point number. ```javascript -var v = absf( -1.0 ); +let v = absf( -1.0 ); // returns 1.0 v = absf( 2.0 ); @@ -83,15 +83,12 @@ v = absf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var rand; -var i; - -for ( i = 0; i < 100; i++ ) { - rand = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const rand = round( randu() * 100.0 ) - 50.0; console.log( 'absf(%d) = %d', rand, absf( rand ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acos/README.md b/lib/node_modules/@stdlib/math/base/special/acos/README.md index d3824aa88339..0433f5196c4d 100644 --- a/lib/node_modules/@stdlib/math/base/special/acos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acos/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acos = require( '@stdlib/math/base/special/acos' ); +const acos = require( '@stdlib/math/base/special/acos' ); ``` #### acos( x ) @@ -35,7 +35,7 @@ var acos = require( '@stdlib/math/base/special/acos' ); Computes the [arccosine][arccosine] of a double-precision floating-point number (in radians). ```javascript -var v = acos( 1.0 ); +let v = acos( 1.0 ); // returns 0.0 v = acos( 0.707 ); // ~pi/4 @@ -51,7 +51,7 @@ v = acos( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = acos( -3.14 ); +const v = acos( -3.14 ); // returns NaN ``` @@ -66,13 +66,12 @@ var v = acos( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acos = require( '@stdlib/math/base/special/acos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acos = require( '@stdlib/math/base/special/acos' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acosd/README.md b/lib/node_modules/@stdlib/math/base/special/acosd/README.md index 5a8931fb4746..bcbc16267a64 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acosd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acosd = require( '@stdlib/math/base/special/acosd' ); +const acosd = require( '@stdlib/math/base/special/acosd' ); ``` #### acosd( x ) @@ -35,8 +35,8 @@ var acosd = require( '@stdlib/math/base/special/acosd' ); Computes the [arccosine][arccosine] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = acosd( 0.0 ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +let v = acosd( 0.0 ); // returns 90.0 v = acosd( 0.5 ); @@ -55,7 +55,7 @@ v = acosd( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = acosd( -3.14 ); +const v = acosd( -3.14 ); // returns NaN ``` @@ -70,13 +70,12 @@ var v = acosd( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acosd = require( '@stdlib/math/base/special/acosd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acosd = require( '@stdlib/math/base/special/acosd' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acosd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acosdf/README.md b/lib/node_modules/@stdlib/math/base/special/acosdf/README.md index 9f9901ce81b3..b42f14804109 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosdf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acosdf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acosdf = require( '@stdlib/math/base/special/acosdf' ); +const acosdf = require( '@stdlib/math/base/special/acosdf' ); ``` #### acosdf( x ) @@ -35,9 +35,9 @@ var acosdf = require( '@stdlib/math/base/special/acosdf' ); Computes the [arccosine][arccosine] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = acosdf( 0.0 ); +let v = acosdf( 0.0 ); // returns 90.0 v = acosdf( 0.5 ); @@ -56,7 +56,7 @@ v = acosdf( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = acosdf( -3.14 ); +const v = acosdf( -3.14 ); // returns NaN ``` @@ -71,13 +71,12 @@ var v = acosdf( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acosdf = require( '@stdlib/math/base/special/acosdf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acosdf = require( '@stdlib/math/base/special/acosdf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acosdf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acosf/README.md b/lib/node_modules/@stdlib/math/base/special/acosf/README.md index 5ba6c4bb774f..a162166b3b7c 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acosf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acosf = require( '@stdlib/math/base/special/acosf' ); +const acosf = require( '@stdlib/math/base/special/acosf' ); ``` #### acosf( x ) @@ -35,7 +35,7 @@ var acosf = require( '@stdlib/math/base/special/acosf' ); Computes the [arccosine][arccosine] of a single-precision floating-point number (in radians). ```javascript -var v = acosf( 1.0 ); +let v = acosf( 1.0 ); // returns 0.0 v = acosf( 0.707 ); // ~pi/4 @@ -51,7 +51,7 @@ v = acosf( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = acosf( -3.14 ); +const v = acosf( -3.14 ); // returns NaN ``` @@ -66,13 +66,12 @@ var v = acosf( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acosf = require( '@stdlib/math/base/special/acosf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acosf = require( '@stdlib/math/base/special/acosf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acosf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acosh/README.md b/lib/node_modules/@stdlib/math/base/special/acosh/README.md index 2c91bfd7bd03..3d6ffcee3fbe 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acosh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acosh = require( '@stdlib/math/base/special/acosh' ); +const acosh = require( '@stdlib/math/base/special/acosh' ); ``` #### acosh( x ) @@ -35,7 +35,7 @@ var acosh = require( '@stdlib/math/base/special/acosh' ); Computes the [hyperbolic arccosine][hyperbolic-arccosine] of double-precision floating-point number. ```javascript -var v = acosh( 1.0 ); +let v = acosh( 1.0 ); // returns 0.0 v = acosh( 2.0 ); @@ -48,7 +48,7 @@ v = acosh( 0.5 ); The domain of `x` is restricted to `[1,+infinity)`. If `x < 1`, the function will return `NaN`. ```javascript -var v = acosh( 0.0 ); +const v = acosh( 0.0 ); // returns NaN ``` @@ -63,13 +63,12 @@ var v = acosh( 0.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acosh = require( '@stdlib/math/base/special/acosh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acosh = require( '@stdlib/math/base/special/acosh' ); -var x = linspace( 1.0, 5.0, 100 ); +const x = linspace( 1.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acosh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acot/README.md b/lib/node_modules/@stdlib/math/base/special/acot/README.md index f6e5cff1f6d7..d62c752fb875 100644 --- a/lib/node_modules/@stdlib/math/base/special/acot/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acot/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acot = require( '@stdlib/math/base/special/acot' ); +const acot = require( '@stdlib/math/base/special/acot' ); ``` #### acot( x ) @@ -35,7 +35,7 @@ var acot = require( '@stdlib/math/base/special/acot' ); Computes the [inverse cotangent][arccotangent] of a double-precision floating-point number (in radians). ```javascript -var v = acot( 2.0 ); +let v = acot( 2.0 ); // returns ~0.4636 v = acot( Infinity ); @@ -53,13 +53,12 @@ v = acot( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acot = require( '@stdlib/math/base/special/acot' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acot = require( '@stdlib/math/base/special/acot' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acot( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acotd/README.md b/lib/node_modules/@stdlib/math/base/special/acotd/README.md index 76d78a0bbe16..8a704a834f80 100644 --- a/lib/node_modules/@stdlib/math/base/special/acotd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acotd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acotd = require( '@stdlib/math/base/special/acotd' ); +const acotd = require( '@stdlib/math/base/special/acotd' ); ``` #### acotd( x ) @@ -35,9 +35,9 @@ var acotd = require( '@stdlib/math/base/special/acotd' ); Computes the [arccotangent][arccotangent] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = acotd( 0.0 ); +let v = acotd( 0.0 ); // returns 90.0 v = acotd( sqrt( 3 ) ); @@ -64,13 +64,12 @@ v = acotd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acotd = require( '@stdlib/math/base/special/acotd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acotd = require( '@stdlib/math/base/special/acotd' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acotd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acotdf/README.md b/lib/node_modules/@stdlib/math/base/special/acotdf/README.md index f75d33797e48..f5a8f8089145 100644 --- a/lib/node_modules/@stdlib/math/base/special/acotdf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acotdf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acotdf = require( '@stdlib/math/base/special/acotdf' ); +const acotdf = require( '@stdlib/math/base/special/acotdf' ); ``` #### acotdf( x ) @@ -35,9 +35,9 @@ var acotdf = require( '@stdlib/math/base/special/acotdf' ); Computes the [arccotangent][arccotangent] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = acotdf( 0.0 ); +let v = acotdf( 0.0 ); // returns 90.0 v = acotdf( sqrtf( 3.0 ) ); @@ -64,13 +64,12 @@ v = acotdf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acotdf = require( '@stdlib/math/base/special/acotdf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acotdf = require( '@stdlib/math/base/special/acotdf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acotdf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acotf/README.md b/lib/node_modules/@stdlib/math/base/special/acotf/README.md index 8d587f9b7977..c8f7b108d841 100644 --- a/lib/node_modules/@stdlib/math/base/special/acotf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acotf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acotf = require( '@stdlib/math/base/special/acotf' ); +const acotf = require( '@stdlib/math/base/special/acotf' ); ``` #### acotf( x ) @@ -35,7 +35,7 @@ var acotf = require( '@stdlib/math/base/special/acotf' ); Computes the [inverse cotangent][arccotangent] of a single-precision floating-point number. ```javascript -var v = acotf( 2.0 ); +let v = acotf( 2.0 ); // returns ~0.4636 v = acotf( Infinity ); @@ -53,13 +53,12 @@ v = acotf( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acotf = require( '@stdlib/math/base/special/acotf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acotf = require( '@stdlib/math/base/special/acotf' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acotf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acoth/README.md b/lib/node_modules/@stdlib/math/base/special/acoth/README.md index 3c0f5bfeb9f3..e6c0050134fa 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoth/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acoth/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acoth = require( '@stdlib/math/base/special/acoth' ); +const acoth = require( '@stdlib/math/base/special/acoth' ); ``` #### acoth( x ) @@ -35,7 +35,7 @@ var acoth = require( '@stdlib/math/base/special/acoth' ); Computes the [inverse hyperbolic cotangent][hyperbolic-arctangent] of a double-precision floating-point number. ```javascript -var v = acoth( 2.0 ); +let v = acoth( 2.0 ); // returns ~0.5493 v = acoth( 1.0 ); @@ -45,7 +45,7 @@ v = acoth( 1.0 ); The domain of the inverse hyperbolic cotangent is the union of the intervals `(-inf,-1]` and `[1,inf)`. If provided a value on the open interval `(-1,1)`, the function returns `NaN`. ```javascript -var v = acoth( 0.0 ); +let v = acoth( 0.0 ); // returns NaN v = acoth( 0.5 ); @@ -63,13 +63,12 @@ v = acoth( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acoth = require( '@stdlib/math/base/special/acoth' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acoth = require( '@stdlib/math/base/special/acoth' ); -var x = linspace( 1.0, 5.0, 100 ); +const x = linspace( 1.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acoth( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/README.md b/lib/node_modules/@stdlib/math/base/special/acovercos/README.md index 3b3a3eae87c0..62239a529d24 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/README.md @@ -48,7 +48,7 @@ The [inverse coversed cosine][inverse-coversed-cosine] is defined as ## Usage ```javascript -var acovercos = require( '@stdlib/math/base/special/acovercos' ); +const acovercos = require( '@stdlib/math/base/special/acovercos' ); ``` #### acovercos( x ) @@ -56,7 +56,7 @@ var acovercos = require( '@stdlib/math/base/special/acovercos' ); Computes the [inverse coversed cosine][inverse-coversed-cosine]. ```javascript -var v = acovercos( 0.0 ); +let v = acovercos( 0.0 ); // returns ~1.5708 v = acovercos( -3.141592653589793/2.0 ); @@ -69,7 +69,7 @@ v = acovercos( -3.141592653589793/6.0 ); If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = acovercos( 1.0 ); +let v = acovercos( 1.0 ); // returns NaN v = acovercos( -3.14 ); @@ -90,13 +90,12 @@ v = acovercos( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acovercos = require( '@stdlib/math/base/special/acovercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acovercos = require( '@stdlib/math/base/special/acovercos' ); -var x = linspace( -2.0, 0.0, 100 ); +const x = linspace( -2.0, 0.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acovercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acovercosf/README.md b/lib/node_modules/@stdlib/math/base/special/acovercosf/README.md index 01c781492d0f..08e0d417ef27 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercosf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acovercosf/README.md @@ -43,7 +43,7 @@ The [inverse coversed cosine][inverse-coversed-cosine] is defined as ## Usage ```javascript -var acovercosf = require( '@stdlib/math/base/special/acovercosf' ); +const acovercosf = require( '@stdlib/math/base/special/acovercosf' ); ``` #### acovercosf( x ) @@ -51,7 +51,7 @@ var acovercosf = require( '@stdlib/math/base/special/acovercosf' ); Computes the [inverse coversed cosine][inverse-coversed-cosine] of a single-precision floating-point number. ```javascript -var v = acovercosf( 0.0 ); +let v = acovercosf( 0.0 ); // returns ~1.5708 v = acovercosf( -3.141592653589793 / 2.0 ); @@ -64,7 +64,7 @@ v = acovercosf( -3.141592653589793 / 6.0 ); If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = acovercosf( 1.0 ); +let v = acovercosf( 1.0 ); // returns NaN v = acovercosf( -3.14 ); @@ -85,13 +85,12 @@ v = acovercosf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acovercosf = require( '@stdlib/math/base/special/acovercosf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acovercosf = require( '@stdlib/math/base/special/acovercosf' ); -var x = linspace( -2.0, 0.0, 100 ); +const x = linspace( -2.0, 0.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acovercosf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/README.md b/lib/node_modules/@stdlib/math/base/special/acoversin/README.md index af6977843f1e..40aba9ad3e4a 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/README.md @@ -48,7 +48,7 @@ The [inverse coversed sine][inverse-coversed-sine] is defined as ## Usage ```javascript -var acoversin = require( '@stdlib/math/base/special/acoversin' ); +const acoversin = require( '@stdlib/math/base/special/acoversin' ); ``` #### acoversin( x ) @@ -56,7 +56,7 @@ var acoversin = require( '@stdlib/math/base/special/acoversin' ); Computes the [inverse coversed sine][inverse-coversed-sine]. ```javascript -var v = acoversin( 0.0 ); +let v = acoversin( 0.0 ); // returns ~1.5708 v = acoversin( 3.141592653589793/2.0 ); @@ -69,7 +69,7 @@ v = acoversin( 3.141592653589793/6.0 ); If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = acoversin( -1.0 ); +let v = acoversin( -1.0 ); // returns NaN v = acoversin( 3.14 ); @@ -90,13 +90,12 @@ v = acoversin( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acoversin = require( '@stdlib/math/base/special/acoversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acoversin = require( '@stdlib/math/base/special/acoversin' ); -var x = linspace( 0.0, 2.0, 100 ); +const x = linspace( 0.0, 2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acoversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acoversinf/README.md b/lib/node_modules/@stdlib/math/base/special/acoversinf/README.md index 95a51c73a69b..17f8a480ed70 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversinf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acoversinf/README.md @@ -43,7 +43,7 @@ The [inverse coversed sine][inverse-coversed-sine] is defined as ## Usage ```javascript -var acoversinf = require( '@stdlib/math/base/special/acoversinf' ); +const acoversinf = require( '@stdlib/math/base/special/acoversinf' ); ``` #### acoversinf( x ) @@ -51,7 +51,7 @@ var acoversinf = require( '@stdlib/math/base/special/acoversinf' ); Computes the [inverse coversed sine][inverse-coversed-sine] of a single-precision floating-point number (in radians). ```javascript -var v = acoversinf( 0.0 ); +let v = acoversinf( 0.0 ); // returns ~1.5708 v = acoversinf( 3.141592653589793 / 2.0 ); @@ -64,7 +64,7 @@ v = acoversinf( 3.141592653589793 / 6.0 ); If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = acoversinf( -1.0 ); +let v = acoversinf( -1.0 ); // returns NaN v = acoversinf( 3.14 ); @@ -85,13 +85,12 @@ v = acoversinf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acoversinf = require( '@stdlib/math/base/special/acoversinf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acoversinf = require( '@stdlib/math/base/special/acoversinf' ); -var x = linspace( 0.0, 2.0, 100 ); +const x = linspace( 0.0, 2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acoversinf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acsc/README.md b/lib/node_modules/@stdlib/math/base/special/acsc/README.md index 890e365de435..c6c8b689b58d 100644 --- a/lib/node_modules/@stdlib/math/base/special/acsc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acsc/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acsc = require( '@stdlib/math/base/special/acsc' ); +const acsc = require( '@stdlib/math/base/special/acsc' ); ``` #### acsc( x ) @@ -35,7 +35,7 @@ var acsc = require( '@stdlib/math/base/special/acsc' ); Computes the [arccosecant][arccosecant] of `x`. ```javascript -var v = acsc( 1.0 ); +let v = acsc( 1.0 ); // returns ~1.57 v = acsc( -3.141592653589793 ); @@ -45,7 +45,7 @@ v = acsc( -3.141592653589793 ); If `|x| < 1`, the function returns `NaN`. ```javascript -var v = acsc( 0.5 ); +const v = acsc( 0.5 ); // returns NaN ``` @@ -60,13 +60,12 @@ var v = acsc( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acsc = require( '@stdlib/math/base/special/acsc' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acsc = require( '@stdlib/math/base/special/acsc' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acsc( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acscd/README.md b/lib/node_modules/@stdlib/math/base/special/acscd/README.md index 050bc5f3e842..6636e1f9e818 100644 --- a/lib/node_modules/@stdlib/math/base/special/acscd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acscd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acscd = require( '@stdlib/math/base/special/acscd' ); +const acscd = require( '@stdlib/math/base/special/acscd' ); ``` #### acscd( x ) @@ -35,8 +35,8 @@ var acscd = require( '@stdlib/math/base/special/acscd' ); Computes the [arccosecant][arccosecant] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = acscd( Infinity ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +let v = acscd( Infinity ); // returns 0.0 v = acscd( 2 * sqrt( 3 ) / 3 ); @@ -66,13 +66,12 @@ v = acscd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acscd = require( '@stdlib/math/base/special/acscd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acscd = require( '@stdlib/math/base/special/acscd' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acscd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acscdf/README.md b/lib/node_modules/@stdlib/math/base/special/acscdf/README.md index 9fa4dacec1cb..f127eb0c5b13 100644 --- a/lib/node_modules/@stdlib/math/base/special/acscdf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acscdf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acscdf = require( '@stdlib/math/base/special/acscdf' ); +const acscdf = require( '@stdlib/math/base/special/acscdf' ); ``` #### acscdf( x ) @@ -35,9 +35,9 @@ var acscdf = require( '@stdlib/math/base/special/acscdf' ); Computes the [arccosecant][arccosecant] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = acscdf( Infinity ); +let v = acscdf( Infinity ); // returns 0.0 v = acscdf( 2.0 * sqrtf( 3.0 ) / 3.0 ); @@ -67,13 +67,12 @@ v = acscdf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acscdf = require( '@stdlib/math/base/special/acscdf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acscdf = require( '@stdlib/math/base/special/acscdf' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acscdf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acscf/README.md b/lib/node_modules/@stdlib/math/base/special/acscf/README.md index ce3fea6269e1..4f3240e7661f 100644 --- a/lib/node_modules/@stdlib/math/base/special/acscf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acscf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acscf = require( '@stdlib/math/base/special/acscf' ); +const acscf = require( '@stdlib/math/base/special/acscf' ); ``` #### acscf( x ) @@ -35,7 +35,7 @@ var acscf = require( '@stdlib/math/base/special/acscf' ); Computes the [arccosecant][arccosecant] of a single-precision floating-point number. ```javascript -var v = acscf( 1.0 ); +let v = acscf( 1.0 ); // returns ~1.57 v = acscf( 3.141592653589793 ); @@ -48,7 +48,7 @@ v = acscf( -3.141592653589793 ); If `|x| < 1`, the function returns `NaN`. ```javascript -var v = acscf( 0.5 ); +const v = acscf( 0.5 ); // returns NaN ``` @@ -63,13 +63,12 @@ var v = acscf( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acscf = require( '@stdlib/math/base/special/acscf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acscf = require( '@stdlib/math/base/special/acscf' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acscf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/acsch/README.md b/lib/node_modules/@stdlib/math/base/special/acsch/README.md index 9d93caf49d8b..a90ee7ce0261 100644 --- a/lib/node_modules/@stdlib/math/base/special/acsch/README.md +++ b/lib/node_modules/@stdlib/math/base/special/acsch/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acsch = require( '@stdlib/math/base/special/acsch' ); +const acsch = require( '@stdlib/math/base/special/acsch' ); ``` #### acsch( x ) @@ -35,7 +35,7 @@ var acsch = require( '@stdlib/math/base/special/acsch' ); Computes the [hyperbolic arccosecant][inverse-hyperbolic-functions] of `x`. ```javascript -var v = acsch( 0.0 ); +let v = acsch( 0.0 ); // returns Infinity v = acsch( -0.0 ); @@ -68,13 +68,12 @@ v = acsch( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acsch = require( '@stdlib/math/base/special/acsch' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acsch = require( '@stdlib/math/base/special/acsch' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acsch( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ahavercos/README.md b/lib/node_modules/@stdlib/math/base/special/ahavercos/README.md index 8a1e616a05b0..c878ef280522 100644 --- a/lib/node_modules/@stdlib/math/base/special/ahavercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ahavercos/README.md @@ -48,7 +48,7 @@ The [inverse half-value versed cosine][archavercosine] is defined as ## Usage ```javascript -var ahavercos = require( '@stdlib/math/base/special/ahavercos' ); +const ahavercos = require( '@stdlib/math/base/special/ahavercos' ); ``` #### ahavercos( x ) @@ -56,7 +56,7 @@ var ahavercos = require( '@stdlib/math/base/special/ahavercos' ); Computes the [inverse half-value versed cosine][archavercosine]. ```javascript -var v = ahavercos( 0.0 ); +let v = ahavercos( 0.0 ); // returns ~3.1416 v = ahavercos( 1.0 ); @@ -69,7 +69,7 @@ v = ahavercos( 0.5 ); If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = ahavercos( 1.5 ); +let v = ahavercos( 1.5 ); // returns NaN v = ahavercos( -3.14 ); @@ -90,13 +90,12 @@ v = ahavercos( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var ahavercos = require( '@stdlib/math/base/special/ahavercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const ahavercos = require( '@stdlib/math/base/special/ahavercos' ); -var x = linspace( 0.0, 1.0, 100 ); +const x = linspace( 0.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( ahavercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ahaversin/README.md b/lib/node_modules/@stdlib/math/base/special/ahaversin/README.md index 1b9f4d6ed0b7..86d3a550e179 100644 --- a/lib/node_modules/@stdlib/math/base/special/ahaversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ahaversin/README.md @@ -48,7 +48,7 @@ The [inverse half-value versed sine][archaversine] is defined as ## Usage ```javascript -var ahaversin = require( '@stdlib/math/base/special/ahaversin' ); +const ahaversin = require( '@stdlib/math/base/special/ahaversin' ); ``` #### ahaversin( x ) @@ -56,7 +56,7 @@ var ahaversin = require( '@stdlib/math/base/special/ahaversin' ); Computes the [inverse half-value versed sine][archaversine]. ```javascript -var v = ahaversin( 0.0 ); +let v = ahaversin( 0.0 ); // returns 0.0 v = ahaversin( 1.0 ); @@ -69,7 +69,7 @@ v = ahaversin( 0.5 ); If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = ahaversin( 1.5 ); +let v = ahaversin( 1.5 ); // returns NaN v = ahaversin( -3.14 ); @@ -90,13 +90,12 @@ v = ahaversin( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var ahaversin = require( '@stdlib/math/base/special/ahaversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const ahaversin = require( '@stdlib/math/base/special/ahaversin' ); -var x = linspace( 0.0, 1.0, 100 ); +const x = linspace( 0.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( ahaversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asec/README.md b/lib/node_modules/@stdlib/math/base/special/asec/README.md index 022cd0011da1..6751d27ea73b 100644 --- a/lib/node_modules/@stdlib/math/base/special/asec/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asec/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asec = require( '@stdlib/math/base/special/asec' ); +const asec = require( '@stdlib/math/base/special/asec' ); ``` #### asec( x ) @@ -35,7 +35,7 @@ var asec = require( '@stdlib/math/base/special/asec' ); Computes the [inverse (arc) secant][arcsecant] of `x`. ```javascript -var v = asec( 1.0 ); +let v = asec( 1.0 ); // returns 0.0 v = asec( 2.0 ); @@ -48,7 +48,7 @@ v = asec( NaN ); The domain of `x` is restricted to the intervals `[-inf, -1]` and `[1, inf]`. For `x` outside of these intervals, the function returns `NaN`. ```javascript -var v = asec( -0.5 ); +let v = asec( -0.5 ); // returns NaN v = asec( 0.5 ); @@ -66,13 +66,12 @@ v = asec( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asec = require( '@stdlib/math/base/special/asec' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asec = require( '@stdlib/math/base/special/asec' ); -var x = linspace( 1.0, 10.0, 100 ); +const x = linspace( 1.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asec( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asecd/README.md b/lib/node_modules/@stdlib/math/base/special/asecd/README.md index 96ef982d38b6..b394de3c22ba 100644 --- a/lib/node_modules/@stdlib/math/base/special/asecd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asecd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asecd = require( '@stdlib/math/base/special/asecd' ); +const asecd = require( '@stdlib/math/base/special/asecd' ); ``` #### asecd( x ) @@ -35,8 +35,8 @@ var asecd = require( '@stdlib/math/base/special/asecd' ); Computes the [arcsecant][arcsecant] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = asecd( 1 ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +let v = asecd( 1 ); // returns 0.0 v = asecd( 2 * sqrt( 3 ) / 3 ); @@ -66,13 +66,12 @@ v = asecd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asecd = require( '@stdlib/math/base/special/asecd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asecd = require( '@stdlib/math/base/special/asecd' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asecd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asecdf/README.md b/lib/node_modules/@stdlib/math/base/special/asecdf/README.md index 4aaf60672a32..c8fce7b92968 100644 --- a/lib/node_modules/@stdlib/math/base/special/asecdf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asecdf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asecdf = require( '@stdlib/math/base/special/asecdf' ); +const asecdf = require( '@stdlib/math/base/special/asecdf' ); ``` #### asecdf( x ) @@ -35,9 +35,9 @@ var asecdf = require( '@stdlib/math/base/special/asecdf' ); Computes the [arcsecant][arcsecant] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = asecdf( Infinity ); +let v = asecdf( Infinity ); // returns 90.0 v = asecdf( 2.0 * sqrtf( 3.0 ) / 3.0 ); @@ -59,7 +59,7 @@ v = asecdf( NaN ); The domain of `x` is restricted to the intervals `[-inf, -1]` and `[1, inf]`. For `x` outside of these intervals, the function returns `NaN`. ```javascript -var v = asecdf( -0.5 ); +let v = asecdf( -0.5 ); // returns NaN v = asecdf( 0.5 ); @@ -77,13 +77,12 @@ v = asecdf( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asecdf = require( '@stdlib/math/base/special/asecdf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asecdf = require( '@stdlib/math/base/special/asecdf' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asecdf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asecf/README.md b/lib/node_modules/@stdlib/math/base/special/asecf/README.md index 4ead0cbc16cf..7dce69fa6115 100644 --- a/lib/node_modules/@stdlib/math/base/special/asecf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asecf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asecf = require( '@stdlib/math/base/special/asecf' ); +const asecf = require( '@stdlib/math/base/special/asecf' ); ``` #### asecf( x ) @@ -35,7 +35,7 @@ var asecf = require( '@stdlib/math/base/special/asecf' ); Computes the [inverse (arc) secant][arcsecant] of a single-precision floating-point number. ```javascript -var v = asecf( 1.0 ); +let v = asecf( 1.0 ); // returns 0.0 v = asecf( 2.0 ); @@ -48,7 +48,7 @@ v = asecf( NaN ); The domain of `x` is restricted to the intervals `[-inf, -1]` and `[1, inf]`. For `x` outside of these intervals, the function returns `NaN`. ```javascript -var v = asecf( -0.5 ); +let v = asecf( -0.5 ); // returns NaN v = asecf( 0.5 ); @@ -66,13 +66,12 @@ v = asecf( 0.5 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asecf = require( '@stdlib/math/base/special/asecf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asecf = require( '@stdlib/math/base/special/asecf' ); -var x = linspace( 1.0, 10.0, 100 ); +const x = linspace( 1.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asecf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asech/README.md b/lib/node_modules/@stdlib/math/base/special/asech/README.md index 3cc914e4d4b6..5044e07c7cb0 100644 --- a/lib/node_modules/@stdlib/math/base/special/asech/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asech/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asech = require( '@stdlib/math/base/special/asech' ); +const asech = require( '@stdlib/math/base/special/asech' ); ``` #### asech( x ) @@ -35,7 +35,7 @@ var asech = require( '@stdlib/math/base/special/asech' ); Computes the [hyperbolic arcsecant][hyperbolic-arcsecant] of `x`. ```javascript -var v = asech( 1.0 ); +let v = asech( 1.0 ); // returns 0.0 v = asech( 0.5 ); @@ -48,7 +48,7 @@ v = asech( 0.0 ); The domain of `x` is restricted to the interval `[0, 1]`. For `x` outside of this interval, the function returns `NaN`. ```javascript -var v = asech( -1.0 ); +let v = asech( -1.0 ); // returns NaN v = asech( 2.0 ); @@ -66,13 +66,12 @@ v = asech( 2.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asech = require( '@stdlib/math/base/special/asech' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asech = require( '@stdlib/math/base/special/asech' ); -var x = linspace( 0.1, 1.0, 100 ); +const x = linspace( 0.1, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asech( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asin/README.md b/lib/node_modules/@stdlib/math/base/special/asin/README.md index 5825c7acddb3..55827996ce89 100644 --- a/lib/node_modules/@stdlib/math/base/special/asin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asin = require( '@stdlib/math/base/special/asin' ); +const asin = require( '@stdlib/math/base/special/asin' ); ``` #### asin( x ) @@ -35,7 +35,7 @@ var asin = require( '@stdlib/math/base/special/asin' ); Computes the [arcsine][arcsine] of a double-precision floating-point number (in radians). ```javascript -var v = asin( 0.0 ); +let v = asin( 0.0 ); // returns 0.0 v = asin( -3.141592653589793/6.0 ); @@ -45,7 +45,7 @@ v = asin( -3.141592653589793/6.0 ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = asin( -3.14 ); +const v = asin( -3.14 ); // returns NaN ``` @@ -60,13 +60,12 @@ var v = asin( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asin = require( '@stdlib/math/base/special/asin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asin = require( '@stdlib/math/base/special/asin' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asind/README.md b/lib/node_modules/@stdlib/math/base/special/asind/README.md index 9508356afe1e..b416a55a4a29 100644 --- a/lib/node_modules/@stdlib/math/base/special/asind/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asind/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asind = require( '@stdlib/math/base/special/asind' ); +const asind = require( '@stdlib/math/base/special/asind' ); ``` #### asind( x ) @@ -35,9 +35,9 @@ var asind = require( '@stdlib/math/base/special/asind' ); Computes the [arcsine][arcsine] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = asind( 0.0 ); +let v = asind( 0.0 ); // returns 0.0 v = asind( 0.5 ); @@ -56,7 +56,7 @@ v = asind( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = asind( -3.14 ); +const v = asind( -3.14 ); // returns NaN ``` @@ -71,13 +71,12 @@ var v = asind( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asind = require( '@stdlib/math/base/special/asind' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asind = require( '@stdlib/math/base/special/asind' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asind( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asindf/README.md b/lib/node_modules/@stdlib/math/base/special/asindf/README.md index 784825fae1ec..5adadea0adb9 100644 --- a/lib/node_modules/@stdlib/math/base/special/asindf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asindf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asindf = require( '@stdlib/math/base/special/asindf' ); +const asindf = require( '@stdlib/math/base/special/asindf' ); ``` #### asindf( x ) @@ -35,9 +35,9 @@ var asindf = require( '@stdlib/math/base/special/asindf' ); Computes the [arcsine][arcsine] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = asindf( 0.0 ); +let v = asindf( 0.0 ); // returns 0.0 v = asindf( 0.5 ); @@ -56,7 +56,7 @@ v = asindf( NaN ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = asindf( -3.14 ); +const v = asindf( -3.14 ); // returns NaN ``` @@ -71,13 +71,12 @@ var v = asindf( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asindf = require( '@stdlib/math/base/special/asindf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asindf = require( '@stdlib/math/base/special/asindf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asindf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asinf/README.md b/lib/node_modules/@stdlib/math/base/special/asinf/README.md index 76734caf1b8a..1166fcca54ca 100644 --- a/lib/node_modules/@stdlib/math/base/special/asinf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asinf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asinf = require( '@stdlib/math/base/special/asinf' ); +const asinf = require( '@stdlib/math/base/special/asinf' ); ``` #### asinf( x ) @@ -35,7 +35,7 @@ var asinf = require( '@stdlib/math/base/special/asinf' ); Computes the [arcsine][arcsine] of a single-precision floating-point number (in radians). ```javascript -var v = asinf( 0.0 ); +let v = asinf( 0.0 ); // returns 0.0 v = asinf( -3.14/6.0 ); @@ -53,13 +53,12 @@ v = asinf( -3.14/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asinf = require( '@stdlib/math/base/special/asinf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asinf = require( '@stdlib/math/base/special/asinf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asinf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/asinh/README.md b/lib/node_modules/@stdlib/math/base/special/asinh/README.md index 867ee952610b..88342ceca6dc 100644 --- a/lib/node_modules/@stdlib/math/base/special/asinh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/asinh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asinh = require( '@stdlib/math/base/special/asinh' ); +const asinh = require( '@stdlib/math/base/special/asinh' ); ``` #### asinh( x ) @@ -35,7 +35,7 @@ var asinh = require( '@stdlib/math/base/special/asinh' ); Computes the [hyperbolic arcsine][hyperbolic-arcsine] of a double-precision floating-point number. ```javascript -var v = asinh( 0.0 ); +let v = asinh( 0.0 ); // returns 0.0 v = asinh( -0.0 ); @@ -68,13 +68,12 @@ v = asinh( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asinh = require( '@stdlib/math/base/special/asinh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asinh = require( '@stdlib/math/base/special/asinh' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asinh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atan/README.md b/lib/node_modules/@stdlib/math/base/special/atan/README.md index 15171bc3f224..0ed729f4cf15 100644 --- a/lib/node_modules/@stdlib/math/base/special/atan/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atan = require( '@stdlib/math/base/special/atan' ); +const atan = require( '@stdlib/math/base/special/atan' ); ``` #### atan( x ) @@ -35,7 +35,7 @@ var atan = require( '@stdlib/math/base/special/atan' ); Computes the [arctangent][arctangent] of a double-precision floating-point number. ```javascript -var v = atan( 0.0 ); +let v = atan( 0.0 ); // returns ~0.0 v = atan( -3.141592653589793/2.0 ); @@ -59,13 +59,12 @@ v = atan( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atan = require( '@stdlib/math/base/special/atan' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atan = require( '@stdlib/math/base/special/atan' ); -var x = linspace( -1000.0, 1000.0, 100 ); +const x = linspace( -1000.0, 1000.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atan( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atan2/README.md b/lib/node_modules/@stdlib/math/base/special/atan2/README.md index 8fbe8f342903..d487d4887542 100755 --- a/lib/node_modules/@stdlib/math/base/special/atan2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atan2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atan2 = require( '@stdlib/math/base/special/atan2' ); +const atan2 = require( '@stdlib/math/base/special/atan2' ); ``` #### atan2( y, x ) @@ -35,7 +35,7 @@ var atan2 = require( '@stdlib/math/base/special/atan2' ); Computes the angle in the plane (in radians) between the positive x-axis and the ray from `(0,0)` to the point `(x,y)`. ```javascript -var v = atan2( 2.0, 2.0 ); // => atan(1.0) +let v = atan2( 2.0, 2.0 ); // => atan(1.0) // returns ~0.785 v = atan2( 6.0, 2.0 ); // => atan(3.0) @@ -68,16 +68,12 @@ v = atan2( 3.0, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var atan2 = require( '@stdlib/math/base/special/atan2' ); +const randu = require( '@stdlib/random/base/randu' ); +const atan2 = require( '@stdlib/math/base/special/atan2' ); -var y; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - y = randu() * 100.0; - x = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const y = randu() * 100.0; + const x = randu() * 100.0; console.log( 'y: %d, \t x: %d, \t atan2(y,x): %d', y.toFixed( 4 ), x.toFixed( 4 ), atan2( y, x ).toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atand/README.md b/lib/node_modules/@stdlib/math/base/special/atand/README.md index ac3f3e3ed7cc..432ac8916266 100644 --- a/lib/node_modules/@stdlib/math/base/special/atand/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atand/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atand = require( '@stdlib/math/base/special/atand' ); +const atand = require( '@stdlib/math/base/special/atand' ); ``` #### atand( x ) @@ -35,8 +35,8 @@ var atand = require( '@stdlib/math/base/special/atand' ); Computes the [arctangent][arctangent] (in degrees) of a double-precision floating-point number. ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var v = atand( 0.0 ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +let v = atand( 0.0 ); // returns 0.0 v = atand( 0.5 ); @@ -66,13 +66,12 @@ v = atand( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atand = require( '@stdlib/math/base/special/atand' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atand = require( '@stdlib/math/base/special/atand' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atand( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atandf/README.md b/lib/node_modules/@stdlib/math/base/special/atandf/README.md index b965842571ca..59c2381c3539 100644 --- a/lib/node_modules/@stdlib/math/base/special/atandf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atandf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atandf = require( '@stdlib/math/base/special/atandf' ); +const atandf = require( '@stdlib/math/base/special/atandf' ); ``` #### atandf( x ) @@ -35,9 +35,9 @@ var atandf = require( '@stdlib/math/base/special/atandf' ); Computes the [arctangent][arctangent] (in degrees) of a single-precision floating-point number. ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var v = atandf( 0.0 ); +let v = atandf( 0.0 ); // returns 0.0 v = atandf( 0.5 ); @@ -67,13 +67,12 @@ v = atandf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atandf = require( '@stdlib/math/base/special/atandf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atandf = require( '@stdlib/math/base/special/atandf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atandf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atanf/README.md b/lib/node_modules/@stdlib/math/base/special/atanf/README.md index 44b711f35823..671e55cfdfaa 100644 --- a/lib/node_modules/@stdlib/math/base/special/atanf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atanf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atanf = require( '@stdlib/math/base/special/atanf' ); +const atanf = require( '@stdlib/math/base/special/atanf' ); ``` #### atanf( x ) @@ -35,7 +35,7 @@ var atanf = require( '@stdlib/math/base/special/atanf' ); Computes the [arctangent][arctangent] of a single-precision floating-point number (in radians). ```javascript -var v = atanf( 0.0 ); +let v = atanf( 0.0 ); // returns 0.0 v = atanf( -3.14/4.0 ); @@ -53,13 +53,12 @@ v = atanf( -3.14/4.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atanf = require( '@stdlib/math/base/special/atanf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atanf = require( '@stdlib/math/base/special/atanf' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atanf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/atanh/README.md b/lib/node_modules/@stdlib/math/base/special/atanh/README.md index c8293d07d78d..2aea4724fb55 100644 --- a/lib/node_modules/@stdlib/math/base/special/atanh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atanh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atanh = require( '@stdlib/math/base/special/atanh' ); +const atanh = require( '@stdlib/math/base/special/atanh' ); ``` #### atanh( x ) @@ -35,7 +35,7 @@ var atanh = require( '@stdlib/math/base/special/atanh' ); Computes the [hyperbolic arctangent][hyperbolic-arctangent] of a double-precision floating-point number. ```javascript -var v = atanh( 0.0 ); +let v = atanh( 0.0 ); // returns 0.0 v = atanh( -0.0 ); @@ -57,7 +57,7 @@ v = atanh( -1.0 ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = atanh( -3.14 ); +const v = atanh( -3.14 ); // returns NaN ``` @@ -72,13 +72,12 @@ var v = atanh( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atanh = require( '@stdlib/math/base/special/atanh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atanh = require( '@stdlib/math/base/special/atanh' ); -var x = linspace( -1.0, 1.0, 103 ); +const x = linspace( -1.0, 1.0, 103 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atanh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/avercos/README.md b/lib/node_modules/@stdlib/math/base/special/avercos/README.md index 8f09d52c82b2..6a32dbfce4de 100644 --- a/lib/node_modules/@stdlib/math/base/special/avercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/avercos/README.md @@ -48,7 +48,7 @@ The [inverse versed cosine][inverse-versed-cosine] is defined as ## Usage ```javascript -var avercos = require( '@stdlib/math/base/special/avercos' ); +const avercos = require( '@stdlib/math/base/special/avercos' ); ``` #### avercos( x ) @@ -56,7 +56,7 @@ var avercos = require( '@stdlib/math/base/special/avercos' ); Computes the [inverse versed cosine][inverse-versed-cosine]. ```javascript -var v = avercos( 0.0 ); +let v = avercos( 0.0 ); // returns 0.0 v = avercos( -3.141592653589793/2.0 ); @@ -69,7 +69,7 @@ v = avercos( -3.141592653589793/6.0 ); If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = avercos( 1.0 ); +let v = avercos( 1.0 ); // returns NaN v = avercos( -3.14 ); @@ -90,13 +90,12 @@ v = avercos( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var avercos = require( '@stdlib/math/base/special/avercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const avercos = require( '@stdlib/math/base/special/avercos' ); -var x = linspace( -2.0, 0.0, 100 ); +const x = linspace( -2.0, 0.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( avercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/avercosf/README.md b/lib/node_modules/@stdlib/math/base/special/avercosf/README.md index b8c015ffb7fc..5ee2d6fdc2a3 100644 --- a/lib/node_modules/@stdlib/math/base/special/avercosf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/avercosf/README.md @@ -48,7 +48,7 @@ The [inverse versed cosine][inverse-versed-cosine] is defined as ## Usage ```javascript -var avercosf = require( '@stdlib/math/base/special/avercosf' ); +const avercosf = require( '@stdlib/math/base/special/avercosf' ); ``` #### avercosf( x ) @@ -56,7 +56,7 @@ var avercosf = require( '@stdlib/math/base/special/avercosf' ); Computes the [inverse versed cosine][inverse-versed-cosine] of a single-precision floating-point number (in radians). ```javascript -var v = avercosf( 0.0 ); +let v = avercosf( 0.0 ); // returns 0.0 v = avercosf( -3.141592653589793 / 2.0 ); @@ -69,7 +69,7 @@ v = avercosf( -3.141592653589793 / 6.0 ); If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = avercosf( 1.0 ); +let v = avercosf( 1.0 ); // returns NaN v = avercosf( -3.14 ); @@ -90,13 +90,12 @@ v = avercosf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var avercosf = require( '@stdlib/math/base/special/avercosf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const avercosf = require( '@stdlib/math/base/special/avercosf' ); -var x = linspace( -2.0, 0.0, 100 ); +const x = linspace( -2.0, 0.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( avercosf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/aversin/README.md b/lib/node_modules/@stdlib/math/base/special/aversin/README.md index 3c07b9ee8f66..673fb40e8469 100644 --- a/lib/node_modules/@stdlib/math/base/special/aversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/aversin/README.md @@ -48,7 +48,7 @@ The [inverse versed sine][inverse-versed-sine] is defined as ## Usage ```javascript -var aversin = require( '@stdlib/math/base/special/aversin' ); +const aversin = require( '@stdlib/math/base/special/aversin' ); ``` #### aversin( x ) @@ -56,7 +56,7 @@ var aversin = require( '@stdlib/math/base/special/aversin' ); Computes the [inverse versed sine][inverse-versed-sine]. ```javascript -var v = aversin( 0.0 ); +let v = aversin( 0.0 ); // returns 0.0 v = aversin( 3.141592653589793/2.0 ); @@ -69,7 +69,7 @@ v = aversin( 3.141592653589793/6.0 ); If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = aversin( -1.0 ); +let v = aversin( -1.0 ); // returns NaN v = aversin( 3.14 ); @@ -90,13 +90,12 @@ v = aversin( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var aversin = require( '@stdlib/math/base/special/aversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const aversin = require( '@stdlib/math/base/special/aversin' ); -var x = linspace( 0.0, 2.0, 100 ); +const x = linspace( 0.0, 2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( aversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/aversinf/README.md b/lib/node_modules/@stdlib/math/base/special/aversinf/README.md index 8f88c8fcb7ec..d1bb8a2de391 100644 --- a/lib/node_modules/@stdlib/math/base/special/aversinf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/aversinf/README.md @@ -43,7 +43,7 @@ The [inverse versed sine][inverse-versed-sine] is defined as ## Usage ```javascript -var aversinf = require( '@stdlib/math/base/special/aversinf' ); +const aversinf = require( '@stdlib/math/base/special/aversinf' ); ``` #### aversinf( x ) @@ -51,7 +51,7 @@ var aversinf = require( '@stdlib/math/base/special/aversinf' ); Computes the [inverse versed sine][inverse-versed-sine] of a single-precision floating-point number (in radians). ```javascript -var v = aversinf( 0.0 ); +let v = aversinf( 0.0 ); // returns 0.0 v = aversinf( 3.141592653589793 / 2.0 ); @@ -64,7 +64,7 @@ v = aversinf( 3.141592653589793 / 6.0 ); If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = aversinf( -1.0 ); +let v = aversinf( -1.0 ); // returns NaN v = aversinf( 3.14 ); @@ -85,13 +85,12 @@ v = aversinf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var aversinf = require( '@stdlib/math/base/special/aversinf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const aversinf = require( '@stdlib/math/base/special/aversinf' ); -var x = linspace( 0.0, 2.0, 100 ); +const x = linspace( 0.0, 2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( aversinf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/bernoulli/README.md b/lib/node_modules/@stdlib/math/base/special/bernoulli/README.md index d5d27336a71d..bf1e8b576093 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoulli/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bernoulli/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var bernoulli = require( '@stdlib/math/base/special/bernoulli' ); +const bernoulli = require( '@stdlib/math/base/special/bernoulli' ); ``` #### bernoulli( n ) @@ -39,7 +39,7 @@ var bernoulli = require( '@stdlib/math/base/special/bernoulli' ); Computes the nth [Bernoulli number][bernoulli-number]. ```javascript -var v = bernoulli( 0 ); +let v = bernoulli( 0 ); // returns 1.0 v = bernoulli( 1 ); @@ -64,7 +64,7 @@ v = bernoulli( 20 ); For even integers `n >= 260`, the function alternates between returning positive and negative infinity, as larger [Bernoulli numbers][bernoulli-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = bernoulli( 260 ); +let v = bernoulli( 260 ); // returns -Infinity v = bernoulli( 262 ); @@ -77,7 +77,7 @@ v = bernoulli( 264 ); If not provided a nonnegative integer value, the function returns `NaN`. ```javascript -var v = bernoulli( 3.14 ); +let v = bernoulli( 3.14 ); // returns NaN v = bernoulli( -1 ); @@ -87,7 +87,7 @@ v = bernoulli( -1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = bernoulli( NaN ); +const v = bernoulli( NaN ); // returns NaN ``` @@ -108,13 +108,10 @@ var v = bernoulli( NaN ); ```javascript -var bernoulli = require( '@stdlib/math/base/special/bernoulli' ); +const bernoulli = require( '@stdlib/math/base/special/bernoulli' ); -var v; -var i; - -for ( i = 0; i < 280; i++ ) { - v = bernoulli( i ); +for ( let i = 0; i < 280; i++ ) { + const v = bernoulli( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/besselj0/README.md b/lib/node_modules/@stdlib/math/base/special/besselj0/README.md index 0355c576eb03..1a0bb787f246 100644 --- a/lib/node_modules/@stdlib/math/base/special/besselj0/README.md +++ b/lib/node_modules/@stdlib/math/base/special/besselj0/README.md @@ -48,7 +48,7 @@ J_0 (x) = \frac{1}{2 \pi} \int_{-\pi}^\pi e^{- i x \sin(\tau)} \,d\tau. ## Usage ```javascript -var j0 = require( '@stdlib/math/base/special/besselj0' ); +const j0 = require( '@stdlib/math/base/special/besselj0' ); ``` #### j0( x ) @@ -56,7 +56,7 @@ var j0 = require( '@stdlib/math/base/special/besselj0' ); Computes the [Bessel function of the first kind][bessel-first-kind] of order zero at `x`. ```javascript -var v = j0( 0.0 ); +let v = j0( 0.0 ); // returns 1.0 v = j0( 1.0 ); @@ -83,14 +83,11 @@ v = j0( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var j0 = require( '@stdlib/math/base/special/besselj0' ); +const randu = require( '@stdlib/random/base/randu' ); +const j0 = require( '@stdlib/math/base/special/besselj0' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; console.log( 'j0(%d) = %d', x, j0( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/besselj1/README.md b/lib/node_modules/@stdlib/math/base/special/besselj1/README.md index 0fd7401bdbe7..64b13bd3ddd4 100644 --- a/lib/node_modules/@stdlib/math/base/special/besselj1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/besselj1/README.md @@ -48,7 +48,7 @@ J_1 (x) = \frac{1}{2 \pi} \int_{-\pi}^\pi e^{i(\tau - x \sin(\tau))} \,d\tau ## Usage ```javascript -var j1 = require( '@stdlib/math/base/special/besselj1' ); +const j1 = require( '@stdlib/math/base/special/besselj1' ); ``` #### j1( x ) @@ -56,7 +56,7 @@ var j1 = require( '@stdlib/math/base/special/besselj1' ); Computes the [Bessel function of the first kind][bessel-first-kind] of order one at `x`. ```javascript -var v = j1( 0.0 ); +let v = j1( 0.0 ); // returns 0.0 v = j1( 1.0 ); @@ -83,14 +83,11 @@ v = j1( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var j1 = require( '@stdlib/math/base/special/besselj1' ); +const randu = require( '@stdlib/random/base/randu' ); +const j1 = require( '@stdlib/math/base/special/besselj1' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; console.log( 'j1(%d) = %d', x, j1( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/bessely0/README.md b/lib/node_modules/@stdlib/math/base/special/bessely0/README.md index c6a00b1d2eb8..1917aaf00ab7 100644 --- a/lib/node_modules/@stdlib/math/base/special/bessely0/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bessely0/README.md @@ -48,7 +48,7 @@ Y_0(x) = \frac{1}{\pi} \int_0^\pi \sin(x \sin\theta) \, d\theta -\frac{2}{\pi} \ ## Usage ```javascript -var y0 = require( '@stdlib/math/base/special/bessely0' ); +const y0 = require( '@stdlib/math/base/special/bessely0' ); ``` #### y0( x ) @@ -56,7 +56,7 @@ var y0 = require( '@stdlib/math/base/special/bessely0' ); Computes the [Bessel function of the second kind][bessel-second-kind] of order zero at `x`. ```javascript -var v = y0( 0.0 ); +let v = y0( 0.0 ); // returns -Infinity v = y0( 1.0 ); @@ -69,7 +69,7 @@ v = y0( Infinity ); If `x < 0` or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = y0( -1.0 ); +let v = y0( -1.0 ); // returns NaN v = y0( -Infinity ); @@ -90,14 +90,11 @@ v = y0( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var y0 = require( '@stdlib/math/base/special/bessely0' ); +const randu = require( '@stdlib/random/base/randu' ); +const y0 = require( '@stdlib/math/base/special/bessely0' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; console.log( 'y0(%d) = %d', x, y0( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/bessely1/README.md b/lib/node_modules/@stdlib/math/base/special/bessely1/README.md index 0b60aa59dc24..ef72b2b85dc0 100644 --- a/lib/node_modules/@stdlib/math/base/special/bessely1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bessely1/README.md @@ -48,7 +48,7 @@ Y_1(x) = \frac{1}{\pi} \int_0^\pi \sin(x \sin\theta - \theta) \, d\theta -\frac{ ## Usage ```javascript -var y1 = require( '@stdlib/math/base/special/bessely1' ); +const y1 = require( '@stdlib/math/base/special/bessely1' ); ``` #### y1( x ) @@ -56,7 +56,7 @@ var y1 = require( '@stdlib/math/base/special/bessely1' ); Computes the [Bessel function of the second kind][bessel-second-kind] of order one at `x`. ```javascript -var v = y1( 0.0 ); +let v = y1( 0.0 ); // returns -Infinity v = y1( 1.0 ); @@ -69,7 +69,7 @@ v = y1( Infinity ); If `x < 0` or `x` is `NaN`, the function returns `NaN`. ```javascript -var v = y1( -1.0 ); +let v = y1( -1.0 ); // returns NaN v = y1( -Infinity ); @@ -91,14 +91,11 @@ v = y1( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var y1 = require( '@stdlib/math/base/special/bessely1' ); +const randu = require( '@stdlib/random/base/randu' ); +const y1 = require( '@stdlib/math/base/special/bessely1' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; console.log( 'y1(%d) = %d', x, y1( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/beta/README.md b/lib/node_modules/@stdlib/math/base/special/beta/README.md index 4fce5f227d44..c25ce9b68393 100644 --- a/lib/node_modules/@stdlib/math/base/special/beta/README.md +++ b/lib/node_modules/@stdlib/math/base/special/beta/README.md @@ -63,7 +63,7 @@ The [beta function][beta-function] is related to the [Gamma function][gamma-func ## Usage ```javascript -var beta = require( '@stdlib/math/base/special/beta' ); +const beta = require( '@stdlib/math/base/special/beta' ); ``` #### beta( x, y ) @@ -71,7 +71,7 @@ var beta = require( '@stdlib/math/base/special/beta' ); Evaluates the [beta function][beta-function]. ```javascript -var val = beta( 0.0, 0.5 ); +let val = beta( 0.0, 0.5 ); // returns Infinity val = beta( 1.0, 1.0 ); @@ -98,12 +98,10 @@ val = beta( 4.0, 1.0 ); ```javascript -var beta = require( '@stdlib/math/base/special/beta' ); -var x; -var y; +const beta = require( '@stdlib/math/base/special/beta' ); -for ( x = 0; x < 10; x++ ) { - for ( y = 10; y > 0; y-- ) { +for ( let x = 0; x < 10; x++ ) { + for ( let y = 10; y > 0; y-- ) { console.log( 'x: %d, \t y: %d, \t f(x,y): %d', x, y, beta( x, y ) ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/betainc/README.md b/lib/node_modules/@stdlib/math/base/special/betainc/README.md index 110e6e29453f..b23e09a38279 100644 --- a/lib/node_modules/@stdlib/math/base/special/betainc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/betainc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var betainc = require( '@stdlib/math/base/special/betainc' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); ``` #### betainc( x, a, b\[, regularized\[, upper]] ) @@ -41,7 +41,7 @@ var betainc = require( '@stdlib/math/base/special/betainc' ); By default, evaluates the regularized lower [incomplete beta function][incomplete-beta-function] for inputs `x`, `a > 0` and `b > 0`. The fourth and fifth parameters of the function can be used to specify whether instead to evaluate the non-regularized and/or upper incomplete beta functions, respectively. ```javascript -var y = betainc( 0.5, 2.0, 2.0 ); +let y = betainc( 0.5, 2.0, 2.0 ); // returns 0.5 y = betainc( 0.5, 2.0, 2.0, false ); @@ -57,7 +57,7 @@ y = betainc( 0.2, 1.0, 2.0, true, true ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = betainc( NaN, 1.0, 1.0 ); +let y = betainc( NaN, 1.0, 1.0 ); // returns NaN y = betainc( 0.8, NaN, 1.0 ); @@ -70,7 +70,7 @@ y = betainc( 0.8, 1.0, NaN ); If provided a `x` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = betainc( 1.5, 1.0, 1.0 ); +let y = betainc( 1.5, 1.0, 1.0 ); // returns NaN y = betainc( -0.5, 1.0, 1.0 ); @@ -80,14 +80,14 @@ y = betainc( -0.5, 1.0, 1.0 ); If provided a negative `a`, the function returns `NaN`. ```javascript -var y = betainc( 0.5, -2.0, 2.0 ); +const y = betainc( 0.5, -2.0, 2.0 ); // returns NaN ``` If provided a negative `b`, the function returns `NaN`. ```javascript -var y = betainc( 0.5, 2.0, -2.0 ); +const y = betainc( 0.5, 2.0, -2.0 ); // returns NaN ``` @@ -102,18 +102,13 @@ var y = betainc( 0.5, 2.0, -2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var betainc = require( '@stdlib/math/base/special/betainc' ); - -var i; -var x; -var a; -var b; - -for ( i = 0; i < 100; i++ ) { - x = randu(); - a = randu() * 10.0; - b = randu() * 10.0; +const randu = require( '@stdlib/random/base/randu' ); +const betainc = require( '@stdlib/math/base/special/betainc' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu(); + const a = randu() * 10.0; + const b = randu() * 10.0; console.log( 'x: %d, \t a: %d, \t b: %d, \t f(x,a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), betainc( x, a, b ).toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md b/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md index ded251fd5f8f..5edc3b710cc1 100644 --- a/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var betaincinv = require( '@stdlib/math/base/special/betaincinv' ); +const betaincinv = require( '@stdlib/math/base/special/betaincinv' ); ``` #### betaincinv( p, a, b\[, upper] ) @@ -41,7 +41,7 @@ var betaincinv = require( '@stdlib/math/base/special/betaincinv' ); Inverts the regularized [incomplete beta function][incomplete-beta-function]. Contrary to the more commonly used definition, in this implementation the first parameter is the probability `p` and the second and third parameter are `a` and `b`. By default, the function inverts the _lower_ regularized [incomplete beta function][incomplete-beta-function]. To invert the _upper_ function instead, set the `upper` argument to `true`. ```javascript -var y = betaincinv( 0.2, 3.0, 3.0 ); +let y = betaincinv( 0.2, 3.0, 3.0 ); // returns ~0.327 y = betaincinv( 0.4, 3.0, 3.0 ); @@ -60,7 +60,7 @@ y = betaincinv( 0.8, 1.0, 6.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = betaincinv( NaN, 1.0, 1.0 ); +let y = betaincinv( NaN, 1.0, 1.0 ); // returns NaN y = betaincinv( 0.5, NaN, 1.0 ); @@ -73,7 +73,7 @@ y = betaincinv( 0.5, 1.0, NaN ); If provided a value outside `[0,1]` for `p`, the function returns `NaN`. ```javascript -var y = betaincinv( 1.2, 1.0, 1.0 ); +let y = betaincinv( 1.2, 1.0, 1.0 ); // returns NaN y = betaincinv( -0.5, 1.0, 1.0 ); @@ -83,7 +83,7 @@ y = betaincinv( -0.5, 1.0, 1.0 ); If provided a nonpositive `a`, the function returns `NaN`. ```javascript -var y = betaincinv( 0.5, -2.0, 2.0 ); +let y = betaincinv( 0.5, -2.0, 2.0 ); // returns NaN y = betaincinv( 0.5, 0.0, 2.0 ); @@ -93,7 +93,7 @@ y = betaincinv( 0.5, 0.0, 2.0 ); If provided a nonpositive `b`, the function returns `NaN`. ```javascript -var y = betaincinv( 0.5, 2.0, -2.0 ); +let y = betaincinv( 0.5, 2.0, -2.0 ); // returns NaN y = betaincinv( 0.5, 2.0, 0.0 ); @@ -111,18 +111,13 @@ y = betaincinv( 0.5, 2.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var betaincinv = require( '@stdlib/math/base/special/betaincinv' ); - -var i; -var p; -var a; -var b; - -for ( i = 0; i < 100; i++ ) { - p = randu(); - a = randu() * 10.0; - b = randu() * 10.0; +const randu = require( '@stdlib/random/base/randu' ); +const betaincinv = require( '@stdlib/math/base/special/betaincinv' ); + +for ( let i = 0; i < 100; i++ ) { + const p = randu(); + const a = randu() * 10.0; + const b = randu() * 10.0; console.log( 'p: %d, \t a: %d, \t b: %d, \t f(p,a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), betaincinv( p, a, b ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/betaln/README.md b/lib/node_modules/@stdlib/math/base/special/betaln/README.md index 6ea15f960c5b..d27f0a10a98c 100644 --- a/lib/node_modules/@stdlib/math/base/special/betaln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/betaln/README.md @@ -63,7 +63,7 @@ The [beta function][beta-function] is related to the [gamma function][gamma-func ## Usage ```javascript -var betaln = require( '@stdlib/math/base/special/betaln' ); +const betaln = require( '@stdlib/math/base/special/betaln' ); ``` #### betaln( x, y ) @@ -71,7 +71,7 @@ var betaln = require( '@stdlib/math/base/special/betaln' ); Evaluates the the [natural logarithm][natural-logarithm] of the [beta function][beta-function]. ```javascript -var val = betaln( 0.0, 0.0 ); +let val = betaln( 0.0, 0.0 ); // returns Infinity val = betaln( 1.0, 1.0 ); @@ -98,12 +98,10 @@ val = betaln( 4.0, 1.0 ); ```javascript -var betaln = require( '@stdlib/math/base/special/betaln' ); -var x; -var y; +const betaln = require( '@stdlib/math/base/special/betaln' ); -for ( x = 0; x < 10; x++ ) { - for ( y = 10; y > 0; y-- ) { +for ( let x = 0; x < 10; x++ ) { + for ( let y = 10; y > 0; y-- ) { console.log( 'x: %d, \t y: %d, \t f(x,y): %d', x, y, betaln( x, y ) ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/binet/README.md b/lib/node_modules/@stdlib/math/base/special/binet/README.md index 9178c104b0c1..f96def90b795 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/README.md +++ b/lib/node_modules/@stdlib/math/base/special/binet/README.md @@ -63,7 +63,7 @@ F_x = \frac{\varphi^x - \varphi^{-x} \cdot \cos(\pi x)}{\sqrt{5}} ## Usage ```javascript -var binet = require( '@stdlib/math/base/special/binet' ); +const binet = require( '@stdlib/math/base/special/binet' ); ``` #### binet( x ) @@ -71,7 +71,7 @@ var binet = require( '@stdlib/math/base/special/binet' ); Evaluates [Binet's formula][fibonacci-number] extended to real numbers. ```javascript -var v = binet( 0.0 ); +let v = binet( 0.0 ); // returns 0.0 v = binet( 1.0 ); @@ -93,7 +93,7 @@ v = binet( 3.14 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = binet( NaN ); +const v = binet( NaN ); // returns NaN ``` @@ -119,13 +119,10 @@ var v = binet( NaN ); ```javascript -var binet = require( '@stdlib/math/base/special/binet' ); +const binet = require( '@stdlib/math/base/special/binet' ); -var v; -var i; - -for ( i = 0; i < 79; i++ ) { - v = binet( i ); +for ( let i = 0; i < 79; i++ ) { + const v = binet( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/binomcoef/README.md b/lib/node_modules/@stdlib/math/base/special/binomcoef/README.md index c95d565c0561..1580e2f9e8fe 100644 --- a/lib/node_modules/@stdlib/math/base/special/binomcoef/README.md +++ b/lib/node_modules/@stdlib/math/base/special/binomcoef/README.md @@ -63,7 +63,7 @@ The [binomial coefficient][binomial-coefficient] can be generalized to negative ## Usage ```javascript -var binomcoef = require( '@stdlib/math/base/special/binomcoef' ); +const binomcoef = require( '@stdlib/math/base/special/binomcoef' ); ``` #### binomcoef( n, k ) @@ -71,7 +71,7 @@ var binomcoef = require( '@stdlib/math/base/special/binomcoef' ); Evaluates the [binomial coefficient][binomial-coefficient] of two integers `n` and `k`. ```javascript -var v = binomcoef( 8, 2 ); +let v = binomcoef( 8, 2 ); // returns 28 v = binomcoef( 0, 0 ); @@ -96,7 +96,7 @@ v = binomcoef( NaN, NaN ); For negative `k`, the function returns `0`. ```javascript -var v = binomcoef( 2, -1 ); +let v = binomcoef( 2, -1 ); // returns 0 v = binomcoef( -3, -1 ); @@ -106,7 +106,7 @@ v = binomcoef( -3, -1 ); The function returns `NaN` for non-integer `n` or `k`. ```javascript -var v = binomcoef( 2, 1.5 ); +let v = binomcoef( 2, 1.5 ); // returns NaN v = binomcoef( 5.5, 2 ); @@ -124,17 +124,13 @@ v = binomcoef( 5.5, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var binomcoef = require( '@stdlib/math/base/special/binomcoef' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const binomcoef = require( '@stdlib/math/base/special/binomcoef' ); -var n; -var k; -var i; - -for ( i = 0; i < 100; i++ ) { - n = round( (randu()*30.0) - 10.0 ); - k = round( randu()*20.0 ); +for ( let i = 0; i < 100; i++ ) { + const n = round( (randu()*30.0) - 10.0 ); + const k = round( randu()*20.0 ); console.log( '%d choose %d = %d', n, k, binomcoef( n, k ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/binomcoefln/README.md b/lib/node_modules/@stdlib/math/base/special/binomcoefln/README.md index 7b2609456a14..f9d51a9ea1c7 100644 --- a/lib/node_modules/@stdlib/math/base/special/binomcoefln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/binomcoefln/README.md @@ -78,7 +78,7 @@ The [binomial coefficient][binomial-coefficient] can be generalized to negative ## Usage ```javascript -var binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); +const binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); ``` #### binomcoefln( n, k ) @@ -86,7 +86,7 @@ var binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); Evaluates the natural logarithm of the [binomial coefficient][binomial-coefficient] of two integers `n` and `k`. ```javascript -var v = binomcoefln( 8, 2 ); +let v = binomcoefln( 8, 2 ); // returns ~3.332 v = binomcoefln( 0, 0 ); @@ -111,7 +111,7 @@ v = binomcoefln( NaN, NaN ); For negative `k`, the function returns `-Infinity`. ```javascript -var v = binomcoefln( 2, -1 ); +let v = binomcoefln( 2, -1 ); // returns -Infinity v = binomcoefln( -3, -1 ); @@ -121,7 +121,7 @@ v = binomcoefln( -3, -1 ); The function returns `NaN` for non-integer `n` or `k`. ```javascript -var v = binomcoefln( 2, 1.5 ); +let v = binomcoefln( 2, 1.5 ); // returns NaN v = binomcoefln( 5.5, 2 ); @@ -139,17 +139,13 @@ v = binomcoefln( 5.5, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); -var n; -var k; -var i; - -for ( i = 0; i < 100; i++ ) { - n = round( (randu()*40.0) - 10.0 ); - k = round( randu()*20.0 ); +for ( let i = 0; i < 100; i++ ) { + const n = round( (randu()*40.0) - 10.0 ); + const k = round( randu()*20.0 ); console.log( 'ln( %d choose %d ) = %d', n, k, binomcoefln( n, k ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/boxcox/README.md b/lib/node_modules/@stdlib/math/base/special/boxcox/README.md index 5bbe1ecc2817..dd8ebcd488f6 100644 --- a/lib/node_modules/@stdlib/math/base/special/boxcox/README.md +++ b/lib/node_modules/@stdlib/math/base/special/boxcox/README.md @@ -48,7 +48,7 @@ The one-parameter [Box-Cox transformation][box-cox-transformation] is defined as ## Usage ```javascript -var boxcox = require( '@stdlib/math/base/special/boxcox' ); +const boxcox = require( '@stdlib/math/base/special/boxcox' ); ``` #### boxcox( x, lambda ) @@ -56,7 +56,7 @@ var boxcox = require( '@stdlib/math/base/special/boxcox' ); Computes a one-parameter [Box-Cox transformation][box-cox-transformation]. ```javascript -var v = boxcox( 1.0, 2.5 ); +let v = boxcox( 1.0, 2.5 ); // returns 0.0 v = boxcox( 4.0, 2.5 ); @@ -88,18 +88,15 @@ v = boxcox( 0.0, -1.0 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var boxcox = require( '@stdlib/math/base/special/boxcox' ); - -var x = incrspace( -1.0, 10.0, 1.0 ); -var l = incrspace( -0.5, 5.0, 0.5 ); - -var b; -var i; -var j; -for ( i = 0; i < x.length; i++ ) { - for ( j = 0; j < l.length; j++ ) { - b = boxcox( x[ i ], l[ j ] ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const boxcox = require( '@stdlib/math/base/special/boxcox' ); + +const x = incrspace( -1.0, 10.0, 1.0 ); +const l = incrspace( -0.5, 5.0, 0.5 ); + +for ( let i = 0; i < x.length; i++ ) { + for ( let j = 0; j < l.length; j++ ) { + const b = boxcox( x[ i ], l[ j ] ); console.log( 'boxcox(%d, %d) = %d', x[ i ], l[ j ], b ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/boxcox1p/README.md b/lib/node_modules/@stdlib/math/base/special/boxcox1p/README.md index 94da61a15cc0..3f3d28fc2121 100644 --- a/lib/node_modules/@stdlib/math/base/special/boxcox1p/README.md +++ b/lib/node_modules/@stdlib/math/base/special/boxcox1p/README.md @@ -48,7 +48,7 @@ A one-parameter [Box-Cox transformation][box-cox-transformation] is defined as ## Usage ```javascript -var boxcox1p = require( '@stdlib/math/base/special/boxcox1p' ); +const boxcox1p = require( '@stdlib/math/base/special/boxcox1p' ); ``` #### boxcox1p( x, lambda ) @@ -56,7 +56,7 @@ var boxcox1p = require( '@stdlib/math/base/special/boxcox1p' ); Computes a one-parameter [Box-Cox transformation][box-cox-transformation] of `1+x`. ```javascript -var v = boxcox1p( 1.0, 2.5 ); +let v = boxcox1p( 1.0, 2.5 ); // returns ~1.8627 v = boxcox1p( 4.0, 2.5 ); @@ -91,18 +91,15 @@ v = boxcox1p( -1.0, -1.0 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var boxcox1p = require( '@stdlib/math/base/special/boxcox1p' ); - -var x = incrspace( -1.0, 10.0, 1.0 ); -var l = incrspace( -0.5, 5.0, 0.5 ); - -var b; -var i; -var j; -for ( i = 0; i < x.length; i++ ) { - for ( j = 0; j < l.length; j++ ) { - b = boxcox1p( x[ i ], l[ j ] ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const boxcox1p = require( '@stdlib/math/base/special/boxcox1p' ); + +const x = incrspace( -1.0, 10.0, 1.0 ); +const l = incrspace( -0.5, 5.0, 0.5 ); + +for ( let i = 0; i < x.length; i++ ) { + for ( let j = 0; j < l.length; j++ ) { + const b = boxcox1p( x[ i ], l[ j ] ); console.log( 'boxcox1p(%d, %d) = %d', x[ i ], l[ j ], b ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/boxcox1pinv/README.md b/lib/node_modules/@stdlib/math/base/special/boxcox1pinv/README.md index c31e2e42407e..7c158b2b5fa8 100644 --- a/lib/node_modules/@stdlib/math/base/special/boxcox1pinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/boxcox1pinv/README.md @@ -48,7 +48,7 @@ To compute the inverse of a one-parameter [Box-Cox transformation][box-cox-trans ## Usage ```javascript -var boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' ); +const boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' ); ``` #### boxcox1pinv( y, lambda ) @@ -56,7 +56,7 @@ var boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' ); Computes the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] for `1+x`. ```javascript -var v = boxcox1pinv( 1.0, 2.5 ); +let v = boxcox1pinv( 1.0, 2.5 ); // returns ~0.6505 v = boxcox1pinv( 4.0, 2.5 ); @@ -94,18 +94,15 @@ v = boxcox1pinv( NaN, 3.1 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' ); - -var y = incrspace( -1.0, 10.0, 1.0 ); -var l = incrspace( -0.5, 5.0, 0.5 ); - -var b; -var i; -var j; -for ( i = 0; i < y.length; i++ ) { - for ( j = 0; j < l.length; j++ ) { - b = boxcox1pinv( y[ i ], l[ j ] ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' ); + +const y = incrspace( -1.0, 10.0, 1.0 ); +const l = incrspace( -0.5, 5.0, 0.5 ); + +for ( let i = 0; i < y.length; i++ ) { + for ( let j = 0; j < l.length; j++ ) { + const b = boxcox1pinv( y[ i ], l[ j ] ); console.log( 'boxcox1pinv(%d, %d) = %d', y[ i ], l[ j ], b ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/boxcoxinv/README.md b/lib/node_modules/@stdlib/math/base/special/boxcoxinv/README.md index 216acafe5863..44460fdcda05 100644 --- a/lib/node_modules/@stdlib/math/base/special/boxcoxinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/boxcoxinv/README.md @@ -48,7 +48,7 @@ To compute the inverse of a one-parameter [Box-Cox transformation][box-cox-trans ## Usage ```javascript -var boxcoxinv = require( '@stdlib/math/base/special/boxcoxinv' ); +const boxcoxinv = require( '@stdlib/math/base/special/boxcoxinv' ); ``` #### boxcoxinv( y, lambda ) @@ -56,7 +56,7 @@ var boxcoxinv = require( '@stdlib/math/base/special/boxcoxinv' ); Computes the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation]. ```javascript -var v = boxcoxinv( 1.0, 2.5 ); +let v = boxcoxinv( 1.0, 2.5 ); // returns ~1.6505 v = boxcoxinv( 4.0, 2.5 ); @@ -94,18 +94,15 @@ v = boxcoxinv( NaN, 3.1 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var boxcoxinv = require( '@stdlib/math/base/special/boxcoxinv' ); - -var y = incrspace( -1.0, 10.0, 1.0 ); -var l = incrspace( -0.5, 5.0, 0.5 ); - -var b; -var i; -var j; -for ( i = 0; i < y.length; i++ ) { - for ( j = 0; j < l.length; j++ ) { - b = boxcoxinv( y[ i ], l[ j ] ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const boxcoxinv = require( '@stdlib/math/base/special/boxcoxinv' ); + +const y = incrspace( -1.0, 10.0, 1.0 ); +const l = incrspace( -0.5, 5.0, 0.5 ); + +for ( let i = 0; i < y.length; i++ ) { + for ( let j = 0; j < l.length; j++ ) { + const b = boxcoxinv( y[ i ], l[ j ] ); console.log( 'boxcoxinv(%d, %d) = %d', y[ i ], l[ j ], b ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/cabs/README.md b/lib/node_modules/@stdlib/math/base/special/cabs/README.md index a94c315fe573..64d58bc52f04 100644 --- a/lib/node_modules/@stdlib/math/base/special/cabs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cabs/README.md @@ -50,7 +50,7 @@ which corresponds to the length of a vector from the origin to a complex value p ## Usage ```javascript -var cabs = require( '@stdlib/math/base/special/cabs' ); +const cabs = require( '@stdlib/math/base/special/cabs' ); ``` #### cabs( z ) @@ -58,9 +58,9 @@ var cabs = require( '@stdlib/math/base/special/cabs' ); Computes an [absolute value][absolute-value] of a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var y = cabs( new Complex128( 5.0, 3.0 ) ); +const y = cabs( new Complex128( 5.0, 3.0 ) ); // returns ~5.83 ``` @@ -77,14 +77,12 @@ var y = cabs( new Complex128( 5.0, 3.0 ) ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cabs = require( '@stdlib/math/base/special/cabs' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const cabs = require( '@stdlib/math/base/special/cabs' ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); console.log( 'cabs(%s) = %d', z.toString(), cabs( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cabs2/README.md b/lib/node_modules/@stdlib/math/base/special/cabs2/README.md index adc6fc65849a..e5a5d2ce040e 100644 --- a/lib/node_modules/@stdlib/math/base/special/cabs2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cabs2/README.md @@ -50,7 +50,7 @@ which corresponds to the length of a vector from the origin to a complex value p ## Usage ```javascript -var cabs2 = require( '@stdlib/math/base/special/cabs2' ); +const cabs2 = require( '@stdlib/math/base/special/cabs2' ); ``` #### cabs2( z ) @@ -58,9 +58,9 @@ var cabs2 = require( '@stdlib/math/base/special/cabs2' ); Computes the squared [absolute value][absolute-value] of a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var y = cabs2( new Complex128( 5.0, 3.0 ) ); +const y = cabs2( new Complex128( 5.0, 3.0 ) ); // returns 34.0 ``` @@ -88,18 +88,15 @@ var y = cabs2( new Complex128( 5.0, 3.0 ) ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var cabs2 = require( '@stdlib/math/base/special/cabs2' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const cabs2 = require( '@stdlib/math/base/special/cabs2' ); // Create a PRNG to generate uniformly distributed pseudorandom integers: -var rand = discreteUniform( -50, 50 ); +const rand = discreteUniform( -50, 50 ); -// Compute the squared absolute value for a set of random numbers... -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand(), rand() ); console.log( 'cabs2(%s) = %d', z.toString(), cabs2( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cabs2f/README.md b/lib/node_modules/@stdlib/math/base/special/cabs2f/README.md index 39cc61ff6c5d..6cab93010537 100644 --- a/lib/node_modules/@stdlib/math/base/special/cabs2f/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cabs2f/README.md @@ -50,7 +50,7 @@ which corresponds to the length of a vector from the origin to a complex value p ## Usage ```javascript -var cabs2f = require( '@stdlib/math/base/special/cabs2f' ); +const cabs2f = require( '@stdlib/math/base/special/cabs2f' ); ``` #### cabs2f( z ) @@ -58,9 +58,9 @@ var cabs2f = require( '@stdlib/math/base/special/cabs2f' ); Computes the squared [absolute value][absolute-value] of a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var y = cabs2f( new Complex64( 5.0, 3.0 ) ); +const y = cabs2f( new Complex64( 5.0, 3.0 ) ); // returns 34.0 ``` @@ -88,18 +88,15 @@ var y = cabs2f( new Complex64( 5.0, 3.0 ) ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var cabs2f = require( '@stdlib/math/base/special/cabs2f' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const cabs2f = require( '@stdlib/math/base/special/cabs2f' ); // Create a PRNG to generate uniformly distributed pseudorandom integers: -var rand = discreteUniform( -50, 50 ); +const rand = discreteUniform( -50, 50 ); -// Compute the squared absolute value for a set of random numbers... -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex64( rand(), rand() ); console.log( 'cabs2f(%s) = %d', z.toString(), cabs2f( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cabsf/README.md b/lib/node_modules/@stdlib/math/base/special/cabsf/README.md index cc4898807d65..423cf1682ffc 100644 --- a/lib/node_modules/@stdlib/math/base/special/cabsf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cabsf/README.md @@ -50,7 +50,7 @@ which corresponds to the length of a vector from the origin to a complex value p ## Usage ```javascript -var cabsf = require( '@stdlib/math/base/special/cabsf' ); +const cabsf = require( '@stdlib/math/base/special/cabsf' ); ``` #### cabsf( z ) @@ -58,9 +58,9 @@ var cabsf = require( '@stdlib/math/base/special/cabsf' ); Computes an [absolute value][absolute-value] of a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); -var y = cabsf( new Complex64( 5.0, 3.0 ) ); +const y = cabsf( new Complex64( 5.0, 3.0 ) ); // returns ~5.83 ``` @@ -77,18 +77,15 @@ var y = cabsf( new Complex64( 5.0, 3.0 ) ); ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var cabsf = require( '@stdlib/math/base/special/cabsf' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const cabsf = require( '@stdlib/math/base/special/cabsf' ); // Create a PRNG to generate uniformly distributed pseudorandom integers: -var rand = discreteUniform( -50, 50 ); +const rand = discreteUniform( -50, 50 ); -// Compute the absolute value for a set of random numbers... -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex64( rand(), rand() ); console.log( 'cabsf(%s) = %d', z.toString(), cabsf( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cbrt/README.md b/lib/node_modules/@stdlib/math/base/special/cbrt/README.md index 9ea5db243a15..e76e35976240 100644 --- a/lib/node_modules/@stdlib/math/base/special/cbrt/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cbrt/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cbrt = require( '@stdlib/math/base/special/cbrt' ); +const cbrt = require( '@stdlib/math/base/special/cbrt' ); ``` #### cbrt( x ) @@ -35,7 +35,7 @@ var cbrt = require( '@stdlib/math/base/special/cbrt' ); Computes the [cube root][cube-root] of a double-precision floating-point number. ```javascript -var v = cbrt( 64.0 ); +let v = cbrt( 64.0 ); // returns 4.0 v = cbrt( 27.0 ); @@ -65,14 +65,11 @@ v = cbrt( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cbrt = require( '@stdlib/math/base/special/cbrt' ); +const randu = require( '@stdlib/random/base/randu' ); +const cbrt = require( '@stdlib/math/base/special/cbrt' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*200.0) - 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*200.0) - 100.0; console.log( 'cbrt(%d) = %d', x, cbrt( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cbrtf/README.md b/lib/node_modules/@stdlib/math/base/special/cbrtf/README.md index 9c3789627d5b..370302b5a9da 100644 --- a/lib/node_modules/@stdlib/math/base/special/cbrtf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cbrtf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cbrtf = require( '@stdlib/math/base/special/cbrtf' ); +const cbrtf = require( '@stdlib/math/base/special/cbrtf' ); ``` #### cbrtf( x ) @@ -35,7 +35,7 @@ var cbrtf = require( '@stdlib/math/base/special/cbrtf' ); Computes the [cube root][cube-root] of a single-precision floating-point number. ```javascript -var v = cbrtf( 64.0 ); +let v = cbrtf( 64.0 ); // returns 4.0 v = cbrtf( 27.0 ); @@ -65,14 +65,11 @@ v = cbrtf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cbrtf = require( '@stdlib/math/base/special/cbrtf' ); +const randu = require( '@stdlib/random/base/randu' ); +const cbrtf = require( '@stdlib/math/base/special/cbrtf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*200.0) - 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*200.0) - 100.0; console.log( 'cbrt(%d) = %d', x, cbrtf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cceil/README.md b/lib/node_modules/@stdlib/math/base/special/cceil/README.md index decfb5c41ead..354feaa8daed 100644 --- a/lib/node_modules/@stdlib/math/base/special/cceil/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cceil/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cceil = require( '@stdlib/math/base/special/cceil' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); ``` #### cceil( z ) @@ -35,17 +35,17 @@ var cceil = require( '@stdlib/math/base/special/cceil' ); Rounds each component of a double-precision complex floating-point number toward positive infinity. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cceil( new Complex128( -1.5, 2.5 ) ); +const v = cceil( new Complex128( -1.5, 2.5 ) ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 3.0 ``` @@ -60,16 +60,14 @@ var im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); -var rand = uniform( -50.0, 50.0 ); +const rand = uniform( -50.0, 50.0 ); -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand(), rand() ); console.log( 'cceil(%s) = %s', z, cceil( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cceilf/README.md b/lib/node_modules/@stdlib/math/base/special/cceilf/README.md index a7c08ee41be0..c27993b4d353 100644 --- a/lib/node_modules/@stdlib/math/base/special/cceilf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cceilf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); ``` #### cceilf( z ) @@ -35,17 +35,17 @@ var cceilf = require( '@stdlib/math/base/special/cceilf' ); Rounds a single-precision complex floating-point number toward positive infinity. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const real = require( '@stdlib/complex/float32/real' ); +const imag = require( '@stdlib/complex/float32/imag' ); -var v = cceilf( new Complex64( -1.5, 2.5 ) ); +const v = cceilf( new Complex64( -1.5, 2.5 ) ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 3.0 ``` @@ -60,16 +60,14 @@ var im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); -var rand = uniform( -50.0, 50.0 ); +const rand = uniform( -50.0, 50.0 ); -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex64( rand(), rand() ); console.log( 'cceilf(%s) = %s', z, cceilf( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cceiln/README.md b/lib/node_modules/@stdlib/math/base/special/cceiln/README.md index 96d75e686d3c..f5a0862b6d7b 100644 --- a/lib/node_modules/@stdlib/math/base/special/cceiln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cceiln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cceiln = require( '@stdlib/math/base/special/cceiln' ); +const cceiln = require( '@stdlib/math/base/special/cceiln' ); ``` #### cceiln( z, n ) @@ -35,19 +35,19 @@ var cceiln = require( '@stdlib/math/base/special/cceiln' ); Rounds each component of a double-precision complex floating-point number to the nearest multiple of `10^n` toward positive infinity. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Round components to 2 decimal places: -var z = new Complex128( -3.141592653589793, 3.141592653589793 ); -var v = cceiln( z, -2 ); +let z = new Complex128( -3.141592653589793, 3.141592653589793 ); +let v = cceiln( z, -2 ); // returns -var re = real( v ); +let re = real( v ); // returns -3.14 -var im = imag( v ); +let im = imag( v ); // returns 3.15 // If n = 0, `cceiln` behaves like `cceil`: @@ -93,21 +93,21 @@ im = imag( v ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var Complex128 = require( '@stdlib/complex/float64/ctor' ); - var real = require( '@stdlib/complex/float64/real' ); - var imag = require( '@stdlib/complex/float64/imag' ); + const Complex128 = require( '@stdlib/complex/float64/ctor' ); + const real = require( '@stdlib/complex/float64/real' ); + const imag = require( '@stdlib/complex/float64/imag' ); - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round components to 0.3: - var v = cceiln( new Complex128( x, x ), -16 ); + const v = cceiln( new Complex128( x, x ), -16 ); // returns - var re = real( v ); + const re = real( v ); // returns 0.3000000000000001 - var im = imag( v ); + const im = imag( v ); // returns 0.3000000000000001 ``` @@ -122,21 +122,18 @@ im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var cceiln = require( '@stdlib/math/base/special/cceiln' ); - -var rand1 = uniform( -50.0, 50.0 ); -var rand2 = discreteUniform( -5.0, 0.0 ); - -var z; -var i; -var n; -for ( i = 0; i < 100; i++ ) { - n = rand2(); - z = new Complex128( rand1(), rand1() ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const cceiln = require( '@stdlib/math/base/special/cceiln' ); + +const rand1 = uniform( -50.0, 50.0 ); +const rand2 = discreteUniform( -5.0, 0.0 ); + +for ( let i = 0; i < 100; i++ ) { + const n = rand2(); + const z = new Complex128( rand1(), rand1() ); console.log( 'cceiln(%s, %s) = %s', z, n, cceiln( z, n ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/README.md b/lib/node_modules/@stdlib/math/base/special/ccis/README.md index c9fe8cf31be2..175b3b6a4570 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ccis/README.md @@ -48,7 +48,7 @@ The [cis][cis] function is defined as ## Usage ```javascript -var ccis = require( '@stdlib/math/base/special/ccis' ); +const ccis = require( '@stdlib/math/base/special/ccis' ); ``` #### ccis( z ) @@ -56,19 +56,19 @@ var ccis = require( '@stdlib/math/base/special/ccis' ); Evaluates the [cis][cis] function for a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var z = new Complex128( 0.0, 0.0 ); +let z = new Complex128( 0.0, 0.0 ); -var v = ccis( z ); +let v = ccis( z ); // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns 0.0 z = new Complex128( 1.0, 0.0 ); @@ -94,17 +94,13 @@ im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var ccis = require( '@stdlib/math/base/special/ccis' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const ccis = require( '@stdlib/math/base/special/ccis' ); -var z1; -var z2; -var i; - -for ( i = 0; i < 100; i++ ) { - z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); - z2 = ccis( z1 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); + const z2 = ccis( z1 ); console.log( 'ccis(%s) = %s', z1.toString(), z2.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/README.md b/lib/node_modules/@stdlib/math/base/special/ceil/README.md index a05b90c5d67f..997fa9fbb1f0 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceil/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceil = require( '@stdlib/math/base/special/ceil' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); ``` #### ceil( x ) @@ -35,7 +35,7 @@ var ceil = require( '@stdlib/math/base/special/ceil' ); Rounds a double-precision floating-point number toward positive infinity. ```javascript -var v = ceil( -4.2 ); +let v = ceil( -4.2 ); // returns -4.0 v = ceil( 9.99999 ); @@ -59,14 +59,11 @@ v = ceil( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'ceil(%d) = %d', x, ceil( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceil10/README.md b/lib/node_modules/@stdlib/math/base/special/ceil10/README.md index 538ba1c3541c..15e9430f2e86 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceil10/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceil10 = require( '@stdlib/math/base/special/ceil10' ); +const ceil10 = require( '@stdlib/math/base/special/ceil10' ); ``` #### ceil10( x ) @@ -35,7 +35,7 @@ var ceil10 = require( '@stdlib/math/base/special/ceil10' ); Rounds a `numeric` value to the nearest power of `10` toward positive infinity. ```javascript -var v = ceil10( -4.2 ); +let v = ceil10( -4.2 ); // returns -1.0 v = ceil10( -4.5 ); @@ -83,7 +83,7 @@ v = ceil10( NaN ); - The function may not return accurate results for subnormals due to a general loss in precision. ```javascript - var v = ceil10( -1.0e-323 ); // should return -1.0e-323 + const v = ceil10( -1.0e-323 ); // should return -1.0e-323 // returns -0.0 ``` @@ -98,16 +98,12 @@ v = ceil10( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil10 = require( '@stdlib/math/base/special/ceil10' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil10 = require( '@stdlib/math/base/special/ceil10' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = ceil10( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = ceil10( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceil2/README.md b/lib/node_modules/@stdlib/math/base/special/ceil2/README.md index 8a4ccf519524..5b858a15663c 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceil2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceil2 = require( '@stdlib/math/base/special/ceil2' ); +const ceil2 = require( '@stdlib/math/base/special/ceil2' ); ``` #### ceil2( x ) @@ -35,7 +35,7 @@ var ceil2 = require( '@stdlib/math/base/special/ceil2' ); Rounds a `numeric` value to the nearest power of two toward positive infinity. ```javascript -var v = ceil2( -4.2 ); +let v = ceil2( -4.2 ); // returns -4.0 v = ceil2( -4.5 ); @@ -83,16 +83,12 @@ v = ceil2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil2 = require( '@stdlib/math/base/special/ceil2' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil2 = require( '@stdlib/math/base/special/ceil2' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = ceil2( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = ceil2( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceilb/README.md b/lib/node_modules/@stdlib/math/base/special/ceilb/README.md index 164983ab8eb4..6c3acb5f155f 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceilb = require( '@stdlib/math/base/special/ceilb' ); +const ceilb = require( '@stdlib/math/base/special/ceilb' ); ``` #### ceilb( x, n, b ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `b^n` toward positive infini ```javascript // Round a value to 4 decimal places: -var v = ceilb( 3.141592653589793, -4, 10 ); +let v = ceilb( 3.141592653589793, -4, 10 ); // returns 3.1416 // If n = 0 or b = 1, `ceilb` behaves like `ceil`: @@ -59,11 +59,11 @@ v = ceilb( 5.0, 1, 2 ); - Due to rounding error in [floating-point numbers][ieee754], rounding may **not** be exact. For example, ```javascript - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round to 0.3... - var v = ceilb( x, -16, 10 ); + const v = ceilb( x, -16, 10 ); // returns 0.3000000000000001 ``` @@ -78,22 +78,16 @@ v = ceilb( 5.0, 1, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var ceilb = require( '@stdlib/math/base/special/ceilb' ); - -var x; -var n; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = round( (randu()*10.0) - 5.0 ); - b = round( randu()*10.0 ); - v = ceilb( x, n, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const ceilb = require( '@stdlib/math/base/special/ceilb' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = round( (randu()*10.0) - 5.0 ); + const b = round( randu()*10.0 ); + const v = ceilb( x, n, b ); console.log( 'x: %d. %d^%d: %d. Rounded: %d.', x, b, n, pow( b, n ), v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/README.md b/lib/node_modules/@stdlib/math/base/special/ceilf/README.md index 04164dc74507..6304236f749e 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceilf = require( '@stdlib/math/base/special/ceilf' ); +const ceilf = require( '@stdlib/math/base/special/ceilf' ); ``` #### ceilf( x ) @@ -35,7 +35,7 @@ var ceilf = require( '@stdlib/math/base/special/ceilf' ); Rounds a single-precision floating-point number toward positive infinity. ```javascript -var v = ceilf( -4.2 ); +let v = ceilf( -4.2 ); // returns -4.0 v = ceilf( 9.99999 ); @@ -59,14 +59,11 @@ v = ceilf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceilf = require( '@stdlib/math/base/special/ceilf' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceilf = require( '@stdlib/math/base/special/ceilf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'ceilf(%d) = %d', x, ceilf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/README.md b/lib/node_modules/@stdlib/math/base/special/ceiln/README.md index 1e92fe9ad0f4..1390560ae63f 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceiln = require( '@stdlib/math/base/special/ceiln' ); +const ceiln = require( '@stdlib/math/base/special/ceiln' ); ``` #### ceiln( x, n ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `10^n` toward positive infin ```javascript // Round a value to 2 decimal places: -var v = ceiln( 3.141592653589793, -2 ); +let v = ceiln( 3.141592653589793, -2 ); // returns 3.15 // If n = 0, `ceiln` behaves like `ceil`: @@ -59,11 +59,11 @@ v = ceiln( 12368.0, 3 ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round to 0.3: - var v = ceiln( x, -16 ); + const v = ceiln( x, -16 ); // returns 0.3000000000000001 ``` @@ -78,18 +78,13 @@ v = ceiln( 12368.0, 3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceiln = require( '@stdlib/math/base/special/ceiln' ); - -var x; -var n; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = ceiln( randu()*5.0, 0 ); - v = ceiln( x, -n ); +const randu = require( '@stdlib/random/base/randu' ); +const ceiln = require( '@stdlib/math/base/special/ceiln' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = ceiln( randu()*5.0, 0 ); + const v = ceiln( x, -n ); console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ceilsd/README.md b/lib/node_modules/@stdlib/math/base/special/ceilsd/README.md index 3a60c3bab29a..03819e408eaa 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilsd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ceilsd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ceilsd = require( '@stdlib/math/base/special/ceilsd' ); +const ceilsd = require( '@stdlib/math/base/special/ceilsd' ); ``` #### ceilsd( x, n, b ) @@ -35,7 +35,7 @@ var ceilsd = require( '@stdlib/math/base/special/ceilsd' ); Rounds a `numeric` value to the nearest `number` toward positive infinity with `n` significant figures. ```javascript -var v = ceilsd( 3.141592653589793, 5, 10 ); +let v = ceilsd( 3.141592653589793, 5, 10 ); // returns 3.1416 v = ceilsd( 3.141592653589793, 1, 10 ); @@ -65,16 +65,12 @@ v = ceilsd( 0.0313, 2, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceilsd = require( '@stdlib/math/base/special/ceilsd' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceilsd = require( '@stdlib/math/base/special/ceilsd' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10000.0) - 5000.0; - y = ceilsd( x, 5, 10 ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10000.0) - 5000.0; + const y = ceilsd( x, 5, 10 ); console.log( 'x: %d. Rounded: %d.', x, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cexp/README.md b/lib/node_modules/@stdlib/math/base/special/cexp/README.md index bf456fc1682e..dcfed590b5d1 100644 --- a/lib/node_modules/@stdlib/math/base/special/cexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cexp/README.md @@ -48,7 +48,7 @@ The [exponential][exponential-function] function of a complex number is defined ## Usage ```javascript -var cexp = require( '@stdlib/math/base/special/cexp' ); +const cexp = require( '@stdlib/math/base/special/cexp' ); ``` #### cexp( z ) @@ -56,17 +56,17 @@ var cexp = require( '@stdlib/math/base/special/cexp' ); Evaluates the [exponential][exponential-function] function for a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cexp( new Complex128( 0.0, 0.0 ) ); +let v = cexp( new Complex128( 0.0, 0.0 ) ); // returns -var re = real( v ); +let re = real( v ); // returns 1.0 -var im = imag( v ); +let im = imag( v ); // returns 0.0 v = cexp( new Complex128( 0.0, 1.0 ) ); @@ -90,22 +90,19 @@ im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cexp = require( '@stdlib/math/base/special/cexp' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const cexp = require( '@stdlib/math/base/special/cexp' ); function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); + const re = discreteUniform( -50, 50 ); + const im = discreteUniform( -50, 50 ); return new Complex128( re, im ); } -var z1; -var z2; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = randomComplex(); - z2 = cexp( z1 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = randomComplex(); + const z2 = cexp( z1 ); console.log( 'cexp(%s) = %s', z1.toString(), z2.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cflipsign/README.md b/lib/node_modules/@stdlib/math/base/special/cflipsign/README.md index d9f3fa94ef2a..ee273d57d8bc 100644 --- a/lib/node_modules/@stdlib/math/base/special/cflipsign/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cflipsign/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var cflipsign = require( '@stdlib/math/base/special/cflipsign' ); +const cflipsign = require( '@stdlib/math/base/special/cflipsign' ); ``` #### cflipsign( z, y ) @@ -45,17 +45,17 @@ var cflipsign = require( '@stdlib/math/base/special/cflipsign' ); Returns a double-precision complex floating-point number with the same magnitude as `z` and the sign of `y*z`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cflipsign( new Complex128( -4.2, 5.5 ), -1.0 ); +const v = cflipsign( new Complex128( -4.2, 5.5 ), -1.0 ); // returns -var re = real( v ); +const re = real( v ); // returns 4.2 -var im = imag( v ); +const im = imag( v ); // returns -5.5 ``` @@ -80,18 +80,15 @@ var im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var cflipsign = require( '@stdlib/math/base/special/cflipsign' ); - -var rand = uniform( -50.0, 50.0 ); - -var z; -var y; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand(), rand() ); - y = rand(); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const cflipsign = require( '@stdlib/math/base/special/cflipsign' ); + +const rand = uniform( -50.0, 50.0 ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand(), rand() ); + const y = rand(); console.log( 'cflipsign(%s, %d) = %s', z, y, cflipsign( z, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cflipsignf/README.md b/lib/node_modules/@stdlib/math/base/special/cflipsignf/README.md index 9b29081993b1..bb98536b07dc 100644 --- a/lib/node_modules/@stdlib/math/base/special/cflipsignf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cflipsignf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var cflipsignf = require( '@stdlib/math/base/special/cflipsignf' ); +const cflipsignf = require( '@stdlib/math/base/special/cflipsignf' ); ``` #### cflipsignf( z, y ) @@ -45,17 +45,17 @@ var cflipsignf = require( '@stdlib/math/base/special/cflipsignf' ); Returns a single-precision complex floating-point number with the same magnitude as `z` and the sign of `y*z`. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const real = require( '@stdlib/complex/float32/real' ); +const imag = require( '@stdlib/complex/float32/imag' ); -var v = cflipsignf( new Complex64( -4.0, 5.0 ), -1.0 ); +const v = cflipsignf( new Complex64( -4.0, 5.0 ), -1.0 ); // returns -var re = real( v ); +const re = real( v ); // returns 4.0 -var im = imag( v ); +const im = imag( v ); // returns -5.0 ``` @@ -80,18 +80,15 @@ var im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cflipsignf = require( '@stdlib/math/base/special/cflipsignf' ); - -var rand = uniform( -50.0, 50.0 ); - -var z; -var y; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( rand(), rand() ); - y = rand(); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cflipsignf = require( '@stdlib/math/base/special/cflipsignf' ); + +const rand = uniform( -50.0, 50.0 ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex64( rand(), rand() ); + const y = rand(); console.log( 'cflipsignf(%s, %d) = %s', z, y, cflipsignf( z, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cfloor/README.md b/lib/node_modules/@stdlib/math/base/special/cfloor/README.md index d404f68efc18..da733686cb7b 100644 --- a/lib/node_modules/@stdlib/math/base/special/cfloor/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cfloor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cfloor = require( '@stdlib/math/base/special/cfloor' ); +const cfloor = require( '@stdlib/math/base/special/cfloor' ); ``` #### cfloor( z ) @@ -35,17 +35,17 @@ var cfloor = require( '@stdlib/math/base/special/cfloor' ); Rounds a double-precision complex floating-point number toward negative infinity. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cfloor( new Complex128( -4.2, 5.5 ) ); +let v = cfloor( new Complex128( -4.2, 5.5 ) ); // returns -var re = real( v ); +let re = real( v ); // returns -5.0 -var im = imag( v ); +let im = imag( v ); // returns 5.0 v = cfloor( new Complex128( 9.99999, 0.1 ) ); @@ -87,21 +87,15 @@ im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var cfloor = require( '@stdlib/math/base/special/cfloor' ); - -var re; -var im; -var z; -var w; -var i; - -for ( i = 0; i < 100; i++ ) { - re = ( randu()*100.0 ) - 50.0; - im = ( randu()*100.0 ) - 50.0; - z = new Complex128( re, im ); - w = cfloor( z ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const randu = require( '@stdlib/random/base/randu' ); +const cfloor = require( '@stdlib/math/base/special/cfloor' ); + +for ( let i = 0; i < 100; i++ ) { + const re = ( randu()*100.0 ) - 50.0; + const im = ( randu()*100.0 ) - 50.0; + const z = new Complex128( re, im ); + const w = cfloor( z ); console.log( 'floor(%s) = %s', z.toString(), w.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cfloorn/README.md b/lib/node_modules/@stdlib/math/base/special/cfloorn/README.md index 24d6f4373898..cd285e93b6b8 100644 --- a/lib/node_modules/@stdlib/math/base/special/cfloorn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cfloorn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cfloorn = require( '@stdlib/math/base/special/cfloorn' ); +const cfloorn = require( '@stdlib/math/base/special/cfloorn' ); ``` #### cfloorn( z, n ) @@ -35,18 +35,18 @@ var cfloorn = require( '@stdlib/math/base/special/cfloorn' ); Rounds each component of a double-precision complex floating-point number to the nearest multiple of `10^n` toward negative infinity. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); // Round components to 2 decimal places: -var v = cfloorn( new Complex128( -3.141592653589793, 3.141592653589793 ), -2 ); +let v = cfloorn( new Complex128( -3.141592653589793, 3.141592653589793 ), -2 ); // returns -var re = real( v ); +let re = real( v ); // returns -3.15 -var im = imag( v ); +let im = imag( v ); // returns 3.14 // If n = 0, `cfloorn` behaves like `cfloor`: @@ -90,21 +90,21 @@ im = imag( v ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var Complex128 = require( '@stdlib/complex/float64/ctor' ); - var real = require( '@stdlib/complex/float64/real' ); - var imag = require( '@stdlib/complex/float64/imag' ); + const Complex128 = require( '@stdlib/complex/float64/ctor' ); + const real = require( '@stdlib/complex/float64/real' ); + const imag = require( '@stdlib/complex/float64/imag' ); - var x = -0.2 - 0.1; + const x = -0.2 - 0.1; // returns -0.30000000000000004 // Should round components to 0.3: - var v = cfloorn( new Complex128( x, x ), -16 ); + const v = cfloorn( new Complex128( x, x ), -16 ); // returns - var re = real( v ); + const re = real( v ); // returns -0.3000000000000001 - var im = imag( v ); + const im = imag( v ); // returns -0.3000000000000001 ``` @@ -119,23 +119,18 @@ im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var cfloorn = require( '@stdlib/math/base/special/cfloorn' ); -var randint = require( '@stdlib/random/base/discrete-uniform' ); - -var z; -var w; -var n; -var i; - -for ( i = 0; i < 100; i++ ) { - z = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); - - n = randint( -5.0, 0.0 ); - w = cfloorn( z, n ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const randu = require( '@stdlib/random/base/randu' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const cfloorn = require( '@stdlib/math/base/special/cfloorn' ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); + + const n = randint( -5.0, 0.0 ); + const w = cfloorn( z, n ); console.log( 'floorn(%s,%s) = %s', z.toString(), n.toString(), w.toString() ); } diff --git a/lib/node_modules/@stdlib/math/base/special/cidentity/README.md b/lib/node_modules/@stdlib/math/base/special/cidentity/README.md index 9452e038deec..eec0a8e700b8 100644 --- a/lib/node_modules/@stdlib/math/base/special/cidentity/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cidentity/README.md @@ -50,7 +50,7 @@ for all `z`. ## Usage ```javascript -var cidentity = require( '@stdlib/math/base/special/cidentity' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); ``` #### cidentity( z ) @@ -58,17 +58,17 @@ var cidentity = require( '@stdlib/math/base/special/cidentity' ); Evaluates the [identity function][identity-function] for a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cidentity( new Complex128( -1.0, 2.0 ) ); +const v = cidentity( new Complex128( -1.0, 2.0 ) ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -85,14 +85,12 @@ var im = imag( v ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var cidentity = require( '@stdlib/math/base/special/cidentity' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); console.log( 'identity(%s) = %s', z, cidentity( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cidentityf/README.md b/lib/node_modules/@stdlib/math/base/special/cidentityf/README.md index 564da3e93c09..3d0df9af7a2a 100644 --- a/lib/node_modules/@stdlib/math/base/special/cidentityf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cidentityf/README.md @@ -50,7 +50,7 @@ for all `z`. ## Usage ```javascript -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); ``` #### cidentityf( z ) @@ -58,17 +58,17 @@ var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); Evaluates the [identity function][identity-function] for a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const real = require( '@stdlib/complex/float32/real' ); +const imag = require( '@stdlib/complex/float32/imag' ); -var v = cidentityf( new Complex64( -1.0, 2.0 ) ); +const v = cidentityf( new Complex64( -1.0, 2.0 ) ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -83,14 +83,12 @@ var im = imag( v ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); console.log( 'identity(%s) = %s', z, cidentityf( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cinv/README.md b/lib/node_modules/@stdlib/math/base/special/cinv/README.md index 51c4073062c6..5220592f6e3e 100644 --- a/lib/node_modules/@stdlib/math/base/special/cinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cinv/README.md @@ -44,7 +44,7 @@ The inverse (or reciprocal) of a non-zero complex number `z = a + bi` is defined ## Usage ```javascript -var cinv = require( '@stdlib/math/base/special/cinv' ); +const cinv = require( '@stdlib/math/base/special/cinv' ); ``` #### cinv( z ) @@ -52,17 +52,17 @@ var cinv = require( '@stdlib/math/base/special/cinv' ); Computes the inverse of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cinv( new Complex128( 2.0, 4.0 ) ); +const v = cinv( new Complex128( 2.0, 4.0 ) ); // returns -var re = real( v ); +const re = real( v ); // returns 0.1 -var im = imag( v ); +const im = imag( v ); // returns -0.2 ``` @@ -77,17 +77,13 @@ var im = imag( v ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var cinv = require( '@stdlib/math/base/special/cinv' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const cinv = require( '@stdlib/math/base/special/cinv' ); -var z1; -var z2; -var i; - -for ( i = 0; i < 100; i++ ) { - z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); - z2 = cinv( z1 ); +for ( let i = 0; i < 100; i++ ) { + const z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); + const z2 = cinv( z1 ); console.log( '1.0 / (%s) = %s', z1.toString(), z2.toString() ); } diff --git a/lib/node_modules/@stdlib/math/base/special/clamp/README.md b/lib/node_modules/@stdlib/math/base/special/clamp/README.md index a2fde4940bbe..9f00697f7da1 100644 --- a/lib/node_modules/@stdlib/math/base/special/clamp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/clamp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var clamp = require( '@stdlib/math/base/special/clamp' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); ``` #### clamp( v, min, max ) @@ -45,7 +45,7 @@ var clamp = require( '@stdlib/math/base/special/clamp' ); Restricts a double-precision floating-point number to a specified range. ```javascript -var v = clamp( 3.14, 0.0, 5.0 ); +let v = clamp( 3.14, 0.0, 5.0 ); // returns 3.14 v = clamp( -3.14, 0.0, 5.0 ); @@ -64,7 +64,7 @@ v = clamp( 0.0, -3.14, -0.0 ); If provided `NaN` for any argument, the function returns `NaN`. ```javascript -var v = clamp( NaN, 0.0, 5.0 ); +let v = clamp( NaN, 0.0, 5.0 ); // returns NaN v = clamp( 0.0, NaN, 5.0 ); @@ -95,18 +95,13 @@ v = clamp( 3.14, 0.0, NaN ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var clamp = require( '@stdlib/math/base/special/clamp' ); - -var min; -var max; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - min = discreteUniform( 0.0, 10.0 ); - max = discreteUniform( 5.0, 15.0 ); - v = discreteUniform( -20.0, 20.0 ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); + +for ( let i = 0; i < 100; i++ ) { + const min = discreteUniform( 0.0, 10.0 ); + const max = discreteUniform( 5.0, 15.0 ); + const v = discreteUniform( -20.0, 20.0 ); console.log( 'clamp(%d,%d,%d) => %d', v, min, max, clamp( v, min, max ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/clampf/README.md b/lib/node_modules/@stdlib/math/base/special/clampf/README.md index 6d106b3cb4f5..358955a44ea4 100644 --- a/lib/node_modules/@stdlib/math/base/special/clampf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/clampf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var clampf = require( '@stdlib/math/base/special/clampf' ); +const clampf = require( '@stdlib/math/base/special/clampf' ); ``` #### clampf( v, min, max ) @@ -45,7 +45,7 @@ var clampf = require( '@stdlib/math/base/special/clampf' ); Restricts a single-precision floating-point number to a specified range. ```javascript -var v = clampf( 3.0, 0.0, 5.0 ); +let v = clampf( 3.0, 0.0, 5.0 ); // returns 3.0 v = clampf( -3.0, 0.0, 5.0 ); @@ -64,7 +64,7 @@ v = clampf( 0.0, -3.0, -0.0 ); If provided `NaN` for any argument, the function returns `NaN`. ```javascript -var v = clampf( NaN, 0.0, 5.0 ); +let v = clampf( NaN, 0.0, 5.0 ); // returns NaN v = clampf( 0.0, NaN, 5.0 ); @@ -95,18 +95,13 @@ v = clampf( 3.14, 0.0, NaN ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var clampf = require( '@stdlib/math/base/special/clampf' ); - -var min; -var max; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - min = discreteUniform( 0.0, 10.0 ); - max = discreteUniform( 5.0, 15.0 ); - v = discreteUniform( -20.0, 20.0 ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const clampf = require( '@stdlib/math/base/special/clampf' ); + +for ( let i = 0; i < 100; i++ ) { + const min = discreteUniform( 0.0, 10.0 ); + const max = discreteUniform( 5.0, 15.0 ); + const v = discreteUniform( -20.0, 20.0 ); console.log( 'clampf(%d,%d,%d) => %d', v, min, max, clampf( v, min, max ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/copysign/README.md b/lib/node_modules/@stdlib/math/base/special/copysign/README.md index 9cba72585a3b..152a7da4350d 100644 --- a/lib/node_modules/@stdlib/math/base/special/copysign/README.md +++ b/lib/node_modules/@stdlib/math/base/special/copysign/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var copysign = require( '@stdlib/math/base/special/copysign' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); ``` #### copysign( x, y ) @@ -35,7 +35,7 @@ var copysign = require( '@stdlib/math/base/special/copysign' ); Returns a [double-precision floating-point number][ieee754] with the magnitude of `x` and the sign of `y`. ```javascript -var z = copysign( -3.14, 10.0 ); +let z = copysign( -3.14, 10.0 ); // returns 3.14 z = copysign( 3.14, -1.0 ); @@ -72,19 +72,14 @@ z = copysign( -0.0, 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var copysign = require( '@stdlib/math/base/special/copysign' ); - -var x; -var y; -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); // Generate random double-precision floating-point numbers `x` and `y` and copy the sign of `y` to `x`... -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - y = (randu()*10.0) - 5.0; - z = copysign( x, y ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const y = (randu()*10.0) - 5.0; + const z = copysign( x, y ); console.log( 'x: %d, y: %d => %d', x, y, z ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/copysignf/README.md b/lib/node_modules/@stdlib/math/base/special/copysignf/README.md index 040248563f6e..ad9008aafb8c 100644 --- a/lib/node_modules/@stdlib/math/base/special/copysignf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/copysignf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var copysignf = require( '@stdlib/math/base/special/copysignf' ); +const copysignf = require( '@stdlib/math/base/special/copysignf' ); ``` #### copysignf( x, y ) @@ -35,7 +35,7 @@ var copysignf = require( '@stdlib/math/base/special/copysignf' ); Returns a [single-precision floating-point number][ieee754] with the magnitude of `x` and the sign of `y`. ```javascript -var z = copysignf( -3.0, 10.0 ); +let z = copysignf( -3.0, 10.0 ); // returns 3.0 z = copysignf( 3.0, -1.0 ); @@ -72,19 +72,14 @@ z = copysignf( -0.0, 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var copysignf = require( '@stdlib/math/base/special/copysignf' ); - -var x; -var y; -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const copysignf = require( '@stdlib/math/base/special/copysignf' ); // Generate random numbers `x` and `y` and copy the sign of `y` to `x`... -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - y = (randu()*10.0) - 5.0; - z = copysignf( x, y ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const y = (randu()*10.0) - 5.0; + const z = copysignf( x, y ); console.log( 'x: %d, y: %d => %d', x, y, z ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cos/README.md b/lib/node_modules/@stdlib/math/base/special/cos/README.md index d0abf8af4039..c870a0da505f 100644 --- a/lib/node_modules/@stdlib/math/base/special/cos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cos/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cos = require( '@stdlib/math/base/special/cos' ); +const cos = require( '@stdlib/math/base/special/cos' ); ``` #### cos( x ) @@ -35,7 +35,7 @@ var cos = require( '@stdlib/math/base/special/cos' ); Computes the [cosine][cosine] of a `number` (in radians). ```javascript -var v = cos( 0.0 ); +let v = cos( 0.0 ); // returns 1.0 v = cos( 3.141592653589793/4.0 ); @@ -59,14 +59,13 @@ v = cos( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var cos = require( '@stdlib/math/base/special/cos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const cos = require( '@stdlib/math/base/special/cos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cosd/README.md b/lib/node_modules/@stdlib/math/base/special/cosd/README.md index 806287504ec9..898c95cc445a 100644 --- a/lib/node_modules/@stdlib/math/base/special/cosd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cosd/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var cosd = require( '@stdlib/math/base/special/cosd' ); +const cosd = require( '@stdlib/math/base/special/cosd' ); ``` #### cosd( x ) @@ -39,7 +39,7 @@ var cosd = require( '@stdlib/math/base/special/cosd' ); Computes the [cosine][trigonometric-functions] of `x` (in degrees). ```javascript -var v = cosd( 0.0 ); +let v = cosd( 0.0 ); // returns 1.0 v = cosd( 60.0 ); @@ -63,13 +63,12 @@ v = cosd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cosd = require( '@stdlib/math/base/special/cosd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cosd = require( '@stdlib/math/base/special/cosd' ); -var x = linspace( -180, 180, 100 ); +const x = linspace( -180, 180, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cosd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cosh/README.md b/lib/node_modules/@stdlib/math/base/special/cosh/README.md index e55472f3674b..90fce11f3ed3 100644 --- a/lib/node_modules/@stdlib/math/base/special/cosh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cosh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosh = require( '@stdlib/math/base/special/cosh' ); +const cosh = require( '@stdlib/math/base/special/cosh' ); ``` #### cosh( x ) @@ -35,7 +35,7 @@ var cosh = require( '@stdlib/math/base/special/cosh' ); Computes the [hyperbolic cosine][hyperbolic-cosine] of a double-precision floating-point number `x`. ```javascript -var v = cosh( 0.0 ); +let v = cosh( 0.0 ); // returns 1.0 v = cosh( 2.0 ); @@ -62,13 +62,12 @@ v = cosh( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cosh = require( '@stdlib/math/base/special/cosh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cosh = require( '@stdlib/math/base/special/cosh' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cosh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cosm1/README.md b/lib/node_modules/@stdlib/math/base/special/cosm1/README.md index e958e18d4c3e..94a500260203 100644 --- a/lib/node_modules/@stdlib/math/base/special/cosm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cosm1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosm1 = require( '@stdlib/math/base/special/cosm1' ); +const cosm1 = require( '@stdlib/math/base/special/cosm1' ); ``` #### cosm1( x ) @@ -35,9 +35,9 @@ var cosm1 = require( '@stdlib/math/base/special/cosm1' ); Computes `cos(x) - 1`, where `cos` is the [cosine][@stdlib/math/base/special/cos] of a `number` (in radians). This function should be used instead of manually calculating `cos(x) - 1` when the argument is near unity. ```javascript -var PI = require( '@stdlib/constants/float64/pi' ); +const PI = require( '@stdlib/constants/float64/pi' ); -var v = cosm1( 0.0 ); +let v = cosm1( 0.0 ); // returns 0.0 v = cosm1( PI/4.0 ); @@ -61,14 +61,13 @@ v = cosm1( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var cosm1 = require( '@stdlib/math/base/special/cosm1' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const cosm1 = require( '@stdlib/math/base/special/cosm1' ); -var x = linspace( 0.0, 2.0*PI, 100 ); +const x = linspace( 0.0, 2.0*PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cosm1( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cospi/README.md b/lib/node_modules/@stdlib/math/base/special/cospi/README.md index ee4799f30f52..92721114331a 100644 --- a/lib/node_modules/@stdlib/math/base/special/cospi/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cospi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cospi = require( '@stdlib/math/base/special/cospi' ); +const cospi = require( '@stdlib/math/base/special/cospi' ); ``` #### cospi( x ) @@ -35,7 +35,7 @@ var cospi = require( '@stdlib/math/base/special/cospi' ); Computes `cos(πx)` more accurately than `cos(pi*x)`, especially for large `x`. ```javascript -var y = cospi( 0.0 ); +let y = cospi( 0.0 ); // returns 1.0 y = cospi( 0.5 ); @@ -59,13 +59,12 @@ y = cospi( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cospi = require( '@stdlib/math/base/special/cospi' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cospi = require( '@stdlib/math/base/special/cospi' ); -var x = linspace( -100.0, 100.0, 100 ); +const x = linspace( -100.0, 100.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cospi( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cot/README.md b/lib/node_modules/@stdlib/math/base/special/cot/README.md index cb710799146a..e7011d11e631 100644 --- a/lib/node_modules/@stdlib/math/base/special/cot/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cot/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var cot = require( '@stdlib/math/base/special/cot' ); +const cot = require( '@stdlib/math/base/special/cot' ); ``` #### cot( x ) @@ -39,7 +39,7 @@ var cot = require( '@stdlib/math/base/special/cot' ); Evaluates the [cotangent][trigonometric-functions] of `x` (in radians). ```javascript -var v = cot( 0.0 ); +let v = cot( 0.0 ); // returns Infinity v = cot( 3.141592653589793/2.0 ); @@ -66,14 +66,13 @@ v = cot( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var cot = require( '@stdlib/math/base/special/cot' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const cot = require( '@stdlib/math/base/special/cot' ); -var x = linspace( -PI/2.0, PI/2.0, 100 ); +const x = linspace( -PI/2.0, PI/2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cot( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cotd/README.md b/lib/node_modules/@stdlib/math/base/special/cotd/README.md index eb2a1098fdb6..a8715b97d4d0 100644 --- a/lib/node_modules/@stdlib/math/base/special/cotd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cotd/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var cotd = require( '@stdlib/math/base/special/cotd' ); +const cotd = require( '@stdlib/math/base/special/cotd' ); ``` #### cotd( x ) @@ -39,7 +39,7 @@ var cotd = require( '@stdlib/math/base/special/cotd' ); Evaluates the [cotangent][trigonometric-functions] of `x` (in degrees). ```javascript -var v = cotd( 0.0 ); +let v = cotd( 0.0 ); // returns Infinity v = cotd( 60.0 ); @@ -63,13 +63,12 @@ v = cotd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cotd = require( '@stdlib/math/base/special/cotd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cotd = require( '@stdlib/math/base/special/cotd' ); -var x = linspace( -180, 180, 100 ); +const x = linspace( -180, 180, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cotd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/coth/README.md b/lib/node_modules/@stdlib/math/base/special/coth/README.md index 12a886d7c769..274de6bfe92c 100644 --- a/lib/node_modules/@stdlib/math/base/special/coth/README.md +++ b/lib/node_modules/@stdlib/math/base/special/coth/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var coth = require( '@stdlib/math/base/special/coth' ); +const coth = require( '@stdlib/math/base/special/coth' ); ``` #### coth( x ) @@ -35,7 +35,7 @@ var coth = require( '@stdlib/math/base/special/coth' ); Computes the [hyperbolic cotangent][hyperbolic-functions] of `x`. ```javascript -var v = coth( 0.0 ); +let v = coth( 0.0 ); // returns Infinity v = coth( 2.0 ); @@ -59,13 +59,12 @@ v = coth( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var coth = require( '@stdlib/math/base/special/coth' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const coth = require( '@stdlib/math/base/special/coth' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( coth( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/README.md b/lib/node_modules/@stdlib/math/base/special/covercos/README.md index b2ce5c65e503..00558030af4b 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/covercos/README.md @@ -48,7 +48,7 @@ The [coversed cosine][coversed-cosine] is defined as ## Usage ```javascript -var covercos = require( '@stdlib/math/base/special/covercos' ); +const covercos = require( '@stdlib/math/base/special/covercos' ); ``` #### covercos( x ) @@ -56,7 +56,7 @@ var covercos = require( '@stdlib/math/base/special/covercos' ); Computes the [coversed cosine][coversed-cosine] (in radians). ```javascript -var v = covercos( 0.0 ); +let v = covercos( 0.0 ); // returns 1.0 v = covercos( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = covercos( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var covercos = require( '@stdlib/math/base/special/covercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const covercos = require( '@stdlib/math/base/special/covercos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( covercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/README.md b/lib/node_modules/@stdlib/math/base/special/coversin/README.md index 3a9972f95a4d..7fd5759582c7 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/coversin/README.md @@ -48,7 +48,7 @@ The [coversed sine][coversed-sine] is defined as ## Usage ```javascript -var coversin = require( '@stdlib/math/base/special/coversin' ); +const coversin = require( '@stdlib/math/base/special/coversin' ); ``` #### coversin( x ) @@ -56,7 +56,7 @@ var coversin = require( '@stdlib/math/base/special/coversin' ); Computes the [coversed sine][coversed-sine] (in radians). ```javascript -var v = coversin( 0.0 ); +let v = coversin( 0.0 ); // returns 1.0 v = coversin( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = coversin( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var coversin = require( '@stdlib/math/base/special/coversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const coversin = require( '@stdlib/math/base/special/coversin' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( coversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cphase/README.md b/lib/node_modules/@stdlib/math/base/special/cphase/README.md index c5f4989c9645..31e2a656e6a9 100644 --- a/lib/node_modules/@stdlib/math/base/special/cphase/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cphase/README.md @@ -35,7 +35,7 @@ The [argument][complex-number-argument] of a complex number, also known as the * ## Usage ```javascript -var cphase = require( '@stdlib/math/base/special/cphase' ); +const cphase = require( '@stdlib/math/base/special/cphase' ); ``` #### cphase( z ) @@ -43,9 +43,9 @@ var cphase = require( '@stdlib/math/base/special/cphase' ); Computes the [argument][complex-number-argument] of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var phi = cphase( new Complex128( 5.0, 3.0 ) ); +const phi = cphase( new Complex128( 5.0, 3.0 ) ); // returns ~0.5404 ``` @@ -60,15 +60,12 @@ var phi = cphase( new Complex128( 5.0, 3.0 ) ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var cphase = require( '@stdlib/math/base/special/cphase' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const cphase = require( '@stdlib/math/base/special/cphase' ); -var z; -var i; - -for ( i = 0; i < 100; i++ ) { - z = new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ); console.log( 'arg(%s) = %d', z.toString(), cphase( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cpolar/README.md b/lib/node_modules/@stdlib/math/base/special/cpolar/README.md index 457853aed87a..fa0b1b03c419 100644 --- a/lib/node_modules/@stdlib/math/base/special/cpolar/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cpolar/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cpolar = require( '@stdlib/math/base/special/cpolar' ); +const cpolar = require( '@stdlib/math/base/special/cpolar' ); ``` #### cpolar( z ) @@ -41,9 +41,9 @@ var cpolar = require( '@stdlib/math/base/special/cpolar' ); Computes the [absolute value][@stdlib/math/base/special/cabs] and [phase][@stdlib/math/base/special/cphase] of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); -var o = cpolar( new Complex128( 5.0, 3.0 ) ); +const o = cpolar( new Complex128( 5.0, 3.0 ) ); // returns [ ~5.83, ~0.5404 ] ``` @@ -52,15 +52,15 @@ var o = cpolar( new Complex128( 5.0, 3.0 ) ); Computes the [absolute value][@stdlib/math/base/special/cabs] and [phase][@stdlib/math/base/special/cphase] of a double-precision complex floating-point number and assigns results to a provided output array. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = cpolar.assign( new Complex128( 5.0, 3.0 ), out, 1, 0 ); +const v = cpolar.assign( new Complex128( 5.0, 3.0 ), out, 1, 0 ); // returns [ ~5.83, ~0.5404 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -75,24 +75,18 @@ var bool = ( v === out ); ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cpolar = require( '@stdlib/math/base/special/cpolar' ); - -var re; -var im; -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - re = round( randu()*100.0 ) - 50.0; - im = round( randu()*100.0 ) - 50.0; - z = new Complex128( re, im ); - o = cpolar( z ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cpolar = require( '@stdlib/math/base/special/cpolar' ); + +for ( let i = 0; i < 100; i++ ) { + const re = round( randu()*100.0 ) - 50.0; + const im = round( randu()*100.0 ) - 50.0; + let z = new Complex128( re, im ); + const o = cpolar( z ); z = z.toString(); console.log( 'abs(%s) = %d. arg(%s) = %d', z, o[0], z, o[1] ); } diff --git a/lib/node_modules/@stdlib/math/base/special/cround/README.md b/lib/node_modules/@stdlib/math/base/special/cround/README.md index 64a8f3f122a6..b3c48de63cbb 100644 --- a/lib/node_modules/@stdlib/math/base/special/cround/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cround/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cround = require( '@stdlib/math/base/special/cround' ); +const cround = require( '@stdlib/math/base/special/cround' ); ``` #### cround( z ) @@ -35,17 +35,17 @@ var cround = require( '@stdlib/math/base/special/cround' ); Rounds each component of a double-precision complex floating-point number to the nearest integer. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = cround( new Complex128( -4.2, 5.5 ) ); +let v = cround( new Complex128( -4.2, 5.5 ) ); // returns -var re = real( v ); +let re = real( v ); // returns -4.0 -var im = imag( v ); +let im = imag( v ); // returns 6.0 v = cround( new Complex128( 9.99999, 0.1 ) ); @@ -87,16 +87,14 @@ im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var cround = require( '@stdlib/math/base/special/cround' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const cround = require( '@stdlib/math/base/special/cround' ); -var rand = uniform( -50.0, 50.0 ); +const rand = uniform( -50.0, 50.0 ); -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand(), rand() ); console.log( 'cround(%s) = %s', z, cround( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/croundn/README.md b/lib/node_modules/@stdlib/math/base/special/croundn/README.md index 039d8c5b74e3..c5ffdcd8acfa 100644 --- a/lib/node_modules/@stdlib/math/base/special/croundn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/croundn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var croundn = require( '@stdlib/math/base/special/croundn' ); +const croundn = require( '@stdlib/math/base/special/croundn' ); ``` #### croundn( z, n ) @@ -35,17 +35,17 @@ var croundn = require( '@stdlib/math/base/special/croundn' ); Rounds each component of a double-precision complex floating-point number to the nearest multiple of `10^n`. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = croundn( new Complex128( -3.141592653589793, 3.141592653589793 ), -2 ); +let v = croundn( new Complex128( -3.141592653589793, 3.141592653589793 ), -2 ); // returns -var re = real( v ); +let re = real( v ); // returns -3.14 -var im = imag( v ); +let im = imag( v ); // returns 3.14 v = croundn( new Complex128( -3.141592653589793, 3.141592653589793 ), 0 ); @@ -87,21 +87,21 @@ im = imag( v ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var Complex128 = require( '@stdlib/complex/float64/ctor' ); - var real = require( '@stdlib/complex/float64/real' ); - var imag = require( '@stdlib/complex/float64/imag' ); + const Complex128 = require( '@stdlib/complex/float64/ctor' ); + const real = require( '@stdlib/complex/float64/real' ); + const imag = require( '@stdlib/complex/float64/imag' ); - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round components to 0.3: - var v = croundn( new Complex128( x, x ), -16 ); + const v = croundn( new Complex128( x, x ), -16 ); // returns - var re = real( v ); + const re = real( v ); // returns 0.3000000000000001 - var im = imag( v ); + const im = imag( v ); // returns 0.3000000000000001 ``` @@ -116,20 +116,17 @@ im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var croundn = require( '@stdlib/math/base/special/croundn' ); - -var rand1 = uniform( -5.0, 0.0 ); -var rand2 = uniform( -50.0, 50.0 ); - -var z; -var i; -var n; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand2(), rand2() ); - n = floor( rand1() ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const croundn = require( '@stdlib/math/base/special/croundn' ); + +const rand1 = uniform( -5.0, 0.0 ); +const rand2 = uniform( -50.0, 50.0 ); + +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand2(), rand2() ); + const n = floor( rand1() ); console.log( 'croundn(%s, %s) = %s', z, n, croundn( z, n ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/csc/README.md b/lib/node_modules/@stdlib/math/base/special/csc/README.md index 94d882b17469..0a22d9647513 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/csc/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var csc = require( '@stdlib/math/base/special/csc' ); +const csc = require( '@stdlib/math/base/special/csc' ); ``` ## csc( x ) @@ -39,7 +39,7 @@ var csc = require( '@stdlib/math/base/special/csc' ); Evaluates the [cosecant][trigonometric-functions] of `x` (in radians). ```javascript -var v = csc( 0.0 ); +let v = csc( 0.0 ); // returns Infinity v = csc( 3.141592653589793/2.0 ); @@ -66,14 +66,13 @@ v = csc( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var csc = require( '@stdlib/math/base/special/csc' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const csc = require( '@stdlib/math/base/special/csc' ); -var x = linspace( -PI/2.0, PI/2.0, 100 ); +const x = linspace( -PI/2.0, PI/2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( csc( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/cscd/README.md b/lib/node_modules/@stdlib/math/base/special/cscd/README.md index bed790f4ffb1..0db3224f403a 100644 --- a/lib/node_modules/@stdlib/math/base/special/cscd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cscd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cscd = require( '@stdlib/math/base/special/cscd' ); +const cscd = require( '@stdlib/math/base/special/cscd' ); ``` #### cscd( x ) @@ -35,7 +35,7 @@ var cscd = require( '@stdlib/math/base/special/cscd' ); Computes the [cosecant][cosecant] of `x` (in degrees). ```javascript -var v = cscd( 30 ); +let v = cscd( 30 ); // returns ~2.0 v = cscd( 45 ); @@ -65,13 +65,12 @@ v = cscd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var cscd = require( '@stdlib/math/base/special/cscd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const cscd = require( '@stdlib/math/base/special/cscd' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( cscd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/csch/README.md b/lib/node_modules/@stdlib/math/base/special/csch/README.md index 8eef55c74b4f..a3dd1c3f136a 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/README.md +++ b/lib/node_modules/@stdlib/math/base/special/csch/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var csch = require( '@stdlib/math/base/special/csch' ); +const csch = require( '@stdlib/math/base/special/csch' ); ``` #### csch( x ) @@ -35,7 +35,7 @@ var csch = require( '@stdlib/math/base/special/csch' ); Computes the [hyperbolic cosecant][hyperbolic-functions] of `x`. ```javascript -var v = csch( 0.0 ); +let v = csch( 0.0 ); // returns Infinity v = csch( 2.0 ); @@ -59,13 +59,12 @@ v = csch( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var csch = require( '@stdlib/math/base/special/csch' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const csch = require( '@stdlib/math/base/special/csch' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( csch( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/csignum/README.md b/lib/node_modules/@stdlib/math/base/special/csignum/README.md index a05a29f1372e..0436b8f3372d 100644 --- a/lib/node_modules/@stdlib/math/base/special/csignum/README.md +++ b/lib/node_modules/@stdlib/math/base/special/csignum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var csignum = require( '@stdlib/math/base/special/csignum' ); +const csignum = require( '@stdlib/math/base/special/csignum' ); ``` #### csignum( z ) @@ -45,17 +45,17 @@ var csignum = require( '@stdlib/math/base/special/csignum' ); Evaluates the [signum][signum] function of a double-precision complex floating-point number. ```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); -var v = csignum( new Complex128( -4.2, 5.5 ) ); +let v = csignum( new Complex128( -4.2, 5.5 ) ); // returns -var re = real( v ); +let re = real( v ); // returns -0.6069136033622302 -var im = imag( v ); +let im = imag( v ); // returns 0.79476781392673 v = csignum( new Complex128( 0.0, 0.0 ) ); @@ -98,16 +98,14 @@ im = imag( v ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var csignum = require( '@stdlib/math/base/special/csignum' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const csignum = require( '@stdlib/math/base/special/csignum' ); -var rand = uniform( -50.0, 50.0 ); +const rand = uniform( -50.0, 50.0 ); -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( rand(), rand() ); +for ( let i = 0; i < 100; i++ ) { + const z = new Complex128( rand(), rand() ); console.log( 'csignum(%s) = %s', z, csignum( z ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/deg2rad/README.md b/lib/node_modules/@stdlib/math/base/special/deg2rad/README.md index 30a4c4801a5f..58ee7cd2c9d1 100644 --- a/lib/node_modules/@stdlib/math/base/special/deg2rad/README.md +++ b/lib/node_modules/@stdlib/math/base/special/deg2rad/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deg2rad = require( '@stdlib/math/base/special/deg2rad' ); +const deg2rad = require( '@stdlib/math/base/special/deg2rad' ); ``` #### deg2rad( x ) @@ -35,7 +35,7 @@ var deg2rad = require( '@stdlib/math/base/special/deg2rad' ); Converts an angle from degrees to radians. ```javascript -var r = deg2rad( 90.0 ); +let r = deg2rad( 90.0 ); // returns ~1.571 r = deg2rad( -45.0 ); @@ -56,16 +56,12 @@ r = deg2rad( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var deg2rad = require( '@stdlib/math/base/special/deg2rad' ); +const randu = require( '@stdlib/random/base/randu' ); +const deg2rad = require( '@stdlib/math/base/special/deg2rad' ); -var d; -var r; -var i; - -for ( i = 0; i < 100; i++ ) { - d = (randu()*720.0) - 360.0; - r = deg2rad( d ); +for ( let i = 0; i < 100; i++ ) { + const d = (randu()*720.0) - 360.0; + const r = deg2rad( d ); console.log( 'degrees: %d => radians: %d', d, r ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/deg2radf/README.md b/lib/node_modules/@stdlib/math/base/special/deg2radf/README.md index ed76dec7ec2c..dad6f42a145e 100644 --- a/lib/node_modules/@stdlib/math/base/special/deg2radf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/deg2radf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deg2radf = require( '@stdlib/math/base/special/deg2radf' ); +const deg2radf = require( '@stdlib/math/base/special/deg2radf' ); ``` #### deg2radf( x ) @@ -35,7 +35,7 @@ var deg2radf = require( '@stdlib/math/base/special/deg2radf' ); Converts an angle from degrees to radians (single-precision). ```javascript -var r = deg2radf( 90.0 ); +let r = deg2radf( 90.0 ); // returns ~1.571 r = deg2radf( -45.0 ); @@ -56,16 +56,12 @@ r = deg2radf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var deg2radf = require( '@stdlib/math/base/special/deg2radf' ); +const randu = require( '@stdlib/random/base/randu' ); +const deg2radf = require( '@stdlib/math/base/special/deg2radf' ); -var d; -var r; -var i; - -for ( i = 0; i < 100; i++ ) { - d = (randu()*720.0) - 360.0; - r = deg2radf( d ); +for ( let i = 0; i < 100; i++ ) { + const d = (randu()*720.0) - 360.0; + const r = deg2radf( d ); console.log( 'degrees: %d => radians: %d', d, r ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/digamma/README.md b/lib/node_modules/@stdlib/math/base/special/digamma/README.md index 1d10be62bd99..ae77323f6aec 100644 --- a/lib/node_modules/@stdlib/math/base/special/digamma/README.md +++ b/lib/node_modules/@stdlib/math/base/special/digamma/README.md @@ -48,7 +48,7 @@ The [digamma function][digamma-function] `ψ` is the logarithmic derivative of t ## Usage ```javascript -var digamma = require( '@stdlib/math/base/special/digamma' ); +const digamma = require( '@stdlib/math/base/special/digamma' ); ``` #### digamma( x ) @@ -56,7 +56,7 @@ var digamma = require( '@stdlib/math/base/special/digamma' ); Evaluates the [digamma function][digamma-function]. ```javascript -var v = digamma( -2.5 ); +let v = digamma( -2.5 ); // returns ~1.103 v = digamma( 1.0 ); @@ -69,7 +69,7 @@ v = digamma( 10.0 ); If `x` is `0` or a negative `integer`, the function returns `NaN`. ```javascript -var v = digamma( 0.0 ); +let v = digamma( 0.0 ); // returns NaN v = digamma( -1.0 ); @@ -82,7 +82,7 @@ v = digamma( -2.0 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = digamma( NaN ); +const v = digamma( NaN ); // returns NaN ``` @@ -97,16 +97,12 @@ var v = digamma( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var digamma = require( '@stdlib/math/base/special/digamma' ); +const randu = require( '@stdlib/random/base/randu' ); +const digamma = require( '@stdlib/math/base/special/digamma' ); -var x; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu()*10.0) - 5.0; - v = digamma( x ); +for ( let i = 0; i < 10; i++ ) { + const x = (randu()*10.0) - 5.0; + const v = digamma( x ); console.log( 'x: %d, f(x): %d', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/dirac-delta/README.md b/lib/node_modules/@stdlib/math/base/special/dirac-delta/README.md index e4bdf17f68d6..83ae51e54e79 100644 --- a/lib/node_modules/@stdlib/math/base/special/dirac-delta/README.md +++ b/lib/node_modules/@stdlib/math/base/special/dirac-delta/README.md @@ -65,7 +65,7 @@ Note that the [Dirac delta function][dirac-delta-function] is **not** a function ## Usage ```javascript -var diracDelta = require( '@stdlib/math/base/special/dirac-delta' ); +const diracDelta = require( '@stdlib/math/base/special/dirac-delta' ); ``` #### diracDelta( x ) @@ -73,7 +73,7 @@ var diracDelta = require( '@stdlib/math/base/special/dirac-delta' ); Evaluates the [Dirac delta function][dirac-delta-function]. ```javascript -var v = diracDelta( 0.0 ); +let v = diracDelta( 0.0 ); // returns Infinity v = diracDelta( 3.14 ); @@ -94,13 +94,12 @@ v = diracDelta( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var diracDelta = require( '@stdlib/math/base/special/dirac-delta' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const diracDelta = require( '@stdlib/math/base/special/dirac-delta' ); -var x = linspace( -1.0, 1.0, 101 ); +const x = linspace( -1.0, 1.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'dirac(%d) = %d', x[ i ], diracDelta( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/README.md b/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/README.md index 6598538c881e..755c94b4576e 100644 --- a/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/README.md +++ b/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/README.md @@ -67,7 +67,7 @@ where `ζ(s)` is the [Riemann zeta][@stdlib/math/base/special/riemann-zeta] func ## Usage ```javascript -var eta = require( '@stdlib/math/base/special/dirichlet-eta' ); +const eta = require( '@stdlib/math/base/special/dirichlet-eta' ); ``` #### eta( s ) @@ -75,7 +75,7 @@ var eta = require( '@stdlib/math/base/special/dirichlet-eta' ); Evaluates the [Dirichlet eta][eta-function] function as a function of a real variable `s`. ```javascript -var v = eta( 0.0 ); // Abel sum of 1-1+1-1+... +let v = eta( 0.0 ); // Abel sum of 1-1+1-1+... // returns 0.5 v = eta( -1.0 ); // Abel sum of 1-2+3-4+... @@ -102,13 +102,12 @@ v = eta( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var eta = require( '@stdlib/math/base/special/dirichlet-eta' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const eta = require( '@stdlib/math/base/special/dirichlet-eta' ); -var s = linspace( -50.0, 50.0, 200 ); +const s = linspace( -50.0, 50.0, 200 ); -var i; -for ( i = 0; i < s.length; i++ ) { +for ( let i = 0; i < s.length; i++ ) { console.log( 's: %d, η(s): %d', s[ i ], eta( s[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ellipe/README.md b/lib/node_modules/@stdlib/math/base/special/ellipe/README.md index b68857550bd2..7246b636aafa 100644 --- a/lib/node_modules/@stdlib/math/base/special/ellipe/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ellipe/README.md @@ -50,7 +50,7 @@ where the parameter `m` is related to the modulus `k` by `m = k^2`. ## Usage ```javascript -var ellipe = require( '@stdlib/math/base/special/ellipe' ); +const ellipe = require( '@stdlib/math/base/special/ellipe' ); ``` #### ellipe( m ) @@ -58,7 +58,7 @@ var ellipe = require( '@stdlib/math/base/special/ellipe' ); Computes the [complete elliptic integral of the second kind][elliptic-integral]. ```javascript -var v = ellipe( 0.5 ); +let v = ellipe( 0.5 ); // returns ~1.351 v = ellipe( -1.0 ); @@ -98,14 +98,11 @@ v = ellipe( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ellipe = require( '@stdlib/math/base/special/ellipe' ); +const randu = require( '@stdlib/random/base/randu' ); +const ellipe = require( '@stdlib/math/base/special/ellipe' ); -var m; -var i; - -for ( i = 0; i < 100; i++ ) { - m = -1.0 + ( randu() * 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const m = -1.0 + ( randu() * 2.0 ); console.log( 'ellipe(%d) = %d', m, ellipe( m ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ellipj/README.md b/lib/node_modules/@stdlib/math/base/special/ellipj/README.md index a45e55abb8fa..25dcaa733ffd 100644 --- a/lib/node_modules/@stdlib/math/base/special/ellipj/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ellipj/README.md @@ -41,7 +41,7 @@ where the parameter `m` is related to the modulus `k` by `m = k^2`. ## Usage ```javascript -var ellipj = require( '@stdlib/math/base/special/ellipj' ); +const ellipj = require( '@stdlib/math/base/special/ellipj' ); ``` #### ellipj( u, m ) @@ -49,7 +49,7 @@ var ellipj = require( '@stdlib/math/base/special/ellipj' ); Computes the [Jacobi elliptic functions][jacobi-elliptic] functions `sn`, `cn`, and `dn`, and the Jacobi amplitude `am`. ```javascript -var v = ellipj( 0.3, 0.5 ); +let v = ellipj( 0.3, 0.5 ); // returns [ ~0.293, ~0.956, ~0.978, ~0.298 ] v = ellipj( 0.0, 0.0 ); @@ -70,14 +70,14 @@ v = ellipj( NaN, NaN ); Computes the Jacobi elliptic functions `sn`, `cn`, `dn`, and Jacobi amplitude `am` and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 4 ); +const out = new Float64Array( 4 ); -var v = ellipj.assign( 0.0, 0.0, out, 1, 0 ); +const v = ellipj.assign( 0.0, 0.0, out, 1, 0 ); // returns [ ~0.0, ~1.0, ~1.0, ~0.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -86,7 +86,7 @@ var bool = ( v === out ); Computes the Jacobi elliptic function `sn` of value `u` with modulus `m`. ```javascript -var v = ellipj.sn( 0.3, 0.5 ); +const v = ellipj.sn( 0.3, 0.5 ); // returns ~0.293 ``` @@ -95,7 +95,7 @@ var v = ellipj.sn( 0.3, 0.5 ); Computes the Jacobi elliptic function `cn` of value `u` with modulus `m`. ```javascript -var v = ellipj.cn( 0.3, 0.5 ); +const v = ellipj.cn( 0.3, 0.5 ); // returns ~0.956 ``` @@ -104,7 +104,7 @@ var v = ellipj.cn( 0.3, 0.5 ); Computes the Jacobi elliptic function `dn` of value `u` with modulus `m`. ```javascript -var v = ellipj.dn( 0.3, 0.5 ); +const v = ellipj.dn( 0.3, 0.5 ); // returns ~0.978 ``` @@ -113,7 +113,7 @@ var v = ellipj.dn( 0.3, 0.5 ); Computes the Jacobi amplitude `am` of value `u` with modulus `m`. ```javascript -var v = ellipj.am( 0.3, 0.5 ); +let v = ellipj.am( 0.3, 0.5 ); // returns ~0.298 v = ellipj.am( 0.3, 2.0 ); @@ -144,17 +144,15 @@ Although `sn`, `cn`, and `dn` may be computed for `-∞ < m < ∞`, the domain o ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var ellipk = require( '@stdlib/math/base/special/ellipk' ); -var ellipj = require( '@stdlib/math/base/special/ellipj' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const ellipk = require( '@stdlib/math/base/special/ellipk' ); +const ellipj = require( '@stdlib/math/base/special/ellipj' ); -var m = 0.7; -var u = linspace( 0.0, ellipk( m ), 100 ); +const m = 0.7; +const u = linspace( 0.0, ellipk( m ), 100 ); -var out; -var i; -for ( i = 0; i < 100; i++ ) { - out = ellipj( u[ i ], m ); +for ( let i = 0; i < 100; i++ ) { + const out = ellipj( u[ i ], m ); console.log( 'sn(%d, %d) = %d', u[ i ], m, out[ 0 ] ); console.log( 'cn(%d, %d) = %d', u[ i ], m, out[ 1 ] ); console.log( 'dn(%d, %d) = %d', u[ i ], m, out[ 2 ] ); diff --git a/lib/node_modules/@stdlib/math/base/special/ellipk/README.md b/lib/node_modules/@stdlib/math/base/special/ellipk/README.md index 65cc3e448c23..1914bbbab01c 100644 --- a/lib/node_modules/@stdlib/math/base/special/ellipk/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ellipk/README.md @@ -50,7 +50,7 @@ where the parameter `m` is related to the modulus `k` by `m = k^2`. ## Usage ```javascript -var ellipk = require( '@stdlib/math/base/special/ellipk' ); +const ellipk = require( '@stdlib/math/base/special/ellipk' ); ``` #### ellipk( m ) @@ -58,7 +58,7 @@ var ellipk = require( '@stdlib/math/base/special/ellipk' ); Computes the [complete elliptic integral of the first kind][elliptic-integral]. ```javascript -var v = ellipk( 0.5 ); +let v = ellipk( 0.5 ); // returns ~1.854 v = ellipk( -1.0 ); @@ -98,14 +98,11 @@ v = ellipk( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ellipk = require( '@stdlib/math/base/special/ellipk' ); +const randu = require( '@stdlib/random/base/randu' ); +const ellipk = require( '@stdlib/math/base/special/ellipk' ); -var m; -var i; - -for ( i = 0; i < 100; i++ ) { - m = -1.0 + ( randu() * 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const m = -1.0 + ( randu() * 2.0 ); console.log( 'ellipk(%d) = %d', m, ellipk( m ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/erf/README.md b/lib/node_modules/@stdlib/math/base/special/erf/README.md index 5fdd0f422063..f07f7170d8f5 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/erf/README.md @@ -48,7 +48,7 @@ The [error function][error-function] is defined as ## Usage ```javascript -var erf = require( '@stdlib/math/base/special/erf' ); +const erf = require( '@stdlib/math/base/special/erf' ); ``` #### erf( x ) @@ -56,7 +56,7 @@ var erf = require( '@stdlib/math/base/special/erf' ); Evaluates the [error function][error-function]. ```javascript -var y = erf( 2.0 ); +let y = erf( 2.0 ); // returns ~0.9953 y = erf( -1.0 ); @@ -66,14 +66,14 @@ y = erf( -1.0 ); If provided `NaN`, the function returns `NaN`. ```javascript -var y = erf( NaN ); +const y = erf( NaN ); // returns NaN ``` The [error function][error-function] is an [odd function][odd-function]; i.e., `erf(-x) = -erf(x)`. Thus, in accordance with the [IEEE 754][ieee754] standard, if provided `-0`, the function returns `-0`. ```javascript -var y = erf( -0.0 ); +const y = erf( -0.0 ); // returns -0.0 ``` @@ -88,13 +88,12 @@ var y = erf( -0.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var erf = require( '@stdlib/math/base/special/erf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const erf = require( '@stdlib/math/base/special/erf' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, erf(x): %d', x[ i ], erf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/erfc/README.md b/lib/node_modules/@stdlib/math/base/special/erfc/README.md index 252068fb0ba2..f996b0ad38f7 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/erfc/README.md @@ -63,7 +63,7 @@ The [complementary error function][complementary-error-function] can also be exp ## Usage ```javascript -var erfc = require( '@stdlib/math/base/special/erfc' ); +const erfc = require( '@stdlib/math/base/special/erfc' ); ``` #### erfc( x ) @@ -71,7 +71,7 @@ var erfc = require( '@stdlib/math/base/special/erfc' ); Evaluates the [complementary error function][complementary-error-function]. ```javascript -var y = erfc( 2.0 ); +let y = erfc( 2.0 ); // returns ~0.0047 y = erfc( -1.0 ); @@ -87,7 +87,7 @@ y = erfc( -Infinity ); If provided `NaN`, the function returns `NaN`. ```javascript -var y = erfc( NaN ); +const y = erfc( NaN ); // returns NaN ``` @@ -102,13 +102,12 @@ var y = erfc( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var erfc = require( '@stdlib/math/base/special/erfc' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const erfc = require( '@stdlib/math/base/special/erfc' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, erfc(x): %d', x[ i ], erfc( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/erfcinv/README.md b/lib/node_modules/@stdlib/math/base/special/erfcinv/README.md index 5c86deb6d7a8..35423f603a65 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfcinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/erfcinv/README.md @@ -50,7 +50,7 @@ where `erf^{-1}(z)` is the [inverse error function][@stdlib/math/base/special/er ## Usage ```javascript -var erfcinv = require( '@stdlib/math/base/special/erfcinv' ); +const erfcinv = require( '@stdlib/math/base/special/erfcinv' ); ``` #### erfcinv( x ) @@ -58,7 +58,7 @@ var erfcinv = require( '@stdlib/math/base/special/erfcinv' ); Evaluates the [inverse complementary error function][erfcinv]. ```javascript -var y = erfcinv( 0.5 ); +let y = erfcinv( 0.5 ); // returns ~0.4769 y = erfcinv( 0.8 ); @@ -74,14 +74,14 @@ y = erfcinv( 2.0 ); The domain of `x` is restricted to `[0,2]`. If `x` is outside this interval, the function returns `NaN`. ```javascript -var y = erfcinv( -3.14 ); +const y = erfcinv( -3.14 ); // returns NaN ``` If provided `NaN`, the function returns `NaN`. ```javascript -var y = erfcinv( NaN ); +const y = erfcinv( NaN ); // returns NaN ``` @@ -96,13 +96,12 @@ var y = erfcinv( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var erfcinv = require( '@stdlib/math/base/special/erfcinv' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const erfcinv = require( '@stdlib/math/base/special/erfcinv' ); -var x = linspace( 0.0, 2.0, 100 ); +const x = linspace( 0.0, 2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, erfcinv(x): %d', x[ i ], erfcinv( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/erfcx/README.md b/lib/node_modules/@stdlib/math/base/special/erfcx/README.md index a387d0becafe..5281df3d8814 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfcx/README.md +++ b/lib/node_modules/@stdlib/math/base/special/erfcx/README.md @@ -63,7 +63,7 @@ For large values, the scaled [complementary error function][complementary-error- ## Usage ```javascript -var erfcx = require( '@stdlib/math/base/special/erfcx' ); +const erfcx = require( '@stdlib/math/base/special/erfcx' ); ``` #### erfcx( x ) @@ -71,7 +71,7 @@ var erfcx = require( '@stdlib/math/base/special/erfcx' ); Evaluates the scaled [complementary error function][complementary-error-function]. ```javascript -var y = erfcx( 0.0 ); +let y = erfcx( 0.0 ); // returns 1.0 y = erfcx( 1.0 ); @@ -90,7 +90,7 @@ y = erfcx( -50.0 ); If provided `NaN`, the function returns `NaN`. ```javascript -var y = erfcx( NaN ); +const y = erfcx( NaN ); // returns NaN ``` @@ -105,13 +105,12 @@ var y = erfcx( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var erfcx = require( '@stdlib/math/base/special/erfcx' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const erfcx = require( '@stdlib/math/base/special/erfcx' ); -var x = linspace( -30.0, 30.0, 100 ); +const x = linspace( -30.0, 30.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, erfcx(x): %d', x[ i ], erfcx( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/erfinv/README.md b/lib/node_modules/@stdlib/math/base/special/erfinv/README.md index 6ccf6b24972e..e7b589fb0e6c 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/erfinv/README.md @@ -63,7 +63,7 @@ c_k=\sum_{m=0}^{k-1}\frac{c_m c_{k-1-m}}{(m+1)(2m+1)} = \left\{1,1,\frac{7}{6},\ ## Usage ```javascript -var erfinv = require( '@stdlib/math/base/special/erfinv' ); +const erfinv = require( '@stdlib/math/base/special/erfinv' ); ``` #### erfinv( x ) @@ -71,7 +71,7 @@ var erfinv = require( '@stdlib/math/base/special/erfinv' ); Evaluates the [inverse error function][inverse-error-function]. ```javascript -var y = erfinv( 0.5 ); +let y = erfinv( 0.5 ); // returns ~0.4769 y = erfinv( 0.8 ); @@ -87,21 +87,21 @@ y = erfinv( 1.0 ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var y = erfinv( -3.14 ); +const y = erfinv( -3.14 ); // returns NaN ``` If provided `NaN`, the function returns `NaN`. ```javascript -var y = erfinv( NaN ); +const y = erfinv( NaN ); // returns NaN ``` The [inverse error function][inverse-error-function] is an [odd function][odd-function]; i.e., `erfinv(-x) = -erfinv(x)`. Thus, in accordance with the [IEEE 754][ieee754] standard, if provided `-0`, the function returns `-0`. ```javascript -var y = erfinv( -0.0 ); +const y = erfinv( -0.0 ); // returns -0.0 ``` @@ -116,13 +116,12 @@ var y = erfinv( -0.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var erfinv = require( '@stdlib/math/base/special/erfinv' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const erfinv = require( '@stdlib/math/base/special/erfinv' ); -var x = linspace( -1.0, 1.0, 100 ); +const x = linspace( -1.0, 1.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, erfinv(x): %d', x[ i ], erfinv( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/exp/README.md b/lib/node_modules/@stdlib/math/base/special/exp/README.md index a9440b5305b1..0277cd8c9a5f 100644 --- a/lib/node_modules/@stdlib/math/base/special/exp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/exp/README.md @@ -50,7 +50,7 @@ where `e` is [Euler's][@stdlib/constants/float64/e] number. ## Usage ```javascript -var exp = require( '@stdlib/math/base/special/exp' ); +const exp = require( '@stdlib/math/base/special/exp' ); ``` #### exp( x ) @@ -58,7 +58,7 @@ var exp = require( '@stdlib/math/base/special/exp' ); Evaluates the natural [exponential function][exponential-function]. ```javascript -var v = exp( 4.0 ); +let v = exp( 4.0 ); // returns ~54.5982 v = exp( -9.0 ); @@ -82,14 +82,11 @@ v = exp( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var exp = require( '@stdlib/math/base/special/exp' ); +const randu = require( '@stdlib/random/base/randu' ); +const exp = require( '@stdlib/math/base/special/exp' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'e^%d = %d', x, exp( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/exp10/README.md b/lib/node_modules/@stdlib/math/base/special/exp10/README.md index 977eb8b7b873..1449a728bfec 100644 --- a/lib/node_modules/@stdlib/math/base/special/exp10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/exp10/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exp10 = require( '@stdlib/math/base/special/exp10' ); +const exp10 = require( '@stdlib/math/base/special/exp10' ); ``` #### exp10( x ) @@ -35,7 +35,7 @@ var exp10 = require( '@stdlib/math/base/special/exp10' ); Evaluates the base `10` [exponential function][exponential-function]. ```javascript -var v = exp10( 3.0 ); +let v = exp10( 3.0 ); // returns 1000.0 v = exp10( -9.0 ); @@ -59,14 +59,11 @@ v = exp10( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var exp10 = require( '@stdlib/math/base/special/exp10' ); +const randu = require( '@stdlib/random/base/randu' ); +const exp10 = require( '@stdlib/math/base/special/exp10' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( '10^%d = %d', x, exp10( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/exp2/README.md b/lib/node_modules/@stdlib/math/base/special/exp2/README.md index cbfc4e85b778..4a7f9d45b1ac 100644 --- a/lib/node_modules/@stdlib/math/base/special/exp2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/exp2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exp2 = require( '@stdlib/math/base/special/exp2' ); +const exp2 = require( '@stdlib/math/base/special/exp2' ); ``` #### exp2( x ) @@ -35,7 +35,7 @@ var exp2 = require( '@stdlib/math/base/special/exp2' ); Evaluates the base `2` [exponential function][exponential-function]. ```javascript -var v = exp2( 3.0 ); +let v = exp2( 3.0 ); // returns 8.0 v = exp2( -9.0 ); @@ -59,14 +59,11 @@ v = exp2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var exp2 = require( '@stdlib/math/base/special/exp2' ); +const randu = require( '@stdlib/random/base/randu' ); +const exp2 = require( '@stdlib/math/base/special/exp2' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( '2^%d = %d', x, exp2( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/expit/README.md b/lib/node_modules/@stdlib/math/base/special/expit/README.md index 032bd35be81a..7a053a5df4fb 100644 --- a/lib/node_modules/@stdlib/math/base/special/expit/README.md +++ b/lib/node_modules/@stdlib/math/base/special/expit/README.md @@ -48,7 +48,7 @@ The [standard logistic][logistic-function] function, also called the expit funct ## Usage ```javascript -var expit = require( '@stdlib/math/base/special/expit' ); +const expit = require( '@stdlib/math/base/special/expit' ); ``` #### expit( x ) @@ -56,7 +56,7 @@ var expit = require( '@stdlib/math/base/special/expit' ); Computes the [standard logistic][logistic-function] function. ```javascript -var v = expit( 0.0 ); +let v = expit( 0.0 ); // returns ~0.5 v = expit( 1.0 ); @@ -83,14 +83,11 @@ v = expit( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var expit = require( '@stdlib/math/base/special/expit' ); +const randu = require( '@stdlib/random/base/randu' ); +const expit = require( '@stdlib/math/base/special/expit' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu(); +for ( let i = 0; i < 100; i++ ) { + const x = randu(); console.log( 'expit(%d) = %d', x, expit( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/expm1/README.md b/lib/node_modules/@stdlib/math/base/special/expm1/README.md index 53dac62f8103..dd4e0b8df330 100644 --- a/lib/node_modules/@stdlib/math/base/special/expm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/expm1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var expm1 = require( '@stdlib/math/base/special/expm1' ); +const expm1 = require( '@stdlib/math/base/special/expm1' ); ``` #### expm1( x ) @@ -35,7 +35,7 @@ var expm1 = require( '@stdlib/math/base/special/expm1' ); Computes `exp(x) - 1`, where `exp(x)` is the natural [exponential function][exponential-function]. ```javascript -var v = expm1( 0.2 ); +let v = expm1( 0.2 ); // returns ~0.221 v = expm1( -9.0 ); @@ -59,14 +59,11 @@ v = expm1( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var expm1 = require( '@stdlib/math/base/special/expm1' ); +const randu = require( '@stdlib/random/base/randu' ); +const expm1 = require( '@stdlib/math/base/special/expm1' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10.0) - 5.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10.0) - 5.0; console.log( 'e^%d - 1 = %d', x, expm1( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/expm1rel/README.md b/lib/node_modules/@stdlib/math/base/special/expm1rel/README.md index 9a9744de7515..46de0e317a76 100644 --- a/lib/node_modules/@stdlib/math/base/special/expm1rel/README.md +++ b/lib/node_modules/@stdlib/math/base/special/expm1rel/README.md @@ -52,7 +52,7 @@ f(x) = \frac{e^x - 1}{x} ## Usage ```javascript -var expm1rel = require( '@stdlib/math/base/special/expm1rel' ); +const expm1rel = require( '@stdlib/math/base/special/expm1rel' ); ``` #### expm1rel( x ) @@ -60,7 +60,7 @@ var expm1rel = require( '@stdlib/math/base/special/expm1rel' ); Computes the relative error exponential. ```javascript -var v = expm1rel( 0.0 ); +let v = expm1rel( 0.0 ); // returns 1.0 v = expm1rel( 1.0 ); @@ -98,18 +98,13 @@ v = expm1rel( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var expm1rel = require( '@stdlib/math/base/special/expm1rel' ); - -var x; -var y; -var a; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - a = x.toFixed( 3 ); - y = expm1rel( x ); +const randu = require( '@stdlib/random/base/randu' ); +const expm1rel = require( '@stdlib/math/base/special/expm1rel' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const a = x.toFixed( 3 ); + const y = expm1rel( x ); console.log( '(e^%d - 1)/%d = %d', a, a, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/factorial/README.md b/lib/node_modules/@stdlib/math/base/special/factorial/README.md index c4a0659cf4b8..fde086bb6df0 100644 --- a/lib/node_modules/@stdlib/math/base/special/factorial/README.md +++ b/lib/node_modules/@stdlib/math/base/special/factorial/README.md @@ -95,7 +95,7 @@ The [factorial][factorial-function] of a **negative** integer is not defined. ## Usage ```javascript -var factorial = require( '@stdlib/math/base/special/factorial' ); +const factorial = require( '@stdlib/math/base/special/factorial' ); ``` #### factorial( x ) @@ -103,7 +103,7 @@ var factorial = require( '@stdlib/math/base/special/factorial' ); Evaluates the [factorial][factorial-function] function. ```javascript -var v = factorial( 3.0 ); +let v = factorial( 3.0 ); // returns 6.0 v = factorial( -1.5 ); @@ -136,13 +136,12 @@ v = factorial( NaN ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var factorial = require( '@stdlib/math/base/special/factorial' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const factorial = require( '@stdlib/math/base/special/factorial' ); -var x = incrspace( -10.0, 100.0, 1.0 ); +const x = incrspace( -10.0, 100.0, 1.0 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], factorial( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/factorial2/README.md b/lib/node_modules/@stdlib/math/base/special/factorial2/README.md index 4e7604e6373c..0db147922d5f 100644 --- a/lib/node_modules/@stdlib/math/base/special/factorial2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/factorial2/README.md @@ -37,7 +37,7 @@ Thus, for example, `5!!` is `5 * 3 * 1 = 15` and `8!!` is `8 * 6 * 4 * 2 = 384`. ## Usage ```javascript -var factorial2 = require( '@stdlib/math/base/special/factorial2' ); +const factorial2 = require( '@stdlib/math/base/special/factorial2' ); ``` #### factorial2( n ) @@ -45,7 +45,7 @@ var factorial2 = require( '@stdlib/math/base/special/factorial2' ); Evaluates the [double factorial][double-factorial] of `n`. ```javascript -var v = factorial2( 2 ); +let v = factorial2( 2 ); // returns 2 v = factorial2( 3 ); @@ -78,13 +78,12 @@ v = factorial2( 301 ); ```javascript -var oneTo = require( '@stdlib/array/base/one-to' ); -var factorial2 = require( '@stdlib/math/base/special/factorial2' ); +const oneTo = require( '@stdlib/array/base/one-to' ); +const factorial2 = require( '@stdlib/math/base/special/factorial2' ); -var values = oneTo( 300 ); +const values = oneTo( 300 ); -var i; -for ( i = 0; i < values.length; i++ ) { +for ( let i = 0; i < values.length; i++ ) { console.log( 'f(%d): %d', values[ i ], factorial2( values[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/factorialln/README.md b/lib/node_modules/@stdlib/math/base/special/factorialln/README.md index b3f12b55081b..1e9ec621bed2 100644 --- a/lib/node_modules/@stdlib/math/base/special/factorialln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/factorialln/README.md @@ -112,7 +112,7 @@ Evaluating the natural logarithm of [factorial function][factorial-function] is ## Usage ```javascript -var factorialln = require( '@stdlib/math/base/special/factorialln' ); +const factorialln = require( '@stdlib/math/base/special/factorialln' ); ``` #### factorialln( x ) @@ -120,7 +120,7 @@ var factorialln = require( '@stdlib/math/base/special/factorialln' ); Evaluates the natural logarithm of the [factorial function][factorial-function]. For input values other than negative integers, the function returns `ln( x! ) = ln( Γ(x+1) )`, where `Γ` is the [Gamma][gamma-function] function. For negative integers, the function returns `NaN`. ```javascript -var v = factorialln( 3.0 ); +let v = factorialln( 3.0 ); // returns ~1.792 v = factorialln( 2.4 ); @@ -136,7 +136,7 @@ v = factorialln( -1.5 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = factorialln( NaN ); +const v = factorialln( NaN ); // returns NaN ``` @@ -151,13 +151,12 @@ var v = factorialln( NaN ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var factorialln = require( '@stdlib/math/base/special/factorialln' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const factorialln = require( '@stdlib/math/base/special/factorialln' ); -var x = incrspace( -10.0, 50.0, 0.5 ); +const x = incrspace( -10.0, 50.0, 0.5 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], factorialln( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/falling-factorial/README.md b/lib/node_modules/@stdlib/math/base/special/falling-factorial/README.md index 2d0fe36c6667..018b179fd7ab 100644 --- a/lib/node_modules/@stdlib/math/base/special/falling-factorial/README.md +++ b/lib/node_modules/@stdlib/math/base/special/falling-factorial/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' ); +const fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' ); ``` #### fallingFactorial( x, n ) @@ -41,7 +41,7 @@ var fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' ); Evaluates the [falling factorial][falling-and-rising-factorials] of `x` and `n`. ```javascript -var v = fallingFactorial( 0.9, 5 ); +let v = fallingFactorial( 0.9, 5 ); // returns ~0.644 v = fallingFactorial( -9.0, 3 ); @@ -63,7 +63,7 @@ v = fallingFactorial( NaN, NaN ); The function returns `NaN` if not provided a nonnegative integer for `n`. ```javascript -var v = fallingFactorial( 2.0, 1.5 ); +let v = fallingFactorial( 2.0, 1.5 ); // returns NaN v = fallingFactorial( 3.0, -2 ); @@ -81,17 +81,13 @@ v = fallingFactorial( 3.0, -2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const fallingFactorial = require( '@stdlib/math/base/special/falling-factorial' ); -var n; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*40.0 ) - 20.0; - n = ceil( randu()*20.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*40.0 ) - 20.0; + const n = ceil( randu()*20.0 ); console.log( 'fallingFactorial(%d,%d) = %d', x, n, fallingFactorial( x, n ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/README.md b/lib/node_modules/@stdlib/math/base/special/fast/README.md index 22c50342999e..9d9535469d34 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fmath = require( '@stdlib/math/base/special/fast' ); +const fmath = require( '@stdlib/math/base/special/fast' ); ``` #### fmath @@ -35,7 +35,7 @@ var fmath = require( '@stdlib/math/base/special/fast' ); Namespace containing "fast" math special functions. ```javascript -var fcns = fmath; +const fcns = fmath; // returns {...} ``` @@ -87,8 +87,8 @@ var fcns = fmath; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var fmath = require( '@stdlib/math/base/special/fast' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const fmath = require( '@stdlib/math/base/special/fast' ); console.log( objectKeys( fmath ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/README.md b/lib/node_modules/@stdlib/math/base/special/fast/abs/README.md index dbc1e11cbd16..d135f82b0c49 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/README.md @@ -48,7 +48,7 @@ The [absolute value][absolute-value] is defined as ## Usage ```javascript -var abs = require( '@stdlib/math/base/special/fast/abs' ); +const abs = require( '@stdlib/math/base/special/fast/abs' ); ``` #### abs( x ) @@ -56,7 +56,7 @@ var abs = require( '@stdlib/math/base/special/fast/abs' ); Computes an [absolute value][absolute-value]. ```javascript -var v = abs( -1.0 ); +let v = abs( -1.0 ); // returns 1.0 v = abs( 2.0 ); @@ -82,7 +82,7 @@ v = abs( NaN ); - This implementation is **not** [IEEE 754][ieee754] compliant. If provided `-0`, the function returns `-0`. ```javascript - var v = abs( -0.0 ); + const v = abs( -0.0 ); // returns -0.0 ``` @@ -97,15 +97,12 @@ v = abs( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var abs = require( '@stdlib/math/base/special/fast/abs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const abs = require( '@stdlib/math/base/special/fast/abs' ); -var rand; -var i; - -for ( i = 0; i < 100; i++ ) { - rand = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const rand = round( randu() * 100.0 ) - 50.0; console.log( 'abs(%d) = %d', rand, abs( rand ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/README.md b/lib/node_modules/@stdlib/math/base/special/fast/acosh/README.md index 1d7c94684231..d970da31f2b1 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var acosh = require( '@stdlib/math/base/special/fast/acosh' ); +const acosh = require( '@stdlib/math/base/special/fast/acosh' ); ``` #### acosh( x ) @@ -35,7 +35,7 @@ var acosh = require( '@stdlib/math/base/special/fast/acosh' ); Computes the [hyperbolic arccosine][inverse-hyperbolic] of a `number` (in radians). ```javascript -var v = acosh( 1.0 ); +let v = acosh( 1.0 ); // returns 0.0 v = acosh( 2.0 ); @@ -48,7 +48,7 @@ v = acosh( 0.5 ); The domain of `x` is restricted to `[1,+infinity)`. If `x < 1`, the function will return `NaN`. ```javascript -var v = acosh( 0.0 ); +const v = acosh( 0.0 ); // returns NaN ``` @@ -63,7 +63,7 @@ var v = acosh( 0.0 ); - For large `x`, the function will overflow. ```javascript - var v = acosh( 1.0e308 ); + const v = acosh( 1.0e308 ); // returns Infinity // (expected 709.889355822726) ``` @@ -79,13 +79,12 @@ var v = acosh( 0.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var acosh = require( '@stdlib/math/base/special/fast/acosh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const acosh = require( '@stdlib/math/base/special/fast/acosh' ); -var x = linspace( 1.0, 5.0, 103 ); +const x = linspace( 1.0, 5.0, 103 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( acosh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/README.md b/lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/README.md index 07289198dc11..61d259be6d50 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ampbm = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-min' ); +const ampbm = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-min' ); ``` #### ampbm( x, y ) @@ -45,7 +45,7 @@ var ampbm = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-min' ); Computes the [hypotenuse][hypotenuse] using the [alpha max plus beta min algorithm][alpha-max-plus-beta-min]. ```javascript -var h = ampbm( -5.0, 12.0 ); +const h = ampbm( -5.0, 12.0 ); // returns ~13.5 ``` @@ -54,36 +54,36 @@ var h = ampbm( -5.0, 12.0 ); Returns a function for computing the [hypotenuse][hypotenuse] using coefficients `alpha` and `beta`. ```javascript -var hypot = ampbm.factory( 1.0, 0.5 ); +const hypot = ampbm.factory( 1.0, 0.5 ); -var h = hypot( -5.0, 12.0 ); +const h = hypot( -5.0, 12.0 ); // returns 14.5 ``` If the returned function should only expect nonnegative arguments, set the `nonnegative` argument to `true`. ```javascript -var hypot = ampbm.factory( 1.0, 0.5, true ); +const hypot = ampbm.factory( 1.0, 0.5, true ); -var h = hypot( 5.0, 12.0 ); +const h = hypot( 5.0, 12.0 ); // returns 14.5 ``` If the returned function should only expect signed 32-bit integers, set the `ints` argument to `true`. ```javascript -var hypot = ampbm.factory( 1.0, 0.5, false, true ); +const hypot = ampbm.factory( 1.0, 0.5, false, true ); -var h = hypot( -5.0, 12.0 ); +const h = hypot( -5.0, 12.0 ); // returns 14 ``` If the returned function should only expect unsigned 32-bit integer valued arguments, set the `nonnegative` and `ints` arguments to `true`. ```javascript -var hypot = ampbm.factory( 1.0, 0.5, true, true ); +const hypot = ampbm.factory( 1.0, 0.5, true, true ); -var h = hypot( 5.0, 12.0 ); +const h = hypot( 5.0, 12.0 ); // returns 14 ``` @@ -112,19 +112,14 @@ var h = hypot( 5.0, 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ampbm = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-min' ); - -var x; -var y; -var h; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = ampbm( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ampbm = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-min' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const y = round( randu()*100.0 ) - 50.0; + const h = ampbm( x, y ); console.log( 'hypot(%d,%d) = %d', x, y, h ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/README.md b/lib/node_modules/@stdlib/math/base/special/fast/asinh/README.md index 653bf9fe528a..9cb336ff4359 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var asinh = require( '@stdlib/math/base/special/fast/asinh' ); +const asinh = require( '@stdlib/math/base/special/fast/asinh' ); ``` #### asinh( x ) @@ -35,7 +35,7 @@ var asinh = require( '@stdlib/math/base/special/fast/asinh' ); Computes the [hyperbolic arcsine][inverse-hyperbolic] of a `number` (in radians). ```javascript -var v = asinh( 0.0 ); +let v = asinh( 0.0 ); // returns 0.0 v = asinh( -0.0 ); @@ -68,7 +68,7 @@ v = asinh( Infinity ); - For large `x`, the function will overflow. ```javascript - var v = asinh( 1.0e200 ); + const v = asinh( 1.0e200 ); // returns Infinity // (expected 461.2101657793691) ``` @@ -76,7 +76,7 @@ v = asinh( Infinity ); - For small `x`, the function will underflow. ```javascript - var v = asinh( 1.0e-50 ); + const v = asinh( 1.0e-50 ); // returns 0.0 // (expected 1.0e-50) ``` @@ -92,13 +92,12 @@ v = asinh( Infinity ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var asinh = require( '@stdlib/math/base/special/fast/asinh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const asinh = require( '@stdlib/math/base/special/fast/asinh' ); -var x = linspace( -5.0, 5.0, 103 ); +const x = linspace( -5.0, 5.0, 103 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( asinh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/atanh/README.md b/lib/node_modules/@stdlib/math/base/special/fast/atanh/README.md index b2c6fd3b0656..adb4569639b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/atanh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/atanh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var atanh = require( '@stdlib/math/base/special/fast/atanh' ); +const atanh = require( '@stdlib/math/base/special/fast/atanh' ); ``` #### atanh( x ) @@ -35,7 +35,7 @@ var atanh = require( '@stdlib/math/base/special/fast/atanh' ); Computes the [hyperbolic arctangent][inverse-hyperbolic] of a `number` (in radians). ```javascript -var v = atanh( 0.0 ); +let v = atanh( 0.0 ); // returns 0.0 v = atanh( -0.0 ); @@ -57,7 +57,7 @@ v = atanh( -1.0 ); The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`. ```javascript -var v = atanh( -3.14 ); +const v = atanh( -3.14 ); // returns NaN ``` @@ -72,7 +72,7 @@ var v = atanh( -3.14 ); - For small `x`, the function will underflow. ```javascript - var v = atanh( 1.0e-17 ); + const v = atanh( 1.0e-17 ); // returns 0.0 // (expected 1.0e-17) ``` @@ -88,13 +88,12 @@ var v = atanh( -3.14 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var atanh = require( '@stdlib/math/base/special/fast/atanh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const atanh = require( '@stdlib/math/base/special/fast/atanh' ); -var x = linspace( -1.0, 1.0, 103 ); +const x = linspace( -1.0, 1.0, 103 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( atanh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/hypot/README.md b/lib/node_modules/@stdlib/math/base/special/fast/hypot/README.md index f833b9fe66b2..24e5e60ae44a 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/hypot/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/hypot/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hypot = require( '@stdlib/math/base/special/fast/hypot' ); +const hypot = require( '@stdlib/math/base/special/fast/hypot' ); ``` #### hypot( x, y ) @@ -45,7 +45,7 @@ var hypot = require( '@stdlib/math/base/special/fast/hypot' ); Computes the [hypotenuse][hypotenuse]. ```javascript -var h = hypot( -5.0, 12.0 ); +const h = hypot( -5.0, 12.0 ); // returns 13.0 ``` @@ -62,14 +62,14 @@ var h = hypot( -5.0, 12.0 ); - For a sufficiently large `x` and/or `y`, computing the hypotenuse will overflow. ```javascript - var h = hypot( 1.0e154, 1.0e154 ); + const h = hypot( 1.0e154, 1.0e154 ); // returns Infinity ``` Similarly, for sufficiently small `x` and/or `y`, computing the hypotenuse will underflow. ```javascript - var h = hypot( 1e-200, 1.0e-200 ); + const h = hypot( 1e-200, 1.0e-200 ); // returns 0.0 ``` @@ -86,19 +86,14 @@ var h = hypot( -5.0, 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var hypot = require( '@stdlib/math/base/special/fast/hypot' ); - -var x; -var y; -var h; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = hypot( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const hypot = require( '@stdlib/math/base/special/fast/hypot' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const y = round( randu()*100.0 ) - 50.0; + const h = hypot( x, y ); console.log( 'hypot(%d,%d) = %d', x, y, h ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/max/README.md b/lib/node_modules/@stdlib/math/base/special/fast/max/README.md index a5cc33cc2a67..34fbadc51fcb 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/max/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/max/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var max = require( '@stdlib/math/base/special/fast/max' ); +const max = require( '@stdlib/math/base/special/fast/max' ); ``` #### max( x, y ) @@ -45,7 +45,7 @@ var max = require( '@stdlib/math/base/special/fast/max' ); Returns the maximum value. ```javascript -var v = max( 4.2, 3.14 ); +const v = max( 4.2, 3.14 ); // returns 4.2 ``` @@ -62,7 +62,7 @@ var v = max( 4.2, 3.14 ); - The implementation **ignores** the sign of `0`. ```javascript - var v = max( +0.0, -0.0 ); + let v = max( +0.0, -0.0 ); // returns -0.0 v = max( -0.0, +0.0 ); @@ -72,7 +72,7 @@ var v = max( 4.2, 3.14 ); - The implementation does **not** check for `NaN` arguments. ```javascript - var v = max( 3.14, NaN ); + let v = max( 3.14, NaN ); // returns NaN v = max( NaN, 3.14 ); @@ -92,18 +92,13 @@ var v = max( 4.2, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var max = require( '@stdlib/math/base/special/fast/max' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = max( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const max = require( '@stdlib/math/base/special/fast/max' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = max( x, y ); console.log( 'max(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/min/README.md b/lib/node_modules/@stdlib/math/base/special/fast/min/README.md index f46d1f54caa1..dba7aa091997 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/min/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var min = require( '@stdlib/math/base/special/fast/min' ); +const min = require( '@stdlib/math/base/special/fast/min' ); ``` #### min( x, y ) @@ -45,7 +45,7 @@ var min = require( '@stdlib/math/base/special/fast/min' ); Returns the minimum value. ```javascript -var v = min( 4.2, 3.14 ); +const v = min( 4.2, 3.14 ); // returns 3.14 ``` @@ -62,7 +62,7 @@ var v = min( 4.2, 3.14 ); - The implementation **ignores** the sign of `0`. ```javascript - var v = min( +0.0, -0.0 ); + let v = min( +0.0, -0.0 ); // returns -0.0 v = min( -0.0, +0.0 ); @@ -72,7 +72,7 @@ var v = min( 4.2, 3.14 ); - The implementation does **not** check for `NaN` arguments. ```javascript - var v = min( 3.14, NaN ); + let v = min( 3.14, NaN ); // returns NaN v = min( NaN, 3.14 ); @@ -92,18 +92,13 @@ var v = min( 4.2, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var min = require( '@stdlib/math/base/special/fast/min' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = min( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const min = require( '@stdlib/math/base/special/fast/min' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = min( x, y ); console.log( 'min(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/pow-int/README.md b/lib/node_modules/@stdlib/math/base/special/fast/pow-int/README.md index a745bb114b8c..f061dadaa6f3 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/pow-int/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/pow-int/README.md @@ -50,7 +50,7 @@ where `b` is the **base** and `x` is the **exponent**. ## Usage ```javascript -var pow = require( '@stdlib/math/base/special/fast/pow-int' ); +const pow = require( '@stdlib/math/base/special/fast/pow-int' ); ``` #### pow( base, exponent ) @@ -58,7 +58,7 @@ var pow = require( '@stdlib/math/base/special/fast/pow-int' ); Evaluates the [exponential function][exponential-function] given a signed 32-bit integer `exponent`. ```javascript -var v = pow( 2.0, 3 ); +let v = pow( 2.0, 3 ); // returns 8.0 v = pow( 100.0, 0 ); @@ -88,7 +88,7 @@ v = pow( NaN, 3 ); - This implementation is **not** recommended for high-precision applications due to error accumulation. As a trivial example, consider ```javascript - var v = pow( 10.0, 308 ); + const v = pow( 10.0, 308 ); // returns 1.0000000000000006e+308 ``` @@ -97,7 +97,7 @@ v = pow( NaN, 3 ); - If provided a negative `exponent`, the implementation first computes the reciprocal of the `base` and then evaluates the exponential function. This can introduce significant error. For example, ```javascript - var v = pow( -459, -98 ); + const v = pow( -459, -98 ); // returns 1.3878956588399783e-261 ``` @@ -121,15 +121,11 @@ v = pow( NaN, 3 ); ```javascript -var pow = require( '@stdlib/math/base/special/fast/pow-int' ); +const pow = require( '@stdlib/math/base/special/fast/pow-int' ); -var x; -var y; -var v; - -x = 10.0; -for ( y = 0; y < 309; y++ ) { - v = pow( x, y ); +const x = 10.0; +for ( let y = 0; y < 309; y++ ) { + const v = pow( x, y ); console.log( '%d^%d = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md b/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md index 20c5b974447e..e563018f4e8b 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var log2Uint32 = require( '@stdlib/math/base/special/fast/uint32-log2' ); +const log2Uint32 = require( '@stdlib/math/base/special/fast/uint32-log2' ); ``` #### log2Uint32( x ) @@ -41,7 +41,7 @@ var log2Uint32 = require( '@stdlib/math/base/special/fast/uint32-log2' ); Returns an **approximate** [binary logarithm][binary-logarithm] of an unsigned 32-bit integer `x`. ```javascript -var v = log2Uint32( 4 >>> 0 ); +let v = log2Uint32( 4 >>> 0 ); // returns 2 v = log2Uint32( 8 >>> 0 ); @@ -73,13 +73,10 @@ v = log2Uint32( 9 >>> 0 ); ```javascript -var log2Uint32 = require( '@stdlib/math/base/special/fast/uint32-log2' ); +const log2Uint32 = require( '@stdlib/math/base/special/fast/uint32-log2' ); -var v; -var i; - -for ( i = 1; i < 101; i++ ) { - v = log2Uint32( i >>> 0 ); +for ( let i = 1; i < 101; i++ ) { + const v = log2Uint32( i >>> 0 ); console.log( 'log2(%d) ≈ %d', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fast/uint32-sqrt/README.md b/lib/node_modules/@stdlib/math/base/special/fast/uint32-sqrt/README.md index a7070c0f6c07..b4ab6bcc77f2 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/uint32-sqrt/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/uint32-sqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sqrtUint32 = require( '@stdlib/math/base/special/fast/uint32-sqrt' ); +const sqrtUint32 = require( '@stdlib/math/base/special/fast/uint32-sqrt' ); ``` #### sqrtUint32( x ) @@ -41,7 +41,7 @@ var sqrtUint32 = require( '@stdlib/math/base/special/fast/uint32-sqrt' ); Returns an **approximate** [square root][square-root] of an unsigned 32-bit integer `x`. ```javascript -var v = sqrtUint32( 9 >>> 0 ); +let v = sqrtUint32( 9 >>> 0 ); // returns 3 v = sqrtUint32( 2 >>> 0 ); @@ -77,13 +77,10 @@ v = sqrtUint32( 0 >>> 0 ); ```javascript -var sqrtUint32 = require( '@stdlib/math/base/special/fast/uint32-sqrt' ); +const sqrtUint32 = require( '@stdlib/math/base/special/fast/uint32-sqrt' ); -var v; -var i; - -for ( i = 0; i < 101; i++ ) { - v = sqrtUint32( i >>> 0 ); +for ( let i = 0; i < 101; i++ ) { + const v = sqrtUint32( i >>> 0 ); console.log( 'sqrt(%d) ≈ %d', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fibonacci-index/README.md b/lib/node_modules/@stdlib/math/base/special/fibonacci-index/README.md index 6141f2b983f6..84570e70d494 100644 --- a/lib/node_modules/@stdlib/math/base/special/fibonacci-index/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fibonacci-index/README.md @@ -50,7 +50,7 @@ where `φ` is the [golden ratio][golden-ratio] and `F > 1`. ## Usage ```javascript -var fibonacciIndex = require( '@stdlib/math/base/special/fibonacci-index' ); +const fibonacciIndex = require( '@stdlib/math/base/special/fibonacci-index' ); ``` #### fibonacciIndex( F ) @@ -58,7 +58,7 @@ var fibonacciIndex = require( '@stdlib/math/base/special/fibonacci-index' ); Computes the [Fibonacci number][fibonacci-number] index for `F_n > 1`. ```javascript -var n = fibonacciIndex( 2 ); +let n = fibonacciIndex( 2 ); // returns 3 n = fibonacciIndex( 3 ); @@ -71,7 +71,7 @@ n = fibonacciIndex( 5 ); If provided either a non-integer or `F_n <= 1`, the function returns `NaN`. ```javascript -var n = fibonacciIndex( -1 ); +let n = fibonacciIndex( -1 ); // returns NaN n = fibonacciIndex( 3.14 ); @@ -81,7 +81,7 @@ n = fibonacciIndex( 3.14 ); If provided `NaN`, the function returns `NaN`. ```javascript -var n = fibonacciIndex( NaN ); +const n = fibonacciIndex( NaN ); // returns NaN ``` @@ -102,21 +102,15 @@ var n = fibonacciIndex( NaN ); ```javascript -var fibonacciIndex = require( '@stdlib/math/base/special/fibonacci-index' ); - -var F1; -var F2; -var FN; -var n; -var i; - -F1 = 1; -F2 = 1; -for ( i = 3; i < 79; i++ ) { - FN = F1 + F2; +const fibonacciIndex = require( '@stdlib/math/base/special/fibonacci-index' ); + +let F1 = 1; +let F2 = 1; +for ( let i = 3; i < 79; i++ ) { + const FN = F1 + F2; F1 = F2; F2 = FN; - n = fibonacciIndex( FN ); + const n = fibonacciIndex( FN ); console.log( 'n(%d) = %d', FN, n ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fibonacci/README.md b/lib/node_modules/@stdlib/math/base/special/fibonacci/README.md index 6f43fad959a8..96c65cd3a09e 100644 --- a/lib/node_modules/@stdlib/math/base/special/fibonacci/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fibonacci/README.md @@ -65,7 +65,7 @@ with seed values `F_0 = 0` and `F_1 = 1`. ## Usage ```javascript -var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); +const fibonacci = require( '@stdlib/math/base/special/fibonacci' ); ``` #### fibonacci( n ) @@ -73,7 +73,7 @@ var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); Computes the nth [Fibonacci number][fibonacci-number]. ```javascript -var v = fibonacci( 0 ); +let v = fibonacci( 0 ); // returns 0 v = fibonacci( 1 ); @@ -92,14 +92,14 @@ v = fibonacci( 78 ); If `n > 78`, the function returns `NaN`, as larger [Fibonacci numbers][fibonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = fibonacci( 79 ); +const v = fibonacci( 79 ); // returns NaN ``` If not provided a nonnegative integer value, the function returns `NaN`. ```javascript -var v = fibonacci( 3.14 ); +let v = fibonacci( 3.14 ); // returns NaN v = fibonacci( -1 ); @@ -109,7 +109,7 @@ v = fibonacci( -1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = fibonacci( NaN ); +const v = fibonacci( NaN ); // returns NaN ``` @@ -130,13 +130,10 @@ var v = fibonacci( NaN ); ```javascript -var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); +const fibonacci = require( '@stdlib/math/base/special/fibonacci' ); -var v; -var i; - -for ( i = 0; i < 79; i++ ) { - v = fibonacci( i ); +for ( let i = 0; i < 79; i++ ) { + const v = fibonacci( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/flipsign/README.md b/lib/node_modules/@stdlib/math/base/special/flipsign/README.md index 5a89f66296dd..72e911c2ddbc 100644 --- a/lib/node_modules/@stdlib/math/base/special/flipsign/README.md +++ b/lib/node_modules/@stdlib/math/base/special/flipsign/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flipsign = require( '@stdlib/math/base/special/flipsign' ); +const flipsign = require( '@stdlib/math/base/special/flipsign' ); ``` #### flipsign( x, y ) @@ -35,7 +35,7 @@ var flipsign = require( '@stdlib/math/base/special/flipsign' ); Returns a [double-precision floating-point number][ieee754] with the magnitude of `x` and the sign of `x*y` (i.e., only return `-x` when `y` is a negative number). ```javascript -var z = flipsign( -3.0, 10.0 ); +let z = flipsign( -3.0, 10.0 ); // returns -3.0 z = flipsign( -3.0, -1.0 ); @@ -75,19 +75,14 @@ z = flipsign( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var flipsign = require( '@stdlib/math/base/special/flipsign' ); - -var x; -var y; -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const flipsign = require( '@stdlib/math/base/special/flipsign' ); // Generate random numbers `x` and `y` and flip the sign of `x` only if `y` is negative... -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - y = (randu()*10.0) - 5.0; - z = flipsign( x, y ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const y = (randu()*10.0) - 5.0; + const z = flipsign( x, y ); console.log( 'x: %d, y: %d => %d', x, y, z ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/flipsignf/README.md b/lib/node_modules/@stdlib/math/base/special/flipsignf/README.md index 3751b071fedd..92b600b1800d 100644 --- a/lib/node_modules/@stdlib/math/base/special/flipsignf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/flipsignf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flipsignf = require( '@stdlib/math/base/special/flipsignf' ); +const flipsignf = require( '@stdlib/math/base/special/flipsignf' ); ``` #### flipsignf( x, y ) @@ -35,7 +35,7 @@ var flipsignf = require( '@stdlib/math/base/special/flipsignf' ); Returns a [single-precision floating-point number][ieee754] with the magnitude of `x` and the sign of `x*y` (i.e., only return `-x` when `y` is a negative number). ```javascript -var z = flipsignf( -3.0, 10.0 ); +let z = flipsignf( -3.0, 10.0 ); // returns -3.0 z = flipsignf( -3.0, -1.0 ); @@ -75,19 +75,14 @@ z = flipsignf( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var flipsignf = require( '@stdlib/math/base/special/flipsignf' ); - -var x; -var y; -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const flipsignf = require( '@stdlib/math/base/special/flipsignf' ); // Generate random numbers `x` and `y` and flip the sign of `x` only if `y` is negative... -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - y = (randu()*10.0) - 5.0; - z = flipsignf( x, y ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const y = (randu()*10.0) - 5.0; + const z = flipsignf( x, y ); console.log( 'x: %d, y: %d => %d', x, y, z ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floor/README.md b/lib/node_modules/@stdlib/math/base/special/floor/README.md index 779404f65fa6..759b2a68006a 100644 --- a/lib/node_modules/@stdlib/math/base/special/floor/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); ``` #### floor( x ) @@ -35,7 +35,7 @@ var floor = require( '@stdlib/math/base/special/floor' ); Rounds a double-precision floating-point number toward negative infinity. ```javascript -var v = floor( -4.2 ); +let v = floor( -4.2 ); // returns -5.0 v = floor( 9.99999 ); @@ -59,14 +59,11 @@ v = floor( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'floor(%d) = %d', x, floor( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floor10/README.md b/lib/node_modules/@stdlib/math/base/special/floor10/README.md index 50e7a48f2fa1..c31ef3048304 100644 --- a/lib/node_modules/@stdlib/math/base/special/floor10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floor10/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floor10 = require( '@stdlib/math/base/special/floor10' ); +const floor10 = require( '@stdlib/math/base/special/floor10' ); ``` #### floor10( x ) @@ -35,7 +35,7 @@ var floor10 = require( '@stdlib/math/base/special/floor10' ); Rounds a `numeric` value to the nearest power of `10` toward negative infinity. ```javascript -var v = floor10( -4.2 ); +let v = floor10( -4.2 ); // returns -10.0 v = floor10( -4.5 ); @@ -83,7 +83,7 @@ v = floor10( NaN ); - The function may not return accurate results for subnormals due to a general loss in precision. ```javascript - var v = floor10( 1.0e-323 ); // should return 1.0e-323 + const v = floor10( 1.0e-323 ); // should return 1.0e-323 // returns 0.0 ``` @@ -98,16 +98,12 @@ v = floor10( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor10 = require( '@stdlib/math/base/special/floor10' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor10 = require( '@stdlib/math/base/special/floor10' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = floor10( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = floor10( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floor2/README.md b/lib/node_modules/@stdlib/math/base/special/floor2/README.md index e222a7b0331a..8697f76cfbbf 100644 --- a/lib/node_modules/@stdlib/math/base/special/floor2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floor2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floor2 = require( '@stdlib/math/base/special/floor2' ); +const floor2 = require( '@stdlib/math/base/special/floor2' ); ``` #### floor2( x ) @@ -35,7 +35,7 @@ var floor2 = require( '@stdlib/math/base/special/floor2' ); Rounds a `numeric` value to the nearest power of two toward negative infinity. ```javascript -var v = floor2( -4.2 ); +let v = floor2( -4.2 ); // returns -8.0 v = floor2( -4.5 ); @@ -83,16 +83,12 @@ v = floor2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor2 = require( '@stdlib/math/base/special/floor2' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor2 = require( '@stdlib/math/base/special/floor2' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = floor2( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = floor2( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floorb/README.md b/lib/node_modules/@stdlib/math/base/special/floorb/README.md index 919cdb3da497..f7311d7b2b6a 100644 --- a/lib/node_modules/@stdlib/math/base/special/floorb/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floorb/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floorb = require( '@stdlib/math/base/special/floorb' ); +const floorb = require( '@stdlib/math/base/special/floorb' ); ``` #### floorb( x, n, b ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `b^n` toward negative infini ```javascript // Round a value to 4 decimal places: -var v = floorb( 3.141592653589793, -4, 10 ); +let v = floorb( 3.141592653589793, -4, 10 ); // returns 3.1415 // If n = 0 or b = 1, `floorb` behaves like `floor`: @@ -59,11 +59,11 @@ v = floorb( 5.0, 1, 2 ); - Due to rounding error in [floating-point numbers][ieee754], rounding may **not** be exact. For example, ```javascript - var x = -0.2 - 0.1; + const x = -0.2 - 0.1; // returns -0.30000000000000004 // Should round to -0.3... - var v = floorb( x, -16, 10 ); + const v = floorb( x, -16, 10 ); // returns -0.3000000000000001 ``` @@ -78,22 +78,16 @@ v = floorb( 5.0, 1, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var floorb = require( '@stdlib/math/base/special/floorb' ); - -var x; -var n; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = round( (randu()*10.0) - 5.0 ); - b = round( randu()*10.0 ); - v = floorb( x, n, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const floorb = require( '@stdlib/math/base/special/floorb' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = round( (randu()*10.0) - 5.0 ); + const b = round( randu()*10.0 ); + const v = floorb( x, n, b ); console.log( 'x: %d. %d^%d: %d. Rounded: %d.', x, b, n, pow( b, n ), v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floorf/README.md b/lib/node_modules/@stdlib/math/base/special/floorf/README.md index e60a7c3b0db0..2433f8fef99d 100644 --- a/lib/node_modules/@stdlib/math/base/special/floorf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floorf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floorf = require( '@stdlib/math/base/special/floorf' ); +const floorf = require( '@stdlib/math/base/special/floorf' ); ``` #### floorf( x ) @@ -35,7 +35,7 @@ var floorf = require( '@stdlib/math/base/special/floorf' ); Rounds a single-precision floating-point `numeric` value toward negative infinity. ```javascript -var v = floorf( -4.2 ); +let v = floorf( -4.2 ); // returns -5.0 v = floorf( 9.99999 ); @@ -59,14 +59,11 @@ v = floorf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floorf = require( '@stdlib/math/base/special/floorf' ); +const randu = require( '@stdlib/random/base/randu' ); +const floorf = require( '@stdlib/math/base/special/floorf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'floorf(%d) = %d', x, floorf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floorn/README.md b/lib/node_modules/@stdlib/math/base/special/floorn/README.md index 3eca6ad62822..32fe902f25fe 100644 --- a/lib/node_modules/@stdlib/math/base/special/floorn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floorn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floorn = require( '@stdlib/math/base/special/floorn' ); +const floorn = require( '@stdlib/math/base/special/floorn' ); ``` #### floorn( x, n ) @@ -36,7 +36,7 @@ Rounds a double-precision floating-point number to the nearest multiple of `10^n ```javascript // Round a value to 4 decimal places: -var v = floorn( 3.141592653589793, -4 ); +let v = floorn( 3.141592653589793, -4 ); // returns 3.1415 // If n = 0, `floorn` behaves like `floor`: @@ -59,11 +59,11 @@ v = floorn( 12368.0, 3 ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var x = -0.2 - 0.1; + const x = -0.2 - 0.1; // returns -0.30000000000000004 // Should round to -0.3: - var v = floorn( x, -16 ); + const v = floorn( x, -16 ); // returns -0.3000000000000001 ``` @@ -78,18 +78,13 @@ v = floorn( 12368.0, 3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floorn = require( '@stdlib/math/base/special/floorn' ); - -var x; -var n; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = floorn( randu()*5.0, 0 ); - v = floorn( x, -n ); +const randu = require( '@stdlib/random/base/randu' ); +const floorn = require( '@stdlib/math/base/special/floorn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = floorn( randu()*5.0, 0 ); + const v = floorn( x, -n ); console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/floorsd/README.md b/lib/node_modules/@stdlib/math/base/special/floorsd/README.md index e62941139d87..5154e3d1aee2 100644 --- a/lib/node_modules/@stdlib/math/base/special/floorsd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/floorsd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var floorsd = require( '@stdlib/math/base/special/floorsd' ); +const floorsd = require( '@stdlib/math/base/special/floorsd' ); ``` #### floorsd( x, n, b ) @@ -35,7 +35,7 @@ var floorsd = require( '@stdlib/math/base/special/floorsd' ); Rounds a `numeric` value to the nearest `number` toward negative infinity with `n` significant figures. ```javascript -var v = floorsd( 3.141592653589793, 5, 10 ); +let v = floorsd( 3.141592653589793, 5, 10 ); // returns 3.1415 v = floorsd( 3.141592653589793, 1, 10 ); @@ -65,16 +65,12 @@ v = floorsd( 0.0313, 2, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floorsd = require( '@stdlib/math/base/special/floorsd' ); +const randu = require( '@stdlib/random/base/randu' ); +const floorsd = require( '@stdlib/math/base/special/floorsd' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10000.0) - 5000.0; - y = floorsd( x, 5, 10 ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10000.0) - 5000.0; + const y = floorsd( x, 5, 10 ); console.log( 'x: %d. Rounded: %d.', x, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fmod/README.md b/lib/node_modules/@stdlib/math/base/special/fmod/README.md index ab87cd2d57ab..a3fe65768aec 100644 --- a/lib/node_modules/@stdlib/math/base/special/fmod/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fmod/README.md @@ -45,7 +45,7 @@ where `x` is the **dividend** and `y` is the **divisor**. ## Usage ```javascript -var fmod = require( '@stdlib/math/base/special/fmod' ); +const fmod = require( '@stdlib/math/base/special/fmod' ); ``` #### fmod( x, y ) @@ -53,7 +53,7 @@ var fmod = require( '@stdlib/math/base/special/fmod' ); Evaluates the [modulus function][modulus-function]. ```javascript -var v = fmod( 8.0, 3.0 ); +let v = fmod( 8.0, 3.0 ); // returns 2.0 v = fmod( 9.0, 3.0 ); @@ -83,17 +83,13 @@ v = fmod( NaN, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var fmod = require( '@stdlib/math/base/special/fmod' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const fmod = require( '@stdlib/math/base/special/fmod' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 10.0 ); - y = round( randu() * 10.0 ) - 5.0; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 10.0 ); + const y = round( randu() * 10.0 ) - 5.0; console.log( '%d%%%d = %d', x, y, fmod( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fresnel/README.md b/lib/node_modules/@stdlib/math/base/special/fresnel/README.md index d8668311f3c6..3d0761e4cec4 100644 --- a/lib/node_modules/@stdlib/math/base/special/fresnel/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fresnel/README.md @@ -50,7 +50,7 @@ Some sources define the Fresnel integrals using t2 for the argument o ## Usage ```javascript -var fresnel = require( '@stdlib/math/base/special/fresnel' ); +const fresnel = require( '@stdlib/math/base/special/fresnel' ); ``` #### fresnel( x ) @@ -58,7 +58,7 @@ var fresnel = require( '@stdlib/math/base/special/fresnel' ); Simultaneously computes the [Fresnel integrals][fresnel-integral] S(x) and C(x). ```javascript -var v = fresnel( 0.0 ); +let v = fresnel( 0.0 ); // returns [ ~0.0, ~0.0 ] v = fresnel( 1.0 ); @@ -79,14 +79,14 @@ v = fresnel( NaN ); Simultaneously computes the [Fresnel integrals][fresnel-integral] S(x) and C(x) and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = fresnel.assign( 0.0, out, 1, 0 ); +const v = fresnel.assign( 0.0, out, 1, 0 ); // returns [ ~0.0, ~0.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -101,13 +101,12 @@ var bool = ( v === out ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var fresnel = require( '@stdlib/math/base/special/fresnel' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const fresnel = require( '@stdlib/math/base/special/fresnel' ); -var x = linspace( 0.0, 10.0, 100 ); +const x = linspace( 0.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( fresnel( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fresnelc/README.md b/lib/node_modules/@stdlib/math/base/special/fresnelc/README.md index f5f4093eb674..59215b91c674 100644 --- a/lib/node_modules/@stdlib/math/base/special/fresnelc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fresnelc/README.md @@ -50,7 +50,7 @@ Some sources define C(x) using t2 for the argument of the cosine. To ## Usage ```javascript -var fresnelc = require( '@stdlib/math/base/special/fresnelc' ); +const fresnelc = require( '@stdlib/math/base/special/fresnelc' ); ``` #### fresnelc( x ) @@ -58,7 +58,7 @@ var fresnelc = require( '@stdlib/math/base/special/fresnelc' ); Computes the [Fresnel integral][fresnel-integral] C(x). ```javascript -var v = fresnelc( 0.0 ); +let v = fresnelc( 0.0 ); // returns ~0.0 v = fresnelc( 1.0 ); @@ -85,13 +85,12 @@ v = fresnelc( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var fresnelc = require( '@stdlib/math/base/special/fresnelc' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const fresnelc = require( '@stdlib/math/base/special/fresnelc' ); -var x = linspace( 0.0, 10.0, 100 ); +const x = linspace( 0.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( fresnelc( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/fresnels/README.md b/lib/node_modules/@stdlib/math/base/special/fresnels/README.md index ea4dd67c64eb..6e5212d08e31 100644 --- a/lib/node_modules/@stdlib/math/base/special/fresnels/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fresnels/README.md @@ -50,7 +50,7 @@ Some sources define S(x) using t2 for the argument of the sine. To ge ## Usage ```javascript -var fresnels = require( '@stdlib/math/base/special/fresnels' ); +const fresnels = require( '@stdlib/math/base/special/fresnels' ); ``` #### fresnels( x ) @@ -58,7 +58,7 @@ var fresnels = require( '@stdlib/math/base/special/fresnels' ); Computes the [Fresnel integral][fresnel-integral] S(x). ```javascript -var v = fresnels( 0.0 ); +let v = fresnels( 0.0 ); // returns ~0.0 v = fresnels( 1.0 ); @@ -85,13 +85,12 @@ v = fresnels( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var fresnels = require( '@stdlib/math/base/special/fresnels' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const fresnels = require( '@stdlib/math/base/special/fresnels' ); -var x = linspace( 0.0, 10.0, 100 ); +const x = linspace( 0.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( fresnels( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/frexp/README.md b/lib/node_modules/@stdlib/math/base/special/frexp/README.md index 46223e7af7c4..629f63dfcd0c 100644 --- a/lib/node_modules/@stdlib/math/base/special/frexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/frexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var frexp = require( '@stdlib/math/base/special/frexp' ); +const frexp = require( '@stdlib/math/base/special/frexp' ); ``` #### frexp( x ) @@ -35,30 +35,30 @@ var frexp = require( '@stdlib/math/base/special/frexp' ); Splits a [double-precision floating-point number][ieee754] into a normalized fraction and an integer power of two. ```javascript -var out = frexp( 4.0 ); +const out = frexp( 4.0 ); // returns [ 0.5, 3 ] ``` By default, the function returns the normalized fraction and the exponent as a two-element `array`. The normalized fraction and exponent satisfy the relation `x = frac * 2^exp`. ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var x = 4.0; -var out = frexp( x ); +const x = 4.0; +const out = frexp( x ); // returns [ 0.5, 3 ] -var frac = out[ 0 ]; -var exp = out[ 1 ]; +const frac = out[ 0 ]; +const exp = out[ 1 ]; -var bool = ( x === frac * pow(2.0, exp) ); +const bool = ( x === frac * pow(2.0, exp) ); // returns true ``` If provided positive or negative zero, `NaN`, or positive or negative `infinity`, the function returns a two-element `array` containing the input value and an exponent equal to `0`. ```javascript -var out = frexp( 0.0 ); +let out = frexp( 0.0 ); // returns [ 0.0, 0 ] out = frexp( -0.0 ); @@ -81,14 +81,14 @@ For all other numeric input values, the [absolute value][@stdlib/math/base/speci Splits a [double-precision floating-point number][ieee754] into a normalized fraction and an integer power of two and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var y = frexp.assign( 4.0, out, 1, 0 ); +const y = frexp.assign( 4.0, out, 1, 0 ); // returns [ 0.5, 3 ] -var bool = ( y === out ); +const bool = ( y === out ); // returns true ``` @@ -103,15 +103,15 @@ var bool = ( y === out ); - Care should be taken when reconstituting a [double-precision floating-point number][ieee754] from a normalized fraction and an exponent. For example, ```javascript - var pow = require( '@stdlib/math/base/special/pow' ); + const pow = require( '@stdlib/math/base/special/pow' ); - var x = 8.988939926493918e+307; // x ~ 2^1023 + const x = 8.988939926493918e+307; // x ~ 2^1023 - var out = frexp( x ); + const out = frexp( x ); // returns [ 0.5000263811533315, 1024 ] // Naive reconstitution: - var y = out[ 0 ] * pow( 2.0, out[ 1 ] ); + let y = out[ 0 ] * pow( 2.0, out[ 1 ] ); // returns Infinity // Account for 2^1024 evaluating as infinity by recognizing 2^1024 = 2^1 * 2^1023: @@ -130,31 +130,25 @@ var bool = ( y === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var BIAS = require( '@stdlib/constants/float64/exponent-bias' ); -var frexp = require( '@stdlib/math/base/special/frexp' ); - -var sign; -var frac; -var exp; -var x; -var f; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const BIAS = require( '@stdlib/constants/float64/exponent-bias' ); +const frexp = require( '@stdlib/math/base/special/frexp' ); // Generate random numbers and break each into a normalized fraction and an integer power of two... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; + let v; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } - frac = randu() * 10.0; - exp = round( randu()*616.0 ) - 308; - x = sign * frac * pow( 10.0, exp ); - f = frexp( x ); + const frac = randu() * 10.0; + const exp = round( randu()*616.0 ) - 308; + const x = sign * frac * pow( 10.0, exp ); + const f = frexp( x ); if ( f[ 1 ] > BIAS ) { v = f[ 0 ] * pow( 2.0, f[1]-BIAS ) * pow( 2.0, BIAS ); } else { diff --git a/lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/README.md b/lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/README.md index 09067c724e75..88b1365a0feb 100644 --- a/lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gamma-delta-ratio/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' ); +const gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' ); ``` #### gammaDeltaRatio( z, delta ) @@ -35,7 +35,7 @@ var gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' ); Computes the ratio of two [gamma functions][@stdlib/math/base/special/gamma]. Specifically, the function evaluates `Γ( z ) / Γ( z + delta )`. ```javascript -var y = gammaDeltaRatio( 2.0, 3.0 ); +let y = gammaDeltaRatio( 2.0, 3.0 ); // returns ~0.042 y = gammaDeltaRatio( 4.0, 0.5 ); @@ -56,16 +56,12 @@ y = gammaDeltaRatio( 100.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' ); +const randu = require( '@stdlib/random/base/randu' ); +const gammaDeltaRatio = require( '@stdlib/math/base/special/gamma-delta-ratio' ); -var delta; -var z; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randu()*10.0; - delta = randu()*10.0; +for ( let i = 0; i < 100; i++ ) { + const z = randu()*10.0; + const delta = randu()*10.0; console.log( 'gamma( %d ) / gamma( %d + %d ) = %d', z, z, delta, gammaDeltaRatio( z, delta ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled/README.md b/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled/README.md index 44f0efdbac76..22d0f3087e74 100644 --- a/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled/README.md @@ -63,7 +63,7 @@ L_g(n) \cdot \exp(-g) ## Usage ```javascript -var gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled' ); +const gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled' ); ``` #### gammaLanczosSumExpGScaled( x ) @@ -71,7 +71,7 @@ var gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczo Calculates the Lanczos sum for the approximation of the [gamma function][gamma-function] (scaled by `exp(-g)`, where `g = 10.900511`). ```javascript -var v = gammaLanczosSumExpGScaled( 4.0 ); +let v = gammaLanczosSumExpGScaled( 4.0 ); // returns ~0.018 v = gammaLanczosSumExpGScaled( -1.5 ); @@ -101,13 +101,12 @@ v = gammaLanczosSumExpGScaled( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gammaLanczosSumExpGScaled = require( '@stdlib/math/base/special/gamma-lanczos-sum-expg-scaled' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], gammaLanczosSumExpGScaled( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum/README.md b/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum/README.md index 3d4fc751484f..5bdc27949097 100644 --- a/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gamma-lanczos-sum/README.md @@ -50,7 +50,7 @@ where `g` is an [arbitrary constant][@stdlib/constants/float64/gamma-lanczos-g] ## Usage ```javascript -var gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' ); +const gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' ); ``` #### gammaLanczosSum( x ) @@ -58,7 +58,7 @@ var gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' ); Calculates the Lanczos sum for the approximation of the [gamma function][gamma-function]. ```javascript -var v = gammaLanczosSum( 4.0 ); +let v = gammaLanczosSum( 4.0 ); // returns ~950.366 v = gammaLanczosSum( -1.5 ); @@ -88,13 +88,12 @@ v = gammaLanczosSum( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gammaLanczosSum = require( '@stdlib/math/base/special/gamma-lanczos-sum' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], gammaLanczosSum( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gamma/README.md b/lib/node_modules/@stdlib/math/base/special/gamma/README.md index b9278aa58407..f7fea8990f76 100644 --- a/lib/node_modules/@stdlib/math/base/special/gamma/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gamma/README.md @@ -65,7 +65,7 @@ where `γ ≈ 0.577216` is the [Euler–Mascheroni constant][@stdlib/constants/ ## Usage ```javascript -var gamma = require( '@stdlib/math/base/special/gamma' ); +const gamma = require( '@stdlib/math/base/special/gamma' ); ``` #### gamma( x ) @@ -73,7 +73,7 @@ var gamma = require( '@stdlib/math/base/special/gamma' ); Evaluates the [gamma function][gamma-function]. ```javascript -var v = gamma( 4.0 ); +let v = gamma( 4.0 ); // returns 6.0 v = gamma( -1.5 ); @@ -106,13 +106,12 @@ v = gamma( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var gamma = require( '@stdlib/math/base/special/gamma' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gamma = require( '@stdlib/math/base/special/gamma' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], gamma( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gamma1pm1/README.md b/lib/node_modules/@stdlib/math/base/special/gamma1pm1/README.md index 108770906da2..7d0320f70dd2 100644 --- a/lib/node_modules/@stdlib/math/base/special/gamma1pm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gamma1pm1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' ); +const gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' ); ``` #### gamma1pm1( x ) @@ -35,7 +35,7 @@ var gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' ); Computes `gamma(x+1) - 1` without cancellation errors for small `x` and where `gamma(x)` is the [gamma function][@stdlib/math/base/special/gamma]. ```javascript -var v = gamma1pm1( 0.2 ); +let v = gamma1pm1( 0.2 ); // returns ~-0.082 v = gamma1pm1( -8.5 ); @@ -59,14 +59,11 @@ v = gamma1pm1( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' ); +const randu = require( '@stdlib/random/base/randu' ); +const gamma1pm1 = require( '@stdlib/math/base/special/gamma1pm1' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10.0) - 5.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10.0) - 5.0; console.log( 'gamma(%d+1) - 1 = %d', x, gamma1pm1( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gammainc/README.md b/lib/node_modules/@stdlib/math/base/special/gammainc/README.md index 42fa8cba2e7d..982c37a0b7d7 100644 --- a/lib/node_modules/@stdlib/math/base/special/gammainc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gammainc/README.md @@ -97,7 +97,7 @@ The relationship between the two functions is `Γ(a,x) = γ(a,x) + Γ(a)`. ## Usage ```javascript -var gammainc = require( '@stdlib/math/base/special/gammainc' ); +const gammainc = require( '@stdlib/math/base/special/gammainc' ); ``` #### gammainc( x, s\[, regularized\[, upper ]] ) @@ -105,7 +105,7 @@ var gammainc = require( '@stdlib/math/base/special/gammainc' ); By default, evaluates the regularized lower [incomplete gamma function][incomplete-gamma-function] for inputs `x` and `s`. The third and fourth parameters of the function can be used to specify whether instead to evaluate the non-regularized and/or upper incomplete gamma functions, respectively. ```javascript -var y = gammainc( 6.0, 2.0 ); +let y = gammainc( 6.0, 2.0 ); // returns ~0.9826 y = gammainc( 1.0, 2.0, true, true ); @@ -121,7 +121,7 @@ y = gammainc( 7.0, 5.0, false ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = gammainc( NaN, 1.0 ); +let y = gammainc( NaN, 1.0 ); // returns NaN y = gammainc( 1.0, NaN ); @@ -131,14 +131,14 @@ y = gammainc( 1.0, NaN ); If provided a negative `x`, the function returns `NaN`. ```javascript -var y = gammainc( -2.0, 2.0 ); +const y = gammainc( -2.0, 2.0 ); // returns NaN ``` If provided a nonpositive `s`, the function returns `NaN`. ```javascript -var y = gammainc( 2.0, -1.0 ); +let y = gammainc( 2.0, -1.0 ); // returns NaN y = gammainc( 2.0, 0.0 ); @@ -156,16 +156,12 @@ y = gammainc( 2.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var gammainc = require( '@stdlib/math/base/special/gammainc' ); +const randu = require( '@stdlib/random/base/randu' ); +const gammainc = require( '@stdlib/math/base/special/gammainc' ); -var i; -var x; -var s; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - s = randu() * 10.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const s = randu() * 10.0; console.log( 'x: %d, \t s: %d, \t f(x,s): %d', x.toFixed( 4 ), s.toFixed( 4 ), gammainc( x, s ).toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gammaincinv/README.md b/lib/node_modules/@stdlib/math/base/special/gammaincinv/README.md index 68d0a4fcd113..c5b8677efdce 100644 --- a/lib/node_modules/@stdlib/math/base/special/gammaincinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gammaincinv/README.md @@ -67,7 +67,7 @@ Again, for given `p` and `a` the function returns the `x` which satisfies `p = Q ## Usage ```javascript -var gammaincinv = require( '@stdlib/math/base/special/gammaincinv' ); +const gammaincinv = require( '@stdlib/math/base/special/gammaincinv' ); ``` #### gammaincinv( p, s\[, upper ] ) @@ -75,7 +75,7 @@ var gammaincinv = require( '@stdlib/math/base/special/gammaincinv' ); Inverts the regularized incomplete gamma function. Contrary to the more commonly used definition, in this implementation the first argument is the probability `p` and the second argument is the scale factor `a`. By default, the function inverts the _lower_ regularized incomplete gamma function, `P(x,a)`. To invert the _upper_ function instead, i.e. `Q(x,a)`, set the `upper` argument to `true`. ```javascript -var y = gammaincinv( 0.5, 2.0 ); +let y = gammaincinv( 0.5, 2.0 ); // returns ~1.678 y = gammaincinv( 0.1, 10.0 ); @@ -91,7 +91,7 @@ y = gammaincinv( 0.75, 3.0, true ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = gammaincinv( NaN, 1.0 ); +let y = gammaincinv( NaN, 1.0 ); // returns NaN y = gammaincinv( 0.5, NaN ); @@ -101,7 +101,7 @@ y = gammaincinv( 0.5, NaN ); If provided a value outside `[0,1]` for `p`, the function returns `NaN`. ```javascript -var y = gammaincinv( 1.2, 1.0 ); +let y = gammaincinv( 1.2, 1.0 ); // returns NaN y = gammaincinv( -0.5, 1.0 ); @@ -119,16 +119,12 @@ y = gammaincinv( -0.5, 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var gammaincinv = require( '@stdlib/math/base/special/gammaincinv' ); +const randu = require( '@stdlib/random/base/randu' ); +const gammaincinv = require( '@stdlib/math/base/special/gammaincinv' ); -var a; -var i; -var p; - -for ( i = 0; i < 100; i++ ) { - p = randu(); - a = randu() * 50.0; +for ( let i = 0; i < 100; i++ ) { + const p = randu(); + const a = randu() * 50.0; console.log( 'p: %d, \t a: %d, \t P^(-1)(p, a): %d', p.toFixed( 4 ), a.toFixed( 4 ), gammaincinv( p, a ).toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gammaln/README.md b/lib/node_modules/@stdlib/math/base/special/gammaln/README.md index 4d66fd2c6276..3f9b82bb4370 100644 --- a/lib/node_modules/@stdlib/math/base/special/gammaln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gammaln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gammaln = require( '@stdlib/math/base/special/gammaln' ); +const gammaln = require( '@stdlib/math/base/special/gammaln' ); ``` #### gammaln( x ) @@ -35,7 +35,7 @@ var gammaln = require( '@stdlib/math/base/special/gammaln' ); Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of the [gamma function][@stdlib/math/base/special/gamma]. ```javascript -var v = gammaln( 2.0 ); +let v = gammaln( 2.0 ); // returns 0.0 v = gammaln( 1.0 ); @@ -68,13 +68,12 @@ v = gammaln( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var gammaln = require( '@stdlib/math/base/special/gammaln' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gammaln = require( '@stdlib/math/base/special/gammaln' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], gammaln( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gammasgn/README.md b/lib/node_modules/@stdlib/math/base/special/gammasgn/README.md index 18c63c01be7c..aea5dee8581f 100644 --- a/lib/node_modules/@stdlib/math/base/special/gammasgn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gammasgn/README.md @@ -50,7 +50,7 @@ The [gamma function][@stdlib/math/base/special/gamma] can be computed as the pro ## Usage ```javascript -var gammasgn = require( '@stdlib/math/base/special/gammasgn' ); +const gammasgn = require( '@stdlib/math/base/special/gammasgn' ); ``` #### gammasgn( x ) @@ -58,7 +58,7 @@ var gammasgn = require( '@stdlib/math/base/special/gammasgn' ); Returns the sign of the [gamma function][@stdlib/math/base/special/gamma]. ```javascript -var v = gammasgn( 1.0 ); +let v = gammasgn( 1.0 ); // returns 1.0 v = gammasgn( -2.5 ); @@ -92,13 +92,12 @@ v = gammasgn( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var gammasgn = require( '@stdlib/math/base/special/gammasgn' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gammasgn = require( '@stdlib/math/base/special/gammasgn' ); -var x = linspace( -10.0, 10.0, 100 ); +const x = linspace( -10.0, 10.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], gammasgn( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/gcd/README.md b/lib/node_modules/@stdlib/math/base/special/gcd/README.md index 97ac18b8734c..e313ce1ce536 100644 --- a/lib/node_modules/@stdlib/math/base/special/gcd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gcd/README.md @@ -39,7 +39,7 @@ The [greatest common divisor][gcd] (gcd) of two non-zero integers `a` and `b` is ## Usage ```javascript -var gcd = require( '@stdlib/math/base/special/gcd' ); +const gcd = require( '@stdlib/math/base/special/gcd' ); ``` #### gcd( a, b ) @@ -47,21 +47,21 @@ var gcd = require( '@stdlib/math/base/special/gcd' ); Computes the [greatest common divisor][gcd] (gcd). ```javascript -var v = gcd( 48, 18 ); +const v = gcd( 48, 18 ); // returns 6 ``` If both `a` and `b` are `0`, the function returns `0`. ```javascript -var v = gcd( 0, 0 ); +const v = gcd( 0, 0 ); // returns 0 ``` Both `a` and `b` must have integer values; otherwise, the function returns `NaN`. ```javascript -var v = gcd( 3.14, 18 ); +let v = gcd( 3.14, 18 ); // returns NaN v = gcd( 48, 3.14 ); @@ -95,14 +95,13 @@ v = gcd( 48, NaN ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var gcd = require( '@stdlib/math/base/special/gcd' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const gcd = require( '@stdlib/math/base/special/gcd' ); -var a = discreteUniform( 100, 0, 50 ); -var b = discreteUniform( a.length, 0, 50 ); +const a = discreteUniform( 100, 0, 50 ); +const b = discreteUniform( a.length, 0, 50 ); -var i; -for ( i = 0; i < a.length; i++ ) { +for ( let i = 0; i < a.length; i++ ) { console.log( 'gcd(%d,%d) = %d', a[ i ], b[ i ], gcd( a[ i ], b[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/hacovercos/README.md b/lib/node_modules/@stdlib/math/base/special/hacovercos/README.md index d934f980a1ba..c3115dccf788 100644 --- a/lib/node_modules/@stdlib/math/base/special/hacovercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/hacovercos/README.md @@ -48,7 +48,7 @@ The half-value [coversed cosine][coversed-cosine] is defined as ## Usage ```javascript -var hacovercos = require( '@stdlib/math/base/special/hacovercos' ); +const hacovercos = require( '@stdlib/math/base/special/hacovercos' ); ``` #### hacovercos( x ) @@ -56,7 +56,7 @@ var hacovercos = require( '@stdlib/math/base/special/hacovercos' ); Computes the half-value [coversed cosine][coversed-cosine] (in radians). ```javascript -var v = hacovercos( 0.0 ); +let v = hacovercos( 0.0 ); // returns 0.5 v = hacovercos( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = hacovercos( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var hacovercos = require( '@stdlib/math/base/special/hacovercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const hacovercos = require( '@stdlib/math/base/special/hacovercos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( hacovercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/hacoversin/README.md b/lib/node_modules/@stdlib/math/base/special/hacoversin/README.md index 7f8b05bb16b7..3744f763ba3e 100644 --- a/lib/node_modules/@stdlib/math/base/special/hacoversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/hacoversin/README.md @@ -48,7 +48,7 @@ The half-value [coversed sine][coversed-sine] is defined as ## Usage ```javascript -var hacoversin = require( '@stdlib/math/base/special/hacoversin' ); +const hacoversin = require( '@stdlib/math/base/special/hacoversin' ); ``` #### hacoversin( x ) @@ -56,7 +56,7 @@ var hacoversin = require( '@stdlib/math/base/special/hacoversin' ); Computes the half-value [coversed sine][coversed-sine] (in radians). ```javascript -var v = hacoversin( 0.0 ); +let v = hacoversin( 0.0 ); // returns 0.5 v = hacoversin( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = hacoversin( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var hacoversin = require( '@stdlib/math/base/special/hacoversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const hacoversin = require( '@stdlib/math/base/special/hacoversin' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( hacoversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/havercos/README.md b/lib/node_modules/@stdlib/math/base/special/havercos/README.md index 7534c8a12334..23d07ed2016b 100644 --- a/lib/node_modules/@stdlib/math/base/special/havercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/havercos/README.md @@ -48,7 +48,7 @@ The half-value [versed cosine][versed-cosine] is defined as ## Usage ```javascript -var havercos = require( '@stdlib/math/base/special/havercos' ); +const havercos = require( '@stdlib/math/base/special/havercos' ); ``` #### havercos( x ) @@ -56,7 +56,7 @@ var havercos = require( '@stdlib/math/base/special/havercos' ); Computes the half-value [versed cosine][versed-cosine] (in radians). ```javascript -var v = havercos( 0.0 ); +let v = havercos( 0.0 ); // returns 1.0 v = havercos( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = havercos( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var havercos = require( '@stdlib/math/base/special/havercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const havercos = require( '@stdlib/math/base/special/havercos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( havercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/haversin/README.md b/lib/node_modules/@stdlib/math/base/special/haversin/README.md index 2901ec7ec87a..3189ef13c581 100644 --- a/lib/node_modules/@stdlib/math/base/special/haversin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/haversin/README.md @@ -48,7 +48,7 @@ The half-value [versed sine][versed-sine] is defined as ## Usage ```javascript -var haversin = require( '@stdlib/math/base/special/haversin' ); +const haversin = require( '@stdlib/math/base/special/haversin' ); ``` #### haversin( x ) @@ -56,7 +56,7 @@ var haversin = require( '@stdlib/math/base/special/haversin' ); Computes the half-value [versed sine][versed-sine] (in radians). ```javascript -var v = haversin( 0.0 ); +let v = haversin( 0.0 ); // returns 0.0 v = haversin( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = haversin( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var haversin = require( '@stdlib/math/base/special/haversin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const haversin = require( '@stdlib/math/base/special/haversin' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( haversin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/heaviside/README.md b/lib/node_modules/@stdlib/math/base/special/heaviside/README.md index 75df894f1d46..b0b34a496906 100644 --- a/lib/node_modules/@stdlib/math/base/special/heaviside/README.md +++ b/lib/node_modules/@stdlib/math/base/special/heaviside/README.md @@ -93,7 +93,7 @@ H(x) = \begin{cases} x & \textrm{if}\ x \geq 0 \\ 0 & \textrm{if}\ x \lt 0\end{c ## Usage ```javascript -var heaviside = require( '@stdlib/math/base/special/heaviside' ); +const heaviside = require( '@stdlib/math/base/special/heaviside' ); ``` #### heaviside( x\[, continuity] ) @@ -101,7 +101,7 @@ var heaviside = require( '@stdlib/math/base/special/heaviside' ); Evaluates the [Heaviside function][heaviside-function]. ```javascript -var v = heaviside( 3.14 ); +let v = heaviside( 3.14 ); // returns 1.0 v = heaviside( -3.14 ); @@ -120,14 +120,14 @@ The `continuity` parameter may be one of the following values: By default, the function is discontinuous at `0`. ```javascript -var v = heaviside( 0.0 ); +const v = heaviside( 0.0 ); // returns NaN ``` To define the [Heaviside function][heaviside-function] as a continuous function, set the `continuity` parameter. ```javascript -var v = heaviside( 0.0, 'half-maximum' ); +let v = heaviside( 0.0, 'half-maximum' ); // returns 0.5 v = heaviside( 0.0, 'left-continuous' ); @@ -148,13 +148,12 @@ v = heaviside( 0.0, 'right-continuous' ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var heaviside = require( '@stdlib/math/base/special/heaviside' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const heaviside = require( '@stdlib/math/base/special/heaviside' ); -var x = linspace( -10.0, 10.0, 101 ); +const x = linspace( -10.0, 10.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'H(%d) = %d', x[ i ], heaviside( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/hypot/README.md b/lib/node_modules/@stdlib/math/base/special/hypot/README.md index f7dd7e3239d6..6e4152c90ddd 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypot/README.md +++ b/lib/node_modules/@stdlib/math/base/special/hypot/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hypot = require( '@stdlib/math/base/special/hypot' ); +const hypot = require( '@stdlib/math/base/special/hypot' ); ``` #### hypot( x, y ) @@ -45,7 +45,7 @@ var hypot = require( '@stdlib/math/base/special/hypot' ); Computes the [hypotenuse][hypotenuse] avoiding overflow and underflow. ```javascript -var h = hypot( -5.0, 12.0 ); +let h = hypot( -5.0, 12.0 ); // returns 13.0 h = hypot( -0.0, -0.0 ); @@ -55,7 +55,7 @@ h = hypot( -0.0, -0.0 ); If either argument is `NaN`, the function returns `NaN`. ```javascript -var h = hypot( NaN, 12.0 ); +let h = hypot( NaN, 12.0 ); // returns NaN h = hypot( 5.0, NaN ); @@ -75,31 +75,31 @@ h = hypot( 5.0, NaN ); - The textbook approach to calculating the hypotenuse is subject to overflow and underflow. For example, for a sufficiently large `x` and/or `y`, computing the hypotenuse will overflow. ```javascript - var sqrt = require( '@stdlib/math/base/special/sqrt' ); + const sqrt = require( '@stdlib/math/base/special/sqrt' ); - var x2 = 1.0e154 * 1.0e154; + const x2 = 1.0e154 * 1.0e154; // returns 1.0e308 - var h = sqrt( x2 + x2 ); + const h = sqrt( x2 + x2 ); // returns Infinity ``` Similarly, for sufficiently small `x` and/or `y`, computing the hypotenuse will underflow. ```javascript - var sqrt = require( '@stdlib/math/base/special/sqrt' ); + const sqrt = require( '@stdlib/math/base/special/sqrt' ); - var x2 = 1.0e-200 * 1.0e-200; + const x2 = 1.0e-200 * 1.0e-200; // returns 0.0 - var h = sqrt( x2 + x2 ); + const h = sqrt( x2 + x2 ); // returns 0.0 ``` This implementation uses a numerically stable algorithm which avoids overflow and underflow. ```javascript - var h = hypot( 1.0e154, 1.0e154 ); + let h = hypot( 1.0e154, 1.0e154 ); // returns ~1.4142e+154 h = hypot( 1.0e-200, 1.0e-200 ); @@ -119,19 +119,14 @@ h = hypot( 5.0, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var hypot = require( '@stdlib/math/base/special/hypot' ); - -var x; -var y; -var h; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = hypot( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const hypot = require( '@stdlib/math/base/special/hypot' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const y = round( randu()*100.0 ) - 50.0; + const h = hypot( x, y ); console.log( 'h(%d,%d) = %d', x, y, h ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/README.md b/lib/node_modules/@stdlib/math/base/special/hypotf/README.md index 906d3e561914..ade724544314 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hypotf = require( '@stdlib/math/base/special/hypotf' ); +const hypotf = require( '@stdlib/math/base/special/hypotf' ); ``` #### hypotf( x, y ) @@ -45,7 +45,7 @@ var hypotf = require( '@stdlib/math/base/special/hypotf' ); Computes the [hypotenuse][hypotenuse] avoiding overflow and underflow (single-precision). ```javascript -var h = hypotf( -5.0, 12.0 ); +let h = hypotf( -5.0, 12.0 ); // returns 13.0 h = hypotf( -0.0, -0.0 ); @@ -55,7 +55,7 @@ h = hypotf( -0.0, -0.0 ); If either argument is `NaN`, the function returns `NaN`. ```javascript -var h = hypotf( NaN, 12.0 ); +let h = hypotf( NaN, 12.0 ); // returns NaN h = hypotf( 5.0, NaN ); @@ -83,19 +83,14 @@ h = hypotf( 5.0, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var hypotf = require( '@stdlib/math/base/special/hypotf' ); - -var x; -var y; -var h; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = hypotf( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const hypotf = require( '@stdlib/math/base/special/hypotf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const y = round( randu()*100.0 ) - 50.0; + const h = hypotf( x, y ); console.log( 'h(%d,%d) = %d', x, y, h ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/identity/README.md b/lib/node_modules/@stdlib/math/base/special/identity/README.md index e5821cfffeb4..475d86d0691a 100644 --- a/lib/node_modules/@stdlib/math/base/special/identity/README.md +++ b/lib/node_modules/@stdlib/math/base/special/identity/README.md @@ -50,7 +50,7 @@ for all `x`. ## Usage ```javascript -var identity = require( '@stdlib/math/base/special/identity' ); +const identity = require( '@stdlib/math/base/special/identity' ); ``` #### identity( x ) @@ -58,7 +58,7 @@ var identity = require( '@stdlib/math/base/special/identity' ); Evaluates the [identity function][identity-function] for a double-precision floating-point number. ```javascript -var v = identity( -1.0 ); +let v = identity( -1.0 ); // returns -1.0 v = identity( 2.0 ); @@ -85,15 +85,12 @@ v = identity( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var identity = require( '@stdlib/math/base/special/identity' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const identity = require( '@stdlib/math/base/special/identity' ); -var rand; -var i; - -for ( i = 0; i < 100; i++ ) { - rand = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const rand = round( randu() * 100.0 ) - 50.0; console.log( 'identity(%d) = %d', rand, identity( rand ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/identityf/README.md b/lib/node_modules/@stdlib/math/base/special/identityf/README.md index f8dae0b7aea7..07d02a827c63 100644 --- a/lib/node_modules/@stdlib/math/base/special/identityf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/identityf/README.md @@ -50,7 +50,7 @@ for all `x`. ## Usage ```javascript -var identityf = require( '@stdlib/math/base/special/identityf' ); +const identityf = require( '@stdlib/math/base/special/identityf' ); ``` #### identityf( x ) @@ -58,7 +58,7 @@ var identityf = require( '@stdlib/math/base/special/identityf' ); Evaluates the [identity function][identity-function] for a single-precision floating-point number. ```javascript -var v = identityf( -1.0 ); +let v = identityf( -1.0 ); // returns -1.0 v = identityf( 2.0 ); @@ -85,15 +85,12 @@ v = identityf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var identityf = require( '@stdlib/math/base/special/identityf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const identityf = require( '@stdlib/math/base/special/identityf' ); -var rand; -var i; - -for ( i = 0; i < 100; i++ ) { - rand = round( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const rand = round( randu() * 100.0 ) - 50.0; console.log( 'identity(%d) = %d', rand, identityf( rand ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/inv/README.md b/lib/node_modules/@stdlib/math/base/special/inv/README.md index a64340e75cef..4ec4bf9811b8 100644 --- a/lib/node_modules/@stdlib/math/base/special/inv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/inv/README.md @@ -48,7 +48,7 @@ y = \frac{1}{x} ## Usage ```javascript -var inv = require( '@stdlib/math/base/special/inv' ); +const inv = require( '@stdlib/math/base/special/inv' ); ``` #### inv( x ) @@ -56,7 +56,7 @@ var inv = require( '@stdlib/math/base/special/inv' ); Computes the [multiplicative inverse][multiplicative-inverse] of a double-precision floating-point number `x`. ```javascript -var v = inv( -1.0 ); +let v = inv( -1.0 ); // returns -1.0 v = inv( 2.0 ); @@ -83,15 +83,12 @@ v = inv( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var inv = require( '@stdlib/math/base/special/inv' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const inv = require( '@stdlib/math/base/special/inv' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; console.log( 'inv(%d) = %d', x, inv( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/invf/README.md b/lib/node_modules/@stdlib/math/base/special/invf/README.md index 4e12703c41f4..0f0c4ec8f423 100644 --- a/lib/node_modules/@stdlib/math/base/special/invf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/invf/README.md @@ -48,7 +48,7 @@ y = \frac{1}{x} ## Usage ```javascript -var invf = require( '@stdlib/math/base/special/invf' ); +const invf = require( '@stdlib/math/base/special/invf' ); ``` #### invf( x ) @@ -56,7 +56,7 @@ var invf = require( '@stdlib/math/base/special/invf' ); Computes the [multiplicative inverse][multiplicative-inverse] of a single-precision floating-point number `x`. ```javascript -var v = invf( -1.0 ); +let v = invf( -1.0 ); // returns -1.0 v = invf( 2.0 ); @@ -83,15 +83,12 @@ v = invf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var invf = require( '@stdlib/math/base/special/invf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const invf = require( '@stdlib/math/base/special/invf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; console.log( 'invf(%d) = %d', x, invf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md index 5e05a4ca8b74..d679f4d66c6d 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' ); +const kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' ); ``` #### kernelBetainc( x, a, b, regularized, upper ) @@ -41,7 +41,7 @@ var kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' ); Evaluates the [incomplete beta function][incomplete-beta-function] and its first derivative for parameters `x`, `a > 0` and `b > 0`. The `regularized` and `upper` boolean parameters are used to specify whether to evaluate the regularized or non-regularized and the upper or lower incomplete beta functions, respectively. ```javascript -var out = kernelBetainc( 0.8, 1.0, 0.3, false, false ); +let out = kernelBetainc( 0.8, 1.0, 0.3, false, false ); // returns [ ~1.277, ~0.926 ] out = kernelBetainc( 0.2, 1.0, 2.0, true, false ); @@ -54,7 +54,7 @@ out = kernelBetainc( 0.2, 1.0, 2.0, true, true ); If provided `NaN` for `x`, `a`, or `b`, the function returns `[ NaN, NaN ]`. ```javascript -var out = kernelBetainc( NaN, 1.0, 1.0, true, true ); +let out = kernelBetainc( NaN, 1.0, 1.0, true, true ); // returns [ NaN, NaN ] out = kernelBetainc( 0.8, NaN, 1.0, true, true ); @@ -67,7 +67,7 @@ out = kernelBetainc( 0.8, 1.0, NaN, true, true ); If `x` is outside the interval `[0,1]`, the function returns `[ NaN, NaN ]`. ```javascript -var out = kernelBetainc( 1.5, 1.0, 1.0, true, true ); +let out = kernelBetainc( 1.5, 1.0, 1.0, true, true ); // returns [ NaN, NaN ] out = kernelBetainc( -0.5, 1.0, 1.0, true, true ); @@ -77,7 +77,7 @@ out = kernelBetainc( -0.5, 1.0, 1.0, true, true ); If `a` or `b` is negative, the function returns `[ NaN, NaN ]`. ```javascript -var out = kernelBetainc( 0.5, -2.0, 2.0, true, true ); +let out = kernelBetainc( 0.5, -2.0, 2.0, true, true ); // returns [ NaN, NaN ] out = kernelBetainc( 0.5, 2.0, -2.0, true, true ); @@ -89,13 +89,13 @@ out = kernelBetainc( 0.5, 2.0, -2.0, true, true ); Evaluates the [incomplete beta function][incomplete-beta-function] and its first derivative for parameters `x`, `a > 0` and `b > 0` and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); -var v = kernelBetainc.assign( 0.2, 1.0, 2.0, true, true, out, 1, 0 ); +const out = new Float64Array( 2 ); +const v = kernelBetainc.assign( 0.2, 1.0, 2.0, true, true, out, 1, 0 ); // returns [ 0.64, 1.6 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -112,20 +112,14 @@ The `offset` parameter specifies the index of the first output array element, an ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' ); - -var out; -var i; -var x; -var a; -var b; - -out = [ 0.0, 0.0 ]; -for ( i = 0; i < 100; i++ ) { - x = randu(); - a = randu() * 10.0; - b = randu() * 10.0; +const randu = require( '@stdlib/random/base/randu' ); +const kernelBetainc = require( '@stdlib/math/base/special/kernel-betainc' ); + +const out = [ 0.0, 0.0 ]; +for ( let i = 0; i < 100; i++ ) { + const x = randu(); + const a = randu() * 10.0; + const b = randu() * 10.0; kernelBetainc( x, a, b, true, false, out, 1, 0 ); console.log( 'x: %d, \t a: %d, \t b: %d, \t f(x,a,b): %d, \t f^1(x,a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), out[ 0 ].toFixed( 4 ), out[ 1 ].toFixed( 4 ) ); } diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-betaincinv/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-betaincinv/README.md index 0adc87bb4937..4fec1782b41c 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-betaincinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-betaincinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' ); +const kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' ); ``` #### kernelBetaincinv( a, b, p, q ) @@ -41,7 +41,7 @@ var kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' ); Inverts the lower regularized [incomplete beta function][incomplete-beta-function] at `a > 0` and `b > 0`. Input probabilities `p` and `q` must satisfy `p = 1 - q`. The function returns a two-element array holding the function value `y` and `1-y`. ```javascript -var y = kernelBetaincinv( 3.0, 3.0, 0.2, 0.8 ); +let y = kernelBetaincinv( 3.0, 3.0, 0.2, 0.8 ); // returns [ ~0.327, ~0.673 ] y = kernelBetaincinv( 3.0, 3.0, 0.4, 0.6 ); @@ -65,18 +65,13 @@ y = kernelBetaincinv( 1.0, 6.0, 0.8, 0.2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' ); - -var i; -var p; -var a; -var b; - -for ( i = 0; i < 100; i++ ) { - p = randu(); - a = randu() * 10.0; - b = randu() * 10.0; +const randu = require( '@stdlib/random/base/randu' ); +const kernelBetaincinv = require( '@stdlib/math/base/special/kernel-betaincinv' ); + +for ( let i = 0; i < 100; i++ ) { + const p = randu(); + const a = randu() * 10.0; + const b = randu() * 10.0; console.log( 'p: %d, \t a: %d, \t b: %d, \t f(p,a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), kernelBetaincinv( a, b, p, 1.0-p )[ 0 ] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-cos/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-cos/README.md index 3123cda9260d..92a9221cde3e 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-cos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-cos/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kernelCos = require( '@stdlib/math/base/special/kernel-cos' ); +const kernelCos = require( '@stdlib/math/base/special/kernel-cos' ); ``` #### kernelCos( x, y ) @@ -35,7 +35,7 @@ var kernelCos = require( '@stdlib/math/base/special/kernel-cos' ); Computes the [cosine][cosine] of a double-precision floating-point number on `[-π/4, π/4]`. ```javascript -var v = kernelCos( 0.0, 0.0 ); +let v = kernelCos( 0.0, 0.0 ); // returns ~1.0 v = kernelCos( 3.141592653589793/6.0, 0.0 ); @@ -82,14 +82,13 @@ v = kernelCos( NaN, 0.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var kernelCos = require( '@stdlib/math/base/special/kernel-cos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const kernelCos = require( '@stdlib/math/base/special/kernel-cos' ); -var x = linspace( -PI/4.0, PI/4.0, 100 ); +const x = linspace( -PI/4.0, PI/4.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'kernelCos(%d) = %d', x[ i ], kernelCos( x[ i ], 0.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-log1p/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-log1p/README.md index 37b1ae9406f2..67cbefdb1fb5 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-log1p/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-log1p/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kernelLog1p = require( '@stdlib/math/base/special/kernel-log1p' ); +const kernelLog1p = require( '@stdlib/math/base/special/kernel-log1p' ); ``` #### kernelLog1p( f ) @@ -35,7 +35,7 @@ var kernelLog1p = require( '@stdlib/math/base/special/kernel-log1p' ); Computes `log(1+f) - f` for `1+f` in `~[sqrt(2)/2, sqrt(2)]`. ```javascript -var v = kernelLog1p( 1.0 ); +let v = kernelLog1p( 1.0 ); // returns ~0.1931 v = kernelLog1p( 1.4142135623730951 ); @@ -66,14 +66,13 @@ v = kernelLog1p( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var kernelLog1p = require( '@stdlib/math/base/special/kernel-log1p' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +const kernelLog1p = require( '@stdlib/math/base/special/kernel-log1p' ); -var x = linspace( sqrt( 2.0 ) / 2.0, sqrt( 2.0 ), 100 ); +const x = linspace( sqrt( 2.0 ) / 2.0, sqrt( 2.0 ), 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'kernelLog1p(%d) = %d', x[ i ], kernelLog1p( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-sin/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-sin/README.md index ce386bed6732..389f19bafa6f 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-sin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-sin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kernelSin = require( '@stdlib/math/base/special/kernel-sin' ); +const kernelSin = require( '@stdlib/math/base/special/kernel-sin' ); ``` #### kernelSin( x, y ) @@ -35,7 +35,7 @@ var kernelSin = require( '@stdlib/math/base/special/kernel-sin' ); Computes the [sine][sine] of a double-precision floating-point number on `[-π/4, π/4]`. ```javascript -var v = kernelSin( 0.0, 0.0 ); +let v = kernelSin( 0.0, 0.0 ); // returns ~0.0 v = kernelSin( 3.141592653589793/6.0, 0.0 ); @@ -88,14 +88,13 @@ v = kernelSin( NaN, NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var kernelSin = require( '@stdlib/math/base/special/kernel-sin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const kernelSin = require( '@stdlib/math/base/special/kernel-sin' ); -var x = linspace( -PI/4.0, PI/4.0, 100 ); +const x = linspace( -PI/4.0, PI/4.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'sine(%d) = %d', x[ i ], kernelSin( x[ i ], 0.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-tan/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-tan/README.md index 43e49e855fce..31ec0f98991a 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-tan/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-tan/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kernelTan = require( '@stdlib/math/base/special/kernel-tan' ); +const kernelTan = require( '@stdlib/math/base/special/kernel-tan' ); ``` #### kernelTan( x, y, k ) @@ -35,7 +35,7 @@ var kernelTan = require( '@stdlib/math/base/special/kernel-tan' ); Computes the [tangent][tangent] of a double-precision floating-point number on `[-π/4, π/4]`. ```javascript -var out = kernelTan( 3.141592653589793/4.0, 0.0, 1 ); +let out = kernelTan( 3.141592653589793/4.0, 0.0, 1 ); // returns ~1.0 out = kernelTan( 3.141592653589793/6.0, 0.0, 1 ); @@ -48,14 +48,14 @@ out = kernelTan( 0.664, 5.288e-17, 1 ); If `k = 1`, the function returns `tan(x+y)`. To return the negative inverse `-1/tan(x+y)`, set `k = -1`. ```javascript -var out = kernelTan( 3.141592653589793/4.0, 0.0, -1 ); +const out = kernelTan( 3.141592653589793/4.0, 0.0, -1 ); // returns ~-1.0 ``` If either `x` or `y` is `NaN`, the function returns `NaN`. ```javascript -var out = kernelTan( NaN, 0.0, 1 ); +let out = kernelTan( NaN, 0.0, 1 ); // returns NaN out = kernelTan( 3.0, NaN, 1 ); @@ -99,21 +99,17 @@ out = kernelTan( NaN, NaN, 1 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var binomial = require( '@stdlib/random/base/binomial' ).factory; -var PI = require( '@stdlib/constants/float64/pi' ); -var kernelTan = require( '@stdlib/math/base/special/kernel-tan' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const binomial = require( '@stdlib/random/base/binomial' ).factory; +const PI = require( '@stdlib/constants/float64/pi' ); +const kernelTan = require( '@stdlib/math/base/special/kernel-tan' ); -var x = linspace( -PI/4.0, PI/4.0, 100 ); -var rbinom = binomial( 1, 0.5 ); +const x = linspace( -PI/4.0, PI/4.0, 100 ); +const rbinom = binomial( 1, 0.5 ); -var descr; -var i; -var k; - -for ( i = 0; i < x.length; i++ ) { - k = rbinom(); - descr = ( k === 1 ) ? 'tan(%d) = %d' : '-1/tan(%d) = %d'; +for ( let i = 0; i < x.length; i++ ) { + const k = rbinom(); + const descr = ( k === 1 ) ? 'tan(%d) = %d' : '-1/tan(%d) = %d'; console.log( descr, x[ i ], kernelTan( x[ i ], 0.0, k ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kronecker-delta/README.md b/lib/node_modules/@stdlib/math/base/special/kronecker-delta/README.md index 644c8f150d4b..505bbe56f30d 100644 --- a/lib/node_modules/@stdlib/math/base/special/kronecker-delta/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kronecker-delta/README.md @@ -48,7 +48,7 @@ The [Kronecker delta][kronecker-delta] is defined as ## Usage ```javascript -var kroneckerDelta = require( '@stdlib/math/base/special/kronecker-delta' ); +const kroneckerDelta = require( '@stdlib/math/base/special/kronecker-delta' ); ``` #### kroneckerDelta( i, j ) @@ -56,7 +56,7 @@ var kroneckerDelta = require( '@stdlib/math/base/special/kronecker-delta' ); Evaluates the [Kronecker delta][kronecker-delta]. ```javascript -var v = kroneckerDelta( 3.14, 3.14 ); +let v = kroneckerDelta( 3.14, 3.14 ); // returns 1.0 v = kroneckerDelta( 3.14, 0.0 ); @@ -83,13 +83,12 @@ v = kroneckerDelta( NaN, NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var kroneckerDelta = require( '@stdlib/math/base/special/kronecker-delta' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const kroneckerDelta = require( '@stdlib/math/base/special/kronecker-delta' ); -var x = linspace( -1.0, 1.0, 101 ); +const x = linspace( -1.0, 1.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'kronecker(%d,%d) = %d', x[ i ], 0.0, kroneckerDelta( x[ i ], 0.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/kronecker-deltaf/README.md b/lib/node_modules/@stdlib/math/base/special/kronecker-deltaf/README.md index 1f895ab4886e..7f5baefd6d9a 100644 --- a/lib/node_modules/@stdlib/math/base/special/kronecker-deltaf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kronecker-deltaf/README.md @@ -48,7 +48,7 @@ The [Kronecker delta][kronecker-delta] is defined as ## Usage ```javascript -var kroneckerDeltaf = require( '@stdlib/math/base/special/kronecker-deltaf' ); +const kroneckerDeltaf = require( '@stdlib/math/base/special/kronecker-deltaf' ); ``` #### kroneckerDeltaf( i, j ) @@ -56,7 +56,7 @@ var kroneckerDeltaf = require( '@stdlib/math/base/special/kronecker-deltaf' ); Evaluates the [Kronecker delta][kronecker-delta] (single-precision). ```javascript -var v = kroneckerDeltaf( 3.14, 3.14 ); +let v = kroneckerDeltaf( 3.14, 3.14 ); // returns 1.0 v = kroneckerDeltaf( 3.14, 0.0 ); @@ -83,13 +83,12 @@ v = kroneckerDeltaf( NaN, NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var kroneckerDeltaf = require( '@stdlib/math/base/special/kronecker-deltaf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const kroneckerDeltaf = require( '@stdlib/math/base/special/kronecker-deltaf' ); -var x = linspace( -1.0, 1.0, 101 ); +const x = linspace( -1.0, 1.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'kronecker(%d,%d) = %d', x[ i ], 0.0, kroneckerDeltaf( x[ i ], 0.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/labs/README.md b/lib/node_modules/@stdlib/math/base/special/labs/README.md index f633011779cc..8cbf2ca2d204 100644 --- a/lib/node_modules/@stdlib/math/base/special/labs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/labs/README.md @@ -48,7 +48,7 @@ The [absolute value][absolute-value] is defined as ## Usage ```javascript -var labs = require( '@stdlib/math/base/special/labs' ); +const labs = require( '@stdlib/math/base/special/labs' ); ``` #### labs( x ) @@ -56,7 +56,7 @@ var labs = require( '@stdlib/math/base/special/labs' ); Computes an [absolute value][absolute-value] of a signed 32-bit integer. ```javascript -var v = labs( -1|0 ); +let v = labs( -1|0 ); // returns 1 v = labs( 2|0 ); @@ -82,9 +82,9 @@ v = labs( 0|0 ); ```javascript // -2^31 - var x = -2147483648|0; + const x = -2147483648|0; - var v = labs( x ); + const v = labs( x ); // returns -2147483648 ``` @@ -99,15 +99,12 @@ v = labs( 0|0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var labs = require( '@stdlib/math/base/special/labs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const labs = require( '@stdlib/math/base/special/labs' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ) - 50; +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ) - 50; console.log( 'abs(%d) = %d', x, labs( x|0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/lcm/README.md b/lib/node_modules/@stdlib/math/base/special/lcm/README.md index ea5e5fec0724..d1ad4ef00b86 100644 --- a/lib/node_modules/@stdlib/math/base/special/lcm/README.md +++ b/lib/node_modules/@stdlib/math/base/special/lcm/README.md @@ -39,7 +39,7 @@ The [least common multiple][lcm] (lcm) of two non-zero integers `a` and `b` is t ## Usage ```javascript -var lcm = require( '@stdlib/math/base/special/lcm' ); +const lcm = require( '@stdlib/math/base/special/lcm' ); ``` #### lcm( a, b ) @@ -47,14 +47,14 @@ var lcm = require( '@stdlib/math/base/special/lcm' ); Computes the [least common multiple][lcm] (lcm). ```javascript -var v = lcm( 48, 18 ); +const v = lcm( 48, 18 ); // returns 144 ``` If either `a` or `b` is `0`, the function returns `0`. ```javascript -var v = lcm( 0, 0 ); +let v = lcm( 0, 0 ); // returns 0 v = lcm( 2, 0 ); @@ -67,7 +67,7 @@ v = lcm( 0, 3 ); Both `a` and `b` must have integer values; otherwise, the function returns `NaN`. ```javascript -var v = lcm( 3.14, 18 ); +let v = lcm( 3.14, 18 ); // returns NaN v = lcm( 48, 3.14 ); @@ -101,19 +101,14 @@ v = lcm( 48, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var lcm = require( '@stdlib/math/base/special/lcm' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - a = round( randu()*50 ); - b = round( randu()*50 ); - v = lcm( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const lcm = require( '@stdlib/math/base/special/lcm' ); + +for ( let i = 0; i < 100; i++ ) { + const a = round( randu()*50 ); + const b = round( randu()*50 ); + const v = lcm( a, b ); console.log( 'lcm(%d,%d) = %d', a, b, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ldexp/README.md b/lib/node_modules/@stdlib/math/base/special/ldexp/README.md index d2b8a7180e0c..682c2d224af6 100644 --- a/lib/node_modules/@stdlib/math/base/special/ldexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ldexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ldexp = require( '@stdlib/math/base/special/ldexp' ); +const ldexp = require( '@stdlib/math/base/special/ldexp' ); ``` #### ldexp( frac, exp ) @@ -35,7 +35,7 @@ var ldexp = require( '@stdlib/math/base/special/ldexp' ); Multiplies a [double-precision floating-point number][ieee754] by an `integer` power of two (i.e., `x = frac * 2^exp`). ```javascript -var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8 +let x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8 // returns 4.0 x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4) @@ -45,7 +45,7 @@ x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4) If `frac` equals positive or negative zero, `NaN`, or positive or negative `infinity`, the function returns a value equal to `frac`. ```javascript -var x = ldexp( 0.0, 20 ); +let x = ldexp( 0.0, 20 ); // returns 0.0 x = ldexp( -0.0, 39 ); @@ -80,36 +80,29 @@ x = ldexp( -Infinity, -118 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var frexp = require( '@stdlib/math/base/special/frexp' ); -var ldexp = require( '@stdlib/math/base/special/ldexp' ); - -var sign; -var frac; -var exp; -var x; -var f; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const frexp = require( '@stdlib/math/base/special/frexp' ); +const ldexp = require( '@stdlib/math/base/special/ldexp' ); + +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } // Generate a random number: - frac = randu() * 10.0; - exp = round( randu()*616.0 ) - 308; - x = sign * frac * pow( 10.0, exp ); + const frac = randu() * 10.0; + const exp = round( randu()*616.0 ) - 308; + const x = sign * frac * pow( 10.0, exp ); // Break the number into a normalized fraction and an integer power of two: - f = frexp( x ); + const f = frexp( x ); // Reconstitute the original number: - v = ldexp( f[ 0 ], f[ 1 ] ); + const v = ldexp( f[ 0 ], f[ 1 ] ); console.log( '%d = %d * 2^%d = %d', x, f[ 0 ], f[ 1 ], v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ldexpf/README.md b/lib/node_modules/@stdlib/math/base/special/ldexpf/README.md index dbd86cc93978..b1df3c0e88d8 100644 --- a/lib/node_modules/@stdlib/math/base/special/ldexpf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ldexpf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ldexpf = require( '@stdlib/math/base/special/ldexpf' ); +const ldexpf = require( '@stdlib/math/base/special/ldexpf' ); ``` #### ldexpf( frac, exp ) @@ -35,7 +35,7 @@ var ldexpf = require( '@stdlib/math/base/special/ldexpf' ); Multiplies a [single-precision floating-point number][ieee754] by an integer power of two (i.e., `x = frac * 2^exp`). ```javascript -var x = ldexpf( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8 +let x = ldexpf( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8 // returns 4.0 x = ldexpf( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4) @@ -45,7 +45,7 @@ x = ldexpf( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4) If `frac` equals positive or negative zero, `NaN`, or positive or negative `infinity`, the function returns a value equal to `frac`. ```javascript -var x = ldexpf( 0.0, 20 ); +let x = ldexpf( 0.0, 20 ); // returns 0.0 x = ldexpf( -0.0, 39 ); @@ -80,15 +80,14 @@ x = ldexpf( -Infinity, -118 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ldexpf = require( '@stdlib/math/base/special/ldexpf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const ldexpf = require( '@stdlib/math/base/special/ldexpf' ); -var frac = linspace( 0.0, 100.0, 10 ); -var exp = discreteUniform( 100, 0, 10 ); +const frac = linspace( 0.0, 100.0, 10 ); +const exp = discreteUniform( 100, 0, 10 ); -var i; -for ( i = 0; i < frac.length; i++ ) { +for ( let i = 0; i < frac.length; i++ ) { console.log( 'ldexpf(%d,%d) = %d', frac[ i ], exp[ i ], ldexpf( frac[ i ], exp[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ln/README.md b/lib/node_modules/@stdlib/math/base/special/ln/README.md index d26ca416203d..f53fd283cf89 100644 --- a/lib/node_modules/@stdlib/math/base/special/ln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ln/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ln = require( '@stdlib/math/base/special/ln' ); +const ln = require( '@stdlib/math/base/special/ln' ); ``` #### ln( x ) @@ -35,7 +35,7 @@ var ln = require( '@stdlib/math/base/special/ln' ); Evaluates the [natural logarithm][natural-logarithm] of a double-precision floating-point number. ```javascript -var v = ln( 4.0 ); +let v = ln( 4.0 ); // returns ~1.386 v = ln( 0.0 ); @@ -51,7 +51,7 @@ v = ln( NaN ); For negative numbers, the [natural logarithm][natural-logarithm] is **not** defined. ```javascript -var v = ln( -4.0 ); +const v = ln( -4.0 ); // returns NaN ``` @@ -66,15 +66,12 @@ var v = ln( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var ln = require( '@stdlib/math/base/special/ln' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const ln = require( '@stdlib/math/base/special/ln' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'ln(%d) = %d', x, ln( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/lnf/README.md b/lib/node_modules/@stdlib/math/base/special/lnf/README.md index a5a2822f0bde..d73e12c6b6de 100644 --- a/lib/node_modules/@stdlib/math/base/special/lnf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/lnf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lnf = require( '@stdlib/math/base/special/lnf' ); +const lnf = require( '@stdlib/math/base/special/lnf' ); ``` #### lnf( x ) @@ -35,7 +35,7 @@ var lnf = require( '@stdlib/math/base/special/lnf' ); Evaluates the [natural logarithm][natural-logarithm] of a single-precision floating-point number. ```javascript -var v = lnf( 4.0 ); +let v = lnf( 4.0 ); // returns ~1.386 v = lnf( 0.0 ); @@ -51,7 +51,7 @@ v = lnf( NaN ); For negative numbers, the [natural logarithm][natural-logarithm] is **not** defined. ```javascript -var v = lnf( -4.0 ); +const v = lnf( -4.0 ); // returns NaN ``` @@ -66,15 +66,12 @@ var v = lnf( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var lnf = require( '@stdlib/math/base/special/lnf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const lnf = require( '@stdlib/math/base/special/lnf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'lnf(%d) = %d', x, lnf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log/README.md b/lib/node_modules/@stdlib/math/base/special/log/README.md index 13accca7e49f..d3eb3e00fe30 100644 --- a/lib/node_modules/@stdlib/math/base/special/log/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var log = require( '@stdlib/math/base/special/log' ); +const log = require( '@stdlib/math/base/special/log' ); ``` #### log( x, b ) @@ -35,7 +35,7 @@ var log = require( '@stdlib/math/base/special/log' ); Computes the base `b` logarithm of a double-precision floating-point number. ```javascript -var v = log( 100.0, 10.0 ); +let v = log( 100.0, 10.0 ); // returns 2.0 v = log( 16.0, 2.0 ); @@ -48,7 +48,7 @@ v = log( 5.0, 1.0 ); For negative `x` or `b`, the [logarithm][logarithm] is **not** defined. ```javascript -var v = log( -4.0, 1.0 ); +let v = log( -4.0, 1.0 ); // returns NaN v = log( 2.0, -4.0 ); @@ -66,17 +66,13 @@ v = log( 2.0, -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var log = require( '@stdlib/math/base/special/log' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const log = require( '@stdlib/math/base/special/log' ); -var b; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); - b = round( randu() * 5.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); + const b = round( randu() * 5.0 ); console.log( 'log( %d, %d ) = %d', x, b, log( x, b ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log10/README.md b/lib/node_modules/@stdlib/math/base/special/log10/README.md index 547a7a08c534..c9d512e142b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/log10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log10/README.md @@ -48,7 +48,7 @@ The [common logarithm][common-logarithm] (logarithm with base 10) is defined for ## Usage ```javascript -var log10 = require( '@stdlib/math/base/special/log10' ); +const log10 = require( '@stdlib/math/base/special/log10' ); ``` #### log10( x ) @@ -56,7 +56,7 @@ var log10 = require( '@stdlib/math/base/special/log10' ); Evaluates the [common logarithm][common-logarithm]. ```javascript -var v = log10( 100.0 ); +let v = log10( 100.0 ); // returns 2.0 v = log10( 8.0 ); @@ -75,7 +75,7 @@ v = log10( NaN ); For negative numbers, the [common logarithm][common-logarithm] is **not** defined. ```javascript -var v = log10( -4.0 ); +const v = log10( -4.0 ); // returns NaN ``` @@ -90,15 +90,12 @@ var v = log10( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var log10 = require( '@stdlib/math/base/special/log10' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const log10 = require( '@stdlib/math/base/special/log10' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'log10(%d) = %d', x, log10( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md b/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md index 2a996645eb6c..bb882bf39be5 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var log1mexp = require( '@stdlib/math/base/special/log1mexp' ); +const log1mexp = require( '@stdlib/math/base/special/log1mexp' ); ``` #### log1mexp( x ) @@ -35,7 +35,7 @@ var log1mexp = require( '@stdlib/math/base/special/log1mexp' ); Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of `1-exp(-|x|)`. ```javascript -var y = log1mexp( 0.0 ); +let y = log1mexp( 0.0 ); // returns -Infinity y = log1mexp( 5.0 ); @@ -62,13 +62,12 @@ y = log1mexp( NaN ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var log1mexp = require( '@stdlib/math/base/special/log1mexp' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const log1mexp = require( '@stdlib/math/base/special/log1mexp' ); -var x = incrspace( -10.0, 10.0, 0.01 ); +const x = incrspace( -10.0, 10.0, 0.01 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], log1mexp( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log1p/README.md b/lib/node_modules/@stdlib/math/base/special/log1p/README.md index 312eb128a138..e48a8be1f5dd 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1p/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1p/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var log1p = require( '@stdlib/math/base/special/log1p' ); +const log1p = require( '@stdlib/math/base/special/log1p' ); ``` #### log1p( x ) @@ -35,7 +35,7 @@ var log1p = require( '@stdlib/math/base/special/log1p' ); Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of `1+x`. ```javascript -var v = log1p( 4.0 ); +let v = log1p( 4.0 ); // returns ~1.609 v = log1p( -1.0 ); @@ -57,7 +57,7 @@ v = log1p( NaN ); For `x < -1`, the function returns `NaN`, as the [natural logarithm][@stdlib/math/base/special/ln] is **not** defined for negative numbers. ```javascript -var v = log1p( -2.0 ); +const v = log1p( -2.0 ); // returns NaN ``` @@ -72,15 +72,12 @@ var v = log1p( -2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var log1p = require( '@stdlib/math/base/special/log1p' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const log1p = require( '@stdlib/math/base/special/log1p' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( log1p( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log1pexp/README.md b/lib/node_modules/@stdlib/math/base/special/log1pexp/README.md index a553aaf32de3..e3563da5ed88 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1pexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1pexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var log1pexp = require( '@stdlib/math/base/special/log1pexp' ); +const log1pexp = require( '@stdlib/math/base/special/log1pexp' ); ``` #### log1pexp( x ) @@ -35,7 +35,7 @@ var log1pexp = require( '@stdlib/math/base/special/log1pexp' ); Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of `1+exp(x)`. ```javascript -var y = log1pexp( -10.0 ); +let y = log1pexp( -10.0 ); // returns ~0.000045 y = log1pexp( 0.0 ); @@ -62,13 +62,12 @@ y = log1pexp( NaN ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var log1pexp = require( '@stdlib/math/base/special/log1pexp' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const log1pexp = require( '@stdlib/math/base/special/log1pexp' ); -var x = incrspace( -10.0, 10.0, 0.01 ); +const x = incrspace( -10.0, 10.0, 0.01 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], log1pexp( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log1pmx/README.md b/lib/node_modules/@stdlib/math/base/special/log1pmx/README.md index b04c06c15d2b..5caf21a14180 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1pmx/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1pmx/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var log1pmx = require( '@stdlib/math/base/special/log1pmx' ); +const log1pmx = require( '@stdlib/math/base/special/log1pmx' ); ``` #### log1pmx( x ) @@ -35,7 +35,7 @@ var log1pmx = require( '@stdlib/math/base/special/log1pmx' ); Evaluates `ln(1+x) - x`. ```javascript -var v = log1pmx( 1.1 ); +let v = log1pmx( 1.1 ); // returns ~-0.358 v = log1pmx( 0.99 ); @@ -62,13 +62,12 @@ v = log1pmx( NaN ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var log1pmx = require( '@stdlib/math/base/special/log1pmx' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const log1pmx = require( '@stdlib/math/base/special/log1pmx' ); -var x = incrspace( 0.0, 10.0, 0.01 ); +const x = incrspace( 0.0, 10.0, 0.01 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x: %d, f(x): %d', x[ i ], log1pmx( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/log2/README.md b/lib/node_modules/@stdlib/math/base/special/log2/README.md index 6d8388b8f317..01b31e64b478 100644 --- a/lib/node_modules/@stdlib/math/base/special/log2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log2/README.md @@ -48,7 +48,7 @@ The [binary logarithm][binary-logarithm] (logarithm with base 2) is defined for ## Usage ```javascript -var log2 = require( '@stdlib/math/base/special/log2' ); +const log2 = require( '@stdlib/math/base/special/log2' ); ``` #### log2( x ) @@ -56,7 +56,7 @@ var log2 = require( '@stdlib/math/base/special/log2' ); Evaluates the [binary logarithm][binary-logarithm]. ```javascript -var v = log2( 4.0 ); +let v = log2( 4.0 ); // returns 2.0 v = log2( 0.0 ); @@ -72,7 +72,7 @@ v = log2( NaN ); For negative numbers, the [binary logarithm][binary-logarithm] is **not** defined. ```javascript -var v = log2( -4.0 ); +const v = log2( -4.0 ); // returns NaN ``` @@ -87,15 +87,12 @@ var v = log2( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var log2 = require( '@stdlib/math/base/special/log2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const log2 = require( '@stdlib/math/base/special/log2' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'log2(%d) = %d', x, log2( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/logaddexp/README.md b/lib/node_modules/@stdlib/math/base/special/logaddexp/README.md index d604e6760aff..6b9ab2c257c7 100644 --- a/lib/node_modules/@stdlib/math/base/special/logaddexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/logaddexp/README.md @@ -33,7 +33,7 @@ Log-domain computations are commonly used to increase accuracy and avoid underfl ## Usage ```javascript -var logaddexp = require( '@stdlib/math/base/special/logaddexp' ); +const logaddexp = require( '@stdlib/math/base/special/logaddexp' ); ``` #### logaddexp( x, y ) @@ -41,7 +41,7 @@ var logaddexp = require( '@stdlib/math/base/special/logaddexp' ); Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of `exp(x) + exp(y)`. ```javascript -var v = logaddexp( 90.0, 90.0 ); +let v = logaddexp( 90.0, 90.0 ); // returns ~90.6931 v = logaddexp( -20.0, 90.0 ); @@ -65,17 +65,14 @@ v = logaddexp( NaN, 1.0 ); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var logaddexp = require( '@stdlib/math/base/special/logaddexp' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const logaddexp = require( '@stdlib/math/base/special/logaddexp' ); -var x = incrspace( -100.0, 100.0, 1.0 ); +const x = incrspace( -100.0, 100.0, 1.0 ); -var v; -var i; -var j; -for ( i = 0; i < x.length; i++ ) { - for ( j = i; j < x.length; j++ ) { - v = logaddexp( x[ i ], x[ j ] ); +for ( let i = 0; i < x.length; i++ ) { + for ( let j = i; j < x.length; j++ ) { + const v = logaddexp( x[ i ], x[ j ] ); console.log( 'x: %d, y: %d, f(x, y): %d', x[ i ], x[ j ], v ); } } diff --git a/lib/node_modules/@stdlib/math/base/special/logf/README.md b/lib/node_modules/@stdlib/math/base/special/logf/README.md index f9dbab88d00d..0fbef8e06f93 100644 --- a/lib/node_modules/@stdlib/math/base/special/logf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/logf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logf = require( '@stdlib/math/base/special/logf' ); +const logf = require( '@stdlib/math/base/special/logf' ); ``` #### logf( x, b ) @@ -35,7 +35,7 @@ var logf = require( '@stdlib/math/base/special/logf' ); Computes the base `b` logarithm of a single-precision floating-point number. ```javascript -var v = logf( 100.0, 10.0 ); +let v = logf( 100.0, 10.0 ); // returns 2.0 v = logf( 16.0, 2.0 ); @@ -48,7 +48,7 @@ v = logf( 5.0, 1.0 ); For negative `x` or `b`, the [logarithm][logarithm] is **not** defined. ```javascript -var v = logf( -4.0, 1.0 ); +let v = logf( -4.0, 1.0 ); // returns NaN v = logf( 2.0, -4.0 ); @@ -66,18 +66,17 @@ v = logf( 2.0, -4.0 ); ```javascript -var randu = require( '@stdlib/random/array/discrete-uniform' ); -var logf = require( '@stdlib/math/base/special/logf' ); +const randu = require( '@stdlib/random/array/discrete-uniform' ); +const logf = require( '@stdlib/math/base/special/logf' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = randu( 100, 0, 100, opts ); -var b = randu( 100, 0, 5, opts ); +const x = randu( 100, 0, 100, opts ); +const b = randu( 100, 0, 5, opts ); -var i; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( 'logf( %d, %d ) = %d', x[ i ], b[ i ], logf( x[ i ], b[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/logit/README.md b/lib/node_modules/@stdlib/math/base/special/logit/README.md index 47511bc921f6..5c23c040b745 100644 --- a/lib/node_modules/@stdlib/math/base/special/logit/README.md +++ b/lib/node_modules/@stdlib/math/base/special/logit/README.md @@ -50,7 +50,7 @@ The [logit][logit] function is the inverse of the [standard logistic][standard-l ## Usage ```javascript -var logit = require( '@stdlib/math/base/special/logit' ); +const logit = require( '@stdlib/math/base/special/logit' ); ``` #### logit( p ) @@ -58,7 +58,7 @@ var logit = require( '@stdlib/math/base/special/logit' ); Computes the [logit][logit] function. ```javascript -var v = logit( 0.2 ); +let v = logit( 0.2 ); // returns ~-1.386 v = logit( 0.9 ); @@ -68,7 +68,7 @@ v = logit( 0.9 ); If `p < 0` or `p > 1`, the function returns `NaN`. ```javascript -var v = logit( 1.3 ); +let v = logit( 1.3 ); // returns NaN v = logit( -0.2 ); @@ -86,14 +86,11 @@ v = logit( -0.2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logit = require( '@stdlib/math/base/special/logit' ); +const randu = require( '@stdlib/random/base/randu' ); +const logit = require( '@stdlib/math/base/special/logit' ); -var p; -var i; - -for ( i = 0; i < 100; i++ ) { - p = randu(); +for ( let i = 0; i < 100; i++ ) { + const p = randu(); console.log( 'logit(%d) = %d', p, logit( p ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/lucas/README.md b/lib/node_modules/@stdlib/math/base/special/lucas/README.md index bac6ff001d95..b9b67b6bbaea 100644 --- a/lib/node_modules/@stdlib/math/base/special/lucas/README.md +++ b/lib/node_modules/@stdlib/math/base/special/lucas/README.md @@ -63,7 +63,7 @@ L_n = \begin{cases}2 & \textrm{if}\ n = 0\\1 & \textrm{if}\ n = 1\\L_{n-1} + L_{ ## Usage ```javascript -var lucas = require( '@stdlib/math/base/special/lucas' ); +const lucas = require( '@stdlib/math/base/special/lucas' ); ``` #### lucas( n ) @@ -71,7 +71,7 @@ var lucas = require( '@stdlib/math/base/special/lucas' ); Computes the nth [Lucas number][lucas-number]. ```javascript -var v = lucas( 0 ); +let v = lucas( 0 ); // returns 2 v = lucas( 1 ); @@ -90,14 +90,14 @@ v = lucas( 76 ); If `n > 76`, the function returns `NaN`, as larger [Lucas numbers][lucas-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = lucas( 77 ); +const v = lucas( 77 ); // returns NaN ``` If not provided a nonnegative integer value, the function returns `NaN`. ```javascript -var v = lucas( 3.14 ); +let v = lucas( 3.14 ); // returns NaN v = lucas( -1 ); @@ -107,7 +107,7 @@ v = lucas( -1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = lucas( NaN ); +const v = lucas( NaN ); // returns NaN ``` @@ -128,13 +128,10 @@ var v = lucas( NaN ); ```javascript -var lucas = require( '@stdlib/math/base/special/lucas' ); +const lucas = require( '@stdlib/math/base/special/lucas' ); -var v; -var i; - -for ( i = 0; i < 77; i++ ) { - v = lucas( i ); +for ( let i = 0; i < 77; i++ ) { + const v = lucas( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/max/README.md b/lib/node_modules/@stdlib/math/base/special/max/README.md index d454eb31f672..ee2133dbf4ff 100644 --- a/lib/node_modules/@stdlib/math/base/special/max/README.md +++ b/lib/node_modules/@stdlib/math/base/special/max/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var max = require( '@stdlib/math/base/special/max' ); +const max = require( '@stdlib/math/base/special/max' ); ``` #### max( x, y ) @@ -45,7 +45,7 @@ var max = require( '@stdlib/math/base/special/max' ); Returns the maximum value. ```javascript -var v = max( 4.2, 3.14 ); +let v = max( 4.2, 3.14 ); // returns 4.2 v = max( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = max( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = max( 4.2, NaN ); +let v = max( 4.2, NaN ); // returns NaN v = max( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = max( NaN, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var max = require( '@stdlib/math/base/special/max' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = max( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const max = require( '@stdlib/math/base/special/max' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = max( x, y ); console.log( 'max(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/maxabs/README.md b/lib/node_modules/@stdlib/math/base/special/maxabs/README.md index 1de006957a99..9346892f5ff4 100644 --- a/lib/node_modules/@stdlib/math/base/special/maxabs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/maxabs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxabs = require( '@stdlib/math/base/special/maxabs' ); +const maxabs = require( '@stdlib/math/base/special/maxabs' ); ``` #### maxabs( x, y ) @@ -45,7 +45,7 @@ var maxabs = require( '@stdlib/math/base/special/maxabs' ); Returns the maximum absolute value. ```javascript -var v = maxabs( -4.2, 3.14 ); +let v = maxabs( -4.2, 3.14 ); // returns 4.2 v = maxabs( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = maxabs( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = maxabs( 4.2, NaN ); +let v = maxabs( 4.2, NaN ); // returns NaN v = maxabs( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = maxabs( NaN, 3.14 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var maxabs = require( '@stdlib/math/base/special/maxabs' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ( randu()*1000.0 ) - 500.0; - v = maxabs( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const maxabs = require( '@stdlib/math/base/special/maxabs' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*1000.0 ) - 500.0; + const y = ( randu()*1000.0 ) - 500.0; + const v = maxabs( x, y ); console.log( 'maxabs(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/maxabsf/README.md b/lib/node_modules/@stdlib/math/base/special/maxabsf/README.md index dd4141ba5f5e..887c353865da 100644 --- a/lib/node_modules/@stdlib/math/base/special/maxabsf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/maxabsf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxabsf = require( '@stdlib/math/base/special/maxabsf' ); +const maxabsf = require( '@stdlib/math/base/special/maxabsf' ); ``` #### maxabsf( x, y ) @@ -45,7 +45,7 @@ var maxabsf = require( '@stdlib/math/base/special/maxabsf' ); Returns the maximum absolute single-precision floating-point number. ```javascript -var v = maxabsf( -4.0, 3.0 ); +let v = maxabsf( -4.0, 3.0 ); // returns 4.0 v = maxabsf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = maxabsf( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = maxabsf( 4.2, NaN ); +let v = maxabsf( 4.2, NaN ); // returns NaN v = maxabsf( NaN, 3.14 ); @@ -83,20 +83,18 @@ v = maxabsf( NaN, 3.14 ); ```javascript -var randu = require( '@stdlib/random/array/uniform' ); -var maxabsf = require( '@stdlib/math/base/special/maxabsf' ); +const randu = require( '@stdlib/random/array/uniform' ); +const maxabsf = require( '@stdlib/math/base/special/maxabsf' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = randu( 100, -500.0, 500.0, opts ); -var y = randu( 100, -500.0, 500.0, opts ); +const x = randu( 100, -500.0, 500.0, opts ); +const y = randu( 100, -500.0, 500.0, opts ); -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = maxabsf( x[ i ], y[ i ] ); +for ( let i = 0; i < 100; i++ ) { + const v = maxabsf( x[ i ], y[ i ] ); console.log( 'maxabsf(%d,%d) = %d', x[ i ], y[ i ], v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/maxabsn/README.md b/lib/node_modules/@stdlib/math/base/special/maxabsn/README.md index fb4212440ac9..d79ebd9fad81 100644 --- a/lib/node_modules/@stdlib/math/base/special/maxabsn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/maxabsn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxabsn = require( '@stdlib/math/base/special/maxabsn' ); +const maxabsn = require( '@stdlib/math/base/special/maxabsn' ); ``` #### maxabsn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var maxabsn = require( '@stdlib/math/base/special/maxabsn' ); Returns the maximum absolute value. ```javascript -var v = maxabsn( -4.2, 3.14 ); +let v = maxabsn( -4.2, 3.14 ); // returns 4.2 v = maxabsn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = maxabsn( 4.2, 3.14, -1.0, 6.8 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = maxabsn( 4.2, NaN ); +let v = maxabsn( 4.2, NaN ); // returns NaN v = maxabsn( NaN, 3.14 ); @@ -68,7 +68,7 @@ v = maxabsn( NaN, 3.14 ); If not provided any arguments, the function returns `+infinity`. ```javascript -var v = maxabsn(); +const v = maxabsn(); // returns Infinity ``` @@ -97,18 +97,13 @@ var v = maxabsn(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var maxabsn = require( '@stdlib/math/base/special/maxabsn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ( randu()*1000.0 ) - 500.0; - v = maxabsn( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const maxabsn = require( '@stdlib/math/base/special/maxabsn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*1000.0 ) - 500.0; + const y = ( randu()*1000.0 ) - 500.0; + const v = maxabsn( x, y ); console.log( 'maxabs(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/maxf/README.md b/lib/node_modules/@stdlib/math/base/special/maxf/README.md index 900f4fb1e501..a77ba4073fb5 100644 --- a/lib/node_modules/@stdlib/math/base/special/maxf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/maxf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxf = require( '@stdlib/math/base/special/maxf' ); +const maxf = require( '@stdlib/math/base/special/maxf' ); ``` #### maxf( x, y ) @@ -45,7 +45,7 @@ var maxf = require( '@stdlib/math/base/special/maxf' ); Returns the maximum single-precision floating-point number. ```javascript -var v = maxf( 4.2, 3.14 ); +let v = maxf( 4.2, 3.14 ); // returns 4.2 v = maxf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = maxf( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = maxf( 4.2, NaN ); +let v = maxf( 4.2, NaN ); // returns NaN v = maxf( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = maxf( NaN, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var maxf = require( '@stdlib/math/base/special/maxf' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = maxf( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const maxf = require( '@stdlib/math/base/special/maxf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = maxf( x, y ); console.log( 'maxf(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/maxn/README.md b/lib/node_modules/@stdlib/math/base/special/maxn/README.md index 88389d6046e3..198eba5337b4 100644 --- a/lib/node_modules/@stdlib/math/base/special/maxn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/maxn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxn = require( '@stdlib/math/base/special/maxn' ); +const maxn = require( '@stdlib/math/base/special/maxn' ); ``` #### maxn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var maxn = require( '@stdlib/math/base/special/maxn' ); Returns the maximum value. ```javascript -var v = maxn( 4.2, 3.14 ); +let v = maxn( 4.2, 3.14 ); // returns 4.2 v = maxn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = maxn( 4.2, 3.14, -1.0, 6.8 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = maxn( 4.2, NaN ); +let v = maxn( 4.2, NaN ); // returns NaN v = maxn( NaN, 3.14 ); @@ -68,7 +68,7 @@ v = maxn( NaN, 3.14 ); If not provided any arguments, the function returns `-infinity`. ```javascript -var v = maxn(); +const v = maxn(); // returns -Infinity ``` @@ -97,18 +97,13 @@ var v = maxn(); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var maxn = require( '@stdlib/math/base/special/maxn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = maxn( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const maxn = require( '@stdlib/math/base/special/maxn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = maxn( x, y ); console.log( 'max(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/min/README.md b/lib/node_modules/@stdlib/math/base/special/min/README.md index d1d77c299c01..3cf340592df1 100644 --- a/lib/node_modules/@stdlib/math/base/special/min/README.md +++ b/lib/node_modules/@stdlib/math/base/special/min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var min = require( '@stdlib/math/base/special/min' ); +const min = require( '@stdlib/math/base/special/min' ); ``` #### min( x, y ) @@ -45,7 +45,7 @@ var min = require( '@stdlib/math/base/special/min' ); Returns the minimum value. ```javascript -var v = min( 4.2, 3.14 ); +let v = min( 4.2, 3.14 ); // returns 3.14 v = min( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = min( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = min( 4.2, NaN ); +let v = min( 4.2, NaN ); // returns NaN v = min( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = min( NaN, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var min = require( '@stdlib/math/base/special/min' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = min( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const min = require( '@stdlib/math/base/special/min' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = min( x, y ); console.log( 'min(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minabs/README.md b/lib/node_modules/@stdlib/math/base/special/minabs/README.md index 6ed4fc6b3dc0..5b0bf4529ad3 100644 --- a/lib/node_modules/@stdlib/math/base/special/minabs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minabs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minabs = require( '@stdlib/math/base/special/minabs' ); +const minabs = require( '@stdlib/math/base/special/minabs' ); ``` #### minabs( x, y ) @@ -45,7 +45,7 @@ var minabs = require( '@stdlib/math/base/special/minabs' ); Returns the minimum absolute value. ```javascript -var v = minabs( -4.2, 3.14 ); +let v = minabs( -4.2, 3.14 ); // returns 3.14 v = minabs( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = minabs( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = minabs( 4.2, NaN ); +let v = minabs( 4.2, NaN ); // returns NaN v = minabs( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = minabs( NaN, 3.14 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var minabs = require( '@stdlib/math/base/special/minabs' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ( randu()*1000.0 ) - 500.0; - v = minabs( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const minabs = require( '@stdlib/math/base/special/minabs' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*1000.0 ) - 500.0; + const y = ( randu()*1000.0 ) - 500.0; + const v = minabs( x, y ); console.log( 'minabs(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minabsf/README.md b/lib/node_modules/@stdlib/math/base/special/minabsf/README.md index 296ad0d7571a..214cb28a634c 100644 --- a/lib/node_modules/@stdlib/math/base/special/minabsf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minabsf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minabsf = require( '@stdlib/math/base/special/minabsf' ); +const minabsf = require( '@stdlib/math/base/special/minabsf' ); ``` #### minabsf( x, y ) @@ -45,7 +45,7 @@ var minabsf = require( '@stdlib/math/base/special/minabsf' ); Returns the minimum absolute single-precision floating-point number. ```javascript -var v = minabsf( -4.0, 3.0 ); +let v = minabsf( -4.0, 3.0 ); // returns 3.0 v = minabsf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = minabsf( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = minabsf( 4.2, NaN ); +let v = minabsf( 4.2, NaN ); // returns NaN v = minabsf( NaN, 3.14 ); @@ -83,20 +83,18 @@ v = minabsf( NaN, 3.14 ); ```javascript -var randu = require( '@stdlib/random/array/uniform' ); -var minabsf = require( '@stdlib/math/base/special/minabsf' ); +const randu = require( '@stdlib/random/array/uniform' ); +const minabsf = require( '@stdlib/math/base/special/minabsf' ); -var opts = { +const opts = { 'dtype': 'float32' }; -var x = randu( 100, -500.0, 500.0, opts ); -var y = randu( 100, -500.0, 500.0, opts ); +const x = randu( 100, -500.0, 500.0, opts ); +const y = randu( 100, -500.0, 500.0, opts ); -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = minabsf( x[ i ], y[ i ] ); +for ( let i = 0; i < 100; i++ ) { + const v = minabsf( x[ i ], y[ i ] ); console.log( 'minabsf(%d,%d) = %d', x[ i ], y[ i ], v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minabsn/README.md b/lib/node_modules/@stdlib/math/base/special/minabsn/README.md index 7fac04d6f8b7..f974a56116de 100644 --- a/lib/node_modules/@stdlib/math/base/special/minabsn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minabsn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minabsn = require( '@stdlib/math/base/special/minabsn' ); +const minabsn = require( '@stdlib/math/base/special/minabsn' ); ``` #### minabsn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var minabsn = require( '@stdlib/math/base/special/minabsn' ); Returns the minimum absolute value. ```javascript -var v = minabsn( -4.2, 3.14 ); +let v = minabsn( -4.2, 3.14 ); // returns 3.14 v = minabsn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = minabsn( 4.2, 3.14, -1.0, 6.8 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = minabsn( 4.2, NaN ); +let v = minabsn( 4.2, NaN ); // returns NaN v = minabsn( NaN, 3.14 ); @@ -68,7 +68,7 @@ v = minabsn( NaN, 3.14 ); If not provided any arguments, the function returns `+infinity`. ```javascript -var v = minabsn(); +const v = minabsn(); // returns Infinity ``` @@ -97,18 +97,13 @@ var v = minabsn(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var minabsn = require( '@stdlib/math/base/special/minabsn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ( randu()*1000.0 ) - 500.0; - v = minabsn( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const minabsn = require( '@stdlib/math/base/special/minabsn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*1000.0 ) - 500.0; + const y = ( randu()*1000.0 ) - 500.0; + const v = minabsn( x, y ); console.log( 'minabs(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minf/README.md b/lib/node_modules/@stdlib/math/base/special/minf/README.md index f68d073cc272..4c91b767dfe8 100644 --- a/lib/node_modules/@stdlib/math/base/special/minf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minf = require( '@stdlib/math/base/special/minf' ); +const minf = require( '@stdlib/math/base/special/minf' ); ``` #### minf( x, y ) @@ -45,7 +45,7 @@ var minf = require( '@stdlib/math/base/special/minf' ); Returns the minimum single-precision floating-point number. ```javascript -var v = minf( 4.2, 3.14 ); +let v = minf( 4.2, 3.14 ); // returns 3.14 v = minf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = minf( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = minf( 4.2, NaN ); +let v = minf( 4.2, NaN ); // returns NaN v = minf( NaN, 3.14 ); @@ -83,18 +83,13 @@ v = minf( NaN, 3.14 ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var minf = require( '@stdlib/math/base/special/minf' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = minf( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minf = require( '@stdlib/math/base/special/minf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = minf( x, y ); console.log( 'minf(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minmax/README.md b/lib/node_modules/@stdlib/math/base/special/minmax/README.md index 9f4b1b904a3f..3bb164e8fa32 100644 --- a/lib/node_modules/@stdlib/math/base/special/minmax/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minmax/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minmax = require( '@stdlib/math/base/special/minmax' ); +const minmax = require( '@stdlib/math/base/special/minmax' ); ``` #### minmax( x, y ) @@ -45,7 +45,7 @@ var minmax = require( '@stdlib/math/base/special/minmax' ); Returns the minimum and maximum values in a single pass. ```javascript -var v = minmax( 4.2, 3.14 ); +let v = minmax( 4.2, 3.14 ); // returns [ 3.14, 4.2 ] v = minmax( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = minmax( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN` for both the minimum value and the maximum value. ```javascript -var v = minmax( 4.2, NaN ); +let v = minmax( 4.2, NaN ); // returns [ NaN, NaN ] v = minmax( NaN, 3.14 ); @@ -67,14 +67,14 @@ v = minmax( NaN, 3.14 ); Returns the minimum and maximum values in a single pass and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = minmax.assign( 5.0, -2.0, out, 1, 0 ); +const v = minmax.assign( 5.0, -2.0, out, 1, 0 ); // returns [ -2.0, 5.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -99,18 +99,13 @@ var bool = ( v === out ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var minmax = require( '@stdlib/math/base/special/minmax' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = minmax( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minmax = require( '@stdlib/math/base/special/minmax' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = minmax( x, y ); console.log( 'minmax(%d,%d) = [%d, %d]', x, y, v[0], v[1] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minmaxabs/README.md b/lib/node_modules/@stdlib/math/base/special/minmaxabs/README.md index cd73a88c215f..cb1f09ff265d 100644 --- a/lib/node_modules/@stdlib/math/base/special/minmaxabs/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minmaxabs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minmaxabs = require( '@stdlib/math/base/special/minmaxabs' ); +const minmaxabs = require( '@stdlib/math/base/special/minmaxabs' ); ``` #### minmaxabs( x, y ) @@ -45,7 +45,7 @@ var minmaxabs = require( '@stdlib/math/base/special/minmaxabs' ); Returns the minimum and maximum absolute values in a single pass. ```javascript -var v = minmaxabs( 4.2, 3.14 ); +let v = minmaxabs( 4.2, 3.14 ); // returns [ 3.14, 4.2 ] v = minmaxabs( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = minmaxabs( +0.0, -0.0 ); If any argument is `NaN`, the function returns `NaN` for both the minimum value and the maximum value. ```javascript -var v = minmaxabs( 4.2, NaN ); +let v = minmaxabs( 4.2, NaN ); // returns [ NaN, NaN ] v = minmaxabs( NaN, 3.14 ); @@ -67,14 +67,14 @@ v = minmaxabs( NaN, 3.14 ); Returns the minimum and maximum absolute values in a single pass and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = minmaxabs.assign( 5.0, -1.0, out, 1, 0 ); +const v = minmaxabs.assign( 5.0, -1.0, out, 1, 0 ); // returns [ 1.0, 5.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -99,18 +99,13 @@ var bool = ( v === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var minmaxabs = require( '@stdlib/math/base/special/minmaxabs' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = ( randu()*100.0 ) - 50.0; - v = minmaxabs( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const minmaxabs = require( '@stdlib/math/base/special/minmaxabs' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*100.0 ) - 50.0; + const y = ( randu()*100.0 ) - 50.0; + const v = minmaxabs( x, y ); console.log( 'minmaxabs(%d,%d) = [%d, %d]', x, y, v[0], v[1] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minmaxabsn/README.md b/lib/node_modules/@stdlib/math/base/special/minmaxabsn/README.md index 260bfefff99b..5964cc7ca1a8 100644 --- a/lib/node_modules/@stdlib/math/base/special/minmaxabsn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minmaxabsn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minmaxabsn = require( '@stdlib/math/base/special/minmaxabsn' ); +const minmaxabsn = require( '@stdlib/math/base/special/minmaxabsn' ); ``` #### minmaxabsn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var minmaxabsn = require( '@stdlib/math/base/special/minmaxabsn' ); Returns the minimum and maximum absolute values in a single pass. ```javascript -var v = minmaxabsn( 4.2, 3.14 ); +let v = minmaxabsn( 4.2, 3.14 ); // returns [ 3.14, 4.2 ] v = minmaxabsn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = minmaxabsn( 4.2, 3.14, -1.0, -6.8 ); If any argument is `NaN`, the function returns `NaN` for both the minimum value and the maximum value. ```javascript -var v = minmaxabsn( 4.2, NaN ); +let v = minmaxabsn( 4.2, NaN ); // returns [ NaN, NaN ] v = minmaxabsn( NaN, 3.14 ); @@ -70,14 +70,14 @@ v = minmaxabsn( NaN, 3.14 ); Returns the minimum and maximum absolute values in a single pass and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = minmaxabsn.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); +const v = minmaxabsn.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); // returns [ 1.0, 5.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -106,18 +106,13 @@ var bool = ( v === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var minmaxabsn = require( '@stdlib/math/base/special/minmaxabsn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = ( randu()*100.0 ) - 50.0; - v = minmaxabsn( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const minmaxabsn = require( '@stdlib/math/base/special/minmaxabsn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*100.0 ) - 50.0; + const y = ( randu()*100.0 ) - 50.0; + const v = minmaxabsn( x, y ); console.log( 'minmaxabs(%d,%d) = [%d, %d]', x, y, v[0], v[1] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minmaxn/README.md b/lib/node_modules/@stdlib/math/base/special/minmaxn/README.md index 6a9bcc62e49a..5c7bce6e26b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/minmaxn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minmaxn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minmaxn = require( '@stdlib/math/base/special/minmaxn' ); +const minmaxn = require( '@stdlib/math/base/special/minmaxn' ); ``` #### minmaxn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var minmaxn = require( '@stdlib/math/base/special/minmaxn' ); Returns the minimum and maximum values in a single pass. ```javascript -var v = minmaxn( 4.2, 3.14 ); +let v = minmaxn( 4.2, 3.14 ); // returns [ 3.14, 4.2 ] v = minmaxn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = minmaxn( 4.2, 3.14, -1.0, 6.8 ); If any argument is `NaN`, the function returns `NaN` for both the minimum value and the maximum value. ```javascript -var v = minmaxn( 4.2, NaN ); +let v = minmaxn( 4.2, NaN ); // returns [ NaN, NaN ] v = minmaxn( NaN, 3.14 ); @@ -70,14 +70,14 @@ v = minmaxn( NaN, 3.14 ); Returns the minimum and maximum values in a single pass and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = minmaxn.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); +const v = minmaxn.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); // returns [ -2.0, 5.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -106,18 +106,13 @@ var bool = ( v === out ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var minmaxn = require( '@stdlib/math/base/special/minmaxn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = minmaxn( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minmaxn = require( '@stdlib/math/base/special/minmaxn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = minmaxn( x, y ); console.log( 'minmax(%d,%d) = [%d, %d]', x, y, v[0], v[1] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/minn/README.md b/lib/node_modules/@stdlib/math/base/special/minn/README.md index e36aeeac114b..04f653dc8483 100644 --- a/lib/node_modules/@stdlib/math/base/special/minn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/minn/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minn = require( '@stdlib/math/base/special/minn' ); +const minn = require( '@stdlib/math/base/special/minn' ); ``` #### minn( \[x\[, y\[, ...args]]] ) @@ -45,7 +45,7 @@ var minn = require( '@stdlib/math/base/special/minn' ); Returns the minimum value. ```javascript -var v = minn( 4.2, 3.14 ); +let v = minn( 4.2, 3.14 ); // returns 3.14 v = minn( +0.0, -0.0 ); @@ -58,7 +58,7 @@ v = minn( 4.2, 3.14, -1.0, 6.8 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = minn( 4.2, NaN ); +let v = minn( 4.2, NaN ); // returns NaN v = minn( NaN, 3.14 ); @@ -68,7 +68,7 @@ v = minn( NaN, 3.14 ); If not provided any arguments, the function returns `+infinity`. ```javascript -var v = minn(); +const v = minn(); // returns Infinity ``` @@ -97,18 +97,13 @@ var v = minn(); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var minn = require( '@stdlib/math/base/special/minn' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = minn( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minn = require( '@stdlib/math/base/special/minn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = minn( x, y ); console.log( 'min(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/modf/README.md b/lib/node_modules/@stdlib/math/base/special/modf/README.md index 52001cae7041..c0a27f032dc0 100644 --- a/lib/node_modules/@stdlib/math/base/special/modf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/modf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var modf = require( '@stdlib/math/base/special/modf' ); +const modf = require( '@stdlib/math/base/special/modf' ); ``` #### modf( x ) @@ -35,7 +35,7 @@ var modf = require( '@stdlib/math/base/special/modf' ); Decomposes a [double-precision floating-point number][ieee754] into integral and fractional parts, each having the same type and sign as `x`. ```javascript -var parts = modf( 3.14 ); +let parts = modf( 3.14 ); // returns [ 3.0, 0.14000000000000012 ] parts = modf( +0.0 ); @@ -59,14 +59,14 @@ parts = modf( NaN ); Decomposes a [double-precision floating-point number][ieee754] into integral and fractional parts, each having the same type and sign as `x`, and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var parts = modf.assign( 3.14, out, 1, 0 ); +const parts = modf.assign( 3.14, out, 1, 0 ); // returns [ 3.0, 0.14000000000000012 ] -var bool = ( parts === out ); +const bool = ( parts === out ); // returns true ``` @@ -87,16 +87,12 @@ var bool = ( parts === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var modf = require( '@stdlib/math/base/special/modf' ); +const randu = require( '@stdlib/random/base/randu' ); +const modf = require( '@stdlib/math/base/special/modf' ); -var parts; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*1000.0) - 500.0; - parts = modf( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*1000.0) - 500.0; + const parts = modf( x ); console.log( 'modf(%d) => integral: %d. fraction: %d.', x, parts[ 0 ], parts[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/nanmax/README.md b/lib/node_modules/@stdlib/math/base/special/nanmax/README.md index 08ce5e0ecee9..fa913ec8cfb9 100644 --- a/lib/node_modules/@stdlib/math/base/special/nanmax/README.md +++ b/lib/node_modules/@stdlib/math/base/special/nanmax/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nanmax = require( '@stdlib/math/base/special/nanmax' ); +const nanmax = require( '@stdlib/math/base/special/nanmax' ); ``` #### nanmax( x, y ) @@ -45,7 +45,7 @@ var nanmax = require( '@stdlib/math/base/special/nanmax' ); Returns the maximum value. ```javascript -var v = nanmax( 4.2, 3.14 ); +let v = nanmax( 4.2, 3.14 ); // returns 4.2 v = nanmax( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = nanmax( +0.0, -0.0 ); If any argument is `NaN`, the function returns the other operand. ```javascript -var v = nanmax( 4.2, NaN ); +let v = nanmax( 4.2, NaN ); // returns 4.2 v = nanmax( NaN, 3.14 ); @@ -65,7 +65,7 @@ v = nanmax( NaN, 3.14 ); If both arguments are `NaN`, the function returns `NaN`. ```javascript -var v = nanmax( NaN, NaN ); +const v = nanmax( NaN, NaN ); // returns NaN ``` @@ -90,9 +90,9 @@ var v = nanmax( NaN, NaN ); ```javascript -var nanmax = require( '@stdlib/math/base/special/nanmax' ); +const nanmax = require( '@stdlib/math/base/special/nanmax' ); -var m = nanmax( 3.0, 4.0 ); +let m = nanmax( 3.0, 4.0 ); console.log( m ); // => 4.0 diff --git a/lib/node_modules/@stdlib/math/base/special/nanmaxf/README.md b/lib/node_modules/@stdlib/math/base/special/nanmaxf/README.md index 91568a7e60f3..d9dda761d33f 100644 --- a/lib/node_modules/@stdlib/math/base/special/nanmaxf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/nanmaxf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nanmaxf = require( '@stdlib/math/base/special/nanmaxf' ); +const nanmaxf = require( '@stdlib/math/base/special/nanmaxf' ); ``` #### nanmaxf( x, y ) @@ -45,7 +45,7 @@ var nanmaxf = require( '@stdlib/math/base/special/nanmaxf' ); Returns the maximum value of two single-precision floating-point numbers, ignoring NaN. ```javascript -var v = nanmaxf( 4.2, 3.14 ); +let v = nanmaxf( 4.2, 3.14 ); // returns 4.2 v = nanmaxf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = nanmaxf( +0.0, -0.0 ); If any argument is `NaN`, the function returns the other operand. ```javascript -var v = nanmaxf( 4.2, NaN ); +let v = nanmaxf( 4.2, NaN ); // returns 4.2 v = nanmaxf( NaN, 3.14 ); @@ -65,7 +65,7 @@ v = nanmaxf( NaN, 3.14 ); If both arguments are `NaN`, the function returns `NaN`. ```javascript -var v = nanmaxf( NaN, NaN ); +const v = nanmaxf( NaN, NaN ); // returns NaN ``` @@ -90,9 +90,9 @@ var v = nanmaxf( NaN, NaN ); ```javascript -var nanmaxf = require( '@stdlib/math/base/special/nanmaxf' ); +const nanmaxf = require( '@stdlib/math/base/special/nanmaxf' ); -var m = nanmaxf( 3.0, 4.0 ); +let m = nanmaxf( 3.0, 4.0 ); console.log( m ); // => 4.0 diff --git a/lib/node_modules/@stdlib/math/base/special/nanmin/README.md b/lib/node_modules/@stdlib/math/base/special/nanmin/README.md index 622860ba2411..be398fa5b59b 100644 --- a/lib/node_modules/@stdlib/math/base/special/nanmin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/nanmin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nanmin = require( '@stdlib/math/base/special/nanmin' ); +const nanmin = require( '@stdlib/math/base/special/nanmin' ); ``` #### nanmin( x, y ) @@ -45,7 +45,7 @@ var nanmin = require( '@stdlib/math/base/special/nanmin' ); Returns the minimum value. ```javascript -var v = nanmin( 4.2, 3.14 ); +let v = nanmin( 4.2, 3.14 ); // returns 3.14 v = nanmin( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = nanmin( +0.0, -0.0 ); If any argument is `NaN`, the function returns the other operand. ```javascript -var v = nanmin( 4.2, NaN ); +let v = nanmin( 4.2, NaN ); // returns 4.2 v = nanmin( NaN, 3.14 ); @@ -65,7 +65,7 @@ v = nanmin( NaN, 3.14 ); If both arguments are `NaN`, the function returns `NaN`. ```javascript -var v = nanmin( NaN, NaN ); +const v = nanmin( NaN, NaN ); // returns NaN ``` @@ -90,9 +90,9 @@ var v = nanmin( NaN, NaN ); ```javascript -var nanmin = require( '@stdlib/math/base/special/nanmin' ); +const nanmin = require( '@stdlib/math/base/special/nanmin' ); -var m = nanmin( 3.0, 4.0 ); +let m = nanmin( 3.0, 4.0 ); console.log( m ); // => 3.0 diff --git a/lib/node_modules/@stdlib/math/base/special/nanminf/README.md b/lib/node_modules/@stdlib/math/base/special/nanminf/README.md index a1a3b8153200..1272e8de21a5 100644 --- a/lib/node_modules/@stdlib/math/base/special/nanminf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/nanminf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nanminf = require( '@stdlib/math/base/special/nanminf' ); +const nanminf = require( '@stdlib/math/base/special/nanminf' ); ``` #### nanminf( x, y ) @@ -45,7 +45,7 @@ var nanminf = require( '@stdlib/math/base/special/nanminf' ); Returns the minimum value of two single-precision floating-point numbers, ignoring NaN. ```javascript -var v = nanminf( 4.2, 3.14 ); +let v = nanminf( 4.2, 3.14 ); // returns 3.14 v = nanminf( +0.0, -0.0 ); @@ -55,7 +55,7 @@ v = nanminf( +0.0, -0.0 ); If any argument is `NaN`, the function returns the other operand. ```javascript -var v = nanminf( 4.2, NaN ); +let v = nanminf( 4.2, NaN ); // returns 4.2 v = nanminf( NaN, 3.14 ); @@ -65,7 +65,7 @@ v = nanminf( NaN, 3.14 ); If both arguments are `NaN`, the function returns `NaN`. ```javascript -var v = nanminf( NaN, NaN ); +const v = nanminf( NaN, NaN ); // returns NaN ``` @@ -90,9 +90,9 @@ var v = nanminf( NaN, NaN ); ```javascript -var nanminf = require( '@stdlib/math/base/special/nanminf' ); +const nanminf = require( '@stdlib/math/base/special/nanminf' ); -var m = nanminf( 3.0, 4.0 ); +let m = nanminf( 3.0, 4.0 ); console.log( m ); // => 3.0 diff --git a/lib/node_modules/@stdlib/math/base/special/negafibonacci/README.md b/lib/node_modules/@stdlib/math/base/special/negafibonacci/README.md index a4c70ce42dec..2c8f5d2a80f3 100644 --- a/lib/node_modules/@stdlib/math/base/special/negafibonacci/README.md +++ b/lib/node_modules/@stdlib/math/base/special/negafibonacci/README.md @@ -80,7 +80,7 @@ with seed values `F_0 = 0` and `F_{-1} = 1`. ## Usage ```javascript -var negafibonacci = require( '@stdlib/math/base/special/negafibonacci' ); +const negafibonacci = require( '@stdlib/math/base/special/negafibonacci' ); ``` #### negafibonacci( n ) @@ -88,7 +88,7 @@ var negafibonacci = require( '@stdlib/math/base/special/negafibonacci' ); Computes the nth [negaFibonacci number][fibonacci-number]. ```javascript -var v = negafibonacci( 0 ); +let v = negafibonacci( 0 ); // returns 0 v = negafibonacci( -1 ); @@ -107,14 +107,14 @@ v = negafibonacci( -78 ); If `n < -78`, the function returns `NaN`, as larger [negaFibonacci numbers][fibonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = negafibonacci( -79 ); +const v = negafibonacci( -79 ); // returns NaN ``` If not provided a nonpositive integer value, the function returns `NaN`. ```javascript -var v = negafibonacci( -3.14 ); +let v = negafibonacci( -3.14 ); // returns NaN v = negafibonacci( 1 ); @@ -124,7 +124,7 @@ v = negafibonacci( 1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = negafibonacci( NaN ); +const v = negafibonacci( NaN ); // returns NaN ``` @@ -145,13 +145,10 @@ var v = negafibonacci( NaN ); ```javascript -var negafibonacci = require( '@stdlib/math/base/special/negafibonacci' ); +const negafibonacci = require( '@stdlib/math/base/special/negafibonacci' ); -var v; -var i; - -for ( i = 0; i > -79; i-- ) { - v = negafibonacci( i ); +for ( let i = 0; i > -79; i-- ) { + const v = negafibonacci( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/negalucas/README.md b/lib/node_modules/@stdlib/math/base/special/negalucas/README.md index 43c6eae50ea8..ab45eb06a6f1 100644 --- a/lib/node_modules/@stdlib/math/base/special/negalucas/README.md +++ b/lib/node_modules/@stdlib/math/base/special/negalucas/README.md @@ -80,7 +80,7 @@ with seed values `L_0 = 2` and `L_{-1} = -1`. ## Usage ```javascript -var negalucas = require( '@stdlib/math/base/special/negalucas' ); +const negalucas = require( '@stdlib/math/base/special/negalucas' ); ``` #### negalucas( n ) @@ -88,7 +88,7 @@ var negalucas = require( '@stdlib/math/base/special/negalucas' ); Computes the nth [negaLucas number][lucas-number]. ```javascript -var v = negalucas( 0 ); +let v = negalucas( 0 ); // returns 2 v = negalucas( -1 ); @@ -107,14 +107,14 @@ v = negalucas( -76 ); If `n < -76`, the function returns `NaN`, as larger [negaLucas numbers][lucas-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = negalucas( -77 ); +const v = negalucas( -77 ); // returns NaN ``` If not provided a nonpositive integer value, the function returns `NaN`. ```javascript -var v = negalucas( -3.14 ); +let v = negalucas( -3.14 ); // returns NaN v = negalucas( 1 ); @@ -124,7 +124,7 @@ v = negalucas( 1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = negalucas( NaN ); +const v = negalucas( NaN ); // returns NaN ``` @@ -145,13 +145,10 @@ var v = negalucas( NaN ); ```javascript -var negalucas = require( '@stdlib/math/base/special/negalucas' ); +const negalucas = require( '@stdlib/math/base/special/negalucas' ); -var v; -var i; - -for ( i = 0; i > -77; i-- ) { - v = negalucas( i ); +for ( let i = 0; i > -77; i-- ) { + const v = negalucas( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/nonfibonacci/README.md b/lib/node_modules/@stdlib/math/base/special/nonfibonacci/README.md index cd7b45d1f7a3..6a9d9117c6bd 100644 --- a/lib/node_modules/@stdlib/math/base/special/nonfibonacci/README.md +++ b/lib/node_modules/@stdlib/math/base/special/nonfibonacci/README.md @@ -54,7 +54,7 @@ where `φ` is the [golden ratio][golden-ratio]. ## Usage ```javascript -var nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' ); +const nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' ); ``` #### nonfibonacci( n ) @@ -62,7 +62,7 @@ var nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' ); Computes the nth [non-Fibonacci number][fibonacci-number]. ```javascript -var v = nonfibonacci( 1 ); +let v = nonfibonacci( 1 ); // returns 4 v = nonfibonacci( 2 ); @@ -75,7 +75,7 @@ v = nonfibonacci( 3 ); If provided either a non-integer or `n < 1`, the function returns `NaN`. ```javascript -var v = nonfibonacci( -1 ); +let v = nonfibonacci( -1 ); // returns NaN v = nonfibonacci( 3.14 ); @@ -85,7 +85,7 @@ v = nonfibonacci( 3.14 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = nonfibonacci( NaN ); +const v = nonfibonacci( NaN ); // returns NaN ``` @@ -108,13 +108,10 @@ var v = nonfibonacci( NaN ); ```javascript -var nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' ); +const nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' ); -var v; -var i; - -for ( i = 1; i < 100; i++ ) { - v = nonfibonacci( i ); +for ( let i = 1; i < 100; i++ ) { + const v = nonfibonacci( i ); console.log( 'nonfibonacci(%d) = %d', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/pdiff/README.md b/lib/node_modules/@stdlib/math/base/special/pdiff/README.md index 3e220d8903ec..48249e275c6a 100644 --- a/lib/node_modules/@stdlib/math/base/special/pdiff/README.md +++ b/lib/node_modules/@stdlib/math/base/special/pdiff/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pdiff = require( '@stdlib/math/base/special/pdiff' ); +const pdiff = require( '@stdlib/math/base/special/pdiff' ); ``` #### pdiff( x, y ) @@ -45,7 +45,7 @@ var pdiff = require( '@stdlib/math/base/special/pdiff' ); Returns the positive difference between `x` and `y` if `x < y`; otherwise, returns `0`. ```javascript -var v = pdiff( 4.2, 3.14 ); +let v = pdiff( 4.2, 3.14 ); // returns 1.06 v = pdiff( 3.14, 4.2 ); @@ -58,7 +58,7 @@ v = pdiff( -0.0, +0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = pdiff( 4.2, NaN ); +let v = pdiff( 4.2, NaN ); // returns NaN v = pdiff( NaN, 3.14 ); @@ -93,18 +93,13 @@ v = pdiff( NaN, NaN ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var pdiff = require( '@stdlib/math/base/special/pdiff' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = pdiff( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const pdiff = require( '@stdlib/math/base/special/pdiff' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = pdiff( x, y ); console.log( 'pdiff(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/pdifff/README.md b/lib/node_modules/@stdlib/math/base/special/pdifff/README.md index 74f9dc62d011..89fae4dc7791 100644 --- a/lib/node_modules/@stdlib/math/base/special/pdifff/README.md +++ b/lib/node_modules/@stdlib/math/base/special/pdifff/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pdifff = require( '@stdlib/math/base/special/pdifff' ); +const pdifff = require( '@stdlib/math/base/special/pdifff' ); ``` #### pdifff( x, y ) @@ -45,7 +45,7 @@ var pdifff = require( '@stdlib/math/base/special/pdifff' ); Returns the positive difference between `x` and `y` if `x < y`; otherwise, returns `0`. ```javascript -var v = pdifff( 4.15, 3.15 ); +let v = pdifff( 4.15, 3.15 ); // returns 1.0 v = pdifff( 3.14, 4.2 ); @@ -58,7 +58,7 @@ v = pdifff( -0.0, +0.0 ); If any argument is `NaN`, the function returns `NaN`. ```javascript -var v = pdifff( 4.2, NaN ); +let v = pdifff( 4.2, NaN ); // returns NaN v = pdifff( NaN, 3.14 ); @@ -93,18 +93,13 @@ v = pdifff( NaN, NaN ); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var pdifff = require( '@stdlib/math/base/special/pdifff' ); - -var x; -var y; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = minstd(); - y = minstd(); - v = pdifff( x, y ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const pdifff = require( '@stdlib/math/base/special/pdifff' ); + +for ( let i = 0; i < 100; i++ ) { + const x = minstd(); + const y = minstd(); + const v = pdifff( x, y ); console.log( 'pdifff(%d,%d) = %d', x, y, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/polygamma/README.md b/lib/node_modules/@stdlib/math/base/special/polygamma/README.md index bc071c75657d..479a2b3e40b0 100644 --- a/lib/node_modules/@stdlib/math/base/special/polygamma/README.md +++ b/lib/node_modules/@stdlib/math/base/special/polygamma/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var polygamma = require( '@stdlib/math/base/special/polygamma' ); +const polygamma = require( '@stdlib/math/base/special/polygamma' ); ``` #### polygamma( n, x ) @@ -41,7 +41,7 @@ var polygamma = require( '@stdlib/math/base/special/polygamma' ); Evaluates the [polygamma function][polygamma-function] of order `n`; i.e., the `(n+1)`th derivative of the [natural logarithm][@stdlib/math/base/special/ln] of the [gamma function][@stdlib/math/base/special/gamma]. ```javascript -var v = polygamma( 3, 1.2 ); +let v = polygamma( 3, 1.2 ); // returns ~3.245 v = polygamma( 5, 1.2 ); @@ -54,7 +54,7 @@ v = polygamma( 3, -4.9 ); If `n` is not a nonnegative `integer`, the function returns `NaN`. ```javascript -var v = polygamma( 2.5, -1.2 ); +let v = polygamma( 2.5, -1.2 ); // returns NaN v = polygamma( -1, 5.3 ); @@ -64,7 +64,7 @@ v = polygamma( -1, 5.3 ); If `x` is `0` or a negative odd `integer`, the function returns `+Infinity`. ```javascript -var v = polygamma( 2, 0.0 ); +let v = polygamma( 2, 0.0 ); // returns +Infinity v = polygamma( 2, -1.0 ); @@ -84,7 +84,7 @@ v = polygamma( 2, -2.0 ); If provided `NaN` as either parameter, the function returns `NaN`. ```javascript -var v = polygamma( NaN, 2.1 ); +let v = polygamma( NaN, 2.1 ); // returns NaN v = polygamma( 1, NaN ); @@ -105,19 +105,14 @@ v = polygamma( NaN, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var polygamma = require( '@stdlib/math/base/special/polygamma' ); - -var n; -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = round( randu()*50.0 ); - v = polygamma( x, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const polygamma = require( '@stdlib/math/base/special/polygamma' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = round( randu()*50.0 ); + const v = polygamma( x, n ); console.log( 'x: %d, ψ^(%d)(x): %d', x, n, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/pow/README.md b/lib/node_modules/@stdlib/math/base/special/pow/README.md index 28d0d3c55a93..c071374584b3 100644 --- a/lib/node_modules/@stdlib/math/base/special/pow/README.md +++ b/lib/node_modules/@stdlib/math/base/special/pow/README.md @@ -50,7 +50,7 @@ where `b` is the **base** and `x` is the **exponent**. ## Usage ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); ``` #### pow( base, exponent ) @@ -58,7 +58,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); Evaluates the [exponential function][exponential-function]. ```javascript -var v = pow( 2.0, 3.0 ); +let v = pow( 2.0, 3.0 ); // returns 8.0 v = pow( 4.0, 0.5 ); @@ -94,17 +94,13 @@ v = pow( NaN, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var b; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - b = round( randu()*10.0 ); - x = round( randu()*10.0 ) - 5.0; +for ( let i = 0; i < 100; i++ ) { + const b = round( randu()*10.0 ); + const x = round( randu()*10.0 ) - 5.0; console.log( '%d^%d = %d', b, x, pow( b, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/powm1/README.md b/lib/node_modules/@stdlib/math/base/special/powm1/README.md index 487921a77c66..bb058d914e2f 100644 --- a/lib/node_modules/@stdlib/math/base/special/powm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/powm1/README.md @@ -48,7 +48,7 @@ When `b` is close to `1` and/or `x` is small, this implementation is more accura ## Usage ```javascript -var powm1 = require( '@stdlib/math/base/special/powm1' ); +const powm1 = require( '@stdlib/math/base/special/powm1' ); ``` #### powm1( b, x ) @@ -56,7 +56,7 @@ var powm1 = require( '@stdlib/math/base/special/powm1' ); Evaluates `bˣ - 1`. ```javascript -var y = powm1( 2.0, 3.0 ); +let y = powm1( 2.0, 3.0 ); // returns 7.0 y = powm1( 4.0, 0.5 ); @@ -92,19 +92,14 @@ y = powm1( 5.0, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var powm1 = require( '@stdlib/math/base/special/powm1' ); - -var b; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - b = round( randu()*10.0 ); - x = round( randu()*10.0 ) - 5.0; - y = powm1( b, x ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const powm1 = require( '@stdlib/math/base/special/powm1' ); + +for ( let i = 0; i < 100; i++ ) { + const b = round( randu()*10.0 ); + const x = round( randu()*10.0 ) - 5.0; + const y = powm1( b, x ); console.log( '%d^%d - 1 = %d', b, x, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rad2deg/README.md b/lib/node_modules/@stdlib/math/base/special/rad2deg/README.md index aaa9e4df1cb7..bae6eb4c6117 100644 --- a/lib/node_modules/@stdlib/math/base/special/rad2deg/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rad2deg/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rad2deg = require( '@stdlib/math/base/special/rad2deg' ); +const rad2deg = require( '@stdlib/math/base/special/rad2deg' ); ``` #### rad2deg( x ) @@ -35,7 +35,7 @@ var rad2deg = require( '@stdlib/math/base/special/rad2deg' ); Converts an angle from radians to degrees. ```javascript -var d = rad2deg( 3.141592653589793/2.0 ); +let d = rad2deg( 3.141592653589793/2.0 ); // returns 90.0 d = rad2deg( -3.141592653589793/4.0 ); @@ -56,7 +56,7 @@ d = rad2deg( NaN ); - Due to finite precision, canonical values may not be returned. For example, ```javascript - var d = rad2deg( 3.141592653589793/6.0 ); + const d = rad2deg( 3.141592653589793/6.0 ); // returns 29.999999999999996 ``` @@ -71,17 +71,13 @@ d = rad2deg( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var rad2deg = require( '@stdlib/math/base/special/rad2deg' ); +const randu = require( '@stdlib/random/base/randu' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const rad2deg = require( '@stdlib/math/base/special/rad2deg' ); -var r; -var d; -var i; - -for ( i = 0; i < 100; i++ ) { - r = randu() * TWO_PI; - d = rad2deg( r ); +for ( let i = 0; i < 100; i++ ) { + const r = randu() * TWO_PI; + const d = rad2deg( r ); console.log( 'radians: %d => degrees: %d', r, d ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rad2degf/README.md b/lib/node_modules/@stdlib/math/base/special/rad2degf/README.md index 5ac7a4755312..56f936cefbc1 100644 --- a/lib/node_modules/@stdlib/math/base/special/rad2degf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rad2degf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rad2degf = require( '@stdlib/math/base/special/rad2degf' ); +const rad2degf = require( '@stdlib/math/base/special/rad2degf' ); ``` #### rad2degf( x ) @@ -35,7 +35,7 @@ var rad2degf = require( '@stdlib/math/base/special/rad2degf' ); Converts an angle from radians to degrees (single-precision). ```javascript -var d = rad2degf( 3.141592653589793 / 2.0 ); +let d = rad2degf( 3.141592653589793 / 2.0 ); // returns 90.0 d = rad2degf( -3.141592653589793 / 4.0 ); @@ -56,7 +56,7 @@ d = rad2degf( NaN ); - Due to finite precision, canonical values may not be returned. For example, ```javascript - var d = rad2degf( 3.141592653589793 / 6.0 ); + const d = rad2degf( 3.141592653589793 / 6.0 ); // returns 30.000001907348633 ``` @@ -71,17 +71,13 @@ d = rad2degf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var TWO_PI = require( '@stdlib/constants/float32/two-pi' ); -var rad2degf = require( '@stdlib/math/base/special/rad2degf' ); +const randu = require( '@stdlib/random/base/randu' ); +const TWO_PI = require( '@stdlib/constants/float32/two-pi' ); +const rad2degf = require( '@stdlib/math/base/special/rad2degf' ); -var r; -var d; -var i; - -for ( i = 0; i < 100; i++ ) { - r = randu() * TWO_PI; - d = rad2degf( r ); +for ( let i = 0; i < 100; i++ ) { + const r = randu() * TWO_PI; + const d = rad2degf( r ); console.log( 'radians: %d => degrees: %d', r, d ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ramp/README.md b/lib/node_modules/@stdlib/math/base/special/ramp/README.md index 56bb80a16b3e..76f319aad759 100644 --- a/lib/node_modules/@stdlib/math/base/special/ramp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ramp/README.md @@ -63,7 +63,7 @@ R(x) = \mathop{\mathrm{max}}( x, 0 ) ## Usage ```javascript -var ramp = require( '@stdlib/math/base/special/ramp' ); +const ramp = require( '@stdlib/math/base/special/ramp' ); ``` #### ramp( x ) @@ -71,7 +71,7 @@ var ramp = require( '@stdlib/math/base/special/ramp' ); Evaluates the [ramp function][ramp-function]. ```javascript -var v = ramp( 3.14 ); +let v = ramp( 3.14 ); // returns 3.14 v = ramp( -3.14 ); @@ -92,13 +92,12 @@ v = ramp( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var ramp = require( '@stdlib/math/base/special/ramp' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const ramp = require( '@stdlib/math/base/special/ramp' ); -var x = linspace( -10.0, 10.0, 101 ); +const x = linspace( -10.0, 10.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'R(%d) = %d', x[ i ], ramp( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rampf/README.md b/lib/node_modules/@stdlib/math/base/special/rampf/README.md index eeaa229c1476..1181b4c7b0d2 100644 --- a/lib/node_modules/@stdlib/math/base/special/rampf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rampf/README.md @@ -63,7 +63,7 @@ R(x) = \mathop{\mathrm{max}}( x, 0 ) ## Usage ```javascript -var rampf = require( '@stdlib/math/base/special/rampf' ); +const rampf = require( '@stdlib/math/base/special/rampf' ); ``` #### rampf( x ) @@ -71,7 +71,7 @@ var rampf = require( '@stdlib/math/base/special/rampf' ); Evaluates the [ramp function][ramp-function]. ```javascript -var v = rampf( 3.14 ); +let v = rampf( 3.14 ); // returns 3.14 v = rampf( -3.14 ); @@ -92,13 +92,12 @@ v = rampf( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var rampf = require( '@stdlib/math/base/special/rampf' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const rampf = require( '@stdlib/math/base/special/rampf' ); -var x = linspace( -10.0, 10.0, 101 ); +const x = linspace( -10.0, 10.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'R(%d) = %d', x[ i ], rampf( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrt/README.md b/lib/node_modules/@stdlib/math/base/special/rcbrt/README.md index 7de83c93e533..97d531aff3ee 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrt/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rcbrt/README.md @@ -48,7 +48,7 @@ The reciprocal of the principal [cube root][cube-root] is defined as ## Usage ```javascript -var rcbrt = require( '@stdlib/math/base/special/rcbrt' ); +const rcbrt = require( '@stdlib/math/base/special/rcbrt' ); ``` #### rcbrt( x ) @@ -56,7 +56,7 @@ var rcbrt = require( '@stdlib/math/base/special/rcbrt' ); Computes the reciprocal (inverse) cube root of a double-precision floating-point number. ```javascript -var v = rcbrt( 1.0 ); +let v = rcbrt( 1.0 ); // returns 1.0 v = rcbrt( 8.0 ); @@ -86,13 +86,11 @@ v = rcbrt( Infinity ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var rcbrt = require( '@stdlib/math/base/special/rcbrt' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const rcbrt = require( '@stdlib/math/base/special/rcbrt' ); -var x; -var i; -for ( i = 0; i < 100; i++ ) { - x = discreteUniform( 0.0, 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = discreteUniform( 0.0, 100.0 ); console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/README.md b/lib/node_modules/@stdlib/math/base/special/rcbrtf/README.md index d49d3919eedf..d564cc503577 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/README.md @@ -48,7 +48,7 @@ The reciprocal of the principal [cube root][cube-root] is defined as ## Usage ```javascript -var rcbrtf = require( '@stdlib/math/base/special/rcbrtf' ); +const rcbrtf = require( '@stdlib/math/base/special/rcbrtf' ); ``` #### rcbrtf( x ) @@ -56,7 +56,7 @@ var rcbrtf = require( '@stdlib/math/base/special/rcbrtf' ); Computes the reciprocal cube root of a single-precision floating-point number. ```javascript -var v = rcbrtf( 1.0 ); +let v = rcbrtf( 1.0 ); // returns 1.0 v = rcbrtf( 8.0 ); @@ -86,13 +86,11 @@ v = rcbrtf( Infinity ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var rcbrtf = require( '@stdlib/math/base/special/rcbrtf' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const rcbrtf = require( '@stdlib/math/base/special/rcbrtf' ); -var x; -var i; -for ( i = 0; i < 100; i++ ) { - x = discreteUniform( 0.0, 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = discreteUniform( 0.0, 100.0 ); console.log( 'rcbrtf(%d) = %d', x, rcbrtf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/README.md b/lib/node_modules/@stdlib/math/base/special/rempio2/README.md index 978033ba6f65..66b4cef2dace 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rempio2 = require( '@stdlib/math/base/special/rempio2' ); +const rempio2 = require( '@stdlib/math/base/special/rempio2' ); ``` #### rempio2( x, y ) @@ -35,28 +35,28 @@ var rempio2 = require( '@stdlib/math/base/special/rempio2' ); Computes `x - nπ/2 = r`. ```javascript -var y = [ 0.0, 0.0 ]; -var n = rempio2( 128.0, y ); +const y = [ 0.0, 0.0 ]; +const n = rempio2( 128.0, y ); // returns 81 -var y1 = y[ 0 ]; +const y1 = y[ 0 ]; // returns ~0.765 -var y2 = y[ 1 ]; +const y2 = y[ 1 ]; // returns ~3.618e-17 ``` When `x` is `NaN` or infinite, the function returns `0` and sets the elements of `y` to `NaN`. ```javascript -var y = [ 0.0, 0.0 ]; -var n = rempio2( NaN, y ); +let y = [ 0.0, 0.0 ]; +let n = rempio2( NaN, y ); // returns 0 -var y1 = y[ 0 ]; +let y1 = y[ 0 ]; // returns NaN -var y2 = y[ 1 ]; +let y2 = y[ 1 ]; // returns NaN y = [ 0.0, 0.0 ]; @@ -94,16 +94,14 @@ y2 = y[ 1 ]; ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var rempio2 = require( '@stdlib/math/base/special/rempio2' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const rempio2 = require( '@stdlib/math/base/special/rempio2' ); -var x = linspace( 0.0, 100.0, 100 ); -var y = [ 0.0, 0.0 ]; -var n; -var i; +const x = linspace( 0.0, 100.0, 100 ); +const y = [ 0.0, 0.0 ]; -for ( i = 0; i < x.length; i++ ) { - n = rempio2( x[ i ], y ); +for ( let i = 0; i < x.length; i++ ) { + const n = rempio2( x[ i ], y ); console.log( '%d - %dπ/2 = %d + %d', x[ i ], n, y[ 0 ], y[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/README.md b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/README.md index 25c5c7cfdb2f..dbbbbf93f95f 100644 --- a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/README.md +++ b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/README.md @@ -50,7 +50,7 @@ where `s` is a complex variable equal to `σ + ti`. The series is only convergen ## Usage ```javascript -var zeta = require( '@stdlib/math/base/special/riemann-zeta' ); +const zeta = require( '@stdlib/math/base/special/riemann-zeta' ); ``` #### zeta( s ) @@ -58,7 +58,7 @@ var zeta = require( '@stdlib/math/base/special/riemann-zeta' ); Evaluates the [Riemann zeta][zeta-function] function as a function of a real variable `s` (i.e., `t = 0`). ```javascript -var v = zeta( 1.1 ); +let v = zeta( 1.1 ); // returns ~10.584 v = zeta( -4.0 ); @@ -88,13 +88,12 @@ v = zeta( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var zeta = require( '@stdlib/math/base/special/riemann-zeta' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const zeta = require( '@stdlib/math/base/special/riemann-zeta' ); -var s = linspace( -50.0, 50.0, 200 ); +const s = linspace( -50.0, 50.0, 200 ); -var i; -for ( i = 0; i < s.length; i++ ) { +for ( let i = 0; i < s.length; i++ ) { console.log( 's: %d, ζ(s): %d', s[ i ], zeta( s[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rising-factorial/README.md b/lib/node_modules/@stdlib/math/base/special/rising-factorial/README.md index e81e183c5f93..7bdc9375a09f 100644 --- a/lib/node_modules/@stdlib/math/base/special/rising-factorial/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rising-factorial/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var risingFactorial = require( '@stdlib/math/base/special/rising-factorial' ); +const risingFactorial = require( '@stdlib/math/base/special/rising-factorial' ); ``` #### risingFactorial( x, n ) @@ -41,7 +41,7 @@ var risingFactorial = require( '@stdlib/math/base/special/rising-factorial' ); Evaluates the [rising factorial][falling-and-rising-factorials] of `x` and `n`. ```javascript -var v = risingFactorial( 0.9, 5 ); +let v = risingFactorial( 0.9, 5 ); // returns ~94.766 v = risingFactorial( -9.0, 3 ); @@ -66,7 +66,7 @@ v = risingFactorial( NaN, NaN ); The function returns `NaN` for non-integer `n`. ```javascript -var v = risingFactorial( 2.0, 1.5 ); +const v = risingFactorial( 2.0, 1.5 ); // returns NaN ``` @@ -81,17 +81,13 @@ var v = risingFactorial( 2.0, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var risingFactorial = require( '@stdlib/math/base/special/rising-factorial' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const risingFactorial = require( '@stdlib/math/base/special/rising-factorial' ); -var n; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*40.0 ) - 20.0; - n = ceil( ( randu()*40.0 ) - 20.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*40.0 ) - 20.0; + const n = ceil( ( randu()*40.0 ) - 20.0 ); console.log( 'risingFactorial(%d,%d) = %d', x, n, risingFactorial( x, n ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/round/README.md b/lib/node_modules/@stdlib/math/base/special/round/README.md index 44dd6f46d4e8..a63ecb52727d 100644 --- a/lib/node_modules/@stdlib/math/base/special/round/README.md +++ b/lib/node_modules/@stdlib/math/base/special/round/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var round = require( '@stdlib/math/base/special/round' ); +const round = require( '@stdlib/math/base/special/round' ); ``` #### round( x ) @@ -35,7 +35,7 @@ var round = require( '@stdlib/math/base/special/round' ); Rounds a `numeric` value to the nearest `integer`. ```javascript -var v = round( -4.2 ); +let v = round( -4.2 ); // returns -4.0 v = round( -4.5 ); @@ -90,14 +90,11 @@ v = round( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'Value: %d. Rounded: %d.', x, round( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/round10/README.md b/lib/node_modules/@stdlib/math/base/special/round10/README.md index eb510c782d4b..62556030ed20 100644 --- a/lib/node_modules/@stdlib/math/base/special/round10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/round10/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var round10 = require( '@stdlib/math/base/special/round10' ); +const round10 = require( '@stdlib/math/base/special/round10' ); ``` #### round10( x ) @@ -35,7 +35,7 @@ var round10 = require( '@stdlib/math/base/special/round10' ); Rounds a `numeric` value to the nearest power of 10 on a linear scale. ```javascript -var v = round10( -4.2 ); +let v = round10( -4.2 ); // returns -1.0 v = round10( -4.5 ); @@ -83,16 +83,12 @@ v = round10( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round10 = require( '@stdlib/math/base/special/round10' ); +const randu = require( '@stdlib/random/base/randu' ); +const round10 = require( '@stdlib/math/base/special/round10' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = round10( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = round10( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/round2/README.md b/lib/node_modules/@stdlib/math/base/special/round2/README.md index 61d621eebec5..cc5277e1f0b8 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/round2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var round2 = require( '@stdlib/math/base/special/round2' ); +const round2 = require( '@stdlib/math/base/special/round2' ); ``` #### round2( x ) @@ -35,7 +35,7 @@ var round2 = require( '@stdlib/math/base/special/round2' ); Rounds a `numeric` value to the nearest power of two on a linear scale. ```javascript -var v = round2( -4.2 ); +let v = round2( -4.2 ); // returns -4.0 v = round2( -4.5 ); @@ -83,16 +83,12 @@ v = round2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round2 = require( '@stdlib/math/base/special/round2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round2 = require( '@stdlib/math/base/special/round2' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = round2( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = round2( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/roundb/README.md b/lib/node_modules/@stdlib/math/base/special/roundb/README.md index 2342fdaa8139..a43f51e5ddac 100644 --- a/lib/node_modules/@stdlib/math/base/special/roundb/README.md +++ b/lib/node_modules/@stdlib/math/base/special/roundb/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var roundb = require( '@stdlib/math/base/special/roundb' ); +const roundb = require( '@stdlib/math/base/special/roundb' ); ``` #### roundb( x, n, b ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `b^n` on a linear scale. ```javascript // Round a value to 2 decimal places: -var v = roundb( 3.141592653589793, -2, 10 ); +let v = roundb( 3.141592653589793, -2, 10 ); // returns 3.14 // If n = 0 or b = 1, `roundb` behaves like `round`: @@ -59,11 +59,11 @@ v = roundb( 5.0, 1, 2 ); - Due to rounding error in [floating-point numbers][ieee754], rounding may **not** be exact. For example, ```javascript - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round to 0.3... - var v = roundb( x, -16, 10 ); + const v = roundb( x, -16, 10 ); // returns 0.3000000000000001 ``` @@ -78,22 +78,16 @@ v = roundb( 5.0, 1, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var roundb = require( '@stdlib/math/base/special/roundb' ); - -var x; -var n; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = round( (randu()*10.0) - 5.0 ); - b = round( randu()*10.0 ); - v = roundb( x, n, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const roundb = require( '@stdlib/math/base/special/roundb' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = round( (randu()*10.0) - 5.0 ); + const b = round( randu()*10.0 ); + const v = roundb( x, n, b ); console.log( 'x: %d. %d^%d: %d. Rounded: %d.', x, b, n, pow( b, n ), v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/roundf/README.md b/lib/node_modules/@stdlib/math/base/special/roundf/README.md index 6071e93c397a..25360781bc5c 100644 --- a/lib/node_modules/@stdlib/math/base/special/roundf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/roundf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var roundf = require( '@stdlib/math/base/special/roundf' ); +const roundf = require( '@stdlib/math/base/special/roundf' ); ``` #### roundf( x ) @@ -35,7 +35,7 @@ var roundf = require( '@stdlib/math/base/special/roundf' ); Rounds a single-precision floating-point number to the nearest `integer`. ```javascript -var v = roundf( -4.2 ); +let v = roundf( -4.2 ); // returns -4.0 v = roundf( -4.5 ); @@ -90,14 +90,11 @@ v = roundf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundf = require( '@stdlib/math/base/special/roundf' ); +const randu = require( '@stdlib/random/base/randu' ); +const roundf = require( '@stdlib/math/base/special/roundf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu() * 100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = ( randu() * 100.0 ) - 50.0; console.log( 'Value: %d. Rounded: %d.', x, roundf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/roundn/README.md b/lib/node_modules/@stdlib/math/base/special/roundn/README.md index 302c67209dbb..328cc745b350 100644 --- a/lib/node_modules/@stdlib/math/base/special/roundn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/roundn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var roundn = require( '@stdlib/math/base/special/roundn' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); ``` #### roundn( x, n ) @@ -36,7 +36,7 @@ Rounds a double-precision floating-point number to the nearest multiple of `10^n ```javascript // Round a value to 2 decimal places: -var v = roundn( 3.141592653589793, -2 ); +let v = roundn( 3.141592653589793, -2 ); // returns 3.14 // If n = 0, `roundn` behaves like `round`: @@ -59,11 +59,11 @@ v = roundn( 12368.0, 3 ); - When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be **inexact**. For example, ```javascript - var x = 0.2 + 0.1; + const x = 0.2 + 0.1; // returns 0.30000000000000004 // Should round to 0.3... - var v = roundn( x, -16 ); + const v = roundn( x, -16 ); // returns 0.3000000000000001 ``` @@ -78,18 +78,12 @@ v = roundn( 12368.0, 3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); - -var x; -var n; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = roundn( randu()*5.0, 0 ); - v = roundn( x, -n ); +const randu = require( '@stdlib/random/base/randu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = roundn( randu()*5.0, 0 ); + const v = roundn( x, -n ); console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/roundsd/README.md b/lib/node_modules/@stdlib/math/base/special/roundsd/README.md index 2afbc3bfaaa3..e7afcfd0eea4 100644 --- a/lib/node_modules/@stdlib/math/base/special/roundsd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/roundsd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var roundsd = require( '@stdlib/math/base/special/roundsd' ); +const roundsd = require( '@stdlib/math/base/special/roundsd' ); ``` #### roundsd( x, n\[, b] ) @@ -35,7 +35,7 @@ var roundsd = require( '@stdlib/math/base/special/roundsd' ); Rounds a `numeric` value to the nearest `number` with `n` significant figures. ```javascript -var v = roundsd( 3.141592653589793, 3 ); +let v = roundsd( 3.141592653589793, 3 ); // returns 3.14 v = roundsd( 3.141592653589793, 1 ); @@ -48,7 +48,7 @@ v = roundsd( 12368.0, 2 ); The default base is `10` (decimal). To round using a different base, provide a third argument. ```javascript -var v = roundsd( 0.0313, 2, 2 ); +const v = roundsd( 0.0313, 2, 2 ); // returns 0.03125 ``` @@ -69,16 +69,12 @@ var v = roundsd( 0.0313, 2, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundsd = require( '@stdlib/math/base/special/roundsd' ); +const randu = require( '@stdlib/random/base/randu' ); +const roundsd = require( '@stdlib/math/base/special/roundsd' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10000.0) - 5000.0; - y = roundsd( x, 5 ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10000.0) - 5000.0; + const y = roundsd( x, 5 ); console.log( 'x: %d. Rounded: %d.', x, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rsqrt/README.md b/lib/node_modules/@stdlib/math/base/special/rsqrt/README.md index 912bdfc58134..a96d1951ba64 100644 --- a/lib/node_modules/@stdlib/math/base/special/rsqrt/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rsqrt/README.md @@ -48,7 +48,7 @@ The reciprocal of the principal [square root][square-root] is defined as ## Usage ```javascript -var rsqrt = require( '@stdlib/math/base/special/rsqrt' ); +const rsqrt = require( '@stdlib/math/base/special/rsqrt' ); ``` #### rsqrt( x ) @@ -56,7 +56,7 @@ var rsqrt = require( '@stdlib/math/base/special/rsqrt' ); Computes the reciprocal (inverse) square root of a double-precision floating-point number. ```javascript -var v = rsqrt( 1.0 ); +let v = rsqrt( 1.0 ); // returns 1.0 v = rsqrt( 4.0 ); @@ -78,7 +78,7 @@ v = rsqrt( Infinity ); For negative numbers, the reciprocal square root is **not** defined. ```javascript -var v = rsqrt( -4.0 ); +const v = rsqrt( -4.0 ); // returns NaN ``` @@ -93,15 +93,12 @@ var v = rsqrt( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var rsqrt = require( '@stdlib/math/base/special/rsqrt' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const rsqrt = require( '@stdlib/math/base/special/rsqrt' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'rsqrt(%d) = %d', x, rsqrt( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/rsqrtf/README.md b/lib/node_modules/@stdlib/math/base/special/rsqrtf/README.md index c07f50002b11..417718528657 100644 --- a/lib/node_modules/@stdlib/math/base/special/rsqrtf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/rsqrtf/README.md @@ -48,7 +48,7 @@ The reciprocal of the principal [square root][square-root] is defined as ## Usage ```javascript -var rsqrtf = require( '@stdlib/math/base/special/rsqrtf' ); +const rsqrtf = require( '@stdlib/math/base/special/rsqrtf' ); ``` #### rsqrtf( x ) @@ -56,7 +56,7 @@ var rsqrtf = require( '@stdlib/math/base/special/rsqrtf' ); Computes the reciprocal (inverse) square root of a single-precision floating-point number. ```javascript -var v = rsqrtf( 1.0 ); +let v = rsqrtf( 1.0 ); // returns 1.0 v = rsqrtf( 4.0 ); @@ -75,7 +75,7 @@ v = rsqrtf( Infinity ); For negative numbers, the reciprocal square root is **not** defined. ```javascript -var v = rsqrtf( -4.0 ); +const v = rsqrtf( -4.0 ); // returns NaN ``` @@ -90,15 +90,12 @@ var v = rsqrtf( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var rsqrtf = require( '@stdlib/math/base/special/rsqrtf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const rsqrtf = require( '@stdlib/math/base/special/rsqrtf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'rsqrt(%d) = %d', x, rsqrtf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sec/README.md b/lib/node_modules/@stdlib/math/base/special/sec/README.md index 4ba7829d878e..516bde49f295 100644 --- a/lib/node_modules/@stdlib/math/base/special/sec/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sec/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var sec = require( '@stdlib/math/base/special/sec' ); +const sec = require( '@stdlib/math/base/special/sec' ); ``` ## sec( x ) @@ -39,7 +39,7 @@ var sec = require( '@stdlib/math/base/special/sec' ); Evaluates the [secant][trigonometric-functions] of `x` (in radians). ```javascript -var v = sec( 0.0 ); +let v = sec( 0.0 ); // returns 1.0 v = sec( 3.141592653589793/2.0 ); @@ -66,14 +66,13 @@ v = sec( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var sec = require( '@stdlib/math/base/special/sec' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const sec = require( '@stdlib/math/base/special/sec' ); -var x = linspace( -PI/2.0, PI/2.0, 100 ); +const x = linspace( -PI/2.0, PI/2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sec( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/secd/README.md b/lib/node_modules/@stdlib/math/base/special/secd/README.md index ad7ed1d18b42..c36eb2832d8d 100644 --- a/lib/node_modules/@stdlib/math/base/special/secd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/secd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var secd = require( '@stdlib/math/base/special/secd' ); +const secd = require( '@stdlib/math/base/special/secd' ); ``` #### secd( x ) @@ -35,7 +35,7 @@ var secd = require( '@stdlib/math/base/special/secd' ); Computes the [secant][secant] of `x` (in degrees). ```javascript -var v = secd( 30 ); +let v = secd( 30 ); // returns ~1.15 v = secd( 45 ); @@ -65,13 +65,12 @@ v = secd( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var secd = require( '@stdlib/math/base/special/secd' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const secd = require( '@stdlib/math/base/special/secd' ); -var x = linspace( 1.1, 5.1, 100 ); +const x = linspace( 1.1, 5.1, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( secd( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sici/README.md b/lib/node_modules/@stdlib/math/base/special/sici/README.md index 1c76aa5ec9f5..e4c667a1ad01 100644 --- a/lib/node_modules/@stdlib/math/base/special/sici/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sici/README.md @@ -65,7 +65,7 @@ where `γ` is the [Euler-Mascheroni][eulergamma] constant. ## Usage ```javascript -var sici = require( '@stdlib/math/base/special/sici' ); +const sici = require( '@stdlib/math/base/special/sici' ); ``` #### sici( x ) @@ -73,7 +73,7 @@ var sici = require( '@stdlib/math/base/special/sici' ); Computes the sine and cosine integrals. ```javascript -var v = sici( 3.0 ); +let v = sici( 3.0 ); // returns [ ~1.849, ~0.12 ] v = sici( 0.0 ); @@ -91,14 +91,14 @@ v = sici( NaN ); Computes the sine and cosine integrals and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = sici.assign( 3.0, out, 1, 0 ); +const v = sici.assign( 3.0, out, 1, 0 ); // returns [ ~1.849, ~0.12 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -113,16 +113,12 @@ var bool = ( v === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var sici = require( '@stdlib/math/base/special/sici' ); +const randu = require( '@stdlib/random/base/randu' ); +const sici = require( '@stdlib/math/base/special/sici' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = sici( x ); +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = sici( x ); console.log( 'si(%d) = %d, ci(%d) = %d', x, y[ 0 ], x, y[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/signum/README.md b/lib/node_modules/@stdlib/math/base/special/signum/README.md index 7ffab04afb77..f8cce03940b0 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/README.md +++ b/lib/node_modules/@stdlib/math/base/special/signum/README.md @@ -50,7 +50,7 @@ for any real number `x`. ## Usage ```javascript -var signum = require( '@stdlib/math/base/special/signum' ); +const signum = require( '@stdlib/math/base/special/signum' ); ``` #### signum( x ) @@ -58,7 +58,7 @@ var signum = require( '@stdlib/math/base/special/signum' ); Evaluates the [signum][signum] function for a double-precision floating-point number. ```javascript -var sign = signum( -5.0 ); +let sign = signum( -5.0 ); // returns -1 sign = signum( 5.0 ); @@ -103,17 +103,13 @@ Table of results: ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var signum = require( '@stdlib/math/base/special/signum' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const signum = require( '@stdlib/math/base/special/signum' ); -var sign; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - sign = signum( x ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const sign = signum( x ); console.log( 'signum(%d) = %d', x, sign ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/signumf/README.md b/lib/node_modules/@stdlib/math/base/special/signumf/README.md index 2dddaea2c5a1..135c1e33f2b3 100644 --- a/lib/node_modules/@stdlib/math/base/special/signumf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/signumf/README.md @@ -50,7 +50,7 @@ for any real number `x`. ## Usage ```javascript -var signumf = require( '@stdlib/math/base/special/signumf' ); +const signumf = require( '@stdlib/math/base/special/signumf' ); ``` #### signumf( x ) @@ -58,7 +58,7 @@ var signumf = require( '@stdlib/math/base/special/signumf' ); Evaluates the [signum][signum] function for a single-precision floating-point number. ```javascript -var sign = signumf( -5.0 ); +let sign = signumf( -5.0 ); // returns -1 sign = signumf( 5.0 ); @@ -103,17 +103,13 @@ Table of results: ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var signumf = require( '@stdlib/math/base/special/signumf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const signumf = require( '@stdlib/math/base/special/signumf' ); -var sign; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - sign = signumf( x ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*100.0 ) - 50.0; + const sign = signumf( x ); console.log( 'signum(%d) = %d', x, sign ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sin/README.md b/lib/node_modules/@stdlib/math/base/special/sin/README.md index 73bde3e8b64e..1a1bd02492b7 100644 --- a/lib/node_modules/@stdlib/math/base/special/sin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sin = require( '@stdlib/math/base/special/sin' ); +const sin = require( '@stdlib/math/base/special/sin' ); ``` #### sin( x ) @@ -35,7 +35,7 @@ var sin = require( '@stdlib/math/base/special/sin' ); Computes the [sine][sine] of a `number` (in radians). ```javascript -var v = sin( 0.0 ); +let v = sin( 0.0 ); // returns ~0.0 v = sin( 3.141592653589793/2.0 ); @@ -56,14 +56,13 @@ v = sin( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var sin = require( '@stdlib/math/base/special/sin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const sin = require( '@stdlib/math/base/special/sin' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sinc/README.md b/lib/node_modules/@stdlib/math/base/special/sinc/README.md index f9aa00ada6b9..d38cfc6f0114 100644 --- a/lib/node_modules/@stdlib/math/base/special/sinc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sinc/README.md @@ -50,7 +50,7 @@ for any real number `x`. ## Usage ```javascript -var sinc = require( '@stdlib/math/base/special/sinc' ); +const sinc = require( '@stdlib/math/base/special/sinc' ); ``` #### sinc( x ) @@ -58,7 +58,7 @@ var sinc = require( '@stdlib/math/base/special/sinc' ); Computes the normalized [cardinal sine][sinc] of a `number`. ```javascript -var v = sinc( 0.5 ); +let v = sinc( 0.5 ); // returns ~0.637 v = sinc( -1.2 ); @@ -82,13 +82,12 @@ v = sinc( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var sinc = require( '@stdlib/math/base/special/sinc' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const sinc = require( '@stdlib/math/base/special/sinc' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sinc( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sincos/README.md b/lib/node_modules/@stdlib/math/base/special/sincos/README.md index 6463c58b40b6..7273fa9de6e9 100644 --- a/lib/node_modules/@stdlib/math/base/special/sincos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sincos/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sincos = require( '@stdlib/math/base/special/sincos' ); +const sincos = require( '@stdlib/math/base/special/sincos' ); ``` #### sincos( x ) @@ -35,7 +35,7 @@ var sincos = require( '@stdlib/math/base/special/sincos' ); Simultaneously computes the [sine][@stdlib/math/base/special/sin] and [cosine][@stdlib/math/base/special/cos] of a `number` (in radians). ```javascript -var v = sincos( 0.0 ); +let v = sincos( 0.0 ); // returns [ ~0.0, ~1.0 ] v = sincos( 3.141592653589793/2.0 ); @@ -50,14 +50,14 @@ v = sincos( -3.141592653589793/6.0 ); Simultaneously computes the [sine][@stdlib/math/base/special/sin] and [cosine][@stdlib/math/base/special/cos] of a `number` (in radians) and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = sincos.assign( 0.0, out, 1, 0 ); +const v = sincos.assign( 0.0, out, 1, 0 ); // returns [ ~0.0, ~1.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -72,14 +72,13 @@ var bool = ( v === out ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var sincos = require( '@stdlib/math/base/special/sincos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const sincos = require( '@stdlib/math/base/special/sincos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sincos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sincospi/README.md b/lib/node_modules/@stdlib/math/base/special/sincospi/README.md index 80887205249a..e858a7989ad6 100644 --- a/lib/node_modules/@stdlib/math/base/special/sincospi/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sincospi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sincospi = require( '@stdlib/math/base/special/sincospi' ); +const sincospi = require( '@stdlib/math/base/special/sincospi' ); ``` #### sincospi( x ) @@ -35,7 +35,7 @@ var sincospi = require( '@stdlib/math/base/special/sincospi' ); Simultaneously computes the [sine][@stdlib/math/base/special/sin] and [cosine][@stdlib/math/base/special/cos] of a `number` times [π][@stdlib/constants/float64/pi] more accurately than `sincos(pi*x)`, especially for large `x`. ```javascript -var v = sincospi( 0.0 ); +let v = sincospi( 0.0 ); // returns [ 0.0, 1.0 ] v = sincospi( 0.5 ); @@ -53,14 +53,14 @@ v = sincospi( NaN ); Simultaneously computes the [sine][@stdlib/math/base/special/sin] and [cosine][@stdlib/math/base/special/cos] of a `number` times [π][@stdlib/constants/float64/pi] more accurately than `sincos(pi*x)`, especially for large `x`, and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = sincospi.assign( 0.0, out, 1, 0 ); +const v = sincospi.assign( 0.0, out, 1, 0 ); // returns [ 0.0, 1.0 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -75,13 +75,12 @@ var bool = ( v === out ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var sincospi = require( '@stdlib/math/base/special/sincospi' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const sincospi = require( '@stdlib/math/base/special/sincospi' ); -var x = linspace( 0.0, 2.0, 101 ); +const x = linspace( 0.0, 2.0, 101 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sincospi( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sinh/README.md b/lib/node_modules/@stdlib/math/base/special/sinh/README.md index 01255bca6cb8..4e98026c06ee 100644 --- a/lib/node_modules/@stdlib/math/base/special/sinh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sinh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sinh = require( '@stdlib/math/base/special/sinh' ); +const sinh = require( '@stdlib/math/base/special/sinh' ); ``` #### sinh( x ) @@ -35,7 +35,7 @@ var sinh = require( '@stdlib/math/base/special/sinh' ); Computes the [hyperbolic sine][hyperbolic-sine] of double-precision floating-point number `x`. ```javascript -var v = sinh( 0.0 ); +let v = sinh( 0.0 ); // returns 0.0 v = sinh( -0.0 ); @@ -62,13 +62,12 @@ v = sinh( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var sinh = require( '@stdlib/math/base/special/sinh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const sinh = require( '@stdlib/math/base/special/sinh' ); -var x = linspace( -5.0, 5.0, 100 ); +const x = linspace( -5.0, 5.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sinh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sinpi/README.md b/lib/node_modules/@stdlib/math/base/special/sinpi/README.md index c39719b251da..201f500b9edb 100644 --- a/lib/node_modules/@stdlib/math/base/special/sinpi/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sinpi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sinpi = require( '@stdlib/math/base/special/sinpi' ); +const sinpi = require( '@stdlib/math/base/special/sinpi' ); ``` #### sinpi( x ) @@ -35,7 +35,7 @@ var sinpi = require( '@stdlib/math/base/special/sinpi' ); Computes `sin(πx)` more accurately than `sin(pi*x)`, especially for large `x`. ```javascript -var y = sinpi( 0.0 ); +let y = sinpi( 0.0 ); // returns 0.0 y = sinpi( 0.5 ); @@ -59,13 +59,12 @@ y = sinpi( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var sinpi = require( '@stdlib/math/base/special/sinpi' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const sinpi = require( '@stdlib/math/base/special/sinpi' ); -var x = linspace( -100.0, 100.0, 100 ); +const x = linspace( -100.0, 100.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( sinpi( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/spence/README.md b/lib/node_modules/@stdlib/math/base/special/spence/README.md index 0754ac094afd..465bb55d9cc3 100644 --- a/lib/node_modules/@stdlib/math/base/special/spence/README.md +++ b/lib/node_modules/@stdlib/math/base/special/spence/README.md @@ -63,7 +63,7 @@ or also alternatively as ## Usage ```javascript -var spence = require( '@stdlib/math/base/special/spence' ); +const spence = require( '@stdlib/math/base/special/spence' ); ``` #### spence( x ) @@ -71,7 +71,7 @@ var spence = require( '@stdlib/math/base/special/spence' ); Evaluates [Spence's function][spence], which is alternatively known as the dilogarithm. ```javascript -var v = spence( 3.0 ); +let v = spence( 3.0 ); // returns ~-1.437 v = spence( 0.0 ); @@ -84,7 +84,7 @@ v = spence( NaN ); For negative numbers, the dilogarithm is **not** defined. ```javascript -var v = spence( -4.0 ); +const v = spence( -4.0 ); // returns NaN ``` @@ -99,14 +99,11 @@ var v = spence( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var spence = require( '@stdlib/math/base/special/spence' ); +const randu = require( '@stdlib/random/base/randu' ); +const spence = require( '@stdlib/math/base/special/spence' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; console.log( 'spence( %d ) = %d', x, spence( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sqrt/README.md b/lib/node_modules/@stdlib/math/base/special/sqrt/README.md index 06476e374f99..52e14e32c4e4 100644 --- a/lib/node_modules/@stdlib/math/base/special/sqrt/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sqrt/README.md @@ -48,7 +48,7 @@ The principal [square root][square-root] is defined as ## Usage ```javascript -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); ``` #### sqrt( x ) @@ -56,7 +56,7 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' ); Computes the principal [square root][square-root] of a double-precision floating-point number. ```javascript -var v = sqrt( 4.0 ); +let v = sqrt( 4.0 ); // returns 2.0 v = sqrt( 9.0 ); @@ -72,7 +72,7 @@ v = sqrt( NaN ); For negative numbers, the principal [square root][square-root] is **not** defined. ```javascript -var v = sqrt( -4.0 ); +const v = sqrt( -4.0 ); // returns NaN ``` @@ -87,15 +87,12 @@ var v = sqrt( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'sqrt(%d) = %d', x, sqrt( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sqrt1pm1/README.md b/lib/node_modules/@stdlib/math/base/special/sqrt1pm1/README.md index 9a4ae2c3c447..d4af927f21ab 100644 --- a/lib/node_modules/@stdlib/math/base/special/sqrt1pm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sqrt1pm1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sqrt1pm1 = require( '@stdlib/math/base/special/sqrt1pm1' ); +const sqrt1pm1 = require( '@stdlib/math/base/special/sqrt1pm1' ); ``` #### sqrt1pm1( x ) @@ -35,7 +35,7 @@ var sqrt1pm1 = require( '@stdlib/math/base/special/sqrt1pm1' ); Computes `sqrt( 1 + x ) - 1` more accurately for small `x`. ```javascript -var v = sqrt1pm1( 3.0 ); +let v = sqrt1pm1( 3.0 ); // returns 1.0 v = sqrt1pm1( 0.5 ); @@ -65,15 +65,12 @@ v = sqrt1pm1( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var sqrt1pm1 = require( '@stdlib/math/base/special/sqrt1pm1' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const sqrt1pm1 = require( '@stdlib/math/base/special/sqrt1pm1' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'sqrt(1+%d) - 1 = %d', x, sqrt1pm1( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sqrtf/README.md b/lib/node_modules/@stdlib/math/base/special/sqrtf/README.md index f82a8f944c7c..59e9f40a00c8 100644 --- a/lib/node_modules/@stdlib/math/base/special/sqrtf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sqrtf/README.md @@ -48,7 +48,7 @@ The principal [square root][square-root] is defined as ## Usage ```javascript -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); ``` #### sqrtf( x ) @@ -56,7 +56,7 @@ var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); Computes the principal [square root][square-root] of a single-precision floating-point number. ```javascript -var v = sqrtf( 4.0 ); +let v = sqrtf( 4.0 ); // returns 2.0 v = sqrtf( 9.0 ); @@ -72,7 +72,7 @@ v = sqrtf( NaN ); For negative numbers, the principal [square root][square-root] is **not** defined. ```javascript -var v = sqrtf( -4.0 ); +const v = sqrtf( -4.0 ); // returns NaN ``` @@ -87,15 +87,12 @@ var v = sqrtf( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const sqrtf = require( '@stdlib/math/base/special/sqrtf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu() * 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu() * 100.0 ); console.log( 'sqrt(%d) = %d', x, sqrtf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/sqrtpi/README.md b/lib/node_modules/@stdlib/math/base/special/sqrtpi/README.md index 0d1604165dbd..d9150cf395da 100644 --- a/lib/node_modules/@stdlib/math/base/special/sqrtpi/README.md +++ b/lib/node_modules/@stdlib/math/base/special/sqrtpi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sqrtpi = require( '@stdlib/math/base/special/sqrtpi' ); +const sqrtpi = require( '@stdlib/math/base/special/sqrtpi' ); ``` #### sqrtpi( x ) @@ -35,7 +35,7 @@ var sqrtpi = require( '@stdlib/math/base/special/sqrtpi' ); Computes the principal [square root][@stdlib/math/base/special/sqrt] of the product of π and a positive double-precision floating-point number. ```javascript -var v = sqrtpi( 4.0 ); +let v = sqrtpi( 4.0 ); // returns ~3.5449 v = sqrtpi( 10.0 ); @@ -51,7 +51,7 @@ v = sqrtpi( NaN ); For negative numbers, the principal [square root][@stdlib/math/base/special/sqrt] is **not** defined. ```javascript -var v = sqrtpi( -4.0 ); +const v = sqrtpi( -4.0 ); // returns NaN ``` @@ -66,14 +66,11 @@ var v = sqrtpi( -4.0 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var sqrtpi = require( '@stdlib/math/base/special/sqrtpi' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const sqrtpi = require( '@stdlib/math/base/special/sqrtpi' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = discreteUniform( 0, 100 ); +for ( let i = 0; i < 100; i++ ) { + const x = discreteUniform( 0, 100 ); console.log( 'sqrtpi(%d) = %d', x, sqrtpi( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/tan/README.md b/lib/node_modules/@stdlib/math/base/special/tan/README.md index e90121d76a60..92e51b1c6f5f 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/README.md +++ b/lib/node_modules/@stdlib/math/base/special/tan/README.md @@ -48,7 +48,7 @@ The [tangent][tangent] is defined as ## Usage ```javascript -var tan = require( '@stdlib/math/base/special/tan' ); +const tan = require( '@stdlib/math/base/special/tan' ); ``` #### tan( x ) @@ -56,7 +56,7 @@ var tan = require( '@stdlib/math/base/special/tan' ); Evaluates the [tangent][tangent] of a `number` (in radians). ```javascript -var v = tan( 0.0 ); +let v = tan( 0.0 ); // returns ~0.0 v = tan( -3.141592653589793/4.0 ); @@ -80,14 +80,13 @@ v = tan( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var tan = require( '@stdlib/math/base/special/tan' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const tan = require( '@stdlib/math/base/special/tan' ); -var x = linspace( -PI/2.0, PI/2.0, 100 ); +const x = linspace( -PI/2.0, PI/2.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( tan( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/tand/README.md b/lib/node_modules/@stdlib/math/base/special/tand/README.md index 0496b6368330..ae97336ef794 100644 --- a/lib/node_modules/@stdlib/math/base/special/tand/README.md +++ b/lib/node_modules/@stdlib/math/base/special/tand/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var tand = require( '@stdlib/math/base/special/tand' ); +const tand = require( '@stdlib/math/base/special/tand' ); ``` #### tand( x ) @@ -39,7 +39,7 @@ var tand = require( '@stdlib/math/base/special/tand' ); Evaluates the [tangent][trigonometric-functions] of `x` (in degrees). ```javascript -var v = tand( 0.0 ); +let v = tand( 0.0 ); // returns 0 v = tand( 60.0 ); @@ -63,13 +63,12 @@ v = tand( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var tand = require( '@stdlib/math/base/special/tand' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const tand = require( '@stdlib/math/base/special/tand' ); -var x = linspace( -180, 180, 100 ); +const x = linspace( -180, 180, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( tand( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/README.md b/lib/node_modules/@stdlib/math/base/special/tanh/README.md index 4834dd031c75..ca561900eb93 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/README.md +++ b/lib/node_modules/@stdlib/math/base/special/tanh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tanh = require( '@stdlib/math/base/special/tanh' ); +const tanh = require( '@stdlib/math/base/special/tanh' ); ``` #### tanh( x ) @@ -35,7 +35,7 @@ var tanh = require( '@stdlib/math/base/special/tanh' ); Computes the [hyperbolic tangent][hyperbolic-tangent] of double-precision floating-point number `x`. ```javascript -var v = tanh( 0.0 ); +let v = tanh( 0.0 ); // returns 0.0 v = tanh( -0.0 ); @@ -62,13 +62,12 @@ v = tanh( NaN ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var tanh = require( '@stdlib/math/base/special/tanh' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const tanh = require( '@stdlib/math/base/special/tanh' ); -var x = linspace( -4.0, 4.0, 100 ); +const x = linspace( -4.0, 4.0, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( tanh( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/tribonacci/README.md b/lib/node_modules/@stdlib/math/base/special/tribonacci/README.md index b786cfff2511..69a5ec80aa78 100644 --- a/lib/node_modules/@stdlib/math/base/special/tribonacci/README.md +++ b/lib/node_modules/@stdlib/math/base/special/tribonacci/README.md @@ -65,7 +65,7 @@ with seed values `F_0 = 0`, `F_1 = 0`, and `F_2 = 1`. ## Usage ```javascript -var tribonacci = require( '@stdlib/math/base/special/tribonacci' ); +const tribonacci = require( '@stdlib/math/base/special/tribonacci' ); ``` #### tribonacci( n ) @@ -73,7 +73,7 @@ var tribonacci = require( '@stdlib/math/base/special/tribonacci' ); Computes the nth [Tribonacci number][tribonacci-number]. ```javascript -var v = tribonacci( 0 ); +let v = tribonacci( 0 ); // returns 0 v = tribonacci( 1 ); @@ -92,14 +92,14 @@ v = tribonacci( 63 ); If `n > 63`, the function returns `NaN`, as larger [Tribonacci numbers][tribonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. ```javascript -var v = tribonacci( 64 ); +const v = tribonacci( 64 ); // returns NaN ``` If not provided a nonnegative integer value, the function returns `NaN`. ```javascript -var v = tribonacci( 3.14 ); +let v = tribonacci( 3.14 ); // returns NaN v = tribonacci( -1 ); @@ -109,7 +109,7 @@ v = tribonacci( -1 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = tribonacci( NaN ); +const v = tribonacci( NaN ); // returns NaN ``` @@ -130,13 +130,10 @@ var v = tribonacci( NaN ); ```javascript -var tribonacci = require( '@stdlib/math/base/special/tribonacci' ); +const tribonacci = require( '@stdlib/math/base/special/tribonacci' ); -var v; -var i; - -for ( i = 0; i < 64; i++ ) { - v = tribonacci( i ); +for ( let i = 0; i < 64; i++ ) { + const v = tribonacci( i ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/trigamma/README.md b/lib/node_modules/@stdlib/math/base/special/trigamma/README.md index 28fa656fd773..b3be7da33dd4 100644 --- a/lib/node_modules/@stdlib/math/base/special/trigamma/README.md +++ b/lib/node_modules/@stdlib/math/base/special/trigamma/README.md @@ -48,7 +48,7 @@ The [trigamma function][trigamma-function] `ψ^(1)` is the derivative of the [di ## Usage ```javascript -var trigamma = require( '@stdlib/math/base/special/trigamma' ); +const trigamma = require( '@stdlib/math/base/special/trigamma' ); ``` #### trigamma( x ) @@ -56,7 +56,7 @@ var trigamma = require( '@stdlib/math/base/special/trigamma' ); Evaluates the [trigamma function][trigamma-function]. ```javascript -var v = trigamma( -2.5 ); +let v = trigamma( -2.5 ); // returns ~9.539 v = trigamma( 1.0 ); @@ -69,7 +69,7 @@ v = trigamma( 10.0 ); If `x` is `0` or a negative `integer`, the function returns `NaN`. ```javascript -var v = trigamma( 0.0 ); +let v = trigamma( 0.0 ); // returns NaN v = trigamma( -1.0 ); @@ -82,7 +82,7 @@ v = trigamma( -2.0 ); If provided `NaN`, the function returns `NaN`. ```javascript -var v = trigamma( NaN ); +const v = trigamma( NaN ); // returns NaN ``` @@ -97,16 +97,12 @@ var v = trigamma( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trigamma = require( '@stdlib/math/base/special/trigamma' ); +const randu = require( '@stdlib/random/base/randu' ); +const trigamma = require( '@stdlib/math/base/special/trigamma' ); -var x; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu()*100.0) - 50.0; - v = trigamma( x ); +for ( let i = 0; i < 10; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = trigamma( x ); console.log( 'x: %d, ψ^(1)(x): %d', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/trunc/README.md b/lib/node_modules/@stdlib/math/base/special/trunc/README.md index 4f3a42bdbd38..ac3d50d9632b 100644 --- a/lib/node_modules/@stdlib/math/base/special/trunc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/trunc/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var trunc = require( '@stdlib/math/base/special/trunc' ); +const trunc = require( '@stdlib/math/base/special/trunc' ); ``` #### trunc( x ) @@ -35,7 +35,7 @@ var trunc = require( '@stdlib/math/base/special/trunc' ); Rounds a double-precision floating-point number toward zero. ```javascript -var v = trunc( -4.2 ); +let v = trunc( -4.2 ); // returns -4.0 v = trunc( 9.99999 ); @@ -68,14 +68,11 @@ v = trunc( -Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trunc = require( '@stdlib/math/base/special/trunc' ); +const randu = require( '@stdlib/random/base/randu' ); +const trunc = require( '@stdlib/math/base/special/trunc' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'trunc(%d) = %d', x, trunc( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/trunc10/README.md b/lib/node_modules/@stdlib/math/base/special/trunc10/README.md index 34b488331e3f..9487cc4c5eaa 100644 --- a/lib/node_modules/@stdlib/math/base/special/trunc10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/trunc10/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var trunc10 = require( '@stdlib/math/base/special/trunc10' ); +const trunc10 = require( '@stdlib/math/base/special/trunc10' ); ``` #### trunc10( x ) @@ -35,7 +35,7 @@ var trunc10 = require( '@stdlib/math/base/special/trunc10' ); Rounds a `numeric` value to the nearest power of 10 toward zero. ```javascript -var v = trunc10( -4.2 ); +let v = trunc10( -4.2 ); // returns -1.0 v = trunc10( -4.5 ); @@ -83,7 +83,7 @@ v = trunc10( NaN ); - The function may not return accurate results for subnormals due to a general loss in precision. ```javascript - var v = trunc10( 1.0e-323 ); // should return 1.0e-323 + const v = trunc10( 1.0e-323 ); // should return 1.0e-323 // returns 0.0 ``` @@ -98,16 +98,12 @@ v = trunc10( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trunc10 = require( '@stdlib/math/base/special/trunc10' ); +const randu = require( '@stdlib/random/base/randu' ); +const trunc10 = require( '@stdlib/math/base/special/trunc10' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = trunc10( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = trunc10( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/trunc2/README.md b/lib/node_modules/@stdlib/math/base/special/trunc2/README.md index ba5376b762a2..ab243a762c06 100644 --- a/lib/node_modules/@stdlib/math/base/special/trunc2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/trunc2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var trunc2 = require( '@stdlib/math/base/special/trunc2' ); +const trunc2 = require( '@stdlib/math/base/special/trunc2' ); ``` #### trunc2( x ) @@ -35,7 +35,7 @@ var trunc2 = require( '@stdlib/math/base/special/trunc2' ); Rounds a `numeric` value to the nearest power of two toward zero. ```javascript -var v = trunc2( -4.2 ); +let v = trunc2( -4.2 ); // returns -4.0 v = trunc2( -4.5 ); @@ -83,16 +83,12 @@ v = trunc2( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trunc2 = require( '@stdlib/math/base/special/trunc2' ); +const randu = require( '@stdlib/random/base/randu' ); +const trunc2 = require( '@stdlib/math/base/special/trunc2' ); -var x; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - v = trunc2( x ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const v = trunc2( x ); console.log( 'Value: %d. Rounded: %d.', x, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/truncb/README.md b/lib/node_modules/@stdlib/math/base/special/truncb/README.md index cdb45e6105ae..3a1de9c1902b 100644 --- a/lib/node_modules/@stdlib/math/base/special/truncb/README.md +++ b/lib/node_modules/@stdlib/math/base/special/truncb/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncb = require( '@stdlib/math/base/special/truncb' ); +const truncb = require( '@stdlib/math/base/special/truncb' ); ``` #### truncb( x, n, b ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `b^n` toward zero. ```javascript // Round a value to 4 decimal places: -var v = truncb( 3.141592653589793, -4, 10 ); +let v = truncb( 3.141592653589793, -4, 10 ); // returns 3.1415 // If n = 0 or b = 1, `truncb` behaves like `trunc`: @@ -69,22 +69,16 @@ v = truncb( 5.0, 1, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var truncb = require( '@stdlib/math/base/special/truncb' ); - -var x; -var n; -var b; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = round( (randu()*10.0) - 5.0 ); - b = round( randu()*10.0 ); - v = truncb( x, n, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const truncb = require( '@stdlib/math/base/special/truncb' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = round( (randu()*10.0) - 5.0 ); + const b = round( randu()*10.0 ); + const v = truncb( x, n, b ); console.log( 'x: %d. %d^%d: %d. Rounded: %d.', x, b, n, pow( b, n ), v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/truncf/README.md b/lib/node_modules/@stdlib/math/base/special/truncf/README.md index b6dbef1a4cb4..9ef2f63c70c1 100644 --- a/lib/node_modules/@stdlib/math/base/special/truncf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/truncf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncf = require( '@stdlib/math/base/special/truncf' ); +const truncf = require( '@stdlib/math/base/special/truncf' ); ``` #### truncf( x ) @@ -35,7 +35,7 @@ var truncf = require( '@stdlib/math/base/special/truncf' ); Rounds a single-precision floating-point number toward zero. ```javascript -var v = truncf( -4.2 ); +let v = truncf( -4.2 ); // returns -4.0 v = truncf( 9.99999 ); @@ -68,14 +68,11 @@ v = truncf( -Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var truncf = require( '@stdlib/math/base/special/truncf' ); +const randu = require( '@stdlib/random/base/randu' ); +const truncf = require( '@stdlib/math/base/special/truncf' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; console.log( 'trunc(%d) = %d', x, truncf( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/truncn/README.md b/lib/node_modules/@stdlib/math/base/special/truncn/README.md index 04e960cf0457..db373d180b66 100644 --- a/lib/node_modules/@stdlib/math/base/special/truncn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/truncn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncn = require( '@stdlib/math/base/special/truncn' ); +const truncn = require( '@stdlib/math/base/special/truncn' ); ``` #### truncn( x, n ) @@ -36,7 +36,7 @@ Rounds a `numeric` value to the nearest multiple of `10^n` toward zero. ```javascript // Round a value to 4 decimal places: -var v = truncn( 3.141592653589793, -4 ); +let v = truncn( 3.141592653589793, -4 ); // returns 3.1415 // If n = 0, `truncn` behaves like `trunc`: @@ -69,18 +69,13 @@ v = truncn( 12368.0, 3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var truncn = require( '@stdlib/math/base/special/truncn' ); - -var x; -var n; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - n = truncn( randu()*5.0, 0 ); - v = truncn( x, -n ); +const randu = require( '@stdlib/random/base/randu' ); +const truncn = require( '@stdlib/math/base/special/truncn' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + const n = truncn( randu()*5.0, 0 ); + const v = truncn( x, -n ); console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/truncsd/README.md b/lib/node_modules/@stdlib/math/base/special/truncsd/README.md index 9f372e073570..bd8c245540d6 100644 --- a/lib/node_modules/@stdlib/math/base/special/truncsd/README.md +++ b/lib/node_modules/@stdlib/math/base/special/truncsd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncsd = require( '@stdlib/math/base/special/truncsd' ); +const truncsd = require( '@stdlib/math/base/special/truncsd' ); ``` #### truncsd( x, n, b ) @@ -35,7 +35,7 @@ var truncsd = require( '@stdlib/math/base/special/truncsd' ); Rounds a `numeric` value to the nearest `number` toward zero with `n` significant figures. ```javascript -var v = truncsd( 3.141592653589793, 5, 10 ); +let v = truncsd( 3.141592653589793, 5, 10 ); // returns 3.1415 v = truncsd( 3.141592653589793, 1, 10 ); @@ -65,16 +65,12 @@ v = truncsd( 0.0313, 2, 2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var truncsd = require( '@stdlib/math/base/special/truncsd' ); +const randu = require( '@stdlib/random/base/randu' ); +const truncsd = require( '@stdlib/math/base/special/truncsd' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*10000.0) - 5000.0; - y = truncsd( x, 5, 10 ); +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*10000.0) - 5000.0; + const y = truncsd( x, 5, 10 ); console.log( 'x: %d. Rounded: %d.', x, y ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/README.md b/lib/node_modules/@stdlib/math/base/special/vercos/README.md index 4513ae9d5db9..f0af4d80fcbc 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/README.md +++ b/lib/node_modules/@stdlib/math/base/special/vercos/README.md @@ -48,7 +48,7 @@ The [versed cosine][versed-cosine] is defined as ## Usage ```javascript -var vercos = require( '@stdlib/math/base/special/vercos' ); +const vercos = require( '@stdlib/math/base/special/vercos' ); ``` #### vercos( x ) @@ -56,7 +56,7 @@ var vercos = require( '@stdlib/math/base/special/vercos' ); Computes the [versed cosine][versed-cosine] of a `number` (in radians). ```javascript -var v = vercos( 0.0 ); +let v = vercos( 0.0 ); // returns 2.0 v = vercos( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = vercos( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var vercos = require( '@stdlib/math/base/special/vercos' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const vercos = require( '@stdlib/math/base/special/vercos' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( vercos( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/versin/README.md b/lib/node_modules/@stdlib/math/base/special/versin/README.md index eda8c5d75290..adb456e08b97 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/README.md +++ b/lib/node_modules/@stdlib/math/base/special/versin/README.md @@ -48,7 +48,7 @@ The [versed sine][versed-sine] is defined as ## Usage ```javascript -var versin = require( '@stdlib/math/base/special/versin' ); +const versin = require( '@stdlib/math/base/special/versin' ); ``` #### versin( x ) @@ -56,7 +56,7 @@ var versin = require( '@stdlib/math/base/special/versin' ); Computes the [versed sine][versed-sine] of a `number` (in radians). ```javascript -var v = versin( 0.0 ); +let v = versin( 0.0 ); // returns 0.0 v = versin( 3.141592653589793/2.0 ); @@ -77,14 +77,13 @@ v = versin( -3.141592653589793/6.0 ); ```javascript -var linspace = require( '@stdlib/array/base/linspace' ); -var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); -var versin = require( '@stdlib/math/base/special/versin' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +const versin = require( '@stdlib/math/base/special/versin' ); -var x = linspace( 0.0, TWO_PI, 100 ); +const x = linspace( 0.0, TWO_PI, 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( versin( x[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/wrap/README.md b/lib/node_modules/@stdlib/math/base/special/wrap/README.md index 668ff8d7704f..7cd0216fd919 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/README.md +++ b/lib/node_modules/@stdlib/math/base/special/wrap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var wrap = require( '@stdlib/math/base/special/wrap' ); +const wrap = require( '@stdlib/math/base/special/wrap' ); ``` #### wrap( v, min, max ) @@ -45,7 +45,7 @@ var wrap = require( '@stdlib/math/base/special/wrap' ); Wraps a value on the half-open interval `[min,max)`. ```javascript -var v = wrap( 3.14, 0.0, 5.0 ); +let v = wrap( 3.14, 0.0, 5.0 ); // returns 3.14 v = wrap( -3.14, 0.0, 5.0 ); @@ -64,7 +64,7 @@ v = wrap( 0.0, -3.14, -0.0 ); If provided `NaN` for any argument, the function returns `NaN`. ```javascript -var v = wrap( NaN, 0.0, 5.0 ); +let v = wrap( NaN, 0.0, 5.0 ); // returns NaN v = wrap( 0.0, NaN, 5.0 ); @@ -77,7 +77,7 @@ v = wrap( 3.14, 0.0, NaN ); If provided `min == max`, the function returns `NaN`. ```javascript -var v = wrap( 3.14, 3.0, 3.0 ); +const v = wrap( 3.14, 3.0, 3.0 ); // returns NaN ``` @@ -106,18 +106,13 @@ var v = wrap( 3.14, 3.0, 3.0 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var wrap = require( '@stdlib/math/base/special/wrap' ); - -var min; -var max; -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - min = discreteUniform( 0.0, 10.0 ); - max = discreteUniform( 5.0, 15.0 ); - v = discreteUniform( -20.0, 20.0 ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const wrap = require( '@stdlib/math/base/special/wrap' ); + +for ( let i = 0; i < 100; i++ ) { + const min = discreteUniform( 0.0, 10.0 ); + const max = discreteUniform( 5.0, 15.0 ); + const v = discreteUniform( -20.0, 20.0 ); console.log( 'wrap(%d,%d,%d) => %d', v, min, max, wrap( v, min, max ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/README.md b/lib/node_modules/@stdlib/math/base/special/xlog1py/README.md index af3e7619da3f..e5119e3f06db 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/README.md +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var xlog1py = require( '@stdlib/math/base/special/xlog1py' ); +const xlog1py = require( '@stdlib/math/base/special/xlog1py' ); ``` #### xlog1py( x, y ) @@ -35,7 +35,7 @@ var xlog1py = require( '@stdlib/math/base/special/xlog1py' ); Computes `x * ln(y+1)` so that the result is `0` if `x = 0`. ```javascript -var out = xlog1py( 3.0, 2.0 ); +let out = xlog1py( 3.0, 2.0 ); // returns ~3.296 out = xlog1py( 1.5, 5.9 ); @@ -71,19 +71,15 @@ out = xlog1py( NaN, 2.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var xlog1py = require( '@stdlib/math/base/special/xlog1py' ); +const randu = require( '@stdlib/random/base/randu' ); +const xlog1py = require( '@stdlib/math/base/special/xlog1py' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu(); +for ( let i = 0; i < 100; i++ ) { + let x = randu(); if ( x < 0.5 ) { x = 0.0; } - y = ( randu() * 20.0 ) - 5.0; + const y = ( randu() * 20.0 ) - 5.0; console.log( 'xlog1py(%d, %d) = %d', x, y, xlog1py( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/README.md b/lib/node_modules/@stdlib/math/base/special/xlogy/README.md index 6347709a290c..10628c376d1b 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/README.md +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var xlogy = require( '@stdlib/math/base/special/xlogy' ); +const xlogy = require( '@stdlib/math/base/special/xlogy' ); ``` #### xlogy( x, y ) @@ -35,7 +35,7 @@ var xlogy = require( '@stdlib/math/base/special/xlogy' ); Computes `x * ln(y)` so that the result is `0` if `x = 0`. ```javascript -var out = xlogy( 3.0, 2.0 ); +let out = xlogy( 3.0, 2.0 ); // returns ~2.079 out = xlogy( 1.5, 5.9 ); @@ -68,19 +68,15 @@ out = xlogy( NaN, 2.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var xlogy = require( '@stdlib/math/base/special/xlogy' ); +const randu = require( '@stdlib/random/base/randu' ); +const xlogy = require( '@stdlib/math/base/special/xlogy' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu(); +for ( let i = 0; i < 100; i++ ) { + let x = randu(); if ( x < 0.5 ) { x = 0.0; } - y = ( randu() * 20.0 ) - 5.0; + const y = ( randu() * 20.0 ) - 5.0; console.log( 'xlogy(%d, %d) = %d', x, y, xlogy( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/xlogyf/README.md b/lib/node_modules/@stdlib/math/base/special/xlogyf/README.md index b905abe83725..d3520012ba03 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogyf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/xlogyf/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var xlogyf = require( '@stdlib/math/base/special/xlogyf' ); +const xlogyf = require( '@stdlib/math/base/special/xlogyf' ); ``` #### xlogyf( x, y ) @@ -35,7 +35,7 @@ var xlogyf = require( '@stdlib/math/base/special/xlogyf' ); Computes `x * ln(y)` so that the result is `0` if `x = 0` for single-precision floating-point numbers `x` and `y`. ```javascript -var out = xlogyf( 3.0, 2.0 ); +let out = xlogyf( 3.0, 2.0 ); // returns ~2.079 out = xlogyf( 1.5, 5.9 ); @@ -68,19 +68,15 @@ out = xlogyf( NaN, 2.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var xlogyf = require( '@stdlib/math/base/special/xlogyf' ); +const randu = require( '@stdlib/random/base/randu' ); +const xlogyf = require( '@stdlib/math/base/special/xlogyf' ); -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu(); +for ( let i = 0; i < 100; i++ ) { + let x = randu(); if ( x < 0.5 ) { x = 0.0; } - y = ( randu() * 20.0 ) - 5.0; + const y = ( randu() * 20.0 ) - 5.0; console.log( 'xlogyf(%d, %d) = %d', x, y, xlogyf( x, y ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/README.md b/lib/node_modules/@stdlib/math/base/tools/README.md index 12a61e415931..34112f98091e 100644 --- a/lib/node_modules/@stdlib/math/base/tools/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tools = require( '@stdlib/math/base/tools' ); +const tools = require( '@stdlib/math/base/tools' ); ``` #### tools @@ -35,7 +35,7 @@ var tools = require( '@stdlib/math/base/tools' ); Namespace containing "base" math tools. ```javascript -var o = tools; +const o = tools; // returns {...} ``` @@ -71,8 +71,8 @@ var o = tools; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var tools = require( '@stdlib/math/base/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const tools = require( '@stdlib/math/base/tools' ); console.log( objectKeys( tools ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/continued-fraction/README.md b/lib/node_modules/@stdlib/math/base/tools/continued-fraction/README.md index 7004a97c9ca2..5dbd195267ec 100644 --- a/lib/node_modules/@stdlib/math/base/tools/continued-fraction/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/continued-fraction/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' ); +const continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' ); ``` #### continuedFraction( generator\[, options ] ) @@ -53,12 +53,12 @@ Using an ES6 [Generator object][es6-generator]: ```javascript // Continued fraction for (e-1)^(-1): -var gen = generator(); -var out = continuedFraction( gen ); +const gen = generator(); +const out = continuedFraction( gen ); // returns ~0.582 function* generator() { - var i = 0; + let i = 0; while ( true ) { i += 1; yield [ i, i ]; @@ -70,12 +70,12 @@ Alternatively, one can use a closure to achieve the same goal: ```javascript // Continued fraction for (e-1)^(-1): -var gen = generator(); -var out = continuedFraction( gen ); +const gen = generator(); +const out = continuedFraction( gen ); // returns ~0.582 function generator() { - var i = 0; + let i = 0; return gen; function gen() { @@ -109,13 +109,13 @@ b_0 + \frac{a_1}{b_1+\frac{a_2}{b_2+\frac{a_3}{b_3+\frac{a_4}{b_4}+\ldots}}} set the `keep` option to `true`. ```javascript -var out = continuedFraction( generator(), { +const out = continuedFraction( generator(), { 'keep': true }); // returns ~1.718 function generator() { - var i = 0; + let i = 0; return gen; function gen() { @@ -128,13 +128,13 @@ function generator() { To change the maximum number of iterations, set the `maxIter` option. ```javascript -var out = continuedFraction( generator(), { +const out = continuedFraction( generator(), { 'maxIter': 10 }); // returns ~0.582 function generator() { - var i = 0; + let i = 0; return gen; function gen() { @@ -147,13 +147,13 @@ function generator() { The default tolerance of `2.22e-16` to assess convergence can be changed via the `tolerance` option. ```javascript -var out = continuedFraction( generator(), { +const out = continuedFraction( generator(), { 'tolerance': 1e-1 }); // returns ~0.579 function generator() { - var i = 0; + let i = 0; return gen; function gen() { @@ -176,8 +176,7 @@ function generator() { ```javascript -var continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' ); -var out; +const continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' ); function* generator() { while ( true ) { @@ -186,7 +185,7 @@ function* generator() { } function closure() { - var ones = [ 1, 1 ]; + const ones = [ 1, 1 ]; return gen; function gen() { @@ -194,7 +193,7 @@ function closure() { } } -out = continuedFraction( generator(), { +let out = continuedFraction( generator(), { 'keep': true }); console.log( 'Golden ratio (generator): %d,', out ); diff --git a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile-c/README.md b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile-c/README.md index 38064341f80f..e7e8e452d518 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile-c/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile-c/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var compile = require( '@stdlib/math/base/tools/evalpoly-compile-c' ); +const compile = require( '@stdlib/math/base/tools/evalpoly-compile-c' ); ``` #### compile( c\[, options] ) @@ -41,7 +41,7 @@ var compile = require( '@stdlib/math/base/tools/evalpoly-compile-c' ); Compiles a C function for evaluating a [polynomial][@stdlib/math/base/tools/evalpoly] having coefficients `c`. ```javascript -var str = compile( [ 3.0, 2.0, 1.0 ] ); +const str = compile( [ 3.0, 2.0, 1.0 ] ); // returns ``` @@ -73,11 +73,11 @@ static double evalpoly( const double x ) { To generate a function having a custom name and supporting single-precision floating-point numbers, provide the corresponding options. ```javascript -var opts = { +const opts = { 'dtype': 'float', 'name': 'polyval123' }; -var str = compile( [ 3.0, 2.0, 1.0 ], opts ); +const str = compile( [ 3.0, 2.0, 1.0 ], opts ); // returns ``` @@ -123,14 +123,14 @@ static float polyval123( const float x ) { ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var compile = require( '@stdlib/math/base/tools/evalpoly-compile-c' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const compile = require( '@stdlib/math/base/tools/evalpoly-compile-c' ); // Create an array of random coefficients: -var coef = discreteUniform( 10, -100, 100 ); +const coef = discreteUniform( 10, -100, 100 ); // Compile a function for evaluating a polynomial: -var str = compile( coef ); +const str = compile( coef ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/README.md b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/README.md index 3241616b5486..a1c512ce0afe 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var compile = require( '@stdlib/math/base/tools/evalpoly-compile' ); +const compile = require( '@stdlib/math/base/tools/evalpoly-compile' ); ``` #### compile( c\[, options] ) @@ -41,7 +41,7 @@ var compile = require( '@stdlib/math/base/tools/evalpoly-compile' ); Compiles a module string containing an exported function which evaluates a [polynomial][@stdlib/math/base/tools/evalpoly] having coefficients `c`. ```javascript -var str = compile( [ 3.0, 2.0, 1.0 ] ); +const str = compile( [ 3.0, 2.0, 1.0 ] ); // returns ``` @@ -89,7 +89,7 @@ The coefficients should be ordered in **ascending** degree, thus matching summat By default, the function assumes double-precision floating-point arithmetic. To emulate single-precision floating-point arithmetic, set the `dtype` option to `'float32'`. ```javascript -var str = compile( [ 3.0, 2.0, 1.0 ], { +const str = compile( [ 3.0, 2.0, 1.0 ], { 'dtype': 'float32' }); // returns @@ -104,7 +104,7 @@ In the previous example, the output string would correspond to the following mod // MODULES // -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // @@ -156,14 +156,14 @@ module.exports = evalpoly; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var compile = require( '@stdlib/math/base/tools/evalpoly-compile' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const compile = require( '@stdlib/math/base/tools/evalpoly-compile' ); // Create an array of random coefficients: -var coef = discreteUniform( 10, -100, 100 ); +const coef = discreteUniform( 10, -100, 100 ); // Compile a module for evaluating a polynomial: -var str = compile( coef ); +const str = compile( coef ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalpoly/README.md b/lib/node_modules/@stdlib/math/base/tools/evalpoly/README.md index c69bdfafb4ff..e224fdd41a78 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalpoly/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalpoly/README.md @@ -50,7 +50,7 @@ where `c_n, c_{n-1}, ..., c_0` are constants. ## Usage ```javascript -var evalpoly = require( '@stdlib/math/base/tools/evalpoly' ); +const evalpoly = require( '@stdlib/math/base/tools/evalpoly' ); ``` #### evalpoly( c, x ) @@ -58,7 +58,7 @@ var evalpoly = require( '@stdlib/math/base/tools/evalpoly' ); Evaluates a [polynomial][polynomial] having coefficients `c` and degree `n` at a value `x`, where `n = c.length-1`. ```javascript -var v = evalpoly( [ 3.0, 2.0, 1.0 ], 10 ); // => 3*10^0 + 2*10^1 + 1*10^2 +const v = evalpoly( [ 3.0, 2.0, 1.0 ], 10 ); // => 3*10^0 + 2*10^1 + 1*10^2 // returns 123.0 ``` @@ -69,9 +69,9 @@ The coefficients should be ordered in **ascending** degree, thus matching summat Uses code generation to in-line coefficients and return a function for evaluating a [polynomial][polynomial] using double-precision floating-point arithmetic. ```javascript -var polyval = evalpoly.factory( [ 3.0, 2.0, 1.0 ] ); +const polyval = evalpoly.factory( [ 3.0, 2.0, 1.0 ] ); -var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 +let v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 // returns 123.0 v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2 @@ -100,25 +100,23 @@ v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2 ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var evalpoly = require( '@stdlib/math/base/tools/evalpoly' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const evalpoly = require( '@stdlib/math/base/tools/evalpoly' ); // Create an array of random coefficients: -var coef = discreteUniform( 10, -100, 100 ); +const coef = discreteUniform( 10, -100, 100 ); // Evaluate the polynomial at random values: -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = uniform( 0.0, 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( 0.0, 100.0 ); console.log( 'f(%d) = %d', v, evalpoly( coef, v ) ); } // Generate an `evalpoly` function: -var polyval = evalpoly.factory( coef ); -for ( i = 0; i < 100; i++ ) { - v = uniform( -50.0, 50.0 ); +const polyval = evalpoly.factory( coef ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( -50.0, 50.0 ); console.log( 'f(%d) = %d', v, polyval( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalpolyf/README.md b/lib/node_modules/@stdlib/math/base/tools/evalpolyf/README.md index d9213f55a42e..b5d33aa3eefb 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalpolyf/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalpolyf/README.md @@ -50,7 +50,7 @@ where `c_n, c_{n-1}, ..., c_0` are constants. ## Usage ```javascript -var evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' ); +const evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' ); ``` #### evalpolyf( c, x ) @@ -58,9 +58,9 @@ var evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' ); Evaluates a [polynomial][polynomial] having coefficients `c` and degree `n` at a value `x`, where `n = c.length-1`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var v = evalpolyf( new Float32Array( [ 3.0, 2.0, 1.0 ] ), 10 ); // => 3*10^0 + 2*10^1 + 1*10^2 +const v = evalpolyf( new Float32Array( [ 3.0, 2.0, 1.0 ] ), 10 ); // => 3*10^0 + 2*10^1 + 1*10^2 // returns 123.0 ``` @@ -71,11 +71,11 @@ The coefficients should be ordered in **ascending** degree, thus matching summat Uses code generation to in-line coefficients and return a function for evaluating a [polynomial][polynomial] using single-precision floating-point arithmetic. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var polyval = evalpolyf.factory( new Float32Array( [ 3.0, 2.0, 1.0 ] ) ); +const polyval = evalpolyf.factory( new Float32Array( [ 3.0, 2.0, 1.0 ] ) ); -var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 +let v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 // returns 123.0 v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2 @@ -104,26 +104,24 @@ v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2 ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' ); // Create an array of random coefficients: -var coef = discreteUniform( 10, -100, 100, { +const coef = discreteUniform( 10, -100, 100, { 'dtype': 'float32' }); // Evaluate the polynomial at random values: -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = uniform( 0.0, 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( 0.0, 100.0 ); console.log( 'f(%d) = %d', v, evalpolyf( coef, v ) ); } // Generate an `evalpolyf` function: -var polyval = evalpolyf.factory( coef ); -for ( i = 0; i < 100; i++ ) { +const polyval = evalpolyf.factory( coef ); +for ( let i = 0; i < 100; i++ ) { v = uniform( -50.0, 50.0 ); console.log( 'f(%d) = %d', v, polyval( v ) ); } diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrational-compile-c/README.md b/lib/node_modules/@stdlib/math/base/tools/evalrational-compile-c/README.md index 25b41da9b56e..9bfd62f2615e 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrational-compile-c/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalrational-compile-c/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var compile = require( '@stdlib/math/base/tools/evalrational-compile-c' ); +const compile = require( '@stdlib/math/base/tools/evalrational-compile-c' ); ``` #### compile( P, Q ) @@ -41,10 +41,10 @@ var compile = require( '@stdlib/math/base/tools/evalrational-compile-c' ); Compiles a C function for evaluating a [rational function][@stdlib/math/base/tools/evalrational] having coefficients `P` and `Q`. ```javascript -var P = [ 3.0, 2.0, 1.0 ]; -var Q = [ -1.0, -2.0, -3.0 ]; +const P = [ 3.0, 2.0, 1.0 ]; +const Q = [ -1.0, -2.0, -3.0 ]; -var str = compile( P, Q ); +const str = compile( P, Q ); // returns ``` @@ -97,14 +97,14 @@ static double evalrational( const double x ) { To generate a function having a custom name and supporting single-precision floating-point numbers, provide the corresponding options. ```javascript -var P = [ 3.0, 2.0, 1.0 ]; -var Q = [ -1.0, -2.0, -3.0 ]; +const P = [ 3.0, 2.0, 1.0 ]; +const Q = [ -1.0, -2.0, -3.0 ]; -var opts = { +const opts = { 'dtype': 'float', 'name': 'rational123' }; -var str = compile( P, Q, opts ); +const str = compile( P, Q, opts ); // returns ``` @@ -171,21 +171,16 @@ static float rational123( const float x ) { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var compile = require( '@stdlib/math/base/tools/evalrational-compile-c' ); - -var sign; -var str; -var P; -var Q; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const compile = require( '@stdlib/math/base/tools/evalrational-compile-c' ); // Create two arrays of random coefficients... -P = new Float64Array( 10 ); -Q = new Float64Array( 10 ); -for ( i = 0; i < P.length; i++ ) { +const P = new Float64Array( 10 ); +const Q = new Float64Array( 10 ); +for ( let i = 0; i < P.length; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { @@ -196,7 +191,7 @@ for ( i = 0; i < P.length; i++ ) { } // Compile a function for evaluating a rational function: -str = compile( P, Q ); +const str = compile( P, Q ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrational-compile/README.md b/lib/node_modules/@stdlib/math/base/tools/evalrational-compile/README.md index a2d54b9c7eb5..e78066860d98 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrational-compile/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalrational-compile/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var compile = require( '@stdlib/math/base/tools/evalrational-compile' ); +const compile = require( '@stdlib/math/base/tools/evalrational-compile' ); ``` #### compile( P, Q\[, options] ) @@ -41,10 +41,10 @@ var compile = require( '@stdlib/math/base/tools/evalrational-compile' ); Compiles a module string containing an exported function which evaluates a [rational function][@stdlib/math/base/tools/evalrational] having coefficients `P` and `Q`. ```javascript -var P = [ 3.0, 2.0, 1.0 ]; -var Q = [ -1.0, -2.0, -3.0 ]; +const P = [ 3.0, 2.0, 1.0 ]; +const Q = [ -1.0, -2.0, -3.0 ]; -var str = compile( P, Q ); +const str = compile( P, Q ); // returns ``` @@ -76,9 +76,9 @@ In the example above, the output string would correspond to the following module * @returns {number} evaluated rational function */ function evalrational( x ) { - var ax; - var s1; - var s2; + let ax; + let s1; + let s2; if ( x === 0.0 ) { return -3.0; } @@ -109,10 +109,10 @@ The coefficients should be ordered in **ascending** degree, thus matching summat By default, the function assumes double-precision floating-point arithmetic. To emulate single-precision floating-point arithmetic, set the `dtype` option to `'float32'`. ```javascript -var P = [ 3.0, 2.0, 1.0 ]; -var Q = [ -1.0, -2.0, -3.0 ]; +const P = [ 3.0, 2.0, 1.0 ]; +const Q = [ -1.0, -2.0, -3.0 ]; -var str = compile( P, Q, { +const str = compile( P, Q, { 'dtype': 'float32' }); // returns @@ -127,7 +127,7 @@ In the previous example, the output string would correspond to the following mod // MODULES // -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // @@ -147,9 +147,9 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); * @returns {number} evaluated rational function */ function evalrational( x ) { - var ax; - var s1; - var s2; + let ax; + let s1; + let s2; if ( x === 0.0 ) { return -3.0; } @@ -196,15 +196,15 @@ module.exports = evalrational; ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var compile = require( '@stdlib/math/base/tools/evalrational-compile' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const compile = require( '@stdlib/math/base/tools/evalrational-compile' ); // Create arrays of random coefficients: -var P = discreteUniform( 10, -100, 100 ); -var Q = discreteUniform( 10, -100, 100 ); +const P = discreteUniform( 10, -100, 100 ); +const Q = discreteUniform( 10, -100, 100 ); // Compile a module for evaluating a rational function: -var str = compile( P, Q ); +const str = compile( P, Q ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrational/README.md b/lib/node_modules/@stdlib/math/base/tools/evalrational/README.md index 4b766231dddd..b079b4d7db52 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrational/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalrational/README.md @@ -65,7 +65,7 @@ where `c_n, c_{n-1}, ..., c_0` are constants. ## Usage ```javascript -var evalrational = require( '@stdlib/math/base/tools/evalrational' ); +const evalrational = require( '@stdlib/math/base/tools/evalrational' ); ``` #### evalrational( P, Q, x ) @@ -73,10 +73,10 @@ var evalrational = require( '@stdlib/math/base/tools/evalrational' ); Evaluates a [rational function][rational-function] at a value `x` using double-precision floating-point arithmetic. ```javascript -var P = [ -6.0, -5.0 ]; -var Q = [ 3.0, 0.5 ]; +const P = [ -6.0, -5.0 ]; +const Q = [ 3.0, 0.5 ]; -var v = evalrational( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 ) / ( 3*6^0 + 0.5*6^1 ) = (-6-30)/(3+3) +const v = evalrational( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 ) / ( 3*6^0 + 0.5*6^1 ) = (-6-30)/(3+3) // returns -6.0 ``` @@ -84,12 +84,12 @@ For polynomials of different degree, the coefficient array for the lower degree ```javascript // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 4 -var P = [ -6.0, -5.0, 4.0, 2.0 ]; +const P = [ -6.0, -5.0, 4.0, 2.0 ]; // 0.5x^1 + 3x^0 => degree 2 -var Q = [ 3.0, 0.5, 0.0, 0.0 ]; // zero-padded +const Q = [ 3.0, 0.5, 0.0, 0.0 ]; // zero-padded -var v = evalrational( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) +const v = evalrational( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) // returns 90.0 ``` @@ -100,12 +100,12 @@ Coefficients should be ordered in **ascending** degree, thus matching summation Uses code generation to in-line coefficients and return a function for evaluating a [rational function][rational-function] using double-precision floating-point arithmetic. ```javascript -var P = [ 20.0, 8.0, 3.0 ]; -var Q = [ 10.0, 9.0, 1.0 ]; +const P = [ 20.0, 8.0, 3.0 ]; +const Q = [ 10.0, 9.0, 1.0 ]; -var rational = evalrational.factory( P, Q ); +const rational = evalrational.factory( P, Q ); -var v = rational( 10.0 ); // => (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2) = (20+80+300)/(10+90+100) +let v = rational( 10.0 ); // => (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2) = (20+80+300)/(10+90+100) // returns 2.0 v = rational( 2.0 ); // => (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2) = (20+16+12)/(10+18+4) @@ -134,26 +134,24 @@ v = rational( 2.0 ); // => (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2) = ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var evalrational = require( '@stdlib/math/base/tools/evalrational' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const evalrational = require( '@stdlib/math/base/tools/evalrational' ); // Create two arrays of random coefficients... -var P = discreteUniform( 10, -100, 100 ); -var Q = discreteUniform( 10, -100, 100 ); +const P = discreteUniform( 10, -100, 100 ); +const Q = discreteUniform( 10, -100, 100 ); // Evaluate the rational function at random values... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = uniform( 0.0, 100.0 ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( 0.0, 100.0 ); console.log( 'f(%d) = %d', v, evalrational( P, Q, v ) ); } // Generate an `evalrational` function... -var rational = evalrational.factory( P, Q ); -for ( i = 0; i < 100; i++ ) { - v = uniform( -50.0, 50.0 ); +const rational = evalrational.factory( P, Q ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( -50.0, 50.0 ); console.log( 'f(%d) = %d', v, rational( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/evalrationalf/README.md b/lib/node_modules/@stdlib/math/base/tools/evalrationalf/README.md index b8ca774b01f3..974b39a33ca6 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalrationalf/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/evalrationalf/README.md @@ -65,7 +65,7 @@ where `c_n, c_{n-1}, ..., c_0` are constants. ## Usage ```javascript -var evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' ); +const evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' ); ``` #### evalrationalf( P, Q, x ) @@ -73,27 +73,27 @@ var evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' ); Evaluates a [rational function][rational-function] at a value `x` using single-precision floating-point arithmetic. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var P = new Float32Array( [ -6.0, -5.0 ] ); -var Q = new Float32Array( [ 3.0, 0.5 ] ); +const P = new Float32Array( [ -6.0, -5.0 ] ); +const Q = new Float32Array( [ 3.0, 0.5 ] ); -var v = evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 ) / ( 3*6^0 + 0.5*6^1 ) = (-6-30)/(3+3) +const v = evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 ) / ( 3*6^0 + 0.5*6^1 ) = (-6-30)/(3+3) // returns -6.0 ``` For polynomials of different degree, the coefficient array for the lower degree [polynomial][polynomial] should be padded with zeros. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // 2x^3 + 4x^2 - 5x^1 - 6x^0 => degree 4 -var P = new Float32Array( [ -6.0, -5.0, 4.0, 2.0 ] ); +const P = new Float32Array( [ -6.0, -5.0, 4.0, 2.0 ] ); // 0.5x^1 + 3x^0 => degree 2 -var Q = new Float32Array( [ 3.0, 0.5, 0.0, 0.0 ] ); // zero-padded +const Q = new Float32Array( [ 3.0, 0.5, 0.0, 0.0 ] ); // zero-padded -var v = evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) +const v = evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 + 4*6^2 + 2*6^3 ) / ( 3*6^0 + 0.5*6^1 + 0*6^2 + 0*6^3 ) = (-6-30+144+432)/(3+3) // returns ~90.0 ``` @@ -104,14 +104,14 @@ Coefficients should be ordered in **ascending** degree, thus matching summation Uses code generation to in-line coefficients and return a function for evaluating a [rational function][rational-function] using single-precision floating-point arithmetic. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var P = new Float32Array( [ 20.0, 8.0, 3.0 ] ); -var Q = new Float32Array( [ 10.0, 9.0, 1.0 ] ); +const P = new Float32Array( [ 20.0, 8.0, 3.0 ] ); +const Q = new Float32Array( [ 10.0, 9.0, 1.0 ] ); -var rational = evalrationalf.factory( P, Q ); +const rational = evalrationalf.factory( P, Q ); -var v = rational( 10.0 ); // => (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2) = (20+80+300)/(10+90+100) +let v = rational( 10.0 ); // => (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2) = (20+80+300)/(10+90+100) // returns 2.0 v = rational( 2.0 ); // => (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2) = (20+16+12)/(10+18+4) @@ -140,29 +140,26 @@ v = rational( 2.0 ); // => (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2) = ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' ); // Create two arrays of random coefficients... -var opts = { +const opts = { 'dtype': 'float32' }; -var P = discreteUniform( 10, -100, 100, opts ); -var Q = discreteUniform( 10, -100, 100, opts ); - -// Evaluate the rational function at random values... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = uniform( 0.0, 100.0 ); +const P = discreteUniform( 10, -100, 100, opts ); +const Q = discreteUniform( 10, -100, 100, opts ); + +for ( let i = 0; i < 100; i++ ) { + const v = uniform( 0.0, 100.0 ); console.log( 'f(%d) = %d', v, evalrationalf( P, Q, v ) ); } // Generate an `evalrationalf` function... -var rational = evalrationalf.factory( P, Q ); -for ( i = 0; i < 100; i++ ) { - v = uniform( -50.0, 50.0 ); +const rational = evalrationalf.factory( P, Q ); +for ( let i = 0; i < 100; i++ ) { + const v = uniform( -50.0, 50.0 ); console.log( 'f(%d) = %d', v, rational( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/fibpoly/README.md b/lib/node_modules/@stdlib/math/base/tools/fibpoly/README.md index 140725a9bed3..41d4389e9da6 100644 --- a/lib/node_modules/@stdlib/math/base/tools/fibpoly/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/fibpoly/README.md @@ -93,7 +93,7 @@ F_{-n}(x) = (-1)^{n-1} F_n(x) ## Usage ```javascript -var fibpoly = require( '@stdlib/math/base/tools/fibpoly' ); +const fibpoly = require( '@stdlib/math/base/tools/fibpoly' ); ``` #### fibpoly( n, x ) @@ -101,7 +101,7 @@ var fibpoly = require( '@stdlib/math/base/tools/fibpoly' ); Evaluates a [Fibonacci polynomial][fibonacci-polynomials] at a value `x`. ```javascript -var v = fibpoly( 5, 2.0 ); // => 2^4 + 3*2^2 + 1 +const v = fibpoly( 5, 2.0 ); // => 2^4 + 3*2^2 + 1 // returns 29.0 ``` @@ -110,9 +110,9 @@ var v = fibpoly( 5, 2.0 ); // => 2^4 + 3*2^2 + 1 Uses code generation to generate a `function` for evaluating a [Fibonacci polynomial][fibonacci-polynomials]. ```javascript -var polyval = fibpoly.factory( 5 ); +const polyval = fibpoly.factory( 5 ); -var v = polyval( 1.0 ); // => 1^4 + 3*1^2 + 1 +let v = polyval( 1.0 ); // => 1^4 + 3*1^2 + 1 // returns 5.0 v = polyval( 2.0 ); // => 2^4 + 3*2^2 + 1 @@ -141,12 +141,10 @@ v = polyval( 2.0 ); // => 2^4 + 3*2^2 + 1 ```javascript -var fibpoly = require( '@stdlib/math/base/tools/fibpoly' ); - -var i; +const fibpoly = require( '@stdlib/math/base/tools/fibpoly' ); // Compute the negaFibonacci and Fibonacci numbers... -for ( i = -77; i < 78; i++ ) { +for ( let i = -77; i < 78; i++ ) { console.log( 'F_%d = %d', i, fibpoly( i, 1.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/hermitepoly/README.md b/lib/node_modules/@stdlib/math/base/tools/hermitepoly/README.md index bea1e7b02380..23a1674272e1 100644 --- a/lib/node_modules/@stdlib/math/base/tools/hermitepoly/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/hermitepoly/README.md @@ -52,7 +52,7 @@ H_{n}(x)=(-1)^{n} e^{x^2} \frac{\mathrm{d}^{n}}{\mathrm{d} x^{n}} e^{-x^2} ## Usage ```javascript -var hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' ); +const hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' ); ``` #### hermitepoly( n, x ) @@ -60,7 +60,7 @@ var hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' ); Evaluates a physicist's [Hermite polynomial][hermite-polynomial] of degree `n`. ```javascript -var v = hermitepoly( 1, 1.0 ); +let v = hermitepoly( 1, 1.0 ); // returns 2.0 v = hermitepoly( 1, 0.5 ); @@ -81,9 +81,9 @@ v = hermitepoly( 2, 0.5 ); Returns a `function` for evaluating a physicist's [Hermite polynomial][hermite-polynomial] of degree `n`. ```javascript -var polyval = hermitepoly.factory( 2 ); +const polyval = hermitepoly.factory( 2 ); -var v = polyval( 0.5 ); +const v = polyval( 0.5 ); // returns -1.0 ``` @@ -108,18 +108,13 @@ var v = polyval( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu'); -var hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' ); - -var x; -var y; -var i; -var j; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; - for ( j = 1; j < 3; j++ ) { - y = hermitepoly( j, x ); +const randu = require( '@stdlib/random/base/randu'); +const hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*100.0) - 50.0; + for ( let j = 1; j < 3; j++ ) { + const y = hermitepoly( j, x ); console.log( 'H_%d( %d ) = %d', j, x.toFixed( 3 ), y.toFixed( 3 ) ); } } diff --git a/lib/node_modules/@stdlib/math/base/tools/lucaspoly/README.md b/lib/node_modules/@stdlib/math/base/tools/lucaspoly/README.md index bedf2fe6020f..977ec5c14b90 100644 --- a/lib/node_modules/@stdlib/math/base/tools/lucaspoly/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/lucaspoly/README.md @@ -78,7 +78,7 @@ L_{-n}(x) = (-1)^{n} L_n(x) ## Usage ```javascript -var lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' ); +const lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' ); ``` #### lucaspoly( n, x ) @@ -86,7 +86,7 @@ var lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' ); Evaluates a [Lucas polynomial][fibonacci-polynomials] at a value `x`. ```javascript -var v = lucaspoly( 5, 2.0 ); // => 2^5 + 5*2^3 + 5*2 +const v = lucaspoly( 5, 2.0 ); // => 2^5 + 5*2^3 + 5*2 // returns 82.0 ``` @@ -95,9 +95,9 @@ var v = lucaspoly( 5, 2.0 ); // => 2^5 + 5*2^3 + 5*2 Uses code generation to generate a `function` for evaluating a [Lucas polynomial][fibonacci-polynomials]. ```javascript -var polyval = lucaspoly.factory( 5 ); +const polyval = lucaspoly.factory( 5 ); -var v = polyval( 1.0 ); // => 1^5 + 5*1^3 + 5 +let v = polyval( 1.0 ); // => 1^5 + 5*1^3 + 5 // returns 11.0 v = polyval( 2.0 ); // => 2^5 + 5*2^3 + 5*2 @@ -126,12 +126,10 @@ v = polyval( 2.0 ); // => 2^5 + 5*2^3 + 5*2 ```javascript -var lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' ); - -var i; +const lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' ); // Compute the negaLucas and Lucas numbers... -for ( i = -76; i < 77; i++ ) { +for ( let i = -76; i < 77; i++ ) { console.log( 'L_%d = %d', i, lucaspoly( i, 1.0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/README.md b/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/README.md index ea7147817c1c..485bcb54fdc0 100644 --- a/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/normhermitepoly/README.md @@ -52,7 +52,7 @@ He_{n}(x)=(-1)^{n} e^{\frac{x^2}{2}} \frac{\mathrm d^{n}}{\mathrm d x^{n}} e^{-\ ## Usage ```javascript -var normhermitepoly = require( '@stdlib/math/base/tools/normhermitepoly' ); +const normhermitepoly = require( '@stdlib/math/base/tools/normhermitepoly' ); ``` #### normhermitepoly( n, x ) @@ -60,7 +60,7 @@ var normhermitepoly = require( '@stdlib/math/base/tools/normhermitepoly' ); Evaluates a normalized [Hermite polynomial][hermite-polynomial] of degree `n` using double-precision floating-point arithmetic. ```javascript -var v = normhermitepoly( 1, 1.0 ); +let v = normhermitepoly( 1, 1.0 ); // returns 1.0 v = normhermitepoly( 1, 0.5 ); @@ -81,9 +81,9 @@ v = normhermitepoly( -1, 0.5 ); Returns a function for evaluating a normalized [Hermite polynomial][hermite-polynomial] of degree `n` using double-precision floating-point arithmetic. ```javascript -var polyval = normhermitepoly.factory( 2 ); +const polyval = normhermitepoly.factory( 2 ); -var v = polyval( 0.5 ); +const v = polyval( 0.5 ); // returns -0.75 ``` @@ -108,22 +108,22 @@ var v = polyval( 0.5 ); ```javascript -var uniform = require( '@stdlib/random/array/uniform' ); -var zeros = require( '@stdlib/array/zeros' ); -var dmap = require( '@stdlib/strided/base/dmap' ); -var logEach = require( '@stdlib/console/log-each' ); -var normhermitepoly = require( '@stdlib/math/base/tools/normhermitepoly' ); +const uniform = require( '@stdlib/random/array/uniform' ); +const zeros = require( '@stdlib/array/zeros' ); +const dmap = require( '@stdlib/strided/base/dmap' ); +const logEach = require( '@stdlib/console/log-each' ); +const normhermitepoly = require( '@stdlib/math/base/tools/normhermitepoly' ); // Generate random values at which to evaluate a polynomial: -var x = uniform( 10, -50.0, 50.0, { +const x = uniform( 10, -50.0, 50.0, { 'dtype': 'float64' }); // Create a polynomial function of degree 1: -var f = normhermitepoly.factory( 1 ); +let f = normhermitepoly.factory( 1 ); // Allocate an output array: -var y = zeros( x.length, 'float64' ); +let y = zeros( x.length, 'float64' ); // Evaluate the polynomial: dmap( x.length, x, 1, y, 1, f ); diff --git a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/README.md b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/README.md index ccf1218b9536..89cf34971f32 100644 --- a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/README.md @@ -52,7 +52,7 @@ He_{n}(x)=(-1)^{n} e^{\frac{x^2}{2}} \frac{\mathrm d^{n}}{\mathrm d x^{n}} e^{-\ ## Usage ```javascript -var normhermitepolyf = require( '@stdlib/math/base/tools/normhermitepolyf' ); +const normhermitepolyf = require( '@stdlib/math/base/tools/normhermitepolyf' ); ``` #### normhermitepolyf( n, x ) @@ -60,7 +60,7 @@ var normhermitepolyf = require( '@stdlib/math/base/tools/normhermitepolyf' ); Evaluates a normalized [Hermite polynomial][hermite-polynomial] of degree `n` using single-precision floating-point arithmetic. ```javascript -var v = normhermitepolyf( 1, 1.0 ); +let v = normhermitepolyf( 1, 1.0 ); // returns 1.0 v = normhermitepolyf( 1, 0.5 ); @@ -81,9 +81,9 @@ v = normhermitepolyf( -1, 0.5 ); Returns a function for evaluating a normalized [Hermite polynomial][hermite-polynomial] of degree `n` using single-precision floating-point arithmetic. ```javascript -var polyval = normhermitepolyf.factory( 2 ); +const polyval = normhermitepolyf.factory( 2 ); -var v = polyval( 0.5 ); +const v = polyval( 0.5 ); // returns -0.75 ``` @@ -108,22 +108,22 @@ var v = polyval( 0.5 ); ```javascript -var uniform = require( '@stdlib/random/array/uniform' ); -var zeros = require( '@stdlib/array/zeros' ); -var smap = require( '@stdlib/strided/base/smap' ); -var logEach = require( '@stdlib/console/log-each' ); -var normhermitepolyf = require( '@stdlib/math/base/tools/normhermitepolyf' ); +const uniform = require( '@stdlib/random/array/uniform' ); +const zeros = require( '@stdlib/array/zeros' ); +const smap = require( '@stdlib/strided/base/smap' ); +const logEach = require( '@stdlib/console/log-each' ); +const normhermitepolyf = require( '@stdlib/math/base/tools/normhermitepolyf' ); // Generate random values at which to evaluate a polynomial: -var x = uniform( 10, -50.0, 50.0, { +const x = uniform( 10, -50.0, 50.0, { 'dtype': 'float32' }); // Create a polynomial function of degree 1: -var f = normhermitepolyf.factory( 1 ); +let f = normhermitepolyf.factory( 1 ); // Allocate an output array: -var y = zeros( x.length, 'float32' ); +let y = zeros( x.length, 'float32' ); // Evaluate the polynomial: smap( x.length, x, 1, y, 1, f ); diff --git a/lib/node_modules/@stdlib/math/base/tools/sum-series/README.md b/lib/node_modules/@stdlib/math/base/tools/sum-series/README.md index 90a652813c31..f26cff16eb5c 100644 --- a/lib/node_modules/@stdlib/math/base/tools/sum-series/README.md +++ b/lib/node_modules/@stdlib/math/base/tools/sum-series/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var sumSeries = require( '@stdlib/math/base/tools/sum-series' ); +const sumSeries = require( '@stdlib/math/base/tools/sum-series' ); ``` #### sumSeries( generator\[, options ] ) @@ -39,13 +39,13 @@ Using an ES6 [Generator object][es6-generator]: ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); -var gen = geometricSeriesGenerator( 0.9 ); -var out = sumSeries( gen ); +const pow = require( '@stdlib/math/base/special/pow' ); +const gen = geometricSeriesGenerator( 0.9 ); +const out = sumSeries( gen ); // returns 10 function* geometricSeriesGenerator( x ) { - var exponent = 0; + let exponent = 0; while ( true ) { yield pow( x, exponent ); exponent += 1; @@ -56,13 +56,13 @@ function* geometricSeriesGenerator( x ) { Alternatively, one can use a closure to achieve the same goal: ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); -var gen = geometricSeriesClosure( 0.9 ); -var out = sumSeries( gen ); +const pow = require( '@stdlib/math/base/special/pow' ); +const gen = geometricSeriesClosure( 0.9 ); +const out = sumSeries( gen ); // returns 10 function geometricSeriesClosure( x ) { - var exponent = -1; + let exponent = -1; return gen; function gen() { @@ -81,15 +81,15 @@ The `function` accepts the following `options`: By default, the initial value of the sum is `0`. To choose a different one, use the `initialValue` option. ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var out = sumSeries( geometricSeriesClosure( 0.5 ), { +const out = sumSeries( geometricSeriesClosure( 0.5 ), { 'initialValue': 1 }); // returns 3 function geometricSeriesClosure( x ) { - var exponent = -1; + let exponent = -1; return gen; function gen() { @@ -102,16 +102,16 @@ function geometricSeriesClosure( x ) { To change the maximum number of terms to be summed, set the `maxTerms` option. ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); // Note: infinite sum is 2 -var out = sumSeries( geometricSeriesClosure( 0.5 ), { +const out = sumSeries( geometricSeriesClosure( 0.5 ), { 'maxTerms': 10 }); // returns ~1.998 function geometricSeriesClosure( x ) { - var exponent = -1; + let exponent = -1; return gen; function gen() { @@ -124,15 +124,15 @@ function geometricSeriesClosure( x ) { The default tolerance of `2.22e-16` used to assess convergence can be changed via the `tolerance` option. ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var out = sumSeries( geometricSeriesClosure( 0.5 ), { +const out = sumSeries( geometricSeriesClosure( 0.5 ), { 'tolerance': 1e-3 }); // returns ~1.998 function geometricSeriesClosure( x ) { - var exponent = -1; + let exponent = -1; return gen; function gen() { @@ -155,13 +155,13 @@ function geometricSeriesClosure( x ) { ```javascript -var log1p = require( '@stdlib/math/base/special/log1p' ); -var sumSeries = require( '@stdlib/math/base/tools/sum-series' ); +const log1p = require( '@stdlib/math/base/special/log1p' ); +const sumSeries = require( '@stdlib/math/base/tools/sum-series' ); function* log1pSeries( x ) { - var mMult = -x; - var mProd = -1; - var k = 0; + const mMult = -x; + let mProd = -1; + let k = 0; while ( true ) { mProd *= mMult; k += 1; diff --git a/lib/node_modules/@stdlib/math/base/utils/README.md b/lib/node_modules/@stdlib/math/base/utils/README.md index d1d9d528a671..f64e755251a7 100644 --- a/lib/node_modules/@stdlib/math/base/utils/README.md +++ b/lib/node_modules/@stdlib/math/base/utils/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var utils = require( '@stdlib/math/base/utils' ); +const utils = require( '@stdlib/math/base/utils' ); ``` #### utils @@ -35,7 +35,7 @@ var utils = require( '@stdlib/math/base/utils' ); Namespace for "base" (i.e., lower-level) math utilities. ```javascript -var o = utils; +const o = utils; // returns {...} ``` @@ -64,8 +64,8 @@ var o = utils; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var utils = require( '@stdlib/math/base/utils' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const utils = require( '@stdlib/math/base/utils' ); console.log( objectKeys( utils ) ); ``` diff --git a/lib/node_modules/@stdlib/math/base/utils/absolute-difference/README.md b/lib/node_modules/@stdlib/math/base/utils/absolute-difference/README.md index 7d988f5a076a..b82b7274efbf 100644 --- a/lib/node_modules/@stdlib/math/base/utils/absolute-difference/README.md +++ b/lib/node_modules/@stdlib/math/base/utils/absolute-difference/README.md @@ -48,7 +48,7 @@ The [absolute difference][absolute-difference] of two real `numbers` is defined ## Usage ```javascript -var absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); +const absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); ``` #### absdiff( x, y ) @@ -56,7 +56,7 @@ var absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); Computes the [absolute difference][absolute-difference] of two real numbers. ```javascript -var d = absdiff( 2.0, 5.0 ); +let d = absdiff( 2.0, 5.0 ); // returns 3.0 d = absdiff( -1.0, 3.14 ); @@ -98,18 +98,13 @@ d = absdiff( -Infinity, Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); - -var x; -var y; -var d; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*1.0e4) - 1.0e2; - y = (randu()*1.0e4) - 1.0e2; - d = absdiff( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); + +for ( let i = 0; i < 100; i++ ) { + const x = (randu()*1.0e4) - 1.0e2; + const y = (randu()*1.0e4) - 1.0e2; + const d = absdiff( x, y ); console.log( 'x = %d. y = %d. |x-y| = %d.', x, y, d ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/utils/float64-epsilon-difference/README.md b/lib/node_modules/@stdlib/math/base/utils/float64-epsilon-difference/README.md index aac98f87b26c..b3b18acf7a92 100644 --- a/lib/node_modules/@stdlib/math/base/utils/float64-epsilon-difference/README.md +++ b/lib/node_modules/@stdlib/math/base/utils/float64-epsilon-difference/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' ); +const epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' ); ``` #### epsdiff( x, y\[, scale] ) @@ -35,7 +35,7 @@ var epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' ); Computes the [relative difference][@stdlib/math/base/utils/relative-difference] of two real numbers in units of [double-precision floating-point epsilon][@stdlib/constants/float64/eps]. ```javascript -var d = epsdiff( 12.15, 12.149999999999999 ); // => ~0.658ε +const d = epsdiff( 12.15, 12.149999999999999 ); // => ~0.658ε // returns ~0.658 ``` @@ -53,7 +53,7 @@ The following [`scale`][@stdlib/math/base/utils/relative-difference] functions a By default, the function scales the [absolute difference][@stdlib/math/base/utils/absolute-difference] by dividing the [absolute difference][@stdlib/math/base/utils/absolute-difference] by the maximum [absolute value][@stdlib/math/base/special/abs] of `x` and `y`. To scale by a different function, specify a scale function name. ```javascript -var d = epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' ); // => ~64761.5ε => ~1.438e-11 +const d = epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' ); // => ~64761.5ε => ~1.438e-11 // returns ~64761.5 ``` @@ -65,7 +65,7 @@ function scale( x, y ) { return ( x > y ) ? y : x; } -var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε +const d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε // returns ~44 ``` @@ -80,14 +80,14 @@ var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε - If computing the [relative difference][@stdlib/math/base/utils/relative-difference] in units of [epsilon][@stdlib/constants/float64/eps] will result in overflow, the function returns the [maximum double-precision floating-point number][@stdlib/constants/float64/max]. ```javascript - var d = epsdiff( 1.0e304, 1.0, 'min' ); // => ~1.798e308ε => 1.0e304/ε overflows + const d = epsdiff( 1.0e304, 1.0, 'min' ); // => ~1.798e308ε => 1.0e304/ε overflows // returns ~1.798e308 ``` - If the [absolute difference][@stdlib/math/base/utils/absolute-difference] of `x` and `y` is `0`, the [relative difference][@stdlib/math/base/utils/relative-difference] is **always** `0`. ```javascript - var d = epsdiff( 0.0, 0.0 ); + let d = epsdiff( 0.0, 0.0 ); // returns 0.0 d = epsdiff( 3.14, 3.14 ); @@ -97,10 +97,10 @@ var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε - If `x = y = +infinity` or `x = y = -infinity`, the function returns `NaN`. ```javascript - var PINF = require( '@stdlib/constants/float64/pinf' ); - var NINF = require( '@stdlib/constants/float64/ninf' ); + const PINF = require( '@stdlib/constants/float64/pinf' ); + const NINF = require( '@stdlib/constants/float64/ninf' ); - var d = epsdiff( PINF, PINF ); + let d = epsdiff( PINF, PINF ); // returns NaN d = epsdiff( NINF, NINF ); @@ -110,10 +110,10 @@ var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε - If `x = -y = +infinity` or `-x = y = +infinity`, the [relative difference][@stdlib/math/base/utils/relative-difference] is `+infinity`. ```javascript - var PINF = require( '@stdlib/constants/float64/pinf' ); - var NINF = require( '@stdlib/constants/float64/ninf' ); + const PINF = require( '@stdlib/constants/float64/pinf' ); + const NINF = require( '@stdlib/constants/float64/ninf' ); - var d = epsdiff( PINF, NINF ); + let d = epsdiff( PINF, NINF ); // returns Infinity d = epsdiff( NINF, PINF ); @@ -123,7 +123,7 @@ var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε - If a `scale` function returns `0`, the function returns `NaN`. ```javascript - var d = epsdiff( -1.0, 1.0, 'mean' ); // => |2/0| + const d = epsdiff( -1.0, 1.0, 'mean' ); // => |2/0| // returns NaN ``` @@ -138,21 +138,15 @@ var d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' ); - -var sign; -var x; -var y; -var d; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu(); - sign = ( randu() > 0.5 ) ? 1.0 : -1.0; - y = x + ( sign*EPS*i ); - d = epsdiff( x, y ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu(); + const sign = ( randu() > 0.5 ) ? 1.0 : -1.0; + const y = x + ( sign*EPS*i ); + const d = epsdiff( x, y ); console.log( 'x = %d. y = %d. d = %dε.', x, y, d ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/utils/relative-difference/README.md b/lib/node_modules/@stdlib/math/base/utils/relative-difference/README.md index 2a84083dcbf9..91ed2a31b1f9 100644 --- a/lib/node_modules/@stdlib/math/base/utils/relative-difference/README.md +++ b/lib/node_modules/@stdlib/math/base/utils/relative-difference/README.md @@ -65,7 +65,7 @@ The choice of scale function depends on application context. ## Usage ```javascript -var reldiff = require( '@stdlib/math/base/utils/relative-difference' ); +const reldiff = require( '@stdlib/math/base/utils/relative-difference' ); ``` #### reldiff( x, y\[, scale] ) @@ -73,7 +73,7 @@ var reldiff = require( '@stdlib/math/base/utils/relative-difference' ); Computes the [relative difference][relative-difference] of two real numbers. ```javascript -var d = reldiff( 2.0, 5.0 ); // => 3/5 +let d = reldiff( 2.0, 5.0 ); // => 3/5 // returns 0.6 d = reldiff( -1.0, 3.14 ); // => 4.14/3.14 @@ -94,7 +94,7 @@ The following `scale` functions are supported: By default, the function scales the [absolute difference][@stdlib/math/base/utils/absolute-difference] by dividing the [absolute difference][@stdlib/math/base/utils/absolute-difference] by the maximum [absolute value][@stdlib/math/base/special/abs] of `x` and `y`. To scale by a different function, specify a scale function name. ```javascript -var d = reldiff( -2.0, 5.0 ); // => |-7/5| +let d = reldiff( -2.0, 5.0 ); // => |-7/5| // returns 1.4 d = reldiff( -2.0, 5.0, 'max-abs' ); // => |-7/5| @@ -131,22 +131,21 @@ d = reldiff( 5.0, -2.0, 'y' ); // => |7/-2| To use a custom scale `function`, provide a `function` which accepts two numeric arguments `x` and `y`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const EPS = require( '@stdlib/constants/float64/eps' ); function scale( x, y ) { - var s; x = abs( x ); y = abs( y ); // Maximum absolute value: - s = (x < y ) ? y : x; + const s = (x < y ) ? y : x; // Scale in units of epsilon: return s * EPS; } -var d = reldiff( 12.15, 12.149999999999999, scale ); +const d = reldiff( 12.15, 12.149999999999999, scale ); // returns ~0.658 ``` @@ -161,7 +160,7 @@ var d = reldiff( 12.15, 12.149999999999999, scale ); - If the [absolute difference][@stdlib/math/base/utils/absolute-difference] of `x` and `y` is `0`, the relative difference is **always** `0`. ```javascript - var d = reldiff( 0.0, 0.0 ); + let d = reldiff( 0.0, 0.0 ); // returns 0.0 d = reldiff( 3.14, 3.14 ); @@ -171,7 +170,7 @@ var d = reldiff( 12.15, 12.149999999999999, scale ); - If `|x| = |y| = infinity`, the function returns `NaN`. ```javascript - var d = reldiff( Infinity, Infinity ); + let d = reldiff( Infinity, Infinity ); // returns NaN d = reldiff( -Infinity, -Infinity ); @@ -181,7 +180,7 @@ var d = reldiff( 12.15, 12.149999999999999, scale ); - If `|x| = |-y| = infinity`, the relative difference is `+infinity`. ```javascript - var d = reldiff( Infinity, -Infinity ); + let d = reldiff( Infinity, -Infinity ); // returns Infinity d = reldiff( -Infinity, Infinity ); @@ -191,7 +190,7 @@ var d = reldiff( 12.15, 12.149999999999999, scale ); - If a `scale` function returns `0`, the function returns `NaN`. ```javascript - var d = reldiff( 0.0, 2.0, 'mean' ); // => |2/1| + let d = reldiff( 0.0, 2.0, 'mean' ); // => |2/1| // returns 2.0 d = reldiff( -1.0, 1.0, 'mean' ); // => |2/0| @@ -209,21 +208,16 @@ var d = reldiff( 12.15, 12.149999999999999, scale ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var reldiff = require( '@stdlib/math/base/utils/relative-difference' ); - -var scales = [ 'max-abs', 'max', 'min-abs', 'min', 'mean-abs', 'mean', 'x', 'y' ]; -var x; -var y; -var d; -var i; -var j; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*1.0e4 ) - 5.0e3; - y = ( randu()*1.0e4 ) - 5.0e3; - for ( j = 0; j < scales.length; j++ ) { - d = reldiff( x, y, scales[j] ); +const randu = require( '@stdlib/random/base/randu' ); +const reldiff = require( '@stdlib/math/base/utils/relative-difference' ); + +const scales = [ 'max-abs', 'max', 'min-abs', 'min', 'mean-abs', 'mean', 'x', 'y' ]; + +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*1.0e4 ) - 5.0e3; + const y = ( randu()*1.0e4 ) - 5.0e3; + for ( let j = 0; j < scales.length; j++ ) { + const d = reldiff( x, y, scales[j] ); console.log( 'x = %d. y = %d. d = %d. scale: %s.', x, y, d, scales[j] ); } } diff --git a/lib/node_modules/@stdlib/math/iter/README.md b/lib/node_modules/@stdlib/math/iter/README.md index 69513bcc8bbf..6abe92536218 100644 --- a/lib/node_modules/@stdlib/math/iter/README.md +++ b/lib/node_modules/@stdlib/math/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter' ); +const ns = require( '@stdlib/math/iter' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter' ); Namespace containing math iterators. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -68,8 +68,8 @@ The namespace contains the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/iter' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/iter' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/iter/ops/README.md b/lib/node_modules/@stdlib/math/iter/ops/README.md index 05fc0fabace8..5606ab62e612 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter/ops' ); +const ns = require( '@stdlib/math/iter/ops' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter/ops' ); Namespace containing math operator iterators. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -66,16 +66,16 @@ The namespace contains the following functions for creating iterator protocol-co ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var ns = require( '@stdlib/math/iter/ops' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const ns = require( '@stdlib/math/iter/ops' ); // Demonstrate operations with two iterators: -var arr1 = [ 2.0, 3.0 ]; -var arr2 = [ 1.0, 4.0 ]; -var itAdd = ns.iterAdd( array2iterator( arr1 ), array2iterator( arr2 ) ); -var itDiv = ns.iterDivide( array2iterator( arr1 ), array2iterator( arr2 ) ); -var itMul = ns.iterMultiply( array2iterator( arr1 ), array2iterator( arr2 ) ); -var itSub = ns.iterSubtract( array2iterator( arr1 ), array2iterator( arr2 ) ); +const arr1 = [ 2.0, 3.0 ]; +const arr2 = [ 1.0, 4.0 ]; +const itAdd = ns.iterAdd( array2iterator( arr1 ), array2iterator( arr2 ) ); +const itDiv = ns.iterDivide( array2iterator( arr1 ), array2iterator( arr2 ) ); +const itMul = ns.iterMultiply( array2iterator( arr1 ), array2iterator( arr2 ) ); +const itSub = ns.iterSubtract( array2iterator( arr1 ), array2iterator( arr2 ) ); // Addition: 2+1=3, 3+4=7 console.log( itAdd.next().value ); @@ -102,8 +102,8 @@ console.log( itSub.next().value ); // => -1.0 // Demonstrate operation with iterator and constant -var it3 = array2iterator( [ 1.0, 2.0 ] ); -var itWithConstant = ns.iterAdd( it3, 3.0 ); +const it3 = array2iterator( [ 1.0, 2.0 ] ); +const itWithConstant = ns.iterAdd( it3, 3.0 ); console.log( itWithConstant.next().value ); // => 4.0 diff --git a/lib/node_modules/@stdlib/math/iter/ops/add/README.md b/lib/node_modules/@stdlib/math/iter/ops/add/README.md index 45937695b96c..dbe3c9eda3fb 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/add/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/add/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAdd = require( '@stdlib/math/iter/ops/add' ); +const iterAdd = require( '@stdlib/math/iter/ops/add' ); ``` #### iterAdd( iter0, ...iterator ) @@ -45,21 +45,21 @@ var iterAdd = require( '@stdlib/math/iter/ops/add' ); Returns an [iterator][mdn-iterator-protocol] which performs element-wise addition of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 1.0, 2.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var it = iterAdd( it1, it2 ); +const it = iterAdd( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.0 v = it.next().value; // returns 6.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,20 +71,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0 ] ); +const arr = array2iterator( [ 1.0, 2.0 ] ); -var it = iterAdd( arr, 3.14 ); +const it = iterAdd( arr, 3.14 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.14 v = it.next().value; // returns 5.14 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,28 +115,28 @@ var bool = it.next().done; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterAdd = require( '@stdlib/math/iter/ops/add' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterAdd = require( '@stdlib/math/iter/ops/add' ); // Create an iterator which generates a sine wave: -var sine1 = iterSineWave({ +const sine1 = iterSineWave({ 'period': 50, 'offset': 0, 'iter': 100 }); // Create another iterator which generates a higher frequency sine wave: -var sine2 = iterSineWave({ +const sine2 = iterSineWave({ 'period': 10, 'offset': 0, 'iter': 100 }); // Create an iterator which adds the two waveforms: -var it = iterAdd( sine1, sine2 ); +const it = iterAdd( sine1, sine2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/ops/divide/README.md b/lib/node_modules/@stdlib/math/iter/ops/divide/README.md index c35d14257c9e..5bdb12f84ad0 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/divide/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/divide/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDivide = require( '@stdlib/math/iter/ops/divide' ); +const iterDivide = require( '@stdlib/math/iter/ops/divide' ); ``` #### iterDivide( iter0, ...iterator ) @@ -45,21 +45,21 @@ var iterDivide = require( '@stdlib/math/iter/ops/divide' ); Returns an [iterator][mdn-iterator-protocol] which performs element-wise division of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 3.0, 2.0 ] ); -var it2 = array2iterator( [ 1.0, 4.0 ] ); +const it1 = array2iterator( [ 3.0, 2.0 ] ); +const it2 = array2iterator( [ 1.0, 4.0 ] ); -var it = iterDivide( it1, it2 ); +const it = iterDivide( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.0 v = it.next().value; // returns 0.5 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,20 +71,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0 ] ); +const arr = array2iterator( [ 1.0, 2.0 ] ); -var it = iterDivide( arr, 4.0 ); +const it = iterDivide( arr, 4.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.25 v = it.next().value; // returns 0.5 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,21 +115,21 @@ var bool = it.next().done; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterDivide = require( '@stdlib/math/iter/ops/divide' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterDivide = require( '@stdlib/math/iter/ops/divide' ); // Create an iterator which generates a sine wave: -var sine = iterSineWave({ +const sine = iterSineWave({ 'period': 50, 'offset': 0, 'iter': 100 }); // Create an iterator which scales the sine wave amplitude: -var it = iterDivide( sine, 10.0 ); +const it = iterDivide( sine, 10.0 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/ops/mod/README.md b/lib/node_modules/@stdlib/math/iter/ops/mod/README.md index 0c10c8fe009f..ce5da148bc3d 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/mod/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/mod/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMod = require( '@stdlib/math/iter/ops/mod' ); +const iterMod = require( '@stdlib/math/iter/ops/mod' ); ``` #### iterMod( iter0, ...iterator ) @@ -45,21 +45,21 @@ var iterMod = require( '@stdlib/math/iter/ops/mod' ); Returns an [iterator][mdn-iterator-protocol] which performs an element-wise modulo operation of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 3.0, -2.0 ] ); -var it2 = array2iterator( [ 1.0, 4.0 ] ); +const it1 = array2iterator( [ 3.0, -2.0 ] ); +const it2 = array2iterator( [ 1.0, 4.0 ] ); -var it = iterMod( it1, it2 ); +const it = iterMod( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; // returns -2.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,20 +71,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 7.0 ] ); +const arr = array2iterator( [ 1.0, 7.0 ] ); -var it = iterMod( arr, 4.0 ); +const it = iterMod( arr, 4.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns 3.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,19 +115,19 @@ var bool = it.next().done; ```javascript -var iterDiscreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterMod = require( '@stdlib/math/iter/ops/mod' ); +const iterDiscreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterMod = require( '@stdlib/math/iter/ops/mod' ); // Create an iterator which generates pseudorandom integers: -var rand = iterDiscreteUniform( 0, 100, { +const rand = iterDiscreteUniform( 0, 100, { 'iter': 100 }); // Create an iterator which performs an element-wise modulo operation: -var it = iterMod( rand, 10 ); +const it = iterMod( rand, 10 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/ops/multiply/README.md b/lib/node_modules/@stdlib/math/iter/ops/multiply/README.md index e2b6635321a9..4925bcad672b 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/multiply/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/multiply/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMultiply = require( '@stdlib/math/iter/ops/multiply' ); +const iterMultiply = require( '@stdlib/math/iter/ops/multiply' ); ``` #### iterMultiply( iter0, ...iterator ) @@ -45,21 +45,21 @@ var iterMultiply = require( '@stdlib/math/iter/ops/multiply' ); Returns an [iterator][mdn-iterator-protocol] which performs element-wise multiplication of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 1.0, 2.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var it = iterMultiply( it1, it2 ); +const it = iterMultiply( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.0 v = it.next().value; // returns 8.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,20 +71,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0 ] ); +const arr = array2iterator( [ 1.0, 2.0 ] ); -var it = iterMultiply( arr, 5.0 ); +const it = iterMultiply( arr, 5.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 5.0 v = it.next().value; // returns 10.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,28 +115,28 @@ var bool = it.next().done; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterMultiply = require( '@stdlib/math/iter/ops/multiply' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterMultiply = require( '@stdlib/math/iter/ops/multiply' ); // Create an iterator which generates a sine wave: -var sine1 = iterSineWave({ +const sine1 = iterSineWave({ 'period': 50, 'offset': 0, 'iter': 100 }); // Create another iterator which generates a higher frequency sine wave: -var sine2 = iterSineWave({ +const sine2 = iterSineWave({ 'period': 10, 'offset': 0, 'iter': 100 }); // Create an iterator which multiplies the two waveforms: -var it = iterMultiply( sine1, sine2 ); +const it = iterMultiply( sine1, sine2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/ops/subtract/README.md b/lib/node_modules/@stdlib/math/iter/ops/subtract/README.md index de573f83d79d..f0575e6301e5 100644 --- a/lib/node_modules/@stdlib/math/iter/ops/subtract/README.md +++ b/lib/node_modules/@stdlib/math/iter/ops/subtract/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSubtract = require( '@stdlib/math/iter/ops/subtract' ); +const iterSubtract = require( '@stdlib/math/iter/ops/subtract' ); ``` #### iterSubtract( iter0, ...iterator ) @@ -45,21 +45,21 @@ var iterSubtract = require( '@stdlib/math/iter/ops/subtract' ); Returns an [iterator][mdn-iterator-protocol] which performs element-wise subtraction of two or more [iterators][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it1 = array2iterator( [ 1.0, 5.0 ] ); -var it2 = array2iterator( [ 3.0, 4.0 ] ); +const it1 = array2iterator( [ 1.0, 5.0 ] ); +const it2 = array2iterator( [ 3.0, 4.0 ] ); -var it = iterSubtract( it1, it2 ); +const it = iterSubtract( it1, it2 ); // returns -var v = it.next().value; +let v = it.next().value; // returns -2.0 v = it.next().value; // returns 1.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -71,20 +71,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0 ] ); +const arr = array2iterator( [ 1.0, 2.0 ] ); -var it = iterSubtract( arr, 4.0 ); +const it = iterSubtract( arr, 4.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns -3.0 v = it.next().value; // returns -2.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,28 +115,28 @@ var bool = it.next().done; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterSubtract = require( '@stdlib/math/iter/ops/subtract' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterSubtract = require( '@stdlib/math/iter/ops/subtract' ); // Create an iterator which generates a sine wave: -var sine1 = iterSineWave({ +const sine1 = iterSineWave({ 'period': 50, 'offset': 0, 'iter': 100 }); // Create another iterator which generates a higher frequency sine wave: -var sine2 = iterSineWave({ +const sine2 = iterSineWave({ 'period': 10, 'offset': 0, 'iter': 100 }); // Create an iterator which subtracts the two waveforms: -var it = iterSubtract( sine1, sine2 ); +const it = iterSubtract( sine1, sine2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/README.md b/lib/node_modules/@stdlib/math/iter/sequences/README.md index 2eab765846dd..047807b17bb9 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter/sequences' ); +const ns = require( '@stdlib/math/iter/sequences' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter/sequences' ); Namespace containing math iterators for generating sequences. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -90,28 +90,24 @@ The namespace contains the following functions for creating iterator protocol-co ```javascript -var ns = require( '@stdlib/math/iter/sequences' ); +const ns = require( '@stdlib/math/iter/sequences' ); // Create iterators for generating square and cube numbers: -var squares = ns.iterSquaresSeq(); -var cubes = ns.iterCubesSeq(); - -// Iterate over both sequences and log the first five pairs: -var square; -var cube; -var i; -for ( i = 0; i < 5; i++ ) { - square = squares.next().value; - cube = cubes.next().value; +const squares = ns.iterSquaresSeq(); +const cubes = ns.iterCubesSeq(); + +for ( let i = 0; i < 5; i++ ) { + const square = squares.next().value; + const cube = cubes.next().value; console.log( 'Square: %d, Cube: %d', square, cube ); } // Calculate the sum of the first ten Fibonacci numbers: -var fibonacci = ns.iterFibonacciSeq({ +const fibonacci = ns.iterFibonacciSeq({ 'iter': 10 }); -var sum = 0; -var v = fibonacci.next(); +let sum = 0; +let v = fibonacci.next(); while ( v.done === false ) { sum += v.value; v = fibonacci.next(); @@ -119,7 +115,7 @@ while ( v.done === false ) { console.log( 'Sum of first ten Fibonacci numbers: %d', sum ); // Generate prime numbers: -var primes = ns.iterPrimesSeq({ +const primes = ns.iterPrimesSeq({ 'iter': 10 }); diff --git a/lib/node_modules/@stdlib/math/iter/sequences/composites/README.md b/lib/node_modules/@stdlib/math/iter/sequences/composites/README.md index 8c73f32a22cc..55d4043ef496 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/composites/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/composites/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCompositesSeq = require( '@stdlib/math/iter/sequences/composites' ); +const iterCompositesSeq = require( '@stdlib/math/iter/sequences/composites' ); ``` #### iterCompositesSeq( \[options] ) @@ -45,10 +45,10 @@ var iterCompositesSeq = require( '@stdlib/math/iter/sequences/composites' ); Returns an iterator which generates a sequence of composite numbers. ```javascript -var it = iterCompositesSeq(); +const it = iterCompositesSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns an infinite iterator (i.e., an iterator which never ends). To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterCompositesSeq( opts ); +const it = iterCompositesSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; // returns 6 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterCompositesSeq = require( '@stdlib/math/iter/sequences/composites' ); +const iterCompositesSeq = require( '@stdlib/math/iter/sequences/composites' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterCompositesSeq( opts ); +const it = iterCompositesSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/continued-fraction/README.md b/lib/node_modules/@stdlib/math/iter/sequences/continued-fraction/README.md index 756cc34745d4..18588c9cdeb3 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/continued-fraction/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/continued-fraction/README.md @@ -84,7 +84,7 @@ are called **convergents**. ## Usage ```javascript -var iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); +const iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); ``` #### iterContinuedFractionSeq( x, \[options] ) @@ -92,10 +92,10 @@ var iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-f Returns an iterator which generates a list of all continued fraction terms (`b_i`) which can be obtained given the precision of `x`. ```javascript -var it = iterContinuedFractionSeq( 3.245 ); +const it = iterContinuedFractionSeq( 3.245 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; @@ -107,7 +107,7 @@ v = it.next().value; v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -133,32 +133,32 @@ The function supports the following `options`: By default, in theory, the function returns an infinite iterator; however, in practice, due to limited precision, every floating-point number is a rational number, and, thus, every returned iterator will end in a finite number of iterations. To explicitly cap the maximum number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterContinuedFractionSeq( 3.245, opts ); +const it = iterContinuedFractionSeq( 3.245, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` The returned iterator terminates once the difference between the input value `x` and a continued fraction approximation is sufficiently small. The default tolerance is [floating-point epsilon][@stdlib/constants/float64/eps] (`~2.22e-16`). Once an update to a continued fraction approximation is less than or equal to this tolerance, the iterator terminates. To adjust the tolerance (e.g., to return a rough approximation of an input value `x`), set the `tol` option. ```javascript -var opts = { +const opts = { 'tol': 1.0e-7 }; -var it = iterContinuedFractionSeq( 3.141592653589793, opts ); +const it = iterContinuedFractionSeq( 3.141592653589793, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 3 v = it.next().value; @@ -167,7 +167,7 @@ v = it.next().value; v = it.next().value; // returns 16 -var bool = it.next().done; +const bool = it.next().done; // returns true // The returned terms [3; 7, 16] evaluate to 3.1415929203539825 @@ -176,12 +176,12 @@ var bool = it.next().done; By default, the returned iterator returns continued fraction terms. To return convergents, set the `returns` option to `'convergents'`. ```javascript -var it = iterContinuedFractionSeq( 3.245, { +const it = iterContinuedFractionSeq( 3.245, { 'returns': 'convergents' }); // returns -var v = it.next().value; +let v = it.next().value; // returns 3.0 v = it.next().value; @@ -193,19 +193,19 @@ v = it.next().value; v = it.next().value; // returns 3.245 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` To return both continued fraction terms and their associated convergents, set the `returns` option to `*`. ```javascript -var it = iterContinuedFractionSeq( 3.245, { +const it = iterContinuedFractionSeq( 3.245, { 'returns': '*' }); // returns -var v = it.next().value; +let v = it.next().value; // returns [ 3, 3.0 ] v = it.next().value; @@ -217,7 +217,7 @@ v = it.next().value; v = it.next().value; // returns [ 4, 3.245 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -248,19 +248,15 @@ var bool = it.next().done; ```javascript -var PI = require( '@stdlib/constants/float64/pi' ); -var iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); function evaluate( terms ) { - var sum; - var N; - var i; - - N = terms.length; - sum = 0.0; + const N = terms.length; + let sum = 0.0; if ( N > 1 ) { sum = 1.0 / terms[ N-1 ]; - for ( i = N-2; i > 0; i-- ) { + for ( let i = N-2; i > 0; i-- ) { sum = 1.0 / ( terms[ i ] + sum ); } } @@ -269,14 +265,14 @@ function evaluate( terms ) { } // Create an iterator: -var opts = { +const opts = { 'iter': 20 }; -var it = iterContinuedFractionSeq( PI, opts ); +const it = iterContinuedFractionSeq( PI, opts ); // Perform manual iteration... -var terms = []; -var v; +const terms = []; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/cubes/README.md b/lib/node_modules/@stdlib/math/iter/sequences/cubes/README.md index ef1c8c738f32..00e7ee80cbf7 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/cubes/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/cubes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCubesSeq = require( '@stdlib/math/iter/sequences/cubes' ); +const iterCubesSeq = require( '@stdlib/math/iter/sequences/cubes' ); ``` #### iterCubesSeq( \[options] ) @@ -45,10 +45,10 @@ var iterCubesSeq = require( '@stdlib/math/iter/sequences/cubes' ); Returns an iterator which generates a sequence of cubes. ```javascript -var it = iterCubesSeq(); +const it = iterCubesSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterCubesSeq( opts ); +const it = iterCubesSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterCubesSeq = require( '@stdlib/math/iter/sequences/cubes' ); +const iterCubesSeq = require( '@stdlib/math/iter/sequences/cubes' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterCubesSeq( opts ); +const it = iterCubesSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/even-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/even-integers/README.md index 21816bedd65d..41f67f7aca7f 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/even-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/even-integers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' ); +const iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' ); ``` #### iterEvenIntegersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' ) Returns an iterator which generates an interleaved sequence of even integers. ```javascript -var it = iterEvenIntegersSeq(); +const it = iterEvenIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterEvenIntegersSeq( opts ); +const it = iterEvenIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' ); +const iterEvenIntegersSeq = require( '@stdlib/math/iter/sequences/even-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterEvenIntegersSeq( opts ); +const it = iterEvenIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/factorials/README.md b/lib/node_modules/@stdlib/math/iter/sequences/factorials/README.md index a0daa7bdc6a2..c4d46fb3c348 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/factorials/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/factorials/README.md @@ -82,7 +82,7 @@ Following the convention for an [empty product][empty-product], in all definitio ## Usage ```javascript -var iterFactorialsSeq = require( '@stdlib/math/iter/sequences/factorials' ); +const iterFactorialsSeq = require( '@stdlib/math/iter/sequences/factorials' ); ``` #### iterFactorialsSeq( \[options] ) @@ -90,10 +90,10 @@ var iterFactorialsSeq = require( '@stdlib/math/iter/sequences/factorials' ); Returns an iterator which generates a sequence of factorials. ```javascript -var it = iterFactorialsSeq(); +const it = iterFactorialsSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -123,19 +123,19 @@ The function supports the following `options`: By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterFactorialsSeq( opts ); +const it = iterFactorialsSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -164,16 +164,16 @@ var bool = it.next().done; ```javascript -var iterFactorialsSeq = require( '@stdlib/math/iter/sequences/factorials' ); +const iterFactorialsSeq = require( '@stdlib/math/iter/sequences/factorials' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterFactorialsSeq( opts ); +const it = iterFactorialsSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/fibonacci/README.md b/lib/node_modules/@stdlib/math/iter/sequences/fibonacci/README.md index 4a4df643d9d3..726556bfec6c 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/fibonacci/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/fibonacci/README.md @@ -69,7 +69,7 @@ with seed values `F_0 = 0` and `F_1 = 1`. ## Usage ```javascript -var iterFibonacciSeq = require( '@stdlib/math/iter/sequences/fibonacci' ); +const iterFibonacciSeq = require( '@stdlib/math/iter/sequences/fibonacci' ); ``` #### iterFibonacciSeq( \[options] ) @@ -77,10 +77,10 @@ var iterFibonacciSeq = require( '@stdlib/math/iter/sequences/fibonacci' ); Returns an iterator which generates a [Fibonacci sequence][fibonacci-number]. ```javascript -var it = iterFibonacciSeq(); +const it = iterFibonacciSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -104,19 +104,19 @@ The function supports the following `options`: The returned iterator can only generate the first `79` [Fibonacci numbers][fibonacci-number], as larger [Fibonacci numbers][fibonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. By default, the function returns an iterator which generates all `79` numbers. To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterFibonacciSeq( opts ); +const it = iterFibonacciSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -145,13 +145,13 @@ var bool = it.next().done; ```javascript -var iterFibonacciSeq = require( '@stdlib/math/iter/sequences/fibonacci' ); +const iterFibonacciSeq = require( '@stdlib/math/iter/sequences/fibonacci' ); // Create an iterator: -var it = iterFibonacciSeq(); +const it = iterFibonacciSeq(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/fifth-powers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/fifth-powers/README.md index f39a24deeebb..da41e7937fd5 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/fifth-powers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/fifth-powers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFifthPowersSeq = require( '@stdlib/math/iter/sequences/fifth-powers' ); +const iterFifthPowersSeq = require( '@stdlib/math/iter/sequences/fifth-powers' ); ``` #### iterFifthPowersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterFifthPowersSeq = require( '@stdlib/math/iter/sequences/fifth-powers' ); Returns an iterator which generates a sequence of fifth powers. ```javascript -var it = iterFifthPowersSeq(); +const it = iterFifthPowersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterFifthPowersSeq( opts ); +const it = iterFifthPowersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterFifthPowersSeq = require( '@stdlib/math/iter/sequences/fifth-powers' ); +const iterFifthPowersSeq = require( '@stdlib/math/iter/sequences/fifth-powers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterFifthPowersSeq( opts ); +const it = iterFifthPowersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/fourth-powers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/fourth-powers/README.md index 3f7473022ff7..f04200015ec8 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/fourth-powers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/fourth-powers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFourthPowersSeq = require( '@stdlib/math/iter/sequences/fourth-powers' ); +const iterFourthPowersSeq = require( '@stdlib/math/iter/sequences/fourth-powers' ); ``` #### iterFourthPowersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterFourthPowersSeq = require( '@stdlib/math/iter/sequences/fourth-powers' ) Returns an iterator which generates a sequence of fourth powers. ```javascript -var it = iterFourthPowersSeq(); +const it = iterFourthPowersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterFourthPowersSeq( opts ); +const it = iterFourthPowersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterFourthPowersSeq = require( '@stdlib/math/iter/sequences/fourth-powers' ); +const iterFourthPowersSeq = require( '@stdlib/math/iter/sequences/fourth-powers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterFourthPowersSeq( opts ); +const it = iterFourthPowersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/integers/README.md index 7829371c9073..e5a4409158a8 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/integers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterIntegersSeq = require( '@stdlib/math/iter/sequences/integers' ); +const iterIntegersSeq = require( '@stdlib/math/iter/sequences/integers' ); ``` #### iterIntegersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterIntegersSeq = require( '@stdlib/math/iter/sequences/integers' ); Returns an iterator which generates an interleaved integer sequence. ```javascript -var it = iterIntegersSeq(); +const it = iterIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterIntegersSeq( opts ); +const it = iterIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterIntegersSeq = require( '@stdlib/math/iter/sequences/integers' ); +const iterIntegersSeq = require( '@stdlib/math/iter/sequences/integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterIntegersSeq( opts ); +const it = iterIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/lucas/README.md b/lib/node_modules/@stdlib/math/iter/sequences/lucas/README.md index b651a51ab891..297201aa0313 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/lucas/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/lucas/README.md @@ -67,7 +67,7 @@ L_n = \begin{cases}2 & \textrm{if}\ n = 0\\1 & \textrm{if}\ n = 1\\L_{n-1} + L_{ ## Usage ```javascript -var iterLucasSeq = require( '@stdlib/math/iter/sequences/lucas' ); +const iterLucasSeq = require( '@stdlib/math/iter/sequences/lucas' ); ``` #### iterLucasSeq( \[options] ) @@ -75,10 +75,10 @@ var iterLucasSeq = require( '@stdlib/math/iter/sequences/lucas' ); Returns an iterator which generates a [Lucas sequence][lucas-number]. ```javascript -var it = iterLucasSeq(); +const it = iterLucasSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -102,19 +102,19 @@ The function supports the following `options`: The returned iterator can only generate the first `77` [Lucas numbers][lucas-number], as larger [Lucas numbers][lucas-number] cannot be safely represented in [double-precision floating-point format][ieee754]. By default, the function returns an iterator which generates all `77` numbers. To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterLucasSeq( opts ); +const it = iterLucasSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -143,13 +143,13 @@ var bool = it.next().done; ```javascript -var iterLucasSeq = require( '@stdlib/math/iter/sequences/lucas' ); +const iterLucasSeq = require( '@stdlib/math/iter/sequences/lucas' ); // Create an iterator: -var it = iterLucasSeq(); +const it = iterLucasSeq(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/negafibonacci/README.md b/lib/node_modules/@stdlib/math/iter/sequences/negafibonacci/README.md index 7a971298194b..43ff15d12573 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/negafibonacci/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/negafibonacci/README.md @@ -84,7 +84,7 @@ with seed values `F_0 = 0` and `F_{-1} = 1`. ## Usage ```javascript -var iterNegaFibonacciSeq = require( '@stdlib/math/iter/sequences/negafibonacci' ); +const iterNegaFibonacciSeq = require( '@stdlib/math/iter/sequences/negafibonacci' ); ``` #### iterNegaFibonacciSeq( \[options] ) @@ -92,10 +92,10 @@ var iterNegaFibonacciSeq = require( '@stdlib/math/iter/sequences/negafibonacci' Returns an iterator which generates a [negaFibonacci sequence][fibonacci-number]. ```javascript -var it = iterNegaFibonacciSeq(); +const it = iterNegaFibonacciSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -119,19 +119,19 @@ The function supports the following `options`: The returned iterator can only generate the first `79` [negaFibonacci numbers][fibonacci-number], as larger [Fibonacci numbers][fibonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. By default, the function returns an iterator which generates all `79` numbers. To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNegaFibonacciSeq( opts ); +const it = iterNegaFibonacciSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -160,13 +160,13 @@ var bool = it.next().done; ```javascript -var iterNegaFibonacciSeq = require( '@stdlib/math/iter/sequences/negafibonacci' ); +const iterNegaFibonacciSeq = require( '@stdlib/math/iter/sequences/negafibonacci' ); // Create an iterator: -var it = iterNegaFibonacciSeq(); +const it = iterNegaFibonacciSeq(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/negalucas/README.md b/lib/node_modules/@stdlib/math/iter/sequences/negalucas/README.md index 7b4bb030134c..d9c3534b71b4 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/negalucas/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/negalucas/README.md @@ -84,7 +84,7 @@ with seed values `L_0 = 2` and `L_{-1} = -1`. ## Usage ```javascript -var iterNegaLucasSeq = require( '@stdlib/math/iter/sequences/negalucas' ); +const iterNegaLucasSeq = require( '@stdlib/math/iter/sequences/negalucas' ); ``` #### iterNegaLucasSeq( \[options] ) @@ -92,10 +92,10 @@ var iterNegaLucasSeq = require( '@stdlib/math/iter/sequences/negalucas' ); Returns an iterator which generates a [negaLucas sequence][lucas-number]. ```javascript -var it = iterNegaLucasSeq(); +const it = iterNegaLucasSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -119,19 +119,19 @@ The function supports the following `options`: The returned iterator can only generate the first `77` [negaLucas numbers][lucas-number], as larger [negaLucas numbers][lucas-number] cannot be safely represented in [double-precision floating-point format][ieee754]. By default, the function returns an iterator which generates all `77` numbers. To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNegaLucasSeq( opts ); +const it = iterNegaLucasSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns -1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -160,13 +160,13 @@ var bool = it.next().done; ```javascript -var iterNegaLucasSeq = require( '@stdlib/math/iter/sequences/negalucas' ); +const iterNegaLucasSeq = require( '@stdlib/math/iter/sequences/negalucas' ); // Create an iterator: -var it = iterNegaLucasSeq(); +const it = iterNegaLucasSeq(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/negative-even-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/negative-even-integers/README.md index 5d3a612db122..aa484d7088ae 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/negative-even-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/negative-even-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/negative-even-integers' ); +const iterNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/negative-even-integers' ); ``` #### iterNegativeEvenIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of negative even integers. ```javascript -var it = iterNegativeEvenIntegersSeq(); +const it = iterNegativeEvenIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns -2 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNegativeEvenIntegersSeq( opts ); +const it = iterNegativeEvenIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -2 v = it.next().value; // returns -4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/negative-even-integers' ); +const iterNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/negative-even-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNegativeEvenIntegersSeq( opts ); +const it = iterNegativeEvenIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/negative-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/negative-integers/README.md index cf3f6f351b56..2ac6cf9723d4 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/negative-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/negative-integers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/negative-integers' ); +const iterNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/negative-integers' ); ``` #### iterNegativeIntegersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/negative-int Returns an iterator which generates a negative integer sequence. ```javascript -var it = iterNegativeIntegersSeq(); +const it = iterNegativeIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns -1 v = it.next().value; @@ -72,19 +72,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNegativeIntegersSeq( opts ); +const it = iterNegativeIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1 v = it.next().value; // returns -2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -113,16 +113,16 @@ var bool = it.next().done; ```javascript -var iterNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/negative-integers' ); +const iterNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/negative-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNegativeIntegersSeq( opts ); +const it = iterNegativeIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/negative-odd-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/negative-odd-integers/README.md index 6715dbb10da4..e205365db561 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/negative-odd-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/negative-odd-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNegativeOddIntegersSeq = require( '@stdlib/math/iter/sequences/negative-odd-integers' ); +const iterNegativeOddIntegersSeq = require( '@stdlib/math/iter/sequences/negative-odd-integers' ); ``` #### iterNegativeOddIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of negative odd integers. ```javascript -var it = iterNegativeOddIntegersSeq(); +const it = iterNegativeOddIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns -1 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNegativeOddIntegersSeq( opts ); +const it = iterNegativeOddIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1 v = it.next().value; // returns -3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNegativeOddIntegersSeq = require( '@stdlib/math/iter/sequences/negative-odd-integers' ); +const iterNegativeOddIntegersSeq = require( '@stdlib/math/iter/sequences/negative-odd-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNegativeOddIntegersSeq( opts ); +const it = iterNegativeOddIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonfibonacci/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonfibonacci/README.md index a0a28f7c2cd3..883613ab228e 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonfibonacci/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonfibonacci/README.md @@ -54,7 +54,7 @@ where `φ` is the [golden ratio][golden-ratio]. ## Usage ```javascript -var iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); +const iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); ``` #### iterNonFibonacciSeq( \[options] ) @@ -62,10 +62,10 @@ var iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); Returns an iterator which generates a [non-Fibonacci integer sequence][fibonacci-number]. ```javascript -var it = iterNonFibonacciSeq(); +const it = iterNonFibonacciSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; @@ -89,19 +89,19 @@ The function supports the following `options`: By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonFibonacciSeq( opts ); +const it = iterNonFibonacciSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4 v = it.next().value; // returns 6 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -130,16 +130,16 @@ var bool = it.next().done; ```javascript -var iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); +const iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonFibonacciSeq( opts ); +const it = iterNonFibonacciSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-even-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-even-integers/README.md index c679212ada4f..4344ba282dd7 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-even-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-even-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNonNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-even-integers' ); +const iterNonNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-even-integers' ); ``` #### iterNonNegativeEvenIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of nonnegative even integers. ```javascript -var it = iterNonNegativeEvenIntegersSeq(); +const it = iterNonNegativeEvenIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonNegativeEvenIntegersSeq( opts ); +const it = iterNonNegativeEvenIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNonNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-even-integers' ); +const iterNonNegativeEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-even-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonNegativeEvenIntegersSeq( opts ); +const it = iterNonNegativeEvenIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-integers/README.md index d54ade2673f2..057b49bcf498 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonnegative-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNonNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-integers' ); +const iterNonNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-integers' ); ``` #### iterNonNegativeIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a nonnegative integer sequence. ```javascript -var it = iterNonNegativeIntegersSeq(); +const it = iterNonNegativeIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonNegativeIntegersSeq( opts ); +const it = iterNonNegativeIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNonNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-integers' ); +const iterNonNegativeIntegersSeq = require( '@stdlib/math/iter/sequences/nonnegative-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonNegativeIntegersSeq( opts ); +const it = iterNonNegativeIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-even-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-even-integers/README.md index 4f46d13ad0c4..3902b4f01505 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-even-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-even-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNonPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-even-integers' ); +const iterNonPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-even-integers' ); ``` #### iterNonPositiveEvenIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of nonpositive even integers. ```javascript -var it = iterNonPositiveEvenIntegersSeq(); +const it = iterNonPositiveEvenIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonPositiveEvenIntegersSeq( opts ); +const it = iterNonPositiveEvenIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns -2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNonPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-even-integers' ); +const iterNonPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-even-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonPositiveEvenIntegersSeq( opts ); +const it = iterNonPositiveEvenIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-integers/README.md index f53d36b20cf4..4e51be4e4dcf 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonpositive-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterNonPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-integers' ); +const iterNonPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-integers' ); ``` #### iterNonPositiveIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a nonpositive integer sequence. ```javascript -var it = iterNonPositiveIntegersSeq(); +const it = iterNonPositiveIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonPositiveIntegersSeq( opts ); +const it = iterNonPositiveIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns -1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterNonPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-integers' ); +const iterNonPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/nonpositive-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonPositiveIntegersSeq( opts ); +const it = iterNonPositiveIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/nonsquares/README.md b/lib/node_modules/@stdlib/math/iter/sequences/nonsquares/README.md index b7c6ac5d2ad3..97e0cc702b2d 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/nonsquares/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/nonsquares/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterNonSquaresSeq = require( '@stdlib/math/iter/sequences/nonsquares' ); +const iterNonSquaresSeq = require( '@stdlib/math/iter/sequences/nonsquares' ); ``` #### iterNonSquaresSeq( \[options] ) @@ -45,10 +45,10 @@ var iterNonSquaresSeq = require( '@stdlib/math/iter/sequences/nonsquares' ); Returns an iterator which generates a sequence of nonsquares. ```javascript -var it = iterNonSquaresSeq(); +const it = iterNonSquaresSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterNonSquaresSeq( opts ); +const it = iterNonSquaresSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterNonSquaresSeq = require( '@stdlib/math/iter/sequences/nonsquares' ); +const iterNonSquaresSeq = require( '@stdlib/math/iter/sequences/nonsquares' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterNonSquaresSeq( opts ); +const it = iterNonSquaresSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/odd-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/odd-integers/README.md index 9dbce3897d55..0591953f4644 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/odd-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/odd-integers/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterOddIntegersSeq = require( '@stdlib/math/iter/sequences/odd-integers' ); +const iterOddIntegersSeq = require( '@stdlib/math/iter/sequences/odd-integers' ); ``` #### iterOddIntegersSeq( \[options] ) @@ -45,10 +45,10 @@ var iterOddIntegersSeq = require( '@stdlib/math/iter/sequences/odd-integers' ); Returns an iterator which generates an interleaved sequence of odd integers. ```javascript -var it = iterOddIntegersSeq(); +const it = iterOddIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterOddIntegersSeq( opts ); +const it = iterOddIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns -1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterOddIntegersSeq = require( '@stdlib/math/iter/sequences/odd-integers' ); +const iterOddIntegersSeq = require( '@stdlib/math/iter/sequences/odd-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterOddIntegersSeq( opts ); +const it = iterOddIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/positive-even-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/positive-even-integers/README.md index 063967a16a13..d63f2c7cdbd9 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/positive-even-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/positive-even-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/positive-even-integers' ); +const iterPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/positive-even-integers' ); ``` #### iterPositiveEvenIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of positive even integers. ```javascript -var it = iterPositiveEvenIntegersSeq(); +const it = iterPositiveEvenIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPositiveEvenIntegersSeq( opts ); +const it = iterPositiveEvenIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns 4 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/positive-even-integers' ); +const iterPositiveEvenIntegersSeq = require( '@stdlib/math/iter/sequences/positive-even-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterPositiveEvenIntegersSeq( opts ); +const it = iterPositiveEvenIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/positive-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/positive-integers/README.md index dc16df18d14a..a98a2ab1d4d2 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/positive-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/positive-integers/README.md @@ -39,7 +39,7 @@ The sequence of positive integers `1, 2, 3, 4, ...` (OEIS [A000027][oeis-a000027 ## Usage ```javascript -var iterPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/positive-integers' ); +const iterPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/positive-integers' ); ``` #### iterPositiveIntegersSeq( \[options] ) @@ -47,10 +47,10 @@ var iterPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/positive-int Returns an iterator which generates a positive integer sequence. ```javascript -var it = iterPositiveIntegersSeq(); +const it = iterPositiveIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -74,19 +74,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPositiveIntegersSeq( opts ); +const it = iterPositiveIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 2 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -115,16 +115,16 @@ var bool = it.next().done; ```javascript -var iterPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/positive-integers' ); +const iterPositiveIntegersSeq = require( '@stdlib/math/iter/sequences/positive-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterPositiveIntegersSeq( opts ); +const it = iterPositiveIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/positive-odd-integers/README.md b/lib/node_modules/@stdlib/math/iter/sequences/positive-odd-integers/README.md index fdb2c0775240..fd03188e8f3e 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/positive-odd-integers/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/positive-odd-integers/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var iterPositiveOddIntegersSeq = require( '@stdlib/math/iter/sequences/positive-odd-integers' ); +const iterPositiveOddIntegersSeq = require( '@stdlib/math/iter/sequences/positive-odd-integers' ); ``` #### iterPositiveOddIntegersSeq( \[options] ) @@ -49,10 +49,10 @@ Returns an iterator which generates a sequence of positive odd integers. ```javascript -var it = iterPositiveOddIntegersSeq(); +const it = iterPositiveOddIntegersSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; @@ -78,19 +78,19 @@ By default, the function returns a finite iterator to avoid exceeding the maximu ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPositiveOddIntegersSeq( opts ); +const it = iterPositiveOddIntegersSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1 v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -121,16 +121,16 @@ var bool = it.next().done; ```javascript -var iterPositiveOddIntegersSeq = require( '@stdlib/math/iter/sequences/positive-odd-integers' ); +const iterPositiveOddIntegersSeq = require( '@stdlib/math/iter/sequences/positive-odd-integers' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterPositiveOddIntegersSeq( opts ); +const it = iterPositiveOddIntegersSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/primes/README.md b/lib/node_modules/@stdlib/math/iter/sequences/primes/README.md index 3ca0e6c33ce9..14638d3ffff1 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/primes/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/primes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterPrimesSeq = require( '@stdlib/math/iter/sequences/primes' ); +const iterPrimesSeq = require( '@stdlib/math/iter/sequences/primes' ); ``` #### iterPrimesSeq( \[options] ) @@ -45,10 +45,10 @@ var iterPrimesSeq = require( '@stdlib/math/iter/sequences/primes' ); Returns an iterator which generates a sequence of prime numbers. ```javascript -var it = iterPrimesSeq(); +const it = iterPrimesSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPrimesSeq( opts ); +const it = iterPrimesSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2 v = it.next().value; // returns 3 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterPrimesSeq = require( '@stdlib/math/iter/sequences/primes' ); +const iterPrimesSeq = require( '@stdlib/math/iter/sequences/primes' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterPrimesSeq( opts ); +const it = iterPrimesSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/squared-triangular/README.md b/lib/node_modules/@stdlib/math/iter/sequences/squared-triangular/README.md index 6161060b7cdf..0abd504114dc 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/squared-triangular/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/squared-triangular/README.md @@ -73,7 +73,7 @@ The nth [squared triangular number][squared-triangular-number] is the nth [trian ## Usage ```javascript -var iterSquaredTriangularSeq = require( '@stdlib/math/iter/sequences/squared-triangular' ); +const iterSquaredTriangularSeq = require( '@stdlib/math/iter/sequences/squared-triangular' ); ``` #### iterSquaredTriangularSeq( \[options] ) @@ -81,10 +81,10 @@ var iterSquaredTriangularSeq = require( '@stdlib/math/iter/sequences/squared-tri Returns an iterator which generates a sequence of [squared triangular numbers][squared-triangular-number]. ```javascript -var it = iterSquaredTriangularSeq(); +const it = iterSquaredTriangularSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -114,19 +114,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterSquaredTriangularSeq( opts ); +const it = iterSquaredTriangularSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -155,16 +155,16 @@ var bool = it.next().done; ```javascript -var iterSquaredTriangularSeq = require( '@stdlib/math/iter/sequences/squared-triangular' ); +const iterSquaredTriangularSeq = require( '@stdlib/math/iter/sequences/squared-triangular' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterSquaredTriangularSeq( opts ); +const it = iterSquaredTriangularSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/squares/README.md b/lib/node_modules/@stdlib/math/iter/sequences/squares/README.md index e751d367d87a..e5904f506855 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/squares/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/squares/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSquaresSeq = require( '@stdlib/math/iter/sequences/squares' ); +const iterSquaresSeq = require( '@stdlib/math/iter/sequences/squares' ); ``` #### iterSquaresSeq( \[options] ) @@ -45,10 +45,10 @@ var iterSquaresSeq = require( '@stdlib/math/iter/sequences/squares' ); Returns an iterator which generates a sequence of squares. ```javascript -var it = iterSquaresSeq(); +const it = iterSquaresSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -78,19 +78,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterSquaresSeq( opts ); +const it = iterSquaresSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -119,16 +119,16 @@ var bool = it.next().done; ```javascript -var iterSquaresSeq = require( '@stdlib/math/iter/sequences/squares' ); +const iterSquaresSeq = require( '@stdlib/math/iter/sequences/squares' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterSquaresSeq( opts ); +const it = iterSquaresSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/triangular/README.md b/lib/node_modules/@stdlib/math/iter/sequences/triangular/README.md index 7407844eb9ff..14eb11ece133 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/triangular/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/triangular/README.md @@ -71,7 +71,7 @@ where the last formula corresponds to a [binomial coefficient][@stdlib/math/base ## Usage ```javascript -var iterTriangularSeq = require( '@stdlib/math/iter/sequences/triangular' ); +const iterTriangularSeq = require( '@stdlib/math/iter/sequences/triangular' ); ``` #### iterTriangularSeq( \[options] ) @@ -79,10 +79,10 @@ var iterTriangularSeq = require( '@stdlib/math/iter/sequences/triangular' ); Returns an iterator which generates a sequence of [triangular numbers][triangular-number]. ```javascript -var it = iterTriangularSeq(); +const it = iterTriangularSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -112,19 +112,19 @@ The function supports the following `options`: By default, the function returns a finite iterator to avoid exceeding the maximum safe double-precision floating-point integer. To adjust the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterTriangularSeq( opts ); +const it = iterTriangularSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -153,16 +153,16 @@ var bool = it.next().done; ```javascript -var iterTriangularSeq = require( '@stdlib/math/iter/sequences/triangular' ); +const iterTriangularSeq = require( '@stdlib/math/iter/sequences/triangular' ); // Create an iterator: -var opts = { +const opts = { 'iter': 100 }; -var it = iterTriangularSeq( opts ); +const it = iterTriangularSeq( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/sequences/tribonacci/README.md b/lib/node_modules/@stdlib/math/iter/sequences/tribonacci/README.md index 9426d4d72ce5..c9642b3a42fb 100644 --- a/lib/node_modules/@stdlib/math/iter/sequences/tribonacci/README.md +++ b/lib/node_modules/@stdlib/math/iter/sequences/tribonacci/README.md @@ -69,7 +69,7 @@ with seed values `F_0 = 0`, `F_1 = 0`, and `F_2 = 1`. ## Usage ```javascript -var iterTribonacciSeq = require( '@stdlib/math/iter/sequences/tribonacci' ); +const iterTribonacciSeq = require( '@stdlib/math/iter/sequences/tribonacci' ); ``` #### iterTribonacciSeq( \[options] ) @@ -77,10 +77,10 @@ var iterTribonacciSeq = require( '@stdlib/math/iter/sequences/tribonacci' ); Returns an iterator which generates a [Tribonacci sequence][tribonacci-number]. ```javascript -var it = iterTribonacciSeq(); +const it = iterTribonacciSeq(); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -104,13 +104,13 @@ The function supports the following `options`: The returned iterator can only generate the first `64` [Tribonacci numbers][tribonacci-number], as larger [Tribonacci numbers][tribonacci-number] cannot be safely represented in [double-precision floating-point format][ieee754]. By default, the function returns an iterator which generates all `64` numbers. To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 3 }; -var it = iterTribonacciSeq( opts ); +const it = iterTribonacciSeq( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0 v = it.next().value; @@ -119,7 +119,7 @@ v = it.next().value; v = it.next().value; // returns 1 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -148,13 +148,13 @@ var bool = it.next().done; ```javascript -var iterTribonacciSeq = require( '@stdlib/math/iter/sequences/tribonacci' ); +const iterTribonacciSeq = require( '@stdlib/math/iter/sequences/tribonacci' ); // Create an iterator: -var it = iterTribonacciSeq(); +const it = iterTribonacciSeq(); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/README.md b/lib/node_modules/@stdlib/math/iter/special/README.md index 20aeb93ec57f..088747e0eb95 100644 --- a/lib/node_modules/@stdlib/math/iter/special/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter/special' ); +const ns = require( '@stdlib/math/iter/special' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter/special' ); Namespace containing math iterators for special functions. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -160,8 +160,8 @@ The namespace contains the following functions for creating iterator protocol-co ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/iter/special' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/iter/special' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/iter/special/abs/README.md b/lib/node_modules/@stdlib/math/iter/special/abs/README.md index 129bc1814dff..bbd717258561 100644 --- a/lib/node_modules/@stdlib/math/iter/special/abs/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/abs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAbs = require( '@stdlib/math/iter/special/abs' ); +const iterAbs = require( '@stdlib/math/iter/special/abs' ); ``` #### iterAbs( iterator ) @@ -45,12 +45,12 @@ var iterAbs = require( '@stdlib/math/iter/special/abs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [absolute value][@stdlib/math/base/special/abs]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAbs( array2iterator( [ -1, 2, -3 ] ) ); +const it = iterAbs( array2iterator( [ -1, 2, -3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -93,21 +93,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterAdd = require( '@stdlib/math/iter/ops/add' ); -var iterAbs = require( '@stdlib/math/iter/special/abs' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterAdd = require( '@stdlib/math/iter/ops/add' ); +const iterAbs = require( '@stdlib/math/iter/special/abs' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAbs( iterAdd( rand, -0.5 ) ); +const it = iterAbs( iterAdd( rand, -0.5 ) ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/abs2/README.md b/lib/node_modules/@stdlib/math/iter/special/abs2/README.md index 89ba7980a78a..0823336e64f4 100644 --- a/lib/node_modules/@stdlib/math/iter/special/abs2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/abs2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAbs2 = require( '@stdlib/math/iter/special/abs2' ); +const iterAbs2 = require( '@stdlib/math/iter/special/abs2' ); ``` #### iterAbs2( iterator ) @@ -45,12 +45,12 @@ var iterAbs2 = require( '@stdlib/math/iter/special/abs2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [squared absolute value][@stdlib/math/base/special/abs2]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAbs2( array2iterator( [ -1, 2, -3 ] ) ); +const it = iterAbs2( array2iterator( [ -1, 2, -3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -93,21 +93,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterAdd = require( '@stdlib/math/iter/ops/add' ); -var iterAbs2 = require( '@stdlib/math/iter/special/abs2' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterAdd = require( '@stdlib/math/iter/ops/add' ); +const iterAbs2 = require( '@stdlib/math/iter/special/abs2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAbs2( iterAdd( rand, -0.5 ) ); +const it = iterAbs2( iterAdd( rand, -0.5 ) ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acos/README.md b/lib/node_modules/@stdlib/math/iter/special/acos/README.md index e6a2a047fba0..e43cd68ed89e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcos = require( '@stdlib/math/iter/special/acos' ); +const iterAcos = require( '@stdlib/math/iter/special/acos' ); ``` #### iterAcos( iterator ) @@ -45,12 +45,12 @@ var iterAcos = require( '@stdlib/math/iter/special/acos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [arccosine][@stdlib/math/base/special/acos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAcos( array2iterator( [ 1.0, 0.707, 0.866 ] ) ); +const it = iterAcos( array2iterator( [ 1.0, 0.707, 0.866 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcos = require( '@stdlib/math/iter/special/acos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcos = require( '@stdlib/math/iter/special/acos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcos( rand ); +const it = iterAcos( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acosh/README.md b/lib/node_modules/@stdlib/math/iter/special/acosh/README.md index 915cd4887481..a35b77f8fd89 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acosh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acosh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcosh = require( '@stdlib/math/iter/special/acosh' ); +const iterAcosh = require( '@stdlib/math/iter/special/acosh' ); ``` #### iterAcosh( iterator ) @@ -45,12 +45,12 @@ var iterAcosh = require( '@stdlib/math/iter/special/acosh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [hyperbolic arccosine][@stdlib/math/base/special/acosh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAcosh( array2iterator( [ 1.0, 2.0 ] ) ); +const it = iterAcosh( array2iterator( [ 1.0, 2.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -91,20 +91,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcosh = require( '@stdlib/math/iter/special/acosh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcosh = require( '@stdlib/math/iter/special/acosh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 1.0, 10.0, { +const rand = uniform( 1.0, 10.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcosh( rand ); +const it = iterAcosh( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acot/README.md b/lib/node_modules/@stdlib/math/iter/special/acot/README.md index 5158faadf0cc..d0268ffe5b36 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acot/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acot/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcot = require( '@stdlib/math/iter/special/acot' ); +const iterAcot = require( '@stdlib/math/iter/special/acot' ); ``` #### iterAcot( iterator ) @@ -45,12 +45,12 @@ var iterAcot = require( '@stdlib/math/iter/special/acot' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse cotangent][@stdlib/math/base/special/acot]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAcot( array2iterator( [ 2.0, 1.0 ] ) ); +const it = iterAcot( array2iterator( [ 2.0, 1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.4636 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcot = require( '@stdlib/math/iter/special/acot' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcot = require( '@stdlib/math/iter/special/acot' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcot( rand ); +const it = iterAcot( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acoth/README.md b/lib/node_modules/@stdlib/math/iter/special/acoth/README.md index 9aa1093e6229..e5530b91010d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acoth/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acoth/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcoth = require( '@stdlib/math/iter/special/acoth' ); +const iterAcoth = require( '@stdlib/math/iter/special/acoth' ); ``` #### iterAcoth( iterator ) @@ -45,12 +45,12 @@ var iterAcoth = require( '@stdlib/math/iter/special/acoth' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse hyperbolic cotangent][@stdlib/math/base/special/acoth]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAcoth( array2iterator( [ 2.0, 1.0 ] ) ); +const it = iterAcoth( array2iterator( [ 2.0, 1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.5493 r = it.next().value; @@ -91,20 +91,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcoth = require( '@stdlib/math/iter/special/acoth' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcoth = require( '@stdlib/math/iter/special/acoth' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 1.0, 10.0, { +const rand = uniform( 1.0, 10.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcoth( rand ); +const it = iterAcoth( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acovercos/README.md b/lib/node_modules/@stdlib/math/iter/special/acovercos/README.md index a86b56bda320..d83935579b34 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acovercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acovercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcovercos = require( '@stdlib/math/iter/special/acovercos' ); +const iterAcovercos = require( '@stdlib/math/iter/special/acovercos' ); ``` #### iterAcovercos( iterator ) @@ -45,13 +45,13 @@ var iterAcovercos = require( '@stdlib/math/iter/special/acovercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse coversed cosine][@stdlib/math/base/special/acovercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, -3.141592653589793/2.0, -3.141592653589793/6.0 ]; -var it = iterAcovercos( array2iterator( x ) ); +const x = [ 0.0, -3.141592653589793/2.0, -3.141592653589793/6.0 ]; +const it = iterAcovercos( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.5708 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcovercos = require( '@stdlib/math/iter/special/acovercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcovercos = require( '@stdlib/math/iter/special/acovercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 0.0, { +const rand = uniform( -2.0, 0.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcovercos( rand ); +const it = iterAcovercos( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/acoversin/README.md b/lib/node_modules/@stdlib/math/iter/special/acoversin/README.md index 3eeda7629e18..4aba1a56b5d5 100644 --- a/lib/node_modules/@stdlib/math/iter/special/acoversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/acoversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAcoversin = require( '@stdlib/math/iter/special/acoversin' ); +const iterAcoversin = require( '@stdlib/math/iter/special/acoversin' ); ``` #### iterAcoversin( iterator ) @@ -45,13 +45,13 @@ var iterAcoversin = require( '@stdlib/math/iter/special/acoversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse coversed sine][@stdlib/math/base/special/acoversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, 3.141592653589793/2.0, 3.141592653589793/6.0 ]; -var it = iterAcoversin( array2iterator( x ) ); +const x = [ 0.0, 3.141592653589793/2.0, 3.141592653589793/6.0 ]; +const it = iterAcoversin( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.5708 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAcoversin = require( '@stdlib/math/iter/special/acoversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAcoversin = require( '@stdlib/math/iter/special/acoversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 2.0, { +const rand = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAcoversin( rand ); +const it = iterAcoversin( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ahavercos/README.md b/lib/node_modules/@stdlib/math/iter/special/ahavercos/README.md index ec938298eec6..33c2674a4c1e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ahavercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ahavercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAhavercos = require( '@stdlib/math/iter/special/ahavercos' ); +const iterAhavercos = require( '@stdlib/math/iter/special/ahavercos' ); ``` #### iterAhavercos( iterator ) @@ -45,13 +45,13 @@ var iterAhavercos = require( '@stdlib/math/iter/special/ahavercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse half-value versed cosine][@stdlib/math/base/special/ahavercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, 0.5, 1.0 ]; -var it = iterAhavercos( array2iterator( x ) ); +const x = [ 0.0, 0.5, 1.0 ]; +const it = iterAhavercos( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~3.1416 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAhavercos = require( '@stdlib/math/iter/special/ahavercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAhavercos = require( '@stdlib/math/iter/special/ahavercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAhavercos( rand ); +const it = iterAhavercos( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ahaversin/README.md b/lib/node_modules/@stdlib/math/iter/special/ahaversin/README.md index 0e69e4d1caee..34d4d43d0d8f 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ahaversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ahaversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAhaversin = require( '@stdlib/math/iter/special/ahaversin' ); +const iterAhaversin = require( '@stdlib/math/iter/special/ahaversin' ); ``` #### iterAhaversin( iterator ) @@ -45,13 +45,13 @@ var iterAhaversin = require( '@stdlib/math/iter/special/ahaversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse half-value versed sine][@stdlib/math/base/special/ahaversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, 0.5, 1.0 ]; -var it = iterAhaversin( array2iterator( x ) ); +const x = [ 0.0, 0.5, 1.0 ]; +const it = iterAhaversin( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAhaversin = require( '@stdlib/math/iter/special/ahaversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAhaversin = require( '@stdlib/math/iter/special/ahaversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAhaversin( rand ); +const it = iterAhaversin( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/asin/README.md b/lib/node_modules/@stdlib/math/iter/special/asin/README.md index 160127091dfb..b4ce8d2fe4bc 100644 --- a/lib/node_modules/@stdlib/math/iter/special/asin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/asin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAsin = require( '@stdlib/math/iter/special/asin' ); +const iterAsin = require( '@stdlib/math/iter/special/asin' ); ``` #### iterAsin( iterator ) @@ -45,12 +45,12 @@ var iterAsin = require( '@stdlib/math/iter/special/asin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [arcsine][@stdlib/math/base/special/asin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAsin( array2iterator( [ 0.0, -3.141592653589793/6.0 ] ) ); +const it = iterAsin( array2iterator( [ 0.0, -3.141592653589793/6.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -91,20 +91,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAsin = require( '@stdlib/math/iter/special/asin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAsin = require( '@stdlib/math/iter/special/asin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAsin( rand ); +const it = iterAsin( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/asinh/README.md b/lib/node_modules/@stdlib/math/iter/special/asinh/README.md index dc597fc04af6..ad447f1c9011 100644 --- a/lib/node_modules/@stdlib/math/iter/special/asinh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/asinh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAsinh = require( '@stdlib/math/iter/special/asinh' ); +const iterAsinh = require( '@stdlib/math/iter/special/asinh' ); ``` #### iterAsinh( iterator ) @@ -45,12 +45,12 @@ var iterAsinh = require( '@stdlib/math/iter/special/asinh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [hyperbolic arcsine][@stdlib/math/base/special/asinh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAsinh( array2iterator( [ 0.0, 2.0, -2.0 ] ) ); +const it = iterAsinh( array2iterator( [ 0.0, 2.0, -2.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAsinh = require( '@stdlib/math/iter/special/asinh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAsinh = require( '@stdlib/math/iter/special/asinh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAsinh( rand ); +const it = iterAsinh( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/atan/README.md b/lib/node_modules/@stdlib/math/iter/special/atan/README.md index 8057207b87b4..ef64cc813524 100644 --- a/lib/node_modules/@stdlib/math/iter/special/atan/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/atan/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAtan = require( '@stdlib/math/iter/special/atan' ); +const iterAtan = require( '@stdlib/math/iter/special/atan' ); ``` #### iterAtan( iterator ) @@ -45,13 +45,13 @@ var iterAtan = require( '@stdlib/math/iter/special/atan' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [arctangent][@stdlib/math/base/special/atan]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var src = [ 0.0, -3.141592653589793/2.0, 3.141592653589793/2.0 ]; -var it = iterAtan( array2iterator( src ) ); +const src = [ 0.0, -3.141592653589793/2.0, 3.141592653589793/2.0 ]; +const it = iterAtan( array2iterator( src ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.0 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAtan = require( '@stdlib/math/iter/special/atan' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAtan = require( '@stdlib/math/iter/special/atan' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAtan( rand ); +const it = iterAtan( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/atan2/README.md b/lib/node_modules/@stdlib/math/iter/special/atan2/README.md index 9cf87bcfa469..586a72c4fdea 100644 --- a/lib/node_modules/@stdlib/math/iter/special/atan2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/atan2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAtan2 = require( '@stdlib/math/iter/special/atan2' ); +const iterAtan2 = require( '@stdlib/math/iter/special/atan2' ); ``` #### iterAtan2( y, x ) @@ -45,15 +45,15 @@ var iterAtan2 = require( '@stdlib/math/iter/special/atan2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [angle][@stdlib/math/base/special/atan2] in the plane (in radians) between the positive x-axis and the ray from `(0,0)` to the point `(x,y)`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 2.0, 2.0, -1.0 ] ); -var y = array2iterator( [ 2.0, 6.0, -1.0 ] ); +const x = array2iterator( [ 2.0, 2.0, -1.0 ] ); +const y = array2iterator( [ 2.0, 6.0, -1.0 ] ); -var it = iterAtan2( y, x ); +const it = iterAtan2( y, x ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.785 r = it.next().value; @@ -73,20 +73,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var y = array2iterator( [ 2.0, 6.0 ] ); +const y = array2iterator( [ 2.0, 6.0 ] ); -var it = iterAtan2( y, 2.0 ); +const it = iterAtan2( y, 2.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.785 v = it.next().value; // returns ~1.249 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -117,25 +117,25 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAtan2 = require( '@stdlib/math/iter/special/atan2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAtan2 = require( '@stdlib/math/iter/special/atan2' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( -2.0, 2.0, { +const x = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); -var y = uniform( -2.0, 2.0, { +const y = uniform( -2.0, 2.0, { 'seed': 4567, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterAtan2( y, x ); +const it = iterAtan2( y, x ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/atanh/README.md b/lib/node_modules/@stdlib/math/iter/special/atanh/README.md index 26fb7f3063e5..1370664da0e3 100644 --- a/lib/node_modules/@stdlib/math/iter/special/atanh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/atanh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAtanh = require( '@stdlib/math/iter/special/atanh' ); +const iterAtanh = require( '@stdlib/math/iter/special/atanh' ); ``` #### iterAtanh( iterator ) @@ -45,12 +45,12 @@ var iterAtanh = require( '@stdlib/math/iter/special/atanh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [hyperbolic arctangent][@stdlib/math/base/special/atanh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterAtanh( array2iterator( [ 0.0, 0.5, 0.9 ] ) ); +const it = iterAtanh( array2iterator( [ 0.0, 0.5, 0.9 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAtanh = require( '@stdlib/math/iter/special/atanh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAtanh = require( '@stdlib/math/iter/special/atanh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAtanh( rand ); +const it = iterAtanh( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/avercos/README.md b/lib/node_modules/@stdlib/math/iter/special/avercos/README.md index 155167877407..c96c9b376f0c 100644 --- a/lib/node_modules/@stdlib/math/iter/special/avercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/avercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAvercos = require( '@stdlib/math/iter/special/avercos' ); +const iterAvercos = require( '@stdlib/math/iter/special/avercos' ); ``` #### iterAvercos( iterator ) @@ -45,13 +45,13 @@ var iterAvercos = require( '@stdlib/math/iter/special/avercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse versed cosine][@stdlib/math/base/special/avercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, -3.141592653589793/2.0, -3.141592653589793/6.0 ]; -var it = iterAvercos( array2iterator( x ) ); +const x = [ 0.0, -3.141592653589793/2.0, -3.141592653589793/6.0 ]; +const it = iterAvercos( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAvercos = require( '@stdlib/math/iter/special/avercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAvercos = require( '@stdlib/math/iter/special/avercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 0.0, { +const rand = uniform( -2.0, 0.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAvercos( rand ); +const it = iterAvercos( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/aversin/README.md b/lib/node_modules/@stdlib/math/iter/special/aversin/README.md index ff95357d3116..5a2b0250756f 100644 --- a/lib/node_modules/@stdlib/math/iter/special/aversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/aversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterAversin = require( '@stdlib/math/iter/special/aversin' ); +const iterAversin = require( '@stdlib/math/iter/special/aversin' ); ``` #### iterAversin( iterator ) @@ -45,13 +45,13 @@ var iterAversin = require( '@stdlib/math/iter/special/aversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inverse versed sine][@stdlib/math/base/special/aversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = [ 0.0, 3.141592653589793/2.0, 3.141592653589793/6.0 ]; -var it = iterAversin( array2iterator( x ) ); +const x = [ 0.0, 3.141592653589793/2.0, 3.141592653589793/6.0 ]; +const it = iterAversin( array2iterator( x ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterAversin = require( '@stdlib/math/iter/special/aversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterAversin = require( '@stdlib/math/iter/special/aversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 2.0, { +const rand = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterAversin( rand ); +const it = iterAversin( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/besselj0/README.md b/lib/node_modules/@stdlib/math/iter/special/besselj0/README.md index 825bb302af67..c1cb1f4f7a0c 100644 --- a/lib/node_modules/@stdlib/math/iter/special/besselj0/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/besselj0/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBesselj0 = require( '@stdlib/math/iter/special/besselj0' ); +const iterBesselj0 = require( '@stdlib/math/iter/special/besselj0' ); ``` #### iterBesselj0( iterator ) @@ -45,12 +45,12 @@ var iterBesselj0 = require( '@stdlib/math/iter/special/besselj0' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Bessel function of the first kind][@stdlib/math/base/special/besselj0] of order zero. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterBesselj0( array2iterator( [ 2.0, -1.0 ] ) ); +const it = iterBesselj0( array2iterator( [ 2.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.22389 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBesselj0 = require( '@stdlib/math/iter/special/besselj0' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBesselj0 = require( '@stdlib/math/iter/special/besselj0' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterBesselj0( rand ); +const it = iterBesselj0( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/besselj1/README.md b/lib/node_modules/@stdlib/math/iter/special/besselj1/README.md index d8df834d8740..ca6daad5f141 100644 --- a/lib/node_modules/@stdlib/math/iter/special/besselj1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/besselj1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBesselj1 = require( '@stdlib/math/iter/special/besselj1' ); +const iterBesselj1 = require( '@stdlib/math/iter/special/besselj1' ); ``` #### iterBesselj1( iterator ) @@ -45,12 +45,12 @@ var iterBesselj1 = require( '@stdlib/math/iter/special/besselj1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Bessel function of the first kind][@stdlib/math/base/special/besselj1] of order one. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterBesselj1( array2iterator( [ 2.0, -1.0 ] ) ); +const it = iterBesselj1( array2iterator( [ 2.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.57672 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBesselj1 = require( '@stdlib/math/iter/special/besselj1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBesselj1 = require( '@stdlib/math/iter/special/besselj1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterBesselj1( rand ); +const it = iterBesselj1( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/bessely0/README.md b/lib/node_modules/@stdlib/math/iter/special/bessely0/README.md index bb50ee266991..e7c605513fea 100644 --- a/lib/node_modules/@stdlib/math/iter/special/bessely0/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/bessely0/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBessely0 = require( '@stdlib/math/iter/special/bessely0' ); +const iterBessely0 = require( '@stdlib/math/iter/special/bessely0' ); ``` #### iterBessely0( iterator ) @@ -45,12 +45,12 @@ var iterBessely0 = require( '@stdlib/math/iter/special/bessely0' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Bessel function of the second kind][@stdlib/math/base/special/bessely0] of order zero. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterBessely0( array2iterator( [ 2.0, 0.0 ] ) ); +const it = iterBessely0( array2iterator( [ 2.0, 0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.51038 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBessely0 = require( '@stdlib/math/iter/special/bessely0' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBessely0 = require( '@stdlib/math/iter/special/bessely0' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 2.0, { +const rand = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterBessely0( rand ); +const it = iterBessely0( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/bessely1/README.md b/lib/node_modules/@stdlib/math/iter/special/bessely1/README.md index a26704b56f80..644383ecdc26 100644 --- a/lib/node_modules/@stdlib/math/iter/special/bessely1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/bessely1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBessely1 = require( '@stdlib/math/iter/special/bessely1' ); +const iterBessely1 = require( '@stdlib/math/iter/special/bessely1' ); ``` #### iterBessely1( iterator ) @@ -45,12 +45,12 @@ var iterBessely1 = require( '@stdlib/math/iter/special/bessely1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Bessel function of the second kind][@stdlib/math/base/special/bessely1] of order one. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterBessely1( array2iterator( [ 2.0, 0.0 ] ) ); +const it = iterBessely1( array2iterator( [ 2.0, 0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~-0.10703 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBessely1 = require( '@stdlib/math/iter/special/bessely1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBessely1 = require( '@stdlib/math/iter/special/bessely1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 2.0, { +const rand = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterBessely1( rand ); +const it = iterBessely1( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/beta/README.md b/lib/node_modules/@stdlib/math/iter/special/beta/README.md index ac8e38465f25..b3782110b54d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/beta/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/beta/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBeta = require( '@stdlib/math/iter/special/beta' ); +const iterBeta = require( '@stdlib/math/iter/special/beta' ); ``` #### iterBeta( x, y ) @@ -45,15 +45,15 @@ var iterBeta = require( '@stdlib/math/iter/special/beta' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [beta function][@stdlib/math/base/special/beta]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 1.0, 5.0, 4.0 ] ); -var y = array2iterator( [ 1.0, 0.2, 1.0 ] ); +const x = array2iterator( [ 1.0, 5.0, 4.0 ] ); +const y = array2iterator( [ 1.0, 0.2, 1.0 ] ); -var it = iterBeta( x, y ); +const it = iterBeta( x, y ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -73,20 +73,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 1.0, 5.0 ] ); +const x = array2iterator( [ 1.0, 5.0 ] ); -var it = iterBeta( x, 2.0 ); +const it = iterBeta( x, 2.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.5 v = it.next().value; // returns ~0.0333 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -117,25 +117,25 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBeta = require( '@stdlib/math/iter/special/beta' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBeta = require( '@stdlib/math/iter/special/beta' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( 0.0, 2.0, { +const x = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); -var y = uniform( 0.0, 2.0, { +const y = uniform( 0.0, 2.0, { 'seed': 4567, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterBeta( x, y ); +const it = iterBeta( x, y ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/betaln/README.md b/lib/node_modules/@stdlib/math/iter/special/betaln/README.md index 1635e0a81222..c2e23a038cb7 100644 --- a/lib/node_modules/@stdlib/math/iter/special/betaln/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/betaln/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBetaln = require( '@stdlib/math/iter/special/betaln' ); +const iterBetaln = require( '@stdlib/math/iter/special/betaln' ); ``` #### iterBetaln( x, y ) @@ -45,15 +45,15 @@ var iterBetaln = require( '@stdlib/math/iter/special/betaln' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [natural logarithm of the beta function][@stdlib/math/base/special/betaln]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 1.0, 5.0, 4.0 ] ); -var y = array2iterator( [ 1.0, 0.2, 1.0 ] ); +const x = array2iterator( [ 1.0, 5.0, 4.0 ] ); +const y = array2iterator( [ 1.0, 0.2, 1.0 ] ); -var it = iterBetaln( x, y ); +const it = iterBetaln( x, y ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -73,20 +73,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 1.0, 5.0 ] ); +const x = array2iterator( [ 1.0, 5.0 ] ); -var it = iterBetaln( x, 2.0 ); +const it = iterBetaln( x, 2.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~-0.6931 v = it.next().value; // returns ~-3.4012 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -117,25 +117,25 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBetaln = require( '@stdlib/math/iter/special/betaln' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBetaln = require( '@stdlib/math/iter/special/betaln' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( 0.0, 2.0, { +const x = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); -var y = uniform( 0.0, 2.0, { +const y = uniform( 0.0, 2.0, { 'seed': 4567, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterBetaln( x, y ); +const it = iterBetaln( x, y ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/binet/README.md b/lib/node_modules/@stdlib/math/iter/special/binet/README.md index 5034ff70fba9..43b168464099 100644 --- a/lib/node_modules/@stdlib/math/iter/special/binet/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/binet/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterBinet = require( '@stdlib/math/iter/special/binet' ); +const iterBinet = require( '@stdlib/math/iter/special/binet' ); ``` #### iterBinet( iterator ) @@ -45,12 +45,12 @@ var iterBinet = require( '@stdlib/math/iter/special/binet' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates [Binet's formula][@stdlib/math/base/special/binet] extended to real numbers. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterBinet( array2iterator( [ 0.0, 3.0, 3.14 ] ) ); +const it = iterBinet( array2iterator( [ 0.0, 3.0, 3.14 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterBinet = require( '@stdlib/math/iter/special/binet' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterBinet = require( '@stdlib/math/iter/special/binet' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterBinet( rand ); +const it = iterBinet( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/cbrt/README.md b/lib/node_modules/@stdlib/math/iter/special/cbrt/README.md index a1fcf7afba1d..4bfe66a9ea69 100644 --- a/lib/node_modules/@stdlib/math/iter/special/cbrt/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/cbrt/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCbrt = require( '@stdlib/math/iter/special/cbrt' ); +const iterCbrt = require( '@stdlib/math/iter/special/cbrt' ); ``` #### iterCbrt( iterator ) @@ -45,12 +45,12 @@ var iterCbrt = require( '@stdlib/math/iter/special/cbrt' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [cube root][@stdlib/math/base/special/cbrt]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCbrt( array2iterator( [ 1, 8, 27 ] ) ); +const it = iterCbrt( array2iterator( [ 1, 8, 27 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCbrt = require( '@stdlib/math/iter/special/cbrt' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCbrt = require( '@stdlib/math/iter/special/cbrt' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCbrt( rand ); +const it = iterCbrt( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ceil/README.md b/lib/node_modules/@stdlib/math/iter/special/ceil/README.md index 5ad7174cd08f..efc36d309cd3 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ceil/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ceil/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCeil = require( '@stdlib/math/iter/special/ceil' ); +const iterCeil = require( '@stdlib/math/iter/special/ceil' ); ``` #### iterCeil( iterator ) @@ -45,12 +45,12 @@ var iterCeil = require( '@stdlib/math/iter/special/ceil' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/ceil] each iterated value toward positive infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCeil( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); +const it = iterCeil( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 3.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCeil = require( '@stdlib/math/iter/special/ceil' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCeil = require( '@stdlib/math/iter/special/ceil' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCeil( rand ); +const it = iterCeil( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ceil10/README.md b/lib/node_modules/@stdlib/math/iter/special/ceil10/README.md index 722f7163dd45..43e32333a7e5 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ceil10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ceil10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCeil10 = require( '@stdlib/math/iter/special/ceil10' ); +const iterCeil10 = require( '@stdlib/math/iter/special/ceil10' ); ``` #### iterCeil10( iterator ) @@ -45,12 +45,12 @@ var iterCeil10 = require( '@stdlib/math/iter/special/ceil10' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/ceil10] each iterated value to the nearest power of `10` toward positive infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCeil10( array2iterator( [ -4.2, 13.0, -13.0 ] ) ); +const it = iterCeil10( array2iterator( [ -4.2, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns -1.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCeil10 = require( '@stdlib/math/iter/special/ceil10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCeil10 = require( '@stdlib/math/iter/special/ceil10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCeil10( rand ); +const it = iterCeil10( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ceil2/README.md b/lib/node_modules/@stdlib/math/iter/special/ceil2/README.md index c4c713caef6c..30670e2f5b06 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ceil2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ceil2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCeil2 = require( '@stdlib/math/iter/special/ceil2' ); +const iterCeil2 = require( '@stdlib/math/iter/special/ceil2' ); ``` #### iterCeil2( iterator ) @@ -45,12 +45,12 @@ var iterCeil2 = require( '@stdlib/math/iter/special/ceil2' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/ceil2] each iterated value to the nearest power of two toward positive infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCeil2( array2iterator( [ -4.2, 13.0, -13.0 ] ) ); +const it = iterCeil2( array2iterator( [ -4.2, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns -4.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCeil2 = require( '@stdlib/math/iter/special/ceil2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCeil2 = require( '@stdlib/math/iter/special/ceil2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCeil2( rand ); +const it = iterCeil2( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/cos/README.md b/lib/node_modules/@stdlib/math/iter/special/cos/README.md index 7057f04bccac..cefaa2550afb 100644 --- a/lib/node_modules/@stdlib/math/iter/special/cos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/cos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCos = require( '@stdlib/math/iter/special/cos' ); +const iterCos = require( '@stdlib/math/iter/special/cos' ); ``` #### iterCos( iterator ) @@ -45,13 +45,13 @@ var iterCos = require( '@stdlib/math/iter/special/cos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [cosine][@stdlib/math/base/special/cos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var src = [ 0.0, 3.141592653589793/4.0, -3.141592653589793/6.0 ]; -var it = iterCos( array2iterator( src ) ); +const src = [ 0.0, 3.141592653589793/4.0, -3.141592653589793/6.0 ]; +const it = iterCos( array2iterator( src ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.0 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCos = require( '@stdlib/math/iter/special/cos' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCos = require( '@stdlib/math/iter/special/cos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCos( rand ); +const it = iterCos( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/cosh/README.md b/lib/node_modules/@stdlib/math/iter/special/cosh/README.md index 4e3969f3ec18..ce055d655395 100644 --- a/lib/node_modules/@stdlib/math/iter/special/cosh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/cosh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCosh = require( '@stdlib/math/iter/special/cosh' ); +const iterCosh = require( '@stdlib/math/iter/special/cosh' ); ``` #### iterCosh( iterator ) @@ -45,12 +45,12 @@ var iterCosh = require( '@stdlib/math/iter/special/cosh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [hyperbolic cosine][@stdlib/math/base/special/cosh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCosh( array2iterator( [ 0.0, 2.0 ] ) ); +const it = iterCosh( array2iterator( [ 0.0, 2.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCosh = require( '@stdlib/math/iter/special/cosh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCosh = require( '@stdlib/math/iter/special/cosh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCosh( rand ); +const it = iterCosh( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/cosm1/README.md b/lib/node_modules/@stdlib/math/iter/special/cosm1/README.md index a45a944205ed..d254c34ba5c0 100644 --- a/lib/node_modules/@stdlib/math/iter/special/cosm1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/cosm1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCosm1 = require( '@stdlib/math/iter/special/cosm1' ); +const iterCosm1 = require( '@stdlib/math/iter/special/cosm1' ); ``` #### iterCosm1( iterator ) @@ -45,12 +45,12 @@ var iterCosm1 = require( '@stdlib/math/iter/special/cosm1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes [`cos(x) - 1`][@stdlib/math/base/special/cosm1]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCosm1( array2iterator( [ 0.0, 0.785 ] ) ); +const it = iterCosm1( array2iterator( [ 0.0, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCosm1 = require( '@stdlib/math/iter/special/cosm1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCosm1 = require( '@stdlib/math/iter/special/cosm1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCosm1( rand ); +const it = iterCosm1( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/cospi/README.md b/lib/node_modules/@stdlib/math/iter/special/cospi/README.md index 8ca587825c8c..0ac7d776f548 100644 --- a/lib/node_modules/@stdlib/math/iter/special/cospi/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/cospi/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCospi = require( '@stdlib/math/iter/special/cospi' ); +const iterCospi = require( '@stdlib/math/iter/special/cospi' ); ``` #### iterCospi( iterator ) @@ -45,13 +45,13 @@ var iterCospi = require( '@stdlib/math/iter/special/cospi' ); Returns an [iterator][mdn-iterator-protocol] which computes the [cosine][@stdlib/math/base/special/cospi] of each iterated value times π. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var src = [ 0.0, 0.5, 0.1 ]; -var it = iterCospi( array2iterator( src ) ); +const src = [ 0.0, 0.5, 0.1 ]; +const it = iterCospi( array2iterator( src ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterCospi = require( '@stdlib/math/iter/special/cospi' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterCospi = require( '@stdlib/math/iter/special/cospi' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCospi( rand ); +const it = iterCospi( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/covercos/README.md b/lib/node_modules/@stdlib/math/iter/special/covercos/README.md index ad59d22c70d8..c2121997a9d8 100644 --- a/lib/node_modules/@stdlib/math/iter/special/covercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/covercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCovercos = require( '@stdlib/math/iter/special/covercos' ); +const iterCovercos = require( '@stdlib/math/iter/special/covercos' ); ``` #### iterCovercos( iterator ) @@ -45,12 +45,12 @@ var iterCovercos = require( '@stdlib/math/iter/special/covercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [coversed cosine][@stdlib/math/base/special/covercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCovercos( array2iterator( [ 0.0, 1.57 ] ) ); +const it = iterCovercos( array2iterator( [ 0.0, 1.57 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCovercos = require( '@stdlib/math/iter/special/covercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCovercos = require( '@stdlib/math/iter/special/covercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCovercos( rand ); +const it = iterCovercos( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/coversin/README.md b/lib/node_modules/@stdlib/math/iter/special/coversin/README.md index e4cf70a9ae6f..2b6d7d2fde4e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/coversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/coversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterCoversin = require( '@stdlib/math/iter/special/coversin' ); +const iterCoversin = require( '@stdlib/math/iter/special/coversin' ); ``` #### iterCoversin( iterator ) @@ -45,12 +45,12 @@ var iterCoversin = require( '@stdlib/math/iter/special/coversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [coversed sine][@stdlib/math/base/special/coversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterCoversin( array2iterator( [ 0.0, 1.57 ] ) ); +const it = iterCoversin( array2iterator( [ 0.0, 1.57 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterCoversin = require( '@stdlib/math/iter/special/coversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterCoversin = require( '@stdlib/math/iter/special/coversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterCoversin( rand ); +const it = iterCoversin( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/deg2rad/README.md b/lib/node_modules/@stdlib/math/iter/special/deg2rad/README.md index ebec61223c47..5868fed5f63f 100644 --- a/lib/node_modules/@stdlib/math/iter/special/deg2rad/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/deg2rad/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDeg2rad = require( '@stdlib/math/iter/special/deg2rad' ); +const iterDeg2rad = require( '@stdlib/math/iter/special/deg2rad' ); ``` #### iterDeg2rad( iterator ) @@ -45,12 +45,12 @@ var iterDeg2rad = require( '@stdlib/math/iter/special/deg2rad' ); Returns an [iterator][mdn-iterator-protocol] which iteratively converts an angle from degrees to radians. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDeg2rad( array2iterator( [ 90.0, 45.0 ] ) ); +const it = iterDeg2rad( array2iterator( [ 90.0, 45.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.571 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterDeg2rad = require( '@stdlib/math/iter/special/deg2rad' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterDeg2rad = require( '@stdlib/math/iter/special/deg2rad' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -360.0, 360.0, { +const rand = uniform( -360.0, 360.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterDeg2rad( rand ); +const it = iterDeg2rad( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/digamma/README.md b/lib/node_modules/@stdlib/math/iter/special/digamma/README.md index 83bcd92cf0b0..89d06bfed364 100644 --- a/lib/node_modules/@stdlib/math/iter/special/digamma/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/digamma/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDigamma = require( '@stdlib/math/iter/special/digamma' ); +const iterDigamma = require( '@stdlib/math/iter/special/digamma' ); ``` #### iterDigamma( iterator ) @@ -45,12 +45,12 @@ var iterDigamma = require( '@stdlib/math/iter/special/digamma' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [digamma function][@stdlib/math/base/special/digamma]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDigamma( array2iterator( [ -2.5, 1.0 ] ) ); +const it = iterDigamma( array2iterator( [ -2.5, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.103 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterDigamma = require( '@stdlib/math/iter/special/digamma' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterDigamma = require( '@stdlib/math/iter/special/digamma' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.01, 5.0, { +const rand = uniform( 0.01, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterDigamma( rand ); +const it = iterDigamma( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/dirac-delta/README.md b/lib/node_modules/@stdlib/math/iter/special/dirac-delta/README.md index 460b89bf341d..78e71ded32c1 100644 --- a/lib/node_modules/@stdlib/math/iter/special/dirac-delta/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/dirac-delta/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterDiracDelta = require( '@stdlib/math/iter/special/dirac-delta' ); +const iterDiracDelta = require( '@stdlib/math/iter/special/dirac-delta' ); ``` #### iterDiracDelta( iterator ) @@ -45,12 +45,12 @@ var iterDiracDelta = require( '@stdlib/math/iter/special/dirac-delta' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Dirac delta function][@stdlib/math/base/special/dirac-delta]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterDiracDelta( array2iterator( [ 2.0, 0.0, -1.0 ] ) ); +const it = iterDiracDelta( array2iterator( [ 2.0, 0.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterDiracDelta = require( '@stdlib/math/iter/special/dirac-delta' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterDiracDelta = require( '@stdlib/math/iter/special/dirac-delta' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterDiracDelta( rand ); +const it = iterDiracDelta( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/dirichlet-eta/README.md b/lib/node_modules/@stdlib/math/iter/special/dirichlet-eta/README.md index dea3b5a73f18..9b522effc693 100644 --- a/lib/node_modules/@stdlib/math/iter/special/dirichlet-eta/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/dirichlet-eta/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEta = require( '@stdlib/math/iter/special/dirichlet-eta' ); +const iterEta = require( '@stdlib/math/iter/special/dirichlet-eta' ); ``` #### iterEta( iterator ) @@ -45,12 +45,12 @@ var iterEta = require( '@stdlib/math/iter/special/dirichlet-eta' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Dirichlet eta function][@stdlib/math/base/special/dirichlet-eta]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterEta( array2iterator( [ 2.0, -1.0 ] ) ); +const it = iterEta( array2iterator( [ 2.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.82247 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterEta = require( '@stdlib/math/iter/special/dirichlet-eta' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterEta = require( '@stdlib/math/iter/special/dirichlet-eta' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterEta( rand ); +const it = iterEta( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ellipe/README.md b/lib/node_modules/@stdlib/math/iter/special/ellipe/README.md index 2f4595e56252..72012d19660c 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ellipe/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ellipe/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEllipe = require( '@stdlib/math/iter/special/ellipe' ); +const iterEllipe = require( '@stdlib/math/iter/special/ellipe' ); ``` #### iterEllipe( iterator ) @@ -45,12 +45,12 @@ var iterEllipe = require( '@stdlib/math/iter/special/ellipe' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [complete elliptic integral of the second kind][@stdlib/math/base/special/ellipe]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterEllipe( array2iterator( [ 0.5, -1.0 ] ) ); +const it = iterEllipe( array2iterator( [ 0.5, -1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.351 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterEllipe = require( '@stdlib/math/iter/special/ellipe' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterEllipe = require( '@stdlib/math/iter/special/ellipe' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterEllipe( rand ); +const it = iterEllipe( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ellipk/README.md b/lib/node_modules/@stdlib/math/iter/special/ellipk/README.md index c7134b025d3c..ef019a2a297d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ellipk/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ellipk/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterEllipk = require( '@stdlib/math/iter/special/ellipk' ); +const iterEllipk = require( '@stdlib/math/iter/special/ellipk' ); ``` #### iterEllipk( iterator ) @@ -45,12 +45,12 @@ var iterEllipk = require( '@stdlib/math/iter/special/ellipk' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [complete elliptic integral of the first kind][@stdlib/math/base/special/ellipk]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterEllipk( array2iterator( [ 0.5, -1.0 ] ) ); +const it = iterEllipk( array2iterator( [ 0.5, -1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.854 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterEllipk = require( '@stdlib/math/iter/special/ellipk' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterEllipk = require( '@stdlib/math/iter/special/ellipk' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterEllipk( rand ); +const it = iterEllipk( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/erf/README.md b/lib/node_modules/@stdlib/math/iter/special/erf/README.md index 2847f1b0ede0..e2a6b93dda1b 100644 --- a/lib/node_modules/@stdlib/math/iter/special/erf/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/erf/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterErf = require( '@stdlib/math/iter/special/erf' ); +const iterErf = require( '@stdlib/math/iter/special/erf' ); ``` #### iterErf( iterator ) @@ -45,12 +45,12 @@ var iterErf = require( '@stdlib/math/iter/special/erf' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [error function][@stdlib/math/base/special/erf]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterErf( array2iterator( [ 2.0, -1.0 ] ) ); +const it = iterErf( array2iterator( [ 2.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.9953 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterErf = require( '@stdlib/math/iter/special/erf' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterErf = require( '@stdlib/math/iter/special/erf' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterErf( rand ); +const it = iterErf( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/erfc/README.md b/lib/node_modules/@stdlib/math/iter/special/erfc/README.md index 41003c767b30..f96a85fa694b 100644 --- a/lib/node_modules/@stdlib/math/iter/special/erfc/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/erfc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterErfc = require( '@stdlib/math/iter/special/erfc' ); +const iterErfc = require( '@stdlib/math/iter/special/erfc' ); ``` #### iterErfc( iterator ) @@ -45,12 +45,12 @@ var iterErfc = require( '@stdlib/math/iter/special/erfc' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [complementary error function][@stdlib/math/base/special/erfc]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterErfc( array2iterator( [ 2.0, -1.0 ] ) ); +const it = iterErfc( array2iterator( [ 2.0, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.0047 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterErfc = require( '@stdlib/math/iter/special/erfc' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterErfc = require( '@stdlib/math/iter/special/erfc' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterErfc( rand ); +const it = iterErfc( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/erfcinv/README.md b/lib/node_modules/@stdlib/math/iter/special/erfcinv/README.md index a8ec7f08d7b5..491b30f22471 100644 --- a/lib/node_modules/@stdlib/math/iter/special/erfcinv/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/erfcinv/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterErfcinv = require( '@stdlib/math/iter/special/erfcinv' ); +const iterErfcinv = require( '@stdlib/math/iter/special/erfcinv' ); ``` #### iterErfcinv( iterator ) @@ -45,12 +45,12 @@ var iterErfcinv = require( '@stdlib/math/iter/special/erfcinv' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [inverse complementary error function][@stdlib/math/base/special/erfcinv]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterErfcinv( array2iterator( [ 0.5, 0.8, 0.0 ] ) ); +const it = iterErfcinv( array2iterator( [ 0.5, 0.8, 0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.4769 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterErfcinv = require( '@stdlib/math/iter/special/erfcinv' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterErfcinv = require( '@stdlib/math/iter/special/erfcinv' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 2.0, { +const rand = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterErfcinv( rand ); +const it = iterErfcinv( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/erfinv/README.md b/lib/node_modules/@stdlib/math/iter/special/erfinv/README.md index 84e24891a310..3dc760f37aa9 100644 --- a/lib/node_modules/@stdlib/math/iter/special/erfinv/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/erfinv/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterErfinv = require( '@stdlib/math/iter/special/erfinv' ); +const iterErfinv = require( '@stdlib/math/iter/special/erfinv' ); ``` #### iterErfinv( iterator ) @@ -45,12 +45,12 @@ var iterErfinv = require( '@stdlib/math/iter/special/erfinv' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [inverse error function][@stdlib/math/base/special/erfinv]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterErfinv( array2iterator( [ 0.5, 0.8, -1.0 ] ) ); +const it = iterErfinv( array2iterator( [ 0.5, 0.8, -1.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.4769 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterErfinv = require( '@stdlib/math/iter/special/erfinv' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterErfinv = require( '@stdlib/math/iter/special/erfinv' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.0, 1.0, { +const rand = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterErfinv( rand ); +const it = iterErfinv( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/exp/README.md b/lib/node_modules/@stdlib/math/iter/special/exp/README.md index ab09720e7ebe..b1a92f471ef0 100644 --- a/lib/node_modules/@stdlib/math/iter/special/exp/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/exp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExp = require( '@stdlib/math/iter/special/exp' ); +const iterExp = require( '@stdlib/math/iter/special/exp' ); ``` #### iterExp( iterator ) @@ -45,12 +45,12 @@ var iterExp = require( '@stdlib/math/iter/special/exp' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the natural [exponential function][@stdlib/math/base/special/exp]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExp( array2iterator( [ 4.0, -9.0, 0.0 ] ) ); +const it = iterExp( array2iterator( [ 4.0, -9.0, 0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~54.5982 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExp = require( '@stdlib/math/iter/special/exp' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExp = require( '@stdlib/math/iter/special/exp' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 100.0, { +const rand = uniform( 0.0, 100.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExp( rand ); +const it = iterExp( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/exp10/README.md b/lib/node_modules/@stdlib/math/iter/special/exp10/README.md index 90a2b91ce8c1..efb2ba22c6fd 100644 --- a/lib/node_modules/@stdlib/math/iter/special/exp10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/exp10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExp10 = require( '@stdlib/math/iter/special/exp10' ); +const iterExp10 = require( '@stdlib/math/iter/special/exp10' ); ``` #### iterExp10( iterator ) @@ -45,12 +45,12 @@ var iterExp10 = require( '@stdlib/math/iter/special/exp10' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the base `10` [exponential function][@stdlib/math/base/special/exp10]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExp10( array2iterator( [ 3.0, -9.0 ] ) ); +const it = iterExp10( array2iterator( [ 3.0, -9.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1000.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExp10 = require( '@stdlib/math/iter/special/exp10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExp10 = require( '@stdlib/math/iter/special/exp10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -50.0, 50.0, { +const rand = uniform( -50.0, 50.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExp10( rand ); +const it = iterExp10( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/exp2/README.md b/lib/node_modules/@stdlib/math/iter/special/exp2/README.md index 650928bf9d08..856fd5e0cbb1 100644 --- a/lib/node_modules/@stdlib/math/iter/special/exp2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/exp2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExp2 = require( '@stdlib/math/iter/special/exp2' ); +const iterExp2 = require( '@stdlib/math/iter/special/exp2' ); ``` #### iterExp2( iterator ) @@ -45,12 +45,12 @@ var iterExp2 = require( '@stdlib/math/iter/special/exp2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the base `2` [exponential function][@stdlib/math/base/special/exp2]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExp2( array2iterator( [ 3.0, -9.0 ] ) ); +const it = iterExp2( array2iterator( [ 3.0, -9.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 8.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExp2 = require( '@stdlib/math/iter/special/exp2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExp2 = require( '@stdlib/math/iter/special/exp2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -50.0, 50.0, { +const rand = uniform( -50.0, 50.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExp2( rand ); +const it = iterExp2( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/expit/README.md b/lib/node_modules/@stdlib/math/iter/special/expit/README.md index 5ba23de56d0e..8d5a0170952d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/expit/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/expit/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExpit = require( '@stdlib/math/iter/special/expit' ); +const iterExpit = require( '@stdlib/math/iter/special/expit' ); ``` #### iterExpit( iterator ) @@ -45,12 +45,12 @@ var iterExpit = require( '@stdlib/math/iter/special/expit' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [standard logistic][@stdlib/math/base/special/expit] function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExpit( array2iterator( [ 0.0, 1.0 ] ) ); +const it = iterExpit( array2iterator( [ 0.0, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.5 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExpit = require( '@stdlib/math/iter/special/expit' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExpit = require( '@stdlib/math/iter/special/expit' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExpit( rand ); +const it = iterExpit( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/expm1/README.md b/lib/node_modules/@stdlib/math/iter/special/expm1/README.md index 306d27d77bf5..710c2ffcd4ad 100644 --- a/lib/node_modules/@stdlib/math/iter/special/expm1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/expm1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExpm1 = require( '@stdlib/math/iter/special/expm1' ); +const iterExpm1 = require( '@stdlib/math/iter/special/expm1' ); ``` #### iterExpm1( iterator ) @@ -45,12 +45,12 @@ var iterExpm1 = require( '@stdlib/math/iter/special/expm1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes [`exp(x) - 1`][@stdlib/math/base/special/expm1]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExpm1( array2iterator( [ 0.2, -9.0 ] ) ); +const it = iterExpm1( array2iterator( [ 0.2, -9.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.221 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExpm1 = require( '@stdlib/math/iter/special/expm1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExpm1 = require( '@stdlib/math/iter/special/expm1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExpm1( rand ); +const it = iterExpm1( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/expm1rel/README.md b/lib/node_modules/@stdlib/math/iter/special/expm1rel/README.md index 475f63de7dae..b2ca78607b92 100644 --- a/lib/node_modules/@stdlib/math/iter/special/expm1rel/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/expm1rel/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterExpm1rel = require( '@stdlib/math/iter/special/expm1rel' ); +const iterExpm1rel = require( '@stdlib/math/iter/special/expm1rel' ); ``` #### iterExpm1rel( iterator ) @@ -45,12 +45,12 @@ var iterExpm1rel = require( '@stdlib/math/iter/special/expm1rel' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [relative error exponential][@stdlib/math/base/special/expm1rel]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterExpm1rel( array2iterator( [ 0.0, 1.0 ] ) ); +const it = iterExpm1rel( array2iterator( [ 0.0, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterExpm1rel = require( '@stdlib/math/iter/special/expm1rel' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterExpm1rel = require( '@stdlib/math/iter/special/expm1rel' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -50.0, 50.0, { +const rand = uniform( -50.0, 50.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterExpm1rel( rand ); +const it = iterExpm1rel( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/factorial/README.md b/lib/node_modules/@stdlib/math/iter/special/factorial/README.md index 1bd7e2d7d356..eb464dde78d2 100644 --- a/lib/node_modules/@stdlib/math/iter/special/factorial/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/factorial/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFactorial = require( '@stdlib/math/iter/special/factorial' ); +const iterFactorial = require( '@stdlib/math/iter/special/factorial' ); ``` #### iterFactorial( iterator ) @@ -45,12 +45,12 @@ var iterFactorial = require( '@stdlib/math/iter/special/factorial' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [factorial function][@stdlib/math/base/special/factorial]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFactorial( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); +const it = iterFactorial( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 6.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterFactorial = require( '@stdlib/math/iter/special/factorial' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterFactorial = require( '@stdlib/math/iter/special/factorial' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = discreteUniform( 0, 171, { +const rand = discreteUniform( 0, 171, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFactorial( rand ); +const it = iterFactorial( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/factorialln/README.md b/lib/node_modules/@stdlib/math/iter/special/factorialln/README.md index f45630cfb5bb..24b7e17a4948 100644 --- a/lib/node_modules/@stdlib/math/iter/special/factorialln/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/factorialln/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFactorialln = require( '@stdlib/math/iter/special/factorialln' ); +const iterFactorialln = require( '@stdlib/math/iter/special/factorialln' ); ``` #### iterFactorialln( iterator ) @@ -45,12 +45,12 @@ var iterFactorialln = require( '@stdlib/math/iter/special/factorialln' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the natural logarithm of the [factorial function][@stdlib/math/base/special/factorialln]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFactorialln( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); +const it = iterFactorialln( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.79176 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); -var iterFactorialln = require( '@stdlib/math/iter/special/factorialln' ); +const discreteUniform = require( '@stdlib/random/iter/discrete-uniform' ); +const iterFactorialln = require( '@stdlib/math/iter/special/factorialln' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = discreteUniform( 0, 171, { +const rand = discreteUniform( 0, 171, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFactorialln( rand ); +const it = iterFactorialln( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/floor/README.md b/lib/node_modules/@stdlib/math/iter/special/floor/README.md index b09aada91712..555c499b7ef0 100644 --- a/lib/node_modules/@stdlib/math/iter/special/floor/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/floor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFloor = require( '@stdlib/math/iter/special/floor' ); +const iterFloor = require( '@stdlib/math/iter/special/floor' ); ``` #### iterFloor( iterator ) @@ -45,12 +45,12 @@ var iterFloor = require( '@stdlib/math/iter/special/floor' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/floor] each iterated value toward negative infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFloor( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); +const it = iterFloor( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterFloor = require( '@stdlib/math/iter/special/floor' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterFloor = require( '@stdlib/math/iter/special/floor' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFloor( rand ); +const it = iterFloor( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/floor10/README.md b/lib/node_modules/@stdlib/math/iter/special/floor10/README.md index b8903c5a7271..72a36992a49c 100644 --- a/lib/node_modules/@stdlib/math/iter/special/floor10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/floor10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFloor10 = require( '@stdlib/math/iter/special/floor10' ); +const iterFloor10 = require( '@stdlib/math/iter/special/floor10' ); ``` #### iterFloor10( iterator ) @@ -45,12 +45,12 @@ var iterFloor10 = require( '@stdlib/math/iter/special/floor10' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/floor10] each iterated value to the nearest power of `10` toward negative infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFloor10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterFloor10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterFloor10 = require( '@stdlib/math/iter/special/floor10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterFloor10 = require( '@stdlib/math/iter/special/floor10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFloor10( rand ); +const it = iterFloor10( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/floor2/README.md b/lib/node_modules/@stdlib/math/iter/special/floor2/README.md index e7aa4c787e44..45421c851703 100644 --- a/lib/node_modules/@stdlib/math/iter/special/floor2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/floor2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFloor2 = require( '@stdlib/math/iter/special/floor2' ); +const iterFloor2 = require( '@stdlib/math/iter/special/floor2' ); ``` #### iterFloor2( iterator ) @@ -45,12 +45,12 @@ var iterFloor2 = require( '@stdlib/math/iter/special/floor2' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/floor2] each iterated value to the nearest power of two toward negative infinity. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFloor2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterFloor2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 8.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterFloor2 = require( '@stdlib/math/iter/special/floor2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterFloor2 = require( '@stdlib/math/iter/special/floor2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFloor2( rand ); +const it = iterFloor2( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/fresnelc/README.md b/lib/node_modules/@stdlib/math/iter/special/fresnelc/README.md index b14785caaa46..73c2123f6ec0 100644 --- a/lib/node_modules/@stdlib/math/iter/special/fresnelc/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/fresnelc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFresnelc = require( '@stdlib/math/iter/special/fresnelc' ); +const iterFresnelc = require( '@stdlib/math/iter/special/fresnelc' ); ``` #### iterFresnelc( iterator ) @@ -45,12 +45,12 @@ var iterFresnelc = require( '@stdlib/math/iter/special/fresnelc' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [Fresnel integral][@stdlib/math/base/special/fresnelc] C(x). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFresnelc( array2iterator( [ 0.0, 1.0 ] ) ); +const it = iterFresnelc( array2iterator( [ 0.0, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterFresnelc = require( '@stdlib/math/iter/special/fresnelc' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterFresnelc = require( '@stdlib/math/iter/special/fresnelc' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 10.0, { +const rand = uniform( 0.0, 10.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFresnelc( rand ); +const it = iterFresnelc( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/fresnels/README.md b/lib/node_modules/@stdlib/math/iter/special/fresnels/README.md index 403638e92fb6..dd05e136c14f 100644 --- a/lib/node_modules/@stdlib/math/iter/special/fresnels/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/fresnels/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterFresnels = require( '@stdlib/math/iter/special/fresnels' ); +const iterFresnels = require( '@stdlib/math/iter/special/fresnels' ); ``` #### iterFresnels( iterator ) @@ -45,12 +45,12 @@ var iterFresnels = require( '@stdlib/math/iter/special/fresnels' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [Fresnel integral][@stdlib/math/base/special/fresnels] S(x). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterFresnels( array2iterator( [ 0.0, 1.0 ] ) ); +const it = iterFresnels( array2iterator( [ 0.0, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterFresnels = require( '@stdlib/math/iter/special/fresnels' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterFresnels = require( '@stdlib/math/iter/special/fresnels' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 10.0, { +const rand = uniform( 0.0, 10.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterFresnels( rand ); +const it = iterFresnels( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/gamma/README.md b/lib/node_modules/@stdlib/math/iter/special/gamma/README.md index 7ff6105085f2..6e05c7a46ebb 100644 --- a/lib/node_modules/@stdlib/math/iter/special/gamma/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/gamma/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterGamma = require( '@stdlib/math/iter/special/gamma' ); +const iterGamma = require( '@stdlib/math/iter/special/gamma' ); ``` #### iterGamma( iterator ) @@ -45,12 +45,12 @@ var iterGamma = require( '@stdlib/math/iter/special/gamma' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [gamma function][@stdlib/math/base/special/gamma]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterGamma( array2iterator( [ 4.0, -1.5, -0.5 ] ) ); +const it = iterGamma( array2iterator( [ 4.0, -1.5, -0.5 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 6.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterGamma = require( '@stdlib/math/iter/special/gamma' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterGamma = require( '@stdlib/math/iter/special/gamma' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterGamma( rand ); +const it = iterGamma( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/gamma1pm1/README.md b/lib/node_modules/@stdlib/math/iter/special/gamma1pm1/README.md index 63a599c75143..9585632e919b 100644 --- a/lib/node_modules/@stdlib/math/iter/special/gamma1pm1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/gamma1pm1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterGamma1pm1 = require( '@stdlib/math/iter/special/gamma1pm1' ); +const iterGamma1pm1 = require( '@stdlib/math/iter/special/gamma1pm1' ); ``` #### iterGamma1pm1( iterator ) @@ -45,12 +45,12 @@ var iterGamma1pm1 = require( '@stdlib/math/iter/special/gamma1pm1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes [`gamma(x+1) - 1`][@stdlib/math/base/special/gamma1pm1] without cancellation errors for small `x`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterGamma1pm1( array2iterator( [ 0.2, -8.5 ] ) ); +const it = iterGamma1pm1( array2iterator( [ 0.2, -8.5 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~-0.082 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterGamma1pm1 = require( '@stdlib/math/iter/special/gamma1pm1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterGamma1pm1 = require( '@stdlib/math/iter/special/gamma1pm1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterGamma1pm1( rand ); +const it = iterGamma1pm1( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/gammaln/README.md b/lib/node_modules/@stdlib/math/iter/special/gammaln/README.md index 1a942942cf96..df1a930a8c1d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/gammaln/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/gammaln/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterGammaln = require( '@stdlib/math/iter/special/gammaln' ); +const iterGammaln = require( '@stdlib/math/iter/special/gammaln' ); ``` #### iterGammaln( iterator ) @@ -45,12 +45,12 @@ var iterGammaln = require( '@stdlib/math/iter/special/gammaln' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the natural logarithm of the [gamma function][@stdlib/math/base/special/gammaln]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterGammaln( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); +const it = iterGammaln( array2iterator( [ 3.0, -1.5, -0.5 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.693147 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterGammaln = require( '@stdlib/math/iter/special/gammaln' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterGammaln = require( '@stdlib/math/iter/special/gammaln' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterGammaln( rand ); +const it = iterGammaln( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/hacovercos/README.md b/lib/node_modules/@stdlib/math/iter/special/hacovercos/README.md index 4b76a34137fc..862af70462d0 100644 --- a/lib/node_modules/@stdlib/math/iter/special/hacovercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/hacovercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterHacovercos = require( '@stdlib/math/iter/special/hacovercos' ); +const iterHacovercos = require( '@stdlib/math/iter/special/hacovercos' ); ``` #### iterHacovercos( iterator ) @@ -45,12 +45,12 @@ var iterHacovercos = require( '@stdlib/math/iter/special/hacovercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [half-value coversed cosine][@stdlib/math/base/special/hacovercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterHacovercos( array2iterator( [ 1.57, 0.785 ] ) ); +const it = iterHacovercos( array2iterator( [ 1.57, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterHacovercos = require( '@stdlib/math/iter/special/hacovercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterHacovercos = require( '@stdlib/math/iter/special/hacovercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterHacovercos( rand ); +const it = iterHacovercos( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/hacoversin/README.md b/lib/node_modules/@stdlib/math/iter/special/hacoversin/README.md index 3e7d696b9c36..200e8c55c832 100644 --- a/lib/node_modules/@stdlib/math/iter/special/hacoversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/hacoversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterHacoversin = require( '@stdlib/math/iter/special/hacoversin' ); +const iterHacoversin = require( '@stdlib/math/iter/special/hacoversin' ); ``` #### iterHacoversin( iterator ) @@ -45,12 +45,12 @@ var iterHacoversin = require( '@stdlib/math/iter/special/hacoversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [half-value coversed sine][@stdlib/math/base/special/hacoversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterHacoversin( array2iterator( [ 1.57, 0.785 ] ) ); +const it = iterHacoversin( array2iterator( [ 1.57, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterHacoversin = require( '@stdlib/math/iter/special/hacoversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterHacoversin = require( '@stdlib/math/iter/special/hacoversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterHacoversin( rand ); +const it = iterHacoversin( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/havercos/README.md b/lib/node_modules/@stdlib/math/iter/special/havercos/README.md index e9d899acb843..8a4300919cb3 100644 --- a/lib/node_modules/@stdlib/math/iter/special/havercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/havercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterHavercos = require( '@stdlib/math/iter/special/havercos' ); +const iterHavercos = require( '@stdlib/math/iter/special/havercos' ); ``` #### iterHavercos( iterator ) @@ -45,12 +45,12 @@ var iterHavercos = require( '@stdlib/math/iter/special/havercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [half-value versed cosine][@stdlib/math/base/special/havercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterHavercos( array2iterator( [ 1.57, 0.785 ] ) ); +const it = iterHavercos( array2iterator( [ 1.57, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.5 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterHavercos = require( '@stdlib/math/iter/special/havercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterHavercos = require( '@stdlib/math/iter/special/havercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterHavercos( rand ); +const it = iterHavercos( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/haversin/README.md b/lib/node_modules/@stdlib/math/iter/special/haversin/README.md index 4a5098664e9a..ab73b15e040b 100644 --- a/lib/node_modules/@stdlib/math/iter/special/haversin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/haversin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterHaversin = require( '@stdlib/math/iter/special/haversin' ); +const iterHaversin = require( '@stdlib/math/iter/special/haversin' ); ``` #### iterHaversin( iterator ) @@ -45,12 +45,12 @@ var iterHaversin = require( '@stdlib/math/iter/special/haversin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [half-value versed sine][@stdlib/math/base/special/haversin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterHaversin( array2iterator( [ 1.57, 0.785 ] ) ); +const it = iterHaversin( array2iterator( [ 1.57, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.5 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterHaversin = require( '@stdlib/math/iter/special/haversin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterHaversin = require( '@stdlib/math/iter/special/haversin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterHaversin( rand ); +const it = iterHaversin( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/inv/README.md b/lib/node_modules/@stdlib/math/iter/special/inv/README.md index 35d19c51cfb1..9ab6a1c305c1 100644 --- a/lib/node_modules/@stdlib/math/iter/special/inv/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/inv/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterInv = require( '@stdlib/math/iter/special/inv' ); +const iterInv = require( '@stdlib/math/iter/special/inv' ); ``` #### iterInv( iterator ) @@ -45,12 +45,12 @@ var iterInv = require( '@stdlib/math/iter/special/inv' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [multiplicative inverse][@stdlib/math/base/special/inv] (also known as the **reciprocal**). ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterInv( array2iterator( [ -1, 2, -3 ] ) ); +const it = iterInv( array2iterator( [ -1, 2, -3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns -1 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterInv = require( '@stdlib/math/iter/special/inv' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterInv = require( '@stdlib/math/iter/special/inv' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterInv( rand ); +const it = iterInv( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ln/README.md b/lib/node_modules/@stdlib/math/iter/special/ln/README.md index 530b13a7317b..a23d30d05bd3 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ln/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ln/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLn = require( '@stdlib/math/iter/special/ln' ); +const iterLn = require( '@stdlib/math/iter/special/ln' ); ``` #### iterLn( iterator ) @@ -45,12 +45,12 @@ var iterLn = require( '@stdlib/math/iter/special/ln' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [natural logarithm][@stdlib/math/base/special/ln]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLn( array2iterator( [ 4.0, 0.0 ] ) ); +const it = iterLn( array2iterator( [ 4.0, 0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.386 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLn = require( '@stdlib/math/iter/special/ln' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLn = require( '@stdlib/math/iter/special/ln' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 100.0, { +const rand = uniform( 0.0, 100.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLn( rand ); +const it = iterLn( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log/README.md b/lib/node_modules/@stdlib/math/iter/special/log/README.md index 228500dd99fd..15b0a3e5c8fc 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog = require( '@stdlib/math/iter/special/log' ); +const iterLog = require( '@stdlib/math/iter/special/log' ); ``` #### iterLog( x, b ) @@ -45,15 +45,15 @@ var iterLog = require( '@stdlib/math/iter/special/log' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the base `b` [logarithm][@stdlib/math/base/special/log] of `x`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 2.0, 2.0, 10.0 ] ); -var y = array2iterator( [ 2.0, 6.0, 2.0 ] ); +const x = array2iterator( [ 2.0, 2.0, 10.0 ] ); +const y = array2iterator( [ 2.0, 6.0, 2.0 ] ); -var it = iterLog( x, y ); +const it = iterLog( x, y ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -73,20 +73,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 2.0, 6.0 ] ); +const x = array2iterator( [ 2.0, 6.0 ] ); -var it = iterLog( x, 2.0 ); +const it = iterLog( x, 2.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns ~2.58496 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -118,25 +118,25 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog = require( '@stdlib/math/iter/special/log' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog = require( '@stdlib/math/iter/special/log' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( 0.0, 100.0, { +const x = uniform( 0.0, 100.0, { 'seed': 1234, 'iter': 10 }); -var y = uniform( 0.0, 10.0, { +const y = uniform( 0.0, 10.0, { 'seed': 4567, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterLog( x, y ); +const it = iterLog( x, y ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log10/README.md b/lib/node_modules/@stdlib/math/iter/special/log10/README.md index 57a3be290fd3..cf2faf57d21d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog10 = require( '@stdlib/math/iter/special/log10' ); +const iterLog10 = require( '@stdlib/math/iter/special/log10' ); ``` #### iterLog10( iterator ) @@ -45,12 +45,12 @@ var iterLog10 = require( '@stdlib/math/iter/special/log10' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [common logarithm][@stdlib/math/base/special/log10]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLog10( array2iterator( [ 100.0, 0.0, Infinity ] ) ); +const it = iterLog10( array2iterator( [ 100.0, 0.0, Infinity ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog10 = require( '@stdlib/math/iter/special/log10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog10 = require( '@stdlib/math/iter/special/log10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLog10( rand ); +const it = iterLog10( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log1mexp/README.md b/lib/node_modules/@stdlib/math/iter/special/log1mexp/README.md index 1fe076b43082..6794388af0f6 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log1mexp/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log1mexp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog1mexp = require( '@stdlib/math/iter/special/log1mexp' ); +const iterLog1mexp = require( '@stdlib/math/iter/special/log1mexp' ); ``` #### iterLog1mexp( iterator ) @@ -45,12 +45,12 @@ var iterLog1mexp = require( '@stdlib/math/iter/special/log1mexp' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [natural logarithm][@stdlib/math/base/special/log1mexp] of `1-exp(-|x|)`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLog1mexp( array2iterator( [ 0.0, 5.0, 10.0 ] ) ); +const it = iterLog1mexp( array2iterator( [ 0.0, 5.0, 10.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns -Infinity r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog1mexp = require( '@stdlib/math/iter/special/log1mexp' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog1mexp = require( '@stdlib/math/iter/special/log1mexp' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLog1mexp( rand ); +const it = iterLog1mexp( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log1p/README.md b/lib/node_modules/@stdlib/math/iter/special/log1p/README.md index 5fedf1bd2f45..9d27056d646d 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log1p/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log1p/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog1p = require( '@stdlib/math/iter/special/log1p' ); +const iterLog1p = require( '@stdlib/math/iter/special/log1p' ); ``` #### iterLog1p( iterator ) @@ -45,12 +45,12 @@ var iterLog1p = require( '@stdlib/math/iter/special/log1p' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [natural logarithm][@stdlib/math/base/special/log1p] of `1+x`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLog1p( array2iterator( [ 4.0, -1.0, Infinity ] ) ); +const it = iterLog1p( array2iterator( [ 4.0, -1.0, Infinity ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~1.609 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog1p = require( '@stdlib/math/iter/special/log1p' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog1p = require( '@stdlib/math/iter/special/log1p' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLog1p( rand ); +const it = iterLog1p( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log1pexp/README.md b/lib/node_modules/@stdlib/math/iter/special/log1pexp/README.md index 8005013c4596..df9029d74f2a 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log1pexp/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log1pexp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog1pexp = require( '@stdlib/math/iter/special/log1pexp' ); +const iterLog1pexp = require( '@stdlib/math/iter/special/log1pexp' ); ``` #### iterLog1pexp( iterator ) @@ -45,12 +45,12 @@ var iterLog1pexp = require( '@stdlib/math/iter/special/log1pexp' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [natural logarithm][@stdlib/math/base/special/log1pexp] of `1+exp(x)`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLog1pexp( array2iterator( [ 0.0, 5.0, -10.0 ] ) ); +const it = iterLog1pexp( array2iterator( [ 0.0, 5.0, -10.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.693147 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog1pexp = require( '@stdlib/math/iter/special/log1pexp' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog1pexp = require( '@stdlib/math/iter/special/log1pexp' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLog1pexp( rand ); +const it = iterLog1pexp( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/log2/README.md b/lib/node_modules/@stdlib/math/iter/special/log2/README.md index 6f9bfaf1c2f2..3fa0b34947c6 100644 --- a/lib/node_modules/@stdlib/math/iter/special/log2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/log2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLog2 = require( '@stdlib/math/iter/special/log2' ); +const iterLog2 = require( '@stdlib/math/iter/special/log2' ); ``` #### iterLog2( iterator ) @@ -45,12 +45,12 @@ var iterLog2 = require( '@stdlib/math/iter/special/log2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [binary logarithm][@stdlib/math/base/special/log2]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLog2( array2iterator( [ 4.0, 0.0, Infinity ] ) ); +const it = iterLog2( array2iterator( [ 4.0, 0.0, Infinity ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLog2 = require( '@stdlib/math/iter/special/log2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLog2 = require( '@stdlib/math/iter/special/log2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLog2( rand ); +const it = iterLog2( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/logit/README.md b/lib/node_modules/@stdlib/math/iter/special/logit/README.md index ae5a04d2147c..e38f4169cc38 100644 --- a/lib/node_modules/@stdlib/math/iter/special/logit/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/logit/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterLogit = require( '@stdlib/math/iter/special/logit' ); +const iterLogit = require( '@stdlib/math/iter/special/logit' ); ``` #### iterLogit( iterator ) @@ -45,12 +45,12 @@ var iterLogit = require( '@stdlib/math/iter/special/logit' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [logit function][@stdlib/math/base/special/logit]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterLogit( array2iterator( [ 0.2, 0.9 ] ) ); +const it = iterLogit( array2iterator( [ 0.2, 0.9 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~-1.386 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterLogit = require( '@stdlib/math/iter/special/logit' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterLogit = require( '@stdlib/math/iter/special/logit' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1.0, { +const rand = uniform( 0.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterLogit( rand ); +const it = iterLogit( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/pow/README.md b/lib/node_modules/@stdlib/math/iter/special/pow/README.md index 306dc65f5570..fe6ebf1bc43e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/pow/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/pow/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterPow = require( '@stdlib/math/iter/special/pow' ); +const iterPow = require( '@stdlib/math/iter/special/pow' ); ``` #### iterPow( base, exponent ) @@ -45,15 +45,15 @@ var iterPow = require( '@stdlib/math/iter/special/pow' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [exponential function][@stdlib/math/base/special/pow]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 2.0, 2.0, -1.0 ] ); -var y = array2iterator( [ 2.0, 6.0, -1.0 ] ); +const x = array2iterator( [ 2.0, 2.0, -1.0 ] ); +const y = array2iterator( [ 2.0, 6.0, -1.0 ] ); -var it = iterPow( x, y ); +const it = iterPow( x, y ); // returns -var r = it.next().value; +let r = it.next().value; // returns 4.0 r = it.next().value; @@ -73,20 +73,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var x = array2iterator( [ 2.0, 6.0 ] ); +const x = array2iterator( [ 2.0, 6.0 ] ); -var it = iterPow( x, 2.0 ); +const it = iterPow( x, 2.0 ); // returns -var v = it.next().value; +let v = it.next().value; // returns 4.0 v = it.next().value; // returns 36.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -117,25 +117,25 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterPow = require( '@stdlib/math/iter/special/pow' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterPow = require( '@stdlib/math/iter/special/pow' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( 0.0, 2.0, { +const x = uniform( 0.0, 2.0, { 'seed': 1234, 'iter': 10 }); -var y = uniform( -2.0, 2.0, { +const y = uniform( -2.0, 2.0, { 'seed': 4567, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterPow( x, y ); +const it = iterPow( x, y ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/rad2deg/README.md b/lib/node_modules/@stdlib/math/iter/special/rad2deg/README.md index 8066753450da..e66c85f14a42 100644 --- a/lib/node_modules/@stdlib/math/iter/special/rad2deg/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/rad2deg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRad2deg = require( '@stdlib/math/iter/special/rad2deg' ); +const iterRad2deg = require( '@stdlib/math/iter/special/rad2deg' ); ``` #### iterRad2deg( iterator ) @@ -45,12 +45,12 @@ var iterRad2deg = require( '@stdlib/math/iter/special/rad2deg' ); Returns an [iterator][mdn-iterator-protocol] which iteratively converts an angle from radians to degrees. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRad2deg( array2iterator( [ 1.57, 0.785 ] ) ); +const it = iterRad2deg( array2iterator( [ 1.57, 0.785 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~89.954 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRad2deg = require( '@stdlib/math/iter/special/rad2deg' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRad2deg = require( '@stdlib/math/iter/special/rad2deg' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRad2deg( rand ); +const it = iterRad2deg( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/ramp/README.md b/lib/node_modules/@stdlib/math/iter/special/ramp/README.md index dda3be40edb3..5cfc6e9ab972 100644 --- a/lib/node_modules/@stdlib/math/iter/special/ramp/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/ramp/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRamp = require( '@stdlib/math/iter/special/ramp' ); +const iterRamp = require( '@stdlib/math/iter/special/ramp' ); ``` #### iterRamp( iterator ) @@ -45,12 +45,12 @@ var iterRamp = require( '@stdlib/math/iter/special/ramp' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [ramp function][@stdlib/math/base/special/ramp]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRamp( array2iterator( [ 4.0, -1.5, -0.5 ] ) ); +const it = iterRamp( array2iterator( [ 4.0, -1.5, -0.5 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 4.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRamp = require( '@stdlib/math/iter/special/ramp' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRamp = require( '@stdlib/math/iter/special/ramp' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRamp( rand ); +const it = iterRamp( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/riemann-zeta/README.md b/lib/node_modules/@stdlib/math/iter/special/riemann-zeta/README.md index e57a77e61b59..48faa16c2b8e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/riemann-zeta/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/riemann-zeta/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterZeta = require( '@stdlib/math/iter/special/riemann-zeta' ); +const iterZeta = require( '@stdlib/math/iter/special/riemann-zeta' ); ``` #### iterZeta( iterator ) @@ -45,12 +45,12 @@ var iterZeta = require( '@stdlib/math/iter/special/riemann-zeta' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [Riemann zeta][@stdlib/math/base/special/riemann-zeta] function. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterZeta( array2iterator( [ 1.1, -4.0 ] ) ); +const it = iterZeta( array2iterator( [ 1.1, -4.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~10.584 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterZeta = require( '@stdlib/math/iter/special/riemann-zeta' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterZeta = require( '@stdlib/math/iter/special/riemann-zeta' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 1.1, 50.0, { +const rand = uniform( 1.1, 50.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterZeta( rand ); +const it = iterZeta( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/round/README.md b/lib/node_modules/@stdlib/math/iter/special/round/README.md index 32e5b513cfdc..15765940cf79 100644 --- a/lib/node_modules/@stdlib/math/iter/special/round/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/round/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRound = require( '@stdlib/math/iter/special/round' ); +const iterRound = require( '@stdlib/math/iter/special/round' ); ``` #### iterRound( iterator ) @@ -45,12 +45,12 @@ var iterRound = require( '@stdlib/math/iter/special/round' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/round] each iterated value to the nearest integer. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRound( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); +const it = iterRound( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 3.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRound = require( '@stdlib/math/iter/special/round' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRound = require( '@stdlib/math/iter/special/round' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRound( rand ); +const it = iterRound( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/round10/README.md b/lib/node_modules/@stdlib/math/iter/special/round10/README.md index 99108b2efef2..fba08f146d17 100644 --- a/lib/node_modules/@stdlib/math/iter/special/round10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/round10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRound10 = require( '@stdlib/math/iter/special/round10' ); +const iterRound10 = require( '@stdlib/math/iter/special/round10' ); ``` #### iterRound10( iterator ) @@ -45,12 +45,12 @@ var iterRound10 = require( '@stdlib/math/iter/special/round10' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/round10] each iterated value to the nearest power of `10` on a linear scale. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRound10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterRound10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 10.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRound10 = require( '@stdlib/math/iter/special/round10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRound10 = require( '@stdlib/math/iter/special/round10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRound10( rand ); +const it = iterRound10( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/round2/README.md b/lib/node_modules/@stdlib/math/iter/special/round2/README.md index e02c9f5dbac5..9aaab33eea13 100644 --- a/lib/node_modules/@stdlib/math/iter/special/round2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/round2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRound2 = require( '@stdlib/math/iter/special/round2' ); +const iterRound2 = require( '@stdlib/math/iter/special/round2' ); ``` #### iterRound2( iterator ) @@ -45,12 +45,12 @@ var iterRound2 = require( '@stdlib/math/iter/special/round2' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/round2] each iterated value to the nearest power of two on a linear scale. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRound2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterRound2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 8.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRound2 = require( '@stdlib/math/iter/special/round2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRound2 = require( '@stdlib/math/iter/special/round2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRound2( rand ); +const it = iterRound2( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/rsqrt/README.md b/lib/node_modules/@stdlib/math/iter/special/rsqrt/README.md index 6d427ca1c5d3..27cf5c4148a7 100644 --- a/lib/node_modules/@stdlib/math/iter/special/rsqrt/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/rsqrt/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterRsqrt = require( '@stdlib/math/iter/special/rsqrt' ); +const iterRsqrt = require( '@stdlib/math/iter/special/rsqrt' ); ``` #### iterRsqrt( iterator ) @@ -45,12 +45,12 @@ var iterRsqrt = require( '@stdlib/math/iter/special/rsqrt' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the reciprocal (inverse) [square root][@stdlib/math/base/special/rsqrt]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterRsqrt( array2iterator( [ 1, 4, 9 ] ) ); +const it = iterRsqrt( array2iterator( [ 1, 4, 9 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterRsqrt = require( '@stdlib/math/iter/special/rsqrt' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterRsqrt = require( '@stdlib/math/iter/special/rsqrt' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterRsqrt( rand ); +const it = iterRsqrt( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/signum/README.md b/lib/node_modules/@stdlib/math/iter/special/signum/README.md index 537fa8937b0d..70da0f53c06b 100644 --- a/lib/node_modules/@stdlib/math/iter/special/signum/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/signum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSignum = require( '@stdlib/math/iter/special/signum' ); +const iterSignum = require( '@stdlib/math/iter/special/signum' ); ``` #### iterSignum( iterator ) @@ -45,12 +45,12 @@ var iterSignum = require( '@stdlib/math/iter/special/signum' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [signum function][@stdlib/math/base/special/signum]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSignum( array2iterator( [ 4.0, -1.5, 0.0, -0.0 ] ) ); +const it = iterSignum( array2iterator( [ 4.0, -1.5, 0.0, -0.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -96,20 +96,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSignum = require( '@stdlib/math/iter/special/signum' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSignum = require( '@stdlib/math/iter/special/signum' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSignum( rand ); +const it = iterSignum( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sin/README.md b/lib/node_modules/@stdlib/math/iter/special/sin/README.md index 9ccda0d653b8..b469434707fb 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSin = require( '@stdlib/math/iter/special/sin' ); +const iterSin = require( '@stdlib/math/iter/special/sin' ); ``` #### iterSin( iterator ) @@ -45,13 +45,13 @@ var iterSin = require( '@stdlib/math/iter/special/sin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [sine][@stdlib/math/base/special/sin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var src = [ 0.0, 3.141592653589793/2.0, -3.141592653589793/6.0 ]; -var it = iterSin( array2iterator( src ) ); +const src = [ 0.0, 3.141592653589793/2.0, -3.141592653589793/6.0 ]; +const it = iterSin( array2iterator( src ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns ~0.0 r = it.next().value; @@ -94,20 +94,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterSin = require( '@stdlib/math/iter/special/sin' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterSin = require( '@stdlib/math/iter/special/sin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSin( rand ); +const it = iterSin( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sinc/README.md b/lib/node_modules/@stdlib/math/iter/special/sinc/README.md index 2b9ac97cecc2..8e99423b9008 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sinc/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sinc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSinc = require( '@stdlib/math/iter/special/sinc' ); +const iterSinc = require( '@stdlib/math/iter/special/sinc' ); ``` #### iterSinc( iterator ) @@ -45,12 +45,12 @@ var iterSinc = require( '@stdlib/math/iter/special/sinc' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the normalized [cardinal sine][@stdlib/math/base/special/sinc]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSinc( array2iterator( [ 0.5, -1.2 ] ) ); +const it = iterSinc( array2iterator( [ 0.5, -1.2 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.637 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSinc = require( '@stdlib/math/iter/special/sinc' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSinc = require( '@stdlib/math/iter/special/sinc' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSinc( rand ); +const it = iterSinc( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sinh/README.md b/lib/node_modules/@stdlib/math/iter/special/sinh/README.md index bf237f1f470e..da2329723f21 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sinh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sinh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSinh = require( '@stdlib/math/iter/special/sinh' ); +const iterSinh = require( '@stdlib/math/iter/special/sinh' ); ``` #### iterSinh( iterator ) @@ -45,12 +45,12 @@ var iterSinh = require( '@stdlib/math/iter/special/sinh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [hyperbolic sine][@stdlib/math/base/special/sinh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSinh( array2iterator( [ 0.0, 2.0 ] ) ); +const it = iterSinh( array2iterator( [ 0.0, 2.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSinh = require( '@stdlib/math/iter/special/sinh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSinh = require( '@stdlib/math/iter/special/sinh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -5.0, 5.0, { +const rand = uniform( -5.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSinh( rand ); +const it = iterSinh( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sinpi/README.md b/lib/node_modules/@stdlib/math/iter/special/sinpi/README.md index 6b022c41ebcf..a0067f92b33a 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sinpi/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sinpi/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSinpi = require( '@stdlib/math/iter/special/sinpi' ); +const iterSinpi = require( '@stdlib/math/iter/special/sinpi' ); ``` #### iterSinpi( iterator ) @@ -45,13 +45,13 @@ var iterSinpi = require( '@stdlib/math/iter/special/sinpi' ); Returns an [iterator][mdn-iterator-protocol] which computes the [sine][@stdlib/math/base/special/sinpi] of each iterated value times π. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var src = [ 0.0, 0.5, 0.1 ]; -var it = iterSinpi( array2iterator( src ) ); +const src = [ 0.0, 0.5, 0.1 ]; +const it = iterSinpi( array2iterator( src ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -95,20 +95,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var iterSinpi = require( '@stdlib/math/iter/special/sinpi' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iterSinpi = require( '@stdlib/math/iter/special/sinpi' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSinpi( rand ); +const it = iterSinpi( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/spence/README.md b/lib/node_modules/@stdlib/math/iter/special/spence/README.md index d717fd61ed9a..ccff924d3081 100644 --- a/lib/node_modules/@stdlib/math/iter/special/spence/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/spence/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSpence = require( '@stdlib/math/iter/special/spence' ); +const iterSpence = require( '@stdlib/math/iter/special/spence' ); ``` #### iterSpence( iterator ) @@ -45,12 +45,12 @@ var iterSpence = require( '@stdlib/math/iter/special/spence' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates [Spence's function][@stdlib/math/base/special/spence]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSpence( array2iterator( [ 0.0, 3.0 ] ) ); +const it = iterSpence( array2iterator( [ 0.0, 3.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~1.645 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSpence = require( '@stdlib/math/iter/special/spence' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSpence = require( '@stdlib/math/iter/special/spence' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 100.0, { +const rand = uniform( 0.0, 100.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSpence( rand ); +const it = iterSpence( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sqrt/README.md b/lib/node_modules/@stdlib/math/iter/special/sqrt/README.md index 7f0e547716d4..497092c2ab93 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sqrt/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sqrt/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSqrt = require( '@stdlib/math/iter/special/sqrt' ); +const iterSqrt = require( '@stdlib/math/iter/special/sqrt' ); ``` #### iterSqrt( iterator ) @@ -45,12 +45,12 @@ var iterSqrt = require( '@stdlib/math/iter/special/sqrt' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the principal [square root][@stdlib/math/base/special/sqrt]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSqrt( array2iterator( [ 1, 4, 9 ] ) ); +const it = iterSqrt( array2iterator( [ 1, 4, 9 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSqrt = require( '@stdlib/math/iter/special/sqrt' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSqrt = require( '@stdlib/math/iter/special/sqrt' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 1000.0, { +const rand = uniform( 0.0, 1000.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSqrt( rand ); +const it = iterSqrt( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/sqrt1pm1/README.md b/lib/node_modules/@stdlib/math/iter/special/sqrt1pm1/README.md index 1b1c775b4345..ff50bc6363a7 100644 --- a/lib/node_modules/@stdlib/math/iter/special/sqrt1pm1/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/sqrt1pm1/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterSqrt1pm1 = require( '@stdlib/math/iter/special/sqrt1pm1' ); +const iterSqrt1pm1 = require( '@stdlib/math/iter/special/sqrt1pm1' ); ``` #### iterSqrt1pm1( iterator ) @@ -45,12 +45,12 @@ var iterSqrt1pm1 = require( '@stdlib/math/iter/special/sqrt1pm1' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes [`sqrt(1+x) - 1`][@stdlib/math/base/special/sqrt1pm1] more accurately for small `x`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterSqrt1pm1( array2iterator( [ 3.0, 0.5 ] ) ); +const it = iterSqrt1pm1( array2iterator( [ 3.0, 0.5 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterSqrt1pm1 = require( '@stdlib/math/iter/special/sqrt1pm1' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterSqrt1pm1 = require( '@stdlib/math/iter/special/sqrt1pm1' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 100.0, { +const rand = uniform( 0.0, 100.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterSqrt1pm1( rand ); +const it = iterSqrt1pm1( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/tan/README.md b/lib/node_modules/@stdlib/math/iter/special/tan/README.md index 57355d93e44b..58face209ff5 100644 --- a/lib/node_modules/@stdlib/math/iter/special/tan/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/tan/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTan = require( '@stdlib/math/iter/special/tan' ); +const iterTan = require( '@stdlib/math/iter/special/tan' ); ``` #### iterTan( iterator ) @@ -45,12 +45,12 @@ var iterTan = require( '@stdlib/math/iter/special/tan' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [tangent][@stdlib/math/base/special/tan]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTan( array2iterator( [ 0.0, 1.57 ] ) ); +const it = iterTan( array2iterator( [ 0.0, 1.57 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTan = require( '@stdlib/math/iter/special/tan' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTan = require( '@stdlib/math/iter/special/tan' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -1.57, 1.57, { +const rand = uniform( -1.57, 1.57, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTan( rand ); +const it = iterTan( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/tanh/README.md b/lib/node_modules/@stdlib/math/iter/special/tanh/README.md index 02c806322425..f2b8cc2618b7 100644 --- a/lib/node_modules/@stdlib/math/iter/special/tanh/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/tanh/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTanh = require( '@stdlib/math/iter/special/tanh' ); +const iterTanh = require( '@stdlib/math/iter/special/tanh' ); ``` #### iterTanh( iterator ) @@ -45,12 +45,12 @@ var iterTanh = require( '@stdlib/math/iter/special/tanh' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [hyperbolic tangent][@stdlib/math/base/special/tanh]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTanh( array2iterator( [ 0.0, 2.0 ] ) ); +const it = iterTanh( array2iterator( [ 0.0, 2.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTanh = require( '@stdlib/math/iter/special/tanh' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTanh = require( '@stdlib/math/iter/special/tanh' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -4.0, 4.0, { +const rand = uniform( -4.0, 4.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTanh( rand ); +const it = iterTanh( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/trigamma/README.md b/lib/node_modules/@stdlib/math/iter/special/trigamma/README.md index a238cde32cbe..de6882872cbf 100644 --- a/lib/node_modules/@stdlib/math/iter/special/trigamma/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/trigamma/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTrigamma = require( '@stdlib/math/iter/special/trigamma' ); +const iterTrigamma = require( '@stdlib/math/iter/special/trigamma' ); ``` #### iterTrigamma( iterator ) @@ -45,12 +45,12 @@ var iterTrigamma = require( '@stdlib/math/iter/special/trigamma' ); Returns an [iterator][mdn-iterator-protocol] which iteratively evaluates the [trigamma function][@stdlib/math/base/special/trigamma]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTrigamma( array2iterator( [ -2.5, 1.0 ] ) ); +const it = iterTrigamma( array2iterator( [ -2.5, 1.0 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~9.539 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTrigamma = require( '@stdlib/math/iter/special/trigamma' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTrigamma = require( '@stdlib/math/iter/special/trigamma' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.01, 50.0, { +const rand = uniform( 0.01, 50.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTrigamma( rand ); +const it = iterTrigamma( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/trunc/README.md b/lib/node_modules/@stdlib/math/iter/special/trunc/README.md index af28f23a93fc..b2e9f4656579 100644 --- a/lib/node_modules/@stdlib/math/iter/special/trunc/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/trunc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTrunc = require( '@stdlib/math/iter/special/trunc' ); +const iterTrunc = require( '@stdlib/math/iter/special/trunc' ); ``` #### iterTrunc( iterator ) @@ -45,12 +45,12 @@ var iterTrunc = require( '@stdlib/math/iter/special/trunc' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/trunc] each iterated value toward zero. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTrunc( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); +const it = iterTrunc( array2iterator( [ 2.5, -1.5, 10.3 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 2.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTrunc = require( '@stdlib/math/iter/special/trunc' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTrunc = require( '@stdlib/math/iter/special/trunc' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -2.0, 2.0, { +const rand = uniform( -2.0, 2.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTrunc( rand ); +const it = iterTrunc( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/trunc10/README.md b/lib/node_modules/@stdlib/math/iter/special/trunc10/README.md index e9a4f6412ad1..20b411aa6a4e 100644 --- a/lib/node_modules/@stdlib/math/iter/special/trunc10/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/trunc10/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTrunc10 = require( '@stdlib/math/iter/special/trunc10' ); +const iterTrunc10 = require( '@stdlib/math/iter/special/trunc10' ); ``` #### iterTrunc10( iterator ) @@ -45,12 +45,12 @@ var iterTrunc10 = require( '@stdlib/math/iter/special/trunc10' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/trunc10] each iterated value to the nearest power of `10` toward zero. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTrunc10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterTrunc10( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTrunc10 = require( '@stdlib/math/iter/special/trunc10' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTrunc10 = require( '@stdlib/math/iter/special/trunc10' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTrunc10( rand ); +const it = iterTrunc10( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/trunc2/README.md b/lib/node_modules/@stdlib/math/iter/special/trunc2/README.md index 2b1d37a38b21..7a94f7d766aa 100644 --- a/lib/node_modules/@stdlib/math/iter/special/trunc2/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/trunc2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterTrunc2 = require( '@stdlib/math/iter/special/trunc2' ); +const iterTrunc2 = require( '@stdlib/math/iter/special/trunc2' ); ``` #### iterTrunc2( iterator ) @@ -45,12 +45,12 @@ var iterTrunc2 = require( '@stdlib/math/iter/special/trunc2' ); Returns an [iterator][mdn-iterator-protocol] which [rounds][@stdlib/math/base/special/trunc2] each iterated value to the nearest power of two toward zero. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterTrunc2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); +const it = iterTrunc2( array2iterator( [ 9.5, 13.0, -13.0 ] ) ); // returns -var r = it.next().value; +let r = it.next().value; // returns 8.0 r = it.next().value; @@ -93,20 +93,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterTrunc2 = require( '@stdlib/math/iter/special/trunc2' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterTrunc2 = require( '@stdlib/math/iter/special/trunc2' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( -200.0, 200.0, { +const rand = uniform( -200.0, 200.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterTrunc2( rand ); +const it = iterTrunc2( rand ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/vercos/README.md b/lib/node_modules/@stdlib/math/iter/special/vercos/README.md index 0c92d67ebaff..a7aab26e4844 100644 --- a/lib/node_modules/@stdlib/math/iter/special/vercos/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/vercos/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterVercos = require( '@stdlib/math/iter/special/vercos' ); +const iterVercos = require( '@stdlib/math/iter/special/vercos' ); ``` #### iterVercos( iterator ) @@ -45,12 +45,12 @@ var iterVercos = require( '@stdlib/math/iter/special/vercos' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [versed cosine][@stdlib/math/base/special/vercos]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterVercos( array2iterator( [ 0.0, 1.57 ] ) ); +const it = iterVercos( array2iterator( [ 0.0, 1.57 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 2.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterVercos = require( '@stdlib/math/iter/special/vercos' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterVercos = require( '@stdlib/math/iter/special/vercos' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterVercos( rand ); +const it = iterVercos( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/special/versin/README.md b/lib/node_modules/@stdlib/math/iter/special/versin/README.md index fc7eb48b183c..05483dab5f81 100644 --- a/lib/node_modules/@stdlib/math/iter/special/versin/README.md +++ b/lib/node_modules/@stdlib/math/iter/special/versin/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterVersin = require( '@stdlib/math/iter/special/versin' ); +const iterVersin = require( '@stdlib/math/iter/special/versin' ); ``` #### iterVersin( iterator ) @@ -45,12 +45,12 @@ var iterVersin = require( '@stdlib/math/iter/special/versin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [versed sine][@stdlib/math/base/special/versin]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var it = iterVersin( array2iterator( [ 0.0, 1.57 ] ) ); +const it = iterVersin( array2iterator( [ 0.0, 1.57 ] ) ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -90,20 +90,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var iterVersin = require( '@stdlib/math/iter/special/versin' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const iterVersin = require( '@stdlib/math/iter/special/versin' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = uniform( 0.0, 6.28, { +const rand = uniform( 0.0, 6.28, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterVersin( rand ); +const it = iterVersin( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/tools/README.md b/lib/node_modules/@stdlib/math/iter/tools/README.md index 50ab30431f9e..a300eef13520 100644 --- a/lib/node_modules/@stdlib/math/iter/tools/README.md +++ b/lib/node_modules/@stdlib/math/iter/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter/tools' ); +const ns = require( '@stdlib/math/iter/tools' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter/tools' ); Namespace containing math iterator tools. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace exposes the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/iter/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/iter/tools' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/iter/tools/map/README.md b/lib/node_modules/@stdlib/math/iter/tools/map/README.md index da591e1928d1..6273936dd332 100644 --- a/lib/node_modules/@stdlib/math/iter/tools/map/README.md +++ b/lib/node_modules/@stdlib/math/iter/tools/map/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMap = require( '@stdlib/math/iter/tools/map' ); +const iterMap = require( '@stdlib/math/iter/tools/map' ); ``` #### iterMap( iterator, fcn\[, options] ) @@ -45,13 +45,13 @@ var iterMap = require( '@stdlib/math/iter/tools/map' ); Returns an [iterator][mdn-iterator-protocol] which invokes a unary `function` accepting a single numeric argument for each iterated value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var sin = require( '@stdlib/math/base/special/sin' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const sin = require( '@stdlib/math/base/special/sin' ); -var it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), sin ); +const it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), sin ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -73,16 +73,16 @@ The invoked `function` is provided one argument: - `value`: iterated value ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( v ) { return v + 10; } -var it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); +const it = iterMap( array2iterator( [ 1, 2, 3, 4 ] ), fcn ); // returns -var r = it.next().value; +let r = it.next().value; // returns 11 r = it.next().value; @@ -101,16 +101,16 @@ The function supports the following `options`: By default, the function returns an [iterator][mdn-iterator-protocol] which returns `NaN` when an input [iterator][mdn-iterator-protocol] yields a non-numeric value. To specify a different return value, set the `invalid` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var sin = require( '@stdlib/math/base/special/sin' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const sin = require( '@stdlib/math/base/special/sin' ); -var opts = { +const opts = { 'invalid': null }; -var it = iterMap( array2iterator( [ '1', '2', '3' ] ), sin, opts ); +const it = iterMap( array2iterator( [ '1', '2', '3' ] ), sin, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns null v = it.next().value; @@ -144,21 +144,21 @@ v = it.next().value; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var sin = require( '@stdlib/math/base/special/sin' ); -var iterMap = require( '@stdlib/math/iter/tools/map' ); +const randu = require( '@stdlib/random/iter/randu' ); +const sin = require( '@stdlib/math/base/special/sin' ); +const iterMap = require( '@stdlib/math/iter/tools/map' ); // Create a seeded iterator for generating pseudorandom numbers: -var rand = randu({ +const rand = randu({ 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterator: -var it = iterMap( rand, sin ); +const it = iterMap( rand, sin ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/tools/map2/README.md b/lib/node_modules/@stdlib/math/iter/tools/map2/README.md index 33a012e4f46d..70fb72357c57 100644 --- a/lib/node_modules/@stdlib/math/iter/tools/map2/README.md +++ b/lib/node_modules/@stdlib/math/iter/tools/map2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMap2 = require( '@stdlib/math/iter/tools/map2' ); +const iterMap2 = require( '@stdlib/math/iter/tools/map2' ); ``` #### iterMap2( iter0, iter1, fcn\[, options] ) @@ -45,16 +45,16 @@ var iterMap2 = require( '@stdlib/math/iter/tools/map2' ); Returns an [iterator][mdn-iterator-protocol] which invokes a binary `function` accepting numeric arguments for each iterated value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var copysign = require( '@stdlib/math/base/special/copysign' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); -var it1 = array2iterator( [ 1.0, 2.0, 3.0, 4.0 ] ); -var it2 = array2iterator( [ 1.0, -1.0, -1.0, 1.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0, 3.0, 4.0 ] ); +const it2 = array2iterator( [ 1.0, -1.0, -1.0, 1.0 ] ); -var it = iterMap2( it1, it2, copysign ); +const it = iterMap2( it1, it2, copysign ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -77,19 +77,19 @@ The invoked `function` is provided two arguments: - `y`: iterated value from second input [iterator][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( x, y ) { return x + y + 10; } -var it1 = array2iterator( [ 1, 2, 3, 4 ] ); -var it2 = array2iterator( [ 1, 2, 3, 4 ] ); +const it1 = array2iterator( [ 1, 2, 3, 4 ] ); +const it2 = array2iterator( [ 1, 2, 3, 4 ] ); -var it = iterMap2( it1, it2, fcn ); +const it = iterMap2( it1, it2, fcn ); // returns -var r = it.next().value; +let r = it.next().value; // returns 12 r = it.next().value; @@ -108,19 +108,19 @@ The function supports the following `options`: By default, the function returns an [iterator][mdn-iterator-protocol] which returns `NaN` when an input [iterator][mdn-iterator-protocol] yields a non-numeric value. To specify a different return value, set the `invalid` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var copysign = require( '@stdlib/math/base/special/copysign' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); -var it1 = array2iterator( [ '1.0', '2.0', '3.0' ] ); -var it2 = array2iterator( [ 1.0, 2.0, 3.0 ] ); +const it1 = array2iterator( [ '1.0', '2.0', '3.0' ] ); +const it2 = array2iterator( [ 1.0, 2.0, 3.0 ] ); -var opts = { +const opts = { 'invalid': null }; -var it = iterMap2( it1, it2, copysign, opts ); +const it = iterMap2( it1, it2, copysign, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns null v = it.next().value; @@ -132,21 +132,21 @@ v = it.next().value; If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var copysign = require( '@stdlib/math/base/special/copysign' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); -var it1 = array2iterator( [ 1.0, 2.0 ] ); +const it1 = array2iterator( [ 1.0, 2.0 ] ); -var it = iterMap2( it1, -4.0, copysign ); +const it = iterMap2( it1, -4.0, copysign ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1.0 v = it.next().value; // returns -2.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -177,27 +177,27 @@ var bool = it.next().done; ```javascript -var randu = require( '@stdlib/random/iter/randu' ); -var uniform = require( '@stdlib/random/iter/uniform' ); -var copysign = require( '@stdlib/math/base/special/copysign' ); -var iterMap2 = require( '@stdlib/math/iter/tools/map2' ); +const randu = require( '@stdlib/random/iter/randu' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const copysign = require( '@stdlib/math/base/special/copysign' ); +const iterMap2 = require( '@stdlib/math/iter/tools/map2' ); // Create seeded iterators for generating pseudorandom numbers: -var rand1 = randu({ +const rand1 = randu({ 'seed': 1234, 'iter': 10 }); -var rand2 = uniform( -1.0, 1.0, { +const rand2 = uniform( -1.0, 1.0, { 'seed': 1234, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterMap2( rand1, rand2, copysign ); +const it = iterMap2( rand1, rand2, copysign ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/tools/map3/README.md b/lib/node_modules/@stdlib/math/iter/tools/map3/README.md index 80b91630551a..2ce00fff327b 100644 --- a/lib/node_modules/@stdlib/math/iter/tools/map3/README.md +++ b/lib/node_modules/@stdlib/math/iter/tools/map3/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterMap3 = require( '@stdlib/math/iter/tools/map3' ); +const iterMap3 = require( '@stdlib/math/iter/tools/map3' ); ``` #### iterMap3( iter0, iter1, iter2, fcn\[, options] ) @@ -45,17 +45,17 @@ var iterMap3 = require( '@stdlib/math/iter/tools/map3' ); Returns an [iterator][mdn-iterator-protocol] which invokes a ternary `function` accepting numeric arguments for each iterated value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var clamp = require( '@stdlib/math/base/special/clamp' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); -var x = array2iterator( [ 1.0, -2.0, 3.0, 14.0 ] ); -var min = array2iterator( [ 1.0, 0.0, -1.0, 1.0 ] ); -var max = array2iterator( [ 10.0, 10.0, 2.0, 10.0 ] ); +const x = array2iterator( [ 1.0, -2.0, 3.0, 14.0 ] ); +const min = array2iterator( [ 1.0, 0.0, -1.0, 1.0 ] ); +const max = array2iterator( [ 10.0, 10.0, 2.0, 10.0 ] ); -var it = iterMap3( x, min, max, clamp ); +const it = iterMap3( x, min, max, clamp ); // returns -var r = it.next().value; +let r = it.next().value; // returns 1.0 r = it.next().value; @@ -79,20 +79,20 @@ The invoked `function` is provided three arguments: - `z`: iterated value from third input [iterator][mdn-iterator-protocol]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); function fcn( x, y, z ) { return x + y + z + 10; } -var it1 = array2iterator( [ 1, 2, 3, 4 ] ); -var it2 = array2iterator( [ 1, 2, 3, 4 ] ); -var it3 = array2iterator( [ 1, 2, 3, 4 ] ); +const it1 = array2iterator( [ 1, 2, 3, 4 ] ); +const it2 = array2iterator( [ 1, 2, 3, 4 ] ); +const it3 = array2iterator( [ 1, 2, 3, 4 ] ); -var it = iterMap3( it1, it2, it3, fcn ); +const it = iterMap3( it1, it2, it3, fcn ); // returns -var r = it.next().value; +let r = it.next().value; // returns 13 r = it.next().value; @@ -111,20 +111,20 @@ The function supports the following `options`: By default, the function returns an [iterator][mdn-iterator-protocol] which returns `NaN` when an input [iterator][mdn-iterator-protocol] yields a non-numeric value. To specify a different return value, set the `invalid` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var clamp = require( '@stdlib/math/base/special/clamp' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); -var it1 = array2iterator( [ '1.0', '2.0', '3.0' ] ); -var it2 = array2iterator( [ 0.0, 0.0, 0.0 ] ); -var it3 = array2iterator( [ 10.0, 10.0, 10.0 ] ); +const it1 = array2iterator( [ '1.0', '2.0', '3.0' ] ); +const it2 = array2iterator( [ 0.0, 0.0, 0.0 ] ); +const it3 = array2iterator( [ 10.0, 10.0, 10.0 ] ); -var opts = { +const opts = { 'invalid': null }; -var it = iterMap3( it1, it2, it3, clamp, opts ); +const it = iterMap3( it1, it2, it3, clamp, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns null v = it.next().value; @@ -136,21 +136,21 @@ v = it.next().value; If provided a numeric value as an [`iterator`][mdn-iterator-protocol] argument, the value is broadcast as an **infinite** [iterator][mdn-iterator-protocol] which **always** returns the provided value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var clamp = require( '@stdlib/math/base/special/clamp' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); -var x = array2iterator( [ -1.0, 20.0 ] ); +const x = array2iterator( [ -1.0, 20.0 ] ); -var it = iterMap3( x, 0.0, 10.0, clamp ); +const it = iterMap3( x, 0.0, 10.0, clamp ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; // returns 10.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -181,31 +181,31 @@ var bool = it.next().done; ```javascript -var uniform = require( '@stdlib/random/iter/uniform' ); -var clamp = require( '@stdlib/math/base/special/clamp' ); -var iterMap3 = require( '@stdlib/math/iter/tools/map3' ); +const uniform = require( '@stdlib/random/iter/uniform' ); +const clamp = require( '@stdlib/math/base/special/clamp' ); +const iterMap3 = require( '@stdlib/math/iter/tools/map3' ); // Create seeded iterators for generating pseudorandom numbers: -var x = uniform( 0.0, 10.0, { +const x = uniform( 0.0, 10.0, { 'seed': 1234, 'iter': 10 }); -var min = uniform( 0.0, 1.0, { +const min = uniform( 0.0, 1.0, { 'seed': 4567, 'iter': 10 }); -var max = uniform( 9.0, 10.0, { +const max = uniform( 9.0, 10.0, { 'seed': 7895, 'iter': 10 }); // Create an iterator which consumes the pseudorandom number iterators: -var it = iterMap3( x, min, max, clamp ); +const it = iterMap3( x, min, max, clamp ); // Perform manual iteration... -var r; +let r; while ( true ) { r = it.next(); if ( r.done ) { diff --git a/lib/node_modules/@stdlib/math/iter/utils/README.md b/lib/node_modules/@stdlib/math/iter/utils/README.md index c9e8ca2747a0..1116c921404c 100644 --- a/lib/node_modules/@stdlib/math/iter/utils/README.md +++ b/lib/node_modules/@stdlib/math/iter/utils/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/iter/utils' ); +const ns = require( '@stdlib/math/iter/utils' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/iter/utils' ); Namespace containing math utility iterators. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following interfaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/iter/utils' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/iter/utils' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/iter/utils/continued-fraction/README.md b/lib/node_modules/@stdlib/math/iter/utils/continued-fraction/README.md index 814ef1a6ca27..ec76287eb2c4 100644 --- a/lib/node_modules/@stdlib/math/iter/utils/continued-fraction/README.md +++ b/lib/node_modules/@stdlib/math/iter/utils/continued-fraction/README.md @@ -67,7 +67,7 @@ where the values `b_i` are called the **coefficients** or **terms** of the conti ## Usage ```javascript -var iterContinuedFraction = require( '@stdlib/math/iter/utils/continued-fraction' ); +const iterContinuedFraction = require( '@stdlib/math/iter/utils/continued-fraction' ); ``` #### iterContinuedFraction( iterator\[, options] ) @@ -75,11 +75,11 @@ var iterContinuedFraction = require( '@stdlib/math/iter/utils/continued-fraction Evaluates the terms of a continued fraction. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 3, 4, 12, 4 ] ); +const arr = array2iterator( [ 3, 4, 12, 4 ] ); -var v = iterContinuedFraction( arr ); +const v = iterContinuedFraction( arr ); // returns ~3.245 ``` @@ -91,29 +91,29 @@ The function supports the following `options`: To explicitly cap the maximum number of iterations, set the `iter` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 3, 4, 12, 4 ] ); +const arr = array2iterator( [ 3, 4, 12, 4 ] ); -var opts = { +const opts = { 'iter': 2 }; -var v = iterContinuedFraction( arr, opts ); +const v = iterContinuedFraction( arr, opts ); // returns 3.25 ``` The function terminates continued fraction evaluation once the difference between continued fraction approximations is sufficiently small. The default tolerance is [floating-point epsilon][@stdlib/constants/float64/eps] (`~2.22e-16`). Once an update to a continued fraction approximation is less than or equal to this tolerance, the function terminates evaluation. To adjust the tolerance (e.g., to return a rough approximation), set the `tol` option. ```javascript -var iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); +const iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); -var opts = { +const opts = { 'tol': 1.0e-7 }; -var it = iterContinuedFractionSeq( 3.141592653589793, opts ); +const it = iterContinuedFractionSeq( 3.141592653589793, opts ); // returns -var v = iterContinuedFraction( it ); +const v = iterContinuedFraction( it ); // returns ~3.14159292 ``` @@ -142,15 +142,15 @@ var v = iterContinuedFraction( it ); ```javascript -var iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var iterContinuedFraction = require( '@stdlib/math/iter/utils/continued-fraction' ); +const iterContinuedFractionSeq = require( '@stdlib/math/iter/sequences/continued-fraction' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const iterContinuedFraction = require( '@stdlib/math/iter/utils/continued-fraction' ); // Create an iterator for returning the list of continued fraction terms: -var it = iterContinuedFractionSeq( PI ); +const it = iterContinuedFractionSeq( PI ); // Reconstitute the original value: -var v = iterContinuedFraction( it ); +const v = iterContinuedFraction( it ); // returns console.log( 'Value: %d.', v ); diff --git a/lib/node_modules/@stdlib/math/special/README.md b/lib/node_modules/@stdlib/math/special/README.md index b26a676bdecb..03a0c93400bf 100644 --- a/lib/node_modules/@stdlib/math/special/README.md +++ b/lib/node_modules/@stdlib/math/special/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/special' ); +const ns = require( '@stdlib/math/special' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/special' ); Namespace containing special math functions. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -88,8 +88,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/special' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/special' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/special/abs/README.md b/lib/node_modules/@stdlib/math/special/abs/README.md index 3c22fd9c9bb4..5f64df6c42cb 100644 --- a/lib/node_modules/@stdlib/math/special/abs/README.md +++ b/lib/node_modules/@stdlib/math/special/abs/README.md @@ -52,7 +52,7 @@ The [absolute value][absolute-value] is defined as ## Usage ```javascript -var abs = require( '@stdlib/math/special/abs' ); +const abs = require( '@stdlib/math/special/abs' ); ``` #### abs( x\[, options] ) @@ -60,7 +60,7 @@ var abs = require( '@stdlib/math/special/abs' ); Computes the [absolute value][absolute-value]. ```javascript -var y = abs( -1.0 ); +const y = abs( -1.0 ); // returns 1.0 ``` @@ -72,23 +72,23 @@ The function accepts the following arguments: If provided an [`ndarray`][@stdlib/ndarray/ctor], the function returns an [`ndarray`][@stdlib/ndarray/ctor] having the same shape and data type as `x`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 -var y = abs( x ); +const x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 +const y = abs( x ); // returns -var v = y.get( 0, 1 ); +const v = y.get( 0, 1 ); // returns 2.0 ``` If provided an array-like object, the function returns an array-like object having the same length and data type as `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0 ] ); -var y = abs( x ); +let x = new Float64Array( [ -1.0, -2.0 ] ); +let y = abs( x ); // returns [ 1.0, 2.0 ] x = [ -1.0, -2.0 ]; @@ -104,10 +104,10 @@ The function accepts the following `options`: By default, when provided either an [`ndarray`][@stdlib/ndarray/ctor] or an array-like object, the function returns an object of the same "kind" (either an [`ndarray`][@stdlib/ndarray/ctor] or array-like object, respectively) having the same underlying [data type][@stdlib/ndarray/dtypes]. To specify a different output array [data type][@stdlib/ndarray/dtypes], set the `dtype` option. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.0, -2.0 ] ); -var y = abs( x ); +let x = new Float32Array( [ -1.0, -2.0 ] ); +let y = abs( x ); // returns [ 1.0, 2.0 ] x = new Float32Array( [ -1.0, -2.0 ] ); @@ -122,17 +122,17 @@ y = abs( x, { Computes the [absolute value][absolute-value] and assigns results to a provided output array. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 -var y = array( [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ); // 2x2 -var out = abs.assign( x, y ); +const x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 +const y = array( [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ); // 2x2 +const out = abs.assign( x, y ); // returns -var bool = ( out === y ); +const bool = ( out === y ); // returns true -var v = y.get( 0, 1 ); +const v = y.get( 0, 1 ); // returns 2.0 ``` @@ -161,21 +161,20 @@ TODO: broadcasting discussion and example(s). ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var abs = require( '@stdlib/math/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const abs = require( '@stdlib/math/special/abs' ); // Provide a number... -var v = abs( -1.0 ); +const v = abs( -1.0 ); console.log( 'x = %d => abs(x) = %d', -1.0, v ); // Provide an array-like object... -var x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); -var y = abs( x ); +let x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); +let y = abs( x ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x_%d = %d => abs(x_%d) = %d', i, x[ i ], i, y[ i ] ); } @@ -183,10 +182,9 @@ for ( i = 0; i < x.length; i++ ) { x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); y = abs( x ); -var sh = x.shape; -var sub; -for ( i = 0; i < x.length; i++ ) { - sub = ind2sub( sh, i ); +const sh = x.shape; +for ( let i = 0; i < x.length; i++ ) { + const sub = ind2sub( sh, i ); console.log( 'x_%d%d = %d => abs(x_%d%d) = %d', sub[ 0 ], sub[ 1 ], x.iget( i ), sub[ 0 ], sub[ 1 ], y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/strided/README.md b/lib/node_modules/@stdlib/math/strided/README.md index 804d9c677263..5b4e7c69f0bb 100644 --- a/lib/node_modules/@stdlib/math/strided/README.md +++ b/lib/node_modules/@stdlib/math/strided/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/strided' ); +const ns = require( '@stdlib/math/strided' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/strided' ); Namespace containing strided array math functions. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -65,8 +65,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/strided' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/strided' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/strided/ops/README.md b/lib/node_modules/@stdlib/math/strided/ops/README.md index 2ff1726860c9..b2e854ce7e6e 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/strided/ops' ); +const ns = require( '@stdlib/math/strided/ops' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/strided/ops' ); Namespace containing strided array math operations. ```javascript -var ops = ns; +const ops = ns; // returns {...} ``` @@ -69,8 +69,8 @@ The namespace contains the following strided array functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/strided/ops' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/strided/ops' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/strided/ops/add-by/README.md b/lib/node_modules/@stdlib/math/strided/ops/add-by/README.md index 697dee4dc22b..45031308f4e4 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/add-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/add-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var addBy = require( '@stdlib/math/strided/ops/add-by' ); +const addBy = require( '@stdlib/math/strided/ops/add-by' ); ``` #### addBy( N, x, strideX, y, strideY, z, strideZ, clbk\[, thisArg] ) @@ -47,9 +47,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 12.0, 14.0, 16.0, 18.0, 20.0 ] @@ -82,18 +82,18 @@ function accessor( values ) { return values; } -var context = { +const context = { 'count': 0 }; -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy( x.length, x, 1, y, 1, z, 1, accessor, context ); // z => [ 12.0, 14.0, 16.0, 18.0, 20.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -104,9 +104,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy( 3, x, 2, y, -1, z, 1, accessor ); // z => [ 14.0, 15.0, 16.0, 0.0, 0.0, 0.0 ] @@ -115,21 +115,21 @@ addBy( 3, x, 2, y, -1, z, 1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( values ) { return values; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element addBy( 3, x1, -2, y1, 1, z1, 1, accessor ); // z0 => [ 0.0, 0.0, 0.0, 20.0, 19.0, 18.0 ] @@ -144,9 +144,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, accessor ); // z => [ 12.0, 14.0, 16.0, 18.0, 20.0 ] @@ -165,9 +165,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // z => [ 0.0, 0.0, 0.0, 20.0, 19.0, 18.0 ] @@ -188,9 +188,9 @@ addBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // No-op... } - var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; - var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; - var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; + const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; addBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -207,10 +207,10 @@ addBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var addBy = require( '@stdlib/math/strided/ops/add-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const addBy = require( '@stdlib/math/strided/ops/add-by' ); function accessor( values, i ) { if ( (i%3) === 0 ) { @@ -220,13 +220,13 @@ function accessor( values, i ) { return values; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); +const y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); console.log( y ); -var z = filledarray( null, x.length, 'generic' ); +const z = filledarray( null, x.length, 'generic' ); console.log( z ); addBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/ops/add/README.md b/lib/node_modules/@stdlib/math/strided/ops/add/README.md index 2c28f65b2f9c..3acd838fbbf6 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/add/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/add/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var add = require( '@stdlib/math/strided/ops/add' ); +const add = require( '@stdlib/math/strided/ops/add' ); ``` #### add( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) @@ -43,11 +43,11 @@ var add = require( '@stdlib/math/strided/ops/add' ); Adds each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); add( x.length, 'float64', x, 1, 'float64', y, 1, 'float64', z, 1 ); // z => [ -1.0, 3.0, 6.0, -1.0, 9.0 ] @@ -69,11 +69,11 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); add( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); // z => [ 1.0, 5.0, 5.0, 0.0, 0.0, 0.0 ] @@ -82,17 +82,17 @@ add( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element add( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); // z0 => [ 0.0, 0.0, 4.0, 0.0, 7.0, 0.0 ] @@ -103,11 +103,11 @@ add( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); Adds each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); add.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0, 'float64', z, 1, 0 ); // z => [ -1.0, 3.0, 6.0, -1.0, 9.0 ] @@ -122,11 +122,11 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); add.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, 1, 0 ); // z => [ 7.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] @@ -149,27 +149,21 @@ add.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, ```javascript -var uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/strided/ops/add' ); +const uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/strided/ops/add' ); -var dt; -var x; -var y; -var z; -var i; +const dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; -dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; - -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( x ); - y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); + const y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( y ); - z = filledarray( 0.0, x.length, 'generic' ); + const z = filledarray( 0.0, x.length, 'generic' ); console.log( z ); add.ndarray( x.length, dt[ i ], x, 1, 0, dt[ i ], y, 1, 0, 'generic', z, -1, z.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/ops/mul-by/README.md b/lib/node_modules/@stdlib/math/strided/ops/mul-by/README.md index d0267fa08dce..1053e882b223 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/mul-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/mul-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var mulBy = require( '@stdlib/math/strided/ops/mul-by' ); +const mulBy = require( '@stdlib/math/strided/ops/mul-by' ); ``` #### mulBy( N, x, strideX, y, strideY, z, strideZ, clbk\[, thisArg] ) @@ -47,9 +47,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 11.0, 24.0, 39.0, 56.0, 75.0 ] @@ -82,18 +82,18 @@ function accessor( values ) { return values; } -var context = { +const context = { 'count': 0 }; -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy( x.length, x, 1, y, 1, z, 1, accessor, context ); // z => [ 11.0, 24.0, 39.0, 56.0, 75.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -104,9 +104,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy( 3, x, 2, y, -1, z, 1, accessor ); // z => [ 13.0, 36.0, 55.0, 0.0, 0.0, 0.0 ] @@ -115,21 +115,21 @@ mulBy( 3, x, 2, y, -1, z, 1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( values ) { return values; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element mulBy( 3, x1, -2, y1, 1, z1, 1, accessor ); // z0 => [ 0.0, 0.0, 0.0, 84.0, 60.0, 32.0 ] @@ -144,9 +144,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, accessor ); // z => [ 11.0, 24.0, 39.0, 56.0, 75.0 ] @@ -165,9 +165,9 @@ function accessor( values ) { return values; } -var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const y = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // z => [ 0.0, 0.0, 0.0, 84.0, 60.0, 32.0 ] @@ -188,9 +188,9 @@ mulBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // No-op... } - var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; - var y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; - var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + const y = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; + const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mulBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -207,10 +207,10 @@ mulBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var mulBy = require( '@stdlib/math/strided/ops/mul-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const mulBy = require( '@stdlib/math/strided/ops/mul-by' ); function accessor( values, i ) { if ( (i%3) === 0 ) { @@ -220,13 +220,13 @@ function accessor( values, i ) { return values; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); +const y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); console.log( y ); -var z = filledarray( null, x.length, 'generic' ); +const z = filledarray( null, x.length, 'generic' ); console.log( z ); mulBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/ops/mul/README.md b/lib/node_modules/@stdlib/math/strided/ops/mul/README.md index d8244019c44a..b434e2b37eed 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/mul/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/mul/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var mul = require( '@stdlib/math/strided/ops/mul' ); +const mul = require( '@stdlib/math/strided/ops/mul' ); ``` #### mul( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) @@ -43,11 +43,11 @@ var mul = require( '@stdlib/math/strided/ops/mul' ); Multiplies each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); mul( x.length, 'float64', x, 1, 'float64', y, 1, 'float64', z, 1 ); // z => [ -2.0, 2.0, 9.0, -20.0, 20.0 ] @@ -69,11 +69,11 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); mul( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); // z => [ -6.0, 6.0, 4.0, 0.0, 0.0, 0.0 ] @@ -82,17 +82,17 @@ mul( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element mul( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); // z0 => [ 0.0, 0.0, 0.0, -25.0, 6.0, 0.0 ] @@ -103,11 +103,11 @@ mul( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); Multiplies each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); mul.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0, 'float64', z, 1, 0 ); // z => [ -2.0, 2.0, 9.0, -20.0, 20.0 ] @@ -122,11 +122,11 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); mul.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, 1, 0 ); // z => [ 6.0, -25.0, 0.0, 0.0, 0.0, 0.0 ] @@ -149,27 +149,21 @@ mul.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, ```javascript -var uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var mul = require( '@stdlib/math/strided/ops/mul' ); +const uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const mul = require( '@stdlib/math/strided/ops/mul' ); -var dt; -var x; -var y; -var z; -var i; +const dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; -dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; - -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( x ); - y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); + const y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( y ); - z = filledarray( 0.0, x.length, 'generic' ); + const z = filledarray( 0.0, x.length, 'generic' ); console.log( z ); mul.ndarray( x.length, dt[ i ], x, 1, 0, dt[ i ], y, 1, 0, 'generic', z, -1, z.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/ops/sub-by/README.md b/lib/node_modules/@stdlib/math/strided/ops/sub-by/README.md index 6bf860a0a233..4f3b0a10086b 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/sub-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/sub-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var subBy = require( '@stdlib/math/strided/ops/sub-by' ); +const subBy = require( '@stdlib/math/strided/ops/sub-by' ); ``` #### subBy( N, x, strideX, y, strideY, z, strideZ, clbk\[, thisArg] ) @@ -47,9 +47,9 @@ function accessor( values ) { return values; } -var x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 3.0, 5.0, 7.0, 9.0, 11.0 ] @@ -82,18 +82,18 @@ function accessor( values ) { return values; } -var context = { +const context = { 'count': 0 }; -var x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy( x.length, x, 1, y, 1, z, 1, accessor, context ); // z => [ 3.0, 5.0, 7.0, 9.0, 11.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -104,9 +104,9 @@ function accessor( values ) { return values; } -var x = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var y = [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const y = [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy( 3, x, 2, y, -1, z, 1, accessor ); // z => [ 5.0, 6.0, 7.0, 0.0, 0.0, 0.0 ] @@ -115,21 +115,21 @@ subBy( 3, x, 2, y, -1, z, 1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( values ) { return values; } // Initial arrays... -var x0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); -var y0 = new Float64Array( [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); +const y0 = new Float64Array( [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element subBy( 3, x1, -2, y1, 1, z1, 1, accessor ); // z0 => [ 0.0, 0.0, 0.0, 11.0, 10.0, 9.0 ] @@ -144,9 +144,9 @@ function accessor( values ) { return values; } -var x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; -var y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; +const y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, accessor ); // z => [ 3.0, 5.0, 7.0, 9.0, 11.0 ] @@ -165,9 +165,9 @@ function accessor( values ) { return values; } -var x = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; -var y = [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ]; +const y = [ 8.0, 7.0, 6.0, 5.0, 4.0, 3.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // z => [ 0.0, 0.0, 0.0, 11.0, 10.0, 9.0 ] @@ -188,9 +188,9 @@ subBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); // No-op... } - var x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; - var y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; - var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 11.0, 12.0, 13.0, 14.0, 15.0 ]; + const y = [ 8.0, 7.0, 6.0, 5.0, 4.0 ]; + const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; subBy( x.length, x, 1, y, 1, z, 1, accessor ); // z => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -207,10 +207,10 @@ subBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 2, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var subBy = require( '@stdlib/math/strided/ops/sub-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const subBy = require( '@stdlib/math/strided/ops/sub-by' ); function accessor( values, i ) { if ( (i%3) === 0 ) { @@ -220,13 +220,13 @@ function accessor( values, i ) { return values; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); +const y = filledarrayBy( x.length, 'generic', uniform( -10.0, 10.0 ) ); console.log( y ); -var z = filledarray( null, x.length, 'generic' ); +const z = filledarray( null, x.length, 'generic' ); console.log( z ); subBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/ops/sub/README.md b/lib/node_modules/@stdlib/math/strided/ops/sub/README.md index 0fd846f92e7c..6cd3147fe65e 100644 --- a/lib/node_modules/@stdlib/math/strided/ops/sub/README.md +++ b/lib/node_modules/@stdlib/math/strided/ops/sub/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var sub = require( '@stdlib/math/strided/ops/sub' ); +const sub = require( '@stdlib/math/strided/ops/sub' ); ``` #### sub( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) @@ -43,11 +43,11 @@ var sub = require( '@stdlib/math/strided/ops/sub' ); Subtracts each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); sub( x.length, 'float64', x, 1, 'float64', y, 1, 'float64', z, 1 ); // z => [ -3.0, -1.0, 0.0, -9.0, -1.0 ] @@ -69,11 +69,11 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); sub( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); // z => [ -5.0, 1.0, 3.0, 0.0, 0.0, 0.0 ] @@ -82,17 +82,17 @@ sub( 3, 'float64', x, 2, 'float64', y, -1, 'float64', z, 1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element sub( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); // z0 => [ 0.0, 0.0, -4.0, 0.0, -5.0, 0.0 ] @@ -103,11 +103,11 @@ sub( 3, 'float64', x1, -2, 'float64', y1, 1, 'float64', z1, 1 ); Subtracts each element in a strided array `x` to a corresponding element in a strided array `y` and assigns the results to elements in a strided array `z` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( x.length ); sub.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0, 'float64', z, 1, 0 ); // z => [ -3.0, -1.0, 0.0, -9.0, -1.0 ] @@ -122,11 +122,11 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( x.length ); sub.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, 1, 0 ); // z => [ -5.0, 0.0, -4.0, 0.0, 0.0, 0.0 ] @@ -149,27 +149,21 @@ sub.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1, 'float64', z, ```javascript -var uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sub = require( '@stdlib/math/strided/ops/sub' ); +const uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sub = require( '@stdlib/math/strided/ops/sub' ); -var dt; -var x; -var y; -var z; -var i; +const dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; -dt = [ 'float64', 'float32', 'int32', 'uint8', 'generic' ]; - -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( x ); - y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); + const y = filledarrayBy( x.length, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( y ); - z = filledarray( 0.0, x.length, 'generic' ); + const z = filledarray( 0.0, x.length, 'generic' ); console.log( z ); sub.ndarray( x.length, dt[ i ], x, 1, 0, dt[ i ], y, 1, 0, 'generic', z, -1, z.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/README.md b/lib/node_modules/@stdlib/math/strided/special/README.md index 4096f8e83428..012dc32e1563 100644 --- a/lib/node_modules/@stdlib/math/strided/special/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/strided/special' ); +const ns = require( '@stdlib/math/strided/special' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/strided/special' ); Namespace containing strided array special math functions. ```javascript -var special = ns; +const special = ns; // returns {...} ``` @@ -144,8 +144,8 @@ The namespace contains the following strided array functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/strided/special' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/strided/special' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/strided/special/abs-by/README.md b/lib/node_modules/@stdlib/math/strided/special/abs-by/README.md index 8894691d9c82..b3aa0135d18f 100644 --- a/lib/node_modules/@stdlib/math/strided/special/abs-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/abs-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var absBy = require( '@stdlib/math/strided/special/abs-by' ); +const absBy = require( '@stdlib/math/strided/special/abs-by' ); ``` #### absBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy( x.length, x, 1, y, 1, accessor ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v * 2.0; } -var context = { +const context = { 'count': 0 }; -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] -var cnt = context.count; +const cnt = context.count; // returns 8 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy( 3, x, 2, y, -1, accessor ); // y => [ 10.0, 6.0, 2.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ absBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v * 2.0; } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element absBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 2.0, 4.0, 6.0, 8.0, 10.0 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -180,8 +180,8 @@ absBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; absBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ absBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var absBy = require( '@stdlib/math/strided/special/abs-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const absBy = require( '@stdlib/math/strided/special/abs-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -100.0, 100.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -100.0, 100.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); absBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/abs/README.md b/lib/node_modules/@stdlib/math/strided/special/abs/README.md index f6e898415c55..67cc8d72817e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/abs/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/abs/README.md @@ -48,7 +48,7 @@ The [absolute value][@stdlib/math/base/special/abs] is defined as ## Usage ```javascript -var abs = require( '@stdlib/math/strided/special/abs' ); +const abs = require( '@stdlib/math/strided/special/abs' ); ``` #### abs( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -56,9 +56,9 @@ var abs = require( '@stdlib/math/strided/special/abs' ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: abs( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -78,10 +78,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -90,15 +90,15 @@ abs( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element abs( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -109,10 +109,10 @@ abs( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a strided array `x` and assigns the result to an element in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -126,10 +126,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -152,23 +152,18 @@ abs.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var abs = require( '@stdlib/math/strided/special/abs' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], discreteUniform( -100, 100 ) ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const abs = require( '@stdlib/math/strided/special/abs' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], discreteUniform( -100, 100 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); abs.ndarray( x.length, dt[ i ], x, 1, 0, dt[ i ], y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/abs2-by/README.md b/lib/node_modules/@stdlib/math/strided/special/abs2-by/README.md index 1753feafeb71..407fa4997f50 100644 --- a/lib/node_modules/@stdlib/math/strided/special/abs2-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/abs2-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var abs2By = require( '@stdlib/math/strided/special/abs2-by' ); +const abs2By = require( '@stdlib/math/strided/special/abs2-by' ); ``` #### abs2By( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By( x.length, x, 1, y, 1, accessor ); // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By( x.length, x, 1, y, 1, accessor, context ); // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By( 3, x, 2, y, -1, accessor ); // y => [ 25.0, 9.0, 1.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ abs2By( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element abs2By( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -180,8 +180,8 @@ abs2By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; abs2By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ abs2By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs2By = require( '@stdlib/math/strided/special/abs2-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs2By = require( '@stdlib/math/strided/special/abs2-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); abs2By.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/abs2/README.md b/lib/node_modules/@stdlib/math/strided/special/abs2/README.md index f6e588942cfa..b93f56e1f27a 100644 --- a/lib/node_modules/@stdlib/math/strided/special/abs2/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/abs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var abs2 = require( '@stdlib/math/strided/special/abs2' ); +const abs2 = require( '@stdlib/math/strided/special/abs2' ); ``` #### abs2( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -41,9 +41,9 @@ var abs2 = require( '@stdlib/math/strided/special/abs2' ); Computes the squared [absolute value][@stdlib/math/base/special/abs] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); // Perform operation in-place: abs2( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs2( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ 16.0, 9.0, 4.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ abs2( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element abs2( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -94,10 +94,10 @@ abs2( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the squared [absolute value][@stdlib/math/base/special/abs] for each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs2.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 4.0, 1.0, 9.0, 25.0, 16.0 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); abs2.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -137,23 +137,18 @@ abs2.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var abs2 = require( '@stdlib/math/strided/special/abs2' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const abs2 = require( '@stdlib/math/strided/special/abs2' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 10.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); abs2.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acos-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acos-by/README.md index e8d728384482..c60e11a35d97 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acos-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acos-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acosBy = require( '@stdlib/math/strided/special/acos-by' ); +const acosBy = require( '@stdlib/math/strided/special/acos-by' ); ``` #### acosBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~0.786, ~0.524, ~2.356, ~2.618 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~0.786, ~0.524, ~2.356, ~2.618 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy( 3, x, 2, y, -1, accessor ); // y => [ ~2.618, ~0.524, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acosBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acosBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.571, ~2.356, ~0.786 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~0.786, ~0.524, ~2.356, ~2.618 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 0.707, 0.866, -0.707, -0.866, 0.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.571, ~2.356, ~0.786 ] @@ -180,8 +180,8 @@ acosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 1.0, 0.707, 0.866, -0.707, -0.866 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acosBy = require( '@stdlib/math/strided/special/acos-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acosBy = require( '@stdlib/math/strided/special/acos-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acosBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acosh-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acosh-by/README.md index 5f60a2355bc8..9f076b17363a 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acosh-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acosh-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acoshBy = require( '@stdlib/math/strided/special/acosh-by' ); +const acoshBy = require( '@stdlib/math/strided/special/acosh-by' ); ``` #### acoshBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~0.962, ~1.317, ~1.567, ~1.763 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~0.962, ~1.317, ~1.567, ~1.763 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.763, ~1.317, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acoshBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acoshBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.925, ~1.567, ~0.962 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~0.962, ~1.317, ~1.567, ~1.763 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.925, ~1.567, ~0.962 ] @@ -180,8 +180,8 @@ acoshBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 1.0, 1.5, 2.0, 2.5, 3.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoshBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acoshBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acoshBy = require( '@stdlib/math/strided/special/acosh-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acoshBy = require( '@stdlib/math/strided/special/acosh-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 1.0, 5.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 1.0, 5.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acoshBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acot-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acot-by/README.md index 65ad73f5c799..89f640ab1aa5 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acot-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acot-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acotBy = require( '@stdlib/math/strided/special/acot-by' ); +const acotBy = require( '@stdlib/math/strided/special/acot-by' ); ``` #### acotBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy( x.length, x, 1, y, 1, accessor ); // y => [ ~-0.381, ~-0.588, ~-1.107, ~1.571, ~1.107 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy( x.length, x, 1, y, 1, accessor, context ); // y => [ ~-0.381, ~-0.588, ~-1.107, ~1.571, ~1.107 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.107, ~-1.107, ~-0.381, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acotBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acotBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.588, ~1.571, ~-0.588 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ ~-0.381, ~-0.588, ~-1.107, ~1.571, ~1.107 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.5, -1.5, -0.5, 0.0, 0.5, 1.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.588, ~1.571, ~-0.588 ] @@ -180,8 +180,8 @@ acotBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -2.5, -1.5, -0.5, 0.0, 0.5 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acotBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acotBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acotBy = require( '@stdlib/math/strided/special/acot-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acotBy = require( '@stdlib/math/strided/special/acot-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -5.0, 5.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -5.0, 5.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acotBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acoth-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acoth-by/README.md index 67609c7c5b6e..97dc7a186d18 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoth-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acoth-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acothBy = require( '@stdlib/math/strided/special/acoth-by' ); +const acothBy = require( '@stdlib/math/strided/special/acoth-by' ); ``` #### acothBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy( x.length, x, 1, y, 1, accessor ); // y => [ ~-0.203, ~-0.255, ~-0.347, -Infinity, Infinity ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy( x.length, x, 1, y, 1, accessor, context ); // y => [ ~-0.203, ~-0.255, ~-0.347, -Infinity, Infinity ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy( 3, x, 2, y, -1, accessor ); // y => [ Infinity, ~-0.347, ~-0.203, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acothBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acothBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.549, -Infinity, ~-0.255 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ ~-0.203, ~-0.255, ~-0.347, -Infinity, Infinity ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -5.0, -4.0, -3.0, -1.0, 1.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.549, -Infinity, ~-0.255 ] @@ -180,8 +180,8 @@ acothBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -5.0, -4.0, -3.0, -1.0, 1.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acothBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acothBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acothBy = require( '@stdlib/math/strided/special/acoth-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acothBy = require( '@stdlib/math/strided/special/acoth-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 1.0, 5.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 1.0, 5.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acothBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acovercos-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acovercos-by/README.md index 54047cdaf8a6..c35068f298b0 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acovercos-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acovercos-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acovercosBy = require( '@stdlib/math/strided/special/acovercos-by' ); +const acovercosBy = require( '@stdlib/math/strided/special/acovercos-by' ); ``` #### acovercosBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy( x.length, x, 1, y, 1, accessor ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy( x.length, x, 1, y, 1, accessor, context ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy( 3, x, 2, y, -1, accessor ); // y => [ ~-0.253, ~0.524, ~1.571, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acovercosBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acovercosBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ] @@ -180,8 +180,8 @@ acovercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acovercosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acovercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acovercosBy = require( '@stdlib/math/strided/special/acovercos-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acovercosBy = require( '@stdlib/math/strided/special/acovercos-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -2.0, 0.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -2.0, 0.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acovercosBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/README.md b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/README.md index da13aa3771d9..49f08c1c11c6 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var acoversinBy = require( '@stdlib/math/strided/special/acoversin-by' ); +const acoversinBy = require( '@stdlib/math/strided/special/acoversin-by' ); ``` #### acoversinBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy( x.length, x, 1, y, 1, accessor ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy( x.length, x, 1, y, 1, accessor, context ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy( 3, x, 2, y, -1, accessor ); // y => [ ~-0.253, ~0.524, ~1.571, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ acoversinBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element acoversinBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ] @@ -180,8 +180,8 @@ acoversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; acoversinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ acoversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var acoversinBy = require( '@stdlib/math/strided/special/acoversin-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const acoversinBy = require( '@stdlib/math/strided/special/acoversin-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 2.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 2.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); acoversinBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ahavercos-by/README.md b/lib/node_modules/@stdlib/math/strided/special/ahavercos-by/README.md index 941caec95a50..90339b10262e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ahavercos-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ahavercos-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var ahavercosBy = require( '@stdlib/math/strided/special/ahavercos-by' ); +const ahavercosBy = require( '@stdlib/math/strided/special/ahavercos-by' ); ``` #### ahavercosBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy( x.length, x, 1, y, 1, accessor ); // y => [ ~3.142, ~1.571, 0.0, ~2.094, ~1.047 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy( x.length, x, 1, y, 1, accessor, context ); // y => [ ~3.142, ~1.571, 0.0, ~2.094, ~1.047 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.047, 0.0, ~3.142, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ ahavercosBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ahavercosBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.203, ~2.094, ~1.571 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ ~3.142, ~1.571, 0.0, ~2.094, ~1.047 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.203, ~2.094, ~1.571 ] @@ -180,8 +180,8 @@ ahavercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahavercosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ ahavercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ahavercosBy = require( '@stdlib/math/strided/special/ahavercos-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ahavercosBy = require( '@stdlib/math/strided/special/ahavercos-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 1.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 1.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); ahavercosBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ahaversin-by/README.md b/lib/node_modules/@stdlib/math/strided/special/ahaversin-by/README.md index 60489ebd681f..fa9ea9e0331e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ahaversin-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ahaversin-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); +const ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); ``` #### ahaversinBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~1.571, ~3.142, ~1.047, ~2.094 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~1.571, ~3.142, ~1.047, ~2.094 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy( 3, x, 2, y, -1, accessor ); // y => [ ~2.094, ~3.142, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ ahaversinBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ahaversinBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.939, ~1.047, ~1.571 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~1.571, ~3.142, ~1.047, ~2.094 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 0.5, 1.0, 0.25, 0.75, 0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.939, ~1.047, ~1.571 ] @@ -180,8 +180,8 @@ ahaversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; ahaversinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ ahaversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 1.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 1.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); ahaversinBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/asin-by/README.md b/lib/node_modules/@stdlib/math/strided/special/asin-by/README.md index e122da038516..607318507d06 100644 --- a/lib/node_modules/@stdlib/math/strided/special/asin-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/asin-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var asinBy = require( '@stdlib/math/strided/special/asin-by' ); +const asinBy = require( '@stdlib/math/strided/special/asin-by' ); ``` #### asinBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~-0.524, ~1.571, ~-0.253, ~0.848 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~-0.524, ~1.571, ~-0.253, ~0.848 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy( 3, x, 2, y, -1, accessor ); // y => [ ~0.848, ~1.571, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ asinBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element asinBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.748, ~-0.253, ~-0.524 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~-0.524, ~1.571, ~-0.253, ~0.848 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.748, ~-0.253, ~-0.524 ] @@ -180,8 +180,8 @@ asinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ asinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var asinBy = require( '@stdlib/math/strided/special/asin-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const asinBy = require( '@stdlib/math/strided/special/asin-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); asinBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/asinh-by/README.md b/lib/node_modules/@stdlib/math/strided/special/asinh-by/README.md index 8916a6e790bf..ad6567b30ce7 100644 --- a/lib/node_modules/@stdlib/math/strided/special/asinh-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/asinh-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var asinhBy = require( '@stdlib/math/strided/special/asinh-by' ); +const asinhBy = require( '@stdlib/math/strided/special/asinh-by' ); ``` #### asinhBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, ~1.444, ~-1.444, ~0.693 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, 0.0, ~1.444, ~-1.444, ~0.693 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy( 3, x, 2, y, -1, accessor ); // y => [ ~0.693, ~1.444, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ asinhBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element asinhBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.636, ~-1.444, 0.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, 0.0, ~1.444, ~-1.444, ~0.693 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.0, 2.0, -2.0, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.636, ~-1.444, 0.0 ] @@ -180,8 +180,8 @@ asinhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -0.0, 2.0, -2.0, 0.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; asinhBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ asinhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var asinhBy = require( '@stdlib/math/strided/special/asinh-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const asinhBy = require( '@stdlib/math/strided/special/asinh-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -5.0, 5.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -5.0, 5.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); asinhBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/atan-by/README.md b/lib/node_modules/@stdlib/math/strided/special/atan-by/README.md index 906cd675c452..b1146cf4b28a 100644 --- a/lib/node_modules/@stdlib/math/strided/special/atan-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/atan-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var atanBy = require( '@stdlib/math/strided/special/atan-by' ); +const atanBy = require( '@stdlib/math/strided/special/atan-by' ); ``` #### atanBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~-0.464, ~0.785, ~-0.896, ~1.31 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~-0.464, ~0.785, ~-0.896, ~1.31 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.31, ~0.785, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ atanBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element atanBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.597, ~-0.896, ~-0.464 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~-0.464, ~0.785, ~-0.896, ~1.31 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -1.25, 3.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.597, ~-0.896, ~-0.464 ] @@ -180,8 +180,8 @@ atanBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -0.5, 1.0, -1.25, 3.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ atanBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var atanBy = require( '@stdlib/math/strided/special/atan-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const atanBy = require( '@stdlib/math/strided/special/atan-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); atanBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/atanh-by/README.md b/lib/node_modules/@stdlib/math/strided/special/atanh-by/README.md index ac25191f9c57..7c834a9b0070 100644 --- a/lib/node_modules/@stdlib/math/strided/special/atanh-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/atanh-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var atanhBy = require( '@stdlib/math/strided/special/atanh-by' ); +const atanhBy = require( '@stdlib/math/strided/special/atanh-by' ); ``` #### atanhBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~-0.549, Infinity, ~-0.255, ~0.973 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~-0.549, Infinity, ~-0.255, ~0.973 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy( 3, x, 2, y, -1, accessor ); // y => [ ~0.973, Infinity, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ atanhBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element atanhBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.829, ~-0.255, ~-0.549 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~-0.549, Infinity, ~-0.255, ~0.973 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -0.5, 1.0, -0.25, 0.75, -0.68 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.829, ~-0.255, ~-0.549 ] @@ -180,8 +180,8 @@ atanhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -0.5, 1.0, -0.25, 0.75 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; atanhBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ atanhBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var atanhBy = require( '@stdlib/math/strided/special/atanh-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const atanhBy = require( '@stdlib/math/strided/special/atanh-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -1.0, 1.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); atanhBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/avercos-by/README.md b/lib/node_modules/@stdlib/math/strided/special/avercos-by/README.md index ccee2ce04f16..2534b0a9377b 100644 --- a/lib/node_modules/@stdlib/math/strided/special/avercos-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/avercos-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var avercosBy = require( '@stdlib/math/strided/special/avercos-by' ); +const avercosBy = require( '@stdlib/math/strided/special/avercos-by' ); ``` #### avercosBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.823, ~1.047, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ avercosBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element avercosBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.234, ~1.571, ~2.177 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.234, ~1.571, ~2.177 ] @@ -180,8 +180,8 @@ avercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; avercosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ avercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var avercosBy = require( '@stdlib/math/strided/special/avercos-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const avercosBy = require( '@stdlib/math/strided/special/avercos-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -2.0, 0.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -2.0, 0.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); avercosBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/aversin-by/README.md b/lib/node_modules/@stdlib/math/strided/special/aversin-by/README.md index c2c7349674e2..4231d73997b6 100644 --- a/lib/node_modules/@stdlib/math/strided/special/aversin-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/aversin-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var aversinBy = require( '@stdlib/math/strided/special/aversin-by' ); +const aversinBy = require( '@stdlib/math/strided/special/aversin-by' ); ``` #### aversinBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy( 3, x, 2, y, -1, accessor ); // y => [ ~1.823, ~1.047, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ aversinBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element aversinBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~1.234, ~1.571, ~2.177 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~2.177, ~1.047, ~1.571, ~1.823 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~1.234, ~1.571, ~2.177 ] @@ -180,8 +180,8 @@ aversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; aversinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ aversinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var aversinBy = require( '@stdlib/math/strided/special/aversin-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const aversinBy = require( '@stdlib/math/strided/special/aversin-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 2.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 2.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); aversinBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/besselj0-by/README.md b/lib/node_modules/@stdlib/math/strided/special/besselj0-by/README.md index b1fb67785bcb..b92a3a896284 100644 --- a/lib/node_modules/@stdlib/math/strided/special/besselj0-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/besselj0-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var besselj0By = require( '@stdlib/math/strided/special/besselj0-by' ); +const besselj0By = require( '@stdlib/math/strided/special/besselj0-by' ); ``` #### besselj0By( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By( x.length, x, 1, y, 1, accessor ); // y => [ 1.0, ~0.765, ~0.998, ~0.984, ~0.938 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By( x.length, x, 1, y, 1, accessor, context ); // y => [ 1.0, ~0.765, ~0.998, ~0.984, ~0.938 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By( 3, x, 2, y, -1, accessor ); // y => [ ~0.938, ~0.998, 1.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ besselj0By( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element besselj0By( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.891, ~0.984, ~0.765 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 1.0, ~0.765, ~0.998, ~0.984, ~0.938 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.891, ~0.984, ~0.765 ] @@ -180,8 +180,8 @@ besselj0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj0By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ besselj0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var besselj0By = require( '@stdlib/math/strided/special/besselj0-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const besselj0By = require( '@stdlib/math/strided/special/besselj0-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); besselj0By.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/README.md b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/README.md index 51ffd432f014..87878001c1c7 100644 --- a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var besselj1By = require( '@stdlib/math/strided/special/besselj1-by' ); +const besselj1By = require( '@stdlib/math/strided/special/besselj1-by' ); ``` #### besselj1By( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~0.44, ~0.05, ~0.124, ~0.242 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~0.44, ~0.05, ~0.124, ~0.242 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By( 3, x, 2, y, -1, accessor ); // y => [ ~0.242, ~0.05, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ besselj1By( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element besselj1By( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~0.317, ~0.124, ~0.44 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~0.44, ~0.05, ~0.124, ~0.242 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~0.317, ~0.124, ~0.44 ] @@ -180,8 +180,8 @@ besselj1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; besselj1By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ besselj1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var besselj1By = require( '@stdlib/math/strided/special/besselj1-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const besselj1By = require( '@stdlib/math/strided/special/besselj1-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); besselj1By.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/bessely0-by/README.md b/lib/node_modules/@stdlib/math/strided/special/bessely0-by/README.md index a7f94bb90176..d2d32eae1964 100644 --- a/lib/node_modules/@stdlib/math/strided/special/bessely0-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/bessely0-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var bessely0By = require( '@stdlib/math/strided/special/bessely0-by' ); +const bessely0By = require( '@stdlib/math/strided/special/bessely0-by' ); ``` #### bessely0By( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By( x.length, x, 1, y, 1, accessor ); // y => [ -Infinity, ~0.088, ~-1.534, ~-0.932, ~-0.445 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By( x.length, x, 1, y, 1, accessor, context ); // y => [ -Infinity, ~0.088, ~-1.534, ~-0.932, ~-0.445 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By( 3, x, 2, y, -1, accessor ); // y => [ ~-0.445, ~-1.534, -Infinity, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ bessely0By( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element bessely0By( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.224, ~-0.932, ~0.088 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ -Infinity, ~0.088, ~-1.534, ~-0.932, ~-0.445 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.224, ~-0.932, ~0.088 ] @@ -180,8 +180,8 @@ bessely0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely0By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ bessely0By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var bessely0By = require( '@stdlib/math/strided/special/bessely0-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const bessely0By = require( '@stdlib/math/strided/special/bessely0-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); bessely0By.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/bessely1-by/README.md b/lib/node_modules/@stdlib/math/strided/special/bessely1-by/README.md index d3a4cc7937d1..e4b4498e5a80 100644 --- a/lib/node_modules/@stdlib/math/strided/special/bessely1-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/bessely1-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var bessely1By = require( '@stdlib/math/strided/special/bessely1-by' ); +const bessely1By = require( '@stdlib/math/strided/special/bessely1-by' ); ``` #### bessely1By( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By( x.length, x, 1, y, 1, accessor ); // y => [ -Infinity, ~-0.781, ~-6.459, ~-2.704, ~-1.471 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By( x.length, x, 1, y, 1, accessor, context ); // y => [ -Infinity, ~-0.781, ~-6.459, ~-2.704, ~-1.471 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By( 3, x, 2, y, -1, accessor ); // y => [ ~-1.471, ~-6.459, -Infinity, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ bessely1By( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element bessely1By( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-1.146, ~-2.704, ~-0.781 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ -Infinity, ~-0.781, ~-6.459, ~-2.704, ~-1.471 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 0.1, 0.25, 0.5, 0.67 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-1.146, ~-2.704, ~-0.781 ] @@ -180,8 +180,8 @@ bessely1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; bessely1By( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ bessely1By.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var bessely1By = require( '@stdlib/math/strided/special/bessely1-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const bessely1By = require( '@stdlib/math/strided/special/bessely1-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); bessely1By.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/binet-by/README.md b/lib/node_modules/@stdlib/math/strided/special/binet-by/README.md index 3cb09f18877c..ff524e7c5c4e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/binet-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/binet-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var binetBy = require( '@stdlib/math/strided/special/binet-by' ); +const binetBy = require( '@stdlib/math/strided/special/binet-by' ); ``` #### binetBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 1.0, 1.0, 2.0, 1.0 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, 1.0, 1.0, 2.0, 1.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy( 3, x, 2, y, -1, accessor ); // y => [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ binetBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element binetBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~2.116, 2.0, 1.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, 1.0, 1.0, 2.0, 1.0 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 2.0, 3.0, -1.0, 3.14 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~2.116, 2.0, 1.0 ] @@ -180,8 +180,8 @@ binetBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 2.0, 3.0, -1.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; binetBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ binetBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var binetBy = require( '@stdlib/math/strided/special/binet-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const binetBy = require( '@stdlib/math/strided/special/binet-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); binetBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/cbrt-by/README.md b/lib/node_modules/@stdlib/math/strided/special/cbrt-by/README.md index dd9165a1cca7..907432ef66c7 100644 --- a/lib/node_modules/@stdlib/math/strided/special/cbrt-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/cbrt-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var cbrtBy = require( '@stdlib/math/strided/special/cbrt-by' ); +const cbrtBy = require( '@stdlib/math/strided/special/cbrt-by' ); ``` #### cbrtBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy( x.length, x, 1, y, 1, accessor ); // y => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy( 3, x, 2, y, -1, accessor ); // y => [ -5.0, -3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ cbrtBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cbrtBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-2.091, ~4.327, ~2.08 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-2.091, ~4.327, ~2.08 ] @@ -180,8 +180,8 @@ cbrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 1.0, 9.0, -27.0, 81.0, -125.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cbrtBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ cbrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var cbrtBy = require( '@stdlib/math/strided/special/cbrt-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const cbrtBy = require( '@stdlib/math/strided/special/cbrt-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); cbrtBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/cbrt/README.md b/lib/node_modules/@stdlib/math/strided/special/cbrt/README.md index 2fd43606564f..631ec94850ba 100644 --- a/lib/node_modules/@stdlib/math/strided/special/cbrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/cbrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cbrt = require( '@stdlib/math/strided/special/cbrt' ); +const cbrt = require( '@stdlib/math/strided/special/cbrt' ); ``` #### cbrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var cbrt = require( '@stdlib/math/strided/special/cbrt' ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); // Perform operation in-place: cbrt( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cbrt( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ 4.0, 2.0, 0.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ cbrt( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cbrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -94,10 +94,10 @@ cbrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cbrt.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 0.0, 1.0, 2.0, 3.0, 4.0 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); cbrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -137,23 +137,18 @@ cbrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var cbrt = require( '@stdlib/math/strided/special/cbrt' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const cbrt = require( '@stdlib/math/strided/special/cbrt' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); cbrt.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ceil/README.md b/lib/node_modules/@stdlib/math/strided/special/ceil/README.md index 7470ca7bda8a..bb2c5fd6ee58 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ceil/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ceil/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ceil = require( '@stdlib/math/strided/special/ceil' ); +const ceil = require( '@stdlib/math/strided/special/ceil' ); ``` #### ceil( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -41,9 +41,9 @@ var ceil = require( '@stdlib/math/strided/special/ceil' ); Rounds each element in a strided array `x` toward positive infinity and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: ceil( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ceil( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ -5.0, -3.0, 2.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ ceil( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ceil( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -94,10 +94,10 @@ ceil( 3, 'float64', x1, -2, 'float64', y1, 1 ); Rounds each element in a strided array `x` toward positive infinity and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ceil.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 2.0, 3.0, -3.0, 4.0, -5.0 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ceil.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -137,23 +137,18 @@ ceil.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var ceil = require( '@stdlib/math/strided/special/ceil' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const ceil = require( '@stdlib/math/strided/special/ceil' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); ceil.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/cos-by/README.md b/lib/node_modules/@stdlib/math/strided/special/cos-by/README.md index 2a98bccf7f46..37109dc97620 100644 --- a/lib/node_modules/@stdlib/math/strided/special/cos-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/cos-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var cosBy = require( '@stdlib/math/strided/special/cos-by' ); +const cosBy = require( '@stdlib/math/strided/special/cos-by' ); ``` #### cosBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy( x.length, x, 1, y, 1, accessor ); // y => [ 1.0, ~-1.0, ~-1.0, ~-0.839, ~-0.76 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 1.0, ~-1.0, ~-1.0, ~-0.839, ~-0.76 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy( 3, x, 2, y, -1, accessor ); // y => [ ~-0.76, ~-1.0, 1.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ cosBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cosBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.144, ~-0.839, ~-1.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 1.0, ~-1.0, ~-1.0, ~-0.839, ~-0.76 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.144, ~-0.839, ~-1.0 ] @@ -180,8 +180,8 @@ cosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ cosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var cosBy = require( '@stdlib/math/strided/special/cos-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const cosBy = require( '@stdlib/math/strided/special/cos-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); cosBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dabs/README.md b/lib/node_modules/@stdlib/math/strided/special/dabs/README.md index dab60d426b19..e591feda5f69 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dabs/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dabs = require( '@stdlib/math/strided/special/dabs' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); ``` #### dabs( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dabs = require( '@stdlib/math/strided/special/dabs' ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: dabs( x.length, x, 1, x, 1 ); @@ -61,13 +61,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); dabs( N, x, 2, y, -1 ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,18 +76,18 @@ dabs( N, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); dabs( N, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -98,10 +98,10 @@ dabs( N, x1, -2, y1, 1 ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -115,13 +115,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); dabs.ndarray( N, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -144,16 +144,15 @@ dabs.ndarray( N, x, 2, 1, y, -1, y.length-1 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dabs = require( '@stdlib/math/strided/special/dabs' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dabs2/README.md b/lib/node_modules/@stdlib/math/strided/special/dabs2/README.md index f11deae9b1e3..40d00c30da36 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dabs2/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dabs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dabs2 = require( '@stdlib/math/strided/special/dabs2' ); +const dabs2 = require( '@stdlib/math/strided/special/dabs2' ); ``` #### dabs2( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dabs2 = require( '@stdlib/math/strided/special/dabs2' ); Computes the [squared absolute value][@stdlib/math/base/special/abs2] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the squared absolute values in-place: dabs2( x.length, x, 1, x, 1 ); @@ -61,13 +61,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); dabs2( N, x, 2, y, -1 ); // y => [ 25.0, 9.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,18 +76,18 @@ dabs2( N, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); dabs2( N, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -98,10 +98,10 @@ dabs2( N, x1, -2, y1, 1 ); Computes the [squared absolute value][@stdlib/math/base/special/abs2] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dabs2.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ] @@ -115,13 +115,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); dabs2.ndarray( N, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -144,16 +144,15 @@ dabs2.ndarray( N, x, 2, 1, y, -1, y.length-1 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dabs2 = require( '@stdlib/math/strided/special/dabs2' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dabs2 = require( '@stdlib/math/strided/special/dabs2' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dcbrt-by/README.md b/lib/node_modules/@stdlib/math/strided/special/dcbrt-by/README.md index c90dfcf53ccf..78305969eecb 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dcbrt-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dcbrt-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var dcbrtBy = require( '@stdlib/math/strided/special/dcbrt-by' ); +const dcbrtBy = require( '@stdlib/math/strided/special/dcbrt-by' ); ``` #### dcbrtBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -43,14 +43,14 @@ var dcbrtBy = require( '@stdlib/math/strided/special/dcbrt-by' ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element retrieved from an input double-precision floating-point strided array via a callback function and assigns each result to an element in an output double-precision floating-point strided array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } -var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); -var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); +const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy( x.length, x, 1, out, 1, accessor ); // out => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] @@ -76,38 +76,38 @@ The invoked callback function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { this.count += 1; return v; } -var context = { +const context = { 'count': 0 }; -var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); -var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); +const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy( x.length, x, 1, out, 1, accessor, context ); // out => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } -var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); -var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); +const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy( 3, x, 2, out, -1, accessor ); // out => [ -5.0, -3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -116,19 +116,19 @@ dcbrtBy( 3, x, 2, out, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); -var out0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); +const out0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcbrtBy( 3, x1, -2, out1, 1, accessor ); // out0 => [ 0.0, 0.0, 0.0, ~-2.091, ~4.327, ~2.08 ] @@ -139,14 +139,14 @@ dcbrtBy( 3, x1, -2, out1, 1, accessor ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element retrieved from an input double-precision floating-point strided array via a callback function and assigns each result to an element in an output double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } -var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); -var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); +const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy.ndarray( x.length, x, 1, 0, out, 1, 0, accessor ); // out => [ 1.0, ~2.08, -3.0, ~4.327, -5.0 ] @@ -160,14 +160,14 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } -var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); -var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0, -9.14 ] ); +const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy.ndarray( 3, x, 2, 1, out, -1, out.length-1, accessor ); // out => [ 0.0, 0.0, 0.0, ~-2.091, ~4.327, ~2.08 ] @@ -184,14 +184,14 @@ dcbrtBy.ndarray( 3, x, 2, 1, out, -1, out.length-1, accessor ); - If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is **ignored**. ```javascript - var Float64Array = require( '@stdlib/array/float64' ); + const Float64Array = require( '@stdlib/array/float64' ); function accessor() { // No-op... } - var x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); - var out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + const x = new Float64Array( [ 1.0, 9.0, -27.0, 81.0, -125.0 ] ); + const out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrtBy( x.length, x, 1, out, 1, accessor ); // out => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -208,10 +208,10 @@ dcbrtBy.ndarray( 3, x, 2, 1, out, -1, out.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dcbrtBy = require( '@stdlib/math/strided/special/dcbrt-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dcbrtBy = require( '@stdlib/math/strided/special/dcbrt-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -221,10 +221,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'float64', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'float64', uniform( -10.0, 10.0 ) ); console.log( x ); -var out = filledarray( null, 10, 'float64' ); +const out = filledarray( null, 10, 'float64' ); console.log( out ); dcbrtBy.ndarray( x.length, x, 1, 0, out, -1, out.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dcbrt/README.md b/lib/node_modules/@stdlib/math/strided/special/dcbrt/README.md index cd276667ca72..a66c6e2fdee5 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dcbrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dcbrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcbrt = require( '@stdlib/math/strided/special/dcbrt' ); +const dcbrt = require( '@stdlib/math/strided/special/dcbrt' ); ``` #### dcbrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dcbrt = require( '@stdlib/math/strided/special/dcbrt' ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); // Perform operation in-place: dcbrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrt( 3, x, 2, y, -1 ); // y => [ 4.0, 2.0, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dcbrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcbrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -92,10 +92,10 @@ dcbrt( 3, x1, -2, y1, 1 ); Computes the [cube root][@stdlib/math/base/special/cbrt] of each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, 1.0, 2.0, 3.0, 4.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dcbrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -135,15 +135,14 @@ dcbrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcbrt = require( '@stdlib/math/strided/special/dcbrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcbrt = require( '@stdlib/math/strided/special/dcbrt' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dceil/README.md b/lib/node_modules/@stdlib/math/strided/special/dceil/README.md index 74085cb1f795..7822f0283676 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dceil/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dceil/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dceil = require( '@stdlib/math/strided/special/dceil' ); +const dceil = require( '@stdlib/math/strided/special/dceil' ); ``` #### dceil( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dceil = require( '@stdlib/math/strided/special/dceil' ); Rounds each element in a double-precision floating-point strided array `x` toward positive infinity and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: dceil( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dceil( 3, x, 2, y, -1 ); // y => [ -5.0, -3.0, 2.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dceil( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dceil( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -92,10 +92,10 @@ dceil( 3, x1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward positive infinity and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dceil.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 2.0, 3.0, -3.0, 4.0, -5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dceil.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -135,15 +135,14 @@ dceil.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dceil = require( '@stdlib/math/strided/special/dceil' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dceil = require( '@stdlib/math/strided/special/dceil' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ddeg2rad/README.md b/lib/node_modules/@stdlib/math/strided/special/ddeg2rad/README.md index e6bcfe58e4ad..f1d22506171c 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ddeg2rad/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ddeg2rad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ddeg2rad = require( '@stdlib/math/strided/special/ddeg2rad' ); +const ddeg2rad = require( '@stdlib/math/strided/special/ddeg2rad' ); ``` #### ddeg2rad( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var ddeg2rad = require( '@stdlib/math/strided/special/ddeg2rad' ); Converts each element in a double-precision floating-point strided array `x` from degrees to radians and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); // Perform operation in-place: ddeg2rad( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ddeg2rad( 3, x, 2, y, -1 ); // y => [ ~1.571, ~0.785, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ ddeg2rad( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ddeg2rad( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, ~2.094, ~1.047, ~0.524 ] @@ -92,10 +92,10 @@ ddeg2rad( 3, x1, -2, y1, 1 ); Converts each element in a double-precision floating-point strided array `x` from degrees to radians and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ddeg2rad.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, ~0.524, ~0.785, ~1.047, ~1.571 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ddeg2rad.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, ~2.094, ~1.047, ~0.524 ] @@ -135,15 +135,14 @@ ddeg2rad.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var ddeg2rad = require( '@stdlib/math/strided/special/ddeg2rad' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ddeg2rad = require( '@stdlib/math/strided/special/ddeg2rad' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -180.0, 180.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/deg2rad/README.md b/lib/node_modules/@stdlib/math/strided/special/deg2rad/README.md index 75380eb505c5..f0bf8e07a5f8 100644 --- a/lib/node_modules/@stdlib/math/strided/special/deg2rad/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/deg2rad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var deg2rad = require( '@stdlib/math/strided/special/deg2rad' ); +const deg2rad = require( '@stdlib/math/strided/special/deg2rad' ); ``` #### deg2rad( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -41,9 +41,9 @@ var deg2rad = require( '@stdlib/math/strided/special/deg2rad' ); Converts each element in a strided array `x` from degrees to radians and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0 ] ); // Perform operation in-place: deg2rad( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); deg2rad( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ ~2.094, ~0.785, 0.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ deg2rad( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element deg2rad( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, ~2.356, ~1.571, ~0.524 ] @@ -94,10 +94,10 @@ deg2rad( 3, 'float64', x1, -2, 'float64', y1, 1 ); Converts each element in a strided array `x` from degrees to radians and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); deg2rad.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 0.0, ~0.524, ~0.785, ~1.571, ~2.094 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 90.0, 120.0, 135.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); deg2rad.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, ~2.356, ~1.571, ~0.524 ] @@ -137,23 +137,18 @@ deg2rad.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var deg2rad = require( '@stdlib/math/strided/special/deg2rad' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -180.0, 180.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const deg2rad = require( '@stdlib/math/strided/special/deg2rad' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -180.0, 180.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); deg2rad.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dfloor/README.md b/lib/node_modules/@stdlib/math/strided/special/dfloor/README.md index 7a46c24820d7..93e6f9218927 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dfloor/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dfloor/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dfloor = require( '@stdlib/math/strided/special/dfloor' ); +const dfloor = require( '@stdlib/math/strided/special/dfloor' ); ``` #### dfloor( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dfloor = require( '@stdlib/math/strided/special/dfloor' ); Rounds each element in a double-precision floating-point strided array `x` toward negative infinity and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); +const x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); // Perform operation in-place: dfloor( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dfloor( 3, x, 2, y, -1 ); // y => [ 5.0, 3.0, -2.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dfloor( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dfloor( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, -7.0, 4.0, 1.0 ] @@ -92,10 +92,10 @@ dfloor( 3, x1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward negative infinity and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dfloor.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ -2.0, 1.0, 3.0, 4.0, 5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dfloor.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, -7.0, 4.0, 1.0 ] @@ -135,15 +135,14 @@ dfloor.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dfloor = require( '@stdlib/math/strided/special/dfloor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dfloor = require( '@stdlib/math/strided/special/dfloor' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dinv/README.md b/lib/node_modules/@stdlib/math/strided/special/dinv/README.md index e95470d12862..f518cd17fbbc 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dinv/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dinv = require( '@stdlib/math/strided/special/dinv' ); +const dinv = require( '@stdlib/math/strided/special/dinv' ); ``` #### dinv( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dinv = require( '@stdlib/math/strided/special/dinv' ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); // Perform operation in-place: dinv( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dinv( 3, x, 2, y, -1 ); // y => [ 0.1, 0.5, -0.05, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dinv( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dinv( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.01, 0.25, -1.0 ] @@ -92,10 +92,10 @@ dinv( 3, x1, -2, y1, 1 ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dinv.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ -0.05, -1.0, 0.5, 0.25, 0.1 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dinv.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.01, 0.25, -1.0 ] @@ -135,15 +135,14 @@ dinv.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dinv = require( '@stdlib/math/strided/special/dinv' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dinv = require( '@stdlib/math/strided/special/dinv' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -50.0, 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskabs/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskabs/README.md index 35b2bac9b97b..5d3e372095ff 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskabs/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskabs = require( '@stdlib/math/strided/special/dmskabs' ); +const dmskabs = require( '@stdlib/math/strided/special/dmskabs' ); ``` #### dmskabs( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskabs = require( '@stdlib/math/strided/special/dmskabs' ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskabs( x.length, x, 1, m, 1, y, 1 ); // y => [ 2.0, 1.0, 0.0, 5.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 2.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskabs( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskabs( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0 ] @@ -101,12 +101,12 @@ dmskabs( 3, x1, -2, m1, -2, y1, 1 ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 2.0, 1.0, 0.0, 5.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0 ] @@ -149,17 +149,16 @@ dmskabs.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskabs = require( '@stdlib/math/strided/special/dmskabs' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskabs = require( '@stdlib/math/strided/special/dmskabs' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskabs2/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskabs2/README.md index 7830155a0d54..850effe330e1 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskabs2/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskabs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskabs2 = require( '@stdlib/math/strided/special/dmskabs2' ); +const dmskabs2 = require( '@stdlib/math/strided/special/dmskabs2' ); ``` #### dmskabs2( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskabs2 = require( '@stdlib/math/strided/special/dmskabs2' ); Computes the [squared absolute value][@stdlib/math/base/special/abs2] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskabs2( x.length, x, 1, m, 1, y, 1 ); // y => [ 4.0, 1.0, 0.0, 25.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs2( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskabs2( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskabs2( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -101,12 +101,12 @@ dmskabs2( 3, x1, -2, m1, -2, y1, 1 ); Computes the [squared absolute value][@stdlib/math/base/special/abs2] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs2.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 4.0, 1.0, 0.0, 25.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskabs2.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -149,17 +149,16 @@ dmskabs2.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskabs2 = require( '@stdlib/math/strided/special/dmskabs2' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskabs2 = require( '@stdlib/math/strided/special/dmskabs2' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskcbrt/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskcbrt/README.md index d969acced1f4..ce3ebddb767c 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskcbrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskcbrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskcbrt = require( '@stdlib/math/strided/special/dmskcbrt' ); +const dmskcbrt = require( '@stdlib/math/strided/special/dmskcbrt' ); ``` #### dmskcbrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskcbrt = require( '@stdlib/math/strided/special/dmskcbrt' ); Computes the [cube root][@stdlib/math/base/special/cbrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskcbrt( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, 1.0, 0.0, 3.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskcbrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskcbrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskcbrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 3.0, 1.0 ] @@ -101,12 +101,12 @@ dmskcbrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the [cube root][@stdlib/math/base/special/cbrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskcbrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, 1.0, 0.0, 3.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskcbrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 3.0, 1.0 ] @@ -149,17 +149,16 @@ dmskcbrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskcbrt = require( '@stdlib/math/strided/special/dmskcbrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskcbrt = require( '@stdlib/math/strided/special/dmskcbrt' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskceil/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskceil/README.md index 84624dbcb7f9..8a92c4f8a919 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskceil/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskceil/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskceil = require( '@stdlib/math/strided/special/dmskceil' ); +const dmskceil = require( '@stdlib/math/strided/special/dmskceil' ); ``` #### dmskceil( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskceil = require( '@stdlib/math/strided/special/dmskceil' ); Rounds each element in a double-precision floating-point strided array `x` toward positive infinity according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskceil( x.length, x, 1, m, 1, y, 1 ); // y => [ 2.0, 3.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskceil( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 2.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskceil( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskceil( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 3.0 ] @@ -101,12 +101,12 @@ dmskceil( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward positive infinity according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskceil.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 2.0, 3.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskceil.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 3.0 ] @@ -149,17 +149,16 @@ dmskceil.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskceil = require( '@stdlib/math/strided/special/dmskceil' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskceil = require( '@stdlib/math/strided/special/dmskceil' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskdeg2rad/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskdeg2rad/README.md index 10ea6b867036..b1accbebe445 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskdeg2rad/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskdeg2rad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskdeg2rad = require( '@stdlib/math/strided/special/dmskdeg2rad' ); +const dmskdeg2rad = require( '@stdlib/math/strided/special/dmskdeg2rad' ); ``` #### dmskdeg2rad( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskdeg2rad = require( '@stdlib/math/strided/special/dmskdeg2rad' ); Converts each element in a double-precision floating-point strided array `x` from degrees to radians according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskdeg2rad( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, ~0.524, 0.0, ~1.047, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskdeg2rad( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskdeg2rad( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskdeg2rad( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~1.047, ~0.524 ] @@ -101,12 +101,12 @@ dmskdeg2rad( 3, x1, -2, m1, -2, y1, 1 ); Converts each element in a double-precision floating-point strided array `x` from degrees to radians according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskdeg2rad.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, ~0.524, 0.0, ~1.047, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskdeg2rad.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~1.047, ~0.524 ] @@ -149,17 +149,16 @@ dmskdeg2rad.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskdeg2rad = require( '@stdlib/math/strided/special/dmskdeg2rad' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskdeg2rad = require( '@stdlib/math/strided/special/dmskdeg2rad' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -180.0, 180.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskfloor/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskfloor/README.md index 681d4f9b75f7..0bbf2f4c3c84 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskfloor/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskfloor/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskfloor = require( '@stdlib/math/strided/special/dmskfloor' ); +const dmskfloor = require( '@stdlib/math/strided/special/dmskfloor' ); ``` #### dmskfloor( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskfloor = require( '@stdlib/math/strided/special/dmskfloor' ); Rounds each element in a double-precision floating-point strided array `x` toward negative infinity according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskfloor( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskfloor( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskfloor( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskfloor( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -101,12 +101,12 @@ dmskfloor( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward negative infinity according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskfloor.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskfloor.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -149,17 +149,16 @@ dmskfloor.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskfloor = require( '@stdlib/math/strided/special/dmskfloor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskfloor = require( '@stdlib/math/strided/special/dmskfloor' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskinv/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskinv/README.md index 480999ebcb8c..8d54991a4420 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskinv/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskinv = require( '@stdlib/math/strided/special/dmskinv' ); +const dmskinv = require( '@stdlib/math/strided/special/dmskinv' ); ``` #### dmskinv( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskinv = require( '@stdlib/math/strided/special/dmskinv' ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskinv( x.length, x, 1, m, 1, y, 1 ); // y => [ -0.05, -1.0, 0.0, 0.25, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskinv( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, -0.05, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskinv( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskinv( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 0.25, -1.0 ] @@ -101,12 +101,12 @@ dmskinv( 3, x1, -2, m1, -2, y1, 1 ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskinv.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ -0.05, -1.0, 0.0, 0.25, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskinv.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.25, -1.0 ] @@ -149,17 +149,16 @@ dmskinv.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskinv = require( '@stdlib/math/strided/special/dmskinv' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskinv = require( '@stdlib/math/strided/special/dmskinv' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -50.0, 50.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskramp/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskramp/README.md index 2e4e7e1273d8..347547af3213 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskramp/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskramp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskramp = require( '@stdlib/math/strided/special/dmskramp' ); +const dmskramp = require( '@stdlib/math/strided/special/dmskramp' ); ``` #### dmskramp( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskramp = require( '@stdlib/math/strided/special/dmskramp' ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskramp( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.1, 2.5, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskramp( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.1, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskramp( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskramp( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.5 ] @@ -101,12 +101,12 @@ dmskramp( 3, x1, -2, m1, -2, y1, 1 ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskramp.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.1, 2.5, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskramp.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.5 ] @@ -149,17 +149,16 @@ dmskramp.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskramp = require( '@stdlib/math/strided/special/dmskramp' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskramp = require( '@stdlib/math/strided/special/dmskramp' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/README.md index 8e569d00ec04..1bfd7712ca5e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskrsqrt = require( '@stdlib/math/strided/special/dmskrsqrt' ); +const dmskrsqrt = require( '@stdlib/math/strided/special/dmskrsqrt' ); ``` #### dmskrsqrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmskrsqrt = require( '@stdlib/math/strided/special/dmskrsqrt' ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmskrsqrt( x.length, x, 1, m, 1, y, 1 ); // y => [ Infinity, 0.5, 0.0, ~0.289, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskrsqrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, Infinity, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmskrsqrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskrsqrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~0.289, 0.5 ] @@ -101,12 +101,12 @@ dmskrsqrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskrsqrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ Infinity, 0.5, 0.0, ~0.289, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskrsqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~0.289, 0.5 ] @@ -149,17 +149,16 @@ dmskrsqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskrsqrt = require( '@stdlib/math/strided/special/dmskrsqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskrsqrt = require( '@stdlib/math/strided/special/dmskrsqrt' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmsksqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/dmsksqrt/README.md index eb10b777b744..bf2eca3a6042 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmsksqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmsksqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmsksqrt = require( '@stdlib/math/strided/special/dmsksqrt' ); +const dmsksqrt = require( '@stdlib/math/strided/special/dmsksqrt' ); ``` #### dmsksqrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmsksqrt = require( '@stdlib/math/strided/special/dmsksqrt' ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmsksqrt( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, 2.0, 0.0, ~3.464, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsksqrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmsksqrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmsksqrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~3.464, 2.0 ] @@ -101,12 +101,12 @@ dmsksqrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a double-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsksqrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, 2.0, 0.0, ~3.464, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsksqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~3.464, 2.0 ] @@ -149,17 +149,16 @@ dmsksqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmsksqrt = require( '@stdlib/math/strided/special/dmsksqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmsksqrt = require( '@stdlib/math/strided/special/dmsksqrt' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dmsktrunc/README.md b/lib/node_modules/@stdlib/math/strided/special/dmsktrunc/README.md index aa2105eaed11..f2de237ab5cc 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmsktrunc/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dmsktrunc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmsktrunc = require( '@stdlib/math/strided/special/dmsktrunc' ); +const dmsktrunc = require( '@stdlib/math/strided/special/dmsktrunc' ); ``` #### dmsktrunc( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var dmsktrunc = require( '@stdlib/math/strided/special/dmsktrunc' ); Rounds each element in a double-precision floating-point strided array `x` toward zero according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( x.length ); dmsktrunc( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsktrunc( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ dmsktrunc( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmsktrunc( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -101,12 +101,12 @@ dmsktrunc( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward zero according to a strided mask array and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsktrunc.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmsktrunc.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -149,17 +149,16 @@ dmsktrunc.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmsktrunc = require( '@stdlib/math/strided/special/dmsktrunc' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmsktrunc = require( '@stdlib/math/strided/special/dmsktrunc' ); -var x = new Float64Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/dramp/README.md b/lib/node_modules/@stdlib/math/strided/special/dramp/README.md index a891390396e4..e2cc66431281 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dramp/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dramp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dramp = require( '@stdlib/math/strided/special/dramp' ); +const dramp = require( '@stdlib/math/strided/special/dramp' ); ``` #### dramp( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dramp = require( '@stdlib/math/strided/special/dramp' ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: dramp( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dramp( 3, x, 2, y, -1 ); // y => [ 0.0, 0.0, 1.1, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dramp( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dramp( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.4, 4.0, 2.5 ] @@ -92,10 +92,10 @@ dramp( 3, x1, -2, y1, 1 ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dramp.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.1, 2.5, 0.0, 4.0, 0.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dramp.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.4, 4.0, 2.5 ] @@ -135,15 +135,14 @@ dramp.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dramp = require( '@stdlib/math/strided/special/dramp' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dramp = require( '@stdlib/math/strided/special/dramp' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/drsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/drsqrt/README.md index 8cff85b217d8..4607b234f2c2 100644 --- a/lib/node_modules/@stdlib/math/strided/special/drsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/drsqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var drsqrt = require( '@stdlib/math/strided/special/drsqrt' ); +const drsqrt = require( '@stdlib/math/strided/special/drsqrt' ); ``` #### drsqrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var drsqrt = require( '@stdlib/math/strided/special/drsqrt' ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: drsqrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); drsqrt( 3, x, 2, y, -1 ); // y => [ ~0.204, ~0.333, Infinity, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ drsqrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element drsqrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -92,10 +92,10 @@ drsqrt( 3, x1, -2, y1, 1 ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); drsqrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ Infinity, 0.5, ~0.333, ~0.289, ~0.204 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); drsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -135,15 +135,14 @@ drsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var drsqrt = require( '@stdlib/math/strided/special/drsqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const drsqrt = require( '@stdlib/math/strided/special/drsqrt' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/dsqrt/README.md index 30bff679695a..582c252fd849 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dsqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dsqrt = require( '@stdlib/math/strided/special/dsqrt' ); +const dsqrt = require( '@stdlib/math/strided/special/dsqrt' ); ``` #### dsqrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dsqrt = require( '@stdlib/math/strided/special/dsqrt' ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: dsqrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dsqrt( 3, x, 2, y, -1 ); // y => [ ~4.899, 3.0, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dsqrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dsqrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -92,10 +92,10 @@ dsqrt( 3, x1, -2, y1, 1 ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a double-precision floating-point strided array `x` and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dsqrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, 2.0, 3.0, ~3.464, ~4.899 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -135,15 +135,14 @@ dsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsqrt = require( '@stdlib/math/strided/special/dsqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsqrt = require( '@stdlib/math/strided/special/dsqrt' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/dtrunc/README.md b/lib/node_modules/@stdlib/math/strided/special/dtrunc/README.md index e2fa6e94a18d..0eab9b9eb719 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dtrunc/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/dtrunc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dtrunc = require( '@stdlib/math/strided/special/dtrunc' ); +const dtrunc = require( '@stdlib/math/strided/special/dtrunc' ); ``` #### dtrunc( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var dtrunc = require( '@stdlib/math/strided/special/dtrunc' ); Rounds each element in a double-precision floating-point strided array `x` toward zero and assigns the results to elements in a double-precision floating-point strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: dtrunc( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dtrunc( 3, x, 2, y, -1 ); // y => [ -5.0, -3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ dtrunc( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dtrunc( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -92,10 +92,10 @@ dtrunc( 3, x1, -2, y1, 1 ); Rounds each element in a double-precision floating-point strided array `x` toward zero and assigns the results to elements in a double-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dtrunc.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, -3.0, 4.0, -5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dtrunc.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -135,15 +135,14 @@ dtrunc.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dtrunc = require( '@stdlib/math/strided/special/dtrunc' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dtrunc = require( '@stdlib/math/strided/special/dtrunc' ); -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/floor/README.md b/lib/node_modules/@stdlib/math/strided/special/floor/README.md index 07c6c630f07c..777e18d805c2 100644 --- a/lib/node_modules/@stdlib/math/strided/special/floor/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/floor/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var floor = require( '@stdlib/math/strided/special/floor' ); +const floor = require( '@stdlib/math/strided/special/floor' ); ``` #### floor( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -41,9 +41,9 @@ var floor = require( '@stdlib/math/strided/special/floor' ); Rounds each element in a strided array `x` toward negative infinity and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0 ] ); +const x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0 ] ); // Perform operation in-place: floor( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); floor( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ -5.0, -4.0, -2.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ floor( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element floor( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, -6.0, 4.0, 2.0 ] @@ -94,10 +94,10 @@ floor( 3, 'float64', x1, -2, 'float64', y1, 1 ); Rounds each element in a strided array `x` toward negative infinity and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); floor.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ -2.0, 2.0, -4.0, 4.0, -5.0 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.5, 2.3, -3.9, 4.2, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); floor.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, -6.0, 4.0, 2.0 ] @@ -137,23 +137,18 @@ floor.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var floor = require( '@stdlib/math/strided/special/floor' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const floor = require( '@stdlib/math/strided/special/floor' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); floor.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/inv/README.md b/lib/node_modules/@stdlib/math/strided/special/inv/README.md index 9ccacc8d42a0..adc32f7d4074 100644 --- a/lib/node_modules/@stdlib/math/strided/special/inv/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/inv/README.md @@ -48,7 +48,7 @@ y = \frac{1}{x} ## Usage ```javascript -var inv = require( '@stdlib/math/strided/special/inv' ); +const inv = require( '@stdlib/math/strided/special/inv' ); ``` #### inv( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -56,9 +56,9 @@ var inv = require( '@stdlib/math/strided/special/inv' ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); // Perform operation in-place: inv( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -78,10 +78,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); inv( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ 0.1, 0.5, -0.05, 0.0, 0.0, 0.0 ] @@ -90,15 +90,15 @@ inv( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element inv( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.01, 0.25, -1.0 ] @@ -109,10 +109,10 @@ inv( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); inv.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ -0.05, -1.0, 0.5, 0.25, 0.1 ] @@ -126,10 +126,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); inv.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.01, 0.25, -1.0 ] @@ -152,23 +152,18 @@ inv.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var inv = require( '@stdlib/math/strided/special/inv' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -50.0, 50.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const inv = require( '@stdlib/math/strided/special/inv' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -50.0, 50.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); inv.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ramp/README.md b/lib/node_modules/@stdlib/math/strided/special/ramp/README.md index 08118dbee30e..15a6a14bc69d 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ramp/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ramp/README.md @@ -63,7 +63,7 @@ R(x) = \mathop{\mathrm{max}}( x, 0 ) ## Usage ```javascript -var ramp = require( '@stdlib/math/strided/special/ramp' ); +const ramp = require( '@stdlib/math/strided/special/ramp' ); ``` #### ramp( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -71,9 +71,9 @@ var ramp = require( '@stdlib/math/strided/special/ramp' ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: ramp( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -93,10 +93,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ramp( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ 0.0, 0.0, 1.1, 0.0, 0.0, 0.0 ] @@ -105,15 +105,15 @@ ramp( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ramp( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.4, 4.0, 2.5 ] @@ -124,10 +124,10 @@ ramp( 3, 'float64', x1, -2, 'float64', y1, 1 ); Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ramp.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 1.1, 2.5, 0.0, 4.0, 0.0 ] @@ -141,10 +141,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ramp.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.4, 4.0, 2.5 ] @@ -167,23 +167,18 @@ ramp.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var ramp = require( '@stdlib/math/strided/special/ramp' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -10.0, 10.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const ramp = require( '@stdlib/math/strided/special/ramp' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -10.0, 10.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); ramp.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/rsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/rsqrt/README.md index bdfe219f85ec..0eebf75e3bc4 100644 --- a/lib/node_modules/@stdlib/math/strided/special/rsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/rsqrt/README.md @@ -48,7 +48,7 @@ The reciprocal of the principal [square root][@stdlib/math/base/special/rsqrt] i ## Usage ```javascript -var rsqrt = require( '@stdlib/math/strided/special/rsqrt' ); +const rsqrt = require( '@stdlib/math/strided/special/rsqrt' ); ``` #### rsqrt( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -56,9 +56,9 @@ var rsqrt = require( '@stdlib/math/strided/special/rsqrt' ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: rsqrt( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -78,10 +78,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); rsqrt( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ ~0.204, ~0.333, Infinity, 0.0, 0.0, 0.0 ] @@ -90,15 +90,15 @@ rsqrt( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element rsqrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -109,10 +109,10 @@ rsqrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); rsqrt.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ Infinity, 0.5, ~0.333, ~0.289, ~0.204 ] @@ -126,10 +126,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); rsqrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -152,23 +152,18 @@ rsqrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var rsqrt = require( '@stdlib/math/strided/special/rsqrt' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const rsqrt = require( '@stdlib/math/strided/special/rsqrt' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); rsqrt.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sabs/README.md b/lib/node_modules/@stdlib/math/strided/special/sabs/README.md index 6adeadd2d3e3..dcd4ac916567 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sabs/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sabs = require( '@stdlib/math/strided/special/sabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); ``` #### sabs( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sabs = require( '@stdlib/math/strided/special/sabs' ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: sabs( x.length, x, 1, x, 1 ); @@ -61,13 +61,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); sabs( N, x, 2, y, -1 ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,18 +76,18 @@ sabs( N, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); sabs( N, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -98,10 +98,10 @@ sabs( N, x1, -2, y1, 1 ); Computes the [absolute value][@stdlib/math/base/special/abs] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -115,13 +115,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); sabs.ndarray( N, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -144,16 +144,15 @@ sabs.ndarray( N, x, 2, 1, y, -1, y.length-1 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sabs2/README.md b/lib/node_modules/@stdlib/math/strided/special/sabs2/README.md index 8763f4910dde..f45dca892231 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sabs2/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sabs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sabs2 = require( '@stdlib/math/strided/special/sabs2' ); +const sabs2 = require( '@stdlib/math/strided/special/sabs2' ); ``` #### sabs2( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sabs2 = require( '@stdlib/math/strided/special/sabs2' ); Computes the [squared absolute value][@stdlib/math/base/special/abs2f] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the squared absolute values in-place: sabs2( x.length, x, 1, x, 1 ); @@ -61,13 +61,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); sabs2( N, x, 2, y, -1 ); // y => [ 25.0, 9.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,18 +76,18 @@ sabs2( N, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); sabs2( N, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -98,10 +98,10 @@ sabs2( N, x1, -2, y1, 1 ); Computes the [squared absolute value][@stdlib/math/base/special/abs2f] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sabs2.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ] @@ -115,13 +115,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = floor( x.length / 2 ); +const N = floor( x.length / 2 ); sabs2.ndarray( N, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 36.0, 16.0, 4.0 ] @@ -144,16 +144,15 @@ sabs2.ndarray( N, x, 2, 1, y, -1, y.length-1 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sabs2 = require( '@stdlib/math/strided/special/sabs2' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sabs2 = require( '@stdlib/math/strided/special/sabs2' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/scbrt/README.md b/lib/node_modules/@stdlib/math/strided/special/scbrt/README.md index beac367abd91..9aed50321815 100644 --- a/lib/node_modules/@stdlib/math/strided/special/scbrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/scbrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scbrt = require( '@stdlib/math/strided/special/scbrt' ); +const scbrt = require( '@stdlib/math/strided/special/scbrt' ); ``` #### scbrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var scbrt = require( '@stdlib/math/strided/special/scbrt' ); Computes the [cube root][@stdlib/math/base/special/cbrtf] of each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); // Perform operation in-place: scbrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); scbrt( 3, x, 2, y, -1 ); // y => [ 4.0, 2.0, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ scbrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scbrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -92,10 +92,10 @@ scbrt( 3, x1, -2, y1, 1 ); Computes the [cube root][@stdlib/math/base/special/cbrtf] of each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); scbrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, 1.0, 2.0, 3.0, 4.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); scbrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 5.0, 3.0, 1.0 ] @@ -135,15 +135,14 @@ scbrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scbrt = require( '@stdlib/math/strided/special/scbrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scbrt = require( '@stdlib/math/strided/special/scbrt' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sceil/README.md b/lib/node_modules/@stdlib/math/strided/special/sceil/README.md index ea9f02f06c5f..c30fa96cbeb6 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sceil/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sceil/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sceil = require( '@stdlib/math/strided/special/sceil' ); +const sceil = require( '@stdlib/math/strided/special/sceil' ); ``` #### sceil( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sceil = require( '@stdlib/math/strided/special/sceil' ); Rounds each element in a single-precision floating-point strided array `x` toward positive infinity and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: sceil( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sceil( 3, x, 2, y, -1 ); // y => [ -5.0, -3.0, 2.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ sceil( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sceil( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -92,10 +92,10 @@ sceil( 3, x1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array `x` toward positive infinity and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sceil.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 2.0, 3.0, -3.0, 4.0, -5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sceil.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 7.0, 4.0, 3.0 ] @@ -135,15 +135,14 @@ sceil.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sceil = require( '@stdlib/math/strided/special/sceil' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sceil = require( '@stdlib/math/strided/special/sceil' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sdeg2rad/README.md b/lib/node_modules/@stdlib/math/strided/special/sdeg2rad/README.md index ab9ab34c85eb..c6c663db0e33 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sdeg2rad/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sdeg2rad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sdeg2rad = require( '@stdlib/math/strided/special/sdeg2rad' ); +const sdeg2rad = require( '@stdlib/math/strided/special/sdeg2rad' ); ``` #### sdeg2rad( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sdeg2rad = require( '@stdlib/math/strided/special/sdeg2rad' ); Converts each element in a single-precision floating-point strided array `x` from degrees to radians and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); // Perform operation in-place: sdeg2rad( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sdeg2rad( 3, x, 2, y, -1 ); // y => [ ~1.571, ~0.785, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ sdeg2rad( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sdeg2rad( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, ~2.094, ~1.047, ~0.524 ] @@ -92,10 +92,10 @@ sdeg2rad( 3, x1, -2, y1, 1 ); Converts each element in a single-precision floating-point strided array `x` from degrees to radians and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sdeg2rad.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, ~0.524, ~0.785, ~1.047, ~1.571 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sdeg2rad.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, ~2.094, ~1.047, ~0.524 ] @@ -135,15 +135,14 @@ sdeg2rad.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sdeg2rad = require( '@stdlib/math/strided/special/sdeg2rad' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sdeg2rad = require( '@stdlib/math/strided/special/sdeg2rad' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -180.0, 180.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sfloor/README.md b/lib/node_modules/@stdlib/math/strided/special/sfloor/README.md index e738313e1776..1106a759e5e5 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sfloor/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sfloor/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sfloor = require( '@stdlib/math/strided/special/sfloor' ); +const sfloor = require( '@stdlib/math/strided/special/sfloor' ); ``` #### sfloor( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sfloor = require( '@stdlib/math/strided/special/sfloor' ); Rounds each element in a single-precision floating-point strided array `x` toward negative infinity and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); +const x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); // Perform operation in-place: sfloor( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sfloor( 3, x, 2, y, -1 ); // y => [ 5.0, 3.0, -2.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ sfloor( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sfloor( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, -7.0, 4.0, 1.0 ] @@ -92,10 +92,10 @@ sfloor( 3, x1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array `x` toward negative infinity and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sfloor.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ -2.0, 1.0, 3.0, 4.0, 5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.1, 1.1, 3.8, 4.5, 5.9, -6.7 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sfloor.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, -7.0, 4.0, 1.0 ] @@ -135,15 +135,14 @@ sfloor.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sfloor = require( '@stdlib/math/strided/special/sfloor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sfloor = require( '@stdlib/math/strided/special/sfloor' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sin-by/README.md b/lib/node_modules/@stdlib/math/strided/special/sin-by/README.md index c5a4b20512fb..4c13eeba980d 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sin-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sin-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var sinBy = require( '@stdlib/math/strided/special/sin-by' ); +const sinBy = require( '@stdlib/math/strided/special/sin-by' ); ``` #### sinBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, ~0.002, ~-0.002, ~-0.544, ~-0.65 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, ~0.002, ~-0.002, ~-0.544, ~-0.65 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy( 3, x, 2, y, -1, accessor ); // y => [ ~-0.65, ~-0.002, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ sinBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sinBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~-0.99, ~-0.544, ~0.002 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, ~0.002, ~-0.002, ~-0.544, ~-0.65 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 3.14, -3.14, 10.0, -15.0, 67.4 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~-0.99, ~-0.544, ~0.002 ] @@ -180,8 +180,8 @@ sinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 3.14, -3.14, 10.0, -15.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sinBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ sinBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sinBy = require( '@stdlib/math/strided/special/sin-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sinBy = require( '@stdlib/math/strided/special/sin-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( -10.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); sinBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sinv/README.md b/lib/node_modules/@stdlib/math/strided/special/sinv/README.md index 1df9d4fe047d..c0fa0e20e25c 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sinv/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sinv = require( '@stdlib/math/strided/special/sinv' ); +const sinv = require( '@stdlib/math/strided/special/sinv' ); ``` #### sinv( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sinv = require( '@stdlib/math/strided/special/sinv' ); Computes the [multiplicative inverse][@stdlib/math/base/special/invf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); // Perform operation in-place: sinv( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sinv( 3, x, 2, y, -1 ); // y => [ ~0.1, 0.5, ~-0.05, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ sinv( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sinv( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, ~0.01, 0.25, -1.0 ] @@ -92,10 +92,10 @@ sinv( 3, x1, -2, y1, 1 ); Computes the [multiplicative inverse][@stdlib/math/base/special/invf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sinv.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ ~-0.05, -1.0, 0.5, 0.25, ~0.1 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sinv.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, ~0.01, 0.25, -1.0 ] @@ -135,15 +135,14 @@ sinv.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sinv = require( '@stdlib/math/strided/special/sinv' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sinv = require( '@stdlib/math/strided/special/sinv' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -50.0, 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/smskabs/README.md b/lib/node_modules/@stdlib/math/strided/special/smskabs/README.md index 2aad8d98ed52..c1844f1aced3 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskabs/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskabs = require( '@stdlib/math/strided/special/smskabs' ); +const smskabs = require( '@stdlib/math/strided/special/smskabs' ); ``` #### smskabs( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskabs = require( '@stdlib/math/strided/special/smskabs' ); Computes the [absolute value][@stdlib/math/base/special/absf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskabs( x.length, x, 1, m, 1, y, 1 ); // y => [ 2.0, 1.0, 0.0, 5.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 2.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskabs( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskabs( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0 ] @@ -101,12 +101,12 @@ smskabs( 3, x1, -2, m1, -2, y1, 1 ); Computes the [absolute value][@stdlib/math/base/special/absf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 2.0, 1.0, 0.0, 5.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0 ] @@ -149,17 +149,16 @@ smskabs.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskabs = require( '@stdlib/math/strided/special/smskabs' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskabs = require( '@stdlib/math/strided/special/smskabs' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskabs2/README.md b/lib/node_modules/@stdlib/math/strided/special/smskabs2/README.md index c48e58ec6402..8ee2e3783eae 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskabs2/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskabs2/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskabs2 = require( '@stdlib/math/strided/special/smskabs2' ); +const smskabs2 = require( '@stdlib/math/strided/special/smskabs2' ); ``` #### smskabs2( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskabs2 = require( '@stdlib/math/strided/special/smskabs2' ); Computes the [squared absolute value][@stdlib/math/base/special/abs2f] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskabs2( x.length, x, 1, m, 1, y, 1 ); // y => [ 4.0, 1.0, 0.0, 25.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs2( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskabs2( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskabs2( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -101,12 +101,12 @@ smskabs2( 3, x1, -2, m1, -2, y1, 1 ); Computes the [squared absolute value][@stdlib/math/base/special/abs2f] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs2.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 4.0, 1.0, 0.0, 25.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskabs2.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 25.0, 1.0 ] @@ -149,17 +149,16 @@ smskabs2.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskabs2 = require( '@stdlib/math/strided/special/smskabs2' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskabs2 = require( '@stdlib/math/strided/special/smskabs2' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskcbrt/README.md b/lib/node_modules/@stdlib/math/strided/special/smskcbrt/README.md index 8f9bd4198794..5f69d51b67d2 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskcbrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskcbrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskcbrt = require( '@stdlib/math/strided/special/smskcbrt' ); +const smskcbrt = require( '@stdlib/math/strided/special/smskcbrt' ); ``` #### smskcbrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskcbrt = require( '@stdlib/math/strided/special/smskcbrt' ); Computes the [cube root][@stdlib/math/base/special/cbrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskcbrt( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, 1.0, 0.0, 3.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskcbrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskcbrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskcbrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 3.0, 1.0 ] @@ -101,12 +101,12 @@ smskcbrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the [cube root][@stdlib/math/base/special/cbrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskcbrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, 1.0, 0.0, 3.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 1.0, 8.0, 27.0, 64.0, 125.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskcbrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 3.0, 1.0 ] @@ -149,17 +149,16 @@ smskcbrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskcbrt = require( '@stdlib/math/strided/special/smskcbrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskcbrt = require( '@stdlib/math/strided/special/smskcbrt' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -100.0, 100.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskceil/README.md b/lib/node_modules/@stdlib/math/strided/special/smskceil/README.md index 75c5069a6ef0..ad642a3acc6e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskceil/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskceil/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskceil = require( '@stdlib/math/strided/special/smskceil' ); +const smskceil = require( '@stdlib/math/strided/special/smskceil' ); ``` #### smskceil( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskceil = require( '@stdlib/math/strided/special/smskceil' ); Rounds each element in a single-precision floating-point strided array `x` toward positive infinity according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskceil( x.length, x, 1, m, 1, y, 1 ); // y => [ 2.0, 3.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskceil( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 2.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskceil( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskceil( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 3.0 ] @@ -101,12 +101,12 @@ smskceil( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array `x` toward positive infinity according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskceil.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 2.0, 3.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskceil.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 3.0 ] @@ -149,17 +149,16 @@ smskceil.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskceil = require( '@stdlib/math/strided/special/smskceil' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskceil = require( '@stdlib/math/strided/special/smskceil' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskdeg2rad/README.md b/lib/node_modules/@stdlib/math/strided/special/smskdeg2rad/README.md index c42454fef1b1..599f9d5be845 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskdeg2rad/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskdeg2rad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskdeg2rad = require( '@stdlib/math/strided/special/smskdeg2rad' ); +const smskdeg2rad = require( '@stdlib/math/strided/special/smskdeg2rad' ); ``` #### smskdeg2rad( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskdeg2rad = require( '@stdlib/math/strided/special/smskdeg2rad' ); Converts each element in a single-precision floating-point strided array `x` from degrees to radians according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskdeg2rad( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, ~0.524, 0.0, ~1.047, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskdeg2rad( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskdeg2rad( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskdeg2rad( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~1.047, ~0.524 ] @@ -101,12 +101,12 @@ smskdeg2rad( 3, x1, -2, m1, -2, y1, 1 ); Converts each element in a single-precision floating-point strided array `x` from degrees to radians according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskdeg2rad.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, ~0.524, 0.0, ~1.047, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 30.0, 45.0, 60.0, 90.0, 120.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskdeg2rad.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~1.047, ~0.524 ] @@ -149,17 +149,16 @@ smskdeg2rad.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskdeg2rad = require( '@stdlib/math/strided/special/smskdeg2rad' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskdeg2rad = require( '@stdlib/math/strided/special/smskdeg2rad' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -180.0, 180.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskfloor/README.md b/lib/node_modules/@stdlib/math/strided/special/smskfloor/README.md index 9a6eb2861fa0..c3c64fc1e66d 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskfloor/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskfloor/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); +const smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); ``` #### smskfloor( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); Rounds each element in a single-precision floating-point strided array toward negative infinity according to a strided mask array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskfloor( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskfloor( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskfloor( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskfloor( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -101,12 +101,12 @@ smskfloor( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array toward negative infinity according to a strided mask array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskfloor.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskfloor.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -149,17 +149,16 @@ smskfloor.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskinv/README.md b/lib/node_modules/@stdlib/math/strided/special/smskinv/README.md index 5b5d39eaa5ba..3a6da5109dc4 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskinv/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskinv/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskinv = require( '@stdlib/math/strided/special/smskinv' ); +const smskinv = require( '@stdlib/math/strided/special/smskinv' ); ``` #### smskinv( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskinv = require( '@stdlib/math/strided/special/smskinv' ); Computes the [multiplicative inverse][@stdlib/math/base/special/invf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskinv( x.length, x, 1, m, 1, y, 1 ); // y => [ ~-0.05, -1.0, 0.0, 0.25, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskinv( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, ~-0.05, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskinv( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskinv( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 0.25, -1.0 ] @@ -101,12 +101,12 @@ smskinv( 3, x1, -2, m1, -2, y1, 1 ); Computes the [multiplicative inverse][@stdlib/math/base/special/invf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskinv.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ ~-0.05, -1.0, 0.0, 0.25, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -20.0, -1.0, 2.0, 4.0, 10.0, 100.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskinv.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.25, -1.0 ] @@ -149,17 +149,16 @@ smskinv.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskinv = require( '@stdlib/math/strided/special/smskinv' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskinv = require( '@stdlib/math/strided/special/smskinv' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -50.0, 50.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskramp/README.md b/lib/node_modules/@stdlib/math/strided/special/smskramp/README.md index 0910fdf5a7c4..7ea2bb486efd 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskramp/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskramp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskramp = require( '@stdlib/math/strided/special/smskramp' ); +const smskramp = require( '@stdlib/math/strided/special/smskramp' ); ``` #### smskramp( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskramp = require( '@stdlib/math/strided/special/smskramp' ); Evaluates the [ramp function][@stdlib/math/base/special/rampf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskramp( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskramp( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskramp( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskramp( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -101,12 +101,12 @@ smskramp( 3, x1, -2, m1, -2, y1, 1 ); Evaluates the [ramp function][@stdlib/math/base/special/rampf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskramp.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskramp.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -149,17 +149,16 @@ smskramp.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskramp = require( '@stdlib/math/strided/special/smskramp' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskramp = require( '@stdlib/math/strided/special/smskramp' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smskrsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/smskrsqrt/README.md index 282ab345932c..62796c1a2cd7 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smskrsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smskrsqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskrsqrt = require( '@stdlib/math/strided/special/smskrsqrt' ); +const smskrsqrt = require( '@stdlib/math/strided/special/smskrsqrt' ); ``` #### smskrsqrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smskrsqrt = require( '@stdlib/math/strided/special/smskrsqrt' ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smskrsqrt( x.length, x, 1, m, 1, y, 1 ); // y => [ Infinity, 0.5, 0.0, ~0.289, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskrsqrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, Infinity, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smskrsqrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskrsqrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~0.289, 0.5 ] @@ -101,12 +101,12 @@ smskrsqrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskrsqrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ Infinity, 0.5, 0.0, ~0.289, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskrsqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~0.289, 0.5 ] @@ -149,17 +149,16 @@ smskrsqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskrsqrt = require( '@stdlib/math/strided/special/smskrsqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskrsqrt = require( '@stdlib/math/strided/special/smskrsqrt' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smsksqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/smsksqrt/README.md index c560c086f165..63b2c7668fa0 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smsksqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smsksqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smsksqrt = require( '@stdlib/math/strided/special/smsksqrt' ); +const smsksqrt = require( '@stdlib/math/strided/special/smsksqrt' ); ``` #### smsksqrt( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smsksqrt = require( '@stdlib/math/strided/special/smsksqrt' ); Computes the principal [square root][@stdlib/math/base/special/sqrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smsksqrt( x.length, x, 1, m, 1, y, 1 ); // y => [ 0.0, 2.0, 0.0, ~3.464, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsksqrt( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smsksqrt( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smsksqrt( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, ~3.464, 2.0 ] @@ -101,12 +101,12 @@ smsksqrt( 3, x1, -2, m1, -2, y1, 1 ); Computes the principal [square root][@stdlib/math/base/special/sqrtf] for each element in a single-precision floating-point strided array `x` according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsksqrt.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 0.0, 2.0, 0.0, ~3.464, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsksqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, ~3.464, 2.0 ] @@ -149,17 +149,16 @@ smsksqrt.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smsksqrt = require( '@stdlib/math/strided/special/smsksqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smsksqrt = require( '@stdlib/math/strided/special/smsksqrt' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/smsktrunc/README.md b/lib/node_modules/@stdlib/math/strided/special/smsktrunc/README.md index dd224daa6c57..aeffa72e526f 100644 --- a/lib/node_modules/@stdlib/math/strided/special/smsktrunc/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/smsktrunc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smsktrunc = require( '@stdlib/math/strided/special/smsktrunc' ); +const smsktrunc = require( '@stdlib/math/strided/special/smsktrunc' ); ``` #### smsktrunc( N, x, sx, m, sm, y, sy ) @@ -41,12 +41,12 @@ var smsktrunc = require( '@stdlib/math/strided/special/smsktrunc' ); Rounds each element in a single-precision floating-point strided array `x` toward zero according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( x.length ); smsktrunc( x.length, x, 1, m, 1, y, 1 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -65,12 +65,12 @@ The function accepts the following arguments: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsktrunc( 3, x, 2, m, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -79,18 +79,18 @@ smsktrunc( 3, x, 2, m, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Initial arrays... -var x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smsktrunc( 3, x1, -2, m1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -101,12 +101,12 @@ smsktrunc( 3, x1, -2, m1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array `x` toward zero according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsktrunc.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -121,12 +121,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 1, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smsktrunc.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -149,17 +149,16 @@ smsktrunc.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smsktrunc = require( '@stdlib/math/strided/special/smsktrunc' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smsktrunc = require( '@stdlib/math/strided/special/smsktrunc' ); -var x = new Float32Array( 10 ); -var m = new Uint8Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); if ( uniform( 0.0, 1.0 ) < 0.5 ) { m[ i ] = 1; diff --git a/lib/node_modules/@stdlib/math/strided/special/sqrt-by/README.md b/lib/node_modules/@stdlib/math/strided/special/sqrt-by/README.md index ec3d8544e6fb..d30e6b3e0107 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sqrt-by/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sqrt-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var sqrtBy = require( '@stdlib/math/strided/special/sqrt-by' ); +const sqrtBy = require( '@stdlib/math/strided/special/sqrt-by' ); ``` #### sqrtBy( N, x, strideX, y, strideY, clbk\[, thisArg] ) @@ -47,8 +47,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 1.0, ~11.045, ~7.071, ~8.983 ] @@ -81,17 +81,17 @@ function accessor( v ) { return v; } -var context = { +const context = { 'count': 0 }; -var x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy( x.length, x, 1, y, 1, accessor, context ); // y => [ 0.0, 1.0, ~11.045, ~7.071, ~8.983 ] -var cnt = context.count; +const cnt = context.count; // returns 5 ``` @@ -102,8 +102,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy( 3, x, 2, y, -1, accessor ); // y => [ ~8.983, ~11.045, 0.0, 0.0, 0.0, 0.0 ] @@ -112,19 +112,19 @@ sqrtBy( 3, x, 2, y, -1, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function accessor( v ) { return v; } // Initial arrays... -var x0 = new Float64Array( [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sqrtBy( 3, x1, -2, y1, 1, accessor ); // y0 => [ 0.0, 0.0, 0.0, ~6.573, ~7.071, 1.0 ] @@ -139,8 +139,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // y => [ 0.0, 1.0, ~11.045, ~7.071, ~8.983 ] @@ -158,8 +158,8 @@ function accessor( v ) { return v; } -var x = [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 0.0, 1.0, 122.0, 50.0, 80.7, 43.2 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // y => [ 0.0, 0.0, 0.0, ~6.573, ~7.071, 1.0 ] @@ -180,8 +180,8 @@ sqrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); // No-op... } - var x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ 0.0, 1.0, 122.0, 50.0, 80.7 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; sqrtBy( x.length, x, 1, y, 1, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -198,10 +198,10 @@ sqrtBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var sqrtBy = require( '@stdlib/math/strided/special/sqrt-by' ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const sqrtBy = require( '@stdlib/math/strided/special/sqrt-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -211,10 +211,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); +const x = filledarrayBy( 10, 'generic', uniform( 0.0, 10.0 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); sqrtBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, accessor ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/sqrt/README.md index b5c436b5cc3a..a98908ea5a20 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sqrt/README.md @@ -48,7 +48,7 @@ The principal [square root][@stdlib/math/base/special/sqrt] is defined as ## Usage ```javascript -var sqrt = require( '@stdlib/math/strided/special/sqrt' ); +const sqrt = require( '@stdlib/math/strided/special/sqrt' ); ``` #### sqrt( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -56,9 +56,9 @@ var sqrt = require( '@stdlib/math/strided/special/sqrt' ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a strided array `x` and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: sqrt( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -78,10 +78,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sqrt( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ ~4.899, 3.0, 0.0, 0.0, 0.0, 0.0 ] @@ -90,15 +90,15 @@ sqrt( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sqrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -109,10 +109,10 @@ sqrt( 3, 'float64', x1, -2, 'float64', y1, 1 ); Computes the principal [square root][@stdlib/math/base/special/sqrt] for each element in a strided array `x` and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sqrt.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 0.0, 2.0, 3.0, ~3.464, ~4.899 ] @@ -126,10 +126,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sqrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -152,23 +152,18 @@ sqrt.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var sqrt = require( '@stdlib/math/strided/special/sqrt' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const sqrt = require( '@stdlib/math/strided/special/sqrt' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( 0.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); sqrt.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/strided/special/sramp/README.md b/lib/node_modules/@stdlib/math/strided/special/sramp/README.md index 7bdfe8a1d9ab..125f64684816 100644 --- a/lib/node_modules/@stdlib/math/strided/special/sramp/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/sramp/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sramp = require( '@stdlib/math/strided/special/sramp' ); +const sramp = require( '@stdlib/math/strided/special/sramp' ); ``` #### sramp( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var sramp = require( '@stdlib/math/strided/special/sramp' ); Evaluates the [ramp function][@stdlib/math/base/special/rampf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); // Perform operation in-place: sramp( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sramp( 3, x, 2, y, -1 ); // y => [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ sramp( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element sramp( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -92,10 +92,10 @@ sramp( 3, x1, -2, y1, 1 ); Evaluates the [ramp function][@stdlib/math/base/special/rampf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sramp.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 2.0, -3.0, 4.0, -5.0, 6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); sramp.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -135,15 +135,14 @@ sramp.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sramp = require( '@stdlib/math/strided/special/sramp' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sramp = require( '@stdlib/math/strided/special/sramp' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/srsqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/srsqrt/README.md index 339554222092..4123f3b6903c 100644 --- a/lib/node_modules/@stdlib/math/strided/special/srsqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/srsqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var srsqrt = require( '@stdlib/math/strided/special/srsqrt' ); +const srsqrt = require( '@stdlib/math/strided/special/srsqrt' ); ``` #### srsqrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var srsqrt = require( '@stdlib/math/strided/special/srsqrt' ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrtf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: srsqrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); srsqrt( 3, x, 2, y, -1 ); // y => [ ~0.204, ~0.333, 1.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ srsqrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element srsqrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -92,10 +92,10 @@ srsqrt( 3, x1, -2, y1, 1 ); Computes the [reciprocal square root][@stdlib/math/base/special/rsqrtf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); srsqrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 0.5, ~0.333, ~0.289, ~0.204 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); srsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.125, ~0.289, 0.5 ] @@ -135,15 +135,14 @@ srsqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var srsqrt = require( '@stdlib/math/strided/special/srsqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const srsqrt = require( '@stdlib/math/strided/special/srsqrt' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/ssqrt/README.md b/lib/node_modules/@stdlib/math/strided/special/ssqrt/README.md index 5236ceaf6888..7cc77375b433 100644 --- a/lib/node_modules/@stdlib/math/strided/special/ssqrt/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/ssqrt/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ssqrt = require( '@stdlib/math/strided/special/ssqrt' ); +const ssqrt = require( '@stdlib/math/strided/special/ssqrt' ); ``` #### ssqrt( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var ssqrt = require( '@stdlib/math/strided/special/ssqrt' ); Computes the principal [square root][@stdlib/math/base/special/sqrtf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); // Perform operation in-place: ssqrt( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ssqrt( 3, x, 2, y, -1 ); // y => [ ~4.899, 3.0, 0.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ ssqrt( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element ssqrt( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -92,10 +92,10 @@ ssqrt( 3, x1, -2, y1, 1 ); Computes the principal [square root][@stdlib/math/base/special/sqrtf] for each element in a single-precision floating-point strided array `x` and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ssqrt.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 0.0, 2.0, 3.0, ~3.464, ~4.899 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 0.0, 4.0, 9.0, 12.0, 24.0, 64.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ssqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 8.0, ~3.464, 2.0 ] @@ -135,15 +135,14 @@ ssqrt.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ssqrt = require( '@stdlib/math/strided/special/ssqrt' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ssqrt = require( '@stdlib/math/strided/special/ssqrt' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( 0.0, 200.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/strunc/README.md b/lib/node_modules/@stdlib/math/strided/special/strunc/README.md index b801e7e0bea5..d5e6804b1575 100644 --- a/lib/node_modules/@stdlib/math/strided/special/strunc/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/strunc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var strunc = require( '@stdlib/math/strided/special/strunc' ); +const strunc = require( '@stdlib/math/strided/special/strunc' ); ``` #### strunc( N, x, strideX, y, strideY ) @@ -41,9 +41,9 @@ var strunc = require( '@stdlib/math/strided/special/strunc' ); Rounds each element in a single-precision floating-point strided array `x` toward zero and assigns the results to elements in a single-precision floating-point strided array `y`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: strunc( x.length, x, 1, x, 1 ); @@ -61,10 +61,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); strunc( 3, x, 2, y, -1 ); // y => [ -5.0, -3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -73,15 +73,15 @@ strunc( 3, x, 2, y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element strunc( 3, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -92,10 +92,10 @@ strunc( 3, x1, -2, y1, 1 ); Rounds each element in a single-precision floating-point strided array `x` toward zero and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); strunc.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, -3.0, 4.0, -5.0 ] @@ -109,10 +109,10 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); strunc.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -135,15 +135,14 @@ strunc.ndarray( 3, x, 2, 1, y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); -var Float32Array = require( '@stdlib/array/float32' ); -var strunc = require( '@stdlib/math/strided/special/strunc' ); +const uniform = require( '@stdlib/random/base/uniform' ); +const Float32Array = require( '@stdlib/array/float32' ); +const strunc = require( '@stdlib/math/strided/special/strunc' ); -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = uniform( -10.0, 10.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/math/strided/special/trunc/README.md b/lib/node_modules/@stdlib/math/strided/special/trunc/README.md index 63125ded003b..2ab928317ea5 100644 --- a/lib/node_modules/@stdlib/math/strided/special/trunc/README.md +++ b/lib/node_modules/@stdlib/math/strided/special/trunc/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var trunc = require( '@stdlib/math/strided/special/trunc' ); +const trunc = require( '@stdlib/math/strided/special/trunc' ); ``` #### trunc( N, dtypeX, x, strideX, dtypeY, y, strideY ) @@ -41,9 +41,9 @@ var trunc = require( '@stdlib/math/strided/special/trunc' ); Rounds each element in a strided array `x` toward zero and assigns the results to elements in a strided array `y`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); // Perform operation in-place: trunc( x.length, 'float64', x, 1, 'float64', x, 1 ); @@ -63,10 +63,10 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); trunc( 3, 'float64', x, 2, 'float64', y, -1 ); // y => [ -5.0, -3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -75,15 +75,15 @@ trunc( 3, 'float64', x, 2, 'float64', y, -1 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element trunc( 3, 'float64', x1, -2, 'float64', y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -94,10 +94,10 @@ trunc( 3, 'float64', x1, -2, 'float64', y1, 1 ); Rounds each element in a strided array `x` toward zero and assigns the results to elements in a strided array `y` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); trunc.ndarray( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 ); // y => [ 1.0, 2.0, -3.0, 4.0, -5.0 ] @@ -111,10 +111,10 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.1, 2.5, -3.5, 4.0, -5.9, 6.4 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); trunc.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -137,23 +137,18 @@ trunc.ndarray( 3, 'float64', x, 2, 1, 'float64', y, -1, y.length-1 ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); -var trunc = require( '@stdlib/math/strided/special/trunc' ); - -var dt; -var x; -var y; -var i; - -dt = dtypes(); -for ( i = 0; i < dt.length; i++ ) { - x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); +const uniform = require( '@stdlib/random/base/uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); +const trunc = require( '@stdlib/math/strided/special/trunc' ); + +const dt = dtypes(); +for ( let i = 0; i < dt.length; i++ ) { + const x = filledarrayBy( 10, dt[ i ], uniform( -100.0, 100.0 ) ); console.log( x ); - y = filledarray( 0.0, x.length, 'generic' ); + const y = filledarray( 0.0, x.length, 'generic' ); console.log( y ); trunc.ndarray( x.length, dt[ i ], x, 1, 0, 'generic', y, -1, y.length-1 ); diff --git a/lib/node_modules/@stdlib/math/tools/README.md b/lib/node_modules/@stdlib/math/tools/README.md index 805ba2e516b2..2d4b95cee845 100644 --- a/lib/node_modules/@stdlib/math/tools/README.md +++ b/lib/node_modules/@stdlib/math/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/math/tools' ); +const ns = require( '@stdlib/math/tools' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/math/tools' ); Namespace for math tools. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace exposes the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/math/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/math/tools' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/math/tools/unary/README.md b/lib/node_modules/@stdlib/math/tools/unary/README.md index 5152bad7ce13..3d7fc7943c72 100644 --- a/lib/node_modules/@stdlib/math/tools/unary/README.md +++ b/lib/node_modules/@stdlib/math/tools/unary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/math/tools/unary' ); +const dispatch = require( '@stdlib/math/tools/unary' ); ``` #### dispatch( table ) @@ -47,12 +47,12 @@ Returns a function which dispatches to specified functions based on input argume ```javascript -var nabs = require( '@stdlib/math/base/special/abs' ); -var dabs = require( '@stdlib/math/strided/special/dabs' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); -var gabs = require( '@stdlib/math/strided/special/abs' ); +const nabs = require( '@stdlib/math/base/special/abs' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); +const gabs = require( '@stdlib/math/strided/special/abs' ); -var table = { +const table = { 'scalar': [ 'number', nabs ], @@ -68,7 +68,7 @@ var table = { ] }; -var abs = dispatch( table ); +const abs = dispatch( table ); ``` The function accepts the following arguments: @@ -132,12 +132,12 @@ Dispatches to an underlying implementation based the data type of `x`. ```javascript -var nabs = require( '@stdlib/math/base/special/abs' ); -var dabs = require( '@stdlib/math/strided/special/dabs' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); -var gabs = require( '@stdlib/math/strided/special/abs' ); +const nabs = require( '@stdlib/math/base/special/abs' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); +const gabs = require( '@stdlib/math/strided/special/abs' ); -var table = { +const table = { 'scalar': [ 'number', nabs ], @@ -153,9 +153,9 @@ var table = { ] }; -var abs = dispatch( table ); +const abs = dispatch( table ); -var y = abs( -1.0 ); +const y = abs( -1.0 ); // returns 1.0 ``` @@ -168,12 +168,12 @@ If provided an [`ndarray`][@stdlib/ndarray/ctor], the function returns an [`ndar ```javascript -var dabs = require( '@stdlib/math/strided/special/dabs' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); -var gabs = require( '@stdlib/math/strided/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); +const gabs = require( '@stdlib/math/strided/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var table = { +const table = { 'ndarray': [ 'float64', dabs.ndarray, 'float32', sabs.ndarray, @@ -181,13 +181,13 @@ var table = { ] }; -var abs = dispatch( table ); +const abs = dispatch( table ); -var x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 -var y = abs( x ); +const x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); // 2x2 +const y = abs( x ); // returns -var v = y.get( 0, 1 ); +const v = y.get( 0, 1 ); // returns 2.0 ``` @@ -196,12 +196,12 @@ If provided an array-like object, the function returns an array-like object havi ```javascript -var dabs = require( '@stdlib/math/strided/special/dabs' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); -var gabs = require( '@stdlib/math/strided/special/abs' ); -var Float64Array = require( '@stdlib/array/float64' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); +const gabs = require( '@stdlib/math/strided/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); -var table = { +const table = { 'array': [ 'float64', dabs, 'float32', sabs, @@ -209,10 +209,10 @@ var table = { ] }; -var abs = dispatch( table ); +const abs = dispatch( table ); -var x = new Float64Array( [ -1.0, -2.0 ] ); -var y = abs( x ); +const x = new Float64Array( [ -1.0, -2.0 ] ); +const y = abs( x ); // returns [ 1.0, 2.0 ] ``` @@ -241,25 +241,17 @@ var y = abs( x ); ```javascript -var nabs = require( '@stdlib/math/base/special/abs' ); -var dabs = require( '@stdlib/math/strided/special/dabs' ); -var sabs = require( '@stdlib/math/strided/special/sabs' ); -var gabs = require( '@stdlib/math/strided/special/abs' ); -var Float64Array = require( '@stdlib/array/float64' ); -var array = require( '@stdlib/ndarray/array' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var dispatch = require( '@stdlib/math/tools/unary' ); - -var table; -var sub; -var abs; -var sh; -var x; -var y; -var i; +const nabs = require( '@stdlib/math/base/special/abs' ); +const dabs = require( '@stdlib/math/strided/special/dabs' ); +const sabs = require( '@stdlib/math/strided/special/sabs' ); +const gabs = require( '@stdlib/math/strided/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const array = require( '@stdlib/ndarray/array' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const dispatch = require( '@stdlib/math/tools/unary' ); // Define a table for resolving unary functions based on argument data types: -table = { +const table = { 'scalar': [ 'number', nabs ], @@ -276,26 +268,26 @@ table = { }; // Create a function which dispatches based on argument data types: -abs = dispatch( table ); +const abs = dispatch( table ); // Provide a number... -y = abs( -1.0 ); +let y = abs( -1.0 ); console.log( 'x = %d => abs(x) = %d', -1.0, y ); // Provide an array-like object... -x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); +let x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); y = abs( x ); -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x_%d = %d => abs(x_%d) = %d', i, x[ i ], i, y[ i ] ); } // Provide an ndarray... x = array( [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ] ); -sh = x.shape; +const sh = x.shape; y = abs( x ); -for ( i = 0; i < x.length; i++ ) { - sub = ind2sub( sh, i ); +for ( let i = 0; i < x.length; i++ ) { + const sub = ind2sub( sh, i ); console.log( 'x_%d%d = %d => abs(x_%d%d) = %d', sub[ 0 ], sub[ 1 ], x.iget( i ), sub[ 0 ], sub[ 1 ], y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ml/README.md b/lib/node_modules/@stdlib/ml/README.md index c22e343e5751..5e3fb339b898 100644 --- a/lib/node_modules/@stdlib/ml/README.md +++ b/lib/node_modules/@stdlib/ml/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ml = require( '@stdlib/ml' ); +const ml = require( '@stdlib/ml' ); ``` #### ml @@ -35,7 +35,7 @@ var ml = require( '@stdlib/ml' ); Namespace containing machine learning algorithms. ```javascript -var algs = ml; +const algs = ml; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ml = require( '@stdlib/ml' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ml = require( '@stdlib/ml' ); console.log( objectKeys( ml ) ); ``` diff --git a/lib/node_modules/@stdlib/ml/incr/README.md b/lib/node_modules/@stdlib/ml/incr/README.md index b7b32bf3c856..22092229040c 100644 --- a/lib/node_modules/@stdlib/ml/incr/README.md +++ b/lib/node_modules/@stdlib/ml/incr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/ml/incr' ); +const ns = require( '@stdlib/ml/incr' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/ml/incr' ); Namespace containing incremental machine learning algorithms. ```javascript -var incr = ns; +const incr = ns; // returns {...} ``` @@ -64,8 +64,8 @@ var incr = ns; ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/ml/incr' ); +const getKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/ml/incr' ); console.log( getKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/ml/incr/binary-classification/README.md b/lib/node_modules/@stdlib/ml/incr/binary-classification/README.md index 488151d1f174..a8112f8583a1 100644 --- a/lib/node_modules/@stdlib/ml/incr/binary-classification/README.md +++ b/lib/node_modules/@stdlib/ml/incr/binary-classification/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrBinaryClassification = require( '@stdlib/ml/incr/binary-classification' ); +const incrBinaryClassification = require( '@stdlib/ml/incr/binary-classification' ); ``` #### incrBinaryClassification( N\[, options] ) @@ -36,7 +36,7 @@ Returns an accumulator `function` which incrementally performs binary classifica ```javascript // Create an accumulator for performing binary classification on 3-dimensional data: -var accumulator = incrBinaryClassification( 3 ); +const accumulator = incrBinaryClassification( 3 ); ``` The function accepts the following `options`: @@ -67,16 +67,16 @@ The function accepts the following `options`: By default, the model contains an intercept term. To omit the intercept, set the `intercept` option to `false`: ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a model with the intercept term: -var acc = incrBinaryClassification( 2, { +let acc = incrBinaryClassification( 2, { 'intercept': true }); -var coefs = acc( array( [ 1.4, 0.5 ] ), 1 ); +let coefs = acc( array( [ 1.4, 0.5 ] ), 1 ); // returns -var dim = coefs.length; +let dim = coefs.length; // returns 3 // Create a model without the intercept term: @@ -95,15 +95,15 @@ dim = coefs.length; If provided a feature vector `x` and response value `y` (either `+1` or `-1`), the accumulator function updates a binary classification model; otherwise, the accumulator function returns the current binary classification model coefficients. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create an accumulator: -var acc = incrBinaryClassification( 2 ); +const acc = incrBinaryClassification( 2 ); // Provide data to the accumulator... -var x = array( [ 1.0, 0.0 ] ); +const x = array( [ 1.0, 0.0 ] ); -var coefs = acc( x, -1 ); +let coefs = acc( x, -1 ); // returns x.set( 0, 0.0 ); @@ -127,14 +127,14 @@ coefs = acc(); Computes predicted response values for one or more observation vectors `X`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a model with the intercept term: -var acc = incrBinaryClassification( 2 ); +const acc = incrBinaryClassification( 2 ); // ... -var label = acc.predict( array( [ 0.5, 2.0 ] ) ); +const label = acc.predict( array( [ 0.5, 2.0 ] ) ); // returns ``` @@ -143,32 +143,32 @@ Provided an [`ndarray`][@stdlib/ndarray/ctor] having shape `(..., N)`, where `N` By default, the method returns the predict label (`type='label'`). In order to return a prediction probability of a `+1` response value given either the logistic (`log`) or modified Huber (`modifiedHuber`) loss functions, set the second argument to `'probability'`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a model with the intercept term: -var acc = incrBinaryClassification( 2, { +const acc = incrBinaryClassification( 2, { 'loss': 'log' }); // ... -var phat = acc.predict( array( [ 0.5, 2.0 ] ), 'probability' ); +const phat = acc.predict( array( [ 0.5, 2.0 ] ), 'probability' ); // returns ``` In order to return the linear predictor (i.e., the signed distance to the hyperplane, which is computed as the dot product between the model coefficients and the provided feature vector `x`, plus the intercept), set the second argument to `'linear'`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a model with the intercept term: -var acc = incrBinaryClassification( 2, { +const acc = incrBinaryClassification( 2, { 'loss': 'log' }); // ... -var lp = acc.predict( array( [ 0.5, 2.0 ] ), 'linear' ); +const lp = acc.predict( array( [ 0.5, 2.0 ] ), 'linear' ); // returns ``` @@ -194,41 +194,40 @@ Given a feature vector `x = [x_0, x_1, ...]` and model coefficients `c = [c_0, c ## Examples + + ```javascript -var normal = require( '@stdlib/random/base/normal' ); -var binomial = require( '@stdlib/random/base/binomial' ); -var array = require( '@stdlib/ndarray/array' ); -var exp = require( '@stdlib/math/base/special/exp' ); -var incrBinaryClassification = require( '@stdlib/ml/incr/binary-classification' ); +const normal = require( '@stdlib/random/base/normal' ); +const binomial = require( '@stdlib/random/base/binomial' ); +const array = require( '@stdlib/ndarray/array' ); +const exp = require( '@stdlib/math/base/special/exp' ); +const incrBinaryClassification = require( '@stdlib/ml/incr/binary-classification' ); // Create a new accumulator: -var acc = incrBinaryClassification( 2, { +const acc = incrBinaryClassification( 2, { 'intercept': true, 'lambda': 1.0e-3, 'loss': 'log' }); // Incrementally update the classification model... -var phat; -var x; -var i; -for ( i = 0; i < 10000; i++ ) { - x = array( [ normal( 0.0, 1.0 ), normal( 0.0, 1.0 ) ] ); - phat = 1.0 / ( 1.0+exp( -( ( 3.0*x.get(0) ) - ( 2.0*x.get(1) ) + 1.0 ) ) ); +for ( let i = 0; i < 10000; i++ ) { + const x = array( [ normal( 0.0, 1.0 ), normal( 0.0, 1.0 ) ] ); + const phat = 1.0 / ( 1.0+exp( -( ( 3.0*x.get(0) ) - ( 2.0*x.get(1) ) + 1.0 ) ) ); acc( x, ( binomial( 1, phat ) ) ? 1.0 : -1.0 ); } // Retrieve model coefficients: -var coefs = acc(); +const coefs = acc(); console.log( 'Feature coefficients: %d, %d', coefs.get( 0 ), coefs.get( 1 ) ); console.log( 'Intercept: %d', coefs.get( 2 ) ); // Predict new observations... -x = array( [ [ 0.9, 0.1 ], [ 0.1, 0.9 ], [ 0.9, 0.9 ] ] ); +const x = array( [ [ 0.9, 0.1 ], [ 0.1, 0.9 ], [ 0.9, 0.9 ] ] ); -var out = acc.predict( x ); +let out = acc.predict( x ); console.log( 'x = [%d, %d]; label = %d', x.get( 0, 0 ), x.get( 0, 1 ), out.get( 0 ) ); console.log( 'x = [%d, %d]; label = %d', x.get( 1, 0 ), x.get( 1, 1 ), out.get( 1 ) ); console.log( 'x = [%d, %d]; label = %d', x.get( 2, 0 ), x.get( 2, 1 ), out.get( 2 ) ); diff --git a/lib/node_modules/@stdlib/ml/incr/kmeans/README.md b/lib/node_modules/@stdlib/ml/incr/kmeans/README.md index f52c4196f632..0c6feeae8799 100644 --- a/lib/node_modules/@stdlib/ml/incr/kmeans/README.md +++ b/lib/node_modules/@stdlib/ml/incr/kmeans/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var incrkmeans = require( '@stdlib/ml/incr/kmeans' ); +const incrkmeans = require( '@stdlib/ml/incr/kmeans' ); ``` #### incrkmeans( k\[, ndims]\[, options] ) @@ -42,7 +42,7 @@ Returns an accumulator `function` which incrementally partitions `k` [clusters][ ```javascript // Create an accumulator for partitioning 2-dimensional data into 5 clusters: -var accumulator = incrkmeans( 5, 2 ); +const accumulator = incrkmeans( 5, 2 ); ``` To specify initial centroids, provide a 2-dimensional `k`-by-`ndims` [`ndarray`][@stdlib/ndarray/ctor] containing centroid locations. @@ -50,24 +50,24 @@ To specify initial centroids, provide a 2-dimensional `k`-by-`ndims` [`ndarray`] ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); // Specify initial centroids: -var buffer = new Float64Array([ +const buffer = new Float64Array([ 0.0, 0.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0 ]); -var shape = [ 5, 2 ]; -var strides = [ 2, 1 ]; +const shape = [ 5, 2 ]; +const strides = [ 2, 1 ]; -var centroids = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const centroids = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // Create an accumulator for partitioning 2-dimensional data into 5 clusters: -var accumulator = incrkmeans( centroids ); +const accumulator = incrkmeans( centroids ); ``` The function accepts the following `options`: @@ -97,23 +97,23 @@ The function accepts the following `options`: If provided a data point vector, the accumulator function returns updated cluster results. If not provided a data point vector, the accumulator function returns the current cluster results. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); // Create a data vector: -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // Create an accumulator for partitioning 2-dimensional data into 5 clusters: -var accumulator = incrkmeans( 5, 2 ); +const accumulator = incrkmeans( 5, 2 ); // Provide data to the accumulator: vec.set( 0, 2.0 ); vec.set( 1, 1.0 ); -var out = accumulator( vec ); +let out = accumulator( vec ); // e.g., returns {...} vec.set( 0, 1.0 ); @@ -151,17 +151,17 @@ Cluster statistics consists of the following columns: Predicts centroid assignment for each data point in a provided matrix `X`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); // Create a data vector: -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +let buffer = new Float64Array( 2 ); +let shape = [ 2 ]; +let strides = [ 1 ]; +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // Create an accumulator for partitioning 2-dimensional into 2 clusters: -var accumulator = incrkmeans( 2, 2, { +const accumulator = incrkmeans( 2, 2, { 'init': [ 'sample', 2 ] }); @@ -182,7 +182,7 @@ accumulator( vec ); buffer = new Float64Array( 4 ); shape = [ 2, 2 ]; strides = [ 2, 1 ]; -var mat = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const mat = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); mat.set( 0, 0, 0.0 ); mat.set( 0, 1, 0.0 ); @@ -190,7 +190,7 @@ mat.set( 0, 1, 0.0 ); mat.set( 1, 0, 0.5 ); mat.set( 1, 1, -0.5 ); -var out = accumulator.predict( mat ); +const out = accumulator.predict( mat ); // returns ``` @@ -220,21 +220,21 @@ To specify an output vector, provide a 1-dimensional [`ndarray`][@stdlib/ndarray ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var normal = require( '@stdlib/random/base/normal' ).factory; -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var incrkmeans = require( '@stdlib/ml/incr/kmeans' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const normal = require( '@stdlib/random/base/normal' ).factory; +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const incrkmeans = require( '@stdlib/ml/incr/kmeans' ); // Define the number of data points to simulate: -var N = 1e4; +const N = 1e4; // Define the number of clusters: -var k = 5; +const k = 5; // Define cluster properties: -var clusters = new Float64Array([ +let clusters = new Float64Array([ 0.0, 1.0, 0.0, 1.0, // meanX, stdevX, meanY, stdevY -5.0, 1.0, 5.0, 1.0, 5.0, 1.0, 5.0, 1.0, @@ -244,61 +244,57 @@ var clusters = new Float64Array([ clusters = ndarray( 'float64', clusters, [ k, 4 ], [ 4, 1 ], 0, 'row-major' ); // Define accumulator options: -var opts = { +const opts = { 'metric': 'euclidean', 'init': [ 'kmeans++', 100 ] }; // Initialize a 2-dimensional k-means accumulator: -var acc = incrkmeans( k, 2, opts ); +const acc = incrkmeans( k, 2, opts ); // Create PRNGs for generating pseudorandom numbers drawn from 2-d uncorrelated normal distributions... -var randn = ndarray( 'generic', new Array( k*2 ), [ k, 2 ], [ 2, 1 ], 0, 'row-major' ); -var i; -for ( i = 0; i < k; i++ ) { +const randn = ndarray( 'generic', new Array( k*2 ), [ k, 2 ], [ 2, 1 ], 0, 'row-major' ); +for ( let i = 0; i < k; i++ ) { randn.set( i, 0, normal( clusters.get( i, 0 ), clusters.get( i, 1 ) ) ); randn.set( i, 1, normal( clusters.get( i, 2 ), clusters.get( i, 3 ) ) ); } // Create a vector for storing simulated data: -var v = ndarray( 'float64', new Float64Array( 2 ), [ 2 ], [ 1 ], 0, 'row-major' ); +const v = ndarray( 'float64', new Float64Array( 2 ), [ 2 ], [ 1 ], 0, 'row-major' ); // Wrap the vector in a matrix for generating cluster predictions: -var m = ndarray( 'float64', v.data, [ 1, 2 ], [ 2, 1 ], 0, 'row-major' ); +const m = ndarray( 'float64', v.data, [ 1, 2 ], [ 2, 1 ], 0, 'row-major' ); // Create a vector for storing cluster predictions: -var p = ndarray( 'int8', new Int8Array( 1 ), [ 1 ], [ 1 ], 0, 'row-major' ); +const p = ndarray( 'int8', new Int8Array( 1 ), [ 1 ], [ 1 ], 0, 'row-major' ); // Simulate data points and incrementally perform k-means clustering... -var totals = [ 0, 0, 0, 0, 0 ]; -var X = []; -var Y = []; -for ( i = 0; i < k; i++ ) { +const totals = [ 0, 0, 0, 0, 0 ]; +const X = []; +const Y = []; +for ( let i = 0; i < k; i++ ) { X.push( [] ); Y.push( [] ); } -var results; -var x; -var y; -var c; -var r; -for ( i = 0; i < N; i++ ) { +let results; + +for ( let i = 0; i < N; i++ ) { // Pick a random cluster from which to sample: - c = discreteUniform( 0, k-1 ); + const c = discreteUniform( 0, k-1 ); totals[ c ] += 1; // Generate a random cluster data point: - x = randn.get( c, 0 )(); + const x = randn.get( c, 0 )(); v.set( 0, x ); X[ c ].push( x ); - y = randn.get( c, 1 )(); + const y = randn.get( c, 1 )(); v.set( 1, y ); Y[ c ].push( y ); // Generate a cluster prediction: - r = acc.predict( p, m ); + const r = acc.predict( p, m ); if ( r ) { console.log( 'Data point: (%d, %d). Prediction: %d.', x.toFixed( 3 ), y.toFixed( 3 ), r.get( 0 )+1 ); } @@ -310,7 +306,7 @@ for ( i = 0; i < N; i++ ) { results = acc(); if ( results ) { console.log( '' ); - for ( i = 0; i < k; i++ ) { + for ( let i = 0; i < k; i++ ) { console.log( 'Cluster %d', i+1 ); console.log( ' centroid: (%d, %d)', results.centroids.get( i, 0 ), results.centroids.get( i, 1 ) ); console.log( ' size: %d', results.stats.get( i, 0 ) ); diff --git a/lib/node_modules/@stdlib/ml/incr/sgd-regression/README.md b/lib/node_modules/@stdlib/ml/incr/sgd-regression/README.md index cb8768435673..69690cfaf549 100644 --- a/lib/node_modules/@stdlib/ml/incr/sgd-regression/README.md +++ b/lib/node_modules/@stdlib/ml/incr/sgd-regression/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrSGDRegression = require( '@stdlib/ml/incr/sgd-regression' ); +const incrSGDRegression = require( '@stdlib/ml/incr/sgd-regression' ); ``` #### incrSGDRegression( \[options] ) @@ -35,20 +35,15 @@ var incrSGDRegression = require( '@stdlib/ml/incr/sgd-regression' ); Creates an online linear regression model fitted via [stochastic gradient descent][stochastic-gradient-descent]. The module performs [L2 regularization][l2-regularization] of the model coefficients, shrinking them towards zero by penalizing the squared [euclidean norm][euclidean-norm] of the coefficients. ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var normal = require( '@stdlib/random/base/normal' ); -var accumulator = incrSGDRegression(); - -var x1; -var x2; -var i; -var y; +const randu = require( '@stdlib/random/base/randu' ); +const normal = require( '@stdlib/random/base/normal' ); +const accumulator = incrSGDRegression(); // Update model as data comes in... -for ( i = 0; i < 100000; i++ ) { - x1 = randu(); - x2 = randu(); - y = (3.0 * x1) + (-3.0 * x2) + 2.0 + normal( 0.0, 1.0 ); +for ( let i = 0; i < 100000; i++ ) { + const x1 = randu(); + const x2 = randu(); + const y = (3.0 * x1) + (-3.0 * x2) + 2.0 + normal( 0.0, 1.0 ); accumulator( [ x1, x2 ], y ); } ``` @@ -65,7 +60,7 @@ The function accepts the following `options`: ```javascript -var accumulator = incrSGDRegression({ +const accumulator = incrSGDRegression({ 'loss': 'squaredError', 'lambda': 1e-4 }); @@ -88,34 +83,25 @@ The used loss function is specified via the `loss` option. The available options The `lambda` parameter determines the amount of shrinkage inflicted on the model coefficients: ```javascript -var createRandom = require( '@stdlib/random/base/randu' ).factory; - -var accumulator; -var coefs; -var opts; -var rand; -var x1; -var x2; -var i; -var y; - -opts = { +const createRandom = require( '@stdlib/random/base/randu' ).factory; + +const opts = { 'seed': 23 }; -rand = createRandom( opts ); +let rand = createRandom( opts ); -accumulator = incrSGDRegression({ +let accumulator = incrSGDRegression({ 'lambda': 1e-5 }); for ( i = 0; i < 100; i++ ) { - x1 = rand(); - x2 = rand(); - y = (3.0 * x1) + (-3.0 * x2) + 2.0; + const x1 = rand(); + const x2 = rand(); + const y = (3.0 * x1) + (-3.0 * x2) + 2.0; accumulator( [ x1, x2 ], y ); } -coefs = accumulator.coefs; +let coefs = accumulator.coefs; // returns [ ~3.007, ~-3.002, ~2 ] rand = createRandom( opts ); @@ -123,10 +109,10 @@ accumulator = incrSGDRegression({ 'lambda': 1e-2 }); -for ( i = 0; i < 100; i++ ) { - x1 = rand(); - x2 = rand(); - y = (3.0 * x1) + (-3.0 * x2) + 2.0; +for ( let i = 0; i < 100; i++ ) { + const x1 = rand(); + const x2 = rand(); + const y = (3.0 * x1) + (-3.0 * x2) + 2.0; accumulator( [ x1, x2 ], y ); } @@ -139,12 +125,12 @@ Higher values of `lambda` reduce the variance of the model coefficient estimates By default, the model contains an `intercept` term. To omit the `intercept`, set the corresponding option to `false`: ```javascript -var accumulator = incrSGDRegression({ +let accumulator = incrSGDRegression({ 'intercept': false }); accumulator( [ 1.4, 0.5 ], 2.0 ); -var dim = accumulator.coefs.length; +let dim = accumulator.coefs.length; // returns 2 accumulator = incrSGDRegression(); @@ -177,7 +163,7 @@ Predicts the response for a new feature vector `x`, where `x` must be a `numeric ```javascript -var yhat = accumulator.predict( [ 0.5, 2.0 ] ); +const yhat = accumulator.predict( [ 0.5, 2.0 ] ); // returns ``` @@ -190,7 +176,7 @@ Getter for the model coefficients / feature weights stored in an `array`. The co ```javascript -var coefs = accumulator.coefs; +const coefs = accumulator.coefs; // returns ``` @@ -216,31 +202,24 @@ var coefs = accumulator.coefs; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var normal = require( '@stdlib/random/base/normal' ); -var incrSGDRegression = require( '@stdlib/ml/incr/sgd-regression' ); +const randu = require( '@stdlib/random/base/randu' ); +const normal = require( '@stdlib/random/base/normal' ); +const incrSGDRegression = require( '@stdlib/ml/incr/sgd-regression' ); -var accumulator; -var rnorm; -var x1; -var x2; -var y; -var i; - -rnorm = normal.factory( 0.0, 1.0 ); +const rnorm = normal.factory( 0.0, 1.0 ); // Create model: -accumulator = incrSGDRegression({ +const accumulator = incrSGDRegression({ 'lambda': 1e-7, 'loss': 'squaredError', 'intercept': true }); // Update model as data comes in... -for ( i = 0; i < 10000; i++ ) { - x1 = randu(); - x2 = randu(); - y = (3.0 * x1) + (-3.0 * x2) + 2.0 + rnorm(); +for ( let i = 0; i < 10000; i++ ) { + const x1 = randu(); + const x2 = randu(); + const y = (3.0 * x1) + (-3.0 * x2) + 2.0 + rnorm(); accumulator( [ x1, x2 ], y ); } diff --git a/lib/node_modules/@stdlib/namespace/README.md b/lib/node_modules/@stdlib/namespace/README.md index 34103b920818..533fc4828f31 100644 --- a/lib/node_modules/@stdlib/namespace/README.md +++ b/lib/node_modules/@stdlib/namespace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var namespace = require( '@stdlib/namespace' ); +const namespace = require( '@stdlib/namespace' ); ``` #### namespace() @@ -35,7 +35,7 @@ var namespace = require( '@stdlib/namespace' ); Returns the standard library namespace. ```javascript -var ns = namespace(); +const ns = namespace(); // returns [ {...}, {...}, ... ] ``` @@ -52,9 +52,9 @@ var ns = namespace(); ```javascript -var namespace = require( '@stdlib/namespace' ); +const namespace = require( '@stdlib/namespace' ); -var ns = namespace(); +const ns = namespace(); // returns [ {...}, {...}, ... ] ``` diff --git a/lib/node_modules/@stdlib/namespace/alias2pkg/README.md b/lib/node_modules/@stdlib/namespace/alias2pkg/README.md index c5ca2b84abe9..24bef6c262d4 100644 --- a/lib/node_modules/@stdlib/namespace/alias2pkg/README.md +++ b/lib/node_modules/@stdlib/namespace/alias2pkg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); +const alias2pkg = require( '@stdlib/namespace/alias2pkg' ); ``` #### alias2pkg( alias ) @@ -45,14 +45,14 @@ var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); Returns the package name associated with a specified `alias`. ```javascript -var v = alias2pkg( 'base.sin' ); +const v = alias2pkg( 'base.sin' ); // returns '@stdlib/math/base/special/sin' ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var v = alias2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); +const v = alias2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,16 @@ var v = alias2pkg( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); - -var list; -var len; -var idx; -var v; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v = list[ idx ]; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2pkg = require( '@stdlib/namespace/alias2pkg' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v = list[ idx ]; console.log( 'alias: %s. pkg: %s.', v, alias2pkg( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/namespace/alias2related/README.md b/lib/node_modules/@stdlib/namespace/alias2related/README.md index d6be719045d8..3ad785fd187c 100644 --- a/lib/node_modules/@stdlib/namespace/alias2related/README.md +++ b/lib/node_modules/@stdlib/namespace/alias2related/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var alias2related = require( '@stdlib/namespace/alias2related' ); +const alias2related = require( '@stdlib/namespace/alias2related' ); ``` #### alias2related( alias ) @@ -45,14 +45,14 @@ var alias2related = require( '@stdlib/namespace/alias2related' ); Returns aliases related to a specified `alias`. ```javascript -var out = alias2related( 'base.sin' ); +const out = alias2related( 'base.sin' ); // returns [...] ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var out = alias2related( 'unrecognized_alias_beep_boop_bop_bip' ); +const out = alias2related( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,16 @@ var out = alias2related( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2related = require( '@stdlib/namespace/alias2related' ); - -var list; -var len; -var idx; -var v; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v = list[ idx ]; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2related = require( '@stdlib/namespace/alias2related' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v = list[ idx ]; console.log( 'alias: %s. related: %s.', v, alias2related( v ).join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/namespace/alias2standalone/README.md b/lib/node_modules/@stdlib/namespace/alias2standalone/README.md index 74edcc9a9215..bd4196f785d8 100644 --- a/lib/node_modules/@stdlib/namespace/alias2standalone/README.md +++ b/lib/node_modules/@stdlib/namespace/alias2standalone/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var alias2standalone = require( '@stdlib/namespace/alias2standalone' ); +const alias2standalone = require( '@stdlib/namespace/alias2standalone' ); ``` #### alias2standalone( alias ) @@ -45,14 +45,14 @@ var alias2standalone = require( '@stdlib/namespace/alias2standalone' ); Returns the standalone package name associated with a specified `alias`. ```javascript -var v = alias2standalone( 'base.sin' ); +const v = alias2standalone( 'base.sin' ); // returns '@stdlib/math-base-special-sin' ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var v = alias2standalone( 'unrecognized_alias_beep_boop_bop_bip' ); +const v = alias2standalone( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,16 @@ var v = alias2standalone( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2standalone = require( '@stdlib/namespace/alias2standalone' ); - -var list; -var len; -var idx; -var v; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v = list[ idx ]; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2standalone = require( '@stdlib/namespace/alias2standalone' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v = list[ idx ]; console.log( 'alias: %s. pkg: %s.', v, alias2standalone( v ) ); } ``` diff --git a/lib/node_modules/@stdlib/namespace/aliases/README.md b/lib/node_modules/@stdlib/namespace/aliases/README.md index a507552dc2d1..1fdd7a40219b 100644 --- a/lib/node_modules/@stdlib/namespace/aliases/README.md +++ b/lib/node_modules/@stdlib/namespace/aliases/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var aliases = require( '@stdlib/namespace/aliases' ); +const aliases = require( '@stdlib/namespace/aliases' ); ``` #### aliases( \[namespace] ) @@ -35,14 +35,14 @@ var aliases = require( '@stdlib/namespace/aliases' ); Returns a list of standard library aliases. ```javascript -var list = aliases(); +const list = aliases(); // returns [...] ``` To return a list of standard library aliases associated with a particular namespace, provide a `namespace` filter. ```javascript -var list = aliases( '@stdlib/math/base/special' ); +const list = aliases( '@stdlib/math/base/special' ); // returns [...] ``` @@ -59,20 +59,15 @@ var list = aliases( '@stdlib/math/base/special' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); -var list; -var len; -var idx; -var i; - -list = aliases(); -len = list.length; +const list = aliases(); +const len = list.length; // Select random aliases from the list... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( list[ idx ] ); } ``` diff --git a/lib/node_modules/@stdlib/namespace/pkg2alias/README.md b/lib/node_modules/@stdlib/namespace/pkg2alias/README.md index 4240bf03001f..f209ef1d71cc 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2alias/README.md +++ b/lib/node_modules/@stdlib/namespace/pkg2alias/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pkg2alias = require( '@stdlib/namespace/pkg2alias' ); +const pkg2alias = require( '@stdlib/namespace/pkg2alias' ); ``` #### pkg2alias( pkg ) @@ -45,14 +45,14 @@ var pkg2alias = require( '@stdlib/namespace/pkg2alias' ); Returns the alias associated with a specified package name. ```javascript -var v = pkg2alias( '@stdlib/math/base/special/sin' ); +const v = pkg2alias( '@stdlib/math/base/special/sin' ); // returns 'base.sin' ``` If provided an unrecognized `pkg`, the function returns `null`. ```javascript -var v = pkg2alias( 'unrecognized_pkg_beep_boop_bop_bip' ); +const v = pkg2alias( 'unrecognized_pkg_beep_boop_bop_bip' ); // returns null ``` @@ -69,7 +69,7 @@ var v = pkg2alias( 'unrecognized_pkg_beep_boop_bop_bip' ); - The function supports providing both internal and standalone package names. ```javascript - var v = pkg2alias( '@stdlib/math-base-special-sin' ); + const v = pkg2alias( '@stdlib/math-base-special-sin' ); // returns 'base.sin' ``` @@ -88,26 +88,19 @@ var v = pkg2alias( 'unrecognized_pkg_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); -var pkg2alias = require( '@stdlib/namespace/pkg2alias' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2pkg = require( '@stdlib/namespace/alias2pkg' ); +const pkg2alias = require( '@stdlib/namespace/pkg2alias' ); -var list; -var len; -var idx; -var v1; -var v2; -var i; - -list = aliases(); -len = list.length; +const list = aliases(); +const len = list.length; // Round-trip from alias-to-pkg-to-alias... -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v1 = alias2pkg( list[ idx ] ); - v2 = pkg2alias( v1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v1 = alias2pkg( list[ idx ] ); + const v2 = pkg2alias( v1 ); console.log( 'alias: %s. pkg: %s.', list[ idx ], v1 ); console.log( 'pkg: %s. alias: %s.', v1, v2 ); } diff --git a/lib/node_modules/@stdlib/namespace/pkg2related/README.md b/lib/node_modules/@stdlib/namespace/pkg2related/README.md index e5b5a9d9dca0..8412855f9287 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2related/README.md +++ b/lib/node_modules/@stdlib/namespace/pkg2related/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pkg2related = require( '@stdlib/namespace/pkg2related' ); +const pkg2related = require( '@stdlib/namespace/pkg2related' ); ``` #### pkg2related( pkg ) @@ -45,14 +45,14 @@ var pkg2related = require( '@stdlib/namespace/pkg2related' ); Returns package names related to a specified package name. ```javascript -var out = pkg2related( '@stdlib/math/base/special/sin' ); +const out = pkg2related( '@stdlib/math/base/special/sin' ); // returns [...] ``` If provided an unrecognized package name, the function returns `null`. ```javascript -var out = pkg2related( 'unrecognized_pkg_beep_boop_bop_bip' ); +const out = pkg2related( 'unrecognized_pkg_beep_boop_bop_bip' ); // returns null ``` @@ -69,7 +69,7 @@ var out = pkg2related( 'unrecognized_pkg_beep_boop_bop_bip' ); - The function supports providing both internal and standalone package names. ```javascript - var out = pkg2related( '@stdlib/math-base-special-sin' ); + const out = pkg2related( '@stdlib/math-base-special-sin' ); // returns [...] ``` @@ -88,25 +88,18 @@ var out = pkg2related( 'unrecognized_pkg_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); -var pkg2related = require( '@stdlib/namespace/pkg2related' ); - -var list; -var len; -var idx; -var pkg; -var v; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v = list[ idx ]; - pkg = alias2pkg( v ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2pkg = require( '@stdlib/namespace/alias2pkg' ); +const pkg2related = require( '@stdlib/namespace/pkg2related' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v = list[ idx ]; + const pkg = alias2pkg( v ); console.log( 'alias: %s. related: %s.', v, pkg2related( pkg ).join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/namespace/pkg2standalone/README.md b/lib/node_modules/@stdlib/namespace/pkg2standalone/README.md index 478f9e3aa41b..b985919ce204 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2standalone/README.md +++ b/lib/node_modules/@stdlib/namespace/pkg2standalone/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pkg2standalone = require( '@stdlib/namespace/pkg2standalone' ); +const pkg2standalone = require( '@stdlib/namespace/pkg2standalone' ); ``` #### pkg2standalone( pkg ) @@ -45,14 +45,14 @@ var pkg2standalone = require( '@stdlib/namespace/pkg2standalone' ); Returns the standalone package name associated with a provided internal package name. ```javascript -var v = pkg2standalone( '@stdlib/math/base/special/sin' ); +const v = pkg2standalone( '@stdlib/math/base/special/sin' ); // returns '@stdlib/math-base-special-sin' ``` If provided an unrecognized `pkg`, the function returns `null`. ```javascript -var v = pkg2standalone( 'unrecognized_pkg_beep_boop_bop_bip' ); +const v = pkg2standalone( 'unrecognized_pkg_beep_boop_bop_bip' ); // returns null ``` @@ -79,25 +79,18 @@ var v = pkg2standalone( 'unrecognized_pkg_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2pkg = require( '@stdlib/namespace/alias2pkg' ); -var pkg2standalone = require( '@stdlib/namespace/pkg2standalone' ); - -var list; -var len; -var idx; -var v1; -var v2; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - v1 = alias2pkg( list[ idx ] ); - v2 = pkg2standalone( v1 ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2pkg = require( '@stdlib/namespace/alias2pkg' ); +const pkg2standalone = require( '@stdlib/namespace/pkg2standalone' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const v1 = alias2pkg( list[ idx ] ); + const v2 = pkg2standalone( v1 ); console.log( 'alias: %s. pkg: %s.', list[ idx ], v1 ); console.log( 'pkg: %s. standalone: %s.', v1, v2 ); } diff --git a/lib/node_modules/@stdlib/namespace/standalone2pkg/README.md b/lib/node_modules/@stdlib/namespace/standalone2pkg/README.md index fd352a8982be..795e9800d49e 100644 --- a/lib/node_modules/@stdlib/namespace/standalone2pkg/README.md +++ b/lib/node_modules/@stdlib/namespace/standalone2pkg/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var standalone2pkg = require( '@stdlib/namespace/standalone2pkg' ); +const standalone2pkg = require( '@stdlib/namespace/standalone2pkg' ); ``` #### standalone2pkg( pkg ) @@ -45,14 +45,14 @@ var standalone2pkg = require( '@stdlib/namespace/standalone2pkg' ); Returns the internal package name associated with a provided standalone package name. ```javascript -var v = standalone2pkg( '@stdlib/math-base-special-sin' ); +const v = standalone2pkg( '@stdlib/math-base-special-sin' ); // returns '@stdlib/math/base/special/sin' ``` If provided an unrecognized standalone package name, the function returns `null`. ```javascript -var v = standalone2pkg( '@stdlib/unrecognized_alias_beep_boop_bop_bip' ); +const v = standalone2pkg( '@stdlib/unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,23 +79,17 @@ var v = standalone2pkg( '@stdlib/unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var alias2standalone = require( '@stdlib/namespace/alias2standalone' ); -var standalone2pkg = require( '@stdlib/namespace/standalone2pkg' ); - -var list; -var len; -var pkg; -var v; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - v = list[ discreteUniform( 0, len-1 ) ]; - pkg = alias2standalone( v ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const alias2standalone = require( '@stdlib/namespace/alias2standalone' ); +const standalone2pkg = require( '@stdlib/namespace/standalone2pkg' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const v = list[ discreteUniform( 0, len-1 ) ]; + const pkg = alias2standalone( v ); console.log( 'alias: %s. standalone: %s.', v, pkg ); console.log( 'standalone: %s. pkg: %s.', pkg, standalone2pkg( pkg ) ); } diff --git a/lib/node_modules/@stdlib/napi/README.md b/lib/node_modules/@stdlib/napi/README.md index 766e6c9d5b63..a2610130b4b7 100644 --- a/lib/node_modules/@stdlib/napi/README.md +++ b/lib/node_modules/@stdlib/napi/README.md @@ -39,7 +39,7 @@ This package exposes an absolute file path for the directory containing header f ## Usage ```javascript -var headerDir = require( '@stdlib/napi' ); +const headerDir = require( '@stdlib/napi' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi' ); +const headerDir = require( '@stdlib/napi' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-complex128/README.md b/lib/node_modules/@stdlib/napi/argv-complex128/README.md index 3b99f894722d..a71b2ca3fc18 100644 --- a/lib/node_modules/@stdlib/napi/argv-complex128/README.md +++ b/lib/node_modules/@stdlib/napi/argv-complex128/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-complex128' ); +const headerDir = require( '@stdlib/napi/argv-complex128' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-complex128' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-complex128' ); +const headerDir = require( '@stdlib/napi/argv-complex128' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-complex128array/README.md b/lib/node_modules/@stdlib/napi/argv-complex128array/README.md index 761dee802319..0ea0fc1f7e8d 100644 --- a/lib/node_modules/@stdlib/napi/argv-complex128array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-complex128array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-complex128array' ); +const headerDir = require( '@stdlib/napi/argv-complex128array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-complex128array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-complex128array' ); +const headerDir = require( '@stdlib/napi/argv-complex128array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-complex64/README.md b/lib/node_modules/@stdlib/napi/argv-complex64/README.md index 0b5fdfd93277..efe9f5dec1a8 100644 --- a/lib/node_modules/@stdlib/napi/argv-complex64/README.md +++ b/lib/node_modules/@stdlib/napi/argv-complex64/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-complex64' ); +const headerDir = require( '@stdlib/napi/argv-complex64' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-complex64' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-complex64' ); +const headerDir = require( '@stdlib/napi/argv-complex64' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-complex64array/README.md b/lib/node_modules/@stdlib/napi/argv-complex64array/README.md index 7441d6e5b030..db8e9ea6242b 100644 --- a/lib/node_modules/@stdlib/napi/argv-complex64array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-complex64array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-complex64array' ); +const headerDir = require( '@stdlib/napi/argv-complex64array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-complex64array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-complex64array' ); +const headerDir = require( '@stdlib/napi/argv-complex64array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-double/README.md b/lib/node_modules/@stdlib/napi/argv-double/README.md index 25f710163f1d..105f7c615b49 100644 --- a/lib/node_modules/@stdlib/napi/argv-double/README.md +++ b/lib/node_modules/@stdlib/napi/argv-double/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-double' ); +const headerDir = require( '@stdlib/napi/argv-double' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-double' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-double' ); +const headerDir = require( '@stdlib/napi/argv-double' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-float/README.md b/lib/node_modules/@stdlib/napi/argv-float/README.md index 300be2c7e61f..8a8d213ea4b8 100644 --- a/lib/node_modules/@stdlib/napi/argv-float/README.md +++ b/lib/node_modules/@stdlib/napi/argv-float/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-float' ); +const headerDir = require( '@stdlib/napi/argv-float' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-float' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-float' ); +const headerDir = require( '@stdlib/napi/argv-float' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-float32array/README.md b/lib/node_modules/@stdlib/napi/argv-float32array/README.md index c44c5b323519..46ef352f8450 100644 --- a/lib/node_modules/@stdlib/napi/argv-float32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-float32array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-float32array' ); +const headerDir = require( '@stdlib/napi/argv-float32array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-float32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-float32array' ); +const headerDir = require( '@stdlib/napi/argv-float32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-float64array/README.md b/lib/node_modules/@stdlib/napi/argv-float64array/README.md index 047ece3b8b40..2791884f8da0 100644 --- a/lib/node_modules/@stdlib/napi/argv-float64array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-float64array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-float64array' ); +const headerDir = require( '@stdlib/napi/argv-float64array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-float64array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-float64array' ); +const headerDir = require( '@stdlib/napi/argv-float64array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-int16array/README.md b/lib/node_modules/@stdlib/napi/argv-int16array/README.md index f9aedb9cf319..1686ec3d8840 100644 --- a/lib/node_modules/@stdlib/napi/argv-int16array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-int16array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-int16array' ); +const headerDir = require( '@stdlib/napi/argv-int16array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-int16array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-int16array' ); +const headerDir = require( '@stdlib/napi/argv-int16array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-int32/README.md b/lib/node_modules/@stdlib/napi/argv-int32/README.md index e93ce91fb631..23671b63d155 100644 --- a/lib/node_modules/@stdlib/napi/argv-int32/README.md +++ b/lib/node_modules/@stdlib/napi/argv-int32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-int32' ); +const headerDir = require( '@stdlib/napi/argv-int32' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-int32' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-int32' ); +const headerDir = require( '@stdlib/napi/argv-int32' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-int32array/README.md b/lib/node_modules/@stdlib/napi/argv-int32array/README.md index 360bc81c26e1..c9dde663ca63 100644 --- a/lib/node_modules/@stdlib/napi/argv-int32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-int32array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-int32array' ); +const headerDir = require( '@stdlib/napi/argv-int32array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-int32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-int32array' ); +const headerDir = require( '@stdlib/napi/argv-int32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-int64/README.md b/lib/node_modules/@stdlib/napi/argv-int64/README.md index 80571c3a2764..4b3de738a8e6 100644 --- a/lib/node_modules/@stdlib/napi/argv-int64/README.md +++ b/lib/node_modules/@stdlib/napi/argv-int64/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-int64' ); +const headerDir = require( '@stdlib/napi/argv-int64' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-int64' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-int64' ); +const headerDir = require( '@stdlib/napi/argv-int64' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-int8array/README.md b/lib/node_modules/@stdlib/napi/argv-int8array/README.md index 2abfda849ce9..ab7072893b92 100644 --- a/lib/node_modules/@stdlib/napi/argv-int8array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-int8array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-int8array' ); +const headerDir = require( '@stdlib/napi/argv-int8array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-int8array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-int8array' ); +const headerDir = require( '@stdlib/napi/argv-int8array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-complex128array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-complex128array/README.md index acca62f4304f..4a9866009a81 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-complex128array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-complex128array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex128array' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex128array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-complex128array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex128array' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex128array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-complex128array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-complex128array2d/README.md index ab74eea0374e..fb423ca6ab54 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-complex128array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-complex128array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex128array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex128array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-complex128array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex128array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex128array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-complex64array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-complex64array/README.md index de0e3e964946..7b9a0ee268bb 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-complex64array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-complex64array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex64array' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex64array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-complex64array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex64array' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex64array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-complex64array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-complex64array2d/README.md index 86793986b11f..1f236172340b 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-complex64array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-complex64array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex64array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex64array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-complex64array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-complex64array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-complex64array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-float32array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-float32array/README.md index 4ec0c63a40a7..770cffc1b241 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-float32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-float32array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-float32array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-float32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-float32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-float32array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-float32array2d/README.md index 152bdc372674..c356e4e83fb5 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-float32array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-float32array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-float32array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-float32array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-float32array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-float64array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-float64array/README.md index ee1a8926e378..c18af887dd81 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-float64array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-float64array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float64array' ); +const headerDir = require( '@stdlib/napi/argv-strided-float64array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-float64array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float64array' ); +const headerDir = require( '@stdlib/napi/argv-strided-float64array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-float64array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-float64array2d/README.md index 1795867cb1a2..84ee69c01e3e 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-float64array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-float64array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float64array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-float64array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-float64array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-float64array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-float64array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int16array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int16array/README.md index 10be06147172..00c3b98e5562 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int16array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int16array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int16array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int16array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int16array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int16array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int16array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int16array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int16array2d/README.md index d22155ecb295..8ac0eab1b0a2 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int16array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int16array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int16array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int16array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int16array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int16array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int16array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int32array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int32array/README.md index 04d04eab2f73..37dd071f8c6b 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int32array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int32array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int32array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int32array2d/README.md index c3c2df97a371..d6e25c38d5e6 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int32array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int32array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int32array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int32array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int32array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int8array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int8array/README.md index 6a246e230eed..79194071d747 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int8array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int8array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int8array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int8array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int8array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int8array' ); +const headerDir = require( '@stdlib/napi/argv-strided-int8array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-int8array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-int8array2d/README.md index ab40db901202..e551c31d187a 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-int8array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-int8array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int8array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int8array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-int8array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-int8array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-int8array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint16array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint16array/README.md index ce2489803767..ae3d606047f2 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint16array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint16array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint16array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint16array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint16array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint16array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint16array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint16array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint16array2d/README.md index bff6afbcc25d..c7a474f016f3 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint16array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint16array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint16array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint16array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint16array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint16array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint16array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint32array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint32array/README.md index 8a935d2c924e..edda5b770144 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint32array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint32array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint32array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint32array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint32array2d/README.md index b1f4c5e345ab..93cdd2cbde87 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint32array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint32array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint32array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint32array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint32array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint32array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint8array/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint8array/README.md index 25bd22a10e67..44e356d42c34 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint8array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint8array/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint8array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint8array' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint8array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint8array' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint8array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-strided-uint8array2d/README.md b/lib/node_modules/@stdlib/napi/argv-strided-uint8array2d/README.md index 5c7825e5c752..e9e364532ca8 100644 --- a/lib/node_modules/@stdlib/napi/argv-strided-uint8array2d/README.md +++ b/lib/node_modules/@stdlib/napi/argv-strided-uint8array2d/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint8array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint8array2d' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/argv-strided-uint8array2d' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-strided-uint8array2d' ); +const headerDir = require( '@stdlib/napi/argv-strided-uint8array2d' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-uint16array/README.md b/lib/node_modules/@stdlib/napi/argv-uint16array/README.md index 61534f1b4713..63f88ff712b2 100644 --- a/lib/node_modules/@stdlib/napi/argv-uint16array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-uint16array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-uint16array' ); +const headerDir = require( '@stdlib/napi/argv-uint16array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-uint16array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-uint16array' ); +const headerDir = require( '@stdlib/napi/argv-uint16array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-uint32/README.md b/lib/node_modules/@stdlib/napi/argv-uint32/README.md index a5ff72edbcde..bb2795f53128 100644 --- a/lib/node_modules/@stdlib/napi/argv-uint32/README.md +++ b/lib/node_modules/@stdlib/napi/argv-uint32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-uint32' ); +const headerDir = require( '@stdlib/napi/argv-uint32' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-uint32' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-uint32' ); +const headerDir = require( '@stdlib/napi/argv-uint32' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-uint32array/README.md b/lib/node_modules/@stdlib/napi/argv-uint32array/README.md index 8f03186ffde5..548082fbb1b1 100644 --- a/lib/node_modules/@stdlib/napi/argv-uint32array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-uint32array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-uint32array' ); +const headerDir = require( '@stdlib/napi/argv-uint32array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-uint32array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-uint32array' ); +const headerDir = require( '@stdlib/napi/argv-uint32array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv-uint8array/README.md b/lib/node_modules/@stdlib/napi/argv-uint8array/README.md index 8afb56740fee..17cc99c6d5d5 100644 --- a/lib/node_modules/@stdlib/napi/argv-uint8array/README.md +++ b/lib/node_modules/@stdlib/napi/argv-uint8array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv-uint8array' ); +const headerDir = require( '@stdlib/napi/argv-uint8array' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv-uint8array' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv-uint8array' ); +const headerDir = require( '@stdlib/napi/argv-uint8array' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/argv/README.md b/lib/node_modules/@stdlib/napi/argv/README.md index 298fd0973c8c..b0e78f0230cf 100644 --- a/lib/node_modules/@stdlib/napi/argv/README.md +++ b/lib/node_modules/@stdlib/napi/argv/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/argv' ); +const headerDir = require( '@stdlib/napi/argv' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/argv' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/argv' ); +const headerDir = require( '@stdlib/napi/argv' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/create-complex-like/README.md b/lib/node_modules/@stdlib/napi/create-complex-like/README.md index 5226747c189c..a7a638b3da79 100644 --- a/lib/node_modules/@stdlib/napi/create-complex-like/README.md +++ b/lib/node_modules/@stdlib/napi/create-complex-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/create-complex-like' ); +const headerDir = require( '@stdlib/napi/create-complex-like' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/create-complex-like' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/create-complex-like' ); +const headerDir = require( '@stdlib/napi/create-complex-like' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/create-double/README.md b/lib/node_modules/@stdlib/napi/create-double/README.md index d9ab6bee48aa..7a0fcba6c48d 100644 --- a/lib/node_modules/@stdlib/napi/create-double/README.md +++ b/lib/node_modules/@stdlib/napi/create-double/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/create-double' ); +const headerDir = require( '@stdlib/napi/create-double' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/create-double' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/create-double' ); +const headerDir = require( '@stdlib/napi/create-double' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/create-int32/README.md b/lib/node_modules/@stdlib/napi/create-int32/README.md index 32dc466cc68d..6622fd732ff7 100644 --- a/lib/node_modules/@stdlib/napi/create-int32/README.md +++ b/lib/node_modules/@stdlib/napi/create-int32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/create-int32' ); +const headerDir = require( '@stdlib/napi/create-int32' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/create-int32' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/create-int32' ); +const headerDir = require( '@stdlib/napi/create-int32' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/create-uint32/README.md b/lib/node_modules/@stdlib/napi/create-uint32/README.md index b1d17ecbf62c..c1f6ac83d571 100644 --- a/lib/node_modules/@stdlib/napi/create-uint32/README.md +++ b/lib/node_modules/@stdlib/napi/create-uint32/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/create-uint32' ); +const headerDir = require( '@stdlib/napi/create-uint32' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/napi/create-uint32' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/create-uint32' ); +const headerDir = require( '@stdlib/napi/create-uint32' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/napi/export/README.md b/lib/node_modules/@stdlib/napi/export/README.md index 6240c55fcd40..010ed40fa62d 100644 --- a/lib/node_modules/@stdlib/napi/export/README.md +++ b/lib/node_modules/@stdlib/napi/export/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/napi/export' ); +const headerDir = require( '@stdlib/napi/export' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/napi/export' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/napi/export' ); +const headerDir = require( '@stdlib/napi/export' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/ndarray/README.md b/lib/node_modules/@stdlib/ndarray/README.md index d0f7445fe50d..ce5e3a2b0beb 100644 --- a/lib/node_modules/@stdlib/ndarray/README.md +++ b/lib/node_modules/@stdlib/ndarray/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/ndarray' ); +const ns = require( '@stdlib/ndarray' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/ndarray' ); ndarray namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -136,8 +136,8 @@ In addition, the namespace contains the following multidimensional array utility ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/ndarray' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/ndarray' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/array/README.md b/lib/node_modules/@stdlib/ndarray/array/README.md index 15fd353174f3..11908d99e26e 100644 --- a/lib/node_modules/@stdlib/ndarray/array/README.md +++ b/lib/node_modules/@stdlib/ndarray/array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); ``` @@ -48,7 +48,7 @@ Returns a multidimensional array. ```javascript // Create a 2x2 matrix: -var arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ); +const arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ); // returns ``` @@ -57,11 +57,11 @@ To initialize multidimensional array data, provide a `buffer` argument, which ma ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); +const Float64Array = require( '@stdlib/array/float64' ); +const allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' ); // Create an ndarray from a generic array linear data buffer: -var arr = array( [ 1.0, 2.0, 3.0, 4.0 ], { 'shape': [ 2, 2 ] } ); +let arr = array( [ 1.0, 2.0, 3.0, 4.0 ], { 'shape': [ 2, 2 ] } ); // returns // Create an ndarray from a typed array linear data buffer: @@ -127,53 +127,53 @@ The function accepts the following `options`: By default, an [`ndarray`][@stdlib/ndarray/ctor] instance **throws** when provided an index which exceeds array dimensions. To support alternative indexing behavior, set the `mode` option, which will affect all public methods for getting and setting array elements. ```javascript -var opts = { +const opts = { 'mode': 'clamp' }; -var arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], opts ); +const arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], opts ); // returns // Attempt to access an out-of-bounds linear index (clamped): -var v = arr.iget( 10 ); +const v = arr.iget( 10 ); // returns 4.0 ``` By default, the `mode` option is applied to subscripts which exceed array dimensions. To specify behavior for each dimension, set the `submode` option. ```javascript -var opts = { +const opts = { 'submode': [ 'wrap', 'clamp' ] }; -var arr = array( [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]] ], opts ); +const arr = array( [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]] ], opts ); // returns // Attempt to access out-of-bounds subscripts: -var v = arr.get( -2, 10, -1 ); // linear index: 3 +const v = arr.get( -2, 10, -1 ); // linear index: 3 // returns 4.0 ``` By default, the function automatically flattens [generic array][@stdlib/array/generic] data sources. To prevent flattening, set the `flatten` option to `false`. ```javascript -var opts = { +const opts = { 'flatten': false, 'dtype': 'generic' }; // Create a generic array which will serve as our ndarray data source: -var buf = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; +const buf = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]; // Create a 2-element vector: -var arr = array( buf, opts ); +const arr = array( buf, opts ); // returns // Retrieve the first vector element: -var v = arr.get( 0 ); +const v = arr.get( 0 ); // returns [ 1.0, 2.0 ] -var bool = ( v === buf[ 0 ] ); +const bool = ( v === buf[ 0 ] ); // returns true ``` @@ -207,16 +207,16 @@ var bool = ( v === buf[ 0 ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 4-dimensional array containing single-precision floating-point numbers: -var arr = array({ +const arr = array({ 'dtype': 'float32', 'shape': [ 3, 3, 3, 3 ] }); // Retrieve an array value: -var v = arr.get( 1, 2, 1, 2 ); +let v = arr.get( 1, 2, 1, 2 ); // returns 0.0 // Set an array value: @@ -227,7 +227,7 @@ v = arr.get( 1, 2, 1, 2 ); // returns 10.0 // Serialize the array as a string: -var str = arr.toString(); +let str = arr.toString(); // returns "ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 3, 3, 3, 3 ], [ 27, 9, 3, 1 ], 0, 'row-major' )" // Serialize the array as JSON: diff --git a/lib/node_modules/@stdlib/ndarray/at/README.md b/lib/node_modules/@stdlib/ndarray/at/README.md index 2cea14062ea8..c23eccb9f19a 100644 --- a/lib/node_modules/@stdlib/ndarray/at/README.md +++ b/lib/node_modules/@stdlib/ndarray/at/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var at = require( '@stdlib/ndarray/at' ); +const at = require( '@stdlib/ndarray/at' ); ``` #### at( x\[, ...indices] ) @@ -45,12 +45,12 @@ var at = require( '@stdlib/ndarray/at' ); Returns an [`ndarray`][@stdlib/ndarray/ctor] element. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns -var v = at( x, 0, 0 ); +let v = at( x, 0, 0 ); // returns 1 v = at( x, 0, 1 ); @@ -81,24 +81,24 @@ The function accepts the following arguments: - If provided out-of-bounds indices, the function always returns `undefined`. ```javascript - var array = require( '@stdlib/ndarray/array' ); + const array = require( '@stdlib/ndarray/array' ); - var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); + const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns - var v = at( x, 10, 20 ); + const v = at( x, 10, 20 ); // returns undefined ``` - Negative indices are resolved relative to the last element along the respective dimension, with the last element corresponding to `-1`. ```javascript - var array = require( '@stdlib/ndarray/array' ); + const array = require( '@stdlib/ndarray/array' ); - var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); + const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns - var v = at( x, -1, -1 ); + let v = at( x, -1, -1 ); // returns 4 v = at( x, -2, -2 ); @@ -120,30 +120,28 @@ The function accepts the following arguments: ```javascript -var cartesianProduct = require( '@stdlib/array/cartesian-product' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var array = require( '@stdlib/ndarray/array' ); -var at = require( '@stdlib/ndarray/at' ); +const cartesianProduct = require( '@stdlib/array/cartesian-product' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const array = require( '@stdlib/ndarray/array' ); +const at = require( '@stdlib/ndarray/at' ); // Define a two-dimensional array: -var shape = [ 5, 5 ]; -var x = array( discreteUniform( 25, -100, 100 ), { +const shape = [ 5, 5 ]; +const x = array( discreteUniform( 25, -100, 100 ), { 'shape': shape }); // Define lists of dimension indices: -var i0 = zeroTo( shape[ 0 ], 'generic' ); -var i1 = zeroTo( shape[ 1 ], 'generic' ); +const i0 = zeroTo( shape[ 0 ], 'generic' ); +const i1 = zeroTo( shape[ 1 ], 'generic' ); // Create a list of index pairs: -var indices = cartesianProduct( i0, i1 ); +const indices = cartesianProduct( i0, i1 ); // Print array contents... -var idx; -var i; -for ( i = 0; i < x.length; i++ ) { - idx = indices[ i ]; +for ( let i = 0; i < x.length; i++ ) { + const idx = indices[ i ]; console.log( 'x[%d,%d] = %d', idx[ 0 ], idx[ 1 ], at( x, idx[ 0 ], idx[ 1 ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/README.md b/lib/node_modules/@stdlib/ndarray/base/README.md index 3f5385136d64..47737bf108be 100644 --- a/lib/node_modules/@stdlib/ndarray/base/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/ndarray/base' ); +const ns = require( '@stdlib/ndarray/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/ndarray/base' ); Base ndarray. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -165,8 +165,8 @@ The namespace contains the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/ndarray/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/ndarray/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/README.md index 2344a4b7302a..c5ae3dd080c9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/ndarray/base/assert' ); +const ns = require( '@stdlib/ndarray/base/assert' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/ndarray/base/assert' ); Base ndarray assertion utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -88,8 +88,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/ndarray/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/ndarray/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/README.md index 40604a236b39..e0b240e8d6d4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var hasEqualShape = require( '@stdlib/ndarray/base/assert/has-equal-shape' ); +const hasEqualShape = require( '@stdlib/ndarray/base/assert/has-equal-shape' ); ``` #### hasEqualShape( x, y ) @@ -45,12 +45,12 @@ var hasEqualShape = require( '@stdlib/ndarray/base/assert/has-equal-shape' ); Tests if two ndarrays have the same shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ 1, 2, 3, 4 ] ); -var y = array( [ 5, 6, 7, 8 ] ); +const x = array( [ 1, 2, 3, 4 ] ); +const y = array( [ 5, 6, 7, 8 ] ); -var bool = hasEqualShape( x, y ); +const bool = hasEqualShape( x, y ); // returns true ``` @@ -75,17 +75,17 @@ var bool = hasEqualShape( x, y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var hasEqualShape = require( '@stdlib/ndarray/base/assert/has-equal-shape' ); +const array = require( '@stdlib/ndarray/array' ); +const hasEqualShape = require( '@stdlib/ndarray/base/assert/has-equal-shape' ); -var x1 = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var y1 = array( [ [ 5, 6 ], [ 7, 8 ] ] ); +const x1 = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const y1 = array( [ [ 5, 6 ], [ 7, 8 ] ] ); -var bool = hasEqualShape( x1, y1 ); +let bool = hasEqualShape( x1, y1 ); // returns true -var x2 = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var y2 = array( [ [ 5, 6 ], [ 7, 8 ], [ 9, 10 ] ] ); +const x2 = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const y2 = array( [ [ 5, 6 ], [ 7, 8 ], [ 9, 10 ] ] ); bool = hasEqualShape( x2, y2 ); // returns false diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-allowed-data-type-cast/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-allowed-data-type-cast/README.md index 80a2e43c5da7..cd4d13043b8c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-allowed-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-allowed-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-cast' ); +const isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-cast' ); ``` #### isAllowedCast( from, to, casting ) @@ -45,7 +45,7 @@ var isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-c Returns a boolean indicating whether an ndarray [data type][@stdlib/ndarray/dtypes] can be cast to another ndarray [data type][@stdlib/ndarray/dtypes] according to a specified [`casting`][@stdlib/ndarray/casting-modes] mode. ```javascript -var bool = isAllowedCast( 'float32', 'float64', 'safe' ); +let bool = isAllowedCast( 'float32', 'float64', 'safe' ); // returns true bool = isAllowedCast( 'float64', 'int32', 'safe' ); @@ -82,30 +82,21 @@ The following [`casting`][@stdlib/ndarray/casting-modes] modes are supported: ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var modes = require( '@stdlib/ndarray/casting-modes' ); -var isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-cast' ); - -var DTYPES; -var MODES; -var bool; -var dt1; -var dt2; -var i; -var j; -var k; +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const modes = require( '@stdlib/ndarray/casting-modes' ); +const isAllowedCast = require( '@stdlib/ndarray/base/assert/is-allowed-data-type-cast' ); // Get a list of supported ndarray data types and casting modes: -DTYPES = dtypes(); -MODES = modes(); +const DTYPES = dtypes(); +const MODES = modes(); // For each data type and mode, determine whether one can cast to another data type... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - for ( k = 0; k < MODES.length; k++ ) { - bool = isAllowedCast( dt1, dt2, MODES[ k ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt1 = DTYPES[ i ]; + for ( let j = 0; j < DTYPES.length; j++ ) { + const dt2 = DTYPES[ j ]; + for ( let k = 0; k < MODES.length; k++ ) { + const bool = isAllowedCast( dt1, dt2, MODES[ k ] ); console.log( '%s => %s. %s: %s.', dt1, dt2, MODES[ k ], bool ); } } diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-boolean-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-boolean-data-type/README.md index 888f8f49e7d3..3f1604cc5a3c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-boolean-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-boolean-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isBooleanDataType = require( '@stdlib/ndarray/base/assert/is-boolean-data-type' ); +const isBooleanDataType = require( '@stdlib/ndarray/base/assert/is-boolean-data-type' ); ``` #### isBooleanDataType( value ) @@ -45,7 +45,7 @@ var isBooleanDataType = require( '@stdlib/ndarray/base/assert/is-boolean-data-ty Tests if an input `value` is a supported ndarray boolean [data type][@stdlib/ndarray/dtypes]. ```javascript -var bool = isBooleanDataType( 'bool' ); +let bool = isBooleanDataType( 'bool' ); // returns true bool = isBooleanDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isBooleanDataType( 'uint32' ); ```javascript -var isBooleanDataType = require( '@stdlib/ndarray/base/assert/is-boolean-data-type' ); +const isBooleanDataType = require( '@stdlib/ndarray/base/assert/is-boolean-data-type' ); -var bool = isBooleanDataType( 'binary' ); +let bool = isBooleanDataType( 'binary' ); // returns false bool = isBooleanDataType( 'bool' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/README.md index e9527e260723..c17913df89b8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var isBufferLengthCompatibleShape = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape' ); +const isBufferLengthCompatibleShape = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape' ); ``` #### isBufferLengthCompatibleShape( len, shape ) @@ -49,9 +49,9 @@ Returns a `boolean` indicating if a buffer `length` is compatible with a provide ```javascript -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; -var bool = isBufferLengthCompatibleShape( 10, shape ); +let bool = isBufferLengthCompatibleShape( 10, shape ); // returns true bool = isBufferLengthCompatibleShape( 3, shape ); @@ -81,25 +81,20 @@ bool = isBufferLengthCompatibleShape( 3, shape ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var isBufferLengthCompatibleShape = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const isBufferLengthCompatibleShape = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape' ); -var shape; -var bool; -var len; -var i; +const len = 500; // buffer length -len = 500; // buffer length - -shape = [ 0, 0, 0 ]; -for ( i = 0; i < 100; i++ ) { +const shape = [ 0, 0, 0 ]; +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Determine if the buffer length is compatible with the shape array: - bool = isBufferLengthCompatibleShape( len, shape ); + const bool = isBufferLengthCompatibleShape( len, shape ); console.log( 'Buffer length: %d. Shape: %s. Compatible: %s.', len, shape.join( 'x' ), bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/README.md index f5f17027b56a..c25b1db5e53c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' ); +const isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' ); ``` #### isBufferLengthCompatible( len, shape, strides, offset ) @@ -45,11 +45,11 @@ var isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-l Returns a `boolean` indicating if a buffer `length` is compatible with provided ndarray meta data. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 25; +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; +const offset = 25; -var bool = isBufferLengthCompatible( 30, shape, strides, offset ); +let bool = isBufferLengthCompatible( 30, shape, strides, offset ); // returns true bool = isBufferLengthCompatible( 4, shape, strides, offset ); @@ -77,43 +77,36 @@ bool = isBufferLengthCompatible( 4, shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' ); - -var strides; -var offset; -var shape; -var bool; -var len; -var i; -var j; - -len = 500; // buffer length -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const isBufferLengthCompatible = require( '@stdlib/ndarray/base/assert/is-buffer-length-compatible' ); + +const len = 500; // buffer length +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; // Compute the index offset: - offset = strides2offset( shape, strides ) + discreteUniform( 0, 200 ); + const offset = strides2offset( shape, strides ) + discreteUniform( 0, 200 ); // Determine if a buffer length is compatible with generated meta data: - bool = isBufferLengthCompatible( len, shape, strides, offset ); + const bool = isBufferLengthCompatible( len, shape, strides, offset ); console.log( 'Buffer length: %d. Shape: %s. Strides: %s. Offset: %d. Compatible: %s.', len, shape.join( 'x' ), strides.join( ',' ), offset, bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-casting-mode/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-casting-mode/README.md index 6b79510d29c4..536b98793405 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-casting-mode/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-casting-mode/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); +const isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); ``` #### isCastingMode( value ) @@ -45,7 +45,7 @@ var isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); Tests if an input `value` is a supported ndarray casting mode. ```javascript -var bool = isCastingMode( 'safe' ); +const bool = isCastingMode( 'safe' ); // returns true ``` @@ -70,9 +70,9 @@ var bool = isCastingMode( 'safe' ); ```javascript -var isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); +const isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); -var bool = isCastingMode( 'none' ); +let bool = isCastingMode( 'none' ); // returns true bool = isCastingMode( 'equiv' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/README.md index 1596bae61f96..9765ffc5ce19 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/README.md @@ -39,7 +39,7 @@ An array is **contiguous** if the memory address of each array element is adjace ## Usage ```javascript -var isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-major-contiguous' ); +const isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-major-contiguous' ); ``` #### isColumnMajorContiguous( shape, strides, offset ) @@ -47,11 +47,11 @@ var isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-ma Returns a `boolean` indicating if an array is column-major contiguous. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 1, 2 ]; -var offset = 25; +let shape = [ 2, 2 ]; +let strides = [ 1, 2 ]; +let offset = 25; -var bool = isColumnMajorContiguous( shape, strides, offset ); +let bool = isColumnMajorContiguous( shape, strides, offset ); // returns true shape = [ 10 ]; @@ -83,43 +83,37 @@ bool = isColumnMajorContiguous( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-major-contiguous' ); - -var strides; -var offset; -var shape; -var bool; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-major-contiguous' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; strides[ 0 ] *= discreteUniform( 1, 2 ); // if scaled by 1, then single segment // Compute the index offset: - offset = strides2offset( shape, strides ) + 25; // include a view offset + const offset = strides2offset( shape, strides ) + 25; // include a view offset // Determine if the array is column-major contiguous: - bool = isColumnMajorContiguous( shape, strides, offset ); + const bool = isColumnMajorContiguous( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Contiguous: %s.', shape.join( 'x' ), strides.join( ',' ), offset, bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/README.md index 4dd76855cce1..aa58b1043446 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); +const isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); ``` #### isColumnMajor( strides ) @@ -45,7 +45,7 @@ var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); Returns a `boolean` indicating if an array is column-major based on a provided stride array. ```javascript -var bool = isColumnMajor( [ 1, 2 ] ); +let bool = isColumnMajor( [ 1, 2 ] ); // returns true bool = isColumnMajor( [ 2, 1 ] ); @@ -73,15 +73,15 @@ bool = isColumnMajor( [ 2, 1 ] ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); -var shape = [ 10, 10, 10 ]; +const shape = [ 10, 10, 10 ]; -var strides = shape2strides( shape, 'column-major' ); +let strides = shape2strides( shape, 'column-major' ); // returns [ 1, 10, 100 ] -var bool = isColumnMajor( strides ); +let bool = isColumnMajor( strides ); // returns true strides = shape2strides( shape, 'row-major' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/README.md index 6adef55b190e..5792a95d7d67 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-complex-floating-point-data-type' ); +const isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-complex-floating-point-data-type' ); ``` #### isComplexFloatingPointDataType( value ) @@ -49,7 +49,7 @@ Tests if an input `value` is a supported ndarray complex-valued floating-point d ```javascript -var bool = isComplexFloatingPointDataType( 'complex128' ); +let bool = isComplexFloatingPointDataType( 'complex128' ); // returns true bool = isComplexFloatingPointDataType( 'uint32' ); @@ -79,9 +79,9 @@ bool = isComplexFloatingPointDataType( 'uint32' ); ```javascript -var isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-complex-floating-point-data-type' ); +const isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-complex-floating-point-data-type' ); -var bool = isComplexFloatingPointDataType( 'binary' ); +let bool = isComplexFloatingPointDataType( 'binary' ); // returns false bool = isComplexFloatingPointDataType( 'complex128' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/README.md index 13f52b291b7e..55afeb97cbf5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/README.md @@ -39,7 +39,7 @@ An array is **contiguous** if the memory address of each array element is adjace ## Usage ```javascript -var isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); +const isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); ``` #### isContiguous( shape, strides, offset ) @@ -47,11 +47,11 @@ var isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); Returns a `boolean` indicating if an array is contiguous. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 25; +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +let offset = 25; -var bool = isContiguous( shape, strides, offset ); +let bool = isContiguous( shape, strides, offset ); // returns true shape = [ 10 ]; @@ -83,43 +83,37 @@ bool = isContiguous( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); - -var strides; -var offset; -var shape; -var bool; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; strides[ 0 ] *= discreteUniform( 1, 2 ); // if scaled by 1, then single segment // Compute the index offset: - offset = strides2offset( shape, strides ) + 25; // include a view offset + const offset = strides2offset( shape, strides ) + 25; // include a view offset // Determine if the array is contiguous: - bool = isContiguous( shape, strides, offset ); + const bool = isContiguous( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Contiguous: %s.', shape.join( 'x' ), strides.join( ',' ), offset, bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-data-type/README.md index 198bac3ede88..b21744b5704c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); +const isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); ``` #### isDataType( value ) @@ -45,7 +45,7 @@ var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); Tests if an input `value` is a supported ndarray data type. ```javascript -var bool = isDataType( 'float32' ); +let bool = isDataType( 'float32' ); // returns true bool = isDataType( 'int32' ); @@ -73,9 +73,9 @@ bool = isDataType( 'int32' ); ```javascript -var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); +const isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); -var bool = isDataType( 'binary' ); +let bool = isDataType( 'binary' ); // returns true bool = isDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-floating-point-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-floating-point-data-type/README.md index 244294873fee..0c16fd7b78a0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-floating-point-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' ); +const isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' ); ``` #### isFloatingPointDataType( value ) @@ -45,7 +45,7 @@ var isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating- Tests if an input `value` is a supported ndarray floating-point data type. ```javascript -var bool = isFloatingPointDataType( 'float32' ); +let bool = isFloatingPointDataType( 'float32' ); // returns true bool = isFloatingPointDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isFloatingPointDataType( 'uint32' ); ```javascript -var isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' ); +const isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' ); -var bool = isFloatingPointDataType( 'binary' ); +let bool = isFloatingPointDataType( 'binary' ); // returns false bool = isFloatingPointDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-index-mode/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-index-mode/README.md index eda4415c48b2..8202ae50970c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-index-mode/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-index-mode/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); +const isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); ``` #### isIndexMode( value ) @@ -45,7 +45,7 @@ var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); Tests if an input `value` is a supported ndarray index mode. ```javascript -var bool = isIndexMode( 'throw' ); +let bool = isIndexMode( 'throw' ); // returns true bool = isIndexMode( 'normalize' ); @@ -79,9 +79,9 @@ bool = isIndexMode( 'wrap' ); ```javascript -var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); +const isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); -var bool = isIndexMode( 'throw' ); +let bool = isIndexMode( 'throw' ); // returns true bool = isIndexMode( 'wrap' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-integer-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-integer-data-type/README.md index 85083233847a..6d57768c58c5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' ); +const isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' ); ``` #### isIntegerDataType( value ) @@ -45,7 +45,7 @@ var isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-ty Tests if an input `value` is a supported ndarray integer (i.e., signed or unsigned integer) data type. ```javascript -var bool = isIntegerDataType( 'float32' ); +let bool = isIntegerDataType( 'float32' ); // returns false bool = isIntegerDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isIntegerDataType( 'uint32' ); ```javascript -var isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' ); +const isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' ); -var bool = isIntegerDataType( 'binary' ); +let bool = isIntegerDataType( 'binary' ); // returns false bool = isIntegerDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast/README.md index 50e3e6db8a87..e8c2d74744f0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' ); +const isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' ); ``` #### isMostlySafeCast( from, to ) @@ -45,7 +45,7 @@ var isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data Returns a `boolean` indicating whether an ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast or, for floating-point data types, downcast to another ndarray [data type][@stdlib/ndarray/dtypes]. ```javascript -var bool = isMostlySafeCast( 'float32', 'float64' ); +let bool = isMostlySafeCast( 'float32', 'float64' ); // returns true bool = isMostlySafeCast( 'float64', 'int32' ); @@ -73,16 +73,15 @@ bool = isMostlySafeCast( 'float64', 'int32' ); ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can cast to another data type... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Can cast? %s.', dt[i].join( ' => ' ), isMostlySafeCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-numeric-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-numeric-data-type/README.md index 95678b920d94..4dc64a5e9ecd 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-numeric-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-numeric-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' ); +const isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' ); ``` #### isNumericDataType( value ) @@ -45,7 +45,7 @@ var isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-ty Tests if an input `value` is a supported ndarray numeric data type. ```javascript -var bool = isNumericDataType( 'float32' ); +let bool = isNumericDataType( 'float32' ); // returns true bool = isNumericDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isNumericDataType( 'uint32' ); ```javascript -var isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' ); +const isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' ); -var bool = isNumericDataType( 'binary' ); +let bool = isNumericDataType( 'binary' ); // returns false bool = isNumericDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-order/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-order/README.md index 66c8969dd72a..f25d4f4ae658 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); +const isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); ``` #### isOrder( value ) @@ -45,7 +45,7 @@ var isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); Tests if an input `value` is an ndarray order. ```javascript -var bool = isOrder( 'row-major' ); +let bool = isOrder( 'row-major' ); // returns true bool = isOrder( 'column-major' ); @@ -73,9 +73,9 @@ bool = isOrder( 'column-major' ); ```javascript -var isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); +const isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); -var bool = isOrder( 'row-major' ); +let bool = isOrder( 'row-major' ); // returns true bool = isOrder( 'column-major' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-read-only/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-read-only/README.md index 587e90063056..32761c7f3c57 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-read-only/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-read-only/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); +const isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); ``` #### isReadOnly( arr ) @@ -45,12 +45,12 @@ var isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); Tests if an ndarray is **read-only**. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ 1, 2, 3, 4 ], { +const x = array( [ 1, 2, 3, 4 ], { 'readonly': true }); -var bool = isReadOnly( x ); +const bool = isReadOnly( x ); // returns true ``` @@ -75,13 +75,13 @@ var bool = isReadOnly( x ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); +const array = require( '@stdlib/ndarray/array' ); +const isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); -var x = array( [ [ 1, 2 ], [ 3, 4 ] ], { +let x = array( [ [ 1, 2 ], [ 3, 4 ] ], { 'readonly': true }); -var bool = isReadOnly( x ); +let bool = isReadOnly( x ); // returns true x = array( [ [ 1, 2 ], [ 3, 4 ] ], { diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-real-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-real-data-type/README.md index 0db878e3c9ad..8639088806ab 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-real-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-real-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); +const isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); ``` #### isRealDataType( value ) @@ -45,7 +45,7 @@ var isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); Tests if an input `value` is a supported ndarray real-valued data type. ```javascript -var bool = isRealDataType( 'float32' ); +let bool = isRealDataType( 'float32' ); // returns true bool = isRealDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isRealDataType( 'uint32' ); ```javascript -var isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); +const isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); -var bool = isRealDataType( 'binary' ); +let bool = isRealDataType( 'binary' ); // returns false bool = isRealDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-real-floating-point-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-real-floating-point-data-type/README.md index 392d5c6bffb1..24393f7cfc39 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-real-floating-point-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-real-floating-point-data-type/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' ); +const isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' ); ``` #### isRealFloatingPointDataType( value ) @@ -49,7 +49,7 @@ Tests if an input `value` is a supported ndarray real-valued floating-point data ```javascript -var bool = isRealFloatingPointDataType( 'float32' ); +let bool = isRealFloatingPointDataType( 'float32' ); // returns true bool = isRealFloatingPointDataType( 'uint32' ); @@ -79,9 +79,9 @@ bool = isRealFloatingPointDataType( 'uint32' ); ```javascript -var isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' ); +const isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' ); -var bool = isRealFloatingPointDataType( 'binary' ); +let bool = isRealFloatingPointDataType( 'binary' ); // returns false bool = isRealFloatingPointDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/README.md index ee67e44b8af8..e2a92263cfab 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/README.md @@ -39,7 +39,7 @@ An array is **contiguous** if the memory address of each array element is adjace ## Usage ```javascript -var isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-contiguous' ); +const isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-contiguous' ); ``` #### isRowMajorContiguous( shape, strides, offset ) @@ -47,11 +47,11 @@ var isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-co Returns a `boolean` indicating if an array is row-major contiguous. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 25; +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +let offset = 25; -var bool = isRowMajorContiguous( shape, strides, offset ); +let bool = isRowMajorContiguous( shape, strides, offset ); // returns true shape = [ 10 ]; @@ -83,43 +83,37 @@ bool = isRowMajorContiguous( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-contiguous' ); - -var strides; -var offset; -var shape; -var bool; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-contiguous' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; strides[ 0 ] *= discreteUniform( 1, 2 ); // if scaled by 1, then single segment // Compute the index offset: - offset = strides2offset( shape, strides ) + 25; // include a view offset + const offset = strides2offset( shape, strides ) + 25; // include a view offset // Determine if the array is row-major contiguous: - bool = isRowMajorContiguous( shape, strides, offset ); + const bool = isRowMajorContiguous( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Contiguous: %s.', shape.join( 'x' ), strides.join( ',' ), offset, bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/README.md index 096a3dbc5553..dabf946982d9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +const isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); ``` #### isRowMajor( strides ) @@ -45,7 +45,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); Returns a `boolean` indicating if an array is row-major based on a provided stride array. ```javascript -var bool = isRowMajor( [ 2, 1 ] ); +let bool = isRowMajor( [ 2, 1 ] ); // returns true bool = isRowMajor( [ 1, 2 ] ); @@ -73,15 +73,15 @@ bool = isRowMajor( [ 1, 2 ] ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); -var shape = [ 10, 10, 10 ]; +const shape = [ 10, 10, 10 ]; -var strides = shape2strides( shape, 'row-major' ); +let strides = shape2strides( shape, 'row-major' ); // returns [ 100, 10, 1 ] -var bool = isRowMajor( strides ); +let bool = isRowMajor( strides ); // returns true strides = shape2strides( shape, 'column-major' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-safe-data-type-cast/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-safe-data-type-cast/README.md index 96c237ab08c7..8908bdef3d7a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-safe-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-safe-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); +const isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); ``` #### isSafeCast( from, to ) @@ -45,7 +45,7 @@ var isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ) Returns a `boolean` indicating whether an ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast to another ndarray [data type][@stdlib/ndarray/dtypes]. ```javascript -var bool = isSafeCast( 'float32', 'float64' ); +let bool = isSafeCast( 'float32', 'float64' ); // returns true bool = isSafeCast( 'float64', 'int32' ); @@ -73,16 +73,15 @@ bool = isSafeCast( 'float64', 'int32' ); ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can safely cast from one data type to another... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Safe? %s.', dt[i].join( ' => ' ), isSafeCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-same-kind-data-type-cast/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-same-kind-data-type-cast/README.md index 82af454583b9..4fa2fdf03c00 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-same-kind-data-type-cast/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-same-kind-data-type-cast/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); +const isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); ``` #### isSameKindCast( from, to ) @@ -45,7 +45,7 @@ var isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-typ Returns a `boolean` indicating whether an ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast to, or is of the same "kind" as, another ndarray [data type][@stdlib/ndarray/dtypes] (e.g., casting between signed integers or between floats). ```javascript -var bool = isSameKindCast( 'float32', 'float64' ); +let bool = isSameKindCast( 'float32', 'float64' ); // returns true bool = isSameKindCast( 'uint16', 'int16' ); @@ -73,16 +73,15 @@ bool = isSameKindCast( 'uint16', 'int16' ); ```javascript -var cartesianSquare = require( '@stdlib/array/cartesian-square' ); -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); +const cartesianSquare = require( '@stdlib/array/cartesian-square' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); // Generate a list of dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // For each data type pair, determine whether one can cast from one data type to another... -var i; -for ( i = 0; i < dt.length; i++ ) { +for ( let i = 0; i < dt.length; i++ ) { console.log( '%s. Allowed cast? %s.', dt[i].join( ' => ' ), isSameKindCast.apply( null, dt[i] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-signed-integer-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-signed-integer-data-type/README.md index 7f7673d14d8b..1f7d5d28c46e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-signed-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-signed-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); +const isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); ``` #### isSignedIntegerDataType( value ) @@ -45,7 +45,7 @@ var isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-in Tests if an input `value` is a supported ndarray signed integer data type. ```javascript -var bool = isSignedIntegerDataType( 'float32' ); +let bool = isSignedIntegerDataType( 'float32' ); // returns false bool = isSignedIntegerDataType( 'int32' ); @@ -73,9 +73,9 @@ bool = isSignedIntegerDataType( 'int32' ); ```javascript -var isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); +const isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); -var bool = isSignedIntegerDataType( 'binary' ); +let bool = isSignedIntegerDataType( 'binary' ); // returns false bool = isSignedIntegerDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-single-segment-compatible/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-single-segment-compatible/README.md index cc2284fd680a..704bc82c08bf 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-single-segment-compatible/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-single-segment-compatible/README.md @@ -39,7 +39,7 @@ An array is compatible with a single memory segment when an array view spans **o ## Usage ```javascript -var isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); +const isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); ``` #### isSingleSegmentCompatible( shape, strides, offset ) @@ -47,11 +47,11 @@ var isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single- Returns a `boolean` indicating if an array is compatible with a single memory segment. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 25; +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +let offset = 25; -var bool = isSingleSegmentCompatible( shape, strides, offset ); +let bool = isSingleSegmentCompatible( shape, strides, offset ); // returns true shape = [ 10 ]; @@ -83,43 +83,37 @@ bool = isSingleSegmentCompatible( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); - -var strides; -var offset; -var shape; -var bool; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; strides[ 0 ] *= discreteUniform( 1, 4 ); // if scaled by 1, then single segment // Compute the index offset: - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); // Determine if the array is compatible with a single memory segment: - bool = isSingleSegmentCompatible( shape, strides, offset ); + const bool = isSingleSegmentCompatible( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Single segment compatible: %s.', shape.join( 'x' ), strides.join( ',' ), offset, bool ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-unsigned-integer-data-type/README.md b/lib/node_modules/@stdlib/ndarray/base/assert/is-unsigned-integer-data-type/README.md index 96eba53a02f6..ad4666da731e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-unsigned-integer-data-type/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-unsigned-integer-data-type/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); +const isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); ``` #### isUnsignedIntegerDataType( value ) @@ -45,7 +45,7 @@ var isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigne Tests if an input `value` is a supported ndarray unsigned integer data type. ```javascript -var bool = isUnsignedIntegerDataType( 'float32' ); +let bool = isUnsignedIntegerDataType( 'float32' ); // returns false bool = isUnsignedIntegerDataType( 'uint32' ); @@ -73,9 +73,9 @@ bool = isUnsignedIntegerDataType( 'uint32' ); ```javascript -var isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); +const isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); -var bool = isUnsignedIntegerDataType( 'binary' ); +let bool = isUnsignedIntegerDataType( 'binary' ); // returns false bool = isUnsignedIntegerDataType( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/assign/README.md b/lib/node_modules/@stdlib/ndarray/base/assign/README.md index edee89f024af..8337db87c02a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assign/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/assign/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var assign = require( '@stdlib/ndarray/base/assign' ); +const assign = require( '@stdlib/ndarray/base/assign' ); ``` #### assign( arrays ) @@ -43,25 +43,25 @@ Assigns elements in an input ndarray to elements in an output ndarray. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create data buffers: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var ybuf = new Float64Array( 6 ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; -var sy = [ 2, 2, 1 ]; +const sx = [ 4, 4, 1 ]; +const sy = [ 2, 2, 1 ]; // Define the index offsets: -var ox = 1; -var oy = 0; +const ox = 1; +const oy = 0; // Create the input and output ndarray-like objects: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -69,7 +69,7 @@ var x = { 'offset': ox, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -119,16 +119,16 @@ Each provided ndarray should be an object with the following properties: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var assign = require( '@stdlib/ndarray/base/assign' ); - -var N = 10; -var shape = [ 5, 2 ]; -var x = { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const assign = require( '@stdlib/ndarray/base/assign' ); + +const N = 10; +const shape = [ 5, 2 ]; +const x = { 'dtype': 'generic', 'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ), 'shape': shape, @@ -136,7 +136,7 @@ var x = { 'offset': 0, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'generic', 'data': filledarray( 0, N, 'generic' ), 'shape': shape.slice(), diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md index fa25c3cbd72f..1d4f3371182f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var binaryLoopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' ); +const binaryLoopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' ); ``` #### binaryLoopOrder( shape, stridesX, stridesY, stridesZ ) @@ -46,17 +46,17 @@ Reorders [ndarray][@stdlib/ndarray/ctor] dimensions and associated strides for [ ```javascript // Define an array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Define the strides for the input arrays: -var stridesX = [ 2, 1 ]; // row-major -var stridesY = [ 4, 2 ]; // row-major +const stridesX = [ 2, 1 ]; // row-major +const stridesY = [ 4, 2 ]; // row-major // Define the strides for the output array: -var stridesZ = [ 1, 2 ]; // column-major +const stridesZ = [ 1, 2 ]; // column-major // Resolve the loop interchange order: -var o = binaryLoopOrder( shape, stridesX, stridesY, stridesZ ); +const o = binaryLoopOrder( shape, stridesX, stridesY, stridesZ ); // returns {...} ``` @@ -100,16 +100,16 @@ For all returned arrays, the first element corresponds to the innermost loop, an ```javascript -var array = require( '@stdlib/ndarray/array' ); -var loopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' ); +const array = require( '@stdlib/ndarray/array' ); +const loopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' ); // Create ndarrays: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var y = array( [ [ 5, 6 ], [ 7, 8 ] ] ); -var z = array( [ [ 0, 0 ], [ 0, 0 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const y = array( [ [ 5, 6 ], [ 7, 8 ] ] ); +const z = array( [ [ 0, 0 ], [ 0, 0 ] ] ); // Resolve loop interchange data: -var o = loopOrder( x.shape, x.strides, y.strides, z.strides ); +const o = loopOrder( x.shape, x.strides, y.strides, z.strides ); // returns {...} console.log( o ); diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-tiling-block-size/README.md b/lib/node_modules/@stdlib/ndarray/base/binary-tiling-block-size/README.md index 5f3e998a1d50..92bd8e94e130 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-tiling-block-size/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/binary-tiling-block-size/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' ); +const binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' ); ``` #### binaryBlockSize( dtypeX, dtypeY, dtypeZ ) @@ -45,7 +45,7 @@ var binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' ) Resolves a loop block size according to provided ndarray [dtypes][@stdlib/ndarray/dtypes] for multi-dimensional array tiled loops applying a binary function. ```javascript -var bsize = binaryBlockSize( 'float64', 'float64', 'float64' ); +const bsize = binaryBlockSize( 'float64', 'float64', 'float64' ); // returns ``` @@ -74,23 +74,19 @@ var bsize = binaryBlockSize( 'float64', 'float64', 'float64' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); -var promotionRules = require( '@stdlib/ndarray/promotion-rules' ); -var binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); +const promotionRules = require( '@stdlib/ndarray/promotion-rules' ); +const binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' ); // Generate a list of input ndarray dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); -// Resolve the block size for each dtype pair and its promoted dtype... -var t; -var b; -var i; console.log( 'block_size, xdtype, ydtype, zdtype' ); -for ( i = 0; i < dt.length; i++ ) { - t = promotionRules.apply( null, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const t = promotionRules.apply( null, dt[ i ] ); dt[ i ].push( ( t === -1 ) ? 'generic' : t ); - b = binaryBlockSize.apply( null, dt[ i ] ); + const b = binaryBlockSize.apply( null, dt[ i ] ); console.log( '%d, %s, %s, %s', b, dt[i][0], dt[i][1], dt[i][2] ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/bind2vind/README.md b/lib/node_modules/@stdlib/ndarray/base/bind2vind/README.md index cc3650e8f05f..2660f5ffdbf5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/bind2vind/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/bind2vind/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bind2vind = require( '@stdlib/ndarray/base/bind2vind' ); +const bind2vind = require( '@stdlib/ndarray/base/bind2vind' ); ``` #### bind2vind( shape, strides, offset, order, idx, mode ) @@ -45,12 +45,12 @@ var bind2vind = require( '@stdlib/ndarray/base/bind2vind' ); Converts a linear index in an underlying data buffer to a linear index in an array view. ```javascript -var shape = [ 3, 3 ]; -var order = 'row-major'; -var strides = [ -3, 1 ]; -var offset = 6; +const shape = [ 3, 3 ]; +const order = 'row-major'; +const strides = [ -3, 1 ]; +const offset = 6; -var idx = bind2vind( shape, strides, offset, order, 7, 'throw' ); +const idx = bind2vind( shape, strides, offset, order, 7, 'throw' ); // returns 1 ``` @@ -62,12 +62,12 @@ The function supports the following modes: - **clamp**: specifies that the function should set a linear index exceeding array dimensions to either `0` (minimum linear index) or the maximum linear index. ```javascript -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, 1 ]; -var offset = 2; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, 1 ]; +const offset = 2; -var idx = bind2vind( shape, strides, offset, order, -2, 'wrap' ); +let idx = bind2vind( shape, strides, offset, order, -2, 'wrap' ); // returns 0 idx = bind2vind( shape, strides, offset, order, 10, 'clamp' ); @@ -77,12 +77,12 @@ idx = bind2vind( shape, strides, offset, order, 10, 'clamp' ); The `order` parameter specifies whether an array is `row-major` (C-style) or `column-major` (Fortran-style). ```javascript -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, -2 ]; -var offset = 2; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, -2 ]; +const offset = 2; -var idx = bind2vind( shape, strides, offset, order, 2, 'throw' ); +const idx = bind2vind( shape, strides, offset, order, 2, 'throw' ); // returns 0 ``` @@ -107,40 +107,36 @@ var idx = bind2vind( shape, strides, offset, order, 2, 'throw' ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var randu = require( '@stdlib/random/base/randu' ); -var bind2vind = require( '@stdlib/ndarray/base/bind2vind' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const randu = require( '@stdlib/random/base/randu' ); +const bind2vind = require( '@stdlib/ndarray/base/bind2vind' ); // Specify array meta data: -var shape = [ 3, 3, 3 ]; -var order = 'row-major'; +const shape = [ 3, 3, 3 ]; +const order = 'row-major'; // Compute array meta data: -var len = numel( shape ); -var strides = shape2strides( shape, order ); +const len = numel( shape ); +const strides = shape2strides( shape, order ); -// Randomly flip the sign of strides... -var i; -for ( i = 0; i < shape.length; i++ ) { +for ( let i = 0; i < shape.length; i++ ) { if ( randu() < 0.5 ) { strides[ i ] *= -1; } } // Compute the underlying data buffer index offset: -var offset = strides2offset( shape, strides ); +const offset = strides2offset( shape, strides ); // Print array info: console.log( 'Dims: %s', shape.join( 'x' ) ); console.log( 'Strides: %s', strides.join( ',' ) ); console.log( 'Offset: %d', offset ); -// For each underlying data buffer index, determine the corresponding index into an array view... -var ind; -for ( i = 0; i < len; i++ ) { - ind = bind2vind( shape, strides, offset, order, i, 'throw' ); +for ( let i = 0; i < len; i++ ) { + const ind = bind2vind( shape, strides, offset, order, i, 'throw' ); console.log( 'buffer[%d] => view[%d]', i, ind ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-array/README.md b/lib/node_modules/@stdlib/ndarray/base/broadcast-array/README.md index 1993b0789ac4..aef9b6f492a4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastArray = require( '@stdlib/ndarray/base/broadcast-array' ); +const broadcastArray = require( '@stdlib/ndarray/base/broadcast-array' ); ``` #### broadcastArray( arr, shape ) @@ -45,14 +45,14 @@ var broadcastArray = require( '@stdlib/ndarray/base/broadcast-array' ); Broadcasts an [ndarray][@stdlib/ndarray/base/ctor] to a specified `shape`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast to a 2x2x2 ndarray: -var y = broadcastArray( x, [ 2, 2, 2 ] ); +const y = broadcastArray( x, [ 2, 2, 2 ] ); // returns ``` @@ -84,33 +84,29 @@ var y = broadcastArray( x, [ 2, 2, 2 ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var broadcastArray = require( '@stdlib/ndarray/base/broadcast-array' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const broadcastArray = require( '@stdlib/ndarray/base/broadcast-array' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast the array to 3x2x2: -var y = broadcastArray( x, [ 3, 2, 2 ] ); +const y = broadcastArray( x, [ 3, 2, 2 ] ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); - -// Loop through the array elements... -var sub; -var v; -var i; -for ( i = 0; i < N; i++ ) { - v = y.iget( i ); - sub = ind2sub( sh, i ); +const N = numel( sh ); + +for ( let i = 0; i < N; i++ ) { + const v = y.iget( i ); + const sub = ind2sub( sh, i ); console.log( 'Y[%s] = %d', sub.join( ', ' ), v ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-arrays/README.md b/lib/node_modules/@stdlib/ndarray/base/broadcast-arrays/README.md index ba722b4d6d0b..b61e02dc8b64 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-arrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-arrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastArrays = require( '@stdlib/ndarray/base/broadcast-arrays' ); +const broadcastArrays = require( '@stdlib/ndarray/base/broadcast-arrays' ); ``` #### broadcastArrays( arrays ) @@ -45,19 +45,19 @@ var broadcastArrays = require( '@stdlib/ndarray/base/broadcast-arrays' ); Broadcasts a list of [ndarrays][@stdlib/ndarray/base/ctor] to a common shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = broadcastArrays( [ x, y ] ); +const out = broadcastArrays( [ x, y ] ); // returns [ , ] ``` @@ -89,34 +89,32 @@ var out = broadcastArrays( [ x, y ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var broadcastArrays = require( '@stdlib/ndarray/base/broadcast-arrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const broadcastArrays = require( '@stdlib/ndarray/base/broadcast-arrays' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 3x2x2 array: -var y = zeros( [ 3, 2, 2 ] ); +const y = zeros( [ 3, 2, 2 ] ); // returns // Broadcast the arrays to a common shape: -var out = broadcastArrays( [ x, y ] ); +const out = broadcastArrays( [ x, y ] ); // returns [ , ] // Retrieve the common shape: -var sh = out[ 0 ].shape; +const sh = out[ 0 ].shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'X[%s] = %d', ind2sub( sh, i ).join( ', ' ), out[ 0 ].iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/README.md b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/README.md index 443981fdbe12..40743ba84307 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' ); +const broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' ); ``` #### broadcastScalar( value, dtype, shape, order ) @@ -45,16 +45,16 @@ var broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' ); Broadcasts a scalar value to an [`ndarray`][@stdlib/ndarray/base/ctor] having a specified shape and [data type][@stdlib/ndarray/dtypes]. ```javascript -var x = broadcastScalar( 1.0, 'float64', [ 2, 2 ], 'row-major' ); +const x = broadcastScalar( 1.0, 'float64', [ 2, 2 ], 'row-major' ); // returns -var sh = x.shape; +const sh = x.shape; // returns [ 2, 2 ] -var dt = x.dtype; +const dt = x.dtype; // returns 'float64' -var v = x.get( 0, 0 ); +const v = x.get( 0, 0 ); // returns 1.0 ``` @@ -85,17 +85,14 @@ var v = x.get( 0, 0 ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate two-dimensional arrays... -var x; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = broadcastScalar( i, dt[ i ], [ 2, 2 ], 'row-major' ); +for ( let i = 0; i < dt.length; i++ ) { + const x = broadcastScalar( i, dt[ i ], [ 2, 2 ], 'row-major' ); console.log( x.get( 0, 1 ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-shapes/README.md b/lib/node_modules/@stdlib/ndarray/base/broadcast-shapes/README.md index 831032182b36..114534c3ba7c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-shapes/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-shapes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' ); +const broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' ); ``` #### broadcastShapes( shapes ) @@ -45,10 +45,10 @@ var broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' ); Broadcasts array shapes to a single shape. ```javascript -var sh1 = [ 8, 1, 6, 1 ]; -var sh2 = [ 7, 1, 5 ]; +const sh1 = [ 8, 1, 6, 1 ]; +const sh2 = [ 7, 1, 5 ]; -var sh = broadcastShapes( [ sh1, sh2 ] ); +const sh = broadcastShapes( [ sh1, sh2 ] ); // returns [ 8, 7, 6, 5 ] ``` @@ -177,10 +177,10 @@ var sh = broadcastShapes( [ sh1, sh2 ] ); - The function returns `null` if provided incompatible shapes (i.e., shapes which cannot be broadcast with one another). ```javascript - var sh1 = [ 3, 2 ]; - var sh2 = [ 2, 3 ]; + const sh1 = [ 3, 2 ]; + const sh2 = [ 2, 3 ]; - var sh = broadcastShapes( [ sh1, sh2 ] ); + const sh = broadcastShapes( [ sh1, sh2 ] ); // returns null ``` @@ -213,20 +213,14 @@ var sh = broadcastShapes( [ sh1, sh2 ] ); ```javascript -var lpad = require( '@stdlib/string/left-pad' ); -var broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' ); - -var shapes; -var out; -var sh; -var i; -var j; +const lpad = require( '@stdlib/string/left-pad' ); +const broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' ); function shape2string( shape ) { return lpad( shape.join( ' x ' ), 20, ' ' ); } -shapes = [ +const shapes = [ [ [ 1, 2 ], [ 2 ] ], [ [ 1, 1 ], [ 3, 4 ] ], [ [ 6, 7 ], [ 5, 6, 1 ], [ 7 ], [ 5, 1, 7 ] ], @@ -237,14 +231,14 @@ shapes = [ [ [ 1, 2 ], [ 1, 2 ] ] ]; -for ( i = 0; i < shapes.length; i++ ) { - sh = shapes[ i ]; - for ( j = 0; j < sh.length; j++ ) { +for ( let i = 0; i < shapes.length; i++ ) { + const sh = shapes[ i ]; + for ( let j = 0; j < sh.length; j++ ) { console.log( shape2string( sh[ j ] ) ); } console.log( lpad( '', 20, '-' ) ); - out = broadcastShapes( sh ); + const out = broadcastShapes( sh ); console.log( shape2string( out )+'\n' ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/buffer-ctors/README.md b/lib/node_modules/@stdlib/ndarray/base/buffer-ctors/README.md index efa54335a2b7..629a95ea758f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/buffer-ctors/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/buffer-ctors/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ctors = require( '@stdlib/ndarray/base/buffer-ctors' ); +const ctors = require( '@stdlib/ndarray/base/buffer-ctors' ); ``` #### ctors( dtype ) @@ -45,14 +45,14 @@ var ctors = require( '@stdlib/ndarray/base/buffer-ctors' ); Returns an ndarray data buffer constructor for a specified [data type][@stdlib/ndarray/dtypes]. ```javascript -var ctor = ctors( 'float64' ); +const ctor = ctors( 'float64' ); // returns ``` If provided an unknown or unsupported [data type][@stdlib/ndarray/dtypes], the function returns `null`. ```javascript -var ctor = ctors( 'float' ); +const ctor = ctors( 'float' ); // returns null ``` @@ -77,15 +77,13 @@ var ctor = ctors( 'float' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var ctors = require( '@stdlib/ndarray/base/buffer-ctors' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const ctors = require( '@stdlib/ndarray/base/buffer-ctors' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); -var ctor; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = ctors( DTYPES[ i ] ); console.log( ctor ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/buffer-dtype-enum/README.md b/lib/node_modules/@stdlib/ndarray/base/buffer-dtype-enum/README.md index 4f0089278558..4181567e7b24 100644 --- a/lib/node_modules/@stdlib/ndarray/base/buffer-dtype-enum/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/buffer-dtype-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' ); +const dtypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' ); ``` #### dtypeEnum( buffer ) @@ -45,17 +45,17 @@ var dtypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' ); Returns the [data type][@stdlib/ndarray/dtypes] enumeration constant of an ndarray data [`buffer`][@stdlib/ndarray/base/buffer-ctors]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var buf = new Float64Array( 10 ); +const Float64Array = require( '@stdlib/array/float64' ); +const buf = new Float64Array( 10 ); -var c = dtypeEnum( buf ); +const c = dtypeEnum( buf ); // returns ``` If provided an ndarray data [`buffer`][@stdlib/ndarray/base/buffer-ctors] having an unknown or unsupported [data type][@stdlib/ndarray/dtypes], the function returns `null`. ```javascript -var c = dtypeEnum( 'beep' ); +const c = dtypeEnum( 'beep' ); // returns null ``` @@ -84,41 +84,35 @@ var c = dtypeEnum( 'beep' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var bufferCtors = require( '@stdlib/ndarray/base/buffer-ctors' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var dtypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' ); - -var DTYPES; -var ctor; -var buf; -var len; -var c; -var i; +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const bufferCtors = require( '@stdlib/ndarray/base/buffer-ctors' ); +const isFunction = require( '@stdlib/assert/is-function' ); +const dtypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' ); // Get a list of supported ndarray buffer data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Buffer length: -len = 10; +const len = 10; // For each supported data type, create a buffer and retrieve its data type enumeration constant... -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = bufferCtors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = bufferCtors( DTYPES[ i ] ); + let buf; if ( DTYPES[ i ] === 'binary' && isFunction( ctor.alloc ) ) { buf = ctor.alloc( len ); } else { buf = new ctor( len ); } - c = dtypeEnum( buf ); + const c = dtypeEnum( buf ); console.log( '%s => %d', DTYPES[ i ], c ); } // Try an array-like object... -buf = { +const buf = { 'length': 10 }; -c = dtypeEnum( buf ); +const c = dtypeEnum( buf ); console.log( '%s => %s', 'generic', c ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/buffer-dtype/README.md b/lib/node_modules/@stdlib/ndarray/base/buffer-dtype/README.md index 42f687dceb00..c2bba0cdd1c0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/buffer-dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/buffer-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype = require( '@stdlib/ndarray/base/buffer-dtype' ); +const dtype = require( '@stdlib/ndarray/base/buffer-dtype' ); ``` #### dtype( buffer ) @@ -45,17 +45,17 @@ var dtype = require( '@stdlib/ndarray/base/buffer-dtype' ); Returns the [data type][@stdlib/ndarray/dtypes] of an ndarray data [`buffer`][@stdlib/ndarray/base/buffer-ctors]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var buf = new Float64Array( 10 ); +const Float64Array = require( '@stdlib/array/float64' ); +const buf = new Float64Array( 10 ); -var dt = dtype( buf ); +const dt = dtype( buf ); // returns 'float64' ``` If provided an ndarray data [`buffer`][@stdlib/ndarray/base/buffer-ctors] having an unknown or unsupported [data type][@stdlib/ndarray/dtypes], the function returns `null`. ```javascript -var dt = dtype( 'beep' ); +const dt = dtype( 'beep' ); // returns null ``` @@ -80,38 +80,35 @@ var dt = dtype( 'beep' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var bufferCtors = require( '@stdlib/ndarray/base/buffer-ctors' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var dtype = require( '@stdlib/ndarray/base/buffer-dtype' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const bufferCtors = require( '@stdlib/ndarray/base/buffer-ctors' ); +const isFunction = require( '@stdlib/assert/is-function' ); +const dtype = require( '@stdlib/ndarray/base/buffer-dtype' ); // Get a list of supported ndarray buffer data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); // Buffer length: -var len = 10; +const len = 10; // For each supported data type, create a buffer and confirm its data type... -var ctor; -var buf; -var dt; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = bufferCtors( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const ctor = bufferCtors( DTYPES[ i ] ); + let buf; if ( DTYPES[ i ] === 'binary' && isFunction( ctor.alloc ) ) { buf = ctor.alloc( len ); } else { buf = new ctor( len ); } - dt = dtype( buf ); + const dt = dtype( buf ); console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt ); } // Try an array-like object... -buf = { +const buf = { 'length': 10 }; -dt = dtype( buf ); +const dt = dtype( buf ); console.log( '%s == %s => %s', 'generic', dt, dt === 'generic' ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/buffer/README.md b/lib/node_modules/@stdlib/ndarray/base/buffer/README.md index cd51352e33bc..4dc39a5ba9be 100644 --- a/lib/node_modules/@stdlib/ndarray/base/buffer/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var buffer = require( '@stdlib/ndarray/base/buffer' ); +const buffer = require( '@stdlib/ndarray/base/buffer' ); ``` #### buffer( dtype, size ) @@ -45,14 +45,14 @@ var buffer = require( '@stdlib/ndarray/base/buffer' ); Returns a contiguous linear ndarray data buffer having a specified [data type][@stdlib/ndarray/dtypes]. ```javascript -var buf = buffer( 'float64', 3 ); +const buf = buffer( 'float64', 3 ); // returns [ 0.0, 0.0, 0.0 ] ``` If provided an unknown or unsupported [data type][@stdlib/ndarray/dtypes], the function returns `null`. ```javascript -var buf = buffer( 'float', 3 ); +const buf = buffer( 'float', 3 ); // returns null ``` @@ -81,15 +81,13 @@ var buf = buffer( 'float', 3 ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var buffer = require( '@stdlib/ndarray/base/buffer' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const buffer = require( '@stdlib/ndarray/base/buffer' ); -var DTYPES = dtypes(); +const DTYPES = dtypes(); -var buf; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - buf = buffer( DTYPES[ i ], 10 ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const buf = buffer( DTYPES[ i ], 10 ); console.log( buf ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/bytes-per-element/README.md b/lib/node_modules/@stdlib/ndarray/base/bytes-per-element/README.md index f855020a83e5..17359a55fffd 100644 --- a/lib/node_modules/@stdlib/ndarray/base/bytes-per-element/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/bytes-per-element/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); ``` #### bytesPerElement( dtype ) @@ -45,7 +45,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); Returns the number of bytes per element provided an underlying [array data type][@stdlib/ndarray/dtypes]. ```javascript -var nbytes = bytesPerElement( 'float64' ); +let nbytes = bytesPerElement( 'float64' ); // returns 8 nbytes = bytesPerElement( 'generic' ); @@ -55,7 +55,7 @@ nbytes = bytesPerElement( 'generic' ); If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var nbytes = bytesPerElement( 'foobar' ); +const nbytes = bytesPerElement( 'foobar' ); // returns null ``` @@ -80,11 +80,9 @@ var nbytes = bytesPerElement( 'foobar' ); ```javascript -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); -var dtypes; -var nbytes; -var i; +let dtypes; dtypes = [ 'float64', @@ -101,8 +99,8 @@ dtypes = [ 'foobar' ]; -for ( i = 0; i < dtypes.length; i++ ) { - nbytes = bytesPerElement( dtypes[ i ] ); +for ( let i = 0; i < dtypes.length; i++ ) { + let nbytes = bytesPerElement( dtypes[ i ] ); nbytes = ( nbytes ) ? nbytes+' bytes' : 'null'; console.log( '%s => %s', dtypes[ i ], nbytes ); } diff --git a/lib/node_modules/@stdlib/ndarray/base/char2dtype/README.md b/lib/node_modules/@stdlib/ndarray/base/char2dtype/README.md index 5a90102c2a27..2ca498642736 100644 --- a/lib/node_modules/@stdlib/ndarray/base/char2dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/char2dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var char2dtype = require( '@stdlib/ndarray/base/char2dtype' ); +const char2dtype = require( '@stdlib/ndarray/base/char2dtype' ); ``` #### char2dtype( \[ch] ) @@ -45,7 +45,7 @@ var char2dtype = require( '@stdlib/ndarray/base/char2dtype' ); Returns the [data type][@stdlib/ndarray/dtypes] string associated with a provided [single letter character abbreviation][@stdlib/ndarray/base/dtype-char]. ```javascript -var out = char2dtype( 'd' ); +let out = char2dtype( 'd' ); // returns 'float64' out = char2dtype( 'i' ); @@ -55,14 +55,14 @@ out = char2dtype( 'i' ); If provided an unknown or unsupported [single letter character abbreviation][@stdlib/ndarray/base/dtype-char], the function returns `null`. ```javascript -var out = char2dtype( '(' ); +const out = char2dtype( '(' ); // returns null ``` If not provided a [data type][@stdlib/ndarray/dtypes] string, the function returns an object mapping [single letter character abbreviations][@stdlib/ndarray/base/dtype-char] to [data type][@stdlib/ndarray/dtypes] strings. ```javascript -var out = char2dtype(); +const out = char2dtype(); // returns {...} ``` @@ -87,10 +87,10 @@ var out = char2dtype(); ```javascript -var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); -var char2dtype = require( '@stdlib/ndarray/base/char2dtype' ); +const dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); +const char2dtype = require( '@stdlib/ndarray/base/char2dtype' ); -var chars = [ +const chars = [ dtypeChar( 'float64' ), dtypeChar( 'float32' ), dtypeChar( 'int8' ), @@ -105,8 +105,7 @@ var chars = [ '(' ]; -var i; -for ( i = 0; i < chars.length; i++ ) { +for ( let i = 0; i < chars.length; i++ ) { console.log( '%s => %s', chars[ i ], char2dtype( chars[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/clamp-index/README.md b/lib/node_modules/@stdlib/ndarray/base/clamp-index/README.md index 26d5de5c1f74..db304d098290 100644 --- a/lib/node_modules/@stdlib/ndarray/base/clamp-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/clamp-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var clampIndex = require( '@stdlib/ndarray/base/clamp-index' ); +const clampIndex = require( '@stdlib/ndarray/base/clamp-index' ); ``` #### clampIndex( idx, max ) @@ -45,7 +45,7 @@ var clampIndex = require( '@stdlib/ndarray/base/clamp-index' ); Restricts an index to the interval `[0,max]`. ```javascript -var idx = clampIndex( 2, 10 ); +let idx = clampIndex( 2, 10 ); // returns 2 idx = clampIndex( -5, 10 ); @@ -76,16 +76,12 @@ idx = clampIndex( 15, 10 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var clampIndex = require( '@stdlib/ndarray/base/clamp-index' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const clampIndex = require( '@stdlib/ndarray/base/clamp-index' ); -var idx; -var out; -var i; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( -20, 20 ); - out = clampIndex( idx, 10 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( -20, 20 ); + const out = clampIndex( idx, 10 ); console.log( '%d => [%d,%d] => %d', idx, 0, 10, out ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/ctor/README.md b/lib/node_modules/@stdlib/ndarray/base/ctor/README.md index 482124a554d5..ec35f3d709d7 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ctor/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarray = require( '@stdlib/ndarray/base/ctor' ); +const ndarray = require( '@stdlib/ndarray/base/ctor' ); ``` @@ -48,14 +48,14 @@ Returns an `ndarray` instance. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -71,14 +71,14 @@ The constructor has the following parameters: To create a zero-dimensional array, provide an empty `shape` and a single `strides` element equal to `0`. The `order` can be either `row-major` or `column-major` and has no effect on data storage or access. ```javascript -var buffer = [ 1 ]; -var shape = []; -var order = 'row-major'; -var strides = [ 0 ]; -var offset = 0; +const buffer = [ 1 ]; +const shape = []; +const order = 'row-major'; +const strides = [ 0 ]; +const offset = 0; // Create a new zero-dimensional array: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -93,7 +93,7 @@ var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); String value of the ndarray constructor name. ```javascript -var str = ndarray.name; +const str = ndarray.name; // returns 'ndarray' ``` @@ -104,20 +104,20 @@ var str = ndarray.name; Size (in bytes) of the array (if known). ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Specify the array configuration: -var buffer = new Float64Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float64Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'float64', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float64', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 32 ``` @@ -125,17 +125,17 @@ If unable to determine the size of the array, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns null ``` @@ -146,20 +146,20 @@ var nbytes = arr.byteLength; Size (in bytes) of each array element (if known). ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Specify the array configuration: -var buffer = new Float32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'float32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float32', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -167,17 +167,17 @@ If size of each array element is unknown, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns null ``` @@ -188,23 +188,23 @@ var nbytes = arr.BYTES_PER_ELEMENT; A reference to the underlying data buffer. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); // Specify the array configuration: -var buffer = new Int8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Int8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'int8', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int8', buffer, shape, strides, offset, order ); // Get the buffer reference: -var d = arr.data; +const d = arr.data; // returns [ 1, 2, 3, 4 ] -var bool = ( d === buffer ); +const bool = ( d === buffer ); // returns true ``` @@ -215,20 +215,20 @@ var bool = ( d === buffer ); Underlying [data type][@stdlib/ndarray/dtypes]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Specify the array configuration: -var buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, 1 ]; -var offset = 2; +const buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'uint8', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint8', buffer, shape, strides, offset, order ); // Get the underlying data type: -var dtype = arr.dtype; +const dtype = arr.dtype; // returns 'uint8' ``` @@ -245,20 +245,20 @@ Meta information, such as information concerning the memory layout of the array. An array is contiguous if (1) an array is compatible with being stored in a single memory segment and (2) each array element is adjacent to the next array element. Note that an array can be both row-major contiguous and column-major contiguous at the same time (e.g., if an array is a 1-dimensional ndarray with `strides = [1]`). ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Specify the array configuration: -var buffer = new Int32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, 2 ]; -var offset = 0; +const buffer = new Int32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, 2 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'int32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int32', buffer, shape, strides, offset, order ); // Get the array flags: -var flg = arr.flags; +const flg = arr.flags; // returns {...} ``` @@ -269,20 +269,20 @@ var flg = arr.flags; Number of array elements. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); // Specify the array configuration: -var buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, -2 ]; -var offset = 3; +const buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, -2 ]; +const offset = 3; // Create a new ndarray: -var arr = ndarray( 'uint16', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint16', buffer, shape, strides, offset, order ); // Get the array length: -var len = arr.length; +const len = arr.length; // returns 4 ``` @@ -293,20 +293,20 @@ var len = arr.length; Number of dimensions. ```javascript -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); // Specify the array configuration: -var buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 3; +const buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 3; // Create a new ndarray: -var arr = ndarray( 'uint8c', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint8c', buffer, shape, strides, offset, order ); // Get the number of dimensions: -var ndims = arr.ndims; +const ndims = arr.ndims; // returns 2 ``` @@ -317,20 +317,20 @@ var ndims = arr.ndims; Index offset which specifies the `buffer` index at which to start iterating over array elements. ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); // Specify the array configuration: -var buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 10; +const buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 10; // Create a new ndarray: -var arr = ndarray( 'int16', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int16', buffer, shape, strides, offset, order ); // Get the index offset: -var o = arr.offset; +const o = arr.offset; // returns 10 ``` @@ -341,20 +341,20 @@ var o = arr.offset; Array order. The array order is either row-major (C-style) or column-major (Fortran-style). ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); // Specify the array configuration: -var buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'uint32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint32', buffer, shape, strides, offset, order ); // Get the array order: -var ord = arr.order; +const ord = arr.order; // returns 'row-major' ``` @@ -366,17 +366,17 @@ Returns a copy of the array shape. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4, 5, 6 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1, 2, 3, 4, 5, 6 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the array shape: -var dims = arr.shape; +const dims = arr.shape; // returns [ 2, 2 ] ``` @@ -388,17 +388,17 @@ Returns a copy of the array strides which specify how to access data along corre ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, 2 ]; -var offset = 1; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, 2 ]; +const offset = 1; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the array strides: -var s = arr.strides; +const s = arr.strides; // returns [ -1, 2 ] ``` @@ -414,17 +414,17 @@ Returns an array element specified according to provided subscripts. The number ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at (1,1): -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 6 ``` @@ -436,17 +436,17 @@ Returns an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at index 3: -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 6 ``` @@ -460,22 +460,22 @@ Sets an array element specified according to provided subscripts. The number of ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at (1,1): arr.set( 1, 1, 40 ); -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 40 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1, 2, 3, 40 ] ``` @@ -489,22 +489,22 @@ Sets an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at index 3: arr.iset( 3, 40 ); -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 40 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1, 2, 3, 40 ] ``` @@ -518,17 +518,17 @@ Serializes an `ndarray` as a `string`. ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Serialize to a string: -var str = arr.toString(); +const str = arr.toString(); // returns "ndarray( 'generic', [ 3, 4, 5, 6, 7, 8 ], [ 3, 2 ], [ 2, 1 ], 0, 'row-major' )" ``` @@ -542,17 +542,17 @@ Serializes an `ndarray` as a [JSON][json] `object`. `JSON.stringify()` implicitl ```javascript // Specify the array configuration: -var buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Serialize to JSON: -var o = arr.toJSON(); +const o = arr.toJSON(); // returns { 'type': 'ndarray', 'dtype': 'generic', 'flags': {...}, 'offset': 0, 'order': 'row-major', 'shape': [ 3, 2 ], 'strides': [ 2, 1 ], 'data': [ 3, 4, 5, 6, 7, 8 ] } ``` @@ -587,29 +587,29 @@ The method does **not** serialize data outside of the buffer region defined by t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/base/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/base/ctor' ); // Create a data buffer: -var buffer = new Float32Array( (3*3*3*3) + 100 ); +const buffer = new Float32Array( (3*3*3*3) + 100 ); // Specify the array shape: -var shape = [ 3, 3, 3, 3 ]; +const shape = [ 3, 3, 3, 3 ]; // Specify the array strides: -var strides = [ 27, 9, 3, 1 ]; +const strides = [ 27, 9, 3, 1 ]; // Specify the index offset: -var offset = 4; +const offset = 4; // Specify the order: -var order = 'row-major'; // C-style +const order = 'row-major'; // C-style // Create a new ndarray: -var arr = ndarray( 'float32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float32', buffer, shape, strides, offset, order ); // Retrieve an array value: -var v = arr.get( 1, 2, 1, 2 ); +let v = arr.get( 1, 2, 1, 2 ); // returns 0.0 // Set an array value: @@ -620,7 +620,7 @@ v = arr.get( 1, 2, 1, 2 ); // returns 10.0 // Serialize the array as a string: -var str = arr.toString(); +let str = arr.toString(); // returns "ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 3, 3, 3, 3 ], [ 27, 9, 3, 1 ], 0, 'row-major' )" // Serialize the array as JSON: diff --git a/lib/node_modules/@stdlib/ndarray/base/data-buffer/README.md b/lib/node_modules/@stdlib/ndarray/base/data-buffer/README.md index 51caeabd1bda..2dcd14937ecb 100644 --- a/lib/node_modules/@stdlib/ndarray/base/data-buffer/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/data-buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var data = require( '@stdlib/ndarray/base/data-buffer' ); +const data = require( '@stdlib/ndarray/base/data-buffer' ); ``` #### data( x ) @@ -45,14 +45,14 @@ var data = require( '@stdlib/ndarray/base/data-buffer' ); Returns the underlying [data buffer][@stdlib/ndarray/base/buffer] of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'dtype': 'float64' }); // returns -var out = data( x ); +const out = data( x ); // returns ``` @@ -77,17 +77,17 @@ var out = data( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var data = require( '@stdlib/ndarray/base/data-buffer' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const data = require( '@stdlib/ndarray/base/data-buffer' ); // Create a 'float64' array... -var opts = { +let opts = { 'dtype': 'float64' }; -var x = zeros( [ 2, 2 ], opts ); +let x = zeros( [ 2, 2 ], opts ); // returns -var buf = data( x ); +let buf = data( x ); // returns // Create a 'float32' array... diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-char/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-char/README.md index e92e05767ac0..d0b3de360451 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-char/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-char/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); +const dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); ``` #### dtypeChar( \[dtype] ) @@ -45,7 +45,7 @@ var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); Returns the single letter character abbreviation for an underlying [array data type][@stdlib/ndarray/dtypes]. ```javascript -var ch = dtypeChar( 'float64' ); +let ch = dtypeChar( 'float64' ); // returns 'd' ch = dtypeChar( 'generic' ); @@ -55,14 +55,14 @@ ch = dtypeChar( 'generic' ); If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var ch = dtypeChar( 'foobar' ); +const ch = dtypeChar( 'foobar' ); // returns null ``` If not provided a [data type][@stdlib/ndarray/dtypes] value, the function returns an object mapping [data type][@stdlib/ndarray/dtypes] strings to single letter character abbreviations. ```javascript -var obj = dtypeChar(); +const obj = dtypeChar(); // returns {...} ``` @@ -87,9 +87,9 @@ var obj = dtypeChar(); ```javascript -var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); +const dtypeChar = require( '@stdlib/ndarray/base/dtype-char' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int8', @@ -104,8 +104,7 @@ var dtypes = [ 'foobar' ]; -var i; -for ( i = 0; i < dtypes.length; i++ ) { +for ( let i = 0; i < dtypes.length; i++ ) { console.log( '%s => %s', dtypes[ i ], dtypeChar( dtypes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-desc/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-desc/README.md index 7fd2bf6b50b7..ed003b8e62ed 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-desc/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-desc/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' ); +const dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' ); ``` #### dtypeDesc( \[dtype] ) @@ -45,7 +45,7 @@ var dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' ); Returns the description for a specified [data type][@stdlib/ndarray/dtypes]. ```javascript -var desc = dtypeDesc( 'float64' ); +let desc = dtypeDesc( 'float64' ); // returns '...' desc = dtypeDesc( 'generic' ); @@ -55,14 +55,14 @@ desc = dtypeDesc( 'generic' ); If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var desc = dtypeDesc( 'foobar' ); +const desc = dtypeDesc( 'foobar' ); // returns null ``` If not provided a [data type][@stdlib/ndarray/dtypes] value, the function returns an object mapping [data type][@stdlib/ndarray/dtypes] strings to descriptions. ```javascript -var obj = dtypeDesc(); +const obj = dtypeDesc(); // returns {...} ``` @@ -87,9 +87,9 @@ var obj = dtypeDesc(); ```javascript -var dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' ); +const dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int8', @@ -104,8 +104,7 @@ var dtypes = [ 'foobar' ]; -var i; -for ( i = 0; i < dtypes.length; i++ ) { +for ( let i = 0; i < dtypes.length; i++ ) { console.log( '%s: %s', dtypes[ i ], dtypeDesc( dtypes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-enum2str/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-enum2str/README.md index 9a8412cb1fe7..497673efd98a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-enum2str/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/ndarray/base/dtype-enum2str' ); +const enum2str = require( '@stdlib/ndarray/base/dtype-enum2str' ); ``` #### enum2str( dtype ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/ndarray/base/dtype-enum2str' ); Returns the data type `string` associated with an ndarray data type enumeration constant. ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var v = str2enum( 'float64' ); +const v = str2enum( 'float64' ); // returns -var dt = enum2str( v ); +const dt = enum2str( v ); // returns 'float64' ``` If unable to resolve a data type `string`, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var enum2str = require( '@stdlib/ndarray/base/dtype-enum2str' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const enum2str = require( '@stdlib/ndarray/base/dtype-enum2str' ); -var str = enum2str( str2enum( 'float64' ) ); +let str = enum2str( str2enum( 'float64' ) ); // returns 'float64' str = enum2str( str2enum( 'float32' ) ); diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-enum/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-enum/README.md index 07ff1977bb44..973983e4b5dc 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/ndarray/base/dtype-resolve-enum' ); +const resolve = require( '@stdlib/ndarray/base/dtype-resolve-enum' ); ``` #### resolve( dtype ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/ndarray/base/dtype-resolve-enum' ); Returns the enumeration constant associated with an ndarray data type value. ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns v = resolve( str2enum( 'float64' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'float64' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/ndarray/base/dtype-resolve-enum' ); +const resolve = require( '@stdlib/ndarray/base/dtype-resolve-enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns v = resolve( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-str/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-str/README.md index f42a64b0d45f..7e65ef690def 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-str/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/ndarray/base/dtype-resolve-str' ); +const resolve = require( '@stdlib/ndarray/base/dtype-resolve-str' ); ``` #### resolve( dtype ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/ndarray/base/dtype-resolve-str' ); Returns the data type string associated with an ndarray data type value. ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns 'float64' v = resolve( str2enum( 'float64' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'float64' ) ); If unable to resolve a data type string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var resolve = require( '@stdlib/ndarray/base/dtype-resolve-str' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const resolve = require( '@stdlib/ndarray/base/dtype-resolve-str' ); -var v = resolve( str2enum( 'float64' ) ); +let v = resolve( str2enum( 'float64' ) ); // returns 'float64' v = resolve( str2enum( 'float32' ) ); diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype-str2enum/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype-str2enum/README.md index 91dfddc13095..ce8a717014fa 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype-str2enum/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); ``` #### str2enum( dtype ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); Returns the enumeration constant associated with an ndarray data type `string`. ```javascript -var v = str2enum( 'float64' ); +const v = str2enum( 'float64' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); -var v = str2enum( 'float64' ); +let v = str2enum( 'float64' ); // returns v = str2enum( 'float32' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype/README.md index 069e4f39da70..9f20441b33ec 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype = require( '@stdlib/ndarray/base/dtype' ); +const dtype = require( '@stdlib/ndarray/base/dtype' ); ``` #### dtype( x ) @@ -45,14 +45,14 @@ var dtype = require( '@stdlib/ndarray/base/dtype' ); Returns the data type of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'dtype': 'float64' }); // returns -var dt = dtype( x ); +const dt = dtype( x ); // returns 'float64' ``` @@ -79,18 +79,18 @@ var dt = dtype( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var dtype = require( '@stdlib/ndarray/base/dtype' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const dtype = require( '@stdlib/ndarray/base/dtype' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -107,11 +107,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Determine the data type for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %s', s.dtype, dtype( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/dtype2c/README.md b/lib/node_modules/@stdlib/ndarray/base/dtype2c/README.md index 2dd27773992b..03fe7603fe48 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtype2c/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtype2c/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); +const dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); ``` #### dtype2c( dtype ) @@ -45,7 +45,7 @@ var dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); Returns the C data type associated with a provided [data type][@stdlib/ndarray/dtypes] value. ```javascript -var out = dtype2c( 'float64' ); +let out = dtype2c( 'float64' ); // returns 'double' out = dtype2c( 'int8' ); @@ -55,7 +55,7 @@ out = dtype2c( 'int8' ); If provided an unknown or unsupported data type, the function returns `null`. ```javascript -var out = dtype2c( 'foobar' ); +const out = dtype2c( 'foobar' ); // returns null ``` @@ -80,9 +80,9 @@ var out = dtype2c( 'foobar' ); ```javascript -var dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); +const dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int8', @@ -97,8 +97,7 @@ var dtypes = [ 'foobar' ]; -var i; -for ( i = 0; i < dtypes.length; i++ ) { +for ( let i = 0; i < dtypes.length; i++ ) { console.log( '%s => %s', dtypes[ i ], dtype2c( dtypes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/dtypes2signatures/README.md b/lib/node_modules/@stdlib/ndarray/base/dtypes2signatures/README.md index 9938b5f62ed4..9abbac4f585a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/dtypes2signatures/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/dtypes2signatures/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); +const dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); ``` #### dtypes2signatures( dtypes, nin, nout ) @@ -45,9 +45,9 @@ var dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); Transforms a list of array argument data types into a list of signatures, where `nin` is the number of input array arguments and `nout` is the number of output array arguments. ```javascript -var dtypes = [ 'float32', 'float64' ]; +const dtypes = [ 'float32', 'float64' ]; -var out = dtypes2signatures( dtypes, 1, 1 ); +let out = dtypes2signatures( dtypes, 1, 1 ); // returns [ '(float32) => (float64)' ] out = dtypes2signatures( dtypes, 2, 0 ); @@ -80,9 +80,9 @@ out = dtypes2signatures( dtypes, 0, 2 ); ```javascript -var dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); +const dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); -var dtypes = [ +const dtypes = [ 'float64', 'float64', 'float64', 'generic', @@ -148,7 +148,7 @@ var dtypes = [ 'uint8c', 'generic' ]; -var sigs = dtypes2signatures( dtypes, 1, 1 ); +const sigs = dtypes2signatures( dtypes, 1, 1 ); console.log( sigs ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/empty-like/README.md b/lib/node_modules/@stdlib/ndarray/base/empty-like/README.md index c73b997624a7..5fc9a0858a67 100644 --- a/lib/node_modules/@stdlib/ndarray/base/empty-like/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/empty-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var emptyLike = require( '@stdlib/ndarray/base/empty-like' ); +const emptyLike = require( '@stdlib/ndarray/base/empty-like' ); ``` #### emptyLike( x ) @@ -45,15 +45,15 @@ var emptyLike = require( '@stdlib/ndarray/base/empty-like' ); Creates an uninitialized ndarray having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. ```javascript -var zeros = require( '@stdlib/ndarray/base/zeros' ); +const zeros = require( '@stdlib/ndarray/base/zeros' ); -var x = zeros( 'float64', [ 2, 2 ], 'row-major' ); +const x = zeros( 'float64', [ 2, 2 ], 'row-major' ); // returns -var y = emptyLike( x ); +const y = emptyLike( x ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] ``` @@ -84,20 +84,16 @@ var sh = y.shape; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var empty = require( '@stdlib/ndarray/base/empty' ); -var emptyLike = require( '@stdlib/ndarray/base/empty-like' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const empty = require( '@stdlib/ndarray/base/empty' ); +const emptyLike = require( '@stdlib/ndarray/base/empty-like' ); // Get a list of data types: -var dt = dtypes(); - -// Generate uninitialized arrays... -var x; -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = empty( dt[ i ], [ 2, 2 ], 'row-major' ); - y = emptyLike( x ); +const dt = dtypes(); + +for ( let i = 0; i < dt.length; i++ ) { + const x = empty( dt[ i ], [ 2, 2 ], 'row-major' ); + const y = emptyLike( x ); console.log( y.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/empty/README.md b/lib/node_modules/@stdlib/ndarray/base/empty/README.md index d3ddcc85e139..799ab887e210 100644 --- a/lib/node_modules/@stdlib/ndarray/base/empty/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/empty/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var empty = require( '@stdlib/ndarray/base/empty' ); +const empty = require( '@stdlib/ndarray/base/empty' ); ``` #### empty( dtype, shape, order ) @@ -45,13 +45,13 @@ var empty = require( '@stdlib/ndarray/base/empty' ); Creates an uninitialized [ndarray][@stdlib/ndarray/base/ctor] having a specified shape and [data type][@stdlib/ndarray/dtypes]. ```javascript -var arr = empty( 'float64', [ 2, 2 ], 'row-major' ); +const arr = empty( 'float64', [ 2, 2 ], 'row-major' ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` @@ -87,17 +87,14 @@ The function accepts the following arguments: ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var empty = require( '@stdlib/ndarray/base/empty' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const empty = require( '@stdlib/ndarray/base/empty' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate uninitialized arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = empty( dt[ i ], [ 2, 2 ], 'row-major' ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = empty( dt[ i ], [ 2, 2 ], 'row-major' ); console.log( arr.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/expand-dimensions/README.md b/lib/node_modules/@stdlib/ndarray/base/expand-dimensions/README.md index 93cefa498433..379e2675e5a2 100644 --- a/lib/node_modules/@stdlib/ndarray/base/expand-dimensions/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/expand-dimensions/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); +const expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); ``` #### expandDimensions( x, axis ) @@ -45,17 +45,17 @@ var expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); Expands the shape of an array `x` by inserting a new dimension of size one at a specified `axis`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Prepend a singleton dimension: -var y = expandDimensions( x, 0 ); +let y = expandDimensions( x, 0 ); // returns -var sh = y.shape; +let sh = y.shape; // returns [ 1, 2, 2 ] // Append a singleton dimension: @@ -98,29 +98,27 @@ sh = y.shape; ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); // Create a 2-dimensional array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Insert a singleton dimension: -var y = expandDimensions( x, 1 ); +const y = expandDimensions( x, 1 ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 2, 1, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/fill/README.md b/lib/node_modules/@stdlib/ndarray/base/fill/README.md index ca0562a73ec0..0fa070883fc8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/fill/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/fill/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var fill = require( '@stdlib/ndarray/base/fill' ); +const fill = require( '@stdlib/ndarray/base/fill' ); ``` #### fill( x, value ) @@ -43,22 +43,22 @@ Fills an input ndarray with a specified value. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create a data buffer: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Define the shape of the input array: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 2, 2, 1 ]; +const sx = [ 2, 2, 1 ]; // Define the index offset: -var ox = 0; +const ox = 0; // Create the input ndarray-like object: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -109,12 +109,12 @@ A provided ndarray should be an object with the following properties: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var fill = require( '@stdlib/ndarray/base/fill' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const fill = require( '@stdlib/ndarray/base/fill' ); -var x = { +const x = { 'dtype': 'generic', 'data': filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ), 'shape': [ 5, 2 ], diff --git a/lib/node_modules/@stdlib/ndarray/base/flag/README.md b/lib/node_modules/@stdlib/ndarray/base/flag/README.md index 3d0ec2ac42b9..65a58acb1368 100644 --- a/lib/node_modules/@stdlib/ndarray/base/flag/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/flag/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flag = require( '@stdlib/ndarray/base/flag' ); +const flag = require( '@stdlib/ndarray/base/flag' ); ``` #### flag( x, name ) @@ -45,12 +45,12 @@ var flag = require( '@stdlib/ndarray/base/flag' ); Returns a specified flag for a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var o = flag( x, 'READONLY' ); +const o = flag( x, 'READONLY' ); // returns ``` @@ -77,18 +77,18 @@ var o = flag( x, 'READONLY' ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var flag = require( '@stdlib/ndarray/base/flag' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const flag = require( '@stdlib/ndarray/base/flag' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -105,11 +105,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Check whether each slice is row-major contiguous... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s', flag( s, 'ROW_MAJOR_CONTIGUOUS' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/flags/README.md b/lib/node_modules/@stdlib/ndarray/base/flags/README.md index 701493606000..5b3cc07cdd91 100644 --- a/lib/node_modules/@stdlib/ndarray/base/flags/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/flags/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flags = require( '@stdlib/ndarray/base/flags' ); +const flags = require( '@stdlib/ndarray/base/flags' ); ``` #### flags( x, copy ) @@ -45,27 +45,27 @@ var flags = require( '@stdlib/ndarray/base/flags' ); Returns the flags of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var o = flags( x, false ); +const o = flags( x, false ); // returns {...} ``` When `copy` is `false`, changes to the returned object may mutate the input [ndarray][@stdlib/ndarray/base/ctor] flags. If there is a chance that the returned object will be mutated (either directly or by downstream consumers), set `copy` to `true` to prevent unintended side effects. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var o = flags( x, true ); +const o = flags( x, true ); // returns {...} -var bool = ( x.flags === o ); +const bool = ( x.flags === o ); // returns false ``` @@ -92,18 +92,18 @@ var bool = ( x.flags === o ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var flags = require( '@stdlib/ndarray/base/flags' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const flags = require( '@stdlib/ndarray/base/flags' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -120,11 +120,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Retrieve the flags for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s', JSON.stringify( flags( s, false ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/fliplr/README.md b/lib/node_modules/@stdlib/ndarray/base/fliplr/README.md index debe13c9a58e..c3cbda916d86 100644 --- a/lib/node_modules/@stdlib/ndarray/base/fliplr/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/fliplr/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fliplr = require( '@stdlib/ndarray/base/fliplr' ); +const fliplr = require( '@stdlib/ndarray/base/fliplr' ); ``` #### fliplr( x, writable ) @@ -45,24 +45,24 @@ var fliplr = require( '@stdlib/ndarray/base/fliplr' ); Returns a view of an input ndarray in which the order of elements along the last dimension is reversed. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = fliplr( x, false ); +const y = fliplr( x, false ); // returns sh = y.shape; @@ -103,24 +103,24 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var fliplr = require( '@stdlib/ndarray/base/fliplr' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const fliplr = require( '@stdlib/ndarray/base/fliplr' ); // Create a linear ndarray buffer: -var buf = zeroTo( 16 ); +const buf = zeroTo( 16 ); // Create a three-dimensional ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 2, 4, 2 ] }); // Reverse the order of last dimension: -var y = fliplr( x, false ); +const y = fliplr( x, false ); // returns -var a = ndarray2array( y ); +const a = ndarray2array( y ); // returns [ [ [ 1, 0 ], [ 3, 2 ], [ 5, 4 ], [ 7, 6 ] ], [ [ 9, 8 ], [ 11, 10 ], [ 13, 12 ], [ 15, 14 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/flipud/README.md b/lib/node_modules/@stdlib/ndarray/base/flipud/README.md index b6b589e6d3a8..9c2b3589de0b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/flipud/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/flipud/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flipud = require( '@stdlib/ndarray/base/flipud' ); +const flipud = require( '@stdlib/ndarray/base/flipud' ); ``` #### flipud( x, writable ) @@ -45,24 +45,24 @@ var flipud = require( '@stdlib/ndarray/base/flipud' ); Returns a view of an input ndarray in which the order of elements along the second-to-last dimension is reversed. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = flipud( x, false ); +const y = flipud( x, false ); // returns sh = y.shape; @@ -103,24 +103,24 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var flipud = require( '@stdlib/ndarray/base/flipud' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const flipud = require( '@stdlib/ndarray/base/flipud' ); // Create a linear ndarray buffer: -var buf = zeroTo( 16 ); +const buf = zeroTo( 16 ); // Create a three-dimensional ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 2, 4, 2 ] }); // Reverse the order of second-to-last dimension: -var y = flipud( x, false ); +const y = flipud( x, false ); // returns -var a = ndarray2array( y ); +const a = ndarray2array( y ); // returns [ [ [ 6, 7 ], [ 4, 5 ], [ 2, 3 ], [ 0, 1 ] ], [ [ 14, 15 ], [ 12, 13 ], [ 10, 11 ], [ 8, 9 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/for-each/README.md b/lib/node_modules/@stdlib/ndarray/base/for-each/README.md index c0fbdee3c13f..3c13538da76d 100644 --- a/lib/node_modules/@stdlib/ndarray/base/for-each/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/for-each/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var forEach = require( '@stdlib/ndarray/base/for-each' ); +const forEach = require( '@stdlib/ndarray/base/for-each' ); ``` #### forEach( arrays, fcn\[, thisArg] ) @@ -41,24 +41,24 @@ var forEach = require( '@stdlib/ndarray/base/for-each' ); Invokes a callback function once for each ndarray element. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var log = require( '@stdlib/console/log' ); +const Float64Array = require( '@stdlib/array/float64' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const log = require( '@stdlib/console/log' ); // Create data buffers: -var xbuf = new Float64Array( 12 ); +const xbuf = new Float64Array( 12 ); // Define the shape of the array: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; +const sx = [ 4, 4, 1 ]; // Define the index offset: -var ox = 1; +const ox = 1; // Create an ndarray-like object: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -113,13 +113,13 @@ The callback function is provided the following arguments: ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var log = require( '@stdlib/console/log' ); -var forEach = require( '@stdlib/ndarray/base/for-each' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const log = require( '@stdlib/console/log' ); +const forEach = require( '@stdlib/ndarray/base/for-each' ); -var x = { +let x = { 'dtype': 'generic', 'data': zeroTo( 10 ), 'shape': [ 5, 2 ], diff --git a/lib/node_modules/@stdlib/ndarray/base/from-scalar/README.md b/lib/node_modules/@stdlib/ndarray/base/from-scalar/README.md index 31c1fff6baef..20459b03c386 100644 --- a/lib/node_modules/@stdlib/ndarray/base/from-scalar/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/from-scalar/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); +const scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); ``` #### scalar2ndarray( value, dtype, order ) @@ -45,16 +45,16 @@ var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); Returns a zero-dimensional [`ndarray`][@stdlib/ndarray/base/ctor] containing a provided scalar `value` and having a specified [data type][@stdlib/ndarray/dtypes]. ```javascript -var x = scalar2ndarray( 1.0, 'float64', 'row-major' ); +const x = scalar2ndarray( 1.0, 'float64', 'row-major' ); // returns -var sh = x.shape; +const sh = x.shape; // returns [] -var dt = x.dtype; +const dt = x.dtype; // returns 'float64' -var v = x.get(); +const v = x.get(); // returns 1.0 ``` @@ -83,17 +83,14 @@ var v = x.get(); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); -// Generate zero-dimensional arrays... -var x; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = scalar2ndarray( i, dt[ i ], 'row-major' ); +for ( let i = 0; i < dt.length; i++ ) { + const x = scalar2ndarray( i, dt[ i ], 'row-major' ); console.log( x.get() ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/function-object/README.md b/lib/node_modules/@stdlib/ndarray/base/function-object/README.md index 4ca9f09301ee..f662437f34f8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/function-object/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/function-object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/ndarray/base/function-object' ); +const headerDir = require( '@stdlib/ndarray/base/function-object' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/ndarray/base/function-object' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/ndarray/base/function-object' ); +const headerDir = require( '@stdlib/ndarray/base/function-object' ); console.log( headerDir ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/ind/README.md b/lib/node_modules/@stdlib/ndarray/base/ind/README.md index 19c263e9f962..9239e4b7b554 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ind/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ind/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ind = require( '@stdlib/ndarray/base/ind' ); +const ind = require( '@stdlib/ndarray/base/ind' ); ``` #### ind( idx, max, mode ) @@ -47,7 +47,7 @@ Returns an index given an index `mode`. ```javascript -var idx = ind( 2, 9, 'throw' ); +let idx = ind( 2, 9, 'throw' ); // returns 2 idx = ind( -1, 9, 'throw' ); @@ -89,9 +89,9 @@ idx = ind( -4, 9, 'normalize' ); Returns a function for returning an index according to a provided index `mode`. ```javascript -var fcn = ind.factory( 'clamp' ); +const fcn = ind.factory( 'clamp' ); -var idx = fcn( 2, 9 ); +let idx = fcn( 2, 9 ); // returns 2 idx = fcn( 10, 9 ); @@ -136,21 +136,15 @@ The function returns a function accepts the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var ind = require( '@stdlib/ndarray/base/ind' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const ind = require( '@stdlib/ndarray/base/ind' ); -var modes; -var mode; -var idx; -var out; -var i; +const modes = [ 'clamp', 'wrap' ]; -modes = [ 'clamp', 'wrap' ]; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( -20, 20 ); - mode = modes[ discreteUniform( 0, modes.length-1 ) ]; - out = ind( idx, 9, mode ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( -20, 20 ); + const mode = modes[ discreteUniform( 0, modes.length-1 ) ]; + const out = ind( idx, 9, mode ); console.log( '%d => %s(%d,%d) => %d', idx, mode, 0, 9, out ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/ind2sub/README.md b/lib/node_modules/@stdlib/ndarray/base/ind2sub/README.md index 00b8a7ad194c..a43fa3e2f6ab 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ind2sub/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ind2sub/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ind2sub = require( '@stdlib/ndarray/base/ind2sub' ); +const ind2sub = require( '@stdlib/ndarray/base/ind2sub' ); ``` #### ind2sub( shape, strides, offset, order, idx, mode ) @@ -45,12 +45,12 @@ var ind2sub = require( '@stdlib/ndarray/base/ind2sub' ); Converts a linear index to an array of subscripts. ```javascript -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; -var subscripts = ind2sub( shape, strides, offset, order, 1, 'throw' ); +const subscripts = ind2sub( shape, strides, offset, order, 1, 'throw' ); // returns [ 0, 1 ] ``` @@ -62,12 +62,12 @@ The function supports the following modes: - **clamp**: specifies that the function should set a linear index exceeding array dimensions to either `0` (minimum linear index) or the maximum linear index. ```javascript -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; -var idx = ind2sub( shape, strides, offset, order, -2, 'wrap' ); +let idx = ind2sub( shape, strides, offset, order, -2, 'wrap' ); // returns [ 1, 0 ] idx = ind2sub( shape, strides, offset, order, 10, 'clamp' ); @@ -77,12 +77,12 @@ idx = ind2sub( shape, strides, offset, order, 10, 'clamp' ); The `order` parameter specifies whether an array is `row-major` (C-style) or `column-major` (Fortran-style). ```javascript -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, 2 ]; -var offset = 0; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, 2 ]; +const offset = 0; -var idx = ind2sub( shape, strides, offset, order, 2, 'throw' ); +const idx = ind2sub( shape, strides, offset, order, 2, 'throw' ); // returns [ 0, 1 ] ``` @@ -91,16 +91,16 @@ var idx = ind2sub( shape, strides, offset, order, 2, 'throw' ); Converts a linear index to an array of subscripts and assigns results to a provided output array. ```javascript -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; -var out = [ 0, 0 ]; -var subscripts = ind2sub.assign( shape, strides, offset, order, 1, 'throw', out ); +const out = [ 0, 0 ]; +const subscripts = ind2sub.assign( shape, strides, offset, order, 1, 'throw', out ); // returns [ 0, 1 ] -var bool = ( subscripts === out ); +const bool = ( subscripts === out ); // returns true ``` @@ -149,14 +149,14 @@ var bool = ( subscripts === out ); ``` ```javascript - var shape = [ 2, 2 ]; - var order = 'row-major'; - var strides = [ -2, 1 ]; - var offset = 2; - var mode = 'throw'; + const shape = [ 2, 2 ]; + const order = 'row-major'; + const strides = [ -2, 1 ]; + const offset = 2; + const mode = 'throw'; // From the perspective of a view... - var s = ind2sub( shape, strides, 0, order, 0, mode ); + let s = ind2sub( shape, strides, 0, order, 0, mode ); // returns [ 0, 0 ] s = ind2sub( shape, strides, 0, order, 1, mode ); @@ -197,26 +197,26 @@ var bool = ( subscripts === out ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var randu = require( '@stdlib/random/base/randu' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var ind2sub = require( '@stdlib/ndarray/base/ind2sub' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const randu = require( '@stdlib/random/base/randu' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const ind2sub = require( '@stdlib/ndarray/base/ind2sub' ); // Specify array characteristics: -var shape = [ 3, 3, 3 ]; -var order = 'row-major'; +const shape = [ 3, 3, 3 ]; +const order = 'row-major'; // Compute array meta data: -var ndims = shape.length; -var strides = shape2strides( shape, order ); -var len = numel( shape ); +const ndims = shape.length; +const strides = shape2strides( shape, order ); +const len = numel( shape ); // Determine stride indices to be used for formatting how views are displayed... -var s0; -var s1; +let s0; +let s1; if ( order === 'column-major' ) { s0 = ndims - 1; s1 = s0 - 1; @@ -226,22 +226,17 @@ if ( order === 'column-major' ) { } // Initialize a linear array... -var arr = []; -var i; -for ( i = 0; i < len; i++ ) { +const arr = []; +for ( let i = 0; i < len; i++ ) { arr.push( 0 ); } // Generate random views and display the mapping of elements in the linear array to view subscripts... -var offset; -var row; -var j; -var s; -for ( i = 0; i < 20; i++ ) { +for ( let i = 0; i < 20; i++ ) { // Randomly flip the sign of one of the strides... - j = discreteUniform( 0, ndims-1 ); + const j = discreteUniform( 0, ndims-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); // Print view meta data... console.log( '' ); @@ -250,9 +245,9 @@ for ( i = 0; i < 20; i++ ) { console.log( 'View (subscripts):' ); // Print the mapping of elements in the linear array to view subscripts... - row = ' '; - for ( j = 0; j < len; j++ ) { - s = ind2sub( shape, strides, offset, order, j, 'throw' ); + let row = ' '; + for ( let j = 0; j < len; j++ ) { + const s = ind2sub( shape, strides, offset, order, j, 'throw' ); row += '(' + s.join( ',' ) + ')'; if ( ndims === 1 && j === len-1 ) { console.log( row ); diff --git a/lib/node_modules/@stdlib/ndarray/base/iteration-order/README.md b/lib/node_modules/@stdlib/ndarray/base/iteration-order/README.md index 7e2d9e67127d..3a2d6b089012 100644 --- a/lib/node_modules/@stdlib/ndarray/base/iteration-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/iteration-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ); +const iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ); ``` #### iterationOrder( strides ) @@ -45,7 +45,7 @@ var iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ); Returns the array iteration order. ```javascript -var o = iterationOrder( [ 2, 1 ] ); +let o = iterationOrder( [ 2, 1 ] ); // returns 1 o = iterationOrder( [ -2, 1 ] ); @@ -82,28 +82,22 @@ The function returns one of the following values: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var randu = require( '@stdlib/random/base/randu' ); -var iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ); - -var strides; -var shape; -var out; -var i; -var j; - -shape = [ 0, 0, 0 ]; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const randu = require( '@stdlib/random/base/randu' ); +const iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ); + +const shape = [ 0, 0, 0 ]; shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); -strides = shape2strides( shape, 'row-major' ); +const strides = shape2strides( shape, 'row-major' ); -for ( i = 0; i < 100; i++ ) { - j = discreteUniform( 0, shape.length-1 ); +for ( let i = 0; i < 100; i++ ) { + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; - out = iterationOrder( strides ); + const out = iterationOrder( strides ); console.log( 'strides: %s => %d', strides.join( ',' ), out ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/map/README.md b/lib/node_modules/@stdlib/ndarray/base/map/README.md index 6e7b4756708a..19b8690d9e54 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/map/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var map = require( '@stdlib/ndarray/base/map' ); +const map = require( '@stdlib/ndarray/base/map' ); ``` #### map( arrays, fcn\[, thisArg] ) @@ -41,29 +41,29 @@ var map = require( '@stdlib/ndarray/base/map' ); Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( x ) { return x * 10.0; } // Create data buffers: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var ybuf = new Float64Array( 6 ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: -var shape = [ 3, 2 ]; +const shape = [ 3, 2 ]; // Define the array strides: -var sx = [ 2, 1 ]; -var sy = [ 2, 1 ]; +const sx = [ 2, 1 ]; +const sy = [ 2, 1 ]; // Define the index offsets: -var ox = 0; -var oy = 0; +const ox = 0; +const oy = 0; // Create the input and output ndarray-like objects: -var x = { +const x = { 'ref': null, 'dtype': 'float64', 'data': xbuf, @@ -72,7 +72,7 @@ var x = { 'offset': ox, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -130,17 +130,17 @@ The callback function is provided the following arguments: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var map = require( '@stdlib/ndarray/base/map' ); - -var N = 10; -var x = { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const map = require( '@stdlib/ndarray/base/map' ); + +const N = 10; +const x = { 'dtype': 'generic', 'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ), 'shape': [ 5, 2 ], @@ -148,7 +148,7 @@ var x = { 'offset': 0, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'generic', 'data': filledarray( 0, N, 'generic' ), 'shape': x.shape.slice(), diff --git a/lib/node_modules/@stdlib/ndarray/base/max-view-buffer-index/README.md b/lib/node_modules/@stdlib/ndarray/base/max-view-buffer-index/README.md index 4156a1a5c8d1..78be61e76d94 100644 --- a/lib/node_modules/@stdlib/ndarray/base/max-view-buffer-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/max-view-buffer-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxViewBufferIndex = require( '@stdlib/ndarray/base/max-view-buffer-index' ); +const maxViewBufferIndex = require( '@stdlib/ndarray/base/max-view-buffer-index' ); ``` #### maxViewBufferIndex( shape, strides, offset ) @@ -46,15 +46,15 @@ Computes the maximum linear index in an underlying data buffer accessible to an ```javascript // Array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Stride array: -var strides = [ 2, 1 ]; +const strides = [ 2, 1 ]; // Index offset which specifies the location of the first indexed value: -var offset = 0; +const offset = 0; -var idx = maxViewBufferIndex( shape, strides, offset ); +const idx = maxViewBufferIndex( shape, strides, offset ); // returns 3 ``` @@ -79,41 +79,35 @@ var idx = maxViewBufferIndex( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var maxViewBufferIndex = require( '@stdlib/ndarray/base/max-view-buffer-index' ); - -var strides; -var offset; -var shape; -var idx; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const maxViewBufferIndex = require( '@stdlib/ndarray/base/max-view-buffer-index' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; // Compute the index offset: - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); // Compute the maximum linear index: - idx = maxViewBufferIndex( shape, strides, offset ); + const idx = maxViewBufferIndex( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Max idx: %d.', shape.join( 'x' ), strides.join( ',' ), offset, idx ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-array/README.md b/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-array/README.md index 0f8a15c0c73a..3fcb63a17f39 100644 --- a/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' ); +const maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' ); ``` #### maybeBroadcastArray( arr, shape ) @@ -45,14 +45,14 @@ var maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' Broadcasts an [ndarray][@stdlib/ndarray/base/ctor] to a specified `shape` if and only if the specified `shape` differs from the provided [ndarray][@stdlib/ndarray/base/ctor]'s shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast to a 2x2x2 ndarray: -var y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); +const y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); // returns ``` @@ -84,29 +84,27 @@ var y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast the array to 3x2x2: -var y = maybeBroadcastArray( x, [ 3, 2, 2 ] ); +const y = maybeBroadcastArray( x, [ 3, 2, 2 ] ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-arrays/README.md b/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-arrays/README.md index e18c5accfaeb..8b29651dab42 100644 --- a/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-arrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/maybe-broadcast-arrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maybeBroadcastArrays = require( '@stdlib/ndarray/base/maybe-broadcast-arrays' ); +const maybeBroadcastArrays = require( '@stdlib/ndarray/base/maybe-broadcast-arrays' ); ``` #### maybeBroadcastArrays( arrays ) @@ -45,19 +45,19 @@ var maybeBroadcastArrays = require( '@stdlib/ndarray/base/maybe-broadcast-arrays Broadcasts [ndarrays][@stdlib/ndarray/base/ctor] to a common shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = maybeBroadcastArrays( [ x, y ] ); +const out = maybeBroadcastArrays( [ x, y ] ); // returns [ , ] ``` @@ -89,34 +89,32 @@ var out = maybeBroadcastArrays( [ x, y ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var maybeBroadcastArrays = require( '@stdlib/ndarray/base/maybe-broadcast-arrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const maybeBroadcastArrays = require( '@stdlib/ndarray/base/maybe-broadcast-arrays' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 3x2x2 array: -var y = zeros( [ 3, 2, 2 ] ); +const y = zeros( [ 3, 2, 2 ] ); // returns // Broadcast arrays to a common shape: -var out = maybeBroadcastArrays( [ x, y ] ); +const out = maybeBroadcastArrays( [ x, y ] ); // returns // Retrieve the common shape: -var sh = out[ 0 ].shape; +const sh = out[ 0 ].shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'X[%s] = %d', ind2sub( sh, i ).join( ', ' ), out[ 0 ].iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/meta-data-props/README.md b/lib/node_modules/@stdlib/ndarray/base/meta-data-props/README.md index 1f2c1650d9ed..c623d79fbff6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/meta-data-props/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/meta-data-props/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var setProps = require( '@stdlib/ndarray/base/meta-data-props' ); +const setProps = require( '@stdlib/ndarray/base/meta-data-props' ); ``` #### setProps( meta, dtypes, obj ) @@ -48,19 +48,19 @@ Defines non-enumerable read-only properties which expose ndarray function meta d ```javascript // Define ndarray function meta data: -var meta = { +const meta = { 'nargs': 2, 'nin': 1, 'nout': 1 }; // Define the list of ndarray data types: -var dtypes = [ +const dtypes = [ 'float64', 'float64' ]; // Define an object/function on which to set the properties: -var obj = {}; +const obj = {}; // Set the properties: setProps( meta, dtypes, obj ); @@ -95,39 +95,39 @@ The `meta` data argument should be an `object` with the following properties: ```javascript -var setProps = require( '@stdlib/ndarray/base/meta-data-props' ); +const setProps = require( '@stdlib/ndarray/base/meta-data-props' ); // Define ndarray function meta data: -var meta = { +const meta = { 'nargs': 2, 'nin': 1, 'nout': 1 }; // Define the list of ndarray data types: -var types = [ +const types = [ 'float64', 'float64', 'float32', 'float32', 'generic', 'generic' ]; // Define an object/function on which to set the properties: -var obj = {}; +const obj = {}; // Set the properties: setProps( meta, types, obj ); // Retrieve ndarray function data... -var nargs = obj.nargs; +const nargs = obj.nargs; // returns 2 -var nin = obj.nin; +const nin = obj.nin; // returns 1 -var nout = obj.nout; +const nout = obj.nout; // returns 1 -var sigs = obj.types; +const sigs = obj.types; // returns [...] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/min-view-buffer-index/README.md b/lib/node_modules/@stdlib/ndarray/base/min-view-buffer-index/README.md index 7cba91cc951b..336b425c06ba 100644 --- a/lib/node_modules/@stdlib/ndarray/base/min-view-buffer-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/min-view-buffer-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minViewBufferIndex = require( '@stdlib/ndarray/base/min-view-buffer-index' ); +const minViewBufferIndex = require( '@stdlib/ndarray/base/min-view-buffer-index' ); ``` #### minViewBufferIndex( shape, strides, offset ) @@ -46,15 +46,15 @@ Computes the minimum linear index in an underlying data buffer accessible to an ```javascript // Array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Stride array: -var strides = [ -2, -1 ]; +const strides = [ -2, -1 ]; // Index offset which specifies the location of the first indexed value: -var offset = 13; // includes a view offset +const offset = 13; // includes a view offset -var idx = minViewBufferIndex( shape, strides, offset ); +const idx = minViewBufferIndex( shape, strides, offset ); // returns 10 ``` @@ -79,41 +79,35 @@ var idx = minViewBufferIndex( shape, strides, offset ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var minViewBufferIndex = require( '@stdlib/ndarray/base/min-view-buffer-index' ); - -var strides; -var offset; -var shape; -var idx; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const minViewBufferIndex = require( '@stdlib/ndarray/base/min-view-buffer-index' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; // Compute the index offset: - offset = strides2offset( shape, strides ) + 25; // include view offset + const offset = strides2offset( shape, strides ) + 25; // include view offset // Compute the minimum linear index: - idx = minViewBufferIndex( shape, strides, offset ); + const idx = minViewBufferIndex( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Min idx: %d.', shape.join( 'x' ), strides.join( ',' ), offset, idx ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/README.md b/lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/README.md index b2a6291ea397..45833a6522eb 100644 --- a/lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/minmax-view-buffer-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' ); +const minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' ); ``` #### minmaxViewBufferIndex( shape, strides, offset ) @@ -46,15 +46,15 @@ Computes the minimum and maximum linear indices in an underlying data buffer whi ```javascript // Array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Stride array: -var strides = [ 2, 1 ]; +const strides = [ 2, 1 ]; // Index offset which specifies the location of the first indexed value: -var offset = 0; +const offset = 0; -var idx = minmaxViewBufferIndex( shape, strides, offset ); +const idx = minmaxViewBufferIndex( shape, strides, offset ); // returns [ 0, 3 ] ``` @@ -63,15 +63,15 @@ var idx = minmaxViewBufferIndex( shape, strides, offset ); Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view and assigns results to a provided output array. ```javascript -var shape = [ 2, 2 ]; -var strides = [ -1, -2 ]; -var offset = 3; +const shape = [ 2, 2 ]; +const strides = [ -1, -2 ]; +const offset = 3; -var out = [ 0, 0 ]; -var idx = minmaxViewBufferIndex.assign( shape, strides, offset, out ); +const out = [ 0, 0 ]; +const idx = minmaxViewBufferIndex.assign( shape, strides, offset, out ); // returns [ 0, 3 ] -var bool = ( idx === out ); +const bool = ( idx === out ); // returns true ``` @@ -96,41 +96,35 @@ var bool = ( idx === out ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var randu = require( '@stdlib/random/base/randu' ); -var minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' ); - -var strides; -var offset; -var shape; -var idx; -var i; -var j; - -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 100; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const randu = require( '@stdlib/random/base/randu' ); +const minmaxViewBufferIndex = require( '@stdlib/ndarray/base/minmax-view-buffer-index' ); + +const shape = [ 0, 0, 0 ]; + +for ( let i = 0; i < 100; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Generate strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; // Compute the index offset: - offset = strides2offset( shape, strides ) + 25; // include a view offset + const offset = strides2offset( shape, strides ) + 25; // include a view offset // Compute the minimum and maximum linear indices: - idx = minmaxViewBufferIndex( shape, strides, offset ); + const idx = minmaxViewBufferIndex( shape, strides, offset ); console.log( 'Shape: %s. Strides: %s. Offset: %d. Min idx: %d. Max idx: %d.', shape.join( 'x' ), strides.join( ',' ), offset, idx[ 0 ], idx[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/napi/README.md b/lib/node_modules/@stdlib/ndarray/base/napi/README.md index 6fc5e10b3162..38a89301d80a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/napi/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/napi/README.md @@ -39,7 +39,7 @@ This package exposes an absolute file path for the directory containing header f ## Usage ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi' ); +const headerDir = require( '@stdlib/ndarray/base/napi' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/ndarray/base/napi' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi' ); +const headerDir = require( '@stdlib/ndarray/base/napi' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/ndarray/base/napi/addon-arguments/README.md b/lib/node_modules/@stdlib/ndarray/base/napi/addon-arguments/README.md index a0e7e875f61b..bc27ac8283c0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/napi/addon-arguments/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/napi/addon-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi/addon-arguments' ); +const headerDir = require( '@stdlib/ndarray/base/napi/addon-arguments' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/ndarray/base/napi/addon-arguments' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi/addon-arguments' ); +const headerDir = require( '@stdlib/ndarray/base/napi/addon-arguments' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/ndarray/base/napi/unary/README.md b/lib/node_modules/@stdlib/ndarray/base/napi/unary/README.md index 6cda710acb9b..66315941a7f3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/napi/unary/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/napi/unary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi/unary' ); +const headerDir = require( '@stdlib/ndarray/base/napi/unary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/ndarray/base/napi/unary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/ndarray/base/napi/unary' ); +const headerDir = require( '@stdlib/ndarray/base/napi/unary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2ndarray/README.md b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2ndarray/README.md index 9dbf1f566866..9b078f38cdce 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2ndarray/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2ndarray/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' ); +const ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' ); ``` #### ndarraylike2ndarray( x ) @@ -45,10 +45,10 @@ var ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' ); Converts an ndarray-like object to an [`ndarray`][@stdlib/ndarray/base/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var out = ndarraylike2ndarray( arr ); +const arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const out = ndarraylike2ndarray( arr ); // returns ``` @@ -73,14 +73,14 @@ var out = ndarraylike2ndarray( arr ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' ); // Create an ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // Convert to a "base" ndarray: -var out = ndarraylike2ndarray( x ); +const out = ndarraylike2ndarray( x ); // returns // Print various properties: diff --git a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2object/README.md b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2object/README.md index 2904291d9288..3352f0eb80df 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2object/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' ); +const ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' ); ``` #### ndarraylike2object( x ) @@ -45,10 +45,10 @@ var ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' ); Converts an [`ndarray`][@stdlib/ndarray/ctor]-like object to an object likely to have the same "shape". ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var obj = ndarraylike2object( arr ); +const arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const obj = ndarraylike2object( arr ); // returns {...} ``` @@ -101,14 +101,14 @@ var obj = ndarraylike2object( arr ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' ); // Create an ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // Convert to a standardized object: -var obj = ndarraylike2object( x ); +const obj = ndarraylike2object( x ); // returns {...} // Print various properties: diff --git a/lib/node_modules/@stdlib/ndarray/base/ndims/README.md b/lib/node_modules/@stdlib/ndarray/base/ndims/README.md index bf7472bc546c..a56de3b7a3a8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ndims/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ndims/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndims = require( '@stdlib/ndarray/base/ndims' ); +const ndims = require( '@stdlib/ndarray/base/ndims' ); ``` #### ndims( x ) @@ -45,12 +45,12 @@ var ndims = require( '@stdlib/ndarray/base/ndims' ); Returns the number of [ndarray][@stdlib/ndarray/base/ctor] dimensions. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var n = ndims( x ); +const n = ndims( x ); // returns 3 ``` @@ -77,18 +77,18 @@ var n = ndims( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var ndims = require( '@stdlib/ndarray/base/ndims' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const ndims = require( '@stdlib/ndarray/base/ndims' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -105,11 +105,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Determine the number of dimensions in each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %d dimensions', s.shape.join( 'x' ), ndims( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/next-cartesian-index/README.md b/lib/node_modules/@stdlib/ndarray/base/next-cartesian-index/README.md index dfce526dd659..04663dadcf14 100644 --- a/lib/node_modules/@stdlib/ndarray/base/next-cartesian-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/next-cartesian-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' ); +const nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' ); ``` #### nextCartesianIndex( shape, order, idx, dim ) @@ -45,7 +45,7 @@ var nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' ); Returns the next Cartesian index (i.e., set of subscripts/dimension indices). ```javascript -var idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', [ 0, 0, 1 ], -1 ); +const idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', [ 0, 0, 1 ], -1 ); // returns [ 0, 1, 0 ] ``` @@ -59,7 +59,7 @@ The function accepts the following arguments: The `order` parameter specifies the index iteration order. When `order` is `row-major`, the last indices change fastest, and, when the `order` is `column-major`, the first indices change fastest. ```javascript -var idx = nextCartesianIndex( [ 2, 2, 2 ], 'column-major', [ 0, 1, 0 ], 0 ); +const idx = nextCartesianIndex( [ 2, 2, 2 ], 'column-major', [ 0, 1, 0 ], 0 ); // returns [ 1, 1, 0 ] ``` @@ -67,7 +67,7 @@ The `dim` parameter controls which dimensions are incremented. When `order` is ` ```javascript // Increment starting from the second-to-last dimension: -var idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', [ 0, 0, 0 ], -2 ); +let idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', [ 0, 0, 0 ], -2 ); // returns [ 0, 1, 0 ] idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', idx, -2 ); @@ -82,11 +82,11 @@ idx = nextCartesianIndex( [ 2, 2, 2 ], 'row-major', idx, -2 ); Returns the next Cartesian index (i.e., set of subscripts/dimension indices) and assigns results to a provided output array. ```javascript -var out = [ 0, 0, 0 ]; -var idx = nextCartesianIndex.assign( [ 2, 2, 2 ], 'row-major', [ 0, 0, 1 ], -1, out ); +const out = [ 0, 0, 0 ]; +const idx = nextCartesianIndex.assign( [ 2, 2, 2 ], 'row-major', [ 0, 0, 1 ], -1, out ); // returns [ 0, 1, 0 ] -var bool = ( out === idx ); +const bool = ( out === idx ); // returns true ``` @@ -124,21 +124,20 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' ); // Create an ndarray: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Initialize a set of indices: -var idx = [ 0, 0, 0 ]; +let idx = [ 0, 0, 0 ]; // Iterate over each element in the array... -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { console.log( 'x[%s] = %d', idx.join( ',' ), x.get.apply( x, idx ) ); idx = nextCartesianIndex.assign( x.shape, x.order, idx, -1, idx ); } diff --git a/lib/node_modules/@stdlib/ndarray/base/nonsingleton-dimensions/README.md b/lib/node_modules/@stdlib/ndarray/base/nonsingleton-dimensions/README.md index 57897edc01d6..0c94273e0ab5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nonsingleton-dimensions/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nonsingleton-dimensions/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensions' ); +const nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensions' ); ``` #### nonsingletonDimensions( shape ) @@ -45,7 +45,7 @@ var nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensi Returns the number of non-singleton dimensions. ```javascript -var n = nonsingletonDimensions( [ 3, 1, 3 ] ); +const n = nonsingletonDimensions( [ 3, 1, 3 ] ); // returns 2 ``` @@ -74,19 +74,15 @@ var n = nonsingletonDimensions( [ 3, 1, 3 ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensions' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensions' ); -var shape; -var n; -var i; - -shape = [ 0, 0, 0 ]; -for ( i = 0; i < 100; i++ ) { +const shape = [ 0, 0, 0 ]; +for ( let i = 0; i < 100; i++ ) { shape[ 0 ] = discreteUniform( 1, 5 ); shape[ 1 ] = discreteUniform( 1, 5 ); shape[ 2 ] = discreteUniform( 1, 5 ); - n = nonsingletonDimensions( shape ); + const n = nonsingletonDimensions( shape ); console.log( 'shape: %s. non-singleton dimensions: %d.', shape.join( 'x' ), n ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/normalize-index/README.md b/lib/node_modules/@stdlib/ndarray/base/normalize-index/README.md index 867002ff126f..266eb77d8ee8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/normalize-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/normalize-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' ); +const normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' ); ``` #### normalizeIndex( idx, max ) @@ -45,7 +45,7 @@ var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' ); Normalizes an index to the interval `[0,max]`. ```javascript -var idx = normalizeIndex( 2, 10 ); +let idx = normalizeIndex( 2, 10 ); // returns 2 idx = normalizeIndex( -5, 10 ); @@ -55,7 +55,7 @@ idx = normalizeIndex( -5, 10 ); If provided an out-of-bounds index, the function returns `-1`. ```javascript -var idx = normalizeIndex( 15, 10 ); +let idx = normalizeIndex( 15, 10 ); // returns -1 idx = normalizeIndex( -15, 10 ); @@ -83,16 +83,12 @@ idx = normalizeIndex( -15, 10 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' ); -var idx; -var out; -var i; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( -20, 20 ); - out = normalizeIndex( idx, 15 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( -20, 20 ); + const out = normalizeIndex( idx, 15 ); console.log( '%d => [%d,%d] => %d', idx, 0, 15, out ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary-loop-interchange-order/README.md index 3821626e3136..c6ab9c811ca3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nullary-loop-interchange-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nullaryLoopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); +const nullaryLoopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); ``` #### nullaryLoopOrder( shape, stridesX ) @@ -46,13 +46,13 @@ Reorders [ndarray][@stdlib/ndarray/ctor] dimensions and associated strides for [ ```javascript // Define an array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Define array strides: -var stridesX = [ 2, 1 ]; // row-major +const stridesX = [ 2, 1 ]; // row-major // Resolve the loop interchange order: -var o = nullaryLoopOrder( shape, stridesX ); +const o = nullaryLoopOrder( shape, stridesX ); // returns {...} ``` @@ -91,14 +91,14 @@ For all returned arrays, the first element corresponds to the innermost loop, an ```javascript -var array = require( '@stdlib/ndarray/array' ); -var loopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); +const array = require( '@stdlib/ndarray/array' ); +const loopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); // Create an ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // Resolve loop interchange data: -var o = loopOrder( x.shape, x.strides ); +const o = loopOrder( x.shape, x.strides ); // returns {...} console.log( o ); diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-tiling-block-size/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary-tiling-block-size/README.md index c9cb8344720e..3c88d4354539 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary-tiling-block-size/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nullary-tiling-block-size/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +const nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); ``` #### nullaryBlockSize( dtypeX ) @@ -45,7 +45,7 @@ var nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' Resolves a loop block size according to provided ndarray [dtypes][@stdlib/ndarray/dtypes] for multi-dimensional array tiled loops applying a nullary function. ```javascript -var bsize = nullaryBlockSize( 'float64' ); +const bsize = nullaryBlockSize( 'float64' ); // returns ``` @@ -74,18 +74,15 @@ var bsize = nullaryBlockSize( 'float64' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); // Get the list of ndarray dtypes: -var dt = dtypes(); +const dt = dtypes(); -// Resolve the block size for each dtype... -var b; -var i; console.log( 'block_size, xdtype' ); -for ( i = 0; i < dt.length; i++ ) { - b = nullaryBlockSize( dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const b = nullaryBlockSize( dt[ i ] ); console.log( '%d, %s', b, dt[ i ] ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md index f0b5023ed2bc..6e38c0949122 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nullary = require( '@stdlib/ndarray/base/nullary' ); +const nullary = require( '@stdlib/ndarray/base/nullary' ); ``` #### nullary( arrays, fcn ) @@ -43,26 +43,26 @@ Applies a nullary callback and assigns results to elements in an output ndarray. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fcn() { return 10.0; } // Create data buffers: -var xbuf = new Float64Array( 12 ); +const xbuf = new Float64Array( 12 ); // Define the shape of the output array: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; +const sx = [ 4, 4, 1 ]; // Define the index offset: -var ox = 1; +const ox = 1; // Create the output ndarray-like object: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -113,12 +113,12 @@ The provided ndarray should be an `object` with the following properties: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var nullary = require( '@stdlib/ndarray/base/nullary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const nullary = require( '@stdlib/ndarray/base/nullary' ); -var x = { +const x = { 'dtype': 'generic', 'data': filledarray( 0, 10, 'generic' ), 'shape': [ 5, 2 ], diff --git a/lib/node_modules/@stdlib/ndarray/base/numel-dimension/README.md b/lib/node_modules/@stdlib/ndarray/base/numel-dimension/README.md index f33a2dc33a33..f91c5534b692 100644 --- a/lib/node_modules/@stdlib/ndarray/base/numel-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/numel-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +const numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); ``` #### numelDimension( x, dim ) @@ -45,12 +45,12 @@ var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); Returns the size (i.e., number of elements) of a specified dimension for a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 4, 2, 3 ] ); +const x = zeros( [ 4, 2, 3 ] ); // returns -var d = numelDimension( x, 0 ); +const d = numelDimension( x, 0 ); // returns 4 ``` @@ -82,18 +82,18 @@ The function accepts the following arguments: ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -111,10 +111,8 @@ var slices = [ ]; // Resolve the size of the first dimension for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => %d', s.shape.join( ',' ), numelDimension( s, 0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/numel/README.md b/lib/node_modules/@stdlib/ndarray/base/numel/README.md index 3c158a6cd153..a7afb1db0e57 100644 --- a/lib/node_modules/@stdlib/ndarray/base/numel/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/numel/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var numel = require( '@stdlib/ndarray/base/numel' ); +const numel = require( '@stdlib/ndarray/base/numel' ); ``` #### numel( shape ) @@ -45,7 +45,7 @@ var numel = require( '@stdlib/ndarray/base/numel' ); Returns the number of elements in an array. ```javascript -var n = numel( [ 3, 2, 3 ] ); +const n = numel( [ 3, 2, 3 ] ); // returns 18 ``` @@ -70,21 +70,17 @@ var n = numel( [ 3, 2, 3 ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var numel = require( '@stdlib/ndarray/base/numel' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const numel = require( '@stdlib/ndarray/base/numel' ); -var shape; -var n; -var i; - -shape = [ 0, 0, 0 ]; -for ( i = 0; i < 100; i++ ) { +const shape = [ 0, 0, 0 ]; +for ( let i = 0; i < 100; i++ ) { // Generate random NxMxL dimensions: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 2, 7 ); shape[ 2 ] = discreteUniform( 1, 12 ); - n = numel( shape ); + const n = numel( shape ); console.log( '%s => %d elements', shape.join( 'x' ), n ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/offset/README.md b/lib/node_modules/@stdlib/ndarray/base/offset/README.md index 007ea0ce3d38..99a1f910532a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/offset/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/offset/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var offset = require( '@stdlib/ndarray/base/offset' ); +const offset = require( '@stdlib/ndarray/base/offset' ); ``` #### offset( x ) @@ -45,12 +45,12 @@ var offset = require( '@stdlib/ndarray/base/offset' ); Returns the index offset specifying the underlying buffer index of the first iterated [ndarray][@stdlib/ndarray/base/ctor] element. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var n = offset( x ); +const n = offset( x ); // returns 0 ``` @@ -77,18 +77,18 @@ var n = offset( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var offset = require( '@stdlib/ndarray/base/offset' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const offset = require( '@stdlib/ndarray/base/offset' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -106,10 +106,8 @@ var slices = [ ]; // Determine the index offset for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %d', s.shape.join( 'x' ), offset( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/order/README.md b/lib/node_modules/@stdlib/ndarray/base/order/README.md index d02a0f109222..3b921a7ea32f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var order = require( '@stdlib/ndarray/base/order' ); +const order = require( '@stdlib/ndarray/base/order' ); ``` #### order( x ) @@ -45,14 +45,14 @@ var order = require( '@stdlib/ndarray/base/order' ); Returns the [layout order][@stdlib/ndarray/orders] of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'order': 'row-major' }); // returns -var out = order( x ); +const out = order( x ); // returns 'row-major' ``` @@ -79,18 +79,18 @@ var out = order( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var order = require( '@stdlib/ndarray/base/order' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const order = require( '@stdlib/ndarray/base/order' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -108,10 +108,8 @@ var slices = [ ]; // Determine the layout order for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %s', s.order, order( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/output-policy-enum2str/README.md b/lib/node_modules/@stdlib/ndarray/base/output-policy-enum2str/README.md index 79f9e07a3fc6..abfa0a33f6f3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-policy-enum2str/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/output-policy-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); +const enum2str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); ``` #### enum2str( policy ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); Returns the policy string associated with an output ndarray [data type policy][@stdlib/ndarray/output-dtype-policies] enumeration constant. ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var v = str2enum( 'same' ); +const v = str2enum( 'same' ); // returns -var policy = enum2str( v ); +const policy = enum2str( v ); // returns 'same' ``` If unable to resolve a policy string, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var enum2str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const enum2str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); -var str = enum2str( str2enum( 'same' ) ); +let str = enum2str( str2enum( 'same' ) ); // returns 'same' str = enum2str( str2enum( 'floating_point' ) ); diff --git a/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-enum/README.md b/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-enum/README.md index 9fe0836ce947..f038557f5ba9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); +const resolve = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); ``` #### resolve( policy ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); Returns the enumeration constant associated with an ndarray [data type policy][@stdlib/ndarray/output-dtype-policies] value. ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var v = resolve( 'same' ); +let v = resolve( 'same' ); // returns v = resolve( str2enum( 'same' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'same' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); +const resolve = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); -var v = resolve( 'same' ); +let v = resolve( 'same' ); // returns v = resolve( 'promoted' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-str/README.md b/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-str/README.md index ea6bc0e5800d..b6cd7d66194b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-str/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/output-policy-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); +const resolve = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); ``` #### resolve( dtype ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); Returns the policy string associated with an ndarray [data type policy][@stdlib/ndarray/output-dtype-policies] value. ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var v = resolve( 'same' ); +let v = resolve( 'same' ); // returns 'same' v = resolve( str2enum( 'same' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'same' ) ); If unable to resolve a policy string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var resolve = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const resolve = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); -var v = resolve( str2enum( 'same' ) ); +let v = resolve( str2enum( 'same' ) ); // returns 'same' v = resolve( str2enum( 'promoted' ) ); diff --git a/lib/node_modules/@stdlib/ndarray/base/output-policy-str2enum/README.md b/lib/node_modules/@stdlib/ndarray/base/output-policy-str2enum/README.md index 45998aa1093d..67c7878aef0e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/output-policy-str2enum/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/output-policy-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); ``` #### str2enum( policy ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); Returns the enumeration constant associated with an output ndarray [data type policy][@stdlib/ndarray/output-dtype-policies] string. ```javascript -var v = str2enum( 'same' ); +const v = str2enum( 'same' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); +const str2enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); -var v = str2enum( 'same' ); +let v = str2enum( 'same' ); // returns v = str2enum( 'promoted' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/prepend-singleton-dimensions/README.md b/lib/node_modules/@stdlib/ndarray/base/prepend-singleton-dimensions/README.md index b4140d94c29b..9a66e6fb5a34 100644 --- a/lib/node_modules/@stdlib/ndarray/base/prepend-singleton-dimensions/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/prepend-singleton-dimensions/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var prependSingletonDimensions = require( '@stdlib/ndarray/base/prepend-singleton-dimensions' ); +const prependSingletonDimensions = require( '@stdlib/ndarray/base/prepend-singleton-dimensions' ); ``` #### prependSingletonDimensions( x, n ) @@ -49,17 +49,17 @@ Returns an ndarray with a specified number of prepended singleton dimensions (i. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Prepend singleton dimensions: -var y = prependSingletonDimensions( x, 3 ); +const y = prependSingletonDimensions( x, 3 ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 1, 1, 1, 2, 2 ] ``` @@ -86,29 +86,27 @@ var sh = y.shape; ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var prependSingletonDimensions = require( '@stdlib/ndarray/base/prepend-singleton-dimensions' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const prependSingletonDimensions = require( '@stdlib/ndarray/base/prepend-singleton-dimensions' ); // Create a 2-dimensional array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Prepend singleton dimensions: -var y = prependSingletonDimensions( x, 3 ); +const y = prependSingletonDimensions( x, 3 ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 1, 1, 1, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/remove-singleton-dimensions/README.md b/lib/node_modules/@stdlib/ndarray/base/remove-singleton-dimensions/README.md index f5de94717b5d..7e8e6fb7183e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/remove-singleton-dimensions/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/remove-singleton-dimensions/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton-dimensions' ); +const removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton-dimensions' ); ``` #### removeSingletonDimensions( x ) @@ -45,17 +45,17 @@ var removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton- Returns an ndarray without singleton dimensions (i.e., dimensions whose size is equal to `1`). ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 1x2x2 ndarray: -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ] ] ); // returns // Remove singleton dimensions: -var y = removeSingletonDimensions( x ); +const y = removeSingletonDimensions( x ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] ``` @@ -85,31 +85,30 @@ var sh = y.shape; ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton-dimensions' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton-dimensions' ); // Create a 5-dimensional array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ], { +const x = array( [ [ 1, 2 ], [ 3, 4 ] ], { 'ndmin': 5 }); // returns // Remove singleton dimensions: -var y = removeSingletonDimensions( x ); +const y = removeSingletonDimensions( x ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); // Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/reverse-dimension/README.md b/lib/node_modules/@stdlib/ndarray/base/reverse-dimension/README.md index df92103a97f1..b90c0dc56abc 100644 --- a/lib/node_modules/@stdlib/ndarray/base/reverse-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/reverse-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' ); +const reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' ); ``` #### reverseDimension( x, dim, writable ) @@ -45,24 +45,24 @@ var reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' ); Returns a view of an input ndarray in which the order of elements along a specified dimension is reversed. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = reverseDimension( x, 0, false ); +const y = reverseDimension( x, 0, false ); // returns sh = y.shape; @@ -103,38 +103,38 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' ); // Create a linear ndarray buffer: -var buf = zeroTo( 16 ); +const buf = zeroTo( 16 ); // Create a three-dimensional ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 2, 4, 2 ] }); // Reverse the order of first axis: -var y0 = reverseDimension( x, 0, false ); +const y0 = reverseDimension( x, 0, false ); // returns -var a0 = ndarray2array( y0 ); +const a0 = ndarray2array( y0 ); // returns [ [ [ 8, 9 ], [ 10, 11 ], [ 12, 13 ], [ 14, 15 ] ], [ [ 0, 1 ], [ 2, 3 ], [ 4, 5 ], [ 6, 7 ] ] ] // Reverse the order of second axis: -var y1 = reverseDimension( x, 1, false ); +const y1 = reverseDimension( x, 1, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 6, 7 ], [ 4, 5 ], [ 2, 3 ], [ 0, 1 ] ], [ [ 14, 15 ], [ 12, 13 ], [ 10, 11 ], [ 8, 9 ] ] ] // Reverse the order of third axis: -var y2 = reverseDimension( x, 2, false ); +const y2 = reverseDimension( x, 2, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 1, 0 ], [ 3, 2 ], [ 5, 4 ], [ 7, 6 ] ], [ [ 9, 8 ], [ 11, 10 ], [ 13, 12 ], [ 15, 14 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/reverse/README.md b/lib/node_modules/@stdlib/ndarray/base/reverse/README.md index a5f1eba803de..61e7ced5ba79 100644 --- a/lib/node_modules/@stdlib/ndarray/base/reverse/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/reverse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reverse = require( '@stdlib/ndarray/base/reverse' ); +const reverse = require( '@stdlib/ndarray/base/reverse' ); ``` #### reverse( x, writable ) @@ -45,24 +45,24 @@ var reverse = require( '@stdlib/ndarray/base/reverse' ); Returns a view of an input ndarray in which the order of elements along each dimension is reversed. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = reverse( x, false ); +const y = reverse( x, false ); // returns sh = y.shape; @@ -102,48 +102,48 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var reverse = require( '@stdlib/ndarray/base/reverse' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const reverse = require( '@stdlib/ndarray/base/reverse' ); // Create a linear ndarray buffer: -var buf = zeroTo( 16 ); +const buf = zeroTo( 16 ); // Create a one-dimensional ndarray: -var x1 = array( buf, { +const x1 = array( buf, { 'shape': [ 16 ] }); // Reverse element order: -var y1 = reverse( x1, false ); +const y1 = reverse( x1, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ] // Create a two-dimensional ndarray: -var x2 = array( buf, { +const x2 = array( buf, { 'shape': [ 4, 4 ] }); // Reverse element order: -var y2 = reverse( x2, false ); +const y2 = reverse( x2, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 15, 14, 13, 12 ], [ 11, 10, 9, 8 ], [ 7, 6, 5, 4 ], [ 3, 2, 1, 0 ] ] // Create a three-dimensional ndarray: -var x3 = array( buf, { +const x3 = array( buf, { 'shape': [ 2, 4, 2 ] }); // Reverse element order: -var y3 = reverse( x3, false ); +const y3 = reverse( x3, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 15, 14 ], [ 13, 12 ], [ 11, 10 ], [ 9, 8 ] ], [ [ 7, 6 ], [ 5, 4 ], [ 3, 2 ], [ 1, 0 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/serialize-meta-data/README.md b/lib/node_modules/@stdlib/ndarray/base/serialize-meta-data/README.md index 6ed60e2afde2..da681f5f3e2b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/serialize-meta-data/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/serialize-meta-data/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var serialize = require( '@stdlib/ndarray/base/serialize-meta-data' ); +const serialize = require( '@stdlib/ndarray/base/serialize-meta-data' ); ``` #### serialize( x ) @@ -45,10 +45,10 @@ var serialize = require( '@stdlib/ndarray/base/serialize-meta-data' ); Serializes [ndarray][@stdlib/ndarray/ctor] meta data. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var dv = serialize( arr ); +const arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const dv = serialize( arr ); // returns ``` @@ -117,14 +117,14 @@ var dv = serialize( arr ); ```javascript -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var array = require( '@stdlib/ndarray/array' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); -var serialize = require( '@stdlib/ndarray/base/serialize-meta-data' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const array = require( '@stdlib/ndarray/array' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); +const serialize = require( '@stdlib/ndarray/base/serialize-meta-data' ); // Create an ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // Print various properties: console.log( 'dtype: %s', x.dtype ); @@ -135,41 +135,40 @@ console.log( 'offset: %d', x.offset ); console.log( 'order: %s', x.order ); // Serialize ndarray meta data to a DataView: -var dv = serialize( x ); +const dv = serialize( x ); // returns // Create a Uint8Array view: -var bytes = new Uint8Array( dv.buffer ); +const bytes = new Uint8Array( dv.buffer ); // Extract the data type (enum): -var dtype = dv.getInt16( 1, IS_LITTLE_ENDIAN ); +const dtype = dv.getInt16( 1, IS_LITTLE_ENDIAN ); console.log( 'dtype (enum): %d', dtype ); // Extract the number of dimensions: -var ndims = fromInt64Bytes( bytes, 1, 3 ); +const ndims = fromInt64Bytes( bytes, 1, 3 ); console.log( 'ndims: %d', ndims ); // Extract the shape: -var shape = []; -var i; -for ( i = 0; i < ndims; i++ ) { +const shape = []; +for ( let i = 0; i < ndims; i++ ) { shape.push( fromInt64Bytes( bytes, 1, 11+(i*8) ) ); } console.log( 'shape: [ %s ]', shape.join( ', ' ) ); // Extract the strides (in units of bytes): -var strides = []; -for ( i = 0; i < ndims; i++ ) { +const strides = []; +for ( let i = 0; i < ndims; i++ ) { strides.push( fromInt64Bytes( bytes, 1, 11+(ndims*8)+(i*8) ) ); } console.log( 'strides (bytes): [ %s ]', strides.join( ', ' ) ); // Extract the index offset (in bytes): -var offset = fromInt64Bytes( bytes, 1, 11+(ndims*16) ); +const offset = fromInt64Bytes( bytes, 1, 11+(ndims*16) ); console.log( 'offset (bytes): %d', offset ); // Extract the order (enum): -var order = dv.getInt8( 19+(ndims*16) ); +const order = dv.getInt8( 19+(ndims*16) ); console.log( 'order (enum): %d', order ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/shape/README.md b/lib/node_modules/@stdlib/ndarray/base/shape/README.md index c050a08e0e35..907ecf4b316b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/shape/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/shape/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var shape = require( '@stdlib/ndarray/base/shape' ); +const shape = require( '@stdlib/ndarray/base/shape' ); ``` #### shape( x, copy ) @@ -45,27 +45,27 @@ var shape = require( '@stdlib/ndarray/base/shape' ); Returns the shape of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var sh = shape( x, false ); +const sh = shape( x, false ); // returns [ 3, 2, 3 ] ``` When `copy` is `false`, changes to the returned shape array may mutate the input [ndarray][@stdlib/ndarray/base/ctor] shape. If there is a chance that the returned shape will be mutated (either directly or by downstream consumers), set `copy` to `true` to prevent unintended side effects. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var sh = shape( x, true ); +const sh = shape( x, true ); // returns [ 3, 2, 3 ] -var bool = ( x.shape === sh ); +const bool = ( x.shape === sh ); // returns false ``` @@ -92,18 +92,18 @@ var bool = ( x.shape === sh ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var shape = require( '@stdlib/ndarray/base/shape' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const shape = require( '@stdlib/ndarray/base/shape' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -120,11 +120,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Determine the shape of each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( 'slice(%s) => %s', x.shape.join( 'x' ), shape( s, false ).join( 'x' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/shape2strides/README.md b/lib/node_modules/@stdlib/ndarray/base/shape2strides/README.md index fc82fd40ac59..5ef69431680a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/shape2strides/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/shape2strides/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); ``` #### shape2strides( shape, order ) @@ -45,14 +45,14 @@ var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); Generates a stride array from an array shape. ```javascript -var strides = shape2strides( [ 3, 2 ], 'row-major' ); +const strides = shape2strides( [ 3, 2 ], 'row-major' ); // returns [ 2, 1 ] ``` The `order` parameter specifies whether an array is `row-major` (C-style) or `column-major` (Fortran-style). ```javascript -var strides = shape2strides( [ 3, 2 ], 'column-major' ); +const strides = shape2strides( [ 3, 2 ], 'column-major' ); // returns [ 1, 3 ] ``` @@ -61,13 +61,13 @@ var strides = shape2strides( [ 3, 2 ], 'column-major' ); Generates a stride array from an array shape and assigns results to a provided output array. ```javascript -var shape = [ 3, 2 ]; -var strides = [ 0, 0 ]; +const shape = [ 3, 2 ]; +const strides = [ 0, 0 ]; -var out = shape2strides.assign( shape, 'row-major', strides ); +const out = shape2strides.assign( shape, 'row-major', strides ); // returns [ 2, 1 ] -var bool = ( strides === out ); +const bool = ( strides === out ); // returns true ``` @@ -92,19 +92,15 @@ var bool = ( strides === out ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides; -var shape; -var i; - -shape = [ 0, 0, 0 ]; -for ( i = 0; i < 100; i++ ) { +const shape = [ 0, 0, 0 ]; +for ( let i = 0; i < 100; i++ ) { shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); - strides = shape2strides( shape, 'row-major' ); + const strides = shape2strides( shape, 'row-major' ); console.log( 'shape: %s. strides: %s.', shape.join( 'x' ), strides.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/singleton-dimensions/README.md b/lib/node_modules/@stdlib/ndarray/base/singleton-dimensions/README.md index 94fe3225ccaf..3e711abbf358 100644 --- a/lib/node_modules/@stdlib/ndarray/base/singleton-dimensions/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/singleton-dimensions/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var singletonDimensions = require( '@stdlib/ndarray/base/singleton-dimensions' ); +const singletonDimensions = require( '@stdlib/ndarray/base/singleton-dimensions' ); ``` #### singletonDimensions( shape ) @@ -45,7 +45,7 @@ var singletonDimensions = require( '@stdlib/ndarray/base/singleton-dimensions' ) Returns the number of singleton dimensions. ```javascript -var n = singletonDimensions( [ 3, 1, 3 ] ); +const n = singletonDimensions( [ 3, 1, 3 ] ); // returns 1 ``` @@ -74,19 +74,15 @@ var n = singletonDimensions( [ 3, 1, 3 ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var singletonDimensions = require( '@stdlib/ndarray/base/singleton-dimensions' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const singletonDimensions = require( '@stdlib/ndarray/base/singleton-dimensions' ); -var shape; -var n; -var i; - -shape = [ 0, 0, 0 ]; -for ( i = 0; i < 100; i++ ) { +const shape = [ 0, 0, 0 ]; +for ( let i = 0; i < 100; i++ ) { shape[ 0 ] = discreteUniform( 1, 5 ); shape[ 1 ] = discreteUniform( 1, 5 ); shape[ 2 ] = discreteUniform( 1, 5 ); - n = singletonDimensions( shape ); + const n = singletonDimensions( shape ); console.log( 'shape: %s. singleton dimensions: %d.', shape.join( 'x' ), n ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-assign/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-assign/README.md index 4b051e95de95..df0fe22e2410 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-assign/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-assign/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceAssign = require( '@stdlib/ndarray/base/slice-assign' ); +const sliceAssign = require( '@stdlib/ndarray/base/slice-assign' ); ``` #### sliceAssign( x, y, slice, strict ) @@ -45,44 +45,44 @@ var sliceAssign = require( '@stdlib/ndarray/base/slice-assign' ); Assigns element values from a broadcasted input `ndarray` to corresponding elements in an output `ndarray` view. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); // Define an input array: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +const sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] // Define an output array: -var y = ndzeros( [ 2, 3, 2 ], { +const y = ndzeros( [ 2, 3, 2 ], { 'dtype': x.dtype }); // Create a slice: -var s0 = null; -var s1 = new Slice( null, null, -1 ); -var s2 = new Slice( null, null, -1 ); -var s = new MultiSlice( s0, s1, s2 ); +const s0 = null; +const s1 = new Slice( null, null, -1 ); +const s2 = new Slice( null, null, -1 ); +const s = new MultiSlice( s0, s1, s2 ); // returns // Perform assignment: -var out = sliceAssign( x, y, s, false ); +const out = sliceAssign( x, y, s, false ); // returns -var bool = ( out === y ); +const bool = ( out === y ); // returns true arr = ndarray2array( y ); @@ -124,54 +124,54 @@ The function accepts the following arguments: ```javascript -var E = require( '@stdlib/slice/multi' ); -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/base/slice' ); -var sliceAssign = require( '@stdlib/ndarray/base/slice-assign' ); +const E = require( '@stdlib/slice/multi' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/base/slice' ); +const sliceAssign = require( '@stdlib/ndarray/base/slice-assign' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create an output ndarray: -var y = ndzeros( [ 3, 3, 3 ] ); +const y = ndzeros( [ 3, 3, 3 ] ); // Update each matrix... -var s1 = E( 0, _, _ ); +const s1 = E( 0, _, _ ); sliceAssign( scalar2ndarray( 100 ), y, s1, false ); -var a1 = ndarray2array( slice( y, s1, false ) ); +const a1 = ndarray2array( slice( y, s1, false ) ); // returns [ [ 100, 100, 100 ], [ 100, 100, 100 ], [ 100, 100, 100 ] ] -var s2 = E( 1, _, _ ); +const s2 = E( 1, _, _ ); sliceAssign( scalar2ndarray( 200 ), y, s2, false ); -var a2 = ndarray2array( slice( y, s2, false ) ); +const a2 = ndarray2array( slice( y, s2, false ) ); // returns [ [ 200, 200, 200 ], [ 200, 200, 200 ], [ 200, 200, 200 ] ] -var s3 = E( 2, _, _ ); +const s3 = E( 2, _, _ ); sliceAssign( scalar2ndarray( 300 ), y, s3, false ); -var a3 = ndarray2array( slice( y, s3, false ) ); +const a3 = ndarray2array( slice( y, s3, false ) ); // returns [ [ 300, 300, 300 ], [ 300, 300, 300 ], [ 300, 300, 300 ] ] // Update the second rows in each matrix: -var s4 = E( _, 1, _ ); +const s4 = E( _, 1, _ ); sliceAssign( scalar2ndarray( 400 ), y, s4, false ); -var a4 = ndarray2array( slice( y, s4, false ) ); +const a4 = ndarray2array( slice( y, s4, false ) ); // returns [ [ 400, 400, 400 ], [ 400, 400, 400 ], [ 400, 400, 400 ] ] // Update the second columns in each matrix: -var s5 = E( _, _, 1 ); +const s5 = E( _, _, 1 ); sliceAssign( scalar2ndarray( 500 ), y, s5, false ); -var a5 = ndarray2array( slice( y, s5, false ) ); +const a5 = ndarray2array( slice( y, s5, false ) ); // returns [ [ 500, 500, 500 ], [ 500, 500, 500 ], [ 500, 500, 500 ] ] // Return the contents of the entire ndarray: -var a6 = ndarray2array( y ); +const a6 = ndarray2array( y ); /* returns [ [ diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-dimension-from/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-dimension-from/README.md index 64acb53654b4..6567a76a1e19 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-dimension-from/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-dimension-from/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimensionFrom = require( '@stdlib/ndarray/base/slice-dimension-from' ); +const sliceDimensionFrom = require( '@stdlib/ndarray/base/slice-dimension-from' ); ``` #### sliceDimensionFrom( x, dim, start, strict, writable ) @@ -45,24 +45,24 @@ var sliceDimensionFrom = require( '@stdlib/ndarray/base/slice-dimension-from' ); Returns a shifted view of an input ndarray along a specified dimension. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionFrom( x, 0, 1, false, false ); +const y = sliceDimensionFrom( x, 0, 1, false, false ); // returns sh = y.shape; @@ -105,38 +105,38 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimensionFrom = require( '@stdlib/ndarray/base/slice-dimension-from' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimensionFrom = require( '@stdlib/ndarray/base/slice-dimension-from' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the last two rows of each matrix: -var y1 = sliceDimensionFrom( x, 1, 1, false, false ); +const y1 = sliceDimensionFrom( x, 1, 1, false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] // Get the last columns of each matrix: -var y2 = sliceDimensionFrom( x, 2, 1, false, false ); +const y2 = sliceDimensionFrom( x, 2, 1, false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 1, 2 ], [ 4, 5 ], [ 7, 8 ] ], [ [ 10, 11 ], [ 13, 14 ], [ 16, 17 ] ], [ [ 19, 20 ], [ 22, 23 ], [ 25, 26 ] ] ] // Get the last two matrices: -var y3 = sliceDimensionFrom( x, 0, 1, false, false ); +const y3 = sliceDimensionFrom( x, 0, 1, false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-dimension-to/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-dimension-to/README.md index d1a61c27aa5d..e9062e06c58a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-dimension-to/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-dimension-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimensionTo = require( '@stdlib/ndarray/base/slice-dimension-to' ); +const sliceDimensionTo = require( '@stdlib/ndarray/base/slice-dimension-to' ); ``` #### sliceDimensionTo( x, dim, stop, strict, writable ) @@ -45,24 +45,24 @@ var sliceDimensionTo = require( '@stdlib/ndarray/base/slice-dimension-to' ); Returns a truncated view of an input ndarray along a specified dimension. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionTo( x, 0, 2, false, false ); +const y = sliceDimensionTo( x, 0, 2, false, false ); // returns sh = y.shape; @@ -105,38 +105,38 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimensionTo = require( '@stdlib/ndarray/base/slice-dimension-to' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimensionTo = require( '@stdlib/ndarray/base/slice-dimension-to' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the first two rows of each matrix: -var y1 = sliceDimensionTo( x, 1, 2, false, false ); +const y1 = sliceDimensionTo( x, 1, 2, false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ] ] ] // Get the first columns of each matrix: -var y2 = sliceDimensionTo( x, 2, 2, false, false ); +const y2 = sliceDimensionTo( x, 2, 2, false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 0, 1 ], [ 3, 4 ], [ 6, 7 ] ], [ [ 9, 10 ], [ 12, 13 ], [ 15, 16 ] ], [ [ 18, 19 ], [ 21, 22 ], [ 24, 25 ] ] ] // Get the first two matrices: -var y3 = sliceDimensionTo( x, 0, 2, false, false ); +const y3 = sliceDimensionTo( x, 0, 2, false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-dimension/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-dimension/README.md index 252ac3c46a4f..24970c36befb 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimension = require( '@stdlib/ndarray/base/slice-dimension' ); +const sliceDimension = require( '@stdlib/ndarray/base/slice-dimension' ); ``` #### sliceDimension( x, dim, slice, strict, writable ) @@ -45,28 +45,28 @@ var sliceDimension = require( '@stdlib/ndarray/base/slice-dimension' ); Returns a view of an input ndarray when sliced along a specified dimension. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s = new Slice( null, null, -1 ); +const s = new Slice( null, null, -1 ); // returns -var y = sliceDimension( x, 0, s, false, false ); +const y = sliceDimension( x, 0, s, false, false ); // returns sh = y.shape; @@ -111,62 +111,62 @@ The function accepts the following arguments: ```javascript -var S = require( '@stdlib/slice/ctor' ); -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimension = require( '@stdlib/ndarray/base/slice-dimension' ); +const S = require( '@stdlib/slice/ctor' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimension = require( '@stdlib/ndarray/base/slice-dimension' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get each matrix... -var y1 = sliceDimension( x, 0, 0, false, false ); +const y1 = sliceDimension( x, 0, 0, false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ] -var y2 = sliceDimension( x, 0, 1, false, false ); +const y2 = sliceDimension( x, 0, 1, false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] -var y3 = sliceDimension( x, 0, 2, false, false ); +const y3 = sliceDimension( x, 0, 2, false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] // Reverse the matrix order: -var s = S( _, _, -1 ); -var y4 = sliceDimension( x, 0, s, false, false ); +const s = S( _, _, -1 ); +const y4 = sliceDimension( x, 0, s, false, false ); // returns -var a4 = ndarray2array( y4 ); +const a4 = ndarray2array( y4 ); // returns [...] // Get the second rows from each matrix: -var y5 = sliceDimension( x, 1, 1, false, false ); +const y5 = sliceDimension( x, 1, 1, false, false ); // returns -var a5 = ndarray2array( y5 ); +const a5 = ndarray2array( y5 ); // returns [ [ 3, 4, 5 ], [ 12, 13, 14 ], [ 21, 22, 23 ] ] // Get the second columns from each matrix: -var y6 = sliceDimension( x, 2, 1, false, false ); +const y6 = sliceDimension( x, 2, 1, false, false ); // returns -var a6 = ndarray2array( y6 ); +const a6 = ndarray2array( y6 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-from/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-from/README.md index 01347b89c06f..401620024648 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-from/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-from/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceFrom = require( '@stdlib/ndarray/base/slice-from' ); +const sliceFrom = require( '@stdlib/ndarray/base/slice-from' ); ``` #### sliceFrom( x, start, strict, writable ) @@ -45,25 +45,25 @@ var sliceFrom = require( '@stdlib/ndarray/base/slice-from' ); Returns a shifted view of an input ndarray. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s = [ 1, null ]; -var y = sliceFrom( x, s, false, false ); +const s = [ 1, null ]; +const y = sliceFrom( x, s, false, false ); // returns sh = y.shape; @@ -105,38 +105,38 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceFrom = require( '@stdlib/ndarray/base/slice-from' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceFrom = require( '@stdlib/ndarray/base/slice-from' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the last two rows of each matrix: -var y1 = sliceFrom( x, [ null, 1, null ], false, false ); +const y1 = sliceFrom( x, [ null, 1, null ], false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] // Get the last two rows and columns of each matrix: -var y2 = sliceFrom( x, [ null, 1, 1 ], false, false ); +const y2 = sliceFrom( x, [ null, 1, 1 ], false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 4, 5 ], [ 7, 8 ] ], [ [ 13, 14 ], [ 16, 17 ] ], [ [ 22, 23 ], [ 25, 26 ] ] ] // Get the last two 2x2 matrices: -var y3 = sliceFrom( x, [ 1, 1, 1 ], false, false ); +const y3 = sliceFrom( x, [ 1, 1, 1 ], false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 13, 14 ], [ 16, 17 ] ], [ [ 22, 23 ], [ 25, 26 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice-to/README.md b/lib/node_modules/@stdlib/ndarray/base/slice-to/README.md index 0eac02b3f05b..0446b2724241 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice-to/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceTo = require( '@stdlib/ndarray/base/slice-to' ); +const sliceTo = require( '@stdlib/ndarray/base/slice-to' ); ``` #### sliceTo( x, stop, strict, writable ) @@ -45,25 +45,25 @@ var sliceTo = require( '@stdlib/ndarray/base/slice-to' ); Returns a truncated view of an input ndarray. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s = [ 2, null ]; -var y = sliceTo( x, s, false, false ); +const s = [ 2, null ]; +const y = sliceTo( x, s, false, false ); // returns sh = y.shape; @@ -105,38 +105,38 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceTo = require( '@stdlib/ndarray/base/slice-to' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceTo = require( '@stdlib/ndarray/base/slice-to' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the first two rows of each matrix: -var y1 = sliceTo( x, [ null, 2, null ], false, false ); +const y1 = sliceTo( x, [ null, 2, null ], false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ] ] ] // Get the first two rows and columns of each matrix: -var y2 = sliceTo( x, [ null, 2, 2 ], false, false ); +const y2 = sliceTo( x, [ null, 2, 2 ], false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 0, 1 ], [ 3, 4 ] ], [ [ 9, 10 ], [ 12, 13 ] ], [ [ 18, 19 ], [ 21, 22 ] ] ] // Get the first two 2x2 matrices: -var y3 = sliceTo( x, [ 2, 2, 2 ], false, false ); +const y3 = sliceTo( x, [ 2, 2, 2 ], false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 0, 1 ], [ 3, 4 ] ], [ [ 9, 10 ], [ 12, 13 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/slice/README.md b/lib/node_modules/@stdlib/ndarray/base/slice/README.md index 267a0e523100..b9071d21441f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/slice/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice = require( '@stdlib/ndarray/base/slice' ); +const slice = require( '@stdlib/ndarray/base/slice' ); ``` #### slice( x, slice, strict, writable ) @@ -45,31 +45,31 @@ var slice = require( '@stdlib/ndarray/base/slice' ); Returns a view of an input ndarray. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s0 = new Slice( null, null, -2 ); -var s1 = new Slice( null, null, -1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = new Slice( null, null, -2 ); +const s1 = new Slice( null, null, -1 ); +const s = new MultiSlice( s0, s1 ); // returns -var y = slice( x, s, false, false ); +const y = slice( x, s, false, false ); // returns sh = y.shape; @@ -113,69 +113,69 @@ The function accepts the following arguments: ```javascript -var S = require( '@stdlib/slice/ctor' ); -var E = require( '@stdlib/slice/multi' ); -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var slice = require( '@stdlib/ndarray/base/slice' ); +const S = require( '@stdlib/slice/ctor' ); +const E = require( '@stdlib/slice/multi' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const slice = require( '@stdlib/ndarray/base/slice' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get each matrix... -var s1 = E( 0, _, _ ); -var y1 = slice( x, s1, false, false ); +const s1 = E( 0, _, _ ); +const y1 = slice( x, s1, false, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ] -var s2 = E( 1, _, _ ); -var y2 = slice( x, s2, false, false ); +const s2 = E( 1, _, _ ); +const y2 = slice( x, s2, false, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] -var s3 = E( 2, _, _ ); -var y3 = slice( x, s3, false, false ); +const s3 = E( 2, _, _ ); +const y3 = slice( x, s3, false, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] // Reverse all elements: -var s = S( _, _, -1 ); -var s4 = E( s, s, s ); -var y4 = slice( x, s4, false, false ); +const s = S( _, _, -1 ); +const s4 = E( s, s, s ); +const y4 = slice( x, s4, false, false ); // returns -var a4 = ndarray2array( y4 ); +const a4 = ndarray2array( y4 ); // returns [...] // Get the second rows from each matrix: -var s5 = E( _, 1, _ ); -var y5 = slice( x, s5, false, false ); +const s5 = E( _, 1, _ ); +const y5 = slice( x, s5, false, false ); // returns -var a5 = ndarray2array( y5 ); +const a5 = ndarray2array( y5 ); // returns [ [ 3, 4, 5 ], [ 12, 13, 14 ], [ 21, 22, 23 ] ] // Get the second columns from each matrix: -var s6 = E( _, _, 1 ); -var y6 = slice( x, s6, false, false ); +const s6 = E( _, _, 1 ); +const y6 = slice( x, s6, false, false ); // returns -var a6 = ndarray2array( y6 ); +const a6 = ndarray2array( y6 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/stride/README.md b/lib/node_modules/@stdlib/ndarray/base/stride/README.md index 43f962712028..72915ed3a994 100644 --- a/lib/node_modules/@stdlib/ndarray/base/stride/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/stride/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var stride = require( '@stdlib/ndarray/base/stride' ); +const stride = require( '@stdlib/ndarray/base/stride' ); ``` #### stride( x, dim ) @@ -45,12 +45,12 @@ var stride = require( '@stdlib/ndarray/base/stride' ); Returns the stride along a specified dimension for a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var st = stride( x, 0 ); +const st = stride( x, 0 ); // returns 6 ``` @@ -86,18 +86,18 @@ The function accepts the following arguments: ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var stride = require( '@stdlib/ndarray/base/stride' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const stride = require( '@stdlib/ndarray/base/stride' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -115,10 +115,8 @@ var slices = [ ]; // Resolve the stride of the first dimension for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => %d', s.shape.join( ',' ), stride( s, 0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/strides/README.md b/lib/node_modules/@stdlib/ndarray/base/strides/README.md index 5c76ba06fab0..3e5e25ac783f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/strides/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/strides/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strides = require( '@stdlib/ndarray/base/strides' ); +const strides = require( '@stdlib/ndarray/base/strides' ); ``` #### strides( x, copy ) @@ -45,27 +45,27 @@ var strides = require( '@stdlib/ndarray/base/strides' ); Returns the strides of a provided [ndarray][@stdlib/ndarray/base/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var st = strides( x, false ); +const st = strides( x, false ); // returns [ 6, 3, 1 ] ``` When `copy` is `false`, changes to the returned strides array may mutate the input [ndarray][@stdlib/ndarray/base/ctor] strides. If there is a chance that the returned strides will be mutated (either directly or by downstream consumers), set `copy` to `true` to prevent unintended side effects. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var st = strides( x, true ); +const st = strides( x, true ); // returns [ 6, 3, 1 ] -var bool = ( x.strides === st ); +const bool = ( x.strides === st ); // returns false ``` @@ -92,18 +92,18 @@ var bool = ( x.strides === st ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var strides = require( '@stdlib/ndarray/base/strides' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const strides = require( '@stdlib/ndarray/base/strides' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -121,10 +121,8 @@ var slices = [ ]; // Determine the strides of each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => (%s)', x.strides.join( ',' ), strides( s, false ).join( ',' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/strides2offset/README.md b/lib/node_modules/@stdlib/ndarray/base/strides2offset/README.md index df91e18e789a..078abdc66bb3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/strides2offset/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/strides2offset/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); ``` #### strides2offset( shape, strides ) @@ -45,7 +45,7 @@ var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); Returns the index offset which specifies the location of the first indexed value in a multidimensional array. ```javascript -var offset = strides2offset( [ 3, 2 ], [ 2, 1 ] ); +let offset = strides2offset( [ 3, 2 ], [ 2, 1 ] ); // returns 0 offset = strides2offset( [ 3, 2 ], [ -2, 1 ] ); @@ -73,36 +73,28 @@ offset = strides2offset( [ 3, 2 ], [ -2, 1 ] ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var randu = require( '@stdlib/random/base/randu' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); - -var strides; -var offset; -var shape; -var len; -var arr; -var i; -var j; - -shape = [ 0, 0, 0 ]; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const randu = require( '@stdlib/random/base/randu' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); + +const shape = [ 0, 0, 0 ]; shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); -strides = shape2strides( shape, 'row-major' ); -len = numel( shape ); +const strides = shape2strides( shape, 'row-major' ); +const len = numel( shape ); -arr = []; -for ( i = 0; i < len; i++ ) { +const arr = []; +for ( let i = 0; i < len; i++ ) { arr.push( i ); } -for ( i = 0; i < 100; i++ ) { - j = discreteUniform( 0, shape.length-1 ); +for ( let i = 0; i < 100; i++ ) { + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); console.log( 'arr[0][0][0] = %d', arr[ offset ] ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/strides2order/README.md b/lib/node_modules/@stdlib/ndarray/base/strides2order/README.md index c3c57fb46b8a..edb8b80a5d0f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/strides2order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/strides2order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strides2order = require( '@stdlib/ndarray/base/strides2order' ); +const strides2order = require( '@stdlib/ndarray/base/strides2order' ); ``` #### strides2order( strides ) @@ -45,7 +45,7 @@ var strides2order = require( '@stdlib/ndarray/base/strides2order' ); Determines the order of a multidimensional array based on a provided stride array. ```javascript -var order = strides2order( [ 2, 1 ] ); +let order = strides2order( [ 2, 1 ] ); // returns 1 order = strides2order( [ 1, 2 ] ); @@ -89,36 +89,31 @@ The function returns one of the following values: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var randu = require( '@stdlib/random/base/randu' ); -var strides2order = require( '@stdlib/ndarray/base/strides2order' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const randu = require( '@stdlib/random/base/randu' ); +const strides2order = require( '@stdlib/ndarray/base/strides2order' ); -var strides; -var order; -var shape; -var i; -var j; +const shape = [ 0, 0, 0 ]; -shape = [ 0, 0, 0 ]; - -for ( i = 0; i < 20; i++ ) { +for ( let i = 0; i < 20; i++ ) { // Generate a random array shape: shape[ 0 ] = discreteUniform( 1, 10 ); shape[ 1 ] = discreteUniform( 1, 10 ); shape[ 2 ] = discreteUniform( 1, 10 ); // Compute the strides: + let strides; if ( randu() < 0.5 ) { strides = shape2strides( shape, 'row-major' ); } else { strides = shape2strides( shape, 'column-major' ); } - j = discreteUniform( 0, shape.length-1 ); + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] *= ( randu() < 0.5 ) ? -1 : 1; // Determine the order: - order = strides2order( strides ); + const order = strides2order( strides ); console.log( 'Strides: %s. Order: %s.', strides.join( ',' ), order ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/sub2ind/README.md b/lib/node_modules/@stdlib/ndarray/base/sub2ind/README.md index 913c3f26dbf5..d48908ac5108 100644 --- a/lib/node_modules/@stdlib/ndarray/base/sub2ind/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/sub2ind/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); +const sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); ``` #### sub2ind( shape, strides, offset, ...subscripts, mode ) @@ -45,12 +45,12 @@ var sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); Converts subscripts to a linear index. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; -var mode = [ 'throw' ]; +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; +const mode = [ 'throw' ]; -var idx = sub2ind( shape, strides, offset, 1, 0, mode ); +const idx = sub2ind( shape, strides, offset, 1, 0, mode ); // returns 2 ``` @@ -62,12 +62,12 @@ The function supports the following modes: - **clamp**: specifies that the function should set subscripts exceeding array dimensions to either `0` (minimum index) or the maximum index along a particular dimension. ```javascript -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var mode = [ 'wrap' ]; -var idx = sub2ind( shape, strides, offset, -2, 0, mode ); +let mode = [ 'wrap' ]; +let idx = sub2ind( shape, strides, offset, -2, 0, mode ); // returns 0 mode = [ 'clamp' ]; @@ -88,12 +88,12 @@ idx = sub2ind( shape, strides, offset, 10, 10, mode ); - When provided fewer `modes` than dimensions, the function recycles `modes` using modulo arithmetic. ```javascript - var shape = [ 2, 2, 2 ]; - var strides = [ 4, 2, 1 ]; - var offset = 0; - var mode = [ 'wrap', 'clamp' ]; + const shape = [ 2, 2, 2 ]; + const strides = [ 4, 2, 1 ]; + const offset = 0; + const mode = [ 'wrap', 'clamp' ]; - var idx = sub2ind( shape, strides, offset, -2, 10, -1, mode ); + const idx = sub2ind( shape, strides, offset, -2, 10, -1, mode ); // returns 3 ``` @@ -132,13 +132,13 @@ idx = sub2ind( shape, strides, offset, 10, 10, mode ); ``` ```javascript - var shape = [ 2, 2 ]; - var strides = [ -2, 1 ]; - var offset = 2; - var mode = [ 'throw' ]; + const shape = [ 2, 2 ]; + const strides = [ -2, 1 ]; + const offset = 2; + const mode = [ 'throw' ]; // From the perspective of a view... - var idx = sub2ind( shape, strides, 0, 0, 0, mode ); + let idx = sub2ind( shape, strides, 0, 0, 0, mode ); // returns 0 idx = sub2ind( shape, strides, 0, 0, 1, mode ); @@ -179,43 +179,36 @@ idx = sub2ind( shape, strides, offset, 10, 10, mode ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var randu = require( '@stdlib/random/base/randu' ); -var sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); - -var shape = [ 3, 3 ]; -var strides = shape2strides( shape, 'row-major' ); -var mode = [ 'throw' ]; -var len = numel( shape ); - -var arr = []; -var i; -for ( i = 0; i < len; i++ ) { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const randu = require( '@stdlib/random/base/randu' ); +const sub2ind = require( '@stdlib/ndarray/base/sub2ind' ); + +const shape = [ 3, 3 ]; +const strides = shape2strides( shape, 'row-major' ); +const mode = [ 'throw' ]; +const len = numel( shape ); + +const arr = []; +for ( let i = 0; i < len; i++ ) { arr.push( i ); } -var offset; -var idx; -var row; -var j; -var n; -var m; -for ( i = 0; i < 20; i++ ) { - j = discreteUniform( 0, shape.length-1 ); +for ( let i = 0; i < 20; i++ ) { + const j = discreteUniform( 0, shape.length-1 ); strides[ j ] = ( randu() < 0.5 ) ? -1 : 1; - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); console.log( '' ); console.log( 'Dimensions: %s.', shape.join( 'x' ) ); console.log( 'Strides: %s.', strides.join( ',' ) ); console.log( 'View:' ); - for ( n = 0; n < shape[ 0 ]; n++ ) { - row = ' '; - for ( m = 0; m < shape[ 1 ]; m++ ) { - idx = sub2ind( shape, strides, offset, n, m, mode ); + for ( let n = 0; n < shape[ 0 ]; n++ ) { + let row = ' '; + for ( let m = 0; m < shape[ 1 ]; m++ ) { + const idx = sub2ind( shape, strides, offset, n, m, mode ); row += arr[ idx ]; if ( m < shape[ 1 ]-1 ) { row += ', '; diff --git a/lib/node_modules/@stdlib/ndarray/base/to-array/README.md b/lib/node_modules/@stdlib/ndarray/base/to-array/README.md index f78ba19cfce4..84c1b958ab37 100644 --- a/lib/node_modules/@stdlib/ndarray/base/to-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/to-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); ``` #### ndarray2array( buffer, shape, strides, offset, order ) @@ -45,39 +45,39 @@ var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); Converts an ndarray buffer to a generic array (which may include nested arrays). ```javascript -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; -var arr = ndarray2array( buffer, shape, strides, offset, order ); +const arr = ndarray2array( buffer, shape, strides, offset, order ); // returns [ [ 1, 2 ], [ 3, 4 ] ] ``` The `order` parameter specifies whether an array is `row-major` (C-style) or `column-major` (Fortran-style). ```javascript -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, 2 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, 2 ]; +const offset = 0; -var arr = ndarray2array( buffer, shape, strides, offset, order ); +const arr = ndarray2array( buffer, shape, strides, offset, order ); // returns [ [ 1, 3 ], [ 2, 4 ] ] ``` The `offset` parameter specifies the location of the first indexed element based on the `strides` array. ```javascript -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 3; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 3; -var arr = ndarray2array( buffer, shape, strides, offset, order ); +const arr = ndarray2array( buffer, shape, strides, offset, order ); // returns [ [ 4, 3 ], [ 2, 1 ] ] ``` @@ -102,44 +102,39 @@ var arr = ndarray2array( buffer, shape, strides, offset, order ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); // Create a data buffer: -var buffer = []; -var i; -for ( i = 0; i < 27; i++ ) { +const buffer = []; +for ( let i = 0; i < 27; i++ ) { buffer.push( i ); } // Specify array meta data: -var shape = [ 3, 3, 3 ]; -var order = 'column-major'; -var ndims = shape.length; +const shape = [ 3, 3, 3 ]; +const order = 'column-major'; +const ndims = shape.length; // Compute array meta data: -var strides = shape2strides( shape, order ); -var offset = strides2offset( shape, strides ); +const strides = shape2strides( shape, order ); // Print array information: console.log( '' ); console.log( 'Dims: %s', shape.join( 'x' ) ); -// Randomly flip strides and convert an ndarray to a nested array... -var arr; -var j; -for ( i = 0; i < 20; i++ ) { - j = discreteUniform( 0, ndims-1 ); +for ( let i = 0; i < 20; i++ ) { + const j = discreteUniform( 0, ndims-1 ); strides[ j ] *= -1; - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); console.log( '' ); console.log( 'Strides: %s', strides.join( ',' ) ); console.log( 'Offset: %d', offset ); - arr = ndarray2array( buffer, shape, strides, offset, order ); + const arr = ndarray2array( buffer, shape, strides, offset, order ); console.log( JSON.stringify( arr ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed/README.md b/lib/node_modules/@stdlib/ndarray/base/to-reversed/README.md index bac1913676b6..d725aa0efca6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/to-reversed/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var toReversed = require( '@stdlib/ndarray/base/to-reversed' ); +const toReversed = require( '@stdlib/ndarray/base/to-reversed' ); ``` #### toReversed( x ) @@ -45,24 +45,24 @@ var toReversed = require( '@stdlib/ndarray/base/to-reversed' ); Returns a new ndarray where the order of elements of an input ndarray is reversed along each dimension. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = toReversed( x ); +const y = toReversed( x ); // returns sh = y.shape; @@ -97,48 +97,48 @@ The function accepts the following arguments: ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var toReversed = require( '@stdlib/ndarray/base/to-reversed' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const toReversed = require( '@stdlib/ndarray/base/to-reversed' ); // Create a linear ndarray buffer: -var buf = zeroTo( 16 ); +const buf = zeroTo( 16 ); // Create a one-dimensional ndarray: -var x1 = array( buf, { +const x1 = array( buf, { 'shape': [ 16 ] }); // Reverse element order: -var y1 = toReversed( x1, false ); +const y1 = toReversed( x1, false ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ] // Create a two-dimensional ndarray: -var x2 = array( buf, { +const x2 = array( buf, { 'shape': [ 4, 4 ] }); // Reverse element order: -var y2 = toReversed( x2, false ); +const y2 = toReversed( x2, false ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 15, 14, 13, 12 ], [ 11, 10, 9, 8 ], [ 7, 6, 5, 4 ], [ 3, 2, 1, 0 ] ] // Create a three-dimensional ndarray: -var x3 = array( buf, { +const x3 = array( buf, { 'shape': [ 2, 4, 2 ] }); // Reverse element order: -var y3 = toReversed( x3, false ); +const y3 = toReversed( x3, false ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 15, 14 ], [ 13, 12 ], [ 11, 10 ], [ 9, 8 ] ], [ [ 7, 6 ], [ 5, 4 ], [ 3, 2 ], [ 1, 0 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/transpose/README.md b/lib/node_modules/@stdlib/ndarray/base/transpose/README.md index f39aa2060df1..f5c585dff241 100644 --- a/lib/node_modules/@stdlib/ndarray/base/transpose/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/transpose/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var transpose = require( '@stdlib/ndarray/base/transpose' ); +const transpose = require( '@stdlib/ndarray/base/transpose' ); ``` #### transpose( x ) @@ -45,21 +45,21 @@ var transpose = require( '@stdlib/ndarray/base/transpose' ); Transposes a matrix (or a stack of matrices) `x`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 2, 3 ] -var y = transpose( x ); +const y = transpose( x ); // returns sh = y.shape; // returns [ 3, 2 ] -var bool = ( x.data === y.data ); +let bool = ( x.data === y.data ); // returns true bool = ( x.get( 0, 1 ) === y.get( 1, 0 ) ); @@ -94,28 +94,21 @@ bool = ( x.get( 0, 1 ) === y.get( 1, 0 ) ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var rpad = require( '@stdlib/string/right-pad' ); -var transpose = require( '@stdlib/ndarray/base/transpose' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const rpad = require( '@stdlib/string/right-pad' ); +const transpose = require( '@stdlib/ndarray/base/transpose' ); function print( arr, name ) { - var str; - var sh; - var p; - var i; - var j; - var k; - - sh = arr.shape; - for ( i = 0; i < sh[0]; i++ ) { - str = name+'['+i+',:,:] = [ '; - p = str.length + 1; - for ( j = 0; j < sh[1]; j++ ) { + const sh = arr.shape; + for ( let i = 0; i < sh[0]; i++ ) { + let str = name+'['+i+',:,:] = [ '; + const p = str.length + 1; + for ( let j = 0; j < sh[1]; j++ ) { if ( j > 0 ) { str += rpad( '\n', p, ' ' ); } - for ( k = 0; k < sh[2]; k++ ) { + for ( let k = 0; k < sh[2]; k++ ) { str += arr.get( i, j, k ); if ( k < sh[2]-1 ) { str += ', '; @@ -127,13 +120,13 @@ function print( arr, name ) { } // Create a data buffer: -var buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Create a stack of matrices: -var x = new ndarray( 'float64', buf, [ 2, 2, 3 ], [ 0, 3, 1 ], 0, 'row-major' ); +const x = new ndarray( 'float64', buf, [ 2, 2, 3 ], [ 0, 3, 1 ], 0, 'row-major' ); // Transpose the stack of matrices: -var y = transpose( x ); +const y = transpose( x ); // Print the stacks: console.log( '' ); diff --git a/lib/node_modules/@stdlib/ndarray/base/unary-by/README.md b/lib/node_modules/@stdlib/ndarray/base/unary-by/README.md index 51c52abc3a16..4ba4c978b3fa 100644 --- a/lib/node_modules/@stdlib/ndarray/base/unary-by/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/unary-by/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unaryBy = require( '@stdlib/ndarray/base/unary-by' ); +const unaryBy = require( '@stdlib/ndarray/base/unary-by' ); ``` #### unaryBy( arrays, fcn, clbk\[, thisArg] ) @@ -43,7 +43,7 @@ Applies a unary function to each element retrieved from an input ndarray accordi ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( x ) { return x * 10.0; @@ -54,22 +54,22 @@ function accessor( v ) { } // Create data buffers: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var ybuf = new Float64Array( 6 ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; -var sy = [ 2, 2, 1 ]; +const sx = [ 4, 4, 1 ]; +const sy = [ 2, 2, 1 ]; // Define the index offsets: -var ox = 1; -var oy = 0; +const ox = 1; +const oy = 0; // Create the input and output ndarray-like objects: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -77,7 +77,7 @@ var x = { 'offset': ox, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -119,7 +119,7 @@ To set the callback execution context, provide a `thisArg`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( x ) { return x * 10.0; @@ -131,22 +131,22 @@ function accessor( v ) { } // Create data buffers: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var ybuf = new Float64Array( 6 ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; -var sy = [ 2, 2, 1 ]; +const sx = [ 4, 4, 1 ]; +const sy = [ 2, 2, 1 ]; // Define the index offsets: -var ox = 1; -var oy = 0; +const ox = 1; +const oy = 0; // Create the input and output ndarray-like objects: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -154,7 +154,7 @@ var x = { 'offset': ox, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -164,12 +164,12 @@ var y = { }; // Apply the unary function: -var context = { +const context = { 'count': 0 }; unaryBy( [ x, y ], scale, accessor, context ); -var cnt = context.count; +const cnt = context.count; // returns 6 ``` @@ -188,7 +188,7 @@ var cnt = context.count; ```javascript - var Float64Array = require( '@stdlib/array/float64' ); + const Float64Array = require( '@stdlib/array/float64' ); function scale( x ) { return x * 10.0; @@ -199,22 +199,22 @@ var cnt = context.count; } // Create data buffers: - var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); - var ybuf = new Float64Array( 6 ); + const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: - var shape = [ 3, 1, 2 ]; + const shape = [ 3, 1, 2 ]; // Define the array strides: - var sx = [ 4, 4, 1 ]; - var sy = [ 2, 2, 1 ]; + const sx = [ 4, 4, 1 ]; + const sy = [ 2, 2, 1 ]; // Define the index offsets: - var ox = 1; - var oy = 0; + const ox = 1; + const oy = 0; // Create the input and output ndarray-like objects: - var x = { + const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -222,7 +222,7 @@ var cnt = context.count; 'offset': ox, 'order': 'row-major' }; - var y = { + const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -249,18 +249,18 @@ var cnt = context.count; ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var unaryBy = require( '@stdlib/ndarray/base/unary-by' ); - -var N = 10; -var x = { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const unaryBy = require( '@stdlib/ndarray/base/unary-by' ); + +const N = 10; +const x = { 'dtype': 'generic', 'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ), 'shape': [ 5, 2 ], @@ -268,7 +268,7 @@ var x = { 'offset': 0, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'generic', 'data': filledarray( 0, N, 'generic' ), 'shape': x.shape.slice(), diff --git a/lib/node_modules/@stdlib/ndarray/base/unary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/unary-loop-interchange-order/README.md index 8e7f69f15408..ceba28da6b02 100644 --- a/lib/node_modules/@stdlib/ndarray/base/unary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/unary-loop-interchange-order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var unaryLoopOrder = require( '@stdlib/ndarray/base/unary-loop-interchange-order' ); +const unaryLoopOrder = require( '@stdlib/ndarray/base/unary-loop-interchange-order' ); ``` #### unaryLoopOrder( shape, stridesX, stridesY ) @@ -46,16 +46,16 @@ Reorders [ndarray][@stdlib/ndarray/ctor] dimensions and associated strides for [ ```javascript // Define an array shape: -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; // Define the strides for the input array: -var stridesX = [ 2, 1 ]; // row-major +const stridesX = [ 2, 1 ]; // row-major // Define the strides for the output array: -var stridesY = [ 1, 2 ]; // column-major +const stridesY = [ 1, 2 ]; // column-major // Resolve the loop interchange order: -var o = unaryLoopOrder( shape, stridesX, stridesY ); +const o = unaryLoopOrder( shape, stridesX, stridesY ); // returns {...} ``` @@ -99,15 +99,15 @@ For all returned arrays, the first element corresponds to the innermost loop, an ```javascript -var array = require( '@stdlib/ndarray/array' ); -var loopOrder = require( '@stdlib/ndarray/base/unary-loop-interchange-order' ); +const array = require( '@stdlib/ndarray/array' ); +const loopOrder = require( '@stdlib/ndarray/base/unary-loop-interchange-order' ); // Create ndarrays: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var y = array( [ [ 0, 0 ], [ 0, 0 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const y = array( [ [ 0, 0 ], [ 0, 0 ] ] ); // Resolve loop interchange data: -var o = loopOrder( x.shape, x.strides, y.strides ); +const o = loopOrder( x.shape, x.strides, y.strides ); // returns {...} console.log( o ); diff --git a/lib/node_modules/@stdlib/ndarray/base/unary-output-dtype/README.md b/lib/node_modules/@stdlib/ndarray/base/unary-output-dtype/README.md index deb215f16bdf..e245a697cd17 100644 --- a/lib/node_modules/@stdlib/ndarray/base/unary-output-dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/unary-output-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); +const unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); ``` #### unaryOutputDataType( dtype, policy ) @@ -45,14 +45,14 @@ var unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); Resolves the output ndarray [data type][@stdlib/ndarray/dtypes] for a unary function according to a [data type policy][@stdlib/ndarray/output-dtype-policies]. ```javascript -var dt = unaryOutputDataType( 'int32', 'floating_point' ); +const dt = unaryOutputDataType( 'int32', 'floating_point' ); // returns 'float64' ``` If `policy` is a [data type][@stdlib/ndarray/dtypes], the function always returns the `policy` value (i.e., the second argument). ```javascript -var dt = unaryOutputDataType( 'float32', 'float64' ); +let dt = unaryOutputDataType( 'float32', 'float64' ); // returns 'float64' dt = unaryOutputDataType( 'int32', 'float64' ); @@ -82,19 +82,19 @@ dt = unaryOutputDataType( 'int32', 'float64' ); ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var map2 = require( '@stdlib/utils/map2' ); -var unzip = require( '@stdlib/utils/unzip' ); -var cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var logEach = require( '@stdlib/console/log-each' ); -var unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const map2 = require( '@stdlib/utils/map2' ); +const unzip = require( '@stdlib/utils/unzip' ); +const cartesianProduct = require( '@stdlib/array/base/cartesian-product' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const logEach = require( '@stdlib/console/log-each' ); +const unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); // Get the list of real-valued data types: -var dt = dtypes( 'real' ); +const dt = dtypes( 'real' ); // Define a list of output data type policies: -var policies = [ +const policies = [ 'default', 'real', 'floating_point', @@ -102,13 +102,13 @@ var policies = [ ]; // Generate dtype-policy argument pairs: -var args = cartesianProduct( dt, policies ); +let args = cartesianProduct( dt, policies ); // Unzip the argument pair array: args = unzip( args ); // Resolve output data types: -var out = map2( args[ 0 ], args[ 1 ], naryFunction( unaryOutputDataType, 2 ) ); +const out = map2( args[ 0 ], args[ 1 ], naryFunction( unaryOutputDataType, 2 ) ); // Print results: logEach( 'dtypes: (%10s, %10s). policy: %s.', args[ 0 ], out, args[ 1 ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/README.md b/lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/README.md index e824ec4fb152..90c496c05703 100644 --- a/lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); +const unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); ``` #### unaryBlockSize( dtypeX, dtypeY ) @@ -45,7 +45,7 @@ var unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); Resolves a loop block size according to provided ndarray [dtypes][@stdlib/ndarray/dtypes] for multi-dimensional array tiled loops applying a unary function. ```javascript -var bsize = unaryBlockSize( 'float64', 'float64' ); +const bsize = unaryBlockSize( 'float64', 'float64' ); // returns ``` @@ -74,18 +74,16 @@ var bsize = unaryBlockSize( 'float64', 'float64' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); -var unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const cartesianSquare = require( '@stdlib/array/base/cartesian-square' ); +const unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); // Generate a list of ndarray dtype pairs: -var dt = cartesianSquare( dtypes() ); +const dt = cartesianSquare( dtypes() ); // Resolve the block size for each dtype pair... -var b; -var i; -for ( i = 0; i < dt.length; i++ ) { - b = unaryBlockSize.apply( null, dt[ i ] ); +for ( let i = 0; i < dt.length; i++ ) { + const b = unaryBlockSize.apply( null, dt[ i ] ); console.log( '%d, %s, %s', b, dt[i][0], dt[i][1] ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/unary/README.md b/lib/node_modules/@stdlib/ndarray/base/unary/README.md index ded88d24673c..b704c34138d5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/unary/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/unary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary = require( '@stdlib/ndarray/base/unary' ); +const unary = require( '@stdlib/ndarray/base/unary' ); ``` #### unary( arrays, fcn ) @@ -43,29 +43,29 @@ Applies a unary callback to elements in an input ndarray and assigns results to ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function scale( x ) { return x * 10.0; } // Create data buffers: -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -var ybuf = new Float64Array( 6 ); +const xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +const ybuf = new Float64Array( 6 ); // Define the shape of the input and output arrays: -var shape = [ 3, 1, 2 ]; +const shape = [ 3, 1, 2 ]; // Define the array strides: -var sx = [ 4, 4, 1 ]; -var sy = [ 2, 2, 1 ]; +const sx = [ 4, 4, 1 ]; +const sy = [ 2, 2, 1 ]; // Define the index offsets: -var ox = 1; -var oy = 0; +const ox = 1; +const oy = 0; // Create the input and output ndarray-like objects: -var x = { +const x = { 'dtype': 'float64', 'data': xbuf, 'shape': shape, @@ -73,7 +73,7 @@ var x = { 'offset': ox, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'float64', 'data': ybuf, 'shape': shape, @@ -124,16 +124,16 @@ Each provided ndarray should be an object with the following properties: ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); -var unary = require( '@stdlib/ndarray/base/unary' ); - -var N = 10; -var x = { +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +const unary = require( '@stdlib/ndarray/base/unary' ); + +const N = 10; +const x = { 'dtype': 'generic', 'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ), 'shape': [ 5, 2 ], @@ -141,7 +141,7 @@ var x = { 'offset': 0, 'order': 'row-major' }; -var y = { +const y = { 'dtype': 'generic', 'data': filledarray( 0, N, 'generic' ), 'shape': x.shape.slice(), diff --git a/lib/node_modules/@stdlib/ndarray/base/vind2bind/README.md b/lib/node_modules/@stdlib/ndarray/base/vind2bind/README.md index e8e5d33a23f3..7f1ce2b5c34f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/vind2bind/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/vind2bind/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); +const vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); ``` #### vind2bind( shape, strides, offset, order, idx, mode ) @@ -45,12 +45,12 @@ var vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); Converts a linear index in an array view to a linear index in an underlying data buffer. ```javascript -var shape = [ 3, 3 ]; -var order = 'row-major'; -var strides = [ -3, 1 ]; -var offset = 6; +const shape = [ 3, 3 ]; +const order = 'row-major'; +const strides = [ -3, 1 ]; +const offset = 6; -var idx = vind2bind( shape, strides, offset, order, 1, 'throw' ); +const idx = vind2bind( shape, strides, offset, order, 1, 'throw' ); // returns 7 ``` @@ -62,12 +62,12 @@ The function supports the following modes: - **clamp**: specifies that the function should set a linear index exceeding array dimensions to either `0` (minimum linear index) or the maximum linear index. ```javascript -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, 1 ]; -var offset = 2; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, 1 ]; +const offset = 2; -var idx = vind2bind( shape, strides, offset, order, -2, 'wrap' ); +let idx = vind2bind( shape, strides, offset, order, -2, 'wrap' ); // returns 0 idx = vind2bind( shape, strides, offset, order, 10, 'clamp' ); @@ -77,12 +77,12 @@ idx = vind2bind( shape, strides, offset, order, 10, 'clamp' ); The `order` parameter specifies whether an array is `row-major` (C-style) or `column-major` (Fortran-style). ```javascript -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, -2 ]; -var offset = 2; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, -2 ]; +const offset = 2; -var idx = vind2bind( shape, strides, offset, order, 2, 'throw' ); +const idx = vind2bind( shape, strides, offset, order, 2, 'throw' ); // returns 0 ``` @@ -107,30 +107,28 @@ var idx = vind2bind( shape, strides, offset, order, 2, 'throw' ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var randu = require( '@stdlib/random/base/randu' ); -var vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const randu = require( '@stdlib/random/base/randu' ); +const vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); // Specify array meta data: -var shape = [ 3, 3, 3 ]; -var order = 'row-major'; +const shape = [ 3, 3, 3 ]; +const order = 'row-major'; // Compute array meta data: -var len = numel( shape ); -var strides = shape2strides( shape, order ); +const len = numel( shape ); +const strides = shape2strides( shape, order ); -// Randomly flip the sign of strides... -var i; -for ( i = 0; i < shape.length; i++ ) { +for ( let i = 0; i < shape.length; i++ ) { if ( randu() < 0.5 ) { strides[ i ] *= -1; } } // Compute the underlying data buffer index offset: -var offset = strides2offset( shape, strides ); +const offset = strides2offset( shape, strides ); // Print array info: console.log( 'Dims: %s', shape.join( 'x' ) ); @@ -138,9 +136,8 @@ console.log( 'Strides: %s', strides.join( ',' ) ); console.log( 'Offset: %d', offset ); // For each view index, determine the corresponding index into an array's underlying data buffer... -var ind; -for ( i = 0; i < len; i++ ) { - ind = vind2bind( shape, strides, offset, order, i, 'throw' ); +for ( let i = 0; i < len; i++ ) { + const ind = vind2bind( shape, strides, offset, order, i, 'throw' ); console.log( 'view[%d] => buffer[%d]', i, ind ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/wrap-index/README.md b/lib/node_modules/@stdlib/ndarray/base/wrap-index/README.md index 1b1b0b5df6b8..f4071d9ce00b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/wrap-index/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/wrap-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); +const wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); ``` #### wrapIndex( idx, max ) @@ -45,7 +45,7 @@ var wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); Wraps an index on the interval `[0,max]`. ```javascript -var idx = wrapIndex( 2, 10 ); +let idx = wrapIndex( 2, 10 ); // returns 2 idx = wrapIndex( -5, 10 ); @@ -76,16 +76,12 @@ idx = wrapIndex( 15, 10 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); -var idx; -var out; -var i; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( -20, 20 ); - out = wrapIndex( idx, 9 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( -20, 20 ); + const out = wrapIndex( idx, 9 ); console.log( '%d => [%d,%d] => %d', idx, 0, 9, out ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/zeros-like/README.md b/lib/node_modules/@stdlib/ndarray/base/zeros-like/README.md index 4392b798feb5..5dfaa573ddb4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/zeros-like/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/zeros-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zerosLike = require( '@stdlib/ndarray/base/zeros-like' ); +const zerosLike = require( '@stdlib/ndarray/base/zeros-like' ); ``` #### zerosLike( x ) @@ -45,15 +45,15 @@ var zerosLike = require( '@stdlib/ndarray/base/zeros-like' ); Creates a zero-filled ndarray having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. ```javascript -var zeros = require( '@stdlib/ndarray/base/zeros' ); +const zeros = require( '@stdlib/ndarray/base/zeros' ); -var x = zeros( 'float64', [ 2, 2 ], 'row-major' ); +const x = zeros( 'float64', [ 2, 2 ], 'row-major' ); // returns -var y = zerosLike( x ); +const y = zerosLike( x ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] ``` @@ -82,20 +82,17 @@ var sh = y.shape; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var zeros = require( '@stdlib/ndarray/base/zeros' ); -var zerosLike = require( '@stdlib/ndarray/base/zeros-like' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const zeros = require( '@stdlib/ndarray/base/zeros' ); +const zerosLike = require( '@stdlib/ndarray/base/zeros-like' ); // Get a list of data types: -var dt = dtypes( 'numeric' ); +const dt = dtypes( 'numeric' ); // Generate zero-filled arrays... -var x; -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = zeros( dt[ i ], [ 2, 2 ], 'row-major' ); - y = zerosLike( x ); +for ( let i = 0; i < dt.length; i++ ) { + const x = zeros( dt[ i ], [ 2, 2 ], 'row-major' ); + const y = zerosLike( x ); console.log( y.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/base/zeros/README.md b/lib/node_modules/@stdlib/ndarray/base/zeros/README.md index 1fae188a6ad4..abd83ba7751f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/zeros/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/zeros/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros = require( '@stdlib/ndarray/base/zeros' ); +const zeros = require( '@stdlib/ndarray/base/zeros' ); ``` #### zeros( dtype, shape, order ) @@ -45,13 +45,13 @@ var zeros = require( '@stdlib/ndarray/base/zeros' ); Creates a zero-filled [ndarray][@stdlib/ndarray/base/ctor] having a specified shape and numeric [data type][@stdlib/ndarray/dtypes]. ```javascript -var arr = zeros( 'float64', [ 2, 2 ], 'row-major' ); +const arr = zeros( 'float64', [ 2, 2 ], 'row-major' ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` @@ -82,17 +82,15 @@ The function accepts the following arguments: ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var zeros = require( '@stdlib/ndarray/base/zeros' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const zeros = require( '@stdlib/ndarray/base/zeros' ); // Get a list of data types: -var dt = dtypes( 'numeric' ); +const dt = dtypes( 'numeric' ); // Generate zero-filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = zeros( dt[ i ], [ 2, 2 ], 'row-major' ); +for ( let i = 0; i < dt.length; i++ ) { + const arr = zeros( dt[ i ], [ 2, 2 ], 'row-major' ); console.log( arr.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/broadcast-array/README.md b/lib/node_modules/@stdlib/ndarray/broadcast-array/README.md index c6fcfb60ae95..f08f12075694 100644 --- a/lib/node_modules/@stdlib/ndarray/broadcast-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/broadcast-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastArray = require( '@stdlib/ndarray/broadcast-array' ); +const broadcastArray = require( '@stdlib/ndarray/broadcast-array' ); ``` #### broadcastArray( x, shape ) @@ -45,14 +45,14 @@ var broadcastArray = require( '@stdlib/ndarray/broadcast-array' ); Broadcasts an [ndarray][@stdlib/ndarray/ctor] to a specified `shape`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast to a 2x2x2 ndarray: -var y = broadcastArray( x, [ 2, 2, 2 ] ); +const y = broadcastArray( x, [ 2, 2, 2 ] ); // returns ``` @@ -83,29 +83,28 @@ var y = broadcastArray( x, [ 2, 2, 2 ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var broadcastArray = require( '@stdlib/ndarray/broadcast-array' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const broadcastArray = require( '@stdlib/ndarray/broadcast-array' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast the array to 3x2x2: -var y = broadcastArray( x, [ 3, 2, 2 ] ); +const y = broadcastArray( x, [ 3, 2, 2 ] ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); // Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/broadcast-arrays/README.md b/lib/node_modules/@stdlib/ndarray/broadcast-arrays/README.md index ee550301c72f..9bd2bab16d80 100644 --- a/lib/node_modules/@stdlib/ndarray/broadcast-arrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/broadcast-arrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var broadcastArrays = require( '@stdlib/ndarray/broadcast-arrays' ); +const broadcastArrays = require( '@stdlib/ndarray/broadcast-arrays' ); ``` #### broadcastArrays( ...arrays ) @@ -45,19 +45,19 @@ var broadcastArrays = require( '@stdlib/ndarray/broadcast-arrays' ); Broadcasts a list of [ndarrays][@stdlib/ndarray/ctor] to a common shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = broadcastArrays( [ x, y ] ); +const out = broadcastArrays( [ x, y ] ); // returns [ , ] ``` @@ -67,19 +67,19 @@ The function supports two (mutually exclusive) means for providing [ndarray][@st 2. providing [ndarray][@stdlib/ndarray/ctor] arguments as separate arguments. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = broadcastArrays( x, y ); +const out = broadcastArrays( x, y ); // returns [ , ] ``` @@ -110,34 +110,33 @@ var out = broadcastArrays( x, y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var broadcastArrays = require( '@stdlib/ndarray/broadcast-arrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const broadcastArrays = require( '@stdlib/ndarray/broadcast-arrays' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 3x2x2 array: -var y = zeros( [ 3, 2, 2 ] ); +const y = zeros( [ 3, 2, 2 ] ); // returns // Broadcast the arrays to a common shape: -var out = broadcastArrays( [ x, y ] ); +const out = broadcastArrays( [ x, y ] ); // returns [ , ] // Retrieve the common shape: -var sh = out[ 0 ].shape; +const sh = out[ 0 ].shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); // Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'X[%s] = %d', ind2sub( sh, i ).join( ', ' ), out[ 0 ].iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/casting-modes/README.md b/lib/node_modules/@stdlib/ndarray/casting-modes/README.md index 8871d9fd6954..0397d7de3f6c 100644 --- a/lib/node_modules/@stdlib/ndarray/casting-modes/README.md +++ b/lib/node_modules/@stdlib/ndarray/casting-modes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var modes = require( '@stdlib/ndarray/casting-modes' ); +const modes = require( '@stdlib/ndarray/casting-modes' ); ``` #### modes() @@ -45,7 +45,7 @@ var modes = require( '@stdlib/ndarray/casting-modes' ); Returns a list of ndarray casting modes. ```javascript -var out = modes(); +const out = modes(); // returns [ 'none', 'equiv', 'safe', 'mostly-safe', 'same-kind', 'unsafe' ] ``` @@ -79,11 +79,10 @@ The output `array` contains the following modes: ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var modes = require( '@stdlib/ndarray/casting-modes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const modes = require( '@stdlib/ndarray/casting-modes' ); -var MODES = modes(); -var bool; +const MODES = modes(); function isMode( str ) { if ( indexOf( MODES, str ) === -1 ) { @@ -92,7 +91,7 @@ function isMode( str ) { return true; } -bool = isMode( 'none' ); +let bool = isMode( 'none' ); // returns true bool = isMode( 'equiv' ); diff --git a/lib/node_modules/@stdlib/ndarray/ctor/README.md b/lib/node_modules/@stdlib/ndarray/ctor/README.md index e0ae7debd911..f96a392c80fe 100644 --- a/lib/node_modules/@stdlib/ndarray/ctor/README.md +++ b/lib/node_modules/@stdlib/ndarray/ctor/README.md @@ -39,7 +39,7 @@ limitations under the License. ## Usage ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); ``` @@ -50,14 +50,14 @@ Returns an `ndarray` instance. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -86,46 +86,46 @@ The constructor supports the following `modes`: By default, an `ndarray` instance **throws** when provided an index which exceeds array dimensions. To support alternative indexing behavior, set the `mode` option, which will affect all public methods for getting and setting array elements. ```javascript -var opts = { +const opts = { 'mode': 'clamp' }; // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order, opts ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order, opts ); // returns // Attempt to access an out-of-bounds linear index (clamped): -var v = arr.iget( 10 ); +const v = arr.iget( 10 ); // returns 4.0 ``` By default, the `mode` option is applied to subscripts which exceed array dimensions. To specify behavior for each dimension, set the `submode` option. ```javascript -var opts = { +const opts = { 'submode': [ 'wrap', 'clamp' ] }; // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2, 2 ]; -var order = 'row-major'; -var strides = [ 4, 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2, 2 ]; +const order = 'row-major'; +const strides = [ 4, 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order, opts ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order, opts ); // returns // Attempt to access out-of-bounds subscripts: -var v = arr.get( -2, 10, -1 ); // linear index: 3 +const v = arr.get( -2, 10, -1 ); // linear index: 3 // returns 4.0 ``` @@ -140,7 +140,7 @@ var v = arr.get( -2, 10, -1 ); // linear index: 3 String value of the ndarray constructor name. ```javascript -var str = ndarray.name; +const str = ndarray.name; // returns 'ndarray' ``` @@ -151,20 +151,20 @@ var str = ndarray.name; Size (in bytes) of the array (if known). ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Specify the array configuration: -var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'float64', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float64', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 32 ``` @@ -172,17 +172,17 @@ If unable to determine the size of the array, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns null ``` @@ -193,20 +193,20 @@ var nbytes = arr.byteLength; Size (in bytes) of each array element (if known). ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Specify the array configuration: -var buffer = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'float32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float32', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -214,17 +214,17 @@ If size of each array element is unknown, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns null ``` @@ -235,23 +235,23 @@ var nbytes = arr.BYTES_PER_ELEMENT; A reference to the underlying data buffer. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); // Specify the array configuration: -var buffer = new Int8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Int8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'int8', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int8', buffer, shape, strides, offset, order ); // Get the buffer reference: -var d = arr.data; +const d = arr.data; // returns [ 1, 2, 3, 4 ] -var bool = ( d === buffer ); +const bool = ( d === buffer ); // returns true ``` @@ -262,20 +262,20 @@ var bool = ( d === buffer ); Underlying [data type][@stdlib/ndarray/dtypes]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Specify the array configuration: -var buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, 1 ]; -var offset = 2; +const buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'uint8', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint8', buffer, shape, strides, offset, order ); // Get the underlying data type: -var dtype = arr.dtype; +const dtype = arr.dtype; // returns 'uint8' ``` @@ -292,20 +292,20 @@ Meta information, such as information regarding the memory layout of the array. An array is contiguous if (1) an array is compatible with being stored in a single memory segment and (2) each array element is adjacent to the next array element. Note that an array can be both row-major contiguous and column-major contiguous at the same time (e.g., if an array is a 1-dimensional ndarray with `strides = [1]`). ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Specify the array configuration: -var buffer = new Int32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, 2 ]; -var offset = 0; +const buffer = new Int32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, 2 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'int32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int32', buffer, shape, strides, offset, order ); // Get the array flags: -var flg = arr.flags; +const flg = arr.flags; // returns {...} ``` @@ -316,20 +316,20 @@ var flg = arr.flags; Number of array elements. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); // Specify the array configuration: -var buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, -2 ]; -var offset = 3; +const buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, -2 ]; +const offset = 3; // Create a new ndarray: -var arr = ndarray( 'uint16', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint16', buffer, shape, strides, offset, order ); // Get the array length: -var len = arr.length; +const len = arr.length; // returns 4 ``` @@ -340,20 +340,20 @@ var len = arr.length; Number of dimensions. ```javascript -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); // Specify the array configuration: -var buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 3; +const buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 3; // Create a new ndarray: -var arr = ndarray( 'uint8c', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint8c', buffer, shape, strides, offset, order ); // Get the number of dimensions: -var ndims = arr.ndims; +const ndims = arr.ndims; // returns 2 ``` @@ -364,20 +364,20 @@ var ndims = arr.ndims; Index offset which specifies the `buffer` index at which to start iterating over array elements. ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); // Specify the array configuration: -var buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 10; +const buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 10; // Create a new ndarray: -var arr = ndarray( 'int16', buffer, shape, strides, offset, order ); +const arr = ndarray( 'int16', buffer, shape, strides, offset, order ); // Get the index offset: -var o = arr.offset; +const o = arr.offset; // returns 10 ``` @@ -388,20 +388,20 @@ var o = arr.offset; Array order. The array order is either row-major (C-style) or column-major (Fortran-style). ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); // Specify the array configuration: -var buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'uint32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'uint32', buffer, shape, strides, offset, order ); // Get the array order: -var ord = arr.order; +const ord = arr.order; // returns 'row-major' ``` @@ -413,17 +413,17 @@ Returns a copy of the array shape. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the array shape: -var dims = arr.shape; +const dims = arr.shape; // returns [ 2, 2 ] ``` @@ -435,17 +435,17 @@ Returns a copy of the array strides which specify how to access data along corre ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, 2 ]; -var offset = 1; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, 2 ]; +const offset = 1; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the array strides: -var s = arr.strides; +const s = arr.strides; // returns [ -1, 2 ] ``` @@ -461,17 +461,17 @@ Returns an array element specified according to provided subscripts. The number ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at (1,1): -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 6.0 ``` @@ -483,17 +483,17 @@ Returns an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at index 3: -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 6.0 ``` @@ -507,22 +507,22 @@ Sets an array element specified according to provided subscripts. The number of ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at (1,1): arr.set( 1, 1, 40.0 ); -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 40.0 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1.0, 2.0, 3.0, 40.0 ] ``` @@ -536,22 +536,22 @@ Sets an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at index 3: arr.iset( 3, 40.0 ); -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 40.0 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1.0, 2.0, 3.0, 40.0 ] ``` @@ -567,17 +567,17 @@ Serializes an `ndarray` as a `string`. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Serialize to a string: -var str = arr.toString(); +const str = arr.toString(); // returns "ndarray( 'generic', [ 3, 4, 5, 6, 7, 8 ], [ 3, 2 ], [ 2, 1 ], 0, 'row-major' )" ``` @@ -591,17 +591,17 @@ Serializes an `ndarray` as a [JSON][json] `object`. `JSON.stringify()` implicitl ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new ndarray: -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // Serialize to JSON: -var o = arr.toJSON(); +const o = arr.toJSON(); // returns { 'type': 'ndarray', 'dtype': 'generic', 'flags': {...}, 'offset': 0, 'order': 'row-major', 'shape': [ 3, 2 ], 'strides': [ 2, 1 ], 'data': [ 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] } ``` @@ -620,14 +620,14 @@ The method does **not** serialize data outside of the buffer region defined by t - To create a zero-dimensional array, provide an empty `shape` and a single `strides` element equal to `0`. The `order` can be either `row-major` or `column-major` and has no effect on data storage or access. ```javascript - var buffer = [ 1 ]; - var shape = []; - var order = 'row-major'; - var strides = [ 0 ]; - var offset = 0; + const buffer = [ 1 ]; + const shape = []; + const order = 'row-major'; + const strides = [ 0 ]; + const offset = 0; // Create a new zero-dimensional array: - var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); + const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -646,29 +646,29 @@ The method does **not** serialize data outside of the buffer region defined by t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); // Create a data buffer: -var buffer = new Float32Array( (3*3*3*3) + 100 ); +const buffer = new Float32Array( (3*3*3*3) + 100 ); // Specify the array shape: -var shape = [ 3, 3, 3, 3 ]; +const shape = [ 3, 3, 3, 3 ]; // Specify the array strides: -var strides = [ 27, 9, 3, 1 ]; +const strides = [ 27, 9, 3, 1 ]; // Specify the index offset: -var offset = 4; +const offset = 4; // Specify the order: -var order = 'row-major'; // C-style +const order = 'row-major'; // C-style // Create a new ndarray: -var arr = ndarray( 'float32', buffer, shape, strides, offset, order ); +const arr = ndarray( 'float32', buffer, shape, strides, offset, order ); // Retrieve an array value: -var v = arr.get( 1, 2, 1, 2 ); +let v = arr.get( 1, 2, 1, 2 ); // returns 0.0 // Set an array value: @@ -679,7 +679,7 @@ v = arr.get( 1, 2, 1, 2 ); // returns 10.0 // Serialize the array as a string: -var str = arr.toString(); +let str = arr.toString(); // returns "ndarray( 'float32', new Float32Array( [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ), [ 3, 3, 3, 3 ], [ 27, 9, 3, 1 ], 0, 'row-major' )" // Serialize the array as JSON: diff --git a/lib/node_modules/@stdlib/ndarray/data-buffer/README.md b/lib/node_modules/@stdlib/ndarray/data-buffer/README.md index 3d9d095f0bcf..ab013574c0c3 100644 --- a/lib/node_modules/@stdlib/ndarray/data-buffer/README.md +++ b/lib/node_modules/@stdlib/ndarray/data-buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var data = require( '@stdlib/ndarray/data-buffer' ); +const data = require( '@stdlib/ndarray/data-buffer' ); ``` #### data( x ) @@ -45,14 +45,14 @@ var data = require( '@stdlib/ndarray/data-buffer' ); Returns the underlying data buffer of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'dtype': 'float64' }); // returns -var out = data( x ); +const out = data( x ); // returns ``` @@ -77,17 +77,17 @@ var out = data( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var data = require( '@stdlib/ndarray/data-buffer' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const data = require( '@stdlib/ndarray/data-buffer' ); // Create a 'float64' array... -var opts = { +let opts = { 'dtype': 'float64' }; -var x = zeros( [ 2, 2 ], opts ); +let x = zeros( [ 2, 2 ], opts ); // returns -var buf = data( x ); +let buf = data( x ); // returns // Create a 'float32' array... diff --git a/lib/node_modules/@stdlib/ndarray/defaults/README.md b/lib/node_modules/@stdlib/ndarray/defaults/README.md index f3ce80d3ece3..59222d4fa879 100644 --- a/lib/node_modules/@stdlib/ndarray/defaults/README.md +++ b/lib/node_modules/@stdlib/ndarray/defaults/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var defaults = require( '@stdlib/ndarray/defaults' ); +const defaults = require( '@stdlib/ndarray/defaults' ); ``` #### defaults() @@ -45,7 +45,7 @@ var defaults = require( '@stdlib/ndarray/defaults' ); Returns default ndarray settings. ```javascript -var out = defaults(); +const out = defaults(); // returns {...} ``` @@ -75,7 +75,7 @@ The returned object has the following properties: Returns the setting value for a provided setting `name`. ```javascript -var v = defaults.get( 'order' ); +let v = defaults.get( 'order' ); // returns v = defaults.get( 'dtypes.floating_point' ); @@ -105,20 +105,20 @@ The setting `name` corresponds to a flattened object path. For example, the sett ```javascript -var array = require( '@stdlib/ndarray/array' ); -var defaults = require( '@stdlib/ndarray/defaults' ); +const array = require( '@stdlib/ndarray/array' ); +const defaults = require( '@stdlib/ndarray/defaults' ); -var o = defaults(); +const o = defaults(); -var buf = [ [ 1, 2 ], [ 3, 4 ] ]; -var opts = { +const buf = [ [ 1, 2 ], [ 3, 4 ] ]; +const opts = { 'order': o.order, 'casting': 'unsafe', 'mode': o.index_mode }; opts.dtype = o.dtypes.default; -var x = array( buf, opts ); +let x = array( buf, opts ); console.log( x.dtype ); opts.dtype = o.dtypes.floating_point; diff --git a/lib/node_modules/@stdlib/ndarray/dispatch-by/README.md b/lib/node_modules/@stdlib/ndarray/dispatch-by/README.md index ae8aa0c51019..26586fdb5d81 100644 --- a/lib/node_modules/@stdlib/ndarray/dispatch-by/README.md +++ b/lib/node_modules/@stdlib/ndarray/dispatch-by/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dispatchBy = require( '@stdlib/ndarray/dispatch-by' ); +const dispatchBy = require( '@stdlib/ndarray/dispatch-by' ); ``` #### dispatchBy( fcns, types, data, nargs, nin, nout ) @@ -93,7 +93,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/ndarray/base/unary-by' ); + const unary = require( '@stdlib/ndarray/base/unary-by' ); function foo( x ) { return x * 10.0; @@ -103,20 +103,20 @@ The function accepts the following arguments: return x * 5.0; } - var fcns = [ + const fcns = [ unary, unary ]; - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var fcn = dispatchBy( fcns, types, data, 2, 1, 1 ); + const fcn = dispatchBy( fcns, types, data, 2, 1, 1 ); ``` is equivalent to @@ -124,7 +124,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/ndarray/base/unary-by' ); + const unary = require( '@stdlib/ndarray/base/unary-by' ); function foo( x ) { return x * 10.0; @@ -134,16 +134,16 @@ The function accepts the following arguments: return x * 5.0; } - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var fcn = dispatchBy( unary, types, data, 2, 1, 1 ); + const fcn = dispatchBy( unary, types, data, 2, 1, 1 ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/dispatch/README.md b/lib/node_modules/@stdlib/ndarray/dispatch/README.md index cd3dd47ff530..f868a2596ac0 100644 --- a/lib/node_modules/@stdlib/ndarray/dispatch/README.md +++ b/lib/node_modules/@stdlib/ndarray/dispatch/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/ndarray/dispatch' ); +const dispatch = require( '@stdlib/ndarray/dispatch' ); ``` #### dispatch( fcns, types, data, nargs, nin, nout ) @@ -43,10 +43,10 @@ Returns an [ndarray][@stdlib/ndarray/ctor] function interface which performs mul ```javascript -var unary = require( '@stdlib/ndarray/base/unary' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const unary = require( '@stdlib/ndarray/base/unary' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); function foo( x ) { return x * 10.0; @@ -57,42 +57,42 @@ function bar( x ) { } // Define a list of ndarray functions for applying a unary callback: -var fcns = [ +const fcns = [ unary, unary ]; // Define a one-dimensional list of input and output array types: -var types = [ +const types = [ 'float64', 'float64', // input, output 'float32', 'float32' // input, output ]; // Define a list of callbacks which should be applied based on the provided array types: -var data = [ +const data = [ foo, bar ]; // Define the total number of input arguments: -var nargs = 2; // input_array + output_array +const nargs = 2; // input_array + output_array // Define the number of input ndarrays: -var nin = 1; +const nin = 1; // Define the number of output ndarrays: -var nout = 1; +const nout = 1; // Create an ndarray function interface: -var fcn = dispatch( fcns, types, data, nargs, nin, nout ); +const fcn = dispatch( fcns, types, data, nargs, nin, nout ); // ... -var xbuf = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var ybuf = new Float64Array( xbuf.length ); +let xbuf = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let ybuf = new Float64Array( xbuf.length ); -var x = ndarray( 'float64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' ); -var y = ndarray( 'float64', ybuf, [ 3 ], [ 1 ], 0, 'row-major' ); +let x = ndarray( 'float64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' ); +let y = ndarray( 'float64', ybuf, [ 3 ], [ 1 ], 0, 'row-major' ); fcn( x, y ); // ybuf => [ 10.0, 20.0, 30.0 ] @@ -154,7 +154,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/ndarray/base/unary' ); + const unary = require( '@stdlib/ndarray/base/unary' ); function foo( x ) { return x * 10.0; @@ -164,20 +164,20 @@ The function accepts the following arguments: return x * 5.0; } - var fcns = [ + const fcns = [ unary, unary ]; - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var fcn = dispatch( fcns, types, data, 2, 1, 1 ); + const fcn = dispatch( fcns, types, data, 2, 1, 1 ); ``` is equivalent to @@ -185,7 +185,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/ndarray/base/unary' ); + const unary = require( '@stdlib/ndarray/base/unary' ); function foo( x ) { return x * 10.0; @@ -195,16 +195,16 @@ The function accepts the following arguments: return x * 5.0; } - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var fcn = dispatch( unary, types, data, 2, 1, 1 ); + const fcn = dispatch( unary, types, data, 2, 1, 1 ); ``` @@ -218,25 +218,25 @@ The function accepts the following arguments: ```javascript -var unary = require( '@stdlib/ndarray/base/unary' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dispatch = require( '@stdlib/ndarray/dispatch' ); +const unary = require( '@stdlib/ndarray/base/unary' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatch = require( '@stdlib/ndarray/dispatch' ); -var types = [ 'float64', 'float64' ]; +const types = [ 'float64', 'float64' ]; -var data = [ +const data = [ abs ]; -var absolute = dispatch( unary, types, data, 2, 1, 1 ); +const absolute = dispatch( unary, types, data, 2, 1, 1 ); -var xbuf = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const xbuf = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var x = ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); -var y = ndarray( 'float64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' ); +const x = ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +const y = ndarray( 'float64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' ); absolute( x, y ); console.log( ybuf ); diff --git a/lib/node_modules/@stdlib/ndarray/dtype/README.md b/lib/node_modules/@stdlib/ndarray/dtype/README.md index 7c89d06dcb02..104996eecf49 100644 --- a/lib/node_modules/@stdlib/ndarray/dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype = require( '@stdlib/ndarray/dtype' ); +const dtype = require( '@stdlib/ndarray/dtype' ); ``` #### dtype( x ) @@ -45,14 +45,14 @@ var dtype = require( '@stdlib/ndarray/dtype' ); Returns the [data type][@stdlib/ndarray/dtypes] of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'dtype': 'float64' }); // returns -var dt = dtype( x ); +const dt = dtype( x ); // returns 'float64' ``` @@ -79,18 +79,18 @@ var dt = dtype( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var dtype = require( '@stdlib/ndarray/dtype' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const dtype = require( '@stdlib/ndarray/dtype' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -108,10 +108,8 @@ var slices = [ ]; // Determine the data type for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %s', s.dtype, dtype( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/dtypes/README.md b/lib/node_modules/@stdlib/ndarray/dtypes/README.md index be50ebcd65f7..b8788606b6cb 100644 --- a/lib/node_modules/@stdlib/ndarray/dtypes/README.md +++ b/lib/node_modules/@stdlib/ndarray/dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); ``` #### dtypes( \[kind] ) @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/ndarray/dtypes' ); Returns a list of ndarray data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'binary', 'complex64', 'complex128', ... ] ``` @@ -69,7 +69,7 @@ When not provided a data type "kind", the function returns an array containing t To return the subset of data types belonging to a specified data type kind, provide a `kind` argument. ```javascript -var out = dtypes( 'floating_point' ); +const out = dtypes( 'floating_point' ); // returns [...] ``` @@ -90,7 +90,7 @@ The function supports the following data type kinds: Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`). ```javascript -var out = dtypes( 'floating_point_and_generic' ); +const out = dtypes( 'floating_point_and_generic' ); // returns [...] ``` @@ -115,12 +115,12 @@ var out = dtypes( 'floating_point_and_generic' ); ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var dtypes = require( '@stdlib/ndarray/dtypes' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const dtypes = require( '@stdlib/ndarray/dtypes' ); -var isdtype = contains( dtypes() ); +const isdtype = contains( dtypes() ); -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/ndarray/empty-like/README.md b/lib/node_modules/@stdlib/ndarray/empty-like/README.md index 923b9584ac4f..d34be91326da 100644 --- a/lib/node_modules/@stdlib/ndarray/empty-like/README.md +++ b/lib/node_modules/@stdlib/ndarray/empty-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var emptyLike = require( '@stdlib/ndarray/empty-like' ); +const emptyLike = require( '@stdlib/ndarray/empty-like' ); ``` #### emptyLike( x\[, options] ) @@ -45,18 +45,18 @@ var emptyLike = require( '@stdlib/ndarray/empty-like' ); Creates an uninitialized [ndarray][@stdlib/ndarray/ctor] having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 2, 2 ] ); +const x = zeros( [ 2, 2 ] ); // returns -var y = emptyLike( x ); +const y = emptyLike( x ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] -var dt = y.dtype; +const dt = y.dtype; // returns 'float64' ``` @@ -71,20 +71,20 @@ The function supports the following `options`: To override either the `dtype`, `shape`, or `order`, specify the corresponding option. For example, to override the inferred [data type][@stdlib/ndarray/dtypes], ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 2, 2 ] ); +const x = zeros( [ 2, 2 ] ); // returns -var dt = x.dtype; +let dt = x.dtype; // returns 'float64' -var y = emptyLike( x, { +const y = emptyLike( x, { 'dtype': 'int32' }); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] dt = y.dtype; @@ -117,22 +117,19 @@ dt = y.dtype; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var empty = require( '@stdlib/ndarray/empty' ); -var emptyLike = require( '@stdlib/ndarray/empty-like' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const empty = require( '@stdlib/ndarray/empty' ); +const emptyLike = require( '@stdlib/ndarray/empty-like' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); // Generate uninitialized arrays... -var x; -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = empty( [ 2, 2 ], { +for ( let i = 0; i < dt.length; i++ ) { + const x = empty( [ 2, 2 ], { 'dtype': dt[ i ] }); - y = emptyLike( x ); + const y = emptyLike( x ); console.log( y.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/empty/README.md b/lib/node_modules/@stdlib/ndarray/empty/README.md index 86bfdec4452e..97262186d06f 100644 --- a/lib/node_modules/@stdlib/ndarray/empty/README.md +++ b/lib/node_modules/@stdlib/ndarray/empty/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var empty = require( '@stdlib/ndarray/empty' ); +const empty = require( '@stdlib/ndarray/empty' ); ``` #### empty( shape\[, options] ) @@ -45,26 +45,26 @@ var empty = require( '@stdlib/ndarray/empty' ); Creates an uninitialized [ndarray][@stdlib/ndarray/ctor] having a specified shape and [data type][@stdlib/ndarray/dtypes]. ```javascript -var arr = empty( [ 2, 2 ] ); +const arr = empty( [ 2, 2 ] ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` The specified output [ndarray][@stdlib/ndarray/ctor] `shape` may be either an array-like object or an integer value. ```javascript -var arr = empty( 2 ); +const arr = empty( 2 ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` @@ -78,15 +78,15 @@ The function accepts the following `options`: By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [`float64`][@stdlib/ndarray/dtypes] data type. To specify an alternative [data type][@stdlib/ndarray/dtypes], provide a `dtype` option. ```javascript -var arr = empty( [ 2, 2 ], { +const arr = empty( [ 2, 2 ], { 'dtype': 'float32' }); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float32' ``` @@ -116,16 +116,15 @@ var dt = arr.dtype; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var empty = require( '@stdlib/ndarray/empty' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const empty = require( '@stdlib/ndarray/empty' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); // Generate uninitialized arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { +let arr; +for ( let i = 0; i < dt.length; i++ ) { arr = empty( [ 2, 2 ], { 'dtype': dt[ i ] }); diff --git a/lib/node_modules/@stdlib/ndarray/fancy/README.md b/lib/node_modules/@stdlib/ndarray/fancy/README.md index 71fe96cc41e3..cba0e66944b8 100644 --- a/lib/node_modules/@stdlib/ndarray/fancy/README.md +++ b/lib/node_modules/@stdlib/ndarray/fancy/README.md @@ -31,18 +31,18 @@ limitations under the License. A **FancyArray** is an [`ndarray`][@stdlib/ndarray/ctor] which supports slicing via indexing expressions. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var FancyArray = require( '@stdlib/ndarray/fancy' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const FancyArray = require( '@stdlib/ndarray/fancy' ); -var buffer = [ 1, 2, 3, 4, 5, 6 ]; -var x = new FancyArray( 'generic', buffer, [ 6 ], [ 1 ], 0, 'row-major' ); +const buffer = [ 1, 2, 3, 4, 5, 6 ]; +const x = new FancyArray( 'generic', buffer, [ 6 ], [ 1 ], 0, 'row-major' ); // returns // Select the first 3 elements: -var y = x[ ':3' ]; +let y = x[ ':3' ]; // returns -var arr = ndarray2array( y ); +let arr = ndarray2array( y ); // returns [ 1, 2, 3 ] // Select every other element, starting with the second element: @@ -71,7 +71,7 @@ arr = ndarray2array( y ); ## Usage ```javascript -var FancyArray = require( '@stdlib/ndarray/fancy' ); +const FancyArray = require( '@stdlib/ndarray/fancy' ); ``` @@ -82,14 +82,14 @@ Returns a `FancyArray` instance. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -118,46 +118,46 @@ The constructor supports the following `modes`: By default, a `FancyArray` instance **throws** when provided an index which exceeds array dimensions. To support alternative indexing behavior, set the `mode` option, which will affect all public **methods** (but **not** slicing semantics) for getting and setting array elements. ```javascript -var opts = { +const opts = { 'mode': 'clamp' }; // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order, opts ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order, opts ); // returns // Attempt to access an out-of-bounds linear index (clamped): -var v = arr.iget( 10 ); +const v = arr.iget( 10 ); // returns 4.0 ``` By default, the `mode` option is applied to subscripts which exceed array dimensions. To specify behavior for each dimension, set the `submode` option. ```javascript -var opts = { +const opts = { 'submode': [ 'wrap', 'clamp' ] }; // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2, 2 ]; -var order = 'row-major'; -var strides = [ 4, 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2, 2 ]; +const order = 'row-major'; +const strides = [ 4, 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order, opts ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order, opts ); // returns // Attempt to access out-of-bounds subscripts: -var v = arr.get( -2, 10, -1 ); // linear index: 3 +const v = arr.get( -2, 10, -1 ); // linear index: 3 // returns 4.0 ``` @@ -172,7 +172,7 @@ var v = arr.get( -2, 10, -1 ); // linear index: 3 String value of the constructor name. ```javascript -var str = FancyArray.name; +const str = FancyArray.name; // returns 'ndarray' ``` @@ -183,20 +183,20 @@ var str = FancyArray.name; Size (in bytes) of the array (if known). ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Specify the array configuration: -var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'float64', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'float64', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns 32 ``` @@ -204,17 +204,17 @@ If unable to determine the size of the array, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the byte length: -var nbytes = arr.byteLength; +const nbytes = arr.byteLength; // returns null ``` @@ -225,20 +225,20 @@ var nbytes = arr.byteLength; Size (in bytes) of each array element (if known). ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Specify the array configuration: -var buffer = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'float32', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'float32', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns 4 ``` @@ -246,17 +246,17 @@ If size of each array element is unknown, the property value is `null`. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the number of bytes per element: -var nbytes = arr.BYTES_PER_ELEMENT; +const nbytes = arr.BYTES_PER_ELEMENT; // returns null ``` @@ -267,23 +267,23 @@ var nbytes = arr.BYTES_PER_ELEMENT; A reference to the underlying data buffer. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); // Specify the array configuration: -var buffer = new Int8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Int8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'int8', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'int8', buffer, shape, strides, offset, order ); // Get the buffer reference: -var d = arr.data; +const d = arr.data; // returns [ 1, 2, 3, 4 ] -var bool = ( d === buffer ); +const bool = ( d === buffer ); // returns true ``` @@ -294,20 +294,20 @@ var bool = ( d === buffer ); Underlying [data type][@stdlib/ndarray/dtypes]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); // Specify the array configuration: -var buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, 1 ]; -var offset = 2; +const buffer = new Uint8Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'uint8', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'uint8', buffer, shape, strides, offset, order ); // Get the underlying data type: -var dtype = arr.dtype; +const dtype = arr.dtype; // returns 'uint8' ``` @@ -324,20 +324,20 @@ Meta information, such as information regarding the memory layout of the array. An array is contiguous if (1) an array is compatible with being stored in a single memory segment and (2) each array element is adjacent to the next array element. Note that an array can be both row-major contiguous and column-major contiguous at the same time (e.g., if an array is a 1-dimensional array with `strides = [1]`). ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Specify the array configuration: -var buffer = new Int32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ 1, 2 ]; -var offset = 0; +const buffer = new Int32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ 1, 2 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'int32', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'int32', buffer, shape, strides, offset, order ); // Get the array flags: -var flg = arr.flags; +const flg = arr.flags; // returns {...} ``` @@ -348,20 +348,20 @@ var flg = arr.flags; Number of array elements. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); // Specify the array configuration: -var buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, -2 ]; -var offset = 3; +const buffer = new Uint16Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, -2 ]; +const offset = 3; // Create a new array: -var arr = new FancyArray( 'uint16', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'uint16', buffer, shape, strides, offset, order ); // Get the array length: -var len = arr.length; +const len = arr.length; // returns 4 ``` @@ -372,20 +372,20 @@ var len = arr.length; Number of dimensions. ```javascript -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); // Specify the array configuration: -var buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 3; +const buffer = new Uint8ClampedArray( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 3; // Create a new array: -var arr = new FancyArray( 'uint8c', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'uint8c', buffer, shape, strides, offset, order ); // Get the number of dimensions: -var ndims = arr.ndims; +const ndims = arr.ndims; // returns 2 ``` @@ -396,20 +396,20 @@ var ndims = arr.ndims; Index offset which specifies the `buffer` index at which to start iterating over array elements. ```javascript -var Int16Array = require( '@stdlib/array/int16' ); +const Int16Array = require( '@stdlib/array/int16' ); // Specify the array configuration: -var buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ -2, -1 ]; -var offset = 10; +const buffer = new Int16Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ -2, -1 ]; +const offset = 10; // Create a new array: -var arr = new FancyArray( 'int16', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'int16', buffer, shape, strides, offset, order ); // Get the index offset: -var o = arr.offset; +const o = arr.offset; // returns 10 ``` @@ -420,20 +420,20 @@ var o = arr.offset; Array order. The array order is either row-major (C-style) or column-major (Fortran-style). ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); // Specify the array configuration: -var buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = new Uint32Array( [ 1, 2, 3, 4 ] ); +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'uint32', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'uint32', buffer, shape, strides, offset, order ); // Get the array order: -var ord = arr.order; +const ord = arr.order; // returns 'row-major' ``` @@ -445,17 +445,17 @@ Returns a copy of the array shape. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the array shape: -var dims = arr.shape; +const dims = arr.shape; // returns [ 2, 2 ] ``` @@ -467,17 +467,17 @@ Returns a copy of the array strides which specify how to access data along corre ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'column-major'; -var strides = [ -1, 2 ]; -var offset = 1; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'column-major'; +const strides = [ -1, 2 ]; +const offset = 1; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the array strides: -var s = arr.strides; +const s = arr.strides; // returns [ -1, 2 ] ``` @@ -493,17 +493,17 @@ Returns an array element specified according to provided subscripts. The number ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at (1,1): -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 6.0 ``` @@ -515,17 +515,17 @@ Returns an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Get the element located at index 3: -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 6.0 ``` @@ -539,22 +539,22 @@ Sets an array element specified according to provided subscripts. The number of ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at (1,1): arr.set( 1, 1, 40.0 ); -var v = arr.get( 1, 1 ); +const v = arr.get( 1, 1 ); // returns 40.0 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1.0, 2.0, 3.0, 40.0 ] ``` @@ -568,22 +568,22 @@ Sets an array element located at a specified linear index. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Set the element located at index 3: arr.iset( 3, 40.0 ); -var v = arr.iget( 3 ); +const v = arr.iget( 3 ); // returns 40.0 // Get the underlying buffer: -var d = arr.data; +const d = arr.data; // returns [ 1.0, 2.0, 3.0, 40.0 ] ``` @@ -599,17 +599,17 @@ Serializes a `FancyArray` as a string. ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Serialize to a string: -var str = arr.toString(); +const str = arr.toString(); // returns "ndarray( 'generic', [ 3, 4, 5, 6, 7, 8 ], [ 3, 2 ], [ 2, 1 ], 0, 'row-major' )" ``` @@ -623,17 +623,17 @@ Serializes a `FancyArray` as a [JSON][json] object. `JSON.stringify()` implicitl ```javascript // Specify the array configuration: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; -var shape = [ 3, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 2; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; +const shape = [ 3, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 2; // Create a new array: -var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); +const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // Serialize to JSON: -var o = arr.toJSON(); +const o = arr.toJSON(); // returns { 'type': 'ndarray', 'dtype': 'generic', 'flags': {...}, 'offset': 0, 'order': 'row-major', 'shape': [ 3, 2 ], 'strides': [ 2, 1 ], 'data': [ 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] } ``` @@ -654,14 +654,14 @@ The method does **not** serialize data outside of the buffer region defined by t - To create a zero-dimensional array, provide an empty `shape` and a single `strides` element equal to `0`. The `order` can be either `row-major` or `column-major` and has no effect on data storage or access. ```javascript - var buffer = [ 1 ]; - var shape = []; - var order = 'row-major'; - var strides = [ 0 ]; - var offset = 0; + const buffer = [ 1 ]; + const shape = []; + const order = 'row-major'; + const strides = [ 0 ]; + const offset = 0; // Create a new zero-dimensional array: - var arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); + const arr = new FancyArray( 'generic', buffer, shape, strides, offset, order ); // returns ``` @@ -688,31 +688,31 @@ The method does **not** serialize data outside of the buffer region defined by t ```javascript -var S = require( '@stdlib/slice/ctor' ); -var E = require( '@stdlib/slice/multi' ); -var toArray = require( '@stdlib/ndarray/to-array' ); -var FancyArray = require( '@stdlib/ndarray/fancy' ); +const S = require( '@stdlib/slice/ctor' ); +const E = require( '@stdlib/slice/multi' ); +const toArray = require( '@stdlib/ndarray/to-array' ); +const FancyArray = require( '@stdlib/ndarray/fancy' ); -var buffer = [ +const buffer = [ 1, 2, 3, 4, // 0 5, 6, // 1 7, 8, // 2 9, 10 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 2; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 2; -var x = new FancyArray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = new FancyArray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns // Access an ndarray property: -var ndims = x.ndims; +const ndims = x.ndims; // returns 2 // Retrieve an ndarray element: -var v = x.get( 2, 1 ); +let v = x.get( 2, 1 ); // returns 8 // Set an ndarray element: @@ -721,29 +721,29 @@ v = x.get( 2, 1 ); // returns 20 // Create an alias for `undefined` for more concise slicing expressions: -var _ = void 0; +const _ = void 0; // Create a multi-dimensional slice: -var s = E( S(0,_,2), _ ); +const s = E( S(0,_,2), _ ); // returns // Use the slice to create a view on the original ndarray: -var y1 = x[ s ]; +const y1 = x[ s ]; console.log( toArray( y1 ) ); // => [ [ 3, 4 ], [ 7, 20 ] ] // Use alternative syntax: -var y2 = x[ [ S(0,_,2), _ ] ]; +const y2 = x[ [ S(0,_,2), _ ] ]; console.log( toArray( y2 ) ); // => [ [ 3, 4 ], [ 7, 20 ] ] // Use alternative syntax: -var y3 = x[ '0::2,:' ]; +const y3 = x[ '0::2,:' ]; console.log( toArray( y3 ) ); // => [ [ 3, 4 ], [ 7, 20 ] ] // Flip dimensions: -var y4 = x[ [ S(_,_,-2), S(_,_,-1) ] ]; +const y4 = x[ [ S(_,_,-2), S(_,_,-1) ] ]; console.log( toArray( y4 ) ); // => [ [ 20, 7 ], [ 4, 3 ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/flag/README.md b/lib/node_modules/@stdlib/ndarray/flag/README.md index 04013715d6ef..e9b0451d79a8 100644 --- a/lib/node_modules/@stdlib/ndarray/flag/README.md +++ b/lib/node_modules/@stdlib/ndarray/flag/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flag = require( '@stdlib/ndarray/flag' ); +const flag = require( '@stdlib/ndarray/flag' ); ``` #### flag( x, name ) @@ -45,12 +45,12 @@ var flag = require( '@stdlib/ndarray/flag' ); Returns a specified flag for a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var o = flag( x, 'READONLY' ); +const o = flag( x, 'READONLY' ); // returns ``` @@ -81,18 +81,18 @@ var o = flag( x, 'READONLY' ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var flag = require( '@stdlib/ndarray/flag' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const flag = require( '@stdlib/ndarray/flag' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -110,10 +110,8 @@ var slices = [ ]; // Check whether each slice is row-major contiguous... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s', flag( s, 'ROW_MAJOR_CONTIGUOUS' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/flags/README.md b/lib/node_modules/@stdlib/ndarray/flags/README.md index eab822f3a153..7695b1e77f9f 100644 --- a/lib/node_modules/@stdlib/ndarray/flags/README.md +++ b/lib/node_modules/@stdlib/ndarray/flags/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var flags = require( '@stdlib/ndarray/flags' ); +const flags = require( '@stdlib/ndarray/flags' ); ``` #### flags( x ) @@ -45,12 +45,12 @@ var flags = require( '@stdlib/ndarray/flags' ); Returns the flags of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var o = flags( x ); +const o = flags( x ); // returns {...} ``` @@ -77,18 +77,18 @@ var o = flags( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var flags = require( '@stdlib/ndarray/flags' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const flags = require( '@stdlib/ndarray/flags' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -105,11 +105,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Retrieve the flags for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s', JSON.stringify( flags( s ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/from-scalar/README.md b/lib/node_modules/@stdlib/ndarray/from-scalar/README.md index 5098d00451e2..719978490a1b 100644 --- a/lib/node_modules/@stdlib/ndarray/from-scalar/README.md +++ b/lib/node_modules/@stdlib/ndarray/from-scalar/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); ``` #### scalar2ndarray( value\[, options] ) @@ -45,16 +45,16 @@ var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); Returns a zero-dimensional [`ndarray`][@stdlib/ndarray/ctor] containing a provided scalar `value`. ```javascript -var x = scalar2ndarray( 1.0 ); +const x = scalar2ndarray( 1.0 ); // returns -var sh = x.shape; +const sh = x.shape; // returns [] -var dt = x.dtype; +const dt = x.dtype; // returns 'float64' -var v = x.get(); +const v = x.get(); // returns 1.0 ``` @@ -75,18 +75,18 @@ If a `dtype` option is not provided and `value` To explicitly specify the [data type][@stdlib/ndarray/dtypes] of the returned [`ndarray`][@stdlib/ndarray/ctor], provide a `dtype` option. ```javascript -var x = scalar2ndarray( 1.0, { +const x = scalar2ndarray( 1.0, { 'dtype': 'float32' }); // returns -var sh = x.shape; +const sh = x.shape; // returns [] -var dt = x.dtype; +const dt = x.dtype; // returns 'float32' -var v = x.get(); +const v = x.get(); // returns 1.0 ``` @@ -116,17 +116,15 @@ var v = x.get(); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); // Get a list of data types: -var dt = dtypes(); +const dt = dtypes(); // Generate zero-dimensional arrays... -var x; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = scalar2ndarray( i, { +for ( let i = 0; i < dt.length; i++ ) { + const x = scalar2ndarray( i, { 'dtype': dt[ i ] }); console.log( x.get() ); diff --git a/lib/node_modules/@stdlib/ndarray/ind2sub/README.md b/lib/node_modules/@stdlib/ndarray/ind2sub/README.md index c4a0e790703c..c7010f623ccb 100644 --- a/lib/node_modules/@stdlib/ndarray/ind2sub/README.md +++ b/lib/node_modules/@stdlib/ndarray/ind2sub/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); ``` #### ind2sub( shape, idx\[, options] ) @@ -45,9 +45,9 @@ var ind2sub = require( '@stdlib/ndarray/ind2sub' ); Converts a linear index to an array of subscripts. ```javascript -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; -var s = ind2sub( shape, 2 ); +const s = ind2sub( shape, 2 ); // returns [ 1, 0 ] ``` @@ -65,22 +65,22 @@ The function supports the following `options`: By default, the function assumes a row-major array. To return subscripts for a column-major array, set the `order` option. ```javascript -var shape = [ 2, 2 ]; -var opts = {}; +const shape = [ 2, 2 ]; +const opts = {}; opts.order = 'column-major'; -var s = ind2sub( shape, 1, opts ); +const s = ind2sub( shape, 1, opts ); // returns [ 1, 0 ] ``` By default, the function throws an `error` if provided a linear index which exceeds array dimensions. To specify alternative behavior, set the `mode` option. ```javascript -var shape = [ 2, 2 ]; -var opts = {}; +const shape = [ 2, 2 ]; +const opts = {}; opts.mode = 'wrap'; -var s = ind2sub( shape, -5, opts ); +let s = ind2sub( shape, -5, opts ); // returns [ 1, 1 ] opts.mode = 'clamp'; @@ -93,13 +93,13 @@ s = ind2sub( shape, 7, opts ); Converts a linear index to an array of subscripts and assigns results to a provided output array. ```javascript -var shape = [ 2, 2 ]; -var out = [ 0, 0 ]; +const shape = [ 2, 2 ]; +const out = [ 0, 0 ]; -var subscripts = ind2sub.assign( shape, 1, out ); +const subscripts = ind2sub.assign( shape, 1, out ); // returns [ 0, 1 ] -var bool = ( subscripts === out ); +const bool = ( subscripts === out ); // returns true ``` @@ -126,19 +126,18 @@ The function accepts the same `options` as above. ```javascript -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var shape = [ 3, 3, 3 ]; -var len = numel( shape ); +const shape = [ 3, 3, 3 ]; +const len = numel( shape ); -var arr = []; -var i; -for ( i = 0; i < len; i++ ) { +const arr = []; +for ( let i = 0; i < len; i++ ) { arr.push( i ); } -var opts = { +const opts = { 'order': 'column-major' }; @@ -147,13 +146,10 @@ console.log( 'Dimensions: %s.', shape.join( 'x' ) ); console.log( 'View (subscripts):' ); console.log( '' ); -var row; -var s; - -row = ' '; -for ( i = 0; i < len; i++ ) { - s = ind2sub( shape, i, opts ); - row += '(' + s.join( ',' ) + ')'; +let row = ' '; +for ( let i = 0; i < len; i++ ) { + const s = ind2sub( shape, i, opts ); + row = '(' + s.join( ',' ) + ')'; if ( (i+1)%shape[0] === 0 ) { console.log( row ); row = ' '; diff --git a/lib/node_modules/@stdlib/ndarray/index-modes/README.md b/lib/node_modules/@stdlib/ndarray/index-modes/README.md index fcefc93e32b5..a1d997c1fbc1 100644 --- a/lib/node_modules/@stdlib/ndarray/index-modes/README.md +++ b/lib/node_modules/@stdlib/ndarray/index-modes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var modes = require( '@stdlib/ndarray/index-modes' ); +const modes = require( '@stdlib/ndarray/index-modes' ); ``` #### modes() @@ -45,7 +45,7 @@ var modes = require( '@stdlib/ndarray/index-modes' ); Returns a list of ndarray index modes. ```javascript -var out = modes(); +const out = modes(); // returns [ 'throw', 'normalize', 'clamp', 'wrap' ] ``` @@ -77,10 +77,10 @@ The output array contains the following modes: ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var modes = require( '@stdlib/ndarray/index-modes' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const modes = require( '@stdlib/ndarray/index-modes' ); -var MODES = modes(); +const MODES = modes(); function isMode( str ) { if ( indexOf( MODES, str ) === -1 ) { @@ -89,7 +89,7 @@ function isMode( str ) { return true; } -var bool = isMode( 'throw' ); +let bool = isMode( 'throw' ); // returns true bool = isMode( 'normalize' ); diff --git a/lib/node_modules/@stdlib/ndarray/iter/README.md b/lib/node_modules/@stdlib/ndarray/iter/README.md index de02d92b0b6c..31310642abcf 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/ndarray/iter' ); +const ns = require( '@stdlib/ndarray/iter' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/ndarray/iter' ); Namespace containing utilities for iterating over multidimensional arrays. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -75,8 +75,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/ndarray/iter' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/ndarray/iter' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/ndarray/iter/column-entries/README.md b/lib/node_modules/@stdlib/ndarray/iter/column-entries/README.md index 6e892c80db86..687b1a2d7e91 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/column-entries/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/column-entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerColumnEntries = require( '@stdlib/ndarray/iter/column-entries' ); +const nditerColumnEntries = require( '@stdlib/ndarray/iter/column-entries' ); ``` #### nditerColumnEntries( x\[, options] ) @@ -45,21 +45,21 @@ var nditerColumnEntries = require( '@stdlib/ndarray/iter/column-entries' ); Returns an iterator which returns `[index, column]` pairs for each column in a matrix (or stack of matrices). ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerColumnEntries( x ); +const iter = nditerColumnEntries( x ); -var v = iter.next().value; +let v = iter.next().value; // returns [...] -var idx = v[ 0 ]; +let idx = v[ 0 ]; // returns [ 0, null, 0 ] -var col = ndarray2array( v[ 1 ] ); +let col = ndarray2array( v[ 1 ] ); // returns [ 1, 3 ] v = iter.next().value; @@ -81,20 +81,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerColumnEntries( x, { +const iter = nditerColumnEntries( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns [...] -var col = ndarray2array( v[ 1 ] ); +let col = ndarray2array( v[ 1 ] ); // returns [ 1, 3 ] v[ 1 ].set( 0, 10 ); @@ -136,21 +136,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerColumnEntries = require( '@stdlib/ndarray/iter/column-entries' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerColumnEntries = require( '@stdlib/ndarray/iter/column-entries' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for returning [index, column] pairs: -var it = nditerColumnEntries( x ); +const it = nditerColumnEntries( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/columns/README.md b/lib/node_modules/@stdlib/ndarray/iter/columns/README.md index ec62339e1ada..c3fdcbc478a5 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/columns/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/columns/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerColumns = require( '@stdlib/ndarray/iter/columns' ); +const nditerColumns = require( '@stdlib/ndarray/iter/columns' ); ``` #### nditerColumns( x\[, options] ) @@ -45,18 +45,18 @@ var nditerColumns = require( '@stdlib/ndarray/iter/columns' ); Returns an iterator which iterates over each column in a matrix (or stack of matrices). ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerColumns( x ); +const iter = nditerColumns( x ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ 1, 3 ] v = iter.next().value; @@ -81,20 +81,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerColumns( x, { +const iter = nditerColumns( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ 1, 3 ] v.set( 0, 10 ); @@ -135,21 +135,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerColumns = require( '@stdlib/ndarray/iter/columns' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerColumns = require( '@stdlib/ndarray/iter/columns' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over columns: -var it = nditerColumns( x ); +const it = nditerColumns( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/entries/README.md b/lib/node_modules/@stdlib/ndarray/iter/entries/README.md index 50ed8bbec5c7..f66b2a9754df 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/entries/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerEntries = require( '@stdlib/ndarray/iter/entries' ); +const nditerEntries = require( '@stdlib/ndarray/iter/entries' ); ``` #### nditerEntries( x\[, options] ) @@ -45,14 +45,14 @@ var nditerEntries = require( '@stdlib/ndarray/iter/entries' ); Returns an iterator which returns `[index, value]` pairs for each element in a provided [`ndarray`][@stdlib/ndarray/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerEntries( x ); +const iter = nditerEntries( x ); -var v = iter.next().value; +let v = iter.next().value; // returns [ [ 0, 0, 0 ], 1 ] v = iter.next().value; @@ -71,18 +71,18 @@ The function accepts the following `options`: By default, the iterator iterates according to the layout order of the input [`ndarray`][@stdlib/ndarray/ctor]. To iterate according to a specified order, set the `order` option. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { 'order': 'row-major' }); // returns -var iter = nditerEntries( x, { +const iter = nditerEntries( x, { 'order': 'column-major' }); -var v = iter.next().value; +let v = iter.next().value; // returns [ [ 0, 0, 0 ], 1 ] v = iter.next().value; @@ -127,20 +127,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerEntries = require( '@stdlib/ndarray/iter/entries' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerEntries = require( '@stdlib/ndarray/iter/entries' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for returning [index, value] pairs: -var it = nditerEntries( x ); +const it = nditerEntries( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/indices/README.md b/lib/node_modules/@stdlib/ndarray/iter/indices/README.md index 17b6ca6b2920..f53b6d711071 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/indices/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/indices/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerIndices = require( '@stdlib/ndarray/iter/indices' ); +const nditerIndices = require( '@stdlib/ndarray/iter/indices' ); ``` #### nditerIndices( shape\[, options] ) @@ -45,14 +45,14 @@ var nditerIndices = require( '@stdlib/ndarray/iter/indices' ); Returns an iterator which returns indices for use indexing into an [`ndarray`][@stdlib/ndarray/ctor] having a specified `shape`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerIndices( x.shape ); +const iter = nditerIndices( x.shape ); -var v = iter.next().value; +let v = iter.next().value; // returns [ 0, 0, 0 ] v = iter.next().value; @@ -71,18 +71,18 @@ The function accepts the following `options`: By default, the iterator returns indices such that the last dimensions are iterated over first. To return indices according to a specified order, set the `order` option. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { 'order': 'row-major' }); // returns -var iter = nditerIndices( x.shape, { +const iter = nditerIndices( x.shape, { 'order': 'column-major' }); -var v = iter.next().value; +let v = iter.next().value; // returns [ 0, 0, 0 ] v = iter.next().value; @@ -124,20 +124,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerIndices = require( '@stdlib/ndarray/iter/indices' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerIndices = require( '@stdlib/ndarray/iter/indices' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for generating indices: -var it = nditerIndices( x.shape ); +const it = nditerIndices( x.shape ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/interleave-subarrays/README.md b/lib/node_modules/@stdlib/ndarray/iter/interleave-subarrays/README.md index 22764ab23ab0..b26084cd77bc 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/interleave-subarrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/interleave-subarrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerInterleaveSubarrays = require( '@stdlib/ndarray/iter/interleave-subarrays' ); +const nditerInterleaveSubarrays = require( '@stdlib/ndarray/iter/interleave-subarrays' ); ``` #### nditerInterleaveSubarrays( arr, ndims ) @@ -45,18 +45,18 @@ var nditerInterleaveSubarrays = require( '@stdlib/ndarray/iter/interleave-subarr Returns an iterator which iterates over interleaved subarrays. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerInterleaveSubarrays( [ x, x ], 2 ); +const iter = nditerInterleaveSubarrays( [ x, x ], 2 ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -103,24 +103,24 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerInterleaveSubarrays = require( '@stdlib/ndarray/iter/interleave-subarrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerInterleaveSubarrays = require( '@stdlib/ndarray/iter/interleave-subarrays' ); // Define input arrays: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); -var y = array( zeroTo( 9 ), { +const y = array( zeroTo( 9 ), { 'shape': [ 3, 3 ] }); // Create an iterator for iterating over interleaved matrices: -var it = nditerInterleaveSubarrays( [ x, y ], 2 ); +const it = nditerInterleaveSubarrays( [ x, y ], 2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/matrices/README.md b/lib/node_modules/@stdlib/ndarray/iter/matrices/README.md index bc6fd8375c7c..c0ae0fa8cb60 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/matrices/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/matrices/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerMatrices = require( '@stdlib/ndarray/iter/matrices' ); +const nditerMatrices = require( '@stdlib/ndarray/iter/matrices' ); ``` #### nditerMatrices( x\[, options] ) @@ -45,18 +45,18 @@ var nditerMatrices = require( '@stdlib/ndarray/iter/matrices' ); Returns an iterator which iterates over each matrix in a stack of matrices. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerMatrices( x ); +const iter = nditerMatrices( x ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -75,20 +75,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerMatrices( x, { +const iter = nditerMatrices( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v.set( 0, 0, 10 ); @@ -129,21 +129,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerMatrices = require( '@stdlib/ndarray/iter/matrices' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerMatrices = require( '@stdlib/ndarray/iter/matrices' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over matrices: -var it = nditerMatrices( x ); +const it = nditerMatrices( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/matrix-entries/README.md b/lib/node_modules/@stdlib/ndarray/iter/matrix-entries/README.md index 385faaadc57b..b66920ededa7 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/matrix-entries/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/matrix-entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerMatrixEntries = require( '@stdlib/ndarray/iter/matrix-entries' ); +const nditerMatrixEntries = require( '@stdlib/ndarray/iter/matrix-entries' ); ``` #### nditerMatrixEntries( x\[, options] ) @@ -45,21 +45,21 @@ var nditerMatrixEntries = require( '@stdlib/ndarray/iter/matrix-entries' ); Returns an iterator which returns `[index, matrix]` pairs for each matrix in a stack of matrices. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerMatrixEntries( x ); +const iter = nditerMatrixEntries( x ); -var v = iter.next().value; +let v = iter.next().value; // returns [...] -var idx = v[ 0 ]; +let idx = v[ 0 ]; // returns [ 0, null, null ] -var mat = ndarray2array( v[ 1 ] ); +let mat = ndarray2array( v[ 1 ] ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -81,20 +81,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerMatrixEntries( x, { +const iter = nditerMatrixEntries( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns [...] -var mat = ndarray2array( v[ 1 ] ); +let mat = ndarray2array( v[ 1 ] ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v[ 1 ].set( 0, 0, 10 ); @@ -136,21 +136,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerMatrixEntries = require( '@stdlib/ndarray/iter/matrix-entries' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerMatrixEntries = require( '@stdlib/ndarray/iter/matrix-entries' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for returning [index, matrix] pairs: -var it = nditerMatrixEntries( x ); +const it = nditerMatrixEntries( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/row-entries/README.md b/lib/node_modules/@stdlib/ndarray/iter/row-entries/README.md index 0c409ec6df4c..99126a9c69ed 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/row-entries/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/row-entries/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerRowEntries = require( '@stdlib/ndarray/iter/row-entries' ); +const nditerRowEntries = require( '@stdlib/ndarray/iter/row-entries' ); ``` #### nditerRowEntries( x\[, options] ) @@ -45,21 +45,21 @@ var nditerRowEntries = require( '@stdlib/ndarray/iter/row-entries' ); Returns an iterator which returns `[index, row]` pairs for each row in a matrix (or stack of matrices). ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerRowEntries( x ); +const iter = nditerRowEntries( x ); -var v = iter.next().value; +let v = iter.next().value; // returns [...] -var idx = v[ 0 ]; +let idx = v[ 0 ]; // returns [ 0, 0, null ] -var row = ndarray2array( v[ 1 ] ); +let row = ndarray2array( v[ 1 ] ); // returns [ 1, 2 ] v = iter.next().value; @@ -81,20 +81,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerRowEntries( x, { +const iter = nditerRowEntries( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns [...] -var row = ndarray2array( v[ 1 ] ); +let row = ndarray2array( v[ 1 ] ); // returns [ 1, 2 ] v[ 1 ].set( 0, 10 ); @@ -136,21 +136,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerRowEntries = require( '@stdlib/ndarray/iter/row-entries' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerRowEntries = require( '@stdlib/ndarray/iter/row-entries' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for returning [index, row] pairs: -var it = nditerRowEntries( x ); +const it = nditerRowEntries( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/rows/README.md b/lib/node_modules/@stdlib/ndarray/iter/rows/README.md index a134ba3253ff..4a8c18b4550e 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/rows/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/rows/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerRows = require( '@stdlib/ndarray/iter/rows' ); +const nditerRows = require( '@stdlib/ndarray/iter/rows' ); ``` #### nditerRows( x\[, options] ) @@ -45,18 +45,18 @@ var nditerRows = require( '@stdlib/ndarray/iter/rows' ); Returns an iterator which iterates over each row in a matrix (or stack of matrices). ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerRows( x ); +const iter = nditerRows( x ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ 1, 2 ] v = iter.next().value; @@ -81,20 +81,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerRows( x, { +const iter = nditerRows( x, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ 1, 2 ] v.set( 0, 10 ); @@ -135,21 +135,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerRows = require( '@stdlib/ndarray/iter/rows' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerRows = require( '@stdlib/ndarray/iter/rows' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over rows: -var it = nditerRows( x ); +const it = nditerRows( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/select-dimension/README.md b/lib/node_modules/@stdlib/ndarray/iter/select-dimension/README.md index c1e627bcac53..b3c3f6163117 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/select-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/select-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerSelectDimension = require( '@stdlib/ndarray/iter/select-dimension' ); +const nditerSelectDimension = require( '@stdlib/ndarray/iter/select-dimension' ); ``` #### nditerSelectDimension( x, dim\[, options] ) @@ -45,18 +45,18 @@ var nditerSelectDimension = require( '@stdlib/ndarray/iter/select-dimension' ); Returns an iterator which iterates over each view along a specified dimension. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerSelectDimension( x, 0 ); +const iter = nditerSelectDimension( x, 0 ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -76,20 +76,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerSelectDimension( x, 0, { +const iter = nditerSelectDimension( x, 0, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v.set( 0, 0, 10 ); @@ -101,20 +101,20 @@ arr = ndarray2array( v ); By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which omit the selected dimension, resulting in [`ndarray`][@stdlib/ndarray/ctor] views having one fewer dimensions than the provided input [`ndarray`][@stdlib/ndarray/ctor]. To include the selected dimension as a singleton dimension in the returned [`ndarray`][@stdlib/ndarray/ctor] views, set the `keepdim` option to `true`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerSelectDimension( x, 0, { +const iter = nditerSelectDimension( x, 0, { 'keepdim': true }); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ [ 1, 2 ], [ 3, 4 ] ] ] v = iter.next().value; @@ -159,21 +159,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerSelectDimension = require( '@stdlib/ndarray/iter/select-dimension' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerSelectDimension = require( '@stdlib/ndarray/iter/select-dimension' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over matrices: -var it = nditerSelectDimension( x, 0 ); +const it = nditerSelectDimension( x, 0 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/stacks/README.md b/lib/node_modules/@stdlib/ndarray/iter/stacks/README.md index 4ccc15458cec..edd15d559443 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/stacks/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/stacks/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerStacks = require( '@stdlib/ndarray/iter/stacks' ); +const nditerStacks = require( '@stdlib/ndarray/iter/stacks' ); ``` #### nditerStacks( x, dims\[, options] ) @@ -45,18 +45,18 @@ var nditerStacks = require( '@stdlib/ndarray/iter/stacks' ); Returns an iterator which iterates over each subarray in a stack of subarrays according to a list of specified stack dimensions. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerStacks( x, [ 1, 2 ] ); +const iter = nditerStacks( x, [ 1, 2 ] ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -75,20 +75,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerStacks( x, [ 1, 2 ], { +const iter = nditerStacks( x, [ 1, 2 ], { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v.set( 0, 0, 10 ); @@ -131,21 +131,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerStacks = require( '@stdlib/ndarray/iter/stacks' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerStacks = require( '@stdlib/ndarray/iter/stacks' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over matrices: -var it = nditerStacks( x, [ 1, 2 ] ); +let it = nditerStacks( x, [ 1, 2 ] ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/subarrays/README.md b/lib/node_modules/@stdlib/ndarray/iter/subarrays/README.md index c93a63e6e6e4..aed98c829790 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/subarrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/subarrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerSubarrays = require( '@stdlib/ndarray/iter/subarrays' ); +const nditerSubarrays = require( '@stdlib/ndarray/iter/subarrays' ); ``` #### nditerSubarrays( x, ndims\[, options] ) @@ -45,18 +45,18 @@ var nditerSubarrays = require( '@stdlib/ndarray/iter/subarrays' ); Returns an iterator which iterates over each subarray in a stack of subarrays. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerSubarrays( x, 2 ); +const iter = nditerSubarrays( x, 2 ); -var v = iter.next().value; +let v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v = iter.next().value; @@ -75,20 +75,20 @@ The function accepts the following `options`: By default, the iterator returns [`ndarray`][@stdlib/ndarray/ctor] views which are **read-only**. To return writable [views][@stdlib/ndarray/slice], set the `readonly` option to `false`. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerSubarrays( x, 2, { +const iter = nditerSubarrays( x, 2, { 'readonly': false }); -var v = iter.next().value; +const v = iter.next().value; // returns -var arr = ndarray2array( v ); +let arr = ndarray2array( v ); // returns [ [ 1, 2 ], [ 3, 4 ] ] v.set( 0, 0, 10 ); @@ -130,21 +130,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var nditerSubarrays = require( '@stdlib/ndarray/iter/subarrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const nditerSubarrays = require( '@stdlib/ndarray/iter/subarrays' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over matrices: -var it = nditerSubarrays( x, 2 ); +const it = nditerSubarrays( x, 2 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/to-array-each/README.md b/lib/node_modules/@stdlib/ndarray/iter/to-array-each/README.md index ea986f630a19..d6dd81378519 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/to-array-each/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/to-array-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditer2arrayEach = require( '@stdlib/ndarray/iter/to-array-each' ); +const nditer2arrayEach = require( '@stdlib/ndarray/iter/to-array-each' ); ``` #### nditer2arrayEach( iterator ) @@ -45,15 +45,15 @@ var nditer2arrayEach = require( '@stdlib/ndarray/iter/to-array-each' ); Returns an iterator which [converts][@stdlib/ndarray/to-array] each iterated [`ndarray`][@stdlib/ndarray/ctor] to a generic array (which may include nested arrays). ```javascript -var array = require( '@stdlib/ndarray/array' ); -var nditerRows = require( '@stdlib/ndarray/iter/rows' ); +const array = require( '@stdlib/ndarray/array' ); +const nditerRows = require( '@stdlib/ndarray/iter/rows' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditer2arrayEach( nditerRows( x ) ); +const iter = nditer2arrayEach( nditerRows( x ) ); -var v = iter.next().value; +let v = iter.next().value; // returns [ 1, 2 ] v = iter.next().value; @@ -95,21 +95,21 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerRows = require( '@stdlib/ndarray/iter/rows' ); -var nditer2arrayEach = require( '@stdlib/ndarray/iter/to-array-each' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerRows = require( '@stdlib/ndarray/iter/rows' ); +const nditer2arrayEach = require( '@stdlib/ndarray/iter/to-array-each' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for iterating over rows and converting to generic arrays: -var it = nditer2arrayEach( nditerRows( x ) ); +const it = nditer2arrayEach( nditerRows( x ) ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/iter/values/README.md b/lib/node_modules/@stdlib/ndarray/iter/values/README.md index 209c36666d50..fa7f74f5446c 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/values/README.md +++ b/lib/node_modules/@stdlib/ndarray/iter/values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nditerValues = require( '@stdlib/ndarray/iter/values' ); +const nditerValues = require( '@stdlib/ndarray/iter/values' ); ``` #### nditerValues( x\[, options] ) @@ -45,14 +45,14 @@ var nditerValues = require( '@stdlib/ndarray/iter/values' ); Returns an iterator which returns individual elements from a provided [`ndarray`][@stdlib/ndarray/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] ); // returns -var iter = nditerValues( x ); +const iter = nditerValues( x ); -var v = iter.next().value; +let v = iter.next().value; // returns 1 v = iter.next().value; @@ -71,18 +71,18 @@ The function accepts the following `options`: By default, the iterator iterates according to the layout order of the input [`ndarray`][@stdlib/ndarray/ctor]. To iterate according to a specified order, set the `order` option. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { +const x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ], { 'order': 'row-major' }); // returns -var iter = nditerValues( x, { +const iter = nditerValues( x, { 'order': 'column-major' }); -var v = iter.next().value; +let v = iter.next().value; // returns 1 v = iter.next().value; @@ -126,20 +126,20 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var nditerValues = require( '@stdlib/ndarray/iter/values' ); +const array = require( '@stdlib/ndarray/array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const nditerValues = require( '@stdlib/ndarray/iter/values' ); // Define an input array: -var x = array( zeroTo( 27 ), { +const x = array( zeroTo( 27 ), { 'shape': [ 3, 3, 3 ] }); // Create an iterator for returning individual elements: -var it = nditerValues( x ); +const it = nditerValues( x ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/ndarray/maybe-broadcast-array/README.md b/lib/node_modules/@stdlib/ndarray/maybe-broadcast-array/README.md index c65b75f95950..d8b0dc04e789 100644 --- a/lib/node_modules/@stdlib/ndarray/maybe-broadcast-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/maybe-broadcast-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' ); +const maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' ); ``` #### maybeBroadcastArray( x, shape ) @@ -45,14 +45,14 @@ var maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' ); Broadcasts an [ndarray][@stdlib/ndarray/ctor] to a specified `shape` if and only if the specified `shape` differs from the provided [ndarray][@stdlib/ndarray/ctor]'s shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast to a 2x2x2 ndarray: -var y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); +const y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); // returns ``` @@ -83,29 +83,27 @@ var y = maybeBroadcastArray( x, [ 2, 2, 2 ] ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' ); +const array = require( '@stdlib/ndarray/array' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Broadcast the array to 3x2x2: -var y = maybeBroadcastArray( x, [ 3, 2, 2 ] ); +const y = maybeBroadcastArray( x, [ 3, 2, 2 ] ); // returns // Retrieve the shape: -var sh = y.shape; +const sh = y.shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); -// Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'Y[%s] = %d', ind2sub( sh, i ).join( ', ' ), y.iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/maybe-broadcast-arrays/README.md b/lib/node_modules/@stdlib/ndarray/maybe-broadcast-arrays/README.md index 29d5378b926b..899456541075 100644 --- a/lib/node_modules/@stdlib/ndarray/maybe-broadcast-arrays/README.md +++ b/lib/node_modules/@stdlib/ndarray/maybe-broadcast-arrays/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maybeBroadcastArrays = require( '@stdlib/ndarray/maybe-broadcast-arrays' ); +const maybeBroadcastArrays = require( '@stdlib/ndarray/maybe-broadcast-arrays' ); ``` #### maybeBroadcastArrays( arrays ) @@ -45,19 +45,19 @@ var maybeBroadcastArrays = require( '@stdlib/ndarray/maybe-broadcast-arrays' ); Broadcasts [ndarrays][@stdlib/ndarray/ctor] to a common shape. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = maybeBroadcastArrays( [ x, y ] ); +const out = maybeBroadcastArrays( [ x, y ] ); // returns [ , ] ``` @@ -67,19 +67,19 @@ The function supports two (mutually exclusive) means for providing [ndarray][@st 2. providing [ndarray][@stdlib/ndarray/ctor] arguments as separate arguments. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Create a 2x2 ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 2x2x2 ndarray: -var y = zeros( [ 2, 2, 2 ] ); +const y = zeros( [ 2, 2, 2 ] ); // returns // Broadcast to a common shape: -var out = maybeBroadcastArrays( x, y ); +const out = maybeBroadcastArrays( x, y ); // returns [ , ] ``` @@ -110,34 +110,33 @@ var out = maybeBroadcastArrays( x, y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); -var numel = require( '@stdlib/ndarray/base/numel' ); -var ind2sub = require( '@stdlib/ndarray/ind2sub' ); -var maybeBroadcastArrays = require( '@stdlib/ndarray/maybe-broadcast-arrays' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const ind2sub = require( '@stdlib/ndarray/ind2sub' ); +const maybeBroadcastArrays = require( '@stdlib/ndarray/maybe-broadcast-arrays' ); // Create a 2x2 array: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // returns // Create a 3x2x2 array: -var y = zeros( [ 3, 2, 2 ] ); +const y = zeros( [ 3, 2, 2 ] ); // returns // Broadcast arrays to a common shape: -var out = maybeBroadcastArrays( [ x, y ] ); +const out = maybeBroadcastArrays( [ x, y ] ); // returns // Retrieve the common shape: -var sh = out[ 0 ].shape; +const sh = out[ 0 ].shape; // returns [ 3, 2, 2 ] // Retrieve the number of elements: -var N = numel( sh ); +const N = numel( sh ); // Loop through the array elements... -var i; -for ( i = 0; i < N; i++ ) { +for ( let i = 0; i < N; i++ ) { console.log( 'X[%s] = %d', ind2sub( sh, i ).join( ', ' ), out[ 0 ].iget( i ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/min-dtype/README.md b/lib/node_modules/@stdlib/ndarray/min-dtype/README.md index 85a94a3151dd..292a153e68ba 100644 --- a/lib/node_modules/@stdlib/ndarray/min-dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/min-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minDataType = require( '@stdlib/ndarray/min-dtype' ); +const minDataType = require( '@stdlib/ndarray/min-dtype' ); ``` #### minDataType( value ) @@ -45,7 +45,7 @@ var minDataType = require( '@stdlib/ndarray/min-dtype' ); Returns the minimum ndarray [data type][@stdlib/ndarray/dtypes] of the closest "kind" necessary for storing a provided scalar value. ```javascript -var dt = minDataType( 3.141592653589793 ); +let dt = minDataType( 3.141592653589793 ); // returns 'float32' dt = minDataType( -3 ); @@ -83,24 +83,20 @@ dt = minDataType( '3' ); ```javascript -var roundn = require( '@stdlib/math/base/special/roundn' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var minDataType = require( '@stdlib/ndarray/min-dtype' ); - -var dt; -var v; -var i; +const roundn = require( '@stdlib/math/base/special/roundn' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const minDataType = require( '@stdlib/ndarray/min-dtype' ); // Generate numbers of varying magnitudes and determine the minimum data type for each value... -for ( i = 0; i < 100; i++ ) { - v = randu() * pow( 2.0, discreteUniform( 0, 40 ) ); +for ( let i = 0; i < 100; i++ ) { + let v = randu() * pow( 2.0, discreteUniform( 0, 40 ) ); if ( randu() < 0.5 ) { v *= -1; } v = roundn( v, discreteUniform( -1, 0 ) ); - dt = minDataType( v ); + const dt = minDataType( v ); console.log( 'min(%d) => %s', v, dt ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/mostly-safe-casts/README.md b/lib/node_modules/@stdlib/ndarray/mostly-safe-casts/README.md index 51c4f2fce5c1..dec4e252ae0d 100644 --- a/lib/node_modules/@stdlib/ndarray/mostly-safe-casts/README.md +++ b/lib/node_modules/@stdlib/ndarray/mostly-safe-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mostlySafeCasts = require( '@stdlib/ndarray/mostly-safe-casts' ); +const mostlySafeCasts = require( '@stdlib/ndarray/mostly-safe-casts' ); ``` #### mostlySafeCasts( \[dtype] ) @@ -45,27 +45,27 @@ var mostlySafeCasts = require( '@stdlib/ndarray/mostly-safe-casts' ); If provided a `dtype` argument, returns a list of ndarray [data types][@stdlib/ndarray/dtypes] to which a provided ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast and, for floating-point data types, can be downcast. ```javascript -var out = mostlySafeCasts( 'float32' ); +const out = mostlySafeCasts( 'float32' ); // e.g., returns [ 'float32', 'float64', ... ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = mostlySafeCasts(); +const out = mostlySafeCasts(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var v = f32[ 'float64' ]; +const v = f32[ 'float64' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = mostlySafeCasts( 'foo' ); +const out = mostlySafeCasts( 'foo' ); // returns null ``` @@ -90,17 +90,14 @@ var out = mostlySafeCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var mostlySafeCasts = require( '@stdlib/ndarray/mostly-safe-casts' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const mostlySafeCasts = require( '@stdlib/ndarray/mostly-safe-casts' ); // Get the list of supported ndarray data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); -// Print the list of ndarray data types to which a data type can be cast... -var list; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - list = mostlySafeCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = mostlySafeCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/README.md b/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/README.md index 123765907a68..934468ebb48d 100644 --- a/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/README.md +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarraylike2ndarray = require( '@stdlib/ndarray/ndarraylike2ndarray' ); +const ndarraylike2ndarray = require( '@stdlib/ndarray/ndarraylike2ndarray' ); ``` #### ndarraylike2ndarray( x\[, options] ) @@ -45,10 +45,10 @@ var ndarraylike2ndarray = require( '@stdlib/ndarray/ndarraylike2ndarray' ); Converts an ndarray-like object to an [`ndarray`][@stdlib/ndarray/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); -var out = ndarraylike2ndarray( arr ); +const arr = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const out = ndarraylike2ndarray( arr ); // returns ``` @@ -79,14 +79,14 @@ The function supports the same `options` as [`ndarray`][@stdlib/ndarray/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarraylike2ndarray = require( '@stdlib/ndarray/ndarraylike2ndarray' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarraylike2ndarray = require( '@stdlib/ndarray/ndarraylike2ndarray' ); // Create an ndarray: -var x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); +const x = array( [ [ 1, 2 ], [ 3, 4 ] ] ); // Create another ndarray sharing the same data: -var out = ndarraylike2ndarray( x ); +const out = ndarraylike2ndarray( x ); // returns // Print various properties: diff --git a/lib/node_modules/@stdlib/ndarray/ndims/README.md b/lib/node_modules/@stdlib/ndarray/ndims/README.md index 378e6c76b8b2..3788e18f6022 100644 --- a/lib/node_modules/@stdlib/ndarray/ndims/README.md +++ b/lib/node_modules/@stdlib/ndarray/ndims/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndims = require( '@stdlib/ndarray/ndims' ); +const ndims = require( '@stdlib/ndarray/ndims' ); ``` #### ndims( x ) @@ -45,12 +45,12 @@ var ndims = require( '@stdlib/ndarray/ndims' ); Returns the number of [ndarray][@stdlib/ndarray/ctor] dimensions. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var n = ndims( x ); +const n = ndims( x ); // returns 3 ``` @@ -77,18 +77,18 @@ var n = ndims( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var ndims = require( '@stdlib/ndarray/ndims' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const ndims = require( '@stdlib/ndarray/ndims' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -105,11 +105,8 @@ var slices = [ E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) ) ]; -// Determine the number of dimensions in each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %d dimensions', s.shape.join( 'x' ), ndims( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/next-dtype/README.md b/lib/node_modules/@stdlib/ndarray/next-dtype/README.md index 33007e6bd3f1..3501687ce69d 100644 --- a/lib/node_modules/@stdlib/ndarray/next-dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/next-dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nextDataType = require( '@stdlib/ndarray/next-dtype' ); +const nextDataType = require( '@stdlib/ndarray/next-dtype' ); ``` #### nextDataType( \[dtype] ) @@ -45,28 +45,28 @@ var nextDataType = require( '@stdlib/ndarray/next-dtype' ); If provided a `dtype` argument, returns the next larger ndarray [data type][@stdlib/ndarray/dtypes] of the same kind. ```javascript -var out = nextDataType( 'float32' ); +const out = nextDataType( 'float32' ); // returns 'float64' ``` If a [data type][@stdlib/ndarray/dtypes] does not have a next larger [data type][@stdlib/ndarray/dtypes] or the next larger data type is not supported, the function returns `-1`. ```javascript -var out = nextDataType( 'float64' ); +const out = nextDataType( 'float64' ); // returns -1 ``` If not provided a `dtype` argument, the function returns a table. ```javascript -var out = nextDataType(); +const out = nextDataType(); // returns {...} ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = nextDataType( 'foo' ); +const out = nextDataType( 'foo' ); // returns null ``` @@ -91,19 +91,15 @@ var out = nextDataType( 'foo' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var nextDataType = require( '@stdlib/ndarray/next-dtype' ); - -var DTYPES; -var dt; -var i; +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const nextDataType = require( '@stdlib/ndarray/next-dtype' ); // Get the list of supported ndarray data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the next larger data type for each supported data type... -for ( i = 0; i < DTYPES.length; i++ ) { - dt = nextDataType( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt = nextDataType( DTYPES[ i ] ); console.log( '%s => %s', DTYPES[ i ], dt ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/numel-dimension/README.md b/lib/node_modules/@stdlib/ndarray/numel-dimension/README.md index 15718f831955..b456299fcd3e 100644 --- a/lib/node_modules/@stdlib/ndarray/numel-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/numel-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var numelDimension = require( '@stdlib/ndarray/numel-dimension' ); +const numelDimension = require( '@stdlib/ndarray/numel-dimension' ); ``` #### numelDimension( x, dim ) @@ -45,12 +45,12 @@ var numelDimension = require( '@stdlib/ndarray/numel-dimension' ); Returns the size (i.e., number of elements) of a specified dimension for a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 4, 2, 3 ] ); +const x = zeros( [ 4, 2, 3 ] ); // returns -var d = numelDimension( x, 0 ); +const d = numelDimension( x, 0 ); // returns 4 ``` @@ -86,18 +86,18 @@ The function accepts the following arguments: ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var numelDimension = require( '@stdlib/ndarray/numel-dimension' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const numelDimension = require( '@stdlib/ndarray/numel-dimension' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -115,10 +115,8 @@ var slices = [ ]; // Resolve the size of the first dimension for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => %d', s.shape.join( ',' ), numelDimension( s, 0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/numel/README.md b/lib/node_modules/@stdlib/ndarray/numel/README.md index ced499155ad9..1221f183114d 100644 --- a/lib/node_modules/@stdlib/ndarray/numel/README.md +++ b/lib/node_modules/@stdlib/ndarray/numel/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var numel = require( '@stdlib/ndarray/numel' ); +const numel = require( '@stdlib/ndarray/numel' ); ``` #### numel( x ) @@ -45,12 +45,12 @@ var numel = require( '@stdlib/ndarray/numel' ); Returns the number of elements in an [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var n = numel( x ); +const n = numel( x ); // returns 18 ``` @@ -77,18 +77,18 @@ var n = numel( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var numel = require( '@stdlib/ndarray/numel' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const numel = require( '@stdlib/ndarray/numel' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -106,9 +106,8 @@ var slices = [ ]; // Determine the number of elements in each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { +let s; +for ( let i = 0; i < slices.length; i++ ) { s = slice( x, slices[ i ] ); console.log( '%s => %d elements', s.shape.join( 'x' ), numel( s ) ); } diff --git a/lib/node_modules/@stdlib/ndarray/offset/README.md b/lib/node_modules/@stdlib/ndarray/offset/README.md index c0862e374418..d51374014b6a 100644 --- a/lib/node_modules/@stdlib/ndarray/offset/README.md +++ b/lib/node_modules/@stdlib/ndarray/offset/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var offset = require( '@stdlib/ndarray/offset' ); +const offset = require( '@stdlib/ndarray/offset' ); ``` #### offset( x ) @@ -45,12 +45,12 @@ var offset = require( '@stdlib/ndarray/offset' ); Returns the index offset specifying the underlying buffer index of the first iterated [ndarray][@stdlib/ndarray/ctor] element. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var n = offset( x ); +const n = offset( x ); // returns 0 ``` @@ -77,18 +77,18 @@ var n = offset( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var offset = require( '@stdlib/ndarray/offset' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const offset = require( '@stdlib/ndarray/offset' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -106,10 +106,8 @@ var slices = [ ]; // Determine the index offset for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %d', s.shape.join( 'x' ), offset( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/order/README.md b/lib/node_modules/@stdlib/ndarray/order/README.md index d46c305a545a..a63ab5c8e7ef 100644 --- a/lib/node_modules/@stdlib/ndarray/order/README.md +++ b/lib/node_modules/@stdlib/ndarray/order/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var order = require( '@stdlib/ndarray/order' ); +const order = require( '@stdlib/ndarray/order' ); ``` #### order( x ) @@ -45,14 +45,14 @@ var order = require( '@stdlib/ndarray/order' ); Returns the [layout order][@stdlib/ndarray/orders] of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ], { +const x = zeros( [ 3, 2, 3 ], { 'order': 'row-major' }); // returns -var out = order( x ); +const out = order( x ); // returns 'row-major' ``` @@ -79,18 +79,18 @@ var out = order( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var order = require( '@stdlib/ndarray/order' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const order = require( '@stdlib/ndarray/order' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -108,10 +108,8 @@ var slices = [ ]; // Determine the layout order for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '%s => %s', s.order, order( s ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/orders/README.md b/lib/node_modules/@stdlib/ndarray/orders/README.md index 6fa1526ddee5..9d057998fa12 100644 --- a/lib/node_modules/@stdlib/ndarray/orders/README.md +++ b/lib/node_modules/@stdlib/ndarray/orders/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var orders = require( '@stdlib/ndarray/orders' ); +const orders = require( '@stdlib/ndarray/orders' ); ``` #### orders() @@ -45,7 +45,7 @@ var orders = require( '@stdlib/ndarray/orders' ); Returns a list of ndarray orders. ```javascript -var out = orders(); +const out = orders(); // e.g., returns [ 'row-major', 'column-major' ] ``` @@ -75,12 +75,12 @@ The output array contains the following orders: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var orders = require( '@stdlib/ndarray/orders' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const orders = require( '@stdlib/ndarray/orders' ); -var isOrder = contains( orders() ); +const isOrder = contains( orders() ); -var bool = isOrder( 'row-major' ); +let bool = isOrder( 'row-major' ); // returns true bool = isOrder( 'column-major' ); diff --git a/lib/node_modules/@stdlib/ndarray/output-dtype-policies/README.md b/lib/node_modules/@stdlib/ndarray/output-dtype-policies/README.md index 59c3a1b4f585..cb05c39681fc 100644 --- a/lib/node_modules/@stdlib/ndarray/output-dtype-policies/README.md +++ b/lib/node_modules/@stdlib/ndarray/output-dtype-policies/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var policies = require( '@stdlib/ndarray/output-dtype-policies' ); +const policies = require( '@stdlib/ndarray/output-dtype-policies' ); ``` #### policies() @@ -45,7 +45,7 @@ var policies = require( '@stdlib/ndarray/output-dtype-policies' ); Returns a list of ndarray data type policies. ```javascript -var out = policies(); +const out = policies(); // e.g., returns [ 'same', 'promoted', ... ] ``` @@ -85,10 +85,10 @@ The output `array` contains the following data type policies: ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var policies = require( '@stdlib/ndarray/output-dtype-policies' ); +const indexOf = require( '@stdlib/utils/index-of' ); +const policies = require( '@stdlib/ndarray/output-dtype-policies' ); -var POLICIES = policies(); +const POLICIES = policies(); function isPolicy( str ) { if ( indexOf( POLICIES, str ) === -1 ) { @@ -97,7 +97,7 @@ function isPolicy( str ) { return true; } -var bool = isPolicy( 'same' ); +let bool = isPolicy( 'same' ); // returns true bool = isPolicy( 'real_floating_point' ); diff --git a/lib/node_modules/@stdlib/ndarray/promotion-rules/README.md b/lib/node_modules/@stdlib/ndarray/promotion-rules/README.md index 548428df25a8..5a3c95f0eacb 100644 --- a/lib/node_modules/@stdlib/ndarray/promotion-rules/README.md +++ b/lib/node_modules/@stdlib/ndarray/promotion-rules/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var promotionRules = require( '@stdlib/ndarray/promotion-rules' ); +const promotionRules = require( '@stdlib/ndarray/promotion-rules' ); ``` #### promotionRules( \[dtype1, dtype2] ) @@ -45,34 +45,34 @@ var promotionRules = require( '@stdlib/ndarray/promotion-rules' ); If provided [data types][@stdlib/ndarray/dtypes], returns the ndarray [data type][@stdlib/ndarray/dtypes] with the smallest size and closest "kind" to which ndarray [data types][@stdlib/ndarray/dtypes] can be **safely** cast. ```javascript -var out = promotionRules( 'float32', 'uint32' ); +const out = promotionRules( 'float32', 'uint32' ); // returns 'float64' ``` If a [data type][@stdlib/ndarray/dtypes] to which [data types][@stdlib/ndarray/dtypes] can be safely cast does **not** exist (or is not supported), the function returns `-1`. ```javascript -var out = promotionRules( 'binary', 'generic' ); +const out = promotionRules( 'binary', 'generic' ); // returns -1 ``` If not provided [data types][@stdlib/ndarray/dtypes], the function returns a promotion table. ```javascript -var out = promotionRules(); +const out = promotionRules(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var rule = f32[ 'uint32' ]; +const rule = f32[ 'uint32' ]; // returns 'float64' ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = promotionRules( 'foo', 'generic' ); +const out = promotionRules( 'foo', 'generic' ); // returns null ``` @@ -97,25 +97,18 @@ var out = promotionRules( 'foo', 'generic' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var promotionRules = require( '@stdlib/ndarray/promotion-rules' ); - -var DTYPES; -var dt1; -var dt2; -var dt; -var i; -var j; +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const promotionRules = require( '@stdlib/ndarray/promotion-rules' ); // Get the list of supported ndarray data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the promotion rule for each pair of ndarray data types... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const dt1 = DTYPES[ i ]; + for ( let j = 0; j < DTYPES.length; j++ ) { + const dt2 = DTYPES[ j ]; + const dt = promotionRules( dt1, dt2 ); console.log( '(%s, %s) => %s', dt1, dt2, dt ); } } diff --git a/lib/node_modules/@stdlib/ndarray/safe-casts/README.md b/lib/node_modules/@stdlib/ndarray/safe-casts/README.md index e775f020bdaf..3ea072e5802a 100644 --- a/lib/node_modules/@stdlib/ndarray/safe-casts/README.md +++ b/lib/node_modules/@stdlib/ndarray/safe-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var safeCasts = require( '@stdlib/ndarray/safe-casts' ); +const safeCasts = require( '@stdlib/ndarray/safe-casts' ); ``` #### safeCasts( \[dtype] ) @@ -45,27 +45,27 @@ var safeCasts = require( '@stdlib/ndarray/safe-casts' ); If provided a `dtype` argument, returns a list of ndarray [data types][@stdlib/ndarray/dtypes] to which a provided ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast. ```javascript -var out = safeCasts( 'float32' ); +const out = safeCasts( 'float32' ); // e.g., returns [ 'float32', 'float64', ... ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = safeCasts(); +const out = safeCasts(); // returns {...} -var f32 = out[ 'float32' ]; +const f32 = out[ 'float32' ]; // returns {...} -var v = f32[ 'float64' ]; +const v = f32[ 'float64' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = safeCasts( 'foo' ); +const out = safeCasts( 'foo' ); // returns null ``` @@ -90,17 +90,15 @@ var out = safeCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var safeCasts = require( '@stdlib/ndarray/safe-casts' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const safeCasts = require( '@stdlib/ndarray/safe-casts' ); // Get the list of supported ndarray data types: -var DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the list of ndarray data types to which a data type can be safely cast... -var list; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - list = safeCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = safeCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/same-kind-casts/README.md b/lib/node_modules/@stdlib/ndarray/same-kind-casts/README.md index 2a4ad28c0267..57bcc6c3ad29 100644 --- a/lib/node_modules/@stdlib/ndarray/same-kind-casts/README.md +++ b/lib/node_modules/@stdlib/ndarray/same-kind-casts/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); +const sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); ``` #### sameKindCasts( \[dtype] ) @@ -45,27 +45,27 @@ var sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); If provided a `dtype` argument, returns a list of ndarray [data types][@stdlib/ndarray/dtypes] to which a provided ndarray [data type][@stdlib/ndarray/dtypes] can be safely cast or cast within the same "kind" (e.g., between signed integers or between floating-point numbers). ```javascript -var out = sameKindCasts( 'float64' ); +const out = sameKindCasts( 'float64' ); // e.g., returns [ 'float64', 'float32', ... ] ``` If not provided a `dtype` argument, the function returns a casting table. ```javascript -var out = sameKindCasts(); +const out = sameKindCasts(); // returns {...} -var f64 = out[ 'float64' ]; +const f64 = out[ 'float64' ]; // returns {...} -var v = f64[ 'float32' ]; +const v = f64[ 'float32' ]; // returns 1 ``` If provided an unrecognized or unsupported `dtype`, the function returns `null`. ```javascript -var out = sameKindCasts( 'foo' ); +const out = sameKindCasts( 'foo' ); // returns null ``` @@ -90,19 +90,15 @@ var out = sameKindCasts( 'foo' ); ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); - -var DTYPES; -var list; -var i; +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const sameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); // Get the list of supported ndarray data types: -DTYPES = dtypes(); +const DTYPES = dtypes(); // Print the list of ndarray data types to which a data type can be cast... -for ( i = 0; i < DTYPES.length; i++ ) { - list = sameKindCasts( DTYPES[ i ] ); +for ( let i = 0; i < DTYPES.length; i++ ) { + const list = sameKindCasts( DTYPES[ i ] ); console.log( '%s: %s', DTYPES[ i ], list.join( ', ' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/shape/README.md b/lib/node_modules/@stdlib/ndarray/shape/README.md index 0a4bc2020142..3fc61bac4bef 100644 --- a/lib/node_modules/@stdlib/ndarray/shape/README.md +++ b/lib/node_modules/@stdlib/ndarray/shape/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var shape = require( '@stdlib/ndarray/shape' ); +const shape = require( '@stdlib/ndarray/shape' ); ``` #### shape( x ) @@ -45,12 +45,12 @@ var shape = require( '@stdlib/ndarray/shape' ); Returns the shape of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var sh = shape( x ); +const sh = shape( x ); // returns [ 3, 2, 3 ] ``` @@ -77,18 +77,18 @@ var sh = shape( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var shape = require( '@stdlib/ndarray/shape' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const shape = require( '@stdlib/ndarray/shape' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -106,10 +106,8 @@ var slices = [ ]; // Determine the shape of each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( 'slice(%s) => %s', x.shape.join( 'x' ), shape( s ).join( 'x' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice-assign/README.md b/lib/node_modules/@stdlib/ndarray/slice-assign/README.md index 76f0adfa5578..aa9bb787dc45 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-assign/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-assign/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceAssign = require( '@stdlib/ndarray/slice-assign' ); +const sliceAssign = require( '@stdlib/ndarray/slice-assign' ); ``` #### sliceAssign( x, y, ...s\[, options] ) @@ -45,44 +45,44 @@ var sliceAssign = require( '@stdlib/ndarray/slice-assign' ); Assigns element values from a broadcasted input [`ndarray`][@stdlib/ndarray/ctor] to corresponding elements in an output [`ndarray`][@stdlib/ndarray/ctor] view. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); // Define an input array: -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +const sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] // Define an output array: -var y = ndzeros( [ 2, 3, 2 ], { +const y = ndzeros( [ 2, 3, 2 ], { 'dtype': x.dtype }); // Create a slice: -var s0 = null; -var s1 = new Slice( null, null, -1 ); -var s2 = new Slice( null, null, -1 ); -var s = new MultiSlice( s0, s1, s2 ); +const s0 = null; +const s1 = new Slice( null, null, -1 ); +const s2 = new Slice( null, null, -1 ); +const s = new MultiSlice( s0, s1, s2 ); // returns // Perform assignment: -var out = sliceAssign( x, y, s ); +const out = sliceAssign( x, y, s ); // returns -var bool = ( out === y ); +const bool = ( out === y ); // returns true arr = ndarray2array( y ); @@ -105,25 +105,25 @@ The function supports three (mutually exclusive) means for providing slice argum The following example demonstrates each invocation style achieving equivalent results. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); // 1. Using a MultiSlice: -var x = scalar2ndarray( 10.0 ); -var y = ndzeros( [ 2, 3 ] ); +let x = scalar2ndarray( 10.0 ); +let y = ndzeros( [ 2, 3 ] ); -var s0 = 0; -var s1 = new Slice( 1, null, 1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = 0; +const s1 = new Slice( 1, null, 1 ); +const s = new MultiSlice( s0, s1 ); // returns -var out = sliceAssign( x, y, s ); +let out = sliceAssign( x, y, s ); // returns -var arr = ndarray2array( out ); +let arr = ndarray2array( out ); // returns [ [ 0.0, 10.0, 10.0 ], [ 0.0, 0.0, 0.0 ] ] // 2. Using an array of slice arguments: @@ -154,33 +154,33 @@ The function supports the following `options`: By default, the function throws an error when provided a slice which exceeds array bounds. To ignore slice indices exceeding array bounds, set the `strict` option to `false`. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); // Define an input array: -var x = scalar2ndarray( 10.0 ); +const x = scalar2ndarray( 10.0 ); // Define an output array: -var y = ndzeros( [ 3, 2 ], { +const y = ndzeros( [ 3, 2 ], { 'dtype': x.dtype }); // Create a slice: -var s0 = new Slice( 1, null, 1 ); -var s1 = new Slice( 10, 20, 1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = new Slice( 1, null, 1 ); +const s1 = new Slice( 10, 20, 1 ); +const s = new MultiSlice( s0, s1 ); // returns // Perform assignment: -var out = sliceAssign( x, y, s, { +const out = sliceAssign( x, y, s, { 'strict': false }); // returns -var arr = ndarray2array( y ); +const arr = ndarray2array( y ); // returns [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ``` @@ -215,54 +215,54 @@ var arr = ndarray2array( y ); ```javascript -var E = require( '@stdlib/slice/multi' ); -var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var ndzeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var sliceAssign = require( '@stdlib/ndarray/slice-assign' ); +const E = require( '@stdlib/slice/multi' ); +const scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndzeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const sliceAssign = require( '@stdlib/ndarray/slice-assign' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create an output ndarray: -var y = ndzeros( [ 3, 3, 3 ] ); +const y = ndzeros( [ 3, 3, 3 ] ); // Update each matrix... -var s1 = E( 0, _, _ ); +const s1 = E( 0, _, _ ); sliceAssign( scalar2ndarray( 100 ), y, s1 ); -var a1 = ndarray2array( slice( y, s1 ) ); +const a1 = ndarray2array( slice( y, s1 ) ); // returns [ [ 100, 100, 100 ], [ 100, 100, 100 ], [ 100, 100, 100 ] ] -var s2 = E( 1, _, _ ); +const s2 = E( 1, _, _ ); sliceAssign( scalar2ndarray( 200 ), y, s2 ); -var a2 = ndarray2array( slice( y, s2 ) ); +const a2 = ndarray2array( slice( y, s2 ) ); // returns [ [ 200, 200, 200 ], [ 200, 200, 200 ], [ 200, 200, 200 ] ] -var s3 = E( 2, _, _ ); +const s3 = E( 2, _, _ ); sliceAssign( scalar2ndarray( 300 ), y, s3 ); -var a3 = ndarray2array( slice( y, s3 ) ); +const a3 = ndarray2array( slice( y, s3 ) ); // returns [ [ 300, 300, 300 ], [ 300, 300, 300 ], [ 300, 300, 300 ] ] // Update the second rows in each matrix: -var s4 = E( _, 1, _ ); +const s4 = E( _, 1, _ ); sliceAssign( scalar2ndarray( 400 ), y, s4 ); -var a4 = ndarray2array( slice( y, s4 ) ); +const a4 = ndarray2array( slice( y, s4 ) ); // returns [ [ 400, 400, 400 ], [ 400, 400, 400 ], [ 400, 400, 400 ] ] // Update the second columns in each matrix: -var s5 = E( _, _, 1 ); +const s5 = E( _, _, 1 ); sliceAssign( scalar2ndarray( 500 ), y, s5 ); -var a5 = ndarray2array( slice( y, s5 ) ); +const a5 = ndarray2array( slice( y, s5 ) ); // returns [ [ 500, 500, 500 ], [ 500, 500, 500 ], [ 500, 500, 500 ] ] // Return the contents of the entire ndarray: -var a6 = ndarray2array( y ); +const a6 = ndarray2array( y ); /* returns [ [ diff --git a/lib/node_modules/@stdlib/ndarray/slice-dimension-from/README.md b/lib/node_modules/@stdlib/ndarray/slice-dimension-from/README.md index 2fccfbdc8fb3..1af474ce042c 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-dimension-from/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-dimension-from/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimensionFrom = require( '@stdlib/ndarray/slice-dimension-from' ); +const sliceDimensionFrom = require( '@stdlib/ndarray/slice-dimension-from' ); ``` #### sliceDimensionFrom( x, dim, start\[, options] ) @@ -45,24 +45,24 @@ var sliceDimensionFrom = require( '@stdlib/ndarray/slice-dimension-from' ); Returns a **read-only** shifted view of an input [`ndarray`][@stdlib/ndarray/ctor] along a specified dimension. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionFrom( x, 0, 1 ); +const y = sliceDimensionFrom( x, 0, 1 ); // returns sh = y.shape; @@ -86,24 +86,24 @@ The function supports the following `options`: By default, the function throws an error when provided a starting index which exceeds array bounds. To return an empty array when a starting index exceeds array bounds, set the `strict` option to `false`. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionFrom( x, 1, 20, { +const y = sliceDimensionFrom( x, 1, 20, { 'strict': false }); // returns @@ -136,38 +136,38 @@ arr = ndarray2array( y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimensionFrom = require( '@stdlib/ndarray/slice-dimension-from' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimensionFrom = require( '@stdlib/ndarray/slice-dimension-from' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the last two rows of each matrix: -var y1 = sliceDimensionFrom( x, 1, 1 ); +const y1 = sliceDimensionFrom( x, 1, 1 ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] // Get the last columns of each matrix: -var y2 = sliceDimensionFrom( x, 2, 1 ); +const y2 = sliceDimensionFrom( x, 2, 1 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 1, 2 ], [ 4, 5 ], [ 7, 8 ] ], [ [ 10, 11 ], [ 13, 14 ], [ 16, 17 ] ], [ [ 19, 20 ], [ 22, 23 ], [ 25, 26 ] ] ] // Get the last two matrices: -var y3 = sliceDimensionFrom( x, 0, 1 ); +const y3 = sliceDimensionFrom( x, 0, 1 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice-dimension-to/README.md b/lib/node_modules/@stdlib/ndarray/slice-dimension-to/README.md index 7c4f0d06a36f..1e8aee256a76 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-dimension-to/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-dimension-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimensionTo = require( '@stdlib/ndarray/slice-dimension-to' ); +const sliceDimensionTo = require( '@stdlib/ndarray/slice-dimension-to' ); ``` #### sliceDimensionTo( x, dim, stop\[, options] ) @@ -45,24 +45,24 @@ var sliceDimensionTo = require( '@stdlib/ndarray/slice-dimension-to' ); Returns a **read-only** truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] along a specified dimension. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionTo( x, 0, 2 ); +const y = sliceDimensionTo( x, 0, 2 ); // returns sh = y.shape; @@ -86,24 +86,24 @@ The function supports the following `options`: By default, the function throws an error when provided an ending index which exceeds array bounds. To return an empty array when an ending index exceeds array bounds, set the `strict` option to `false`. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceDimensionTo( x, 1, -20, { +const y = sliceDimensionTo( x, 1, -20, { 'strict': false }); // returns @@ -136,38 +136,38 @@ arr = ndarray2array( y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimensionTo = require( '@stdlib/ndarray/slice-dimension-to' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimensionTo = require( '@stdlib/ndarray/slice-dimension-to' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the first two rows of each matrix: -var y1 = sliceDimensionTo( x, 1, 2 ); +const y1 = sliceDimensionTo( x, 1, 2 ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ] ] ] // Get the first columns of each matrix: -var y2 = sliceDimensionTo( x, 2, 2 ); +const y2 = sliceDimensionTo( x, 2, 2 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 0, 1 ], [ 3, 4 ], [ 6, 7 ] ], [ [ 9, 10 ], [ 12, 13 ], [ 15, 16 ] ], [ [ 18, 19 ], [ 21, 22 ], [ 24, 25 ] ] ] // Get the first two matrices: -var y3 = sliceDimensionTo( x, 0, 2 ); +const y3 = sliceDimensionTo( x, 0, 2 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice-dimension/README.md b/lib/node_modules/@stdlib/ndarray/slice-dimension/README.md index 49f70c484ad7..0b6bad6691d3 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-dimension/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-dimension/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceDimension = require( '@stdlib/ndarray/slice-dimension' ); +const sliceDimension = require( '@stdlib/ndarray/slice-dimension' ); ``` #### sliceDimension( x, dim, slice\[, options] ) @@ -45,28 +45,28 @@ var sliceDimension = require( '@stdlib/ndarray/slice-dimension' ); Returns a **read-only** view of an input [`ndarray`][@stdlib/ndarray/ctor] when sliced along a specified dimension. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s = new Slice( null, null, -1 ); +const s = new Slice( null, null, -1 ); // returns -var y = sliceDimension( x, 0, s ); +const y = sliceDimension( x, 0, s ); // returns sh = y.shape; @@ -90,28 +90,28 @@ The function supports the following `options`: By default, the function throws an error when provided a slice which exceeds array bounds. To return an empty array when a slice exceeds array bounds, set the `strict` option to `false`. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s = new Slice( 10, 20, 2 ); +const s = new Slice( 10, 20, 2 ); // returns -var y = sliceDimension( x, 1, s, { +const y = sliceDimension( x, 1, s, { 'strict': false }); // returns @@ -146,62 +146,62 @@ arr = ndarray2array( y ); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceDimension = require( '@stdlib/ndarray/slice-dimension' ); +const S = require( '@stdlib/slice/ctor' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceDimension = require( '@stdlib/ndarray/slice-dimension' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get each matrix... -var y1 = sliceDimension( x, 0, 0 ); +const y1 = sliceDimension( x, 0, 0 ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ] -var y2 = sliceDimension( x, 0, 1 ); +const y2 = sliceDimension( x, 0, 1 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] -var y3 = sliceDimension( x, 0, 2 ); +const y3 = sliceDimension( x, 0, 2 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] // Reverse the matrix order: -var s = S( _, _, -1 ); -var y4 = sliceDimension( x, 0, s ); +const s = S( _, _, -1 ); +const y4 = sliceDimension( x, 0, s ); // returns -var a4 = ndarray2array( y4 ); +const a4 = ndarray2array( y4 ); // returns [...] // Get the second rows from each matrix: -var y5 = sliceDimension( x, 1, 1 ); +const y5 = sliceDimension( x, 1, 1 ); // returns -var a5 = ndarray2array( y5 ); +const a5 = ndarray2array( y5 ); // returns [ [ 3, 4, 5 ], [ 12, 13, 14 ], [ 21, 22, 23 ] ] // Get the second columns from each matrix: -var y6 = sliceDimension( x, 2, 1 ); +const y6 = sliceDimension( x, 2, 1 ); // returns -var a6 = ndarray2array( y6 ); +const a6 = ndarray2array( y6 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice-from/README.md b/lib/node_modules/@stdlib/ndarray/slice-from/README.md index 87801709edc9..6f0f72b5c508 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-from/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-from/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceFrom = require( '@stdlib/ndarray/slice-from' ); +const sliceFrom = require( '@stdlib/ndarray/slice-from' ); ``` #### sliceFrom( x, ...start\[, options] ) @@ -45,24 +45,24 @@ var sliceFrom = require( '@stdlib/ndarray/slice-from' ); Returns a **read-only** shifted view of an input [ndarray][@stdlib/ndarray/ctor]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceFrom( x, 1, null ); +const y = sliceFrom( x, 1, null ); // returns sh = y.shape; @@ -86,25 +86,25 @@ The function supports two (mutually exclusive) means for providing index argumen The following example demonstrates each invocation style returning equivalent results. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] // 1. Using an array of index arguments: -var y = sliceFrom( x, [ 1, null ] ); +let y = sliceFrom( x, [ 1, null ] ); // returns sh = y.shape; @@ -131,24 +131,24 @@ The function supports the following `options`: By default, the function throws an error when provided an index argument which exceeds array bounds. To return an empty array when an index exceeds array bounds, set the `strict` option to `false`. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceFrom( x, null, 20, { +const y = sliceFrom( x, null, 20, { 'strict': false }); // returns @@ -186,38 +186,38 @@ arr = ndarray2array( y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceFrom = require( '@stdlib/ndarray/slice-from' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceFrom = require( '@stdlib/ndarray/slice-from' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the last two rows of each matrix: -var y1 = sliceFrom( x, null, 1, null ); +const y1 = sliceFrom( x, null, 1, null ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] // Get the last two rows and columns of each matrix: -var y2 = sliceFrom( x, null, 1, 1 ); +const y2 = sliceFrom( x, null, 1, 1 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 4, 5 ], [ 7, 8 ] ], [ [ 13, 14 ], [ 16, 17 ] ], [ [ 22, 23 ], [ 25, 26 ] ] ] // Get the last two 2x2 matrices: -var y3 = sliceFrom( x, 1, 1, 1 ); +const y3 = sliceFrom( x, 1, 1, 1 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 13, 14 ], [ 16, 17 ] ], [ [ 22, 23 ], [ 25, 26 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice-to/README.md b/lib/node_modules/@stdlib/ndarray/slice-to/README.md index 0fbb5793f002..de156aec339b 100644 --- a/lib/node_modules/@stdlib/ndarray/slice-to/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice-to/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceTo = require( '@stdlib/ndarray/slice-to' ); +const sliceTo = require( '@stdlib/ndarray/slice-to' ); ``` #### sliceTo( x, ...stop\[, options] ) @@ -45,24 +45,24 @@ var sliceTo = require( '@stdlib/ndarray/slice-to' ); Returns a **read-only** truncated view of an input [ndarray][@stdlib/ndarray/ctor]. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceTo( x, 2, null ); +const y = sliceTo( x, 2, null ); // returns sh = y.shape; @@ -86,25 +86,25 @@ The function supports two (mutually exclusive) means for providing index argumen The following example demonstrates each invocation style returning equivalent results. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] // 1. Using an array of index arguments: -var y = sliceTo( x, [ 2, null ] ); +let y = sliceTo( x, [ 2, null ] ); // returns sh = y.shape; @@ -131,24 +131,24 @@ The function supports the following `options`: By default, the function throws an error when provided an index argument which exceeds array bounds. To return an empty array when an index exceeds array bounds, set the `strict` option to `false`. ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var y = sliceTo( x, 2, -20, { +const y = sliceTo( x, 2, -20, { 'strict': false }); // returns @@ -186,38 +186,38 @@ arr = ndarray2array( y ); ```javascript -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var sliceTo = require( '@stdlib/ndarray/slice-to' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const sliceTo = require( '@stdlib/ndarray/slice-to' ); // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get the first two rows of each matrix: -var y1 = sliceTo( x, null, 2, null ); +const y1 = sliceTo( x, null, 2, null ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ [ 0, 1, 2 ], [ 3, 4, 5 ] ], [ [ 9, 10, 11 ], [ 12, 13, 14 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ] ] ] // Get the first two rows and columns of each matrix: -var y2 = sliceTo( x, null, 2, 2 ); +const y2 = sliceTo( x, null, 2, 2 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ [ 0, 1 ], [ 3, 4 ] ], [ [ 9, 10 ], [ 12, 13 ] ], [ [ 18, 19 ], [ 21, 22 ] ] ] // Get the first two 2x2 matrices: -var y3 = sliceTo( x, 2, 2, 2 ); +const y3 = sliceTo( x, 2, 2, 2 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ [ 0, 1 ], [ 3, 4 ] ], [ [ 9, 10 ], [ 12, 13 ] ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/slice/README.md b/lib/node_modules/@stdlib/ndarray/slice/README.md index b3bfad8fdf2a..f40900166b93 100644 --- a/lib/node_modules/@stdlib/ndarray/slice/README.md +++ b/lib/node_modules/@stdlib/ndarray/slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice = require( '@stdlib/ndarray/slice' ); +const slice = require( '@stdlib/ndarray/slice' ); ``` #### slice( x, ...s\[, options] ) @@ -45,31 +45,31 @@ var slice = require( '@stdlib/ndarray/slice' ); Returns a **read-only** view of an input [`ndarray`][@stdlib/ndarray/ctor]. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s0 = new Slice( null, null, -2 ); -var s1 = new Slice( null, null, -1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = new Slice( null, null, -2 ); +const s1 = new Slice( null, null, -1 ); +const s = new MultiSlice( s0, s1 ); // returns -var y = slice( x, s ); +const y = slice( x, s ); // returns sh = y.shape; @@ -94,32 +94,32 @@ The function supports three (mutually exclusive) means for providing slice argum The following example demonstrates each invocation style returning equivalent results. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] // 1. Using a MultiSlice: -var s0 = new Slice( 1, null, 1 ); -var s1 = new Slice( null, null, 1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = new Slice( 1, null, 1 ); +const s1 = new Slice( null, null, 1 ); +const s = new MultiSlice( s0, s1 ); // returns -var y = slice( x, s ); +let y = slice( x, s ); // returns sh = y.shape; @@ -156,31 +156,31 @@ The function supports the following `options`: By default, the function throws an error when provided a slice which exceeds array bounds. To return an empty array when a slice exceeds array bounds, set the `strict` option to `false`. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); -var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -var shape = [ 3, 2 ]; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +const shape = [ 3, 2 ]; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); +const x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); // returns -var sh = x.shape; +let sh = x.shape; // returns [ 3, 2 ] -var arr = ndarray2array( x ); +let arr = ndarray2array( x ); // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -var s0 = new Slice( 1, null, 1 ); -var s1 = new Slice( 10, 20, 1 ); -var s = new MultiSlice( s0, s1 ); +const s0 = new Slice( 1, null, 1 ); +const s1 = new Slice( 10, 20, 1 ); +const s = new MultiSlice( s0, s1 ); // returns -var y = slice( x, s, { +const y = slice( x, s, { 'strict': false }); // returns @@ -220,83 +220,83 @@ arr = ndarray2array( y ); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var E = require( '@stdlib/slice/multi' ); -var array = require( '@stdlib/ndarray/array' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var slice = require( '@stdlib/ndarray/slice' ); +const S = require( '@stdlib/slice/ctor' ); +const E = require( '@stdlib/slice/multi' ); +const array = require( '@stdlib/ndarray/array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const slice = require( '@stdlib/ndarray/slice' ); // Alias `null` to allow for more compact indexing expressions: -var _ = null; +const _ = null; // Create a linear ndarray buffer: -var buf = zeroTo( 27 ); +const buf = zeroTo( 27 ); // Create an ndarray: -var x = array( buf, { +const x = array( buf, { 'shape': [ 3, 3, 3 ] }); // Get each matrix... -var s1 = E( 0, _, _ ); -var y1 = slice( x, s1 ); +const s1 = E( 0, _, _ ); +const y1 = slice( x, s1 ); // returns -var a1 = ndarray2array( y1 ); +const a1 = ndarray2array( y1 ); // returns [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ] -var s2 = E( 1, _, _ ); -var y2 = slice( x, s2 ); +const s2 = E( 1, _, _ ); +const y2 = slice( x, s2 ); // returns -var a2 = ndarray2array( y2 ); +const a2 = ndarray2array( y2 ); // returns [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ] -var s3 = E( 2, _, _ ); -var y3 = slice( x, s3 ); +const s3 = E( 2, _, _ ); +const y3 = slice( x, s3 ); // returns -var a3 = ndarray2array( y3 ); +const a3 = ndarray2array( y3 ); // returns [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] // Reverse all elements: -var s = S( _, _, -1 ); -var s4 = E( s, s, s ); -var y4 = slice( x, s4 ); +const s = S( _, _, -1 ); +const s4 = E( s, s, s ); +const y4 = slice( x, s4 ); // returns -var a4 = ndarray2array( y4 ); +const a4 = ndarray2array( y4 ); // returns [...] // Get the second rows from each matrix: -var s5 = E( _, 1, _ ); -var y5 = slice( x, s5 ); +const s5 = E( _, 1, _ ); +const y5 = slice( x, s5 ); // returns -var a5 = ndarray2array( y5 ); +const a5 = ndarray2array( y5 ); // returns [ [ 3, 4, 5 ], [ 12, 13, 14 ], [ 21, 22, 23 ] ] // Get the second columns from each matrix: -var s6 = E( _, _, 1 ); -var y6 = slice( x, s6 ); +const s6 = E( _, _, 1 ); +const y6 = slice( x, s6 ); // returns -var a6 = ndarray2array( y6 ); +const a6 = ndarray2array( y6 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] // Use an alternative invocation style: -var y7 = slice( x, _, _, 1 ); +const y7 = slice( x, _, _, 1 ); // returns -var a7 = ndarray2array( y7 ); +const a7 = ndarray2array( y7 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] // Use an alternative invocation style: -var y8 = slice( x, [ _, _, 1 ] ); +const y8 = slice( x, [ _, _, 1 ] ); // returns -var a8 = ndarray2array( y8 ); +const a8 = ndarray2array( y8 ); // returns [ [ 1, 4, 7 ], [ 10, 13, 16 ], [ 19, 22, 25 ] ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/stride/README.md b/lib/node_modules/@stdlib/ndarray/stride/README.md index d5c1a5f37c6b..0530b926f7ce 100644 --- a/lib/node_modules/@stdlib/ndarray/stride/README.md +++ b/lib/node_modules/@stdlib/ndarray/stride/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var stride = require( '@stdlib/ndarray/stride' ); +const stride = require( '@stdlib/ndarray/stride' ); ``` #### stride( x, dim ) @@ -45,12 +45,12 @@ var stride = require( '@stdlib/ndarray/stride' ); Returns the stride along a specified dimension for a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var st = stride( x, 0 ); +const st = stride( x, 0 ); // returns 6 ``` @@ -87,18 +87,18 @@ The function accepts the following arguments: ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var stride = require( '@stdlib/ndarray/stride' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const stride = require( '@stdlib/ndarray/stride' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -116,10 +116,8 @@ var slices = [ ]; // Resolve the stride of the first dimension for each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => %d', s.shape.join( ',' ), stride( s, 0 ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/strides/README.md b/lib/node_modules/@stdlib/ndarray/strides/README.md index 429ecc926a2f..eb20e6906b3e 100644 --- a/lib/node_modules/@stdlib/ndarray/strides/README.md +++ b/lib/node_modules/@stdlib/ndarray/strides/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strides = require( '@stdlib/ndarray/strides' ); +const strides = require( '@stdlib/ndarray/strides' ); ``` #### strides( x ) @@ -45,12 +45,12 @@ var strides = require( '@stdlib/ndarray/strides' ); Returns the strides of a provided [ndarray][@stdlib/ndarray/ctor]. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 3, 2, 3 ] ); +const x = zeros( [ 3, 2, 3 ] ); // returns -var st = strides( x ); +const st = strides( x ); // returns [ 6, 3, 1 ] ``` @@ -77,18 +77,18 @@ var st = strides( x ); ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); -var slice = require( '@stdlib/ndarray/slice' ); -var E = require( '@stdlib/slice/multi' ); -var S = require( '@stdlib/slice/ctor' ); -var strides = require( '@stdlib/ndarray/strides' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const slice = require( '@stdlib/ndarray/slice' ); +const E = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const strides = require( '@stdlib/ndarray/strides' ); // Create an array: -var x = zeros( [ 10, 10, 10, 10 ] ); +const x = zeros( [ 10, 10, 10, 10 ] ); // returns // Define some slices: -var slices = [ +const slices = [ // :,:,:,: E( null, null, null, null ), @@ -106,10 +106,8 @@ var slices = [ ]; // Determine the strides of each slice... -var s; -var i; -for ( i = 0; i < slices.length; i++ ) { - s = slice( x, slices[ i ] ); +for ( let i = 0; i < slices.length; i++ ) { + const s = slice( x, slices[ i ] ); console.log( '(%s) => (%s)', x.strides.join( ',' ), strides( s ).join( ',' ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/sub2ind/README.md b/lib/node_modules/@stdlib/ndarray/sub2ind/README.md index 7699b47faff6..5b13e51c1a0c 100644 --- a/lib/node_modules/@stdlib/ndarray/sub2ind/README.md +++ b/lib/node_modules/@stdlib/ndarray/sub2ind/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sub2ind = require( '@stdlib/ndarray/sub2ind' ); +const sub2ind = require( '@stdlib/ndarray/sub2ind' ); ``` #### sub2ind( shape, ...subscripts\[, options] ) @@ -45,9 +45,9 @@ var sub2ind = require( '@stdlib/ndarray/sub2ind' ); Converts subscripts to a linear index. ```javascript -var shape = [ 2, 2 ]; +const shape = [ 2, 2 ]; -var idx = sub2ind( shape, 1, 0 ); +const idx = sub2ind( shape, 1, 0 ); // returns 2 ``` @@ -67,22 +67,22 @@ The function supports the following `options`: By default, the function assumes a row-major array. To return a linear index for a column-major array, set the `order` option. ```javascript -var shape = [ 2, 2 ]; -var opts = {}; +const shape = [ 2, 2 ]; +const opts = {}; opts.order = 'column-major'; -var idx = sub2ind( shape, 1, 0, opts ); +const idx = sub2ind( shape, 1, 0, opts ); // returns 1 ``` By default, the function throws an `error` if provided subscripts which exceed array dimensions. To specify alternative behavior, set the `mode` option. ```javascript -var shape = [ 2, 2 ]; -var opts = {}; +const shape = [ 2, 2 ]; +const opts = {}; opts.mode = 'wrap'; -var idx = sub2ind( shape, -2, 0, opts ); +let idx = sub2ind( shape, -2, 0, opts ); // returns 0 opts.mode = 'clamp'; @@ -93,15 +93,15 @@ idx = sub2ind( shape, 10, 10, opts ); To specify separate modes for each dimension, provide a `mode` array. ```javascript -var shape = [ 2, 2, 2 ]; -var opts = { +const shape = [ 2, 2, 2 ]; +const opts = { 'mode': [ 'wrap', 'clamp' ] }; -var idx = sub2ind( shape, -2, 10, -1, opts ); +const idx = sub2ind( shape, -2, 10, -1, opts ); // returns 3 ``` @@ -126,19 +126,18 @@ var idx = sub2ind( shape, -2, 10, -1, opts ); ```javascript -var numel = require( '@stdlib/ndarray/base/numel' ); -var sub2ind = require( '@stdlib/ndarray/sub2ind' ); +const numel = require( '@stdlib/ndarray/base/numel' ); +const sub2ind = require( '@stdlib/ndarray/sub2ind' ); -var shape = [ 3, 3, 3 ]; -var len = numel( shape ); +const shape = [ 3, 3, 3 ]; +const len = numel( shape ); -var arr = []; -var i; -for ( i = 0; i < len; i++ ) { +const arr = []; +for ( let i = 0; i < len; i++ ) { arr.push( i ); } -var opts = { +const opts = { 'order': 'column-major' }; @@ -147,18 +146,13 @@ console.log( 'Dimensions: %s.', shape.join( 'x' ) ); console.log( 'View:' ); console.log( '' ); -var slice; -var idx; -var row; -var j; -var k; -for ( k = 0; k < shape[ 2 ]; k++ ) { - slice = 'A[:,:,'+k+'] = '; +for ( let k = 0; k < shape[ 2 ]; k++ ) { + const slice = 'A[:,:,'+k+'] = '; console.log( slice ); - for ( i = 0; i < shape[ 0 ]; i++ ) { - row = ' '; - for ( j = 0; j < shape[ 1 ]; j++ ) { - idx = sub2ind( shape, i, j, k, opts ); + for ( let i = 0; i < shape[ 0 ]; i++ ) { + let row = ' '; + for ( let j = 0; j < shape[ 1 ]; j++ ) { + const idx = sub2ind( shape, i, j, k, opts ); row += arr[ idx ]; if ( j < shape[ 1 ]-1 ) { row += ', '; diff --git a/lib/node_modules/@stdlib/ndarray/to-array/README.md b/lib/node_modules/@stdlib/ndarray/to-array/README.md index 91aad76d708e..529fb57e4f6d 100644 --- a/lib/node_modules/@stdlib/ndarray/to-array/README.md +++ b/lib/node_modules/@stdlib/ndarray/to-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); ``` #### ndarray2array( x ) @@ -45,18 +45,18 @@ var ndarray2array = require( '@stdlib/ndarray/to-array' ); Converts an [ndarray][@stdlib/ndarray/ctor] to a generic array (which may include nested arrays). ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = [ 1, 2, 3, 4 ]; -var shape = [ 2, 2 ]; -var order = 'row-major'; -var strides = [ 2, 1 ]; -var offset = 0; +const buffer = [ 1, 2, 3, 4 ]; +const shape = [ 2, 2 ]; +const order = 'row-major'; +const strides = [ 2, 1 ]; +const offset = 0; -var x = ndarray( 'generic', buffer, shape, strides, offset, order ); +const x = ndarray( 'generic', buffer, shape, strides, offset, order ); // returns -var out = ndarray2array( x ); +const out = ndarray2array( x ); // returns [ [ 1, 2 ], [ 3, 4 ] ] ``` @@ -81,43 +81,39 @@ var out = ndarray2array( x ); ```javascript -var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); +const shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +const strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray2array = require( '@stdlib/ndarray/to-array' ); // Create a data buffer: -var buffer = zeroTo( 27 ); +const buffer = zeroTo( 27 ); // Specify array meta data: -var shape = [ 3, 3, 3 ]; -var order = 'column-major'; -var ndims = shape.length; +const shape = [ 3, 3, 3 ]; +const order = 'column-major'; +const ndims = shape.length; // Compute array meta data: -var strides = shape2strides( shape, order ); -var offset = strides2offset( shape, strides ); +const strides = shape2strides( shape, order ); // Print array information: console.log( '' ); console.log( 'Dims: %s', shape.join( 'x' ) ); // Randomly flip strides and convert an ndarray to a nested array... -var arr; -var i; -var j; -for ( i = 0; i < 20; i++ ) { - j = discreteUniform( 0, ndims-1 ); +for ( let i = 0; i < 20; i++ ) { + const j = discreteUniform( 0, ndims-1 ); strides[ j ] *= -1; - offset = strides2offset( shape, strides ); + const offset = strides2offset( shape, strides ); console.log( '' ); console.log( 'Strides: %s', strides.join( ',' ) ); console.log( 'Offset: %d', offset ); - arr = ndarray( 'generic', buffer, shape, strides, offset, order ); + const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); console.log( JSON.stringify( ndarray2array( arr ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/zeros-like/README.md b/lib/node_modules/@stdlib/ndarray/zeros-like/README.md index fe3d7687ee86..9386fa6a4d60 100644 --- a/lib/node_modules/@stdlib/ndarray/zeros-like/README.md +++ b/lib/node_modules/@stdlib/ndarray/zeros-like/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zerosLike = require( '@stdlib/ndarray/zeros-like' ); +const zerosLike = require( '@stdlib/ndarray/zeros-like' ); ``` #### zerosLike( x\[, options] ) @@ -45,18 +45,18 @@ var zerosLike = require( '@stdlib/ndarray/zeros-like' ); Creates a zero-filled [ndarray][@stdlib/ndarray/ctor] having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 2, 2 ] ); +const x = zeros( [ 2, 2 ] ); // returns -var y = zerosLike( x ); +const y = zerosLike( x ); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] -var dt = y.dtype; +const dt = y.dtype; // returns 'float64' ``` @@ -72,20 +72,20 @@ The function supports the following `options`: To override either the `dtype`, `shape`, or `order`, specify the corresponding option. For example, to override the inferred [data type][@stdlib/ndarray/dtypes], ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var x = zeros( [ 2, 2 ] ); +const x = zeros( [ 2, 2 ] ); // returns -var dt = x.dtype; +let dt = x.dtype; // returns 'float64' -var y = zerosLike( x, { +const y = zerosLike( x, { 'dtype': 'int32' }); // returns -var sh = y.shape; +const sh = y.shape; // returns [ 2, 2 ] dt = y.dtype; @@ -113,22 +113,19 @@ dt = y.dtype; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var zeros = require( '@stdlib/ndarray/zeros' ); -var zerosLike = require( '@stdlib/ndarray/zeros-like' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const zeros = require( '@stdlib/ndarray/zeros' ); +const zerosLike = require( '@stdlib/ndarray/zeros-like' ); // Get a list of data types: -var dt = dtypes( 'numeric' ); +const dt = dtypes( 'numeric' ); // Generate zero-filled arrays... -var x; -var y; -var i; -for ( i = 0; i < dt.length; i++ ) { - x = zeros( [ 2, 2 ], { +for ( let i = 0; i < dt.length; i++ ) { + const x = zeros( [ 2, 2 ], { 'dtype': dt[ i ] }); - y = zerosLike( x ); + const y = zerosLike( x ); console.log( y.data ); } ``` diff --git a/lib/node_modules/@stdlib/ndarray/zeros/README.md b/lib/node_modules/@stdlib/ndarray/zeros/README.md index 211104b48794..8a6067f699f9 100644 --- a/lib/node_modules/@stdlib/ndarray/zeros/README.md +++ b/lib/node_modules/@stdlib/ndarray/zeros/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); ``` #### zeros( shape\[, options] ) @@ -45,26 +45,26 @@ var zeros = require( '@stdlib/ndarray/zeros' ); Creates a zero-filled [ndarray][@stdlib/ndarray/ctor] having a specified shape and [data type][@stdlib/ndarray/dtypes]. ```javascript -var arr = zeros( [ 2, 2 ] ); +const arr = zeros( [ 2, 2 ] ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` The specified output [ndarray][@stdlib/ndarray/ctor] `shape` may be either an array-like object or an integer value. ```javascript -var arr = zeros( 2 ); +const arr = zeros( 2 ); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float64' ``` @@ -79,15 +79,15 @@ The function accepts the following `options`: By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [`float64`][@stdlib/ndarray/dtypes] data type. To specify an alternative [data type][@stdlib/ndarray/dtypes], provide a `dtype` option. ```javascript -var arr = zeros( [ 2, 2 ], { +const arr = zeros( [ 2, 2 ], { 'dtype': 'float32' }); // returns -var sh = arr.shape; +const sh = arr.shape; // returns [ 2, 2 ] -var dt = arr.dtype; +const dt = arr.dtype; // returns 'float32' ``` @@ -112,17 +112,15 @@ var dt = arr.dtype; ```javascript -var dtypes = require( '@stdlib/ndarray/dtypes' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const dtypes = require( '@stdlib/ndarray/dtypes' ); +const zeros = require( '@stdlib/ndarray/zeros' ); // Get a list of data types: -var dt = dtypes( 'numeric' ); +const dt = dtypes( 'numeric' ); // Generate zero-filled arrays... -var arr; -var i; -for ( i = 0; i < dt.length; i++ ) { - arr = zeros( [ 2, 2 ], { +for ( let i = 0; i < dt.length; i++ ) { + const arr = zeros( [ 2, 2 ], { 'dtype': dt[ i ] }); console.log( arr.data ); diff --git a/lib/node_modules/@stdlib/net/README.md b/lib/node_modules/@stdlib/net/README.md index edcc13544e0c..b25107ceb920 100644 --- a/lib/node_modules/@stdlib/net/README.md +++ b/lib/node_modules/@stdlib/net/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var net = require( '@stdlib/net' ); +const net = require( '@stdlib/net' ); ``` #### net @@ -35,7 +35,7 @@ var net = require( '@stdlib/net' ); Namespace containing networking functionality. ```javascript -var n = net; +const n = net; // returns {...} ``` @@ -64,8 +64,8 @@ var n = net; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var net = require( '@stdlib/net' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const net = require( '@stdlib/net' ); console.log( objectKeys( net ) ); ``` diff --git a/lib/node_modules/@stdlib/net/disposable-http-server/README.md b/lib/node_modules/@stdlib/net/disposable-http-server/README.md index 640c974f1516..1dbadf82ee2c 100644 --- a/lib/node_modules/@stdlib/net/disposable-http-server/README.md +++ b/lib/node_modules/@stdlib/net/disposable-http-server/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var httpServer = require( '@stdlib/net/disposable-http-server' ); +const httpServer = require( '@stdlib/net/disposable-http-server' ); ``` #### httpServer( options\[, clbk] ) @@ -39,7 +39,7 @@ Creates a disposable HTTP server; i.e., the server closes immediately after serv ```javascript -var opts = { +const opts = { 'html': '', 'javascript': 'console.log( "Boop" );' }; @@ -62,7 +62,7 @@ To serve HTML content, set the `html` option. Once the content is requested, the ```javascript -var opts = { +const opts = { 'html': '

Beep

' }; @@ -74,7 +74,7 @@ To serve JavaScript, set the `javascript` option. If no HTML is provided, an HTM ```javascript -var opts = { +const opts = { 'javascript': 'console.log( "Boop" );' }; @@ -86,7 +86,7 @@ If HTML and JavaScript are provided, in order for the JavaScript to be served, t ```javascript -var opts = { +const opts = { 'html': '', 'javascript': 'console.log( "Boop" );' }; @@ -99,7 +99,7 @@ To obtain the `server` handle, provide a callback. ```javascript -var nextTick = require( '@stdlib/utils/next-tick' ); +const nextTick = require( '@stdlib/utils/next-tick' ); function onReady( error, server ) { if ( error ) { @@ -111,7 +111,7 @@ function onReady( error, server ) { } } -var opts = { +const opts = { 'html': html, 'javascript': 'console.log( "Boop" );' }; @@ -142,14 +142,14 @@ httpServer( opts, onReady ); ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var httpServer = require( '@stdlib/net/disposable-http-server' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const httpServer = require( '@stdlib/net/disposable-http-server' ); -var html = join( __dirname, 'examples', 'fixtures', 'index.html' ); -var js = join( __dirname, 'examples', 'fixtures', 'script.js' ); +const html = join( __dirname, 'examples', 'fixtures', 'index.html' ); +const js = join( __dirname, 'examples', 'fixtures', 'script.js' ); -var opts = { +const opts = { 'html': readFileSync( html ), 'javascript': readFileSync( js ), 'port': 7331, diff --git a/lib/node_modules/@stdlib/net/http-server/README.md b/lib/node_modules/@stdlib/net/http-server/README.md index 5ab01a8a2410..31da54808569 100644 --- a/lib/node_modules/@stdlib/net/http-server/README.md +++ b/lib/node_modules/@stdlib/net/http-server/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var httpServer = require( '@stdlib/net/http-server' ); +const httpServer = require( '@stdlib/net/http-server' ); ``` #### httpServer( \[options,] \[ requestListener] ) @@ -35,7 +35,7 @@ var httpServer = require( '@stdlib/net/http-server' ); Returns a function to create an [HTTP][http] server. ```javascript -var createServer = httpServer(); +const createServer = httpServer(); ``` To bind a request callback to a server, provide a `requestListener`. @@ -46,7 +46,7 @@ function requestListener( request, response ) { response.end( 'OK' ); } -var createServer = httpServer( requestListener ); +const createServer = httpServer( requestListener ); ``` The function accepts the following `options`: @@ -59,22 +59,22 @@ The function accepts the following `options`: To specify server options, provide an `options` object. ```javascript -var opts = { +const opts = { 'port': 7331, 'address': '0.0.0.0' }; -var createServer = httpServer( opts ); +const createServer = httpServer( opts ); ``` To specify a range of permissible ports, set the `maxport` option. ```javascript -var opts = { +const opts = { 'maxport': 9999 }; -var createServer = httpServer( opts ); +const createServer = httpServer( opts ); ``` When provided a `maxport` option, a created server will search for the first available `port` on which to listen, starting from `port`. @@ -92,7 +92,7 @@ function done( error, server ) { server.close(); } -var createServer = httpServer(); +const createServer = httpServer(); createServer( done ); ``` @@ -120,9 +120,9 @@ createServer( done ); ```javascript -var proc = require( 'process' ); -var http = require( 'http' ); -var httpServer = require( '@stdlib/net/http-server' ); +const proc = require( 'process' ); +const http = require( 'http' ); +const httpServer = require( '@stdlib/net/http-server' ); function done( error, server ) { if ( error ) { @@ -142,14 +142,14 @@ function onRequest( request, response ) { } // Specify server options... -var opts = { +const opts = { 'port': 7331, 'maxport': 9999, 'hostname': 'localhost' }; // Create a function for creating an HTTP server... -var createServer = httpServer( opts, onRequest ); +const createServer = httpServer( opts, onRequest ); // Create a server: createServer( done ); diff --git a/lib/node_modules/@stdlib/net/simple-http-server/README.md b/lib/node_modules/@stdlib/net/simple-http-server/README.md index 9348632c9122..575a8b2e6d6a 100644 --- a/lib/node_modules/@stdlib/net/simple-http-server/README.md +++ b/lib/node_modules/@stdlib/net/simple-http-server/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var httpServer = require( '@stdlib/net/simple-http-server' ); +const httpServer = require( '@stdlib/net/simple-http-server' ); ``` #### httpServer( \[options,] \[clbk] ) @@ -55,7 +55,7 @@ By default, the server serves content from the current working directory of the ```javascript -var opts = { +const opts = { 'dir': './examples' }; httpServer( opts ); @@ -64,7 +64,7 @@ httpServer( opts ); To obtain the `server` handle, provide a callback. ```javascript -var nextTick = require( '@stdlib/utils/next-tick' ); +const nextTick = require( '@stdlib/utils/next-tick' ); function onReady( error, server ) { if ( error ) { @@ -89,9 +89,9 @@ httpServer( onReady ); ```javascript -var httpServer = require( '@stdlib/net/simple-http-server' ); +const httpServer = require( '@stdlib/net/simple-http-server' ); -var opts = { +const opts = { 'dir': './', 'port': 7331, 'hostname': 'localhost', diff --git a/lib/node_modules/@stdlib/nlp/README.md b/lib/node_modules/@stdlib/nlp/README.md index bb606b3c72a7..648d195a413e 100644 --- a/lib/node_modules/@stdlib/nlp/README.md +++ b/lib/node_modules/@stdlib/nlp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nlp = require( '@stdlib/nlp' ); +const nlp = require( '@stdlib/nlp' ); ``` #### nlp @@ -35,7 +35,7 @@ var nlp = require( '@stdlib/nlp' ); Namespace containing natural language processing (NLP) functionality. ```javascript -var fcns = nlp; +const fcns = nlp; // returns {...} ``` @@ -68,8 +68,8 @@ var fcns = nlp; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var nlp = require( '@stdlib/nlp' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const nlp = require( '@stdlib/nlp' ); console.log( objectKeys( nlp ) ); ``` diff --git a/lib/node_modules/@stdlib/nlp/expand-acronyms/README.md b/lib/node_modules/@stdlib/nlp/expand-acronyms/README.md index 3dd2d3bd2270..8b18846058ec 100644 --- a/lib/node_modules/@stdlib/nlp/expand-acronyms/README.md +++ b/lib/node_modules/@stdlib/nlp/expand-acronyms/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var expandAcronyms = require( '@stdlib/nlp/expand-acronyms' ); +const expandAcronyms = require( '@stdlib/nlp/expand-acronyms' ); ``` #### expandAcronyms( str ) @@ -41,8 +41,8 @@ var expandAcronyms = require( '@stdlib/nlp/expand-acronyms' ); Expands acronyms in a string. ```javascript -var str = 'TLDR, the article is too long...'; -var out = expandAcronyms( str ); +const str = 'TLDR, the article is too long...'; +const out = expandAcronyms( str ); // returns 'too long did not read, the article is too long...' ``` @@ -67,10 +67,10 @@ var out = expandAcronyms( str ); ```javascript -var expandAcronyms = require( '@stdlib/nlp/expand-acronyms' ); +const expandAcronyms = require( '@stdlib/nlp/expand-acronyms' ); -var str = 'LOL, this is fun. I am ROFL.'; -var out = expandAcronyms( str ); +let str = 'LOL, this is fun. I am ROFL.'; +let out = expandAcronyms( str ); // returns 'laughing out loud, this is fun. I am rolling on the floor laughing.' str = 'brb, I need to check my mail. thx!'; diff --git a/lib/node_modules/@stdlib/nlp/expand-contractions/README.md b/lib/node_modules/@stdlib/nlp/expand-contractions/README.md index 9714f612e4f9..3a616c45dc06 100644 --- a/lib/node_modules/@stdlib/nlp/expand-contractions/README.md +++ b/lib/node_modules/@stdlib/nlp/expand-contractions/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var expandContractions = require( '@stdlib/nlp/expand-contractions' ); +const expandContractions = require( '@stdlib/nlp/expand-contractions' ); ``` #### expandContractions( str ) @@ -41,8 +41,8 @@ var expandContractions = require( '@stdlib/nlp/expand-contractions' ); Expands all contractions to their formal equivalents. ```javascript -var str = 'I won\'t be able to get y\'all out of this one.'; -var out = expandContractions( str ); +const str = 'I won\'t be able to get y\'all out of this one.'; +const out = expandContractions( str ); // returns 'I will not be able to get you all out of this one.' ``` @@ -67,10 +67,10 @@ var out = expandContractions( str ); ```javascript -var expandContractions = require( '@stdlib/nlp/expand-contractions' ); +const expandContractions = require( '@stdlib/nlp/expand-contractions' ); -var str = 'I won\'t be able to, sorry.'; -var out = expandContractions( str ); +let str = 'I won\'t be able to, sorry.'; +let out = expandContractions( str ); // returns 'I will not be able to, sorry.' str = 'She\'ll be coming around the mountain...'; diff --git a/lib/node_modules/@stdlib/nlp/lda/README.md b/lib/node_modules/@stdlib/nlp/lda/README.md index 769261f4cb32..a52566ccc56a 100644 --- a/lib/node_modules/@stdlib/nlp/lda/README.md +++ b/lib/node_modules/@stdlib/nlp/lda/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var lda = require( '@stdlib/nlp/lda' ); +const lda = require( '@stdlib/nlp/lda' ); ``` #### lda( docs, K\[, options] ) @@ -41,10 +41,7 @@ var lda = require( '@stdlib/nlp/lda' ); [Latent Dirichlet Allocation][lda] via collapsed Gibbs sampling. To create a model, call the `lda` function by passing it an `array` of `strings` and the number of topics `K` that should be identified. ```javascript -var model; -var docs; - -docs = [ +const docs = [ 'I loved you first', 'For one is both and both are one in love', 'You never see my pain', @@ -52,7 +49,7 @@ docs = [ 'See a lot of pain, a lot of tears' ]; -model = lda( docs, 2 ); +const model = lda( docs, 2 ); // returns {} ``` @@ -77,7 +74,7 @@ Returns the `no` terms with the highest probabilities for chosen topic `k`. ```javascript -var words = model.getTerms( 0, 3 ); +const words = model.getTerms( 0, 3 ); /* returns [ { 'word': 'both', 'prob': 0.06315008476532499 }, @@ -98,62 +95,54 @@ var words = model.getTerms( 0, 3 ); ```javascript -var sotu = require( '@stdlib/datasets/sotu' ); -var roundn = require( '@stdlib/math/base/special/roundn' ); -var stopwords = require( '@stdlib/datasets/stopwords-en' ); -var lowercase = require( '@stdlib/string/lowercase' ); -var lda = require( '@stdlib/nlp/lda' ); - -var speeches; -var words; -var terms; -var model; -var str; -var i; -var j; - -words = stopwords(); -for ( i = 0; i < words.length; i++ ) { +const sotu = require( '@stdlib/datasets/sotu' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const stopwords = require( '@stdlib/datasets/stopwords-en' ); +const lowercase = require( '@stdlib/string/lowercase' ); +const lda = require( '@stdlib/nlp/lda' ); + +const words = stopwords(); +for ( let i = 0; i < words.length; i++ ) { words[ i ] = new RegExp( '\\b'+words[ i ]+'\\b', 'gi' ); } -speeches = sotu({ +const speeches = sotu({ 'range': [ 1930, 2010 ] }); -for ( i = 0; i < speeches.length; i++ ) { - str = lowercase( speeches[ i ].text ); - for ( j = 0; j < words.length; j++ ) { +for ( let i = 0; i < speeches.length; i++ ) { + let str = lowercase( speeches[ i ].text ); + for ( let j = 0; j < words.length; j++ ) { str = str.replace( words[ j ], '' ); } speeches[ i ] = str; } -model = lda( speeches, 3 ); +const model = lda( speeches, 3 ); model.fit( 1000, 100, 10 ); -for ( i = 0; i <= 80; i++ ) { - str = 'Year: ' + (1930+i) + '\t'; +for ( let i = 0; i <= 80; i++ ) { + let str = 'Year: ' + (1930+i) + '\t'; str += 'Topic 1: ' + roundn( model.avgTheta.get( i, 0 ), -3 ) + '\t'; str += 'Topic 2: ' + roundn( model.avgTheta.get( i, 1 ), -3 ) + '\t'; str += 'Topic 3: ' + roundn( model.avgTheta.get( i, 2 ), -3 ); console.log( str ); } -terms = model.getTerms( 0, 20 ); -for ( i = 0; i < terms.length; i++ ) { +let terms = model.getTerms( 0, 20 ); +for ( let i = 0; i < terms.length; i++ ) { terms[ i ] = terms[ i ].word; } console.log( 'Words most associated with first topic:\n ' + terms.join( ', ' ) ); terms = model.getTerms( 1, 20 ); -for ( i = 0; i < terms.length; i++ ) { +for ( let i = 0; i < terms.length; i++ ) { terms[ i ] = terms[ i ].word; } console.log( 'Words most associated with second topic:\n ' + terms.join( ', ' ) ); terms = model.getTerms( 2, 20 ); -for ( i = 0; i < terms.length; i++ ) { +for ( let i = 0; i < terms.length; i++ ) { terms[ i ] = terms[ i ].word; } console.log( 'Words most associated with third topic:\n ' + terms.join( ', ' ) ); diff --git a/lib/node_modules/@stdlib/nlp/ordinalize/README.md b/lib/node_modules/@stdlib/nlp/ordinalize/README.md index 422173bfd8ae..1c81f42dac6c 100644 --- a/lib/node_modules/@stdlib/nlp/ordinalize/README.md +++ b/lib/node_modules/@stdlib/nlp/ordinalize/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ordinalize = require( '@stdlib/nlp/ordinalize' ); +const ordinalize = require( '@stdlib/nlp/ordinalize' ); ``` #### ordinalize( value\[, options] ) @@ -41,7 +41,7 @@ var ordinalize = require( '@stdlib/nlp/ordinalize' ); Converts an integer to an ordinal string (e.g., `1st`, `2nd`, etc.). ```javascript -var out = ordinalize( '22' ); +let out = ordinalize( '22' ); // returns '22nd' out = ordinalize( 13 ); @@ -57,7 +57,7 @@ The function accepts the following `options`: By default, the function returns an ordinal string. To return only an ordinal suffix, set the `suffixOnly` option. ```javascript -var out = ordinalize( '22', { +const out = ordinalize( '22', { 'suffixOnly': true }); // returns 'nd' @@ -66,7 +66,7 @@ var out = ordinalize( '22', { By default, the function returns an ordinal string in English. To return an ordinal string for a different language, set the `lang` option. ```javascript -var out = ordinalize( '22', { +const out = ordinalize( '22', { 'lang': 'fr' }); // returns '22e' @@ -75,11 +75,11 @@ var out = ordinalize( '22', { By default, if a language differentiates between masculine and feminine grammatical forms, the functions returns an ordinal string in the masculine form. To return an ordinal string in the feminine form, set the `gender` option. ```javascript -var opts = { +const opts = { 'lang': 'es', 'gender': 'masculine' }; -var out = ordinalize( 7, opts ); +let out = ordinalize( 7, opts ); // returns '7º' opts.gender = 'feminine'; @@ -119,9 +119,9 @@ out = ordinalize( 7, opts ); ```javascript -var ordinalize = require( '@stdlib/nlp/ordinalize' ); +const ordinalize = require( '@stdlib/nlp/ordinalize' ); -var out = ordinalize( '1' ); +let out = ordinalize( '1' ); // returns '1st' out = ordinalize( 2 ); diff --git a/lib/node_modules/@stdlib/nlp/porter-stemmer/README.md b/lib/node_modules/@stdlib/nlp/porter-stemmer/README.md index 0ef6d4dd489b..c57a746f7cc0 100644 --- a/lib/node_modules/@stdlib/nlp/porter-stemmer/README.md +++ b/lib/node_modules/@stdlib/nlp/porter-stemmer/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var porterStemmer = require( '@stdlib/nlp/porter-stemmer' ); +const porterStemmer = require( '@stdlib/nlp/porter-stemmer' ); ``` #### porterStemmer( word ) @@ -41,7 +41,7 @@ var porterStemmer = require( '@stdlib/nlp/porter-stemmer' ); Extracts the stem of a given word using the Porter stemming algorithm. ```javascript -var out = porterStemmer( 'worldwide' ); +let out = porterStemmer( 'worldwide' ); // returns 'worldwid' out = porterStemmer( 'fighting' ); @@ -59,9 +59,9 @@ out = porterStemmer( 'fighting' ); ```javascript -var porterStemmer = require( '@stdlib/nlp/porter-stemmer' ); +const porterStemmer = require( '@stdlib/nlp/porter-stemmer' ); -var out = porterStemmer( 'walking' ); +let out = porterStemmer( 'walking' ); // returns 'walk' out = porterStemmer( 'walked' ); diff --git a/lib/node_modules/@stdlib/nlp/sentencize/README.md b/lib/node_modules/@stdlib/nlp/sentencize/README.md index 7b4ecbfaa976..5ed24c006259 100644 --- a/lib/node_modules/@stdlib/nlp/sentencize/README.md +++ b/lib/node_modules/@stdlib/nlp/sentencize/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sentencize = require( '@stdlib/nlp/sentencize' ); +const sentencize = require( '@stdlib/nlp/sentencize' ); ``` #### sentencize( str ) @@ -41,8 +41,8 @@ var sentencize = require( '@stdlib/nlp/sentencize' ); Splits a string into an array of sentences. ```javascript -var str = 'Hello Mrs. Maple, could you call me back? I need to talk to you about something.'; -var out = sentencize( str ); +let str = 'Hello Mrs. Maple, could you call me back? I need to talk to you about something.'; +let out = sentencize( str ); // returns [ 'Hello Mrs. Maple, could you call me back?', 'I need to talk to you about something.' ] str = 'As of 2.14.2023, the average price of apples is $1.31 per pound! Inflation has been a strain on the economy.'; @@ -61,21 +61,21 @@ out = sentencize( str ); ```javascript -var sentencize = require( '@stdlib/nlp/sentencize' ); +const sentencize = require( '@stdlib/nlp/sentencize' ); -var sentences = [ +const sentences = [ 'Dr. John Smith, Jr. who is a renowned expert in the field of Artificial Intelligence, and who has published numerous papers on the subject, e.g. "Machine Learning for Dummies", "The Future of AI", etc., gave a lecture at the annual AI conference yesterday and stated that AI technology is rapidly advancing, but we must be cautious of its potential consequences such as job displacement, privacy concerns, and ethical dilemmas.', 'In addition, AI also has many benefits such as improved efficiency and accuracy, and the ability to process large amounts of data.', 'Dr. Smith emphasized that it is crucial for society to have open and honest discussions about the development and deployment of AI to ensure its responsible and beneficial use for all.', 'He also stressed the importance of considering the implications and consequences of AI, i.e. it must not be developed or used in a way that is harmful or unethical.', 'The audience was in agreement, nodding their heads and taking notes throughout the lecture.' ]; -var str = sentences.join( ' ' ); +const str = sentences.join( ' ' ); -var out = sentencize( str ); +const out = sentencize( str ); // returns [...] -var bool = ( out.length === 5 ); +let bool = ( out.length === 5 ); // returns true bool = ( out[ 0 ] === sentences[ 0 ] ); diff --git a/lib/node_modules/@stdlib/nlp/tokenize/README.md b/lib/node_modules/@stdlib/nlp/tokenize/README.md index fc9f08d016c5..b2820f5418c1 100644 --- a/lib/node_modules/@stdlib/nlp/tokenize/README.md +++ b/lib/node_modules/@stdlib/nlp/tokenize/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var tokenize = require( '@stdlib/nlp/tokenize' ); +const tokenize = require( '@stdlib/nlp/tokenize' ); ``` #### tokenize( str\[, keepWhitespace] ) @@ -41,16 +41,16 @@ var tokenize = require( '@stdlib/nlp/tokenize' ); Tokenizes a string. ```javascript -var str = 'Hello Mrs. Maple, could you call me back?'; -var out = tokenize( str ); +const str = 'Hello Mrs. Maple, could you call me back?'; +const out = tokenize( str ); // returns [ 'Hello', 'Mrs.', 'Maple', ',', 'could', 'you', 'call', 'me', 'back', '?' ] ``` To include whitespace characters (spaces, tabs, line breaks) in the output array, set `keepWhitespace` to `true`. ```javascript -var str = 'Hello World!\n'; -var out = tokenize( str, true ); +const str = 'Hello World!\n'; +const out = tokenize( str, true ); // returns [ 'Hello', ' ', 'World', '!', '\n' ] ``` @@ -62,10 +62,12 @@ var out = tokenize( str, true ); ## Examples + + ```javascript -var tokenize = require( '@stdlib/nlp/tokenize' ); +const tokenize = require( '@stdlib/nlp/tokenize' ); console.log( tokenize( 'Hello World!' ) ); // => [ 'Hello', 'World', '!' ] @@ -73,7 +75,7 @@ console.log( tokenize( 'Hello World!' ) ); console.log( tokenize( '' ) ); // => [] -var str = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod.'; +const str = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod.'; console.log( tokenize( str ) ); /* => [ diff --git a/lib/node_modules/@stdlib/number/README.md b/lib/node_modules/@stdlib/number/README.md index c421907fed27..168dcb11b40f 100644 --- a/lib/node_modules/@stdlib/number/README.md +++ b/lib/node_modules/@stdlib/number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number' ); +const ns = require( '@stdlib/number' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number' ); Number namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -70,8 +70,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/ctor/README.md b/lib/node_modules/@stdlib/number/ctor/README.md index 6219271246c7..b4574cd9c120 100644 --- a/lib/node_modules/@stdlib/number/ctor/README.md +++ b/lib/node_modules/@stdlib/number/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Number = require( '@stdlib/number/ctor' ); +const Number = require( '@stdlib/number/ctor' ); ``` #### Number( value ) @@ -47,7 +47,7 @@ Returns a [`Number`][mdn-number] object. ```javascript -var v = new Number( 5.0 ); +const v = new Number( 5.0 ); // returns ``` @@ -78,14 +78,11 @@ var v = new Number( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Number = require( '@stdlib/number/ctor' ); +const randu = require( '@stdlib/random/base/randu' ); +const Number = require( '@stdlib/number/ctor' ); -var v; -var i; - -for ( i = 0; i < 100; i++ ) { - v = new Number( randu() ); +for ( let i = 0; i < 100; i++ ) { + const v = new Number( randu() ); console.log( 'typeof %d: %s', v, typeof v ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/README.md b/lib/node_modules/@stdlib/number/float32/README.md index e2d43131bb2e..6e8fff6ff0d4 100644 --- a/lib/node_modules/@stdlib/number/float32/README.md +++ b/lib/node_modules/@stdlib/number/float32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/float32' ); +const ns = require( '@stdlib/number/float32' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/float32' ); Utilities for single-precision floating-point numbers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float32' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/README.md b/lib/node_modules/@stdlib/number/float32/base/README.md index 0cccaa67c0b5..4a44f8365624 100644 --- a/lib/node_modules/@stdlib/number/float32/base/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/float32/base' ); +const ns = require( '@stdlib/number/float32/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/float32/base' ); Base utilities for single-precision floating-point numbers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -72,8 +72,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float32/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float32/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/assert/README.md b/lib/node_modules/@stdlib/number/float32/base/assert/README.md index 6d546a90c2b0..5ab6042933c1 100644 --- a/lib/node_modules/@stdlib/number/float32/base/assert/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var assert = require( '@stdlib/number/float32/base/assert' ); +const assert = require( '@stdlib/number/float32/base/assert' ); ``` #### assert @@ -35,7 +35,7 @@ var assert = require( '@stdlib/number/float32/base/assert' ); Namespace containing "base" single-precision floating-point number assert functions. ```javascript -var ns = assert; +const ns = assert; // returns {...} ``` @@ -73,8 +73,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float32/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float32/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value-zero/README.md index ac5809a801e5..a389ae5ca82a 100644 --- a/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValueZerof = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); +const isSameValueZerof = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); ``` #### isSameValueZerof( a, b ) @@ -35,9 +35,9 @@ var isSameValueZerof = require( '@stdlib/number/float32/base/assert/is-same-valu Tests if two single-precision floating-point numbers `a` and `b` are the same value. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var bool = isSameValueZerof( toFloat32( 3.14 ), toFloat32( 3.14 ) ); +let bool = isSameValueZerof( toFloat32( 3.14 ), toFloat32( 3.14 ) ); // returns true bool = isSameValueZerof( toFloat32( 5.0 ), toFloat32( 3.0 ) ); @@ -49,7 +49,7 @@ In contrast to the strict equality operator `===`, the function treats `NaNs` as ```javascript -var bool = ( NaN === NaN ); +let bool = ( NaN === NaN ); // returns false bool = isSameValueZerof( NaN, NaN ); @@ -61,7 +61,7 @@ In contrast to the [SameValue Algorithm][@stdlib/number/float32/base/assert/is-s ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValueZerof( 0.0, -0.0 ); @@ -88,10 +88,10 @@ bool = isSameValueZerof( -0.0, 0.0 ); ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var isSameValueZerof = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const isSameValueZerof = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); -var bool = isSameValueZerof( toFloat32( 3.14 ), toFloat32( 3.14 ) ); +let bool = isSameValueZerof( toFloat32( 3.14 ), toFloat32( 3.14 ) ); // returns true bool = isSameValueZerof( toFloat32( 0.0 ), toFloat32( 0.0 ) ); diff --git a/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value/README.md b/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value/README.md index 0eee66b74d28..67490858ff5b 100644 --- a/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/assert/is-same-value/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValuef = require( '@stdlib/number/float32/base/assert/is-same-value' ); +const isSameValuef = require( '@stdlib/number/float32/base/assert/is-same-value' ); ``` #### isSameValuef( a, b ) @@ -35,9 +35,9 @@ var isSameValuef = require( '@stdlib/number/float32/base/assert/is-same-value' ) Tests if two single-precision floating-point numbers `a` and `b` are the same value. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var bool = isSameValuef( toFloat32( 3.14 ), toFloat32( 3.14 ) ); +let bool = isSameValuef( toFloat32( 3.14 ), toFloat32( 3.14 ) ); // returns true bool = isSameValuef( toFloat32( 5.0 ), toFloat32( 3.0 ) ); @@ -49,7 +49,7 @@ In contrast to the strict equality operator `===`, the function distinguishes be ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValuef( 0.0, -0.0 ); @@ -86,10 +86,10 @@ bool = isSameValuef( NaN, NaN ); ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var isSameValuef = require( '@stdlib/number/float32/base/assert/is-same-value' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const isSameValuef = require( '@stdlib/number/float32/base/assert/is-same-value' ); -var bool = isSameValuef( toFloat32( 3.14 ), toFloat32( 3.14 ) ); +let bool = isSameValuef( toFloat32( 3.14 ), toFloat32( 3.14 ) ); // returns true bool = isSameValuef( toFloat32( 0.0 ), toFloat32( 0.0 ) ); diff --git a/lib/node_modules/@stdlib/number/float32/base/exponent/README.md b/lib/node_modules/@stdlib/number/float32/base/exponent/README.md index d0351e28371c..99db056d1690 100644 --- a/lib/node_modules/@stdlib/number/float32/base/exponent/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/exponent/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponentf = require( '@stdlib/number/float32/base/exponent' ); +const exponentf = require( '@stdlib/number/float32/base/exponent' ); ``` #### exponentf( x ) @@ -35,9 +35,9 @@ var exponentf = require( '@stdlib/number/float32/base/exponent' ); Returns an integer corresponding to the unbiased exponent of a [single-precision floating-point number][ieee754]. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var exp = exponentf( toFloat32( 3.14e34 ) ); // => 2^114 ~ 2.08e34 +let exp = exponentf( toFloat32( 3.14e34 ) ); // => 2^114 ~ 2.08e34 // returns 114 exp = exponentf( toFloat32( 3.14e-34 ) ); // => 2^-112 ~ 1.93e-34 @@ -64,25 +64,19 @@ exp = exponentf( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var exponentf = require( '@stdlib/number/float32/base/exponent' ); - -var frac; -var exp; -var x; -var e; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const exponentf = require( '@stdlib/number/float32/base/exponent' ); // Generate random numbers and extract their exponents... -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = round( randu()*44.0 ) - 22; - x = frac * pow( 10.0, exp ); +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = round( randu()*44.0 ) - 22; + let x = frac * pow( 10.0, exp ); x = toFloat32( x ); - e = exponentf( x ); + const e = exponentf( x ); console.log( 'x: %d. unbiased exponent: %d.', x, e ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/from-binary-string/README.md b/lib/node_modules/@stdlib/number/float32/base/from-binary-string/README.md index 9a9ef8b5c9d4..af441af7d5a7 100644 --- a/lib/node_modules/@stdlib/number/float32/base/from-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/from-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromBinaryStringf = require( '@stdlib/number/float32/base/from-binary-string' ); +const fromBinaryStringf = require( '@stdlib/number/float32/base/from-binary-string' ); ``` #### fromBinaryStringf( bstr ) @@ -35,8 +35,8 @@ var fromBinaryStringf = require( '@stdlib/number/float32/base/from-binary-string Creates a [single-precision floating-point number][ieee754] from an [IEEE 754 literal bit representation][@stdlib/number/float32/base/to-binary-string]. ```javascript -var bstr = '01000000100000000000000000000000'; -var v = fromBinaryStringf( bstr ); +let bstr = '01000000100000000000000000000000'; +let v = fromBinaryStringf( bstr ); // returns 4.0 bstr = '01000000010010010000111111011011'; @@ -51,8 +51,8 @@ v = fromBinaryStringf( bstr ); The function handles [subnormals][subnormals]. ```javascript -var bstr = '10000000000000000000000000010110'; -var val = fromBinaryStringf( bstr ); +let bstr = '10000000000000000000000000010110'; +let val = fromBinaryStringf( bstr ); // returns ~-3.08e-44 bstr = '00000000000000000000000000000001'; @@ -63,8 +63,8 @@ val = fromBinaryStringf( bstr ); The function handles special values. ```javascript -var bstr = '00000000000000000000000000000000'; -var val = fromBinaryStringf( bstr ); +let bstr = '00000000000000000000000000000000'; +let val = fromBinaryStringf( bstr ); // returns 0.0 bstr = '10000000000000000000000000000000'; @@ -95,38 +95,31 @@ val = fromBinaryStringf( bstr ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); -var fromBinaryStringf = require( '@stdlib/number/float32/base/from-binary-string' ); - -var frac; -var sign; -var exp; -var b; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); +const fromBinaryStringf = require( '@stdlib/number/float32/base/from-binary-string' ); // Convert random numbers to IEEE 754 literal bit representations and then convert them back... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } - frac = randu() * 10.0; - exp = round( randu()*100.0 ); + const frac = randu() * 10.0; + let exp = round( randu()*100.0 ); if ( randu() < 0.5 ) { exp = -exp; } - x = sign * frac * pow( 2.0, exp ); + let x = sign * frac * pow( 2.0, exp ); x = toFloat32( x ); - b = toBinaryStringf( x ); - y = fromBinaryStringf( b ); + const b = toBinaryStringf( x ); + const y = fromBinaryStringf( b ); console.log( '%d => %s => %d', x, b, y ); console.log( x === y ); diff --git a/lib/node_modules/@stdlib/number/float32/base/from-word/README.md b/lib/node_modules/@stdlib/number/float32/base/from-word/README.md index f4178eea4458..05c74cbfc454 100644 --- a/lib/node_modules/@stdlib/number/float32/base/from-word/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/from-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromWordf = require( '@stdlib/number/float32/base/from-word' ); +const fromWordf = require( '@stdlib/number/float32/base/from-word' ); ``` #### fromWordf( word ) @@ -35,9 +35,9 @@ var fromWordf = require( '@stdlib/number/float32/base/from-word' ); Creates a [single-precision floating-point number][ieee754] from an unsigned `integer` corresponding to an [IEEE 754][ieee754] binary representation. ```javascript -var word = 1068180177; // => 0 01111111 01010110010001011010001 +const word = 1068180177; // => 0 01111111 01010110010001011010001 -var f32 = fromWordf( word ); // when printed, implicitly promoted to float64 +const f32 = fromWordf( word ); // when printed, implicitly promoted to float64 // returns 1.3370000123977661 ``` @@ -68,19 +68,15 @@ var f32 = fromWordf( word ); // when printed, implicitly promoted to float64 ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); -var fromWordf = require( '@stdlib/number/float32/base/from-word' ); - -var word; -var f32; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); +const fromWordf = require( '@stdlib/number/float32/base/from-word' ); // Create single-precision floating-point numbers from unsigned integers... -for ( i = 0; i < 1000; i++ ) { - word = round( randu()*MAX_UINT32 ); - f32 = fromWordf( word ); +for ( let i = 0; i < 1000; i++ ) { + const word = round( randu()*MAX_UINT32 ); + const f32 = fromWordf( word ); console.log( 'word: %d => float32: %d', word, f32 ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/normalize/README.md b/lib/node_modules/@stdlib/number/float32/base/normalize/README.md index 741f1e868da3..74861758a746 100644 --- a/lib/node_modules/@stdlib/number/float32/base/normalize/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/normalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normalizef = require( '@stdlib/number/float32/base/normalize' ); +const normalizef = require( '@stdlib/number/float32/base/normalize' ); ``` #### normalizef( x ) @@ -35,42 +35,42 @@ var normalizef = require( '@stdlib/number/float32/base/normalize' ); Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp`. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var out = normalizef( toFloat32( 1.401e-45 ) ); +const out = normalizef( toFloat32( 1.401e-45 ) ); // returns [ 1.1754943508222875e-38, -23 ] ``` By default, the function returns `y` and `exp` as a two-element `array`. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var pow = require( '@stdlib/math/base/special/pow' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var out = normalizef( toFloat32( 1.401e-45 ) ); +const out = normalizef( toFloat32( 1.401e-45 ) ); // returns [ 1.1754943508222875e-38, -23 ] -var y = out[ 0 ]; -var exp = out[ 1 ]; +const y = out[ 0 ]; +const exp = out[ 1 ]; -var bool = ( y*pow(2, exp) === toFloat32(1.401e-45) ); +const bool = ( y*pow(2, exp) === toFloat32(1.401e-45) ); // returns true ``` The function expects a finite, non-zero [single-precision floating-point number][ieee754] `x`. If `x == 0`, ```javascript -var out = normalizef( 0.0 ); +const out = normalizef( 0.0 ); // returns [ 0.0, 0 ]; ``` If `x` is either positive or negative `infinity` or `NaN`, ```javascript -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); +const PINF = require( '@stdlib/constants/float32/pinf' ); +const NINF = require( '@stdlib/constants/float32/ninf' ); -var out = normalizef( PINF ); +let out = normalizef( PINF ); // returns [ Infinity, 0 ] out = normalizef( NINF ); @@ -85,15 +85,15 @@ out = normalizef( NaN ); Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp` and assigns results to a provided output array. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var Float32Array = require( '@stdlib/array/float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var out = new Float32Array( 2 ); +const out = new Float32Array( 2 ); -var v = normalizef.assign( toFloat32( 1.401e-45 ), out, 1, 0 ); +const v = normalizef.assign( toFloat32( 1.401e-45 ), out, 1, 0 ); // returns [ 1.1754943508222875e-38, -23 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -118,25 +118,19 @@ var bool = ( v === out ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var normalizef = require( '@stdlib/number/float32/base/normalize' ); - -var frac; -var exp; -var x; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const normalizef = require( '@stdlib/number/float32/base/normalize' ); // Generate denormalized single-precision floating-point numbers and then normalize them... -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = 38 + round( randu()*6.0 ); - x = frac * pow( 10.0, -exp ); +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = 38 + round( randu()*6.0 ); + let x = frac * pow( 10.0, -exp ); x = toFloat32( x ); - v = normalizef( x ); + const v = normalizef( x ); console.log( '%d = %d * 2^%d = %d', x, v[0], v[1], v[0]*pow(2.0, v[1]) ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/signbit/README.md b/lib/node_modules/@stdlib/number/float32/base/signbit/README.md index 0f70925481c0..f0a22f112152 100644 --- a/lib/node_modules/@stdlib/number/float32/base/signbit/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/signbit/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var signbitf = require( '@stdlib/number/float32/base/signbit' ); +const signbitf = require( '@stdlib/number/float32/base/signbit' ); ``` #### signbitf( x ) @@ -35,9 +35,9 @@ var signbitf = require( '@stdlib/number/float32/base/signbit' ); Returns a `boolean` indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (`true`) or off (`false`). ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var bool = signbitf( toFloat32( 4.0 ) ); +let bool = signbitf( toFloat32( 4.0 ) ); // returns false bool = signbitf( toFloat32( -9.14e-34 ) ); @@ -61,18 +61,14 @@ bool = signbitf( -0.0 ); ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var randu = require( '@stdlib/random/base/randu' ); -var signbitf = require( '@stdlib/number/float32/base/signbit' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const signbitf = require( '@stdlib/number/float32/base/signbit' ); -var sign; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = (randu()*100.0) - 50.0; +for ( let i = 0; i < 100; i++ ) { + let x = (randu()*100.0) - 50.0; x = toFloat32( x ); - sign = signbitf( x ); + let sign = signbitf( x ); sign = ( sign ) ? 'true' : 'false'; console.log( 'x: %d. signbit: %s.', x, sign ); } diff --git a/lib/node_modules/@stdlib/number/float32/base/significand/README.md b/lib/node_modules/@stdlib/number/float32/base/significand/README.md index 730b0ceff8cf..7ddc547bb4d2 100644 --- a/lib/node_modules/@stdlib/number/float32/base/significand/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/significand/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var significandf = require( '@stdlib/number/float32/base/significand' ); +const significandf = require( '@stdlib/number/float32/base/significand' ); ``` #### significandf( x ) @@ -35,9 +35,9 @@ var significandf = require( '@stdlib/number/float32/base/significand' ); Returns an integer corresponding to the significand of a [single-precision floating-point number][ieee754]. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var s = significandf( toFloat32( 3.14e34 ) ); // => 10000011000010001110111 +let s = significandf( toFloat32( 3.14e34 ) ); // => 10000011000010001110111 // returns 4293751 s = significandf( toFloat32( 3.14e-34 ) ); // => 10100001011000001010101 @@ -64,25 +64,19 @@ s = significandf( NaN ); // => 10000000000000000000000 ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var significandf = require( '@stdlib/number/float32/base/significand' ); - -var frac; -var exp; -var x; -var s; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const significandf = require( '@stdlib/number/float32/base/significand' ); // Generate random numbers and extract their significands... -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = round( randu()*44.0 ) - 22; - x = frac * pow( 10.0, exp ); +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = round( randu()*44.0 ) - 22; + let x = frac * pow( 10.0, exp ); x = toFloat32( x ); - s = significandf( x ); + const s = significandf( x ); console.log( 'x: %d. significand: %d.', x, s ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/to-binary-string/README.md b/lib/node_modules/@stdlib/number/float32/base/to-binary-string/README.md index 1d49137db39b..f9b24b1d8dbc 100644 --- a/lib/node_modules/@stdlib/number/float32/base/to-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/to-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); +const toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); ``` #### toBinaryStringf( x ) @@ -35,9 +35,9 @@ var toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); Returns a `string` giving the literal bit representation of a [single-precision floating-point number][ieee754]. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var str = toBinaryStringf( toFloat32( 4.0 ) ); +let str = toBinaryStringf( toFloat32( 4.0 ) ); // returns '01000000100000000000000000000000' str = toBinaryStringf( toFloat32( 3.141592653589793 ) ); @@ -50,9 +50,9 @@ str = toBinaryStringf( toFloat32( -1.0e38 ) ); The function handles [subnormals][subnormals]. ```javascript -var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var str = toBinaryStringf( toFloat32( -3.14e-39 ) ); +let str = toBinaryStringf( toFloat32( -3.14e-39 ) ); // returns '10000000001000100011000100001011' str = toBinaryStringf( toFloat32( 1.4e-45 ) ); @@ -62,10 +62,10 @@ str = toBinaryStringf( toFloat32( 1.4e-45 ) ); The function handles special values. ```javascript -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); +const PINF = require( '@stdlib/constants/float32/pinf' ); +const NINF = require( '@stdlib/constants/float32/ninf' ); -var str = toBinaryStringf( 0.0 ); +let str = toBinaryStringf( 0.0 ); // returns '00000000000000000000000000000000' str = toBinaryStringf( -0.0 ); @@ -92,34 +92,28 @@ str = toBinaryStringf( NINF ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); - -var frac; -var sign; -var exp; -var b; -var x; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const toBinaryStringf = require( '@stdlib/number/float32/base/to-binary-string' ); // Convert random numbers to literal bit representations... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } - frac = randu() * 10.0; - exp = round( randu()*100.0 ); + const frac = randu() * 10.0; + let exp = round( randu()*100.0 ); if ( randu() < 0.5 ) { exp = -exp; } - x = sign * frac * pow( 2.0, exp ); + let x = sign * frac * pow( 2.0, exp ); x = float64ToFloat32( x ); - b = toBinaryStringf( x ); + const b = toBinaryStringf( x ); console.log( b ); } ``` diff --git a/lib/node_modules/@stdlib/number/float32/base/to-int32/README.md b/lib/node_modules/@stdlib/number/float32/base/to-int32/README.md index af4a74faea89..abc476fd4efa 100644 --- a/lib/node_modules/@stdlib/number/float32/base/to-int32/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/to-int32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float32ToInt32 = require( '@stdlib/number/float32/base/to-int32' ); +const float32ToInt32 = require( '@stdlib/number/float32/base/to-int32' ); ``` #### float32ToInt32( x ) @@ -35,9 +35,9 @@ var float32ToInt32 = require( '@stdlib/number/float32/base/to-int32' ); Converts a [single-precision floating-point number][ieee754] to a signed 32-bit integer. ```javascript -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var y = float32ToInt32( float64ToFloat32( 4294967295.0 ) ); +let y = float32ToInt32( float64ToFloat32( 4294967295.0 ) ); // returns 0 y = float32ToInt32( float64ToFloat32( 3.14 ) ); @@ -67,22 +67,18 @@ y = float32ToInt32( float64ToFloat32( -Infinity ) ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var float32ToInt32 = require( '@stdlib/number/float32/base/to-int32' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float32ToInt32 = require( '@stdlib/number/float32/base/to-int32' ); -var int32; -var f32; -var i; - -for ( i = 0; i < 500; i++ ) { +for ( let i = 0; i < 500; i++ ) { // Generate a random single-precision floating-point integer: - f32 = float64ToFloat32( round( randu()*MAX_INT ) ); + const f32 = float64ToFloat32( round( randu()*MAX_INT ) ); // Convert the single-precision floating-point integer to a signed integer: - int32 = float32ToInt32( f32 ); + const int32 = float32ToInt32( f32 ); console.log( 'float32: %d => int32: %d', f32, int32 ); } diff --git a/lib/node_modules/@stdlib/number/float32/base/to-uint32/README.md b/lib/node_modules/@stdlib/number/float32/base/to-uint32/README.md index d713f002a49b..22096b100c8d 100644 --- a/lib/node_modules/@stdlib/number/float32/base/to-uint32/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/to-uint32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float32ToUint32 = require( '@stdlib/number/float32/base/to-uint32' ); +const float32ToUint32 = require( '@stdlib/number/float32/base/to-uint32' ); ``` #### float32ToUint32( x ) @@ -35,9 +35,9 @@ var float32ToUint32 = require( '@stdlib/number/float32/base/to-uint32' ); Converts a [single-precision floating-point number][ieee754] to an unsigned 32-bit integer. ```javascript -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var y = float32ToUint32( float64ToFloat32( 4294967297.0 ) ); +let y = float32ToUint32( float64ToFloat32( 4294967297.0 ) ); // returns 0 y = float32ToUint32( float64ToFloat32( 3.14 ) ); @@ -67,24 +67,19 @@ y = float32ToUint32( float64ToFloat32( -Infinity ) ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var float32ToUint32 = require( '@stdlib/number/float32/base/to-uint32' ); - -var uint32; -var half; -var f32; -var i; - -half = ( MAX_INT-1 ) / 2; -for ( i = 0; i < 500; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float32ToUint32 = require( '@stdlib/number/float32/base/to-uint32' ); + +const half = ( MAX_INT-1 ) / 2; +for ( let i = 0; i < 500; i++ ) { // Generate a random single-precision floating-point integer: - f32 = float64ToFloat32( round( randu()*MAX_INT ) - half ); + const f32 = float64ToFloat32( round( randu()*MAX_INT ) - half ); // Convert the single-precision floating-point value to an unsigned 32-bit integer: - uint32 = float32ToUint32( f32 ); + const uint32 = float32ToUint32( f32 ); console.log( 'float32: %d => uint32: %d', f32, uint32 ); } diff --git a/lib/node_modules/@stdlib/number/float32/base/to-word/README.md b/lib/node_modules/@stdlib/number/float32/base/to-word/README.md index 3f9c04c93946..a175c76bf714 100644 --- a/lib/node_modules/@stdlib/number/float32/base/to-word/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/to-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toWordf = require( '@stdlib/number/float32/base/to-word' ); +const toWordf = require( '@stdlib/number/float32/base/to-word' ); ``` #### toWordf( x ) @@ -35,12 +35,12 @@ var toWordf = require( '@stdlib/number/float32/base/to-word' ); Returns an unsigned 32-bit `integer` corresponding to the [IEEE 754][ieee754] binary representation of a [single-precision floating-point number][ieee754]. ```javascript -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var f32 = float64ToFloat32( 1.337 ); +const f32 = float64ToFloat32( 1.337 ); // returns 1.3370000123977661 -var w = toWordf( f32 ); // => 0 01111111 01010110010001011010001 +const w = toWordf( f32 ); // => 0 01111111 01010110010001011010001 // returns 1068180177 ``` @@ -71,20 +71,15 @@ var w = toWordf( f32 ); // => 0 01111111 01010110010001011010001 ```javascript -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var randu = require( '@stdlib/random/base/randu' ); -var toWordf = require( '@stdlib/number/float32/base/to-word' ); - -var word; -var f64; -var f32; -var i; +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const randu = require( '@stdlib/random/base/randu' ); +const toWordf = require( '@stdlib/number/float32/base/to-word' ); // Convert single-precision floating-point numbers to integers representing the binary literal... -for ( i = 0; i < 1000; i++ ) { - f64 = (randu()*100.0) - 50.0; - f32 = float64ToFloat32( f64 ); - word = toWordf( f32 ); +for ( let i = 0; i < 1000; i++ ) { + const f64 = (randu()*100.0) - 50.0; + const f32 = float64ToFloat32( f64 ); + const word = toWordf( f32 ); console.log( 'float64: %d => float32: %d => word: %d', f64, f32, word ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/README.md b/lib/node_modules/@stdlib/number/float64/README.md index 3e6b26f7abb6..59fd601d08e9 100644 --- a/lib/node_modules/@stdlib/number/float64/README.md +++ b/lib/node_modules/@stdlib/number/float64/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/float64' ); +const ns = require( '@stdlib/number/float64' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/float64' ); Utilities for double-precision floating-point numbers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float64' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float64' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/README.md b/lib/node_modules/@stdlib/number/float64/base/README.md index 7403a69e44a9..0473e1242ac6 100644 --- a/lib/node_modules/@stdlib/number/float64/base/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/float64/base' ); +const ns = require( '@stdlib/number/float64/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/float64/base' ); Base utilities for double-precision floating-point numbers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -78,8 +78,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float64/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float64/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/assert/README.md b/lib/node_modules/@stdlib/number/float64/base/assert/README.md index 3e71f99869c2..ca4a17f2bc7d 100644 --- a/lib/node_modules/@stdlib/number/float64/base/assert/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/assert/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var assert = require( '@stdlib/number/float64/base/assert' ); +const assert = require( '@stdlib/number/float64/base/assert' ); ``` #### assert @@ -35,7 +35,7 @@ var assert = require( '@stdlib/number/float64/base/assert' ); Namespace containing "base" double-precision floating-point number assert functions. ```javascript -var ns = assert; +const ns = assert; // returns {...} ``` @@ -73,8 +73,8 @@ The namespace contains the following functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/float64/base/assert' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/float64/base/assert' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value-zero/README.md b/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value-zero/README.md index ec8e3fc2f86c..347588f7403d 100644 --- a/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value-zero/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value-zero/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValueZero = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); +const isSameValueZero = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); ``` #### isSameValueZero( a, b ) @@ -35,7 +35,7 @@ var isSameValueZero = require( '@stdlib/number/float64/base/assert/is-same-value Tests if two double-precision floating-point numbers `a` and `b` are the same value. ```javascript -var bool = isSameValueZero( 3.14, 3.14 ); +let bool = isSameValueZero( 3.14, 3.14 ); // returns true bool = isSameValueZero( 5.0, 3.0 ); @@ -47,7 +47,7 @@ In contrast to the strict equality operator `===`, the function treats `NaNs` as ```javascript -var bool = ( NaN === NaN ); +let bool = ( NaN === NaN ); // returns false bool = isSameValueZero( NaN, NaN ); @@ -59,7 +59,7 @@ In contrast to the [SameValue Algorithm][@stdlib/number/float64/base/assert/is-s ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValueZero( 0.0, -0.0 ); @@ -86,9 +86,9 @@ bool = isSameValueZero( -0.0, 0.0 ); ```javascript -var isSameValueZero = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); +const isSameValueZero = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); -var bool = isSameValueZero( 3.14, 3.14 ); +let bool = isSameValueZero( 3.14, 3.14 ); // returns true bool = isSameValueZero( 0.0, 0.0 ); diff --git a/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value/README.md b/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value/README.md index e6dfdb2b93ae..91464d2a9870 100644 --- a/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/assert/is-same-value/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' ); +const isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' ); ``` #### isSameValue( a, b ) @@ -35,7 +35,7 @@ var isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' ); Tests if two double-precision floating-point numbers `a` and `b` are the same value. ```javascript -var bool = isSameValue( 3.14, 3.14 ); +let bool = isSameValue( 3.14, 3.14 ); // returns true bool = isSameValue( 5.0, 3.0 ); @@ -47,7 +47,7 @@ In contrast to the strict equality operator `===`, the function distinguishes be ```javascript -var bool = ( 0.0 === -0.0 ); +let bool = ( 0.0 === -0.0 ); // returns true bool = isSameValue( 0.0, -0.0 ); @@ -84,9 +84,9 @@ bool = isSameValue( NaN, NaN ); ```javascript -var isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' ); +const isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' ); -var bool = isSameValue( 3.14, 3.14 ); +let bool = isSameValue( 3.14, 3.14 ); // returns true bool = isSameValue( 0.0, 0.0 ); diff --git a/lib/node_modules/@stdlib/number/float64/base/exponent/README.md b/lib/node_modules/@stdlib/number/float64/base/exponent/README.md index 816af50e29e1..1ab992b66dc6 100644 --- a/lib/node_modules/@stdlib/number/float64/base/exponent/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/exponent/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponent = require( '@stdlib/number/float64/base/exponent' ); +const exponent = require( '@stdlib/number/float64/base/exponent' ); ``` #### exponent( x ) @@ -35,7 +35,7 @@ var exponent = require( '@stdlib/number/float64/base/exponent' ); Returns an `integer` corresponding to the unbiased exponent of a [double-precision floating-point number][ieee754]. ```javascript -var exp = exponent( 3.14e307 ); // => 2**1021 ~ 1e307 +let exp = exponent( 3.14e307 ); // => 2**1021 ~ 1e307 // returns 1021 exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307 @@ -62,23 +62,17 @@ exp = exponent( NaN ); ```javascript -var randu = require( '@stdlib/random/base/uniform' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var exponent = require( '@stdlib/number/float64/base/exponent' ); - -var frac; -var exp; -var x; -var e; -var i; +const randu = require( '@stdlib/random/base/uniform' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const exponent = require( '@stdlib/number/float64/base/exponent' ); // Generate random numbers and extract their exponents... -for ( i = 0; i < 100; i++ ) { - frac = randu( 0.0, 10.0 ); - exp = discreteUniform( -323, 323 ); - x = frac * pow( 10.0, exp ); - e = exponent( x ); +for ( let i = 0; i < 100; i++ ) { + const frac = randu( 0.0, 10.0 ); + const exp = discreteUniform( -323, 323 ); + const x = frac * pow( 10.0, exp ); + const e = exponent( x ); console.log( 'x: %d. unbiased exponent: %d.', x, e ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/from-binary-string/README.md b/lib/node_modules/@stdlib/number/float64/base/from-binary-string/README.md index 5e3c4d870e84..bb0c1437be79 100644 --- a/lib/node_modules/@stdlib/number/float64/base/from-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/from-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromBinaryString = require( '@stdlib/number/float64/base/from-binary-string' ); +const fromBinaryString = require( '@stdlib/number/float64/base/from-binary-string' ); ``` #### fromBinaryString( bstr ) @@ -35,8 +35,8 @@ var fromBinaryString = require( '@stdlib/number/float64/base/from-binary-string' Creates a [double-precision floating-point number][ieee754] from a [literal bit representation][@stdlib/number/float64/base/to-binary-string]. ```javascript -var bstr = '0100000000010000000000000000000000000000000000000000000000000000'; -var val = fromBinaryString( bstr ); +let bstr = '0100000000010000000000000000000000000000000000000000000000000000'; +let val = fromBinaryString( bstr ); // returns 4.0 bstr = '0100000000001001001000011111101101010100010001000010110100011000'; @@ -51,8 +51,8 @@ val = fromBinaryString( bstr ); The function handles [subnormals][subnormals]. ```javascript -var bstr = '1000000000000000000000000000000000000000000000000001100011010011'; -var val = fromBinaryString( bstr ); +let bstr = '1000000000000000000000000000000000000000000000000001100011010011'; +let val = fromBinaryString( bstr ); // returns -3.14e-320 bstr = '0000000000000000000000000000000000000000000000000000000000000001'; @@ -63,8 +63,8 @@ val = fromBinaryString( bstr ); The function handles special values. ```javascript -var bstr = '0000000000000000000000000000000000000000000000000000000000000000'; -var val = fromBinaryString( bstr ); +let bstr = '0000000000000000000000000000000000000000000000000000000000000000'; +let val = fromBinaryString( bstr ); // returns 0.0 bstr = '1000000000000000000000000000000000000000000000000000000000000000'; @@ -95,35 +95,28 @@ val = fromBinaryString( bstr ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); -var fromBinaryString = require( '@stdlib/number/float64/base/from-binary-string' ); - -var frac; -var sign; -var exp; -var b; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); +const fromBinaryString = require( '@stdlib/number/float64/base/from-binary-string' ); // Convert random numbers to literal bit representations and then convert them back... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } - frac = randu() * 10.0; - exp = round( randu()*100.0 ); + const frac = randu() * 10.0; + let exp = round( randu()*100.0 ); if ( randu() < 0.5 ) { exp = -exp; } - x = sign * frac * pow( 2.0, exp ); - b = toBinaryString( x ); - y = fromBinaryString( b ); + const x = sign * frac * pow( 2.0, exp ); + const b = toBinaryString( x ); + const y = fromBinaryString( b ); console.log( '%d => %s => %d', x, b, y ); console.log( x === y ); } diff --git a/lib/node_modules/@stdlib/number/float64/base/from-int64-bytes/README.md b/lib/node_modules/@stdlib/number/float64/base/from-int64-bytes/README.md index 7891184e00a7..7e8b829b36b0 100644 --- a/lib/node_modules/@stdlib/number/float64/base/from-int64-bytes/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/from-int64-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); +const fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); ``` #### fromInt64Bytes( bytes, stride, offset ) @@ -35,10 +35,10 @@ var fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); Converts a signed 64-bit integer byte array to a [double-precision floating-point number][ieee754]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var bytes = new Uint8Array( [ 255, 255, 255, 255, 255, 255, 255, 255 ] ); -var out = fromInt64Bytes( bytes, 1, 0 ); +const bytes = new Uint8Array( [ 255, 255, 255, 255, 255, 255, 255, 255 ] ); +const out = fromInt64Bytes( bytes, 1, 0 ); // returns -1.0 ``` @@ -47,10 +47,10 @@ The function supports providing a `stride` and an index `offset` for indexing in ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var bytes = new Uint8Array( [ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255 ] ); -var out = fromInt64Bytes( bytes, 2, 1 ); +const bytes = new Uint8Array( [ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255 ] ); +const out = fromInt64Bytes( bytes, 2, 1 ); // returns -1.0 ``` @@ -75,22 +75,15 @@ var out = fromInt64Bytes( bytes, 2, 1 ); ```javascript -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); - -var bytes; -var sgn; -var x; -var b; -var s; -var i; -var j; -var k; - -bytes = new Uint8Array( 8 ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const fromInt64Bytes = require( '@stdlib/number/float64/base/from-int64-bytes' ); + +const bytes = new Uint8Array( 8 ); +let s; +let k; if ( IS_LITTLE_ENDIAN ) { k = 0; s = 1; @@ -99,21 +92,21 @@ if ( IS_LITTLE_ENDIAN ) { s = -1; } // Generate random integer-valued doubles on the interval (-2^16, 2^16)... -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { // Determine the sign: - sgn = ( bernoulli( 0.5 ) ) ? 0 : 128; // 2^7 + const sgn = ( bernoulli( 0.5 ) ) ? 0 : 128; // 2^7 // Set a subset of individual (lower-order) bytes: - for ( j = 0; j < 2; j++ ) { - b = discreteUniform( 0, 255 ); // 2^8-1 + for ( let j = 0; j < 2; j++ ) { + const b = discreteUniform( 0, 255 ); // 2^8-1 bytes[ k+(j*s) ] = b; } // Set higher-order bytes using two's complement: - for ( j = 2; j < 8; j++ ) { + for ( let j = 2; j < 8; j++ ) { bytes[ k+(j*s) ] = ( sgn ) ? 255 : 0; // 2^8-1 } // Convert the bytes to a double: - x = fromInt64Bytes( bytes, 1, 0 ); + const x = fromInt64Bytes( bytes, 1, 0 ); console.log( bytes + ' => ' + x ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/from-words/README.md b/lib/node_modules/@stdlib/number/float64/base/from-words/README.md index 7ce5d0bfd452..2ea8480d25da 100644 --- a/lib/node_modules/@stdlib/number/float64/base/from-words/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/from-words/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromWords = require( '@stdlib/number/float64/base/from-words' ); +const fromWords = require( '@stdlib/number/float64/base/from-words' ); ``` #### fromWords( high, low ) @@ -35,7 +35,7 @@ var fromWords = require( '@stdlib/number/float64/base/from-words' ); Creates a [double-precision floating-point number][ieee754] from a higher order word (unsigned 32-bit `integer`) and a lower order word (unsigned 32-bit `integer`). ```javascript -var v = fromWords( 1774486211, 2479577218 ); +let v = fromWords( 1774486211, 2479577218 ); // returns 3.14e201 v = fromWords( 3221823995, 1413754136 ); @@ -78,20 +78,15 @@ v = fromWords( 4293918720, 0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); -var fromWords = require( '@stdlib/number/float64/base/from-words' ); - -var high; -var low; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - high = round( randu()*MAX_UINT32 ); - low = round( randu()*MAX_UINT32 ); - x = fromWords( high, low ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); +const fromWords = require( '@stdlib/number/float64/base/from-words' ); + +for ( let i = 0; i < 100; i++ ) { + const high = round( randu()*MAX_UINT32 ); + const low = round( randu()*MAX_UINT32 ); + const x = fromWords( high, low ); console.log( 'higher: %d. lower: %d. float: %d.', high, low, x ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/get-high-word/README.md b/lib/node_modules/@stdlib/number/float64/base/get-high-word/README.md index c876d7542e10..11317cf10162 100644 --- a/lib/node_modules/@stdlib/number/float64/base/get-high-word/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/get-high-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); ``` #### getHighWord( x ) @@ -35,7 +35,7 @@ var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); Returns an unsigned 32-bit `integer` corresponding to the more significant 32 bits of a [double-precision floating-point number][ieee754]. ```javascript -var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011 +const w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011 // returns 1774486211 ``` @@ -50,22 +50,16 @@ var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011 ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); - -var frac; -var exp; -var w; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = -floor( randu()*324.0 ); - x = frac * pow( 10.0, exp ); - w = getHighWord( x ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const getHighWord = require( '@stdlib/number/float64/base/get-high-word' ); + +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = -floor( randu()*324.0 ); + const x = frac * pow( 10.0, exp ); + const w = getHighWord( x ); console.log( 'x: %d. high word: %d.', x, w ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/get-low-word/README.md b/lib/node_modules/@stdlib/number/float64/base/get-low-word/README.md index 07ca1a021aed..3bf0ac0d55da 100644 --- a/lib/node_modules/@stdlib/number/float64/base/get-low-word/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/get-low-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); +const getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); ``` #### getLowWord( x ) @@ -35,7 +35,7 @@ var getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); Returns an unsigned 32-bit `integer` corresponding to the less significant 32 bits of a [double-precision floating-point number][ieee754]. ```javascript -var w = getLowWord( 3.14e201 ); // => 10010011110010110101100010000010 +const w = getLowWord( 3.14e201 ); // => 10010011110010110101100010000010 // returns 2479577218 ``` @@ -50,22 +50,16 @@ var w = getLowWord( 3.14e201 ); // => 10010011110010110101100010000010 ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); - -var frac; -var exp; -var w; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = -floor( randu()*324.0 ); - x = frac * pow( 10.0, exp ); - w = getLowWord( x ); +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const getLowWord = require( '@stdlib/number/float64/base/get-low-word' ); + +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = -floor( randu()*324.0 ); + const x = frac * pow( 10.0, exp ); + const w = getLowWord( x ); console.log( 'x: %d. low word: %d.', x, w ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/normalize/README.md b/lib/node_modules/@stdlib/number/float64/base/normalize/README.md index a49cfff98bf2..73c3182df13e 100644 --- a/lib/node_modules/@stdlib/number/float64/base/normalize/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/normalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normalize = require( '@stdlib/number/float64/base/normalize' ); +const normalize = require( '@stdlib/number/float64/base/normalize' ); ``` #### normalize( x ) @@ -35,32 +35,32 @@ var normalize = require( '@stdlib/number/float64/base/normalize' ); Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp`. ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var out = normalize( 3.14e-319 ); +const out = normalize( 3.14e-319 ); // returns [ 1.4141234400356668e-303, -52 ] -var y = out[ 0 ]; -var exp = out[ 1 ]; +const y = out[ 0 ]; +const exp = out[ 1 ]; -var bool = ( y*pow(2.0, exp) === 3.14e-319 ); +const bool = ( y*pow(2.0, exp) === 3.14e-319 ); // returns true ``` The function expects a finite, non-zero numeric value `x`. If `x == 0`, ```javascript -var out = normalize( 0.0 ); +const out = normalize( 0.0 ); // returns [ 0.0, 0 ]; ``` If `x` is either positive or negative `infinity` or `NaN`, ```javascript -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); +const PINF = require( '@stdlib/constants/float64/pinf' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); -var out = normalize( PINF ); +let out = normalize( PINF ); // returns [ Infinity, 0 ] out = normalize( NINF ); @@ -75,14 +75,14 @@ out = normalize( NaN ); Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp` and assigns results to a provided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); -var v = normalize.assign( 3.14e-319, out, 1, 0); +const v = normalize.assign( 3.14e-319, out, 1, 0); // returns [ 1.4141234400356668e-303, -52 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -97,30 +97,24 @@ var bool = ( v === out ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/uniform' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var normalize = require( '@stdlib/number/float64/base/normalize' ); - -var frac; -var exp; -var x; -var v; -var i; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/uniform' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const normalize = require( '@stdlib/number/float64/base/normalize' ); // Generate denormalized numbers and then normalize them... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { // Generate a random fraction: - frac = randu( 0.0, 10.0 ); + const frac = randu( 0.0, 10.0 ); // Generate an exponent on the interval (-308,-324): - exp = discreteUniform( -323, -309 ); + const exp = discreteUniform( -323, -309 ); // Create a subnormal number (~2.23e-308, ~4.94e-324): - x = frac * pow( 10.0, exp ); + const x = frac * pow( 10.0, exp ); // Determine a `y` and an `exp` to "normalize" the subnormal: - v = normalize( x ); + const v = normalize( x ); console.log( '%d = %d * 2^%d = %d', x, v[0], v[1], v[0]*pow(2.0, v[1]) ); } diff --git a/lib/node_modules/@stdlib/number/float64/base/set-high-word/README.md b/lib/node_modules/@stdlib/number/float64/base/set-high-word/README.md index b2cea2c334ec..6bc99f0b5b7d 100644 --- a/lib/node_modules/@stdlib/number/float64/base/set-high-word/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/set-high-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setHighWord = require( '@stdlib/number/float64/base/set-high-word' ); +const setHighWord = require( '@stdlib/number/float64/base/set-high-word' ); ``` #### setHighWord( x, high ) @@ -35,12 +35,12 @@ var setHighWord = require( '@stdlib/number/float64/base/set-high-word' ); Sets the more significant 32 bits (higher order word) of a [double-precision floating-point number][ieee754] `x` to a bit sequence represented by an unsigned 32-bit integer `high`. The returned `double` will have the same less significant 32 bits (lower order word) as `x`. ```javascript -var high = 5 >>> 0; // => 0 00000000000 00000000000000000101 +let high = 5 >>> 0; // => 0 00000000000 00000000000000000101 -var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010 +let y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010 // returns 1.18350528745e-313 -var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000 +const PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000 high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000 @@ -60,28 +60,21 @@ y = setHighWord( PINF, high ); // => 0 01111111111 00000000000000000000000000000 ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); -var setHighWord = require( '@stdlib/number/float64/base/set-high-word' ); - -var high; -var frac; -var exp; -var x; -var y; -var i; +const pow = require( '@stdlib/math/base/special/pow' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); +const setHighWord = require( '@stdlib/number/float64/base/set-high-word' ); // Generate a random double-precision floating-point number: -frac = randu() * 10.0; -exp = -round( randu() * 323.0 ); -x = frac * pow( 10.0, exp ); +const frac = randu() * 10.0; +const exp = -round( randu() * 323.0 ); +const x = frac * pow( 10.0, exp ); // Replace the higher order word of `x` to generate new random numbers having the same lower order word... -for ( i = 0; i < 100; i++ ) { - high = round( randu()*MAX_UINT32 ); - y = setHighWord( x, high ); +for ( let i = 0; i < 100; i++ ) { + const high = round( randu()*MAX_UINT32 ); + const y = setHighWord( x, high ); console.log( 'x: %d. new high word: %d. y: %d.', x, high, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/set-low-word/README.md b/lib/node_modules/@stdlib/number/float64/base/set-low-word/README.md index 743373d8e023..37d15c1b983e 100644 --- a/lib/node_modules/@stdlib/number/float64/base/set-low-word/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/set-low-word/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setLowWord = require( '@stdlib/number/float64/base/set-low-word' ); +const setLowWord = require( '@stdlib/number/float64/base/set-low-word' ); ``` #### setLowWord( x, low ) @@ -35,23 +35,23 @@ var setLowWord = require( '@stdlib/number/float64/base/set-low-word' ); Sets the less significant 32 bits (lower order word) of a [double-precision floating-point number][ieee754] `x` to a bit sequence represented by an unsigned 32-bit integer `low`. The returned `double` will have the same more significant 32 bits (higher order word) as `x`. ```javascript -var low = 5 >>> 0; // => 00000000000000000000000000000101 +const low = 5 >>> 0; // => 00000000000000000000000000000101 -var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010 +const x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010 -var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101 +const y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101 // returns 3.139998651394392e+201 ``` Setting the lower order bits of `NaN` or positive or negative `infinity` will return `NaN`, as `NaN` is [defined][ieee754] as a `double` whose exponent bit sequence is all ones and whose fraction can be any bit sequence **except** all zeros. Positive and negative `infinity` are [defined][ieee754] as `doubles` with an exponent bit sequence equal to all ones and a fraction equal to all zeros. Hence, changing the less significant bits of positive and negative `infinity` converts each value to `NaN`. ```javascript -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); +const PINF = require( '@stdlib/constants/float64/pinf' ); +const NINF = require( '@stdlib/constants/float64/ninf' ); -var low = 12345678; +const low = 12345678; -var y = setLowWord( PINF, low ); +let y = setLowWord( PINF, low ); // returns NaN y = setLowWord( NINF, low ); @@ -72,28 +72,21 @@ y = setLowWord( NaN, low ); ```javascript -var pow = require( '@stdlib/math/base/special/pow' ); -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); -var setLowWord = require( '@stdlib/number/float64/base/set-low-word' ); - -var frac; -var exp; -var low; -var x; -var y; -var i; +const pow = require( '@stdlib/math/base/special/pow' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); +const setLowWord = require( '@stdlib/number/float64/base/set-low-word' ); // Generate a random double-precision floating-point number: -frac = randu() * 10.0; -exp = -round( randu() * 323.0 ); -x = frac * pow( 10.0, exp ); +const frac = randu() * 10.0; +const exp = -round( randu() * 323.0 ); +const x = frac * pow( 10.0, exp ); // Replace the lower order word of `x` to generate new random numbers having the same higher order word... -for ( i = 0; i < 100; i++ ) { - low = round( randu()*MAX_UINT32 ); - y = setLowWord( x, low ); +for ( let i = 0; i < 100; i++ ) { + const low = round( randu()*MAX_UINT32 ); + const y = setLowWord( x, low ); console.log( 'x: %d. new low word: %d. y: %d.', x, low, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/signbit/README.md b/lib/node_modules/@stdlib/number/float64/base/signbit/README.md index 84da9aaf8387..ca6edc681733 100644 --- a/lib/node_modules/@stdlib/number/float64/base/signbit/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/signbit/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var signbit = require( '@stdlib/number/float64/base/signbit' ); +const signbit = require( '@stdlib/number/float64/base/signbit' ); ``` #### signbit( x ) @@ -35,7 +35,7 @@ var signbit = require( '@stdlib/number/float64/base/signbit' ); Returns a `boolean` indicating if the sign bit for a [double-precision floating-point number][ieee754] is on (`true`) or off (`false`). ```javascript -var bool = signbit( 4.0 ); +let bool = signbit( 4.0 ); // returns false bool = signbit( -9.14e-307 ); @@ -59,16 +59,12 @@ bool = signbit( -0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var signbit = require( '@stdlib/number/float64/base/signbit' ); +const randu = require( '@stdlib/random/base/randu' ); +const signbit = require( '@stdlib/number/float64/base/signbit' ); -var sign; -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = ( randu()*100.0 ) - 50.0; - sign = signbit( x ); +for ( let i = 0; i < 100; i++ ) { + const x = ( randu()*100.0 ) - 50.0; + let sign = signbit( x ); sign = ( sign ) ? 'true' : 'false'; console.log( 'x: %d. signbit: %s.', x, sign ); } diff --git a/lib/node_modules/@stdlib/number/float64/base/to-binary-string/README.md b/lib/node_modules/@stdlib/number/float64/base/to-binary-string/README.md index af9c892faf04..4b783bd3fdbc 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); +const toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); ``` #### toBinaryString( x ) @@ -35,7 +35,7 @@ var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); Returns a `string` giving the literal bit representation of a [double-precision floating-point number][ieee754]. ```javascript -var str = toBinaryString( 4.0 ); +let str = toBinaryString( 4.0 ); // returns '0100000000010000000000000000000000000000000000000000000000000000' str = toBinaryString( 3.141592653589793 ); @@ -48,7 +48,7 @@ str = toBinaryString( -1.0e308 ); The function handles [subnormals][subnormals]. ```javascript -var str = toBinaryString( -3.14e-320 ); +let str = toBinaryString( -3.14e-320 ); // returns '1000000000000000000000000000000000000000000000000001100011010011' str = toBinaryString( 5.0e-324 ); @@ -58,7 +58,7 @@ str = toBinaryString( 5.0e-324 ); The function handles special values. ```javascript -var str = toBinaryString( 0.0 ); +let str = toBinaryString( 0.0 ); // returns '0000000000000000000000000000000000000000000000000000000000000000' str = toBinaryString( -0.0 ); @@ -85,32 +85,26 @@ str = toBinaryString( -Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); - -var frac; -var sign; -var exp; -var b; -var x; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); // Convert random numbers to literal bit representations... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } - frac = randu() * 10.0; - exp = round( randu()*100.0 ); + const frac = randu() * 10.0; + let exp = round( randu()*100.0 ); if ( randu() < 0.5 ) { exp = -exp; } - x = sign * frac * pow( 2.0, exp ); - b = toBinaryString( x ); + const x = sign * frac * pow( 2.0, exp ); + const b = toBinaryString( x ); console.log( b ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/to-float32/README.md b/lib/node_modules/@stdlib/number/float64/base/to-float32/README.md index de3cb78ef29c..b91bf9214ba0 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-float32/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-float32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); ``` #### float64ToFloat32( x ) @@ -35,7 +35,7 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); Converts a [double-precision floating-point number][ieee754] to the nearest [single-precision floating-point number][ieee754]. ```javascript -var y = float64ToFloat32( 1.337 ); +const y = float64ToFloat32( 1.337 ); // returns 1.3370000123977661 ``` @@ -60,17 +60,13 @@ var y = float64ToFloat32( 1.337 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); - -var f64; -var f32; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); // Convert random double-precision floating-point numbers to the nearest single-precision floating-point number... -for ( i = 0; i < 1000; i++ ) { - f64 = randu() * 100.0; - f32 = float64ToFloat32( f64 ); +for ( let i = 0; i < 1000; i++ ) { + const f64 = randu() * 100.0; + const f32 = float64ToFloat32( f64 ); console.log( 'float64: %d => float32: %d', f64, f32 ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/base/to-int32/README.md b/lib/node_modules/@stdlib/number/float64/base/to-int32/README.md index 80e3d5be1bd6..b6db6229e784 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-int32/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-int32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); +const float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); ``` #### float64ToInt32( x ) @@ -35,7 +35,7 @@ var float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); Converts a [double-precision floating-point number][ieee754] to a signed 32-bit integer. ```javascript -var y = float64ToInt32( 4294967295.0 ); +let y = float64ToInt32( 4294967295.0 ); // returns -1 y = float64ToInt32( 3.14 ); @@ -65,21 +65,17 @@ y = float64ToInt32( -Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); -var int32; -var f64; -var i; - -for ( i = 0; i < 500; i++ ) { +for ( let i = 0; i < 500; i++ ) { // Generate a random double-precision floating-point integer: - f64 = round( randu()*MAX_INT ); + const f64 = round( randu()*MAX_INT ); // Convert the double-precision floating-point integer to a signed integer: - int32 = float64ToInt32( f64 ); + const int32 = float64ToInt32( f64 ); console.log( 'float64: %d => int32: %d', f64, int32 ); } diff --git a/lib/node_modules/@stdlib/number/float64/base/to-int64-bytes/README.md b/lib/node_modules/@stdlib/number/float64/base/to-int64-bytes/README.md index 90d9a0910c6c..c823e6bad465 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-int64-bytes/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-int64-bytes/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float64ToInt64Bytes = require( '@stdlib/number/float64/base/to-int64-bytes' ); +const float64ToInt64Bytes = require( '@stdlib/number/float64/base/to-int64-bytes' ); ``` #### float64ToInt64Bytes( x ) @@ -35,7 +35,7 @@ var float64ToInt64Bytes = require( '@stdlib/number/float64/base/to-int64-bytes' Converts an integer-valued [double-precision floating-point number][ieee754] to a signed 64-bit integer byte array according to host byte order (endianness). ```javascript -var out = float64ToInt64Bytes( 4294967297.0 ); +const out = float64ToInt64Bytes( 4294967297.0 ); // returns ``` @@ -44,13 +44,13 @@ var out = float64ToInt64Bytes( 4294967297.0 ); Converts an integer-valued [double-precision floating-point number][ieee754] to a signed 64-bit integer byte array according to host byte order (endianness) and assigns results to a provided output array. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var out = new Uint8Array( 16 ); -var y = float64ToInt64Bytes.assign( 4294967297.0, out, 2, 1 ); +const out = new Uint8Array( 16 ); +const y = float64ToInt64Bytes.assign( 4294967297.0, out, 2, 1 ); // returns -var bool = ( y === out ); +const bool = ( y === out ); // returns true ``` @@ -75,23 +75,16 @@ var bool = ( y === out ); ```javascript -var toBinaryStringUint8 = require( '@stdlib/number/uint8/base/to-binary-string' ); -var float64ToInt64Bytes = require( '@stdlib/number/float64/base/to-int64-bytes' ); - -var bytes; -var str; -var sgn; -var x; -var i; -var j; - -str = [ '', '', '', '', '', '', '', '', '' ]; -x = 1; - -for ( i = 0; i < 54; i++ ) { - sgn = ( i&1 ) ? -1 : 1; - bytes = float64ToInt64Bytes( x*sgn ); - for ( j = 0; j < bytes.length; j++ ) { +const toBinaryStringUint8 = require( '@stdlib/number/uint8/base/to-binary-string' ); +const float64ToInt64Bytes = require( '@stdlib/number/float64/base/to-int64-bytes' ); + +const str = [ '', '', '', '', '', '', '', '', '' ]; +let x = 1; + +for ( let i = 0; i < 54; i++ ) { + const sgn = ( i&1 ) ? -1 : 1; + const bytes = float64ToInt64Bytes( x*sgn ); + for ( let j = 0; j < bytes.length; j++ ) { str[ j ] = toBinaryStringUint8( bytes[ j ] ); } console.log( '%s2**%d => %s', ( sgn < 0 ) ? '-' : '+', i, str.join( ' ' ) ); diff --git a/lib/node_modules/@stdlib/number/float64/base/to-uint32/README.md b/lib/node_modules/@stdlib/number/float64/base/to-uint32/README.md index 328656d221bd..3745097b7ccb 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-uint32/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-uint32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); +const float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); ``` #### float64ToUint32( x ) @@ -35,7 +35,7 @@ var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); Converts a [double-precision floating-point number][ieee754] to an unsigned 32-bit integer. ```javascript -var y = float64ToUint32( 4294967297.0 ); +let y = float64ToUint32( 4294967297.0 ); // returns 1 y = float64ToUint32( 3.14 ); @@ -65,23 +65,18 @@ y = float64ToUint32( -Infinity ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); - -var uint32; -var half; -var f64; -var i; - -half = ( MAX_INT-1 ) / 2; -for ( i = 0; i < 500; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); + +const half = ( MAX_INT-1 ) / 2; +for ( let i = 0; i < 500; i++ ) { // Generate a random double-precision floating-point integer: - f64 = round( randu()*MAX_INT ) - half; + const f64 = round( randu()*MAX_INT ) - half; // Convert the double-precision floating-point value to an unsigned 32-bit integer: - uint32 = float64ToUint32( f64 ); + const uint32 = float64ToUint32( f64 ); console.log( 'float64: %d => uint32: %d', f64, uint32 ); } diff --git a/lib/node_modules/@stdlib/number/float64/base/to-words/README.md b/lib/node_modules/@stdlib/number/float64/base/to-words/README.md index 16bad4afad20..1e2d391ec857 100644 --- a/lib/node_modules/@stdlib/number/float64/base/to-words/README.md +++ b/lib/node_modules/@stdlib/number/float64/base/to-words/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toWords = require( '@stdlib/number/float64/base/to-words' ); +const toWords = require( '@stdlib/number/float64/base/to-words' ); ``` #### toWords( x ) @@ -35,20 +35,20 @@ var toWords = require( '@stdlib/number/float64/base/to-words' ); Splits a [double-precision floating-point number][ieee754] into a higher order word (unsigned 32-bit `integer`) and a lower order word (unsigned 32-bit `integer`). ```javascript -var w = toWords( 3.14e201 ); +const w = toWords( 3.14e201 ); // returns [ 1774486211, 2479577218 ] ``` By default, the function returns an `array` containing two elements: a higher order word and a lower order word. The lower order word contains the less significant bits, while the higher order word contains the more significant bits and includes the exponent and sign. ```javascript -var w = toWords( 3.14e201 ); +const w = toWords( 3.14e201 ); // returns [ 1774486211, 2479577218 ] -var high = w[ 0 ]; +const high = w[ 0 ]; // returns 1774486211 -var low = w[ 1 ]; +const low = w[ 1 ]; // returns 2479577218 ``` @@ -57,14 +57,14 @@ var low = w[ 1 ]; Splits a [double-precision floating-point number][ieee754] into a higher order word (unsigned 32-bit `integer`) and a lower order word (unsigned 32-bit `integer`) and assigns results to a provided output array. ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); -var out = new Uint32Array( 2 ); +const out = new Uint32Array( 2 ); -var w = toWords.assign( 3.14e201, out, 1, 0 ); +const w = toWords.assign( 3.14e201, out, 1, 0 ); // returns [ 1774486211, 2479577218 ] -var bool = ( w === out ); +const bool = ( w === out ); // returns true ``` @@ -79,23 +79,17 @@ var bool = ( w === out ); ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var toWords = require( '@stdlib/number/float64/base/to-words' ); - -var frac; -var exp; -var w; -var x; -var i; +const floor = require( '@stdlib/math/base/special/floor' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); +const toWords = require( '@stdlib/number/float64/base/to-words' ); // Generate random numbers and split into words... -for ( i = 0; i < 100; i++ ) { - frac = randu() * 10.0; - exp = -floor( randu()*324.0 ); - x = frac * pow( 10.0, exp ); - w = toWords( x ); +for ( let i = 0; i < 100; i++ ) { + const frac = randu() * 10.0; + const exp = -floor( randu()*324.0 ); + const x = frac * pow( 10.0, exp ); + const w = toWords( x ); console.log( 'x: %d. higher: %d. lower: %d.', x, w[ 0 ], w[ 1 ] ); } ``` diff --git a/lib/node_modules/@stdlib/number/float64/reviver/README.md b/lib/node_modules/@stdlib/number/float64/reviver/README.md index c899c0e723a0..5e0a923eef42 100644 --- a/lib/node_modules/@stdlib/number/float64/reviver/README.md +++ b/lib/node_modules/@stdlib/number/float64/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveNumber = require( '@stdlib/number/float64/reviver' ); +const reviveNumber = require( '@stdlib/number/float64/reviver' ); ``` #### reviveNumber( key, value ) @@ -45,11 +45,11 @@ var reviveNumber = require( '@stdlib/number/float64/reviver' ); Revives a JSON-serialized number. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"float64","value":"NaN"}'; +const str = '{"type":"float64","value":"NaN"}'; -var buf = parseJSON( str, reviveNumber ); +const buf = parseJSON( str, reviveNumber ); // returns NaN ``` @@ -76,15 +76,15 @@ For details on the JSON serialization format, see [`@stdlib/number/float64/to-js ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var number2json = require( '@stdlib/number/float64/to-json' ); -var reviveNumber = require( '@stdlib/number/float64/reviver' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const number2json = require( '@stdlib/number/float64/to-json' ); +const reviveNumber = require( '@stdlib/number/float64/reviver' ); -var str = JSON.stringify( number2json( NaN ) ); +const str = JSON.stringify( number2json( NaN ) ); console.log( str ); // => '{"type":"float64","value":"NaN"}' -var out = parseJSON( str, reviveNumber ); +const out = parseJSON( str, reviveNumber ); if ( out instanceof Error ) { throw out; } diff --git a/lib/node_modules/@stdlib/number/float64/to-json/README.md b/lib/node_modules/@stdlib/number/float64/to-json/README.md index a1db6c68070c..7b40440a11d5 100644 --- a/lib/node_modules/@stdlib/number/float64/to-json/README.md +++ b/lib/node_modules/@stdlib/number/float64/to-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var number2json = require( '@stdlib/number/float64/to-json' ); +const number2json = require( '@stdlib/number/float64/to-json' ); ``` #### number2json( x ) @@ -45,7 +45,7 @@ var number2json = require( '@stdlib/number/float64/to-json' ); Returns a [JSON][json] representation of a number. ```javascript -var json = number2json( NaN ); +const json = number2json( NaN ); /* returns { 'type': 'float64', @@ -77,7 +77,7 @@ var json = number2json( NaN ); ```javascript -var number2json = require( '@stdlib/number/float64/to-json' ); +const number2json = require( '@stdlib/number/float64/to-json' ); console.log( number2json( NaN ) ); ``` diff --git a/lib/node_modules/@stdlib/number/int32/README.md b/lib/node_modules/@stdlib/number/int32/README.md index 9d39fcc4de31..705bafa8f155 100644 --- a/lib/node_modules/@stdlib/number/int32/README.md +++ b/lib/node_modules/@stdlib/number/int32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/int32' ); +const ns = require( '@stdlib/number/int32' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/int32' ); Utilities for signed 32-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/int32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/int32' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/int32/base/README.md b/lib/node_modules/@stdlib/number/int32/base/README.md index 1139c598e618..fdeb154ccc7b 100644 --- a/lib/node_modules/@stdlib/number/int32/base/README.md +++ b/lib/node_modules/@stdlib/number/int32/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/int32/base' ); +const ns = require( '@stdlib/number/int32/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/int32/base' ); Base utilities for signed 32-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -62,8 +62,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/int32/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/int32/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/int32/base/to-uint32/README.md b/lib/node_modules/@stdlib/number/int32/base/to-uint32/README.md index 5d01bbe09bfb..e58a28faefc2 100644 --- a/lib/node_modules/@stdlib/number/int32/base/to-uint32/README.md +++ b/lib/node_modules/@stdlib/number/int32/base/to-uint32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var int32ToUint32 = require( '@stdlib/number/int32/base/to-uint32' ); +const int32ToUint32 = require( '@stdlib/number/int32/base/to-uint32' ); ``` #### int32ToUint32( x ) @@ -35,9 +35,9 @@ var int32ToUint32 = require( '@stdlib/number/int32/base/to-uint32' ); Converts a signed 32-bit integer to an unsigned 32-bit integer. ```javascript -var float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); +const float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); -var y = int32ToUint32( float64ToInt32( -1 ) ); +let y = int32ToUint32( float64ToInt32( -1 ) ); // returns 4294967295 y = int32ToUint32( float64ToInt32( 3 ) ); @@ -55,27 +55,23 @@ y = int32ToUint32( float64ToInt32( 3 ) ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var MAX_INT32 = require( '@stdlib/constants/int32/max' ); -var float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); -var int32ToUint32 = require( '@stdlib/number/int32/base/to-uint32' ); +const randu = require( '@stdlib/random/base/randu' ); +const MAX_INT32 = require( '@stdlib/constants/int32/max' ); +const float64ToInt32 = require( '@stdlib/number/float64/base/to-int32' ); +const int32ToUint32 = require( '@stdlib/number/int32/base/to-uint32' ); -var uint32; -var int32; -var sign; -var i; - -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let sign; if ( randu() < 0.5 ) { sign = -1.0; } else { sign = 1.0; } // Generate a random signed 32-bit integer: - int32 = float64ToInt32( sign*randu()*MAX_INT32 ); + const int32 = float64ToInt32( sign*randu()*MAX_INT32 ); // Convert the signed integer to an unsigned 32-bit integer: - uint32 = int32ToUint32( int32 ); + const uint32 = int32ToUint32( int32 ); console.log( 'int32: %d => uint32: %d', int32, uint32 ); } diff --git a/lib/node_modules/@stdlib/number/uint16/README.md b/lib/node_modules/@stdlib/number/uint16/README.md index 7997df13e978..29f6895c5911 100644 --- a/lib/node_modules/@stdlib/number/uint16/README.md +++ b/lib/node_modules/@stdlib/number/uint16/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint16' ); +const ns = require( '@stdlib/number/uint16' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint16' ); Utilities for unsigned 16-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint16' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint16' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint16/base/README.md b/lib/node_modules/@stdlib/number/uint16/base/README.md index ce71efce4be3..28ba614288f6 100644 --- a/lib/node_modules/@stdlib/number/uint16/base/README.md +++ b/lib/node_modules/@stdlib/number/uint16/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint16/base' ); +const ns = require( '@stdlib/number/uint16/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint16/base' ); Base utilities for unsigned 16-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -63,8 +63,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint16/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint16/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint16/base/from-binary-string/README.md b/lib/node_modules/@stdlib/number/uint16/base/from-binary-string/README.md index 5bf82ae2337f..b9f8e3291fe8 100644 --- a/lib/node_modules/@stdlib/number/uint16/base/from-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint16/base/from-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromBinaryStringUint16 = require( '@stdlib/number/uint16/base/from-binary-string' ); +const fromBinaryStringUint16 = require( '@stdlib/number/uint16/base/from-binary-string' ); ``` #### fromBinaryStringUint16( bstr ) @@ -35,8 +35,8 @@ var fromBinaryStringUint16 = require( '@stdlib/number/uint16/base/from-binary-st Creates an unsigned 16-bit integer from a [literal bit representation][@stdlib/number/uint16/base/to-binary-string]. ```javascript -var bstr = '0101010101010101'; -var val = fromBinaryStringUint16( bstr ); +let bstr = '0101010101010101'; +let val = fromBinaryStringUint16( bstr ); // returns 21845 bstr = '0000000000000000'; @@ -63,22 +63,17 @@ val = fromBinaryStringUint16( bstr ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_UINT = require( '@stdlib/constants/uint16/max' ); -var toBinaryStringUint16 = require( '@stdlib/number/uint16/base/to-binary-string' ); -var fromBinaryStringUint16 = require( '@stdlib/number/uint16/base/from-binary-string' ); - -var b; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_UINT = require( '@stdlib/constants/uint16/max' ); +const toBinaryStringUint16 = require( '@stdlib/number/uint16/base/to-binary-string' ); +const fromBinaryStringUint16 = require( '@stdlib/number/uint16/base/from-binary-string' ); // Convert random integers to literal bit representations and then convert them back... -for ( i = 0; i < 100; i++ ) { - x = round( randu()*MAX_UINT ); - b = toBinaryStringUint16( x ); - y = fromBinaryStringUint16( b ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*MAX_UINT ); + const b = toBinaryStringUint16( x ); + const y = fromBinaryStringUint16( b ); console.log( '%d => %s => %d', x, b, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint16/base/to-binary-string/README.md b/lib/node_modules/@stdlib/number/uint16/base/to-binary-string/README.md index d165829f2f99..1bb065d7b382 100644 --- a/lib/node_modules/@stdlib/number/uint16/base/to-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint16/base/to-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); +const toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); ``` #### toBinaryString( x ) @@ -35,11 +35,11 @@ var toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); Returns a `string` giving the literal bit representation of an [unsigned 16-bit integer][integer]. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); -var a = new Uint16Array( [ 1, 4, 9 ] ); +const a = new Uint16Array( [ 1, 4, 9 ] ); -var str = toBinaryString( a[0] ); +let str = toBinaryString( a[0] ); // returns '0000000000000001' str = toBinaryString( a[1] ); @@ -60,7 +60,7 @@ str = toBinaryString( a[2] ); - Except for [typed arrays][typed-arrays], JavaScript does **not** provide native user support for [unsigned 16-bit integers][integer]. According to the [ECMAScript standard][ecma-262], `number` values correspond to [double-precision floating-point numbers][ieee754]. While this function is intended for [unsigned 16-bit integers][integer], the function will accept [floating-point][ieee754] values and represent the values **as if** they are [unsigned 16-bit integers][integer]. Accordingly, care **should** be taken to ensure that **only** nonnegative integer values less than `65536` (`2^16`) are provided. ```javascript - var str = toBinaryString( 1 ); + let str = toBinaryString( 1 ); // returns '0000000000000001' str = toBinaryString( 4 ); @@ -84,27 +84,22 @@ str = toBinaryString( a[2] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var MAX_UINT16 = require( '@stdlib/constants/uint16/max' ); -var toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); - -var x; -var y; -var b; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const MAX_UINT16 = require( '@stdlib/constants/uint16/max' ); +const toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); // Generate random unsigned 16-bit integers... -x = new Uint16Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Uint16Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*MAX_UINT16 ); } // Convert unsigned 16-bit integers to literal bit representations... -for ( i = 0; i < x.length; i++ ) { - b = toBinaryString( x[i] ); - y = parseInt( b, 2 ); +for ( let i = 0; i < x.length; i++ ) { + const b = toBinaryString( x[i] ); + const y = parseInt( b, 2 ); console.log( 'x: %d, b: %s, y: %d', x[i], b, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint32/README.md b/lib/node_modules/@stdlib/number/uint32/README.md index b95b940d95f0..86a8dedf46eb 100644 --- a/lib/node_modules/@stdlib/number/uint32/README.md +++ b/lib/node_modules/@stdlib/number/uint32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint32' ); +const ns = require( '@stdlib/number/uint32' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint32' ); Utilities for unsigned 32-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint32' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint32' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/README.md b/lib/node_modules/@stdlib/number/uint32/base/README.md index 43c0f8e78280..6ef18629f810 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint32/base' ); +const ns = require( '@stdlib/number/uint32/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint32/base' ); Base utilities for unsigned 32-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint32/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint32/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/from-binary-string/README.md b/lib/node_modules/@stdlib/number/uint32/base/from-binary-string/README.md index b5487dc4c3e2..fe3d7fea70ff 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/from-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/from-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-string' ); +const fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-string' ); ``` #### fromBinaryStringUint32( bstr ) @@ -35,8 +35,8 @@ var fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-st Creates an unsigned 32-bit integer from a [literal bit representation][@stdlib/number/uint32/base/to-binary-string]. ```javascript -var bstr = '01010101010101010101010101010101'; -var val = fromBinaryStringUint32( bstr ); +let bstr = '01010101010101010101010101010101'; +let val = fromBinaryStringUint32( bstr ); // returns 1431655765 bstr = '00000000000000000000000000000000'; @@ -63,22 +63,17 @@ val = fromBinaryStringUint32( bstr ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var MAX_UINT = require( '@stdlib/constants/uint32/max' ); -var toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); -var fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-string' ); - -var b; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const MAX_UINT = require( '@stdlib/constants/uint32/max' ); +const toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); +const fromBinaryStringUint32 = require( '@stdlib/number/uint32/base/from-binary-string' ); // Convert random integers to literal bit representations and then convert them back... -for ( i = 0; i < 100; i++ ) { - x = round( randu()*MAX_UINT ); - b = toBinaryStringUint32( x ); - y = fromBinaryStringUint32( b ); +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*MAX_UINT ); + const b = toBinaryStringUint32( x ); + const y = fromBinaryStringUint32( b ); console.log( '%d => %s => %d', x, b, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/rotl/README.md b/lib/node_modules/@stdlib/number/uint32/base/rotl/README.md index 8cbb29d4b170..f9ea166e5e98 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/rotl/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/rotl/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rotl32 = require( '@stdlib/number/uint32/base/rotl' ); +const rotl32 = require( '@stdlib/number/uint32/base/rotl' ); ``` #### rotl32( x, shift ) @@ -35,13 +35,13 @@ var rotl32 = require( '@stdlib/number/uint32/base/rotl' ); Performs a bitwise rotation to the left. ```javascript -var toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); +const toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); -var x = 2147483649; -var bstr = toBinaryStringUint32( x ); +const x = 2147483649; +let bstr = toBinaryStringUint32( x ); // returns '10000000000000000000000000000001' -var y = rotl32( x, 10 ); +const y = rotl32( x, 10 ); // returns 1536 bstr = toBinaryStringUint32( y ); @@ -59,16 +59,16 @@ bstr = toBinaryStringUint32( y ); - If provided a `shift` equal to `0`, the function returns the input value. ```javascript - var y = rotl32( 3, 0 ); + const y = rotl32( 3, 0 ); // returns 3 ``` - If provided a `shift` greater than `31`, the function performs a bitwise rotation based on the `5` least significant bits of `shift` (i.e., `shift % 32`). ```javascript - var shift = 34; // 00000000000000000000000000100010 + const shift = 34; // 00000000000000000000000000100010 - var y = rotl( 1, shift ); // 00000000000000000000000000000100 + const y = rotl( 1, shift ); // 00000000000000000000000000000100 // returns 4 ``` @@ -83,25 +83,20 @@ bstr = toBinaryStringUint32( y ); ```javascript -var toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var rotl32 = require( '@stdlib/number/uint32/base/rotl' ); - -var HALF; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = i; - y = rotl32( x, 10 ); +const toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const rotl32 = require( '@stdlib/number/uint32/base/rotl' ); + +for ( let i = 0; i < 100; i++ ) { + const x = i; + const y = rotl32( x, 10 ); console.log( '%d => %s => %s => %d', x, toBinaryStringUint32( x ), toBinaryStringUint32( y ), y ); } -HALF = (MAX_INT+1) / 2; -for ( i = 0; i < 100; i++ ) { - x = HALF + i; - y = rotl32( x, 10 ); +const HALF = (MAX_INT+1) / 2; +for ( let i = 0; i < 100; i++ ) { + const x = HALF + i; + const y = rotl32( x, 10 ); console.log( '%d => %s => %s => %d', x, toBinaryStringUint32( x ), toBinaryStringUint32( y ), y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/rotr/README.md b/lib/node_modules/@stdlib/number/uint32/base/rotr/README.md index 3df31fd9cca5..f34ad21f8bd7 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/rotr/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/rotr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rotr32 = require( '@stdlib/number/uint32/base/rotr' ); +const rotr32 = require( '@stdlib/number/uint32/base/rotr' ); ``` #### rotr32( x, shift ) @@ -35,13 +35,13 @@ var rotr32 = require( '@stdlib/number/uint32/base/rotr' ); Performs a bitwise rotation to the right. ```javascript -var toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); +const toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); -var x = 2147483649; -var bstr = toBinaryStringUint32( x ); +const x = 2147483649; +let bstr = toBinaryStringUint32( x ); // returns '10000000000000000000000000000001' -var y = rotr32( x, 10 ); +const y = rotr32( x, 10 ); // returns 6291456 bstr = toBinaryStringUint32( y ); @@ -59,16 +59,16 @@ bstr = toBinaryStringUint32( y ); - If provided a `shift` equal to `0`, the function returns the input value. ```javascript - var y = rotr32( 3, 0 ); + const y = rotr32( 3, 0 ); // returns 3 ``` - If provided a `shift` greater than `31`, the function performs a bitwise rotation based on the `5` least significant bits of `shift` (i.e., `shift % 32`). ```javascript - var shift = 34; // 00000000000000000000000000100010 + const shift = 34; // 00000000000000000000000000100010 - var y = rotr( 1, shift ); // 01000000000000000000000000000000 + const y = rotr( 1, shift ); // 01000000000000000000000000000000 // returns 1073741824 ``` @@ -83,25 +83,20 @@ bstr = toBinaryStringUint32( y ); ```javascript -var toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); -var MAX_INT = require( '@stdlib/constants/uint32/max' ); -var rotr32 = require( '@stdlib/number/uint32/base/rotr' ); - -var HALF; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = i; - y = rotr32( x, 10 ); +const toBinaryStringUint32 = require( '@stdlib/number/uint32/base/to-binary-string' ); +const MAX_INT = require( '@stdlib/constants/uint32/max' ); +const rotr32 = require( '@stdlib/number/uint32/base/rotr' ); + +for ( let i = 0; i < 100; i++ ) { + const x = i; + const y = rotr32( x, 10 ); console.log( '%d => %s => %s => %d', x, toBinaryStringUint32( x ), toBinaryStringUint32( y ), y ); } -HALF = (MAX_INT+1) / 2; -for ( i = 0; i < 100; i++ ) { - x = HALF + i; - y = rotr32( x, 10 ); +const HALF = (MAX_INT+1) / 2; +for ( let i = 0; i < 100; i++ ) { + const x = HALF + i; + const y = rotr32( x, 10 ); console.log( '%d => %s => %s => %d', x, toBinaryStringUint32( x ), toBinaryStringUint32( y ), y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/to-binary-string/README.md b/lib/node_modules/@stdlib/number/uint32/base/to-binary-string/README.md index 5aeb8078bfcb..0fe4ac4763fa 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/to-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/to-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toBinaryString = require( '@stdlib/number/uint32/base/to-binary-string' ); +const toBinaryString = require( '@stdlib/number/uint32/base/to-binary-string' ); ``` #### toBinaryString( x ) @@ -35,11 +35,11 @@ var toBinaryString = require( '@stdlib/number/uint32/base/to-binary-string' ); Returns a `string` giving the literal bit representation of an [unsigned 32-bit integer][integer]. ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); -var a = new Uint32Array( [ 1, 4, 9 ] ); +const a = new Uint32Array( [ 1, 4, 9 ] ); -var str = toBinaryString( a[0] ); +let str = toBinaryString( a[0] ); // returns '00000000000000000000000000000001' str = toBinaryString( a[1] ); @@ -60,7 +60,7 @@ str = toBinaryString( a[2] ); - Except for [typed arrays][typed-arrays], JavaScript does **not** provide native user support for [unsigned 32-bit integers][integer]. According to the [ECMAScript standard][ecma-262], `number` values correspond to [double-precision floating-point numbers][ieee754]. While this function is intended for [unsigned 32-bit integers][integer], the function will accept [floating-point][ieee754] values and represent the values **as if** they are [unsigned 32-bit integers][integer]. Accordingly, care **should** be taken to ensure that **only** nonnegative integer values less than `4,294,967,296` (`2^32`) are provided. ```javascript - var str = toBinaryString( 1 ); + let str = toBinaryString( 1 ); // returns '00000000000000000000000000000001' str = toBinaryString( 4 ); @@ -84,26 +84,21 @@ str = toBinaryString( a[2] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var toBinaryString = require( '@stdlib/number/uint32/base/to-binary-string' ); - -var x; -var y; -var b; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const toBinaryString = require( '@stdlib/number/uint32/base/to-binary-string' ); // Generate random unsigned 32-bit integers... -x = new Uint32Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Uint32Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*1.0e5 ); } // Convert unsigned 32-bit integers to literal bit representations... -for ( i = 0; i < x.length; i++ ) { - b = toBinaryString( x[i] ); - y = parseInt( b, 2 ); +for ( let i = 0; i < x.length; i++ ) { + const b = toBinaryString( x[i] ); + const y = parseInt( b, 2 ); console.log( 'x: %d, b: %s, y: %d', x[i], b, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint32/base/to-int32/README.md b/lib/node_modules/@stdlib/number/uint32/base/to-int32/README.md index 8bfc446ae61e..0d50f0dca3a0 100644 --- a/lib/node_modules/@stdlib/number/uint32/base/to-int32/README.md +++ b/lib/node_modules/@stdlib/number/uint32/base/to-int32/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' ); +const uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' ); ``` #### uint32ToInt32( x ) @@ -35,9 +35,9 @@ var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' ); Converts an unsigned 32-bit integer to a signed 32-bit integer. ```javascript -var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); +const float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); -var y = uint32ToInt32( float64ToUint32( 4294967295 ) ); +let y = uint32ToInt32( float64ToUint32( 4294967295 ) ); // returns -1 y = uint32ToInt32( float64ToUint32( 3 ) ); @@ -55,21 +55,17 @@ y = uint32ToInt32( float64ToUint32( 3 ) ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); -var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); -var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' ); +const randu = require( '@stdlib/random/base/randu' ); +const MAX_UINT32 = require( '@stdlib/constants/uint32/max' ); +const float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' ); +const uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' ); -var uint32; -var int32; -var i; - -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { // Generate a random unsigned 32-bit integer: - uint32 = float64ToUint32( randu()*MAX_UINT32 ); + const uint32 = float64ToUint32( randu()*MAX_UINT32 ); // Convert the unsigned integer to a signed 32-bit integer: - int32 = uint32ToInt32( uint32 ); + const int32 = uint32ToInt32( uint32 ); console.log( 'uint32: %d => int32: %d', uint32, int32 ); } diff --git a/lib/node_modules/@stdlib/number/uint8/README.md b/lib/node_modules/@stdlib/number/uint8/README.md index 840c819c7f0f..b4e9a0fb81a5 100644 --- a/lib/node_modules/@stdlib/number/uint8/README.md +++ b/lib/node_modules/@stdlib/number/uint8/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint8' ); +const ns = require( '@stdlib/number/uint8' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint8' ); Utilities for unsigned 8-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint8' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint8' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint8/base/README.md b/lib/node_modules/@stdlib/number/uint8/base/README.md index e2aa2952e4f1..17db3a50d033 100644 --- a/lib/node_modules/@stdlib/number/uint8/base/README.md +++ b/lib/node_modules/@stdlib/number/uint8/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/number/uint8/base' ); +const ns = require( '@stdlib/number/uint8/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/number/uint8/base' ); Base utilities for unsigned 8-bit integers. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -63,8 +63,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/number/uint8/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/number/uint8/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/number/uint8/base/from-binary-string/README.md b/lib/node_modules/@stdlib/number/uint8/base/from-binary-string/README.md index 8fd6e36d9eff..c4a181142c82 100644 --- a/lib/node_modules/@stdlib/number/uint8/base/from-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint8/base/from-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var fromBinaryStringUint8 = require( '@stdlib/number/uint8/base/from-binary-string' ); +const fromBinaryStringUint8 = require( '@stdlib/number/uint8/base/from-binary-string' ); ``` #### fromBinaryStringUint8( bstr ) @@ -35,8 +35,8 @@ var fromBinaryStringUint8 = require( '@stdlib/number/uint8/base/from-binary-stri Creates an unsigned 8-bit integer from a [literal bit representation][@stdlib/number/uint8/base/to-binary-string]. ```javascript -var bstr = '01010101'; -var val = fromBinaryStringUint8( bstr ); +let bstr = '01010101'; +let val = fromBinaryStringUint8( bstr ); // returns 85 bstr = '00000000'; @@ -63,17 +63,13 @@ val = fromBinaryStringUint8( bstr ); ```javascript -var toBinaryStringUint8 = require( '@stdlib/number/uint8/base/to-binary-string' ); -var fromBinaryStringUint8 = require( '@stdlib/number/uint8/base/from-binary-string' ); - -var b; -var y; -var i; +const toBinaryStringUint8 = require( '@stdlib/number/uint8/base/to-binary-string' ); +const fromBinaryStringUint8 = require( '@stdlib/number/uint8/base/from-binary-string' ); // Convert integers to literal bit representations and then convert them back... -for ( i = 0; i < 256; i++ ) { - b = toBinaryStringUint8( i ); - y = fromBinaryStringUint8( b ); +for ( let i = 0; i < 256; i++ ) { + const b = toBinaryStringUint8( i ); + const y = fromBinaryStringUint8( b ); console.log( '%d => %s => %d', i, b, y ); } ``` diff --git a/lib/node_modules/@stdlib/number/uint8/base/to-binary-string/README.md b/lib/node_modules/@stdlib/number/uint8/base/to-binary-string/README.md index 7a3d75e56bee..9b6996388abe 100644 --- a/lib/node_modules/@stdlib/number/uint8/base/to-binary-string/README.md +++ b/lib/node_modules/@stdlib/number/uint8/base/to-binary-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); +const toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); ``` #### toBinaryString( x ) @@ -35,11 +35,11 @@ var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); Returns a `string` giving the literal bit representation of an [unsigned 8-bit integer][integer]. ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var a = new Uint8Array( [ 1, 4, 9 ] ); +const a = new Uint8Array( [ 1, 4, 9 ] ); -var str = toBinaryString( a[0] ); +let str = toBinaryString( a[0] ); // returns '00000001' str = toBinaryString( a[1] ); @@ -60,7 +60,7 @@ str = toBinaryString( a[2] ); - Except for [typed arrays][typed-arrays], JavaScript does **not** provide native user support for [unsigned 8-bit integers][integer]. According to the [ECMAScript standard][ecma-262], `number` values correspond to [double-precision floating-point numbers][ieee754]. While this function is intended for [unsigned 8-bit integers][integer], the function will accept [floating-point][ieee754] values and represent the values **as if** they are [unsigned 8-bit integers][integer]. Accordingly, care **should** be taken to ensure that **only** nonnegative integer values less than `256` (`2^8`) are provided. ```javascript - var str = toBinaryString( 1 ); + let str = toBinaryString( 1 ); // returns '00000001' str = toBinaryString( 4 ); @@ -84,24 +84,19 @@ str = toBinaryString( a[2] ); ```javascript -var Uint8Array = require( '@stdlib/array/uint8' ); -var MAX_UINT8 = require( '@stdlib/constants/uint8/max' ); -var toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const MAX_UINT8 = require( '@stdlib/constants/uint8/max' ); +const toBinaryString = require( '@stdlib/number/uint8/base/to-binary-string' ); -var x; -var y; -var b; -var i; - -x = new Uint8Array( MAX_UINT8+1 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Uint8Array( MAX_UINT8+1 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i; } // Convert unsigned 8-bit integers to literal bit representations... -for ( i = 0; i < x.length; i++ ) { - b = toBinaryString( x[i] ); - y = parseInt( b, 2 ); +for ( let i = 0; i < x.length; i++ ) { + const b = toBinaryString( x[i] ); + const y = parseInt( b, 2 ); console.log( 'x: %d, b: %s, y: %d', x[i], b, y ); } ``` diff --git a/lib/node_modules/@stdlib/object/README.md b/lib/node_modules/@stdlib/object/README.md index 368b35b356ad..59932f3ff80e 100644 --- a/lib/node_modules/@stdlib/object/README.md +++ b/lib/node_modules/@stdlib/object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/object' ); +const ns = require( '@stdlib/object' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/object' ); Object namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -65,8 +65,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/object' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/object' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/object/assign/README.md b/lib/node_modules/@stdlib/object/assign/README.md index c2d45d8b664c..e99312d5cadc 100644 --- a/lib/node_modules/@stdlib/object/assign/README.md +++ b/lib/node_modules/@stdlib/object/assign/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var assign = require( '@stdlib/object/assign' ); +const assign = require( '@stdlib/object/assign' ); ``` #### assign( target, source1\[, source2\[,...,sourceN]] ) @@ -45,19 +45,19 @@ var assign = require( '@stdlib/object/assign' ); Copies enumerable own properties from one or more source objects to a target object. ```javascript -var x = { +const x = { 'a': 'beep' }; -var y = { +const y = { 'b': 'boop' }; -var z = assign( x, y ); +const z = assign( x, y ); -var v = z.b; +const v = z.b; // returns 'boop' -var bool = ( z === x ); +const bool = ( z === x ); // returns true ``` @@ -87,21 +87,21 @@ var bool = ( z === x ); ```javascript -var assign = require( '@stdlib/object/assign' ); +const assign = require( '@stdlib/object/assign' ); -var obj1 = { +const obj1 = { 'name': 'Jane', 'age': 29 }; -var obj2 = { +const obj2 = { 'country': 'US', 'city': 'San Francisco' }; -var obj3 = { +const obj3 = { 'hobby': 'Reading' }; -var result = assign( obj1, obj2, obj3 ); +const result = assign( obj1, obj2, obj3 ); // returns { 'name': 'Jane', 'age': 29, 'country': 'US', 'city': 'San Francisco', 'hobby': 'Reading' } ``` diff --git a/lib/node_modules/@stdlib/object/ctor/README.md b/lib/node_modules/@stdlib/object/ctor/README.md index ba7630273b59..6ffe62ef63b6 100644 --- a/lib/node_modules/@stdlib/object/ctor/README.md +++ b/lib/node_modules/@stdlib/object/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Object = require( '@stdlib/object/ctor' ); +const Object = require( '@stdlib/object/ctor' ); ``` #### Object( value ) @@ -45,7 +45,7 @@ var Object = require( '@stdlib/object/ctor' ); Returns a new [object][mdn-object]. ```javascript -var o = new Object( null ); +const o = new Object( null ); // returns {} ``` @@ -60,8 +60,8 @@ var o = new Object( null ); Property whose value is a reference to the constructor function that created the instance object. ```javascript -var o = new Object( null ); -var ctr = o.constructor; +const o = new Object( null ); +const ctr = o.constructor; // returns Object ``` @@ -76,7 +76,7 @@ var ctr = o.constructor; Assigns enumerable properties of one or more source objects to a target object. ```javascript -var o = Object.assign( {}, { 'a': 1, 'b': 2 } ); +const o = Object.assign( {}, { 'a': 1, 'b': 2 } ); // returns { 'a': 1, 'b': 2 } ``` @@ -87,7 +87,7 @@ var o = Object.assign( {}, { 'a': 1, 'b': 2 } ); Returns a new object with the given prototype and properties. ```javascript -var o = Object.create( null, { +const o = Object.create( null, { 'a': { 'value': 1 }, @@ -102,7 +102,7 @@ function Person( first, last ) { this.last = last; } -var p = Object.create( Person.prototype, { +const p = Object.create( Person.prototype, { 'first': { 'value': 'Jane' }, @@ -120,7 +120,7 @@ var p = Object.create( Person.prototype, { Defines new or modifies existing properties directly on an object, returning the object. ```javascript -var o = Object.defineProperties( {}, { +const o = Object.defineProperties( {}, { 'a': { 'value': 1 }, @@ -138,7 +138,7 @@ var o = Object.defineProperties( {}, { Defines a new property directly on an object, or modifies an existing property on an object, and returns the object. ```javascript -var o = Object.defineProperty( {}, 'a', { +const o = Object.defineProperty( {}, 'a', { 'value': 1, 'writable': true, 'enumerable': true, @@ -154,8 +154,8 @@ var o = Object.defineProperty( {}, 'a', { Returns an array of a given object's own enumerable string-keyed property entries, i.e. `[key, value]` pairs. ```javascript -var o = { 'a': 1, 'b': 2 }; -var arr = Object.entries( o ); +const o = { 'a': 1, 'b': 2 }; +const arr = Object.entries( o ); // e.g., returns [ [ 'a', 1 ], [ 'b', 2 ] ] ``` @@ -166,12 +166,12 @@ var arr = Object.entries( o ); Freezes an object. A frozen object can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, and existing properties from being changed. ```javascript -var o = { 'a': 1 }; +const o = { 'a': 1 }; Object.freeze( o ); // returns { 'a': 1 } o.b = 1; -var v = o.b; +const v = o.b; // returns undefined ``` @@ -182,8 +182,8 @@ var v = o.b; Returns an object that contains the properties of the given object. ```javascript -var o = { 'a': 1 }; -var d = Object.getOwnPropertyDescriptor( o, 'a' ); +const o = { 'a': 1 }; +const d = Object.getOwnPropertyDescriptor( o, 'a' ); // returns { 'value': 1, 'writable': true, 'enumerable': true, 'configurable': true } ``` @@ -194,8 +194,8 @@ var d = Object.getOwnPropertyDescriptor( o, 'a' ); Returns an object whose properties are the result of calling `Object.getOwnPropertyDescriptor()` on every property of the given object. ```javascript -var o = { 'a': 1, 'b': 2 }; -var d = Object.getOwnPropertyDescriptors( o ); +const o = { 'a': 1, 'b': 2 }; +const d = Object.getOwnPropertyDescriptors( o ); // returns { 'a': { 'value': 1, 'writable': true, 'enumerable': true, 'configurable': true }, 'b': { 'value': 2, 'writable': true, 'enumerable': true, 'configurable': true } } ``` @@ -206,8 +206,8 @@ var d = Object.getOwnPropertyDescriptors( o ); Returns an array of a given object's own property names. ```javascript -var o = { 'a': 1, 'b': 2 }; -var arr = Object.getOwnPropertyNames( o ); +const o = { 'a': 1, 'b': 2 }; +const arr = Object.getOwnPropertyNames( o ); // e.g., returns [ 'a', 'b' ] ``` @@ -218,9 +218,9 @@ var arr = Object.getOwnPropertyNames( o ); Returns an array of a given object's own property symbols. ```javascript -var o = { 'a': 1 }; +const o = { 'a': 1 }; o[ Symbol( 'b' ) ] = 2; -var arr = Object.getOwnPropertySymbols( o ); +const arr = Object.getOwnPropertySymbols( o ); // returns [ Symbol(b) ] ``` @@ -231,8 +231,8 @@ var arr = Object.getOwnPropertySymbols( o ); Returns the prototype of an object. ```javascript -var o = { 'a': 1 }; -var p = Object.getPrototypeOf( o ); +const o = { 'a': 1 }; +const p = Object.getPrototypeOf( o ); // returns {} ``` @@ -243,8 +243,8 @@ var p = Object.getPrototypeOf( o ); Returns a boolean indicating whether an object has a property with the specified name. ```javascript -var o = { 'a': 1 }; -var b = Object.hasOwn( o, 'b' ); +const o = { 'a': 1 }; +const b = Object.hasOwn( o, 'b' ); // returns false ``` @@ -255,8 +255,8 @@ var b = Object.hasOwn( o, 'b' ); Returns a boolean indicating whether an object has a property with the specified name. ```javascript -var o = { 'a': 1 }; -var b = o.hasOwnProperty( 'a' ); +const o = { 'a': 1 }; +const b = o.hasOwnProperty( 'a' ); // returns true ``` @@ -267,7 +267,7 @@ var b = o.hasOwnProperty( 'a' ); Returns a boolean indicating whether two values are the same value. ```javascript -var b = Object.is( 1, 1 ); +let b = Object.is( 1, 1 ); // returns true b = Object.is( 1, '1' ); @@ -281,8 +281,8 @@ b = Object.is( 1, '1' ); Returns a boolean indicating whether an object is extensible (whether new properties can be added to it). ```javascript -var o = { 'a': 1 }; -var b = Object.isExtensible( o ); +const o = { 'a': 1 }; +let b = Object.isExtensible( o ); // returns true Object.preventExtensions( o ); @@ -297,8 +297,8 @@ b = Object.isExtensible( o ); Returns a boolean indicating whether an object is frozen. Frozen objects can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, and existing properties from being changed. ```javascript -var o = { 'a': 1 }; -var b = Object.isFrozen( o ); +const o = { 'a': 1 }; +let b = Object.isFrozen( o ); // returns false Object.freeze( o ); @@ -313,9 +313,9 @@ b = Object.isFrozen( o ); Returns a boolean indicating whether an object is in the prototype chain of another object. ```javascript -var o = { 'a': 1 }; -var p = { '__proto__': o }; -var b = o.isPrototypeOf( p ); +const o = { 'a': 1 }; +const p = { '__proto__': o }; +const b = o.isPrototypeOf( p ); // returns true ``` @@ -326,8 +326,8 @@ var b = o.isPrototypeOf( p ); Returns a boolean indicating whether an object is sealed. An object is sealed if it is not extensible and all of its properties are non-configurable. ```javascript -var o = { 'a': 1 }; -var b = Object.isSealed( o ); +const o = { 'a': 1 }; +let b = Object.isSealed( o ); // returns false Object.seal( o ); @@ -342,8 +342,8 @@ b = Object.isSealed( o ); Returns an array of a given object's own enumerable property names. ```javascript -var o = { 'a': 1, 'b': 2 }; -var arr = Object.keys( o ); +const o = { 'a': 1, 'b': 2 }; +const arr = Object.keys( o ); // e.g., returns [ 'a', 'b' ] ``` @@ -354,10 +354,10 @@ var arr = Object.keys( o ); Prevents new properties from being added to an object. ```javascript -var o = { 'a': 1 }; +const o = { 'a': 1 }; Object.preventExtensions( o ); o.b = 2; -var b = ( o.b === void 0 ); +let b = ( o.b === void 0 ); // returns true o.a = 3; @@ -372,11 +372,11 @@ b = ( o.a === 3 ); Returns a boolean indicating whether a property is enumerable. ```javascript -var o = { 'a': 1 }; -var b = o.propertyIsEnumerable( 'a' ); +const o = { 'a': 1 }; +let b = o.propertyIsEnumerable( 'a' ); // returns true -var arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; b = arr.propertyIsEnumerable( 'length' ); // returns false ``` @@ -388,11 +388,11 @@ b = arr.propertyIsEnumerable( 'length' ); Seals an object, preventing new properties from being added to it (i.e., making it non extensible) and marking all existing properties as non-configurable. ```javascript -var o = { 'a': 1 }; +const o = { 'a': 1 }; Object.seal( o ); o.b = 2; -var b = ( o.b === void 0 ); +const b = ( o.b === void 0 ); // returns true ``` @@ -403,11 +403,11 @@ var b = ( o.b === void 0 ); Sets the prototype of an object. ```javascript -var o = { 'a': 1 }; -var p = { 'b': 2 }; +const o = { 'a': 1 }; +const p = { 'b': 2 }; Object.setPrototypeOf( o, p ); -var b = ( o.b === 2 ); +const b = ( o.b === 2 ); // returns true ``` @@ -418,8 +418,8 @@ var b = ( o.b === 2 ); Returns a string representing the object. ```javascript -var o = { 'a': 1 }; -var str = o.toLocaleString(); +const o = { 'a': 1 }; +const str = o.toLocaleString(); // returns ``` @@ -430,8 +430,8 @@ var str = o.toLocaleString(); Returns a string representing the object. ```javascript -var o = { 'a': 1 }; -var str = o.toString(); +const o = { 'a': 1 }; +const str = o.toString(); // returns ``` @@ -442,8 +442,8 @@ var str = o.toString(); Returns the primitive value of the object. ```javascript -var o = {}; -var v = o.valueOf(); +const o = {}; +const v = o.valueOf(); // returns {} ``` @@ -454,8 +454,8 @@ var v = o.valueOf(); Returns an array of a given object's own enumerable property values. ```javascript -var o = { 'a': 1, 'b': 2 }; -var arr = Object.values( o ); +const o = { 'a': 1, 'b': 2 }; +const arr = Object.values( o ); // e.g., returns [ 1, 2 ] ``` @@ -486,9 +486,9 @@ var arr = Object.values( o ); ```javascript -var Object = require( '@stdlib/object/ctor' ); +const Object = require( '@stdlib/object/ctor' ); -var values = [ +const values = [ '5', 5, true, @@ -499,8 +499,7 @@ var values = [ {} ]; -var i; -for ( i = 0; i < values.length; i++ ) { +for ( let i = 0; i < values.length; i++ ) { console.log( new Object( values[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/os/README.md b/lib/node_modules/@stdlib/os/README.md index d85830f0ea7e..8e4e374d7992 100644 --- a/lib/node_modules/@stdlib/os/README.md +++ b/lib/node_modules/@stdlib/os/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/os' ); +const ns = require( '@stdlib/os' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/os' ); Namespace containing OS utilities. ```javascript -var os = ns; +const os = ns; // returns {...} ``` @@ -82,8 +82,8 @@ In addition, it exports the following constants: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/os' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/os' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/os/arch/README.md b/lib/node_modules/@stdlib/os/arch/README.md index 9621c28d4b48..a5e5489d193f 100644 --- a/lib/node_modules/@stdlib/os/arch/README.md +++ b/lib/node_modules/@stdlib/os/arch/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ARCH = require( '@stdlib/os/arch' ); +const ARCH = require( '@stdlib/os/arch' ); ``` #### ARCH @@ -60,7 +60,7 @@ console.log( ARCH ); ```javascript -var ARCH = require( '@stdlib/os/arch' ); +const ARCH = require( '@stdlib/os/arch' ); if ( ARCH === 'arm' || ARCH === 'arm64' ) { console.log( 'Running on ARM...' ); diff --git a/lib/node_modules/@stdlib/os/byte-order/README.md b/lib/node_modules/@stdlib/os/byte-order/README.md index 83c5efa9eb51..63ada26e7e6b 100644 --- a/lib/node_modules/@stdlib/os/byte-order/README.md +++ b/lib/node_modules/@stdlib/os/byte-order/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var BYTE_ORDER = require( '@stdlib/os/byte-order' ); +const BYTE_ORDER = require( '@stdlib/os/byte-order' ); ``` #### BYTE_ORDER @@ -65,7 +65,7 @@ console.log( BYTE_ORDER ); ```javascript -var BYTE_ORDER = require( '@stdlib/os/byte-order' ); +const BYTE_ORDER = require( '@stdlib/os/byte-order' ); if ( BYTE_ORDER === 'little-endian' ) { console.log( 'Least significant byte comes first...' ); diff --git a/lib/node_modules/@stdlib/os/configdir/README.md b/lib/node_modules/@stdlib/os/configdir/README.md index ec9bcde8da9d..a5ae0f53f620 100644 --- a/lib/node_modules/@stdlib/os/configdir/README.md +++ b/lib/node_modules/@stdlib/os/configdir/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var configdir = require( '@stdlib/os/configdir' ); +const configdir = require( '@stdlib/os/configdir' ); ``` #### configdir( \[path] ) @@ -45,14 +45,14 @@ var configdir = require( '@stdlib/os/configdir' ); Returns a directory for user-specific configuration files. ```javascript -var dir = configdir(); +const dir = configdir(); // e.g., returns '/Users//Library/Preferences' ``` To append a `path` to the base directory, provide a `path` argument. ```javascript -var dir = configdir( 'appname/config' ); +const dir = configdir( 'appname/config' ); // e.g., returns '/Users//Library/Preferences/appname/config' ``` @@ -83,7 +83,7 @@ On non-Windows platforms, if the function is unable to locate the current user's ```javascript -var configdir = require( '@stdlib/os/configdir' ); +const configdir = require( '@stdlib/os/configdir' ); console.log( configdir( 'appy/config' ) ); ``` diff --git a/lib/node_modules/@stdlib/os/float-word-order/README.md b/lib/node_modules/@stdlib/os/float-word-order/README.md index 16596d28b8bc..b8d46aafaa50 100644 --- a/lib/node_modules/@stdlib/os/float-word-order/README.md +++ b/lib/node_modules/@stdlib/os/float-word-order/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var FLOAT_WORD_ORDER = require( '@stdlib/os/float-word-order' ); +const FLOAT_WORD_ORDER = require( '@stdlib/os/float-word-order' ); ``` #### FLOAT_WORD_ORDER @@ -64,7 +64,7 @@ console.log( FLOAT_WORD_ORDER ); ```javascript -var FLOAT_WORD_ORDER = require( '@stdlib/os/float-word-order' ); +const FLOAT_WORD_ORDER = require( '@stdlib/os/float-word-order' ); if ( FLOAT_WORD_ORDER === 'little-endian' ) { console.log( 'Least significant word comes first...' ); diff --git a/lib/node_modules/@stdlib/os/homedir/README.md b/lib/node_modules/@stdlib/os/homedir/README.md index 2e2a01407c5d..76ddc9dce8c9 100644 --- a/lib/node_modules/@stdlib/os/homedir/README.md +++ b/lib/node_modules/@stdlib/os/homedir/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var homedir = require( '@stdlib/os/homedir' ); +const homedir = require( '@stdlib/os/homedir' ); ``` #### homedir() @@ -45,7 +45,7 @@ var homedir = require( '@stdlib/os/homedir' ); Returns the current user's `home` directory. ```javascript -var home = homedir(); +const home = homedir(); // e.g., returns '/Users/' ``` @@ -76,7 +76,7 @@ If unable to locate a `home` directory, the function returns `null`. ```javascript -var homedir = require( '@stdlib/os/homedir' ); +const homedir = require( '@stdlib/os/homedir' ); console.log( homedir() ); ``` diff --git a/lib/node_modules/@stdlib/os/num-cpus/README.md b/lib/node_modules/@stdlib/os/num-cpus/README.md index 0eb3630db262..a376951c38f4 100644 --- a/lib/node_modules/@stdlib/os/num-cpus/README.md +++ b/lib/node_modules/@stdlib/os/num-cpus/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var NUM_CPUS = require( '@stdlib/os/num-cpus' ); +const NUM_CPUS = require( '@stdlib/os/num-cpus' ); ``` #### NUM_CPUS @@ -35,7 +35,7 @@ var NUM_CPUS = require( '@stdlib/os/num-cpus' ); Number of CPUs. ```javascript -var n = NUM_CPUS; +const n = NUM_CPUS; // returns ``` @@ -65,18 +65,16 @@ var n = NUM_CPUS; ```javascript -var proc = require( 'process' ); -var cluster = require( 'cluster' ); -var NUM_CPUS = require( '@stdlib/os/num-cpus' ); - -var i; +const proc = require( 'process' ); +const cluster = require( 'cluster' ); +const NUM_CPUS = require( '@stdlib/os/num-cpus' ); function onTimeout() { proc.exit( 0 ); } if ( cluster.isMaster ) { - for ( i = 0; i < NUM_CPUS; i++ ) { + for ( let i = 0; i < NUM_CPUS; i++ ) { cluster.fork(); } } else { diff --git a/lib/node_modules/@stdlib/os/platform/README.md b/lib/node_modules/@stdlib/os/platform/README.md index 46dd55f668c2..12c8faae1cb5 100644 --- a/lib/node_modules/@stdlib/os/platform/README.md +++ b/lib/node_modules/@stdlib/os/platform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var PLATFORM = require( '@stdlib/os/platform' ); +const PLATFORM = require( '@stdlib/os/platform' ); ``` #### PLATFORM @@ -50,7 +50,7 @@ console.log( PLATFORM ); ```javascript -var PLATFORM = require( '@stdlib/os/platform' ); +const PLATFORM = require( '@stdlib/os/platform' ); if ( PLATFORM === 'win32' ) { console.log( 'Running on a PC...' ); diff --git a/lib/node_modules/@stdlib/os/tmpdir/README.md b/lib/node_modules/@stdlib/os/tmpdir/README.md index 8a3cb08b2afc..c15a819badc0 100644 --- a/lib/node_modules/@stdlib/os/tmpdir/README.md +++ b/lib/node_modules/@stdlib/os/tmpdir/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tmpdir = require( '@stdlib/os/tmpdir' ); +const tmpdir = require( '@stdlib/os/tmpdir' ); ``` #### tmpdir() @@ -35,7 +35,7 @@ var tmpdir = require( '@stdlib/os/tmpdir' ); Returns the directory for storing temporary files. ```javascript -var dir = tmpdir(); +const dir = tmpdir(); // e.g., returns '/path/to/temporary/files/directory' ``` @@ -50,10 +50,10 @@ var dir = tmpdir(); ```javascript -var PATH_SEP = require( '@stdlib/constants/path/sep' ); -var tmpdir = require( '@stdlib/os/tmpdir' ); +const PATH_SEP = require( '@stdlib/constants/path/sep' ); +const tmpdir = require( '@stdlib/os/tmpdir' ); -var parts = tmpdir().split( PATH_SEP ); +const parts = tmpdir().split( PATH_SEP ); console.log( parts ); ``` diff --git a/lib/node_modules/@stdlib/plot/README.md b/lib/node_modules/@stdlib/plot/README.md index ecd68049825b..be87bc2758d8 100644 --- a/lib/node_modules/@stdlib/plot/README.md +++ b/lib/node_modules/@stdlib/plot/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var plot = require( '@stdlib/plot' ); +const plot = require( '@stdlib/plot' ); ``` #### plot @@ -35,10 +35,10 @@ var plot = require( '@stdlib/plot' ); Plot API. ```javascript -var x = [ 1, 2, 3 ]; -var y = [ 1, 0, 1 ]; +const x = [ 1, 2, 3 ]; +const y = [ 1, 0, 1 ]; -var plt = plot( [ x ], [ y ] ); +const plt = plot( [ x ], [ y ] ); ``` @@ -54,27 +54,22 @@ var plt = plot( [ x ], [ y ] ); ```javascript -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var now = require( '@stdlib/time/now' ); -var plot = require( '@stdlib/plot' ); - -var t; -var x; -var y; -var i; +const randn = require( '@stdlib/random/base/box-muller' ); +const Float64Array = require( '@stdlib/array/float64' ); +const now = require( '@stdlib/time/now' ); +const plot = require( '@stdlib/plot' ); // Create some data... -t = now() * 1000; -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const t = now() * 1000; +const x = new Float64Array( 100 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = t + (i*360000); y[ i ] = 50.0 + (10.0*randn()); } // Create a new plot: -var plt = plot( [x], [y], { +const plt = plot( [x], [y], { 'width': 600, 'height': 480, 'xScale': 'time', @@ -83,11 +78,11 @@ var plt = plot( [x], [y], { }); // Render as a virtual DOM tree: -var vtree = plt.render( 'vdom' ); +const vtree = plt.render( 'vdom' ); console.log( JSON.stringify( vtree ) ); // Render as HTML: -var html = plt.render(); +const html = plt.render(); console.log( html ); // Listen for 'render' events (e.g., when triggered due to changes in state): diff --git a/lib/node_modules/@stdlib/plot/components/svg/annotations/README.md b/lib/node_modules/@stdlib/plot/components/svg/annotations/README.md index 5db95da6c16a..3ebbcecedce7 100644 --- a/lib/node_modules/@stdlib/plot/components/svg/annotations/README.md +++ b/lib/node_modules/@stdlib/plot/components/svg/annotations/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Annotations = require( '@stdlib/plot/components/svg/annotations' ); +const Annotations = require( '@stdlib/plot/components/svg/annotations' ); ``` #### Annotations() @@ -45,7 +45,7 @@ var Annotations = require( '@stdlib/plot/components/svg/annotations' ); Returns an `Annotations` instance. ```javascript -var node = new Annotations(); +const node = new Annotations(); // returns ``` @@ -60,9 +60,9 @@ var node = new Annotations(); Renders an instance as a [Virtual DOM tree][virtual-dom]. ```javascript -var node = new Annotations(); +const node = new Annotations(); -var vtree = node.render(); +const vtree = node.render(); /* e.g., returns { 'tagName': 'g', @@ -97,7 +97,7 @@ var vtree = node.render(); Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. ```javascript -var node = new Annotations(); +const node = new Annotations(); function onRender( vtree ) { console.log( vtree ); @@ -118,7 +118,7 @@ node.render(); Upon receiving a `'change'` event, an instance re-renders. ```javascript -var node = new Annotations(); +const node = new Annotations(); function onRender( vtree ) { console.log( vtree ); @@ -151,17 +151,17 @@ node.emit( 'change' ); ```javascript -var toHTML = require( 'vdom-to-html' ); -var annotations = require( '@stdlib/plot/components/svg/annotations' ); +const toHTML = require( 'vdom-to-html' ); +const annotations = require( '@stdlib/plot/components/svg/annotations' ); // Create a new component: -var node = annotations(); +const node = annotations(); // Render as a virtual DOM tree: -var vtree = node.render(); +const vtree = node.render(); // Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); +const html = toHTML( vtree ); // returns ``` diff --git a/lib/node_modules/@stdlib/plot/components/svg/defs/README.md b/lib/node_modules/@stdlib/plot/components/svg/defs/README.md index 10e8f5c52fd8..81751033da45 100644 --- a/lib/node_modules/@stdlib/plot/components/svg/defs/README.md +++ b/lib/node_modules/@stdlib/plot/components/svg/defs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Defs = require( '@stdlib/plot/components/svg/defs' ); +const Defs = require( '@stdlib/plot/components/svg/defs' ); ``` #### Defs() @@ -45,7 +45,7 @@ var Defs = require( '@stdlib/plot/components/svg/defs' ); Returns a `Defs` instance. ```javascript -var node = new Defs(); +const node = new Defs(); // returns ``` @@ -60,9 +60,9 @@ var node = new Defs(); Renders an instance as a [virtual DOM tree][virtual-dom]. ```javascript -var node = new Defs(); +const node = new Defs(); -var vtree = node.render(); +const vtree = node.render(); /* e.g., returns { 'tagName': 'defs', @@ -92,7 +92,7 @@ var vtree = node.render(); Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. ```javascript -var node = new Defs(); +const node = new Defs(); function onRender( vtree ) { console.log( vtree ); @@ -113,7 +113,7 @@ node.render(); Upon receiving a `'change'` event, an instance re-renders. ```javascript -var node = new Defs(); +const node = new Defs(); function onRender( vtree ) { console.log( vtree ); @@ -146,17 +146,17 @@ node.emit( 'change' ); ```javascript -var toHTML = require( 'vdom-to-html' ); -var defs = require( '@stdlib/plot/components/svg/defs' ); +const toHTML = require( 'vdom-to-html' ); +const defs = require( '@stdlib/plot/components/svg/defs' ); // Create a new component: -var node = defs(); +const node = defs(); // Render as a virtual DOM tree: -var vtree = node.render(); +const vtree = node.render(); // Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); +const html = toHTML( vtree ); // returns ``` diff --git a/lib/node_modules/@stdlib/plot/components/svg/rug/README.md b/lib/node_modules/@stdlib/plot/components/svg/rug/README.md index 88adfdb93117..cff17940a3b8 100644 --- a/lib/node_modules/@stdlib/plot/components/svg/rug/README.md +++ b/lib/node_modules/@stdlib/plot/components/svg/rug/README.md @@ -45,7 +45,7 @@ A **rug plot** provides a compact 1-dimensional visualization to supplement high ## Usage ```javascript -var Rug = require( '@stdlib/plot/components/svg/rug' ); +const Rug = require( '@stdlib/plot/components/svg/rug' ); ``` #### Rug( \[options] ) @@ -53,7 +53,7 @@ var Rug = require( '@stdlib/plot/components/svg/rug' ); Returns a `Rug` instance. ```javascript -var node = new Rug(); +const node = new Rug(); // returns ``` @@ -72,7 +72,7 @@ The constructor accepts the following `options`: To specify rug plot options at instantiation, provide an `options` object. ```javascript -var opts = { +const opts = { 'data': [ 0.1, 0.3, 0.5 ], 'color': '#ff0000', 'label': 'group-1', @@ -82,7 +82,7 @@ var opts = { 'autoRender': false }; -var node = new Rug( opts ); +const node = new Rug( opts ); // returns ``` @@ -97,11 +97,11 @@ var node = new Rug( opts ); **Writable** property which specifies whether an instance re-renders on each `'change'` event. ```javascript -var node = new Rug({ +const node = new Rug({ 'autoRender': false }); -var mode = node.autoRender; +const mode = node.autoRender; // returns false ``` @@ -112,11 +112,11 @@ var mode = node.autoRender; **Writable** property which specifies tick (tassel) color. A color value may be either a `string` or an accessor `function`. ```javascript -var node = new Rug({ +const node = new Rug({ 'color': 'steelblue' }); -var color = node.color; +const color = node.color; // returns ``` @@ -132,11 +132,11 @@ When retrieved, the returned value is always an accessor which accepts two param **Writable** property which specifies the tick (tassel) data. ```javascript -var node = new Rug({ +const node = new Rug({ 'data': [ 0.1, 0.2, 0.3 ] }); -var data = node.data; +const data = node.data; // returns [ 0.1, 0.2, 0.3 ] ``` @@ -154,7 +154,7 @@ function isDefined( d ) { return ( d !== null ); } -var node = new Rug({ +const node = new Rug({ 'isDefined': isDefined }); @@ -171,11 +171,11 @@ The default function behavior defines `NaN` data values as undefined. **Writable** property specifying a tick (tassel) label. A label value may be either a `string` or an accessor `function`. ```javascript -var node = new Rug({ +const node = new Rug({ 'label': 'group-1' }); -var label = node.label; +const label = node.label; // returns ``` @@ -191,11 +191,11 @@ When retrieved, the returned value is always an accessor which accepts two param **Writable** property specifying tick (tassel) opacity. An opacity value may be either a `number` or an accessor `function`. ```javascript -var node = new Rug({ +const node = new Rug({ 'opacity': 0.5 }); -var opacity = node.opacity; +const opacity = node.opacity; // returns ``` @@ -211,11 +211,11 @@ When retrieved, the returned value is always an accessor which accepts two param **Writable** property specifying the rug plot orientation. ```javascript -var node = new Rug({ +const node = new Rug({ 'orientation': 'left' }); -var orient = node.orientation; +const orient = node.orientation; // returns 'left' ``` @@ -238,11 +238,11 @@ function scale( d, i ) { return d; } -var node = new Rug({ +const node = new Rug({ 'scale': scale }); -var fcn = node.scale; +const fcn = node.scale; // returns ``` @@ -253,11 +253,11 @@ var fcn = node.scale; **Writable** property specifying tick (tassel) size. ```javascript -var node = new Rug({ +const node = new Rug({ 'size': 5 }); -var size = node.size; +const size = node.size; // returns 5 ``` @@ -272,11 +272,11 @@ var size = node.size; Renders an instance as a [virtual DOM tree][virtual-dom]. ```javascript -var node = new Rug({ +const node = new Rug({ 'data': [ 0.1 ] }); -var vtree = node.render(); +const vtree = node.render(); /* e.g., returns { 'tagName': 'g', @@ -336,7 +336,7 @@ var vtree = node.render(); Event emitted when an instance renders. The event object is the rendered [Virtual DOM tree][virtual-dom]. ```javascript -var node = new Rug(); +const node = new Rug(); function onRender( vtree ) { console.log( vtree ); @@ -360,7 +360,7 @@ node.render(); If `autoRender` is `true`, upon receiving a `'change'` event, an instance re-renders. ```javascript -var node = new Rug({ +const node = new Rug({ 'autoRender': true }); @@ -398,21 +398,21 @@ node.emit( 'change' ); ```javascript -var toHTML = require( 'vdom-to-html' ); -var rug = require( '@stdlib/plot/components/svg/rug' ); +const toHTML = require( 'vdom-to-html' ); +const rug = require( '@stdlib/plot/components/svg/rug' ); // Create a new rug component: -var opts = { +const opts = { 'data': [ 0.10, 0.50, 0.90 ], 'orientation': 'bottom' }; -var r = rug( opts ); +const r = rug( opts ); // Render as a virtual DOM tree: -var vtree = r.render(); +const vtree = r.render(); // Transform the virtual DOM tree to HTML: -var html = toHTML( vtree ); +const html = toHTML( vtree ); // returns // Listen for 'render' events (e.g., when triggered due to changes in state): diff --git a/lib/node_modules/@stdlib/plot/ctor/README.md b/lib/node_modules/@stdlib/plot/ctor/README.md index 931c9451563c..ca9bbdd3f271 100644 --- a/lib/node_modules/@stdlib/plot/ctor/README.md +++ b/lib/node_modules/@stdlib/plot/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Plot = require( '@stdlib/plot/ctor' ); +const Plot = require( '@stdlib/plot/ctor' ); ``` #### Plot( \[x, y,] \[options] ) @@ -45,17 +45,17 @@ var Plot = require( '@stdlib/plot/ctor' ); Returns a `plot` instance for creating 2-dimensional plots. ```javascript -var plot = new Plot(); +const plot = new Plot(); // returns ``` To provide plot data at instantiation, provide `x` **and** `y` data as arguments. ```javascript -var x = [[0.10, 0.20, 0.30]]; -var y = [[0.52, 0.79, 0.64]]; +const x = [[0.10, 0.20, 0.30]]; +const y = [[0.52, 0.79, 0.64]]; -var plot = new Plot( x, y ); +const plot = new Plot( x, y ); // returns ``` @@ -111,32 +111,32 @@ The function accepts the following `options`: In addition to supporting `x` and `y` data as arguments, the constructor supports providing data via the `x` and `y` options. ```javascript -var opts = { +const opts = { 'x': [[0.10, 0.20, 0.30]], 'y': [[0.52, 0.79, 0.64]] }; -var plot = new Plot( opts ); +const plot = new Plot( opts ); // returns ``` Note that `x` and `y` arguments take precedence over `x` and `y` options. ```javascript -var opts = { +const opts = { 'x': [[0.10, 0.20, 0.30]], 'y': [[0.52, 0.79, 0.64]] }; -var x = [[0.40, 0.50, 0.60]]; -var y = [[0.37, 0.51, 0.44]]; +const x = [[0.40, 0.50, 0.60]]; +const y = [[0.37, 0.51, 0.44]]; -var plot = new Plot( x, y, opts ); +const plot = new Plot( x, y, opts ); -var x1 = plot.x; +const x1 = plot.x; // returns [[0.40, 0.50, 0.60]] -var y1 = plot.y; +const y1 = plot.y; // returns [[0.37, 0.51, 0.44]] ``` @@ -151,16 +151,16 @@ var y1 = plot.y; Renders a plot. ```javascript -var plot = new Plot(); -var vtree = plot.render(); +const plot = new Plot(); +const vtree = plot.render(); // returns ``` By default, the method renders a plot as a [virtual DOM tree][vdom]. To render to an alternative format, provide a `format` argument. ```javascript -var plot = new Plot(); -var vtree = plot.render( 'html' ); +const plot = new Plot(); +const vtree = plot.render( 'html' ); // returns ``` @@ -171,14 +171,14 @@ var vtree = plot.render( 'html' ); Generates a plot view. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.view(); ``` To generate a particular plot view without updating the [`viewer`](#prop-viewer) property, provide a `viewer`. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.view( 'stdout' ); ``` @@ -193,7 +193,7 @@ plot.view( 'stdout' ); `x` values. The `x` property value must be an `array`, where each element corresponds to a plotted dataset. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.x = [ @@ -202,7 +202,7 @@ plot.x = [ ]; // Get: -var x = plot.x; +const x = plot.x; // returns [ [ 1417563950959, 1417563952959 ], [ 1417563950959, 1417563952959 ] ] ``` @@ -213,7 +213,7 @@ var x = plot.x; `y` values. The `y` property value must be an `array`, where each element corresponds to a plotted dataset. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.y = [ @@ -222,7 +222,7 @@ plot.y = [ ]; // Get: -var y = plot.y; +const y = plot.y; // returns [ [ 0.25, 0.23 ], [ 0.72, 0.89 ] ] ``` @@ -233,7 +233,7 @@ var y = plot.y; Data labels. During plot creation, each plotted dataset is assigned a `label`. If the number of `labels` is less than the number of plotted datasets, `labels` are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.labels = [ @@ -242,7 +242,7 @@ plot.labels = [ ]; // Get: -var labels = plot.labels; +const labels = plot.labels; // returns ['beep','boop'] ``` @@ -260,13 +260,13 @@ function isDefined( d ) { return ( d !== null ); } -var plot = new Plot(); +const plot = new Plot(); // Set: plot.isDefined = isDefined; // Get: -var fcn = plot.isDefined; +const fcn = plot.isDefined; // returns ``` @@ -279,20 +279,20 @@ The default behavior is to ignore values which are `NaN`. Data colors. To set the `color` for all plotted datasets, provide a `color` name. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.colors = '#474747'; // Get: -var colors = plot.colors; +const colors = plot.colors; // returns ['#474747'] ``` To specify the colors for each dataset, provide an `array` of colors. During plot creation, each plotted dataset is assigned one of the provided colors. If the number of colors is less than the number of plotted datasets, colors are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.colors = [ '#000', // assigned to datasets 0,3,6,9,... @@ -301,7 +301,7 @@ plot.colors = [ ]; // Get: -var colors = plot.colors; +const colors = plot.colors; // returns ['#000','rgb(100,100,100)','red'] ``` @@ -315,13 +315,13 @@ A `plot` instance also supports providing the name of a predefined color scheme. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.colors = 'category20'; // Get: -var colors = plot.colors; +const colors = plot.colors; // returns ``` @@ -340,20 +340,20 @@ Data line style(s). The following line styles are supported: To set the line style for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.lineStyle = '-'; // all solid lines // Get: -var lineStyle = plot.lineStyle; +const lineStyle = plot.lineStyle; // returns ['-'] ``` To specify the line style for each dataset, provide an `array` of line styles. During plot creation, each plotted dataset is assigned a `lineStyle`. If the number of line styles is less than the number of plotted datasets, line styles are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.lineStyle = [ ':', // assigned to datasets 0,3,6,9,... @@ -369,20 +369,20 @@ plot.lineStyle = [ Data line opacity, where an opacity of `0.0` makes a line completely transparent and an opacity of `1.0` makes a line completely opaque. To set the opacity for all plotted lines, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.lineOpacity = 0.9; // Get: -var opacity = plot.lineOpacity; +const opacity = plot.lineOpacity; // returns [0.9] ``` To specify the line opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.lineOpacity = [ 0.7, // assigned to datasets 0,3,6,9,... @@ -398,20 +398,20 @@ plot.lineOpacity = [ Data line width(s). To set the line widths for all plotted lines, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.lineWidth = 1; // Get: -var width = plot.lineWidth; +const width = plot.lineWidth; // returns [1] ``` To specify the line width for each dataset, provide an `array` of widths. During plot creation, each plotted dataset is assigned a line width. If the number of line widths is less than the number of plotted datasets, line widths are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.lineWidth = [ 1, // assigned to datasets 0,2,4,... @@ -432,20 +432,20 @@ Data symbols. The following symbols are supported: To set the symbols for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.symbols = 'closed-circle'; // Get: -var sym = plot.symbols; +const sym = plot.symbols; // returns ['closed-circle'] ``` To specify the symbols used for each dataset, provide an `array` of symbols. During plot creation, each plotted dataset is assigned a symbol. If the number of symbols is less than the number of plotted datasets, symbols are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.symbols = [ 'closed-circle', // assigned to datasets 0,3,6,9,... @@ -461,20 +461,20 @@ plot.symbols = [ Symbols size. To set the size of all symbols, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.symbolsSize = 4; // Get: -var size = plot.symbolsSize; +const size = plot.symbolsSize; // returns [4] ``` To specify the symbols size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a symbols size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.symbolsSize = [ 4, // assigned to datasets 0,2,4,... @@ -489,20 +489,20 @@ plot.symbolsSize = [ Symbols opacity, where an opacity of `0.0` makes a symbol completely transparent and an opacity of `1.0` makes a symbol completely opaque. To set the opacity for all plotted symbols, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.symbolsOpacity = 0.9; // Get: -var opacity = plot.symbolsOpacity; +const opacity = plot.symbolsOpacity; // returns [0.9] ``` To specify the opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.symbolsOpacity = [ 0.7, // assigned to datasets 0,3,6,9,... @@ -518,13 +518,13 @@ plot.symbolsOpacity = [ Plot width (in pixels). ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.width = 720; // Get: -var width = plot.width; +const width = plot.width; // returns 720 ``` @@ -535,13 +535,13 @@ var width = plot.width; Plot height (in pixels). ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.height = 480; // Get: -var height = plot.height; +const height = plot.height; // returns 480 ``` @@ -552,13 +552,13 @@ var height = plot.height; Plot left padding (in pixels). Left padding is typically used to create space for a left-oriented `y`-axis. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.paddingLeft = 120; // Get: -var padding = plot.paddingLeft; +const padding = plot.paddingLeft; // returns 120 ``` @@ -569,13 +569,13 @@ var padding = plot.paddingLeft; Plot right padding (in pixels). Right padding is typically used to create space for a right-oriented `y`-axis. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.paddingRight = 90; // Get: -var padding = plot.paddingRight; +const padding = plot.paddingRight; // returns 90 ``` @@ -586,13 +586,13 @@ var padding = plot.paddingRight; Plot top padding (in pixels). Top padding is typically used to create space for a title or top-oriented `x`-axis. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.paddingTop = 100; // Get: -var padding = plot.paddingTop; +const padding = plot.paddingTop; // returns 100 ``` @@ -603,13 +603,13 @@ var padding = plot.paddingTop; Plot bottom padding (in pixels). Bottom padding is typically used to create space for a bottom-oriented `x`-axis. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.paddingBottom = 105; // Get: -var padding = plot.paddingBottom; +const padding = plot.paddingBottom; // returns 105 ``` @@ -620,13 +620,13 @@ var padding = plot.paddingBottom; Minimum value of the `x`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xMin = -1.0; // Get: -var xMin = plot.xMin; +const xMin = plot.xMin; // returns -1.0 ``` @@ -637,13 +637,13 @@ var xMin = plot.xMin; Maximum value of the `x`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `x` data. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xMax = 100.0; // Get: -var xMax = plot.xMax; +const xMax = plot.xMax; // returns 100.0 ``` @@ -654,13 +654,13 @@ var xMax = plot.xMax; Minimum value of the `y`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yMin = -50.0; // Get: -var yMin = plot.yMin; +const yMin = plot.yMin; // returns -50.0 ``` @@ -671,13 +671,13 @@ var yMin = plot.yMin; Maximum value of the `y`-axis domain. When retrieved, if the value has been set to `null`, the returned value is computed from the `y` data. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yMax = 31.4; // Get: -var yMax = plot.yMax; +const yMax = plot.yMax; // returns 31.4 ``` @@ -693,7 +693,7 @@ Scale function for mapping values to a coordinate along the `x`-axis. The follow To set the scale, ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xScale = 'time'; ``` @@ -701,9 +701,9 @@ plot.xScale = 'time'; When retrieved, the returned value is a scale `function`. ```javascript -var plot = new Plot(); +const plot = new Plot(); -var xScale = plot.xScale; +const xScale = plot.xScale; // returns ``` @@ -719,7 +719,7 @@ Scale function for mapping values to a coordinate along the `y`-axis. The follow To set the scale, ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yScale = 'linear'; ``` @@ -727,9 +727,9 @@ plot.yScale = 'linear'; When retrieved, the returned value is a scale `function`. ```javascript -var plot = new Plot(); +const plot = new Plot(); -var yScale = plot.yScale; +const yScale = plot.yScale; // returns ``` @@ -740,7 +740,7 @@ var yScale = plot.yScale; `x`-axis tick format. To set the tick format, ```javascript -var plot = new Plot({ +const plot = new Plot({ 'xScale': 'time' }); @@ -750,12 +750,12 @@ plot.xTickFormat = '%H:%M'; When retrieved, if the value has not been set to `null`, the returned value is a formatting `function`. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'xScale': 'time', 'xTickFormat': '%H:%M' }); -var fmt = plot.xTickFormat; +const fmt = plot.xTickFormat; // returns ``` @@ -766,7 +766,7 @@ var fmt = plot.xTickFormat; `y`-axis tick format. To set the tick format, ```javascript -var plot = new Plot({ +const plot = new Plot({ 'yScale': 'linear' }); @@ -776,12 +776,12 @@ plot.yTickFormat = '.0%'; When retrieved, if the value has not been set to `null`, the returned value is a formatting `function`. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'yScale': 'linear', 'yTickFormat': '.0%' }); -var fmt = plot.yTickFormat; +const fmt = plot.yTickFormat; // returns ``` @@ -792,20 +792,20 @@ var fmt = plot.yTickFormat; Number of `x`-axis tick marks. To set the number of tick marks, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xNumTicks = 10; // Get: -var numTicks = plot.xNumTicks; +const numTicks = plot.xNumTicks; // returns 10 ``` If the value is set to `null`, the number of tick marks is computed internally. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xNumTicks = null; ``` @@ -817,20 +817,20 @@ plot.xNumTicks = null; Number of `y`-axis tick marks. To set the number of tick marks, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yNumTicks = 5; // Get: -var numTicks = plot.yNumTicks; +const numTicks = plot.yNumTicks; // returns 5 ``` If the value is set to `null`, the number of tick marks is computed internally. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yNumTicks = null; ``` @@ -847,13 +847,13 @@ plot.yNumTicks = null; To set the orientation, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xAxisOrient = 'top'; // Get: -var orient = plot.xAxisOrient; +const orient = plot.xAxisOrient; // returns 'top' ``` @@ -869,13 +869,13 @@ var orient = plot.xAxisOrient; To set the orientation, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yAxisOrient = 'right'; // Get: -var orient = plot.yAxisOrient; +const orient = plot.yAxisOrient; // returns 'right' ``` @@ -886,20 +886,20 @@ var orient = plot.yAxisOrient; Boolean flag(s) indicating whether to display a rug plot along the `x`-axis. To set the for flag all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xRug = true; // Get: -var flgs = plot.xRug; +const flgs = plot.xRug; // returns [true] ``` To specify the flag for each dataset, provide an `array` of `booleans`. During plot creation, each plotted dataset is assigned a flag. If the number of flags is less than the number of plotted datasets, flags are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xRug = [ true, // assigned to datasets 0,2,4,... @@ -914,20 +914,20 @@ plot.xRug = [ Boolean flag(s) indicating whether to display a rug plot along the `y`-axis. To set the for flag all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yRug = true; // Get: -var flgs = plot.yRug; +const flgs = plot.yRug; // returns [true] ``` To specify the flag for each dataset, provide an `array` of `booleans`. During plot creation, each plotted dataset is assigned a flag. If the number of flags is less than the number of plotted datasets, flags are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yRug = [ false, // assigned to datasets 0,2,4,... @@ -947,20 +947,20 @@ plot.yRug = [ To set the orientation for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xRugOrient = 'top'; // Get: -var orient = plot.xRugOrient; +const orient = plot.xRugOrient; // returns ['top'] ``` To specify the `x`-axis rug orientation for each dataset, provide an `array` of orientations. During plot creation, each plotted dataset is assigned an orientation. If the number of orientations is less than the number of plotted datasets, orientations are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xRugOrient = [ 'bottom', // assigned to datasets 0,2,4,... @@ -980,20 +980,20 @@ plot.xRugOrient = [ To set the orientation for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yRugOrient = 'right'; // Get: -var orient = plot.yRugOrient; +const orient = plot.yRugOrient; // returns ['right'] ``` To specify the `y`-axis rug orientation for each dataset, provide an `array` of orientations. During plot creation, each plotted dataset is assigned an orientation. If the number of orientations is less than the number of plotted datasets, orientations are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yRugOrient = [ 'left', // assigned to datasets 0,2,4,... @@ -1008,20 +1008,20 @@ plot.yRugOrient = [ `x`-axis rug opacity, where an opacity of `0.0` makes a rug completely transparent and an opacity of `1.0` makes a rug completely opaque. To set the opacity for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xRugOpacity = 0.2; // Get: -var opacity = plot.xRugOpacity; +const opacity = plot.xRugOpacity; // returns [0.2] ``` To specify the `x`-axis rug opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xRugOpacity = [ 0.1, // assigned to datasets 0,2,4,... @@ -1036,20 +1036,20 @@ plot.xRugOpacity = [ `y`-axis rug opacity, where an opacity of `0.0` makes a rug completely transparent and an opacity of `1.0` makes a rug completely opaque. To set the opacity for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yRugOpacity = 0.4; // Get: -var opacity = plot.yRugOpacity; +const opacity = plot.yRugOpacity; // returns [0.4] ``` To specify the `y`-axis rug opacity for each dataset, provide an `array` of opacities. During plot creation, each plotted dataset is assigned an opacity. If the number of opacities is less than the number of plotted datasets, opacities are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yRugOpacity = [ 0.7, // assigned to datasets 0,2,4,... @@ -1064,20 +1064,20 @@ plot.yRugOpacity = [ `x`-axis rug tick (tassel) size. To set the tick size for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xRugSize = 4; // Get: -var size = plot.xRugSize; +const size = plot.xRugSize; // returns [4] ``` To specify the `x`-axis rug size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a tick size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.xRugSize = [ 4, // assigned to datasets 0,3,6,... @@ -1093,20 +1093,20 @@ plot.xRugSize = [ `y`-axis rug tick (tassel) size. To set the tick size for all plotted datasets, ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yRugSize = 4; // Get: -var size = plot.yRugSize; +const size = plot.yRugSize; // returns [4] ``` To specify the `y`-axis rug size for each dataset, provide an `array` of sizes. During plot creation, each plotted dataset is assigned a tick size. If the number of sizes is less than the number of plotted datasets, sizes are reused using modulo arithmetic. ```javascript -var plot = new Plot(); +const plot = new Plot(); plot.yRugSize = [ 6, // assigned to datasets 0,3,6,... @@ -1122,13 +1122,13 @@ plot.yRugSize = [ Plot description. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.description = 'A plot of `x` vs `y`.'; // Get: -var desc = plot.description; +const desc = plot.description; // returns 'A plot of `x` vs `y`.' ``` @@ -1139,13 +1139,13 @@ var desc = plot.description; Plot title. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.title = 'Time Series'; // Get: -var title = plot.title; +const title = plot.title; // returns 'Time Series' ``` @@ -1156,13 +1156,13 @@ var title = plot.title; `x`-axis label. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.xLabel = 'time'; // Get: -var label = plot.xLabel; +const label = plot.xLabel; // returns 'time' ``` @@ -1173,13 +1173,13 @@ var label = plot.xLabel; `y`-axis label. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.yLabel = 'value'; // Get: -var label = plot.yLabel; +const label = plot.yLabel; // returns 'value' ``` @@ -1192,13 +1192,13 @@ Plot rendering engine. The following engines are supported: - `'svg'` ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.engine = 'svg'; // Get: -var engine = plot.engine; +const engine = plot.engine; // returns 'svg' ``` @@ -1212,13 +1212,13 @@ Plot render format. The following formats are supported: - `'html'` ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.renderFormat = 'html'; // Get: -var fmt = plot.renderFormat; +const fmt = plot.renderFormat; // returns 'html' ``` @@ -1229,13 +1229,13 @@ var fmt = plot.renderFormat; Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.autoRender = false; // Get: -var mode = plot.autoRender; +const mode = plot.autoRender; // returns false ``` @@ -1251,13 +1251,13 @@ Plot viewer. The following viewers are supported: - `'browser'` ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.viewer = 'window'; // Get: -var viewer = plot.viewer; +const viewer = plot.viewer; // returns 'window' ``` @@ -1268,13 +1268,13 @@ var viewer = plot.viewer; Viewer mode. If `true`, an instance generates an updated view on each `'render'` event; otherwise, generating a view must be triggered manually. ```javascript -var plot = new Plot(); +const plot = new Plot(); // Set: plot.autoView = true; // Get: -var mode = plot.autoView; +const mode = plot.autoView; // returns true ``` @@ -1289,12 +1289,12 @@ var mode = plot.autoView; Returns the expected graph width. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'width': 100, 'paddingLeft': 20, 'paddingRight': 10 }); -var width = plot.graphWidth; +const width = plot.graphWidth; // returns 70 ``` @@ -1305,12 +1305,12 @@ var width = plot.graphWidth; Returns the expected graph height. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'height': 500, 'paddingTop': 10, 'paddingBottom': 120 }); -var height = plot.graphHeight; +const height = plot.graphHeight; // returns 370 ``` @@ -1321,11 +1321,11 @@ var height = plot.graphHeight; Returns the `x`-axis domain. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'xMin': -1.0, 'xMax': 1.0 }); -var domain = plot.xDomain; +const domain = plot.xDomain; // returns [-1.0,1.0] ``` @@ -1336,11 +1336,11 @@ var domain = plot.xDomain; Returns the `y`-axis domain. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'yMin': 0.0, 'yMax': 100.0 }); -var domain = plot.yDomain; +const domain = plot.yDomain; // returns [0.0,100.0] ``` @@ -1351,12 +1351,12 @@ var domain = plot.yDomain; Returns the `x`-axis range. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'width': 100, 'paddingLeft': 10, 'paddingRight': 10 }); -var range = plot.xRange; +const range = plot.xRange; // returns [0,80] ``` @@ -1367,12 +1367,12 @@ var range = plot.xRange; Returns the `y`-axis range. ```javascript -var plot = new Plot({ +const plot = new Plot({ 'height': 500, 'paddingTop': 10, 'paddingBottom': 120 }); -var range = plot.yRange; +const range = plot.yRange; // returns [370,0] ``` @@ -1383,8 +1383,8 @@ var range = plot.yRange; Returns a `function` to map values to `x`-axis coordinate values. ```javascript -var plot = new Plot(); -var xPos = plot.xPos; +const plot = new Plot(); +const xPos = plot.xPos; // returns ``` @@ -1395,8 +1395,8 @@ var xPos = plot.xPos; Returns a `function` to map values to `y`-axis coordinate values. ```javascript -var plot = new Plot(); -var yPos = plot.yPos; +const plot = new Plot(); +const yPos = plot.yPos; // returns ``` @@ -1413,26 +1413,21 @@ var yPos = plot.yPos; ```javascript -var randn = require( '@stdlib/random/base/box-muller' ); -var Float64Array = require( '@stdlib/array/float64' ); -var plot = require( '@stdlib/plot/ctor' ); - -var now; -var x; -var y; -var i; +const randn = require( '@stdlib/random/base/box-muller' ); +const Float64Array = require( '@stdlib/array/float64' ); +const plot = require( '@stdlib/plot/ctor' ); // Create some data... -now = ( new Date() ).getTime(); -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const now = ( new Date() ).getTime(); +const x = new Float64Array( 100 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = now + (i*360000); y[ i ] = 50.0 + (10.0*randn()); } // Create a new plot: -var h = plot( [x], [y], { +const h = plot( [x], [y], { 'width': 600, 'height': 480, 'xScale': 'time', @@ -1442,11 +1437,11 @@ var h = plot( [x], [y], { }); // Render as a virtual DOM tree: -var vtree = h.render( 'vdom' ); +const vtree = h.render( 'vdom' ); console.log( JSON.stringify( vtree ) ); // Render as HTML: -var html = h.render(); +const html = h.render(); console.log( html ); // Listen for 'render' events (e.g., when triggered due to changes in state): diff --git a/lib/node_modules/@stdlib/plot/sparklines/README.md b/lib/node_modules/@stdlib/plot/sparklines/README.md index 1b1bf459fe9c..df6e70186d9e 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/plot/sparklines' ); +const ns = require( '@stdlib/plot/sparklines' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/plot/sparklines' ); Namespace for sparkline functionality. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -63,8 +63,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/plot/sparklines' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/plot/sparklines' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/plot/sparklines/base/README.md b/lib/node_modules/@stdlib/plot/sparklines/base/README.md index d5c620933e47..53036596b85b 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/base/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/plot/sparklines/base' ); +const ns = require( '@stdlib/plot/sparklines/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/plot/sparklines/base' ); Namespace containing "base" (i.e., lower-level) sparkline functionality. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -62,8 +62,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/plot/sparklines/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/plot/sparklines/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/plot/sparklines/base/ctor/README.md b/lib/node_modules/@stdlib/plot/sparklines/base/ctor/README.md index adcd9d3caef6..cadf6ea6308c 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/base/ctor/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/base/ctor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); +const Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); ``` #### Sparkline( \[data,] \[options] ) @@ -35,7 +35,7 @@ var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); Returns a `sparkline` instance. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // returns ``` @@ -59,13 +59,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.autoRender = false; // Get: -var mode = sparkline.autoRender; +const mode = sparkline.autoRender; // returns false ``` @@ -76,18 +76,18 @@ var mode = sparkline.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.bufferSize = 3; // Get: -var size = sparkline.bufferSize; +const size = sparkline.bufferSize; // returns 3 sparkline.data = [ 1, 2, 3 ]; -var data = sparkline.data; +let data = sparkline.data; // returns [ 1, 2, 3 ] sparkline.push( 4 ); @@ -105,15 +105,15 @@ Setting a data buffer size is useful when rendering data streams. Sparkline data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.data = new Float32Array( [ 3.14, 5.0, -3.14, -1.0 ] ); // Get: -var data = sparkline.data; +const data = sparkline.data; // returns [ ~3.14, 5.0, ~-3.14, -1.0 ] ``` @@ -126,13 +126,13 @@ Note that data is **copied** to an internal data buffer. Sparkline description. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.description = 'Daily stock prices for the past 30 days.'; // Get: -var desc = sparkline.description; +const desc = sparkline.description; // returns 'Daily stock prices for the past 30 days.' ``` @@ -150,13 +150,13 @@ function isDefined( d ) { return ( d !== null ); } -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.isDefined = isDefined; // Get: -var fcn = sparkline.isDefined; +const fcn = sparkline.isDefined; // returns ``` @@ -169,13 +169,13 @@ The default behavior is to ignore values which are `NaN`. Data label. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.label = 'beep'; // Get: -var label = sparkline.label; +const label = sparkline.label; // returns 'beep' ``` @@ -190,13 +190,13 @@ var label = sparkline.label; Appends data to a sparkline. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); // Set: sparkline.data = [ 1, 2, 3 ]; // Get: -var data = sparkline.data; +let data = sparkline.data; // returns [ 1, 2, 3 ] sparkline.push( 4 ); @@ -218,7 +218,7 @@ function render() { return '▁█▅▃▆▆▅'; } -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); sparkline._render = render; ``` @@ -236,11 +236,11 @@ function render() { return '▁█▅▃▆▆▅'; } -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); sparkline._render = render; -var str = sparkline.render(); +const str = sparkline.render(); // returns '▁█▅▃▆▆▅' ``` @@ -259,11 +259,11 @@ function render() { return '▁█▅▃▆▆▅'; } -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); sparkline._render = render; -var str = sparkline.toString(); +const str = sparkline.toString(); // returns '▁█▅▃▆▆▅' ``` @@ -276,7 +276,7 @@ var str = sparkline.toString(); Emitted whenever a property value changes. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); sparkline.on( 'change', onChange ); @@ -290,7 +290,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var sparkline = new Sparkline(); +const sparkline = new Sparkline(); sparkline.on( 'render', onRender ); @@ -314,8 +314,8 @@ function onRender( str ) { ```javascript -var inherit = require( '@stdlib/utils/inherit' ); -var Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); +const inherit = require( '@stdlib/utils/inherit' ); +const Sparkline = require( '@stdlib/plot/sparklines/base/ctor' ); // Define a chart constructor: function Chart( opts ) { @@ -333,11 +333,10 @@ inherit( Chart, Sparkline ); // Implement a custom render method: Chart.prototype._render = function render() { - var str; - var i; + let str; str = ''; - for ( i = 0; i < this._data.length; i++ ) { + for ( let i = 0; i < this._data.length; i++ ) { if ( this._data[ i ] > 0 ) { str += '↑'; } else { @@ -348,7 +347,7 @@ Chart.prototype._render = function render() { }; // Create a new chart instance: -var chart = new Chart(); +const chart = new Chart(); // Set chart data: chart.data = [ 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0 ]; diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/README.md index f65b1ecff270..7a96435c3d4f 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UnicodeSparkline = require( '@stdlib/plot/sparklines/unicode' ); +const UnicodeSparkline = require( '@stdlib/plot/sparklines/unicode' ); ``` #### UnicodeSparkline( \[data,] \[options] ) @@ -35,7 +35,7 @@ var UnicodeSparkline = require( '@stdlib/plot/sparklines/unicode' ); Returns a chart instance. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); ``` The constructor accepts the following `options`: @@ -62,13 +62,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -79,18 +79,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -108,15 +108,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ 3.14, 5.0, -3.14, -1.0 ] ``` @@ -129,13 +129,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.description = 'Daily stock prices for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Daily stock prices for the past 30 days.' ``` @@ -146,7 +146,7 @@ var desc = chart.description; `Boolean` flag indicating whether to render infinite values. For certain chart types, when set to `false`, infinite values are considered missing values. Otherwise, for those same chart types, both positive and negative infinity are encoded as `∞`. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); chart.infinities = true; @@ -160,7 +160,7 @@ chart.data = [ 3.0 ]; -var str = chart.render(); +const str = chart.render(); // returns '▁█ ∞▆∞▅' ``` @@ -178,13 +178,13 @@ function isDefined( d ) { return ( d !== null ); } -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -197,13 +197,13 @@ The default behavior is **dependent** on the chart type. Data label. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -214,13 +214,13 @@ var label = chart.label; Chart type. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); // Set: chart.type = 'line'; // Get: -var type = chart.type; +const type = chart.type; // returns 'line' ``` @@ -239,11 +239,11 @@ The following chart types are supported: Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. ```javascript -var chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMin = 0.0; -var str = chart.render(); +const str = chart.render(); // returns '▁█▁▄▁▇▅' ``` @@ -254,11 +254,11 @@ var str = chart.render(); Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. ```javascript -var chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new UnicodeSparkline( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMax = 10.0; -var str = chart.render(); +const str = chart.render(); // returns '▃▆▂▄▁▅▅' ``` @@ -273,9 +273,9 @@ var str = chart.render(); Appends data to a chart. ```javascript -var chart = new UnicodeSparkline( [ 1, 2, 3 ] ); +const chart = new UnicodeSparkline( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -291,9 +291,9 @@ data = chart.data; Renders a Unicode sparkline. ```javascript -var chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.render(); +let str = chart.render(); // returns '▁█▅▃▆▆▅' // Render a line chart from the same data: @@ -310,9 +310,9 @@ str = chart.render(); Serializes a Unicode sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new UnicodeSparkline( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '▁█▅▃▆▆▅' ``` @@ -325,7 +325,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); chart.on( 'change', onChange ); @@ -339,7 +339,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new UnicodeSparkline(); +const chart = new UnicodeSparkline(); chart.on( 'render', onRender ); @@ -369,24 +369,19 @@ function onRender( str ) { ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var sparkline = require( '@stdlib/plot/sparklines/unicode' ); - -var chart; -var data; -var id; -var i; +const stdout = require( '@stdlib/streams/node/stdout' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const sparkline = require( '@stdlib/plot/sparklines/unicode' ); // Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Float64Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = randu() * 100.0; } // Create a sparkline chart: -chart = sparkline( data ); +const chart = sparkline( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -400,7 +395,7 @@ chart.yMin = 0.0; chart.yMax = 100.0; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/column/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/column/README.md index fe23713e9ade..4ecb013a3b99 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/column/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/column/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ColumnChart = require( '@stdlib/plot/sparklines/unicode/column' ); +const ColumnChart = require( '@stdlib/plot/sparklines/unicode/column' ); ``` #### ColumnChart( \[data,] \[options] ) @@ -35,7 +35,7 @@ var ColumnChart = require( '@stdlib/plot/sparklines/unicode/column' ); Returns a chart instance. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); ``` The constructor accepts the following `options`: @@ -61,13 +61,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -78,18 +78,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -107,15 +107,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ 3.14, 5.0, -3.14, -1.0 ] ``` @@ -128,13 +128,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.description = 'Daily stock prices for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Daily stock prices for the past 30 days.' ``` @@ -145,7 +145,7 @@ var desc = chart.description; `Boolean` flag indicating whether to render infinite values. When set to `false`, infinite values are considered missing values. When set to `true`, both positive and negative infinity are encoded as `∞`. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); chart.infinities = true; @@ -159,7 +159,7 @@ chart.data = [ 3.0 ]; -var str = chart.render(); +const str = chart.render(); // returns '▁█ ∞▆∞▅' ``` @@ -177,13 +177,13 @@ function isDefined( d ) { return ( d !== null ); } -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -196,13 +196,13 @@ The default behavior is to ignore values which are `NaN`. Data label. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -213,11 +213,11 @@ var label = chart.label; Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. ```javascript -var chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMin = 0.0; -var str = chart.render(); +const str = chart.render(); // returns '▁█▁▄▁▇▅' ``` @@ -228,11 +228,11 @@ var str = chart.render(); Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. ```javascript -var chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new ColumnChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMax = 10.0; -var str = chart.render(); +const str = chart.render(); // returns '▃▆▂▄▁▅▅' ``` @@ -247,9 +247,9 @@ var str = chart.render(); Appends data to a chart. ```javascript -var chart = new ColumnChart( [ 1, 2, 3 ] ); +const chart = new ColumnChart( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -265,9 +265,9 @@ data = chart.data; Renders a column chart sparkline. ```javascript -var chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.render(); +const str = chart.render(); // returns '▁█▅▃▆▆▅' ``` @@ -278,9 +278,9 @@ var str = chart.render(); Serializes a column chart sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new ColumnChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '▁█▅▃▆▆▅' ``` @@ -293,7 +293,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); chart.on( 'change', onChange ); @@ -307,7 +307,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new ColumnChart(); +const chart = new ColumnChart(); chart.on( 'render', onRender ); @@ -337,24 +337,19 @@ function onRender( str ) { ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var columnChart = require( '@stdlib/plot/sparklines/unicode/column' ); - -var chart; -var data; -var id; -var i; +const stdout = require( '@stdlib/streams/node/stdout' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const columnChart = require( '@stdlib/plot/sparklines/unicode/column' ); // Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Float64Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = randu() * 100.0; } // Create a new column chart: -chart = columnChart( data ); +const chart = columnChart( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -368,7 +363,7 @@ chart.yMin = 0.0; chart.yMax = 100.0; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/README.md index bf476f0dd54f..e964f903248d 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var LineChart = require( '@stdlib/plot/sparklines/unicode/line' ); +const LineChart = require( '@stdlib/plot/sparklines/unicode/line' ); ``` #### LineChart( \[data,] \[options] ) @@ -35,7 +35,7 @@ var LineChart = require( '@stdlib/plot/sparklines/unicode/line' ); Returns a chart instance. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); ``` The constructor accepts the following `options`: @@ -61,13 +61,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -78,18 +78,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -107,15 +107,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.data = new Float64Array( [ 3.14, 5.0, -3.14, -1.0 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ 3.14, 5.0, -3.14, -1.0 ] ``` @@ -128,13 +128,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.description = 'Daily stock prices for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Daily stock prices for the past 30 days.' ``` @@ -145,7 +145,7 @@ var desc = chart.description; `Boolean` flag indicating whether to render infinite values. When set to `false`, infinite values are considered missing values. When set to `true`, both positive and negative infinity are encoded as `∞`. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); chart.infinities = true; @@ -159,7 +159,7 @@ chart.data = [ 3.0 ]; -var str = chart.render(); +const str = chart.render(); // returns '⡈⠉ ∞⢂∞⠒' ``` @@ -177,13 +177,13 @@ function isDefined( d ) { return ( d !== null ); } -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -196,13 +196,13 @@ The default behavior is to ignore values which are `NaN`. Data label. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -213,11 +213,11 @@ var label = chart.label; Minimum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis lower bound is fixed; otherwise, the minimum value is computed from the chart data. ```javascript -var chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMin = 0.0; -var str = chart.render(); +const str = chart.render(); // returns '⡈⢁⡠⢄⡐⠒⠒' ``` @@ -228,11 +228,11 @@ var str = chart.render(); Maximum value of the y-axis domain. If this value is set to a value other than `null`, the y-axis upper bound is fixed; otherwise, the maximum value is computed based on the chart data. ```javascript -var chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); +const chart = new LineChart( [ -1.0, 5.0, -3.0, 2.0, -4.0, 4.0, 3.0 ] ); chart.yMax = 10.0; -var str = chart.render(); +const str = chart.render(); // returns '⠔⢂⡠⢄⡐⠒⠒' ``` @@ -247,9 +247,9 @@ var str = chart.render(); Appends data to a chart. ```javascript -var chart = new LineChart( [ 1, 2, 3 ] ); +const chart = new LineChart( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -265,9 +265,9 @@ data = chart.data; Renders a line chart sparkline. ```javascript -var chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.render(); +const str = chart.render(); // returns '⡈⠑⠢⠔⠒⠒⠒' ``` @@ -278,9 +278,9 @@ var str = chart.render(); Serializes a line chart sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); +const chart = new LineChart( [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '⡈⠑⠢⠔⠒⠒⠒' ``` @@ -293,7 +293,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); chart.on( 'change', onChange ); @@ -307,7 +307,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new LineChart(); +const chart = new LineChart(); chart.on( 'render', onRender ); @@ -337,24 +337,19 @@ function onRender( str ) { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var lineChart = require( '@stdlib/plot/sparklines/unicode/line' ); - -var chart; -var data; -var id; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const lineChart = require( '@stdlib/plot/sparklines/unicode/line' ); // Generate some random data... -data = new Float64Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Float64Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = randu() * 100.0; } // Create a new line chart: -chart = lineChart( data ); +const chart = lineChart( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -368,7 +363,7 @@ chart.yMin = 0.0; chart.yMax = 100.0; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/README.md index 3948886a9072..0be08291d8a1 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var TristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); +const TristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); ``` #### TristateChart( \[data,] \[options] ) @@ -35,7 +35,7 @@ var TristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); Returns a chart instance. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); ``` The constructor accepts the following `options`: @@ -58,13 +58,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -75,18 +75,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -104,15 +104,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.data = new Int8Array( [ 1, 0, -1, 1, 1, 0 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ 1, 0, -1, 1, 1, 0 ] ``` @@ -125,13 +125,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.description = 'Gains and losses for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Gains and losses for the past 30 days.' ``` @@ -149,13 +149,13 @@ function isDefined( d ) { return ( d !== null ); } -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -168,13 +168,13 @@ The default behavior is to ignore values which are `NaN`. Data label. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -189,9 +189,9 @@ var label = chart.label; Appends data to a chart. ```javascript -var chart = new TristateChart( [ 1, 2, 3 ] ); +const chart = new TristateChart( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -207,9 +207,9 @@ data = chart.data; Renders a tristate chart sparkline. ```javascript -var chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); +const chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); -var str = chart.render(); +const str = chart.render(); // returns '▄▀──▀▄▄▀' ``` @@ -222,9 +222,9 @@ In a tristate chart, negative values are encoded as lower blocks, positive value Serializes a tristate chart sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); +const chart = new TristateChart( [ -1, 1, 0, 0, 1, -1, -1, 1 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '▄▀──▀▄▄▀' ``` @@ -237,7 +237,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); chart.on( 'change', onChange ); @@ -251,7 +251,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new TristateChart(); +const chart = new TristateChart(); chart.on( 'render', onRender ); @@ -281,18 +281,13 @@ function onRender( str ) { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var tristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); - -var chart; -var data; -var id; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const Int8Array = require( '@stdlib/array/int8' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const tristateChart = require( '@stdlib/plot/sparklines/unicode/tristate' ); function datum() { - var d = randu(); + const d = randu(); if ( d > 0.67 ) { return 1; } @@ -303,13 +298,13 @@ function datum() { } // Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Int8Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = datum(); } // Create a new tristate chart: -chart = tristateChart( data ); +const chart = tristateChart( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -321,7 +316,7 @@ stdout.write( chart.render() ); chart.bufferSize = data.length; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/up-down/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/up-down/README.md index e64cc41bf3f7..de68be37e9a8 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/up-down/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/up-down/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var UpDownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); +const UpDownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); ``` #### UpDownChart( \[data,] \[options] ) @@ -35,7 +35,7 @@ var UpDownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); Returns a chart instance. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); ``` The constructor accepts the following `options`: @@ -58,13 +58,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -75,18 +75,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -104,15 +104,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.data = new Int8Array( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ -1, 1, 1, 1, 1, -1, -1, 1 ] ``` @@ -125,13 +125,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.description = 'Wins and losses for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Wins and losses for the past 30 days.' ``` @@ -150,13 +150,13 @@ function isDefined( d ) { return ( d === 1 ); } -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -169,13 +169,13 @@ The default behavior is to ignore any values which are not `1` or `-1`. Data label. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -190,9 +190,9 @@ var label = chart.label; Appends data to a chart. ```javascript -var chart = new UpDownChart( [ 1, 2, 3 ] ); +const chart = new UpDownChart( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -208,9 +208,9 @@ data = chart.data; Renders an up/down chart sparkline. ```javascript -var chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); +const chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); -var str = chart.render(); +const str = chart.render(); // returns '↓↑↑↑↑↓↓↑' ``` @@ -230,9 +230,9 @@ If provided any other value other than `1` or `-1`, the value is encoded as a mi Serializes an up/down chart sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); +const chart = new UpDownChart( [ -1, 1, 1, 1, 1, -1, -1, 1 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '↓↑↑↑↑↓↓↑' ``` @@ -245,7 +245,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); chart.on( 'change', onChange ); @@ -259,7 +259,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new UpDownChart(); +const chart = new UpDownChart(); chart.on( 'render', onRender ); @@ -289,18 +289,13 @@ function onRender( str ) { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var updownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); - -var chart; -var data; -var id; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const Int8Array = require( '@stdlib/array/int8' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const updownChart = require( '@stdlib/plot/sparklines/unicode/up-down' ); function datum() { - var d = randu(); + let d = randu(); if ( d > 0.75 ) { d = 1; } else { @@ -310,13 +305,13 @@ function datum() { } // Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Int8Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = datum(); } // Create a new up/down chart: -chart = updownChart( data ); +const chart = updownChart( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -328,7 +323,7 @@ stdout.write( chart.render() ); chart.bufferSize = data.length; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/win-loss/README.md b/lib/node_modules/@stdlib/plot/sparklines/unicode/win-loss/README.md index d4e8792eaff0..77b0ec745834 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/win-loss/README.md +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/win-loss/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var WinLossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); +const WinLossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); ``` #### WinLossChart( \[data,] \[options] ) @@ -35,7 +35,7 @@ var WinLossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); Returns a chart instance. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); ``` The constructor accepts the following `options`: @@ -58,13 +58,13 @@ The constructor accepts the following `options`: Rendering mode. If `true`, an instance renders on each `'change'` event; otherwise, rendering must be triggered manually. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.autoRender = false; // Get: -var mode = chart.autoRender; +const mode = chart.autoRender; // returns false ``` @@ -75,18 +75,18 @@ var mode = chart.autoRender; Data buffer size. If set, this specifies the maximum number of data elements which can be rendered. Once the data buffer is full, each new datum results in the oldest datum being removed. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.bufferSize = 3; // Get: -var size = chart.bufferSize; +const size = chart.bufferSize; // returns 3 chart.data = [ 1, 2, 3 ]; -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -104,15 +104,15 @@ Setting a data buffer size is useful when rendering data streams. Chart data. When set, the value must be either `array`-like or an [ndarray][@stdlib/ndarray/ctor] and cannot exceed the `bufferSize`. ```javascript -var Int8Array = require( '@stdlib/array/int8' ); +const Int8Array = require( '@stdlib/array/int8' ); -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.data = new Int8Array( [ -2, 1, 2, 2, 1, -1, -1, 1 ] ); // Get: -var data = chart.data; +const data = chart.data; // returns [ -2, 1, 2, 2, 1, -1, -1, 1 ] ``` @@ -125,13 +125,13 @@ Note that data is **copied** to an internal data buffer. Chart description. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.description = 'Wins and losses for the past 30 days.'; // Get: -var desc = chart.description; +const desc = chart.description; // returns 'Wins and losses for the past 30 days.' ``` @@ -150,13 +150,13 @@ function isDefined( d ) { return ( d !== -2 ); } -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.isDefined = isDefined; // Get: -var fcn = chart.isDefined; +const fcn = chart.isDefined; // returns ``` @@ -169,13 +169,13 @@ The default behavior is to ignore any values which are not `1`, `-1`, `2`, or `- Data label. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); // Set: chart.label = 'beep'; // Get: -var label = chart.label; +const label = chart.label; // returns 'beep' ``` @@ -190,9 +190,9 @@ var label = chart.label; Appends data to a chart. ```javascript -var chart = new WinLossChart( [ 1, 2, 3 ] ); +const chart = new WinLossChart( [ 1, 2, 3 ] ); -var data = chart.data; +let data = chart.data; // returns [ 1, 2, 3 ] chart.push( 4 ); @@ -208,9 +208,9 @@ data = chart.data; Renders a win/loss chart sparkline. ```javascript -var chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); +const chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); -var str = chart.render(); +const str = chart.render(); // returns '┌╵└┴╵╷╷╵┌┬' ``` @@ -246,9 +246,9 @@ If provided any value other than `1`, `-1`, `2`, or `-2`, the value is encoded a Serializes a win/loss chart sparkline as a `string` by calling the `render()` method. ```javascript -var chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); +const chart = new WinLossChart( [ -2, 1, 2, 2, 1, -1, -1, 1, -2, -2 ] ); -var str = chart.toString(); +const str = chart.toString(); // returns '┌╵└┴╵╷╷╵┌┬' ``` @@ -261,7 +261,7 @@ var str = chart.toString(); Emitted whenever a property value changes. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); chart.on( 'change', onChange ); @@ -275,7 +275,7 @@ function onChange() { Emitted whenever a sparkline is rendered. ```javascript -var chart = new WinLossChart(); +const chart = new WinLossChart(); chart.on( 'render', onRender ); @@ -305,19 +305,14 @@ function onRender( str ) { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int8Array = require( '@stdlib/array/int8' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var winlossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); - -var chart; -var data; -var id; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const Int8Array = require( '@stdlib/array/int8' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const winlossChart = require( '@stdlib/plot/sparklines/unicode/win-loss' ); // Based on GS Warriors winning percentages for 2015-2016... function datum() { - var d = randu(); + let d = randu(); if ( d > 0.5 ) { // home d = randu(); if ( d < 0.057 ) { // loss @@ -337,13 +332,13 @@ function datum() { } // Generate some random data... -data = new Int8Array( 50 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Int8Array( 50 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = datum(); } // Create a new win/loss chart: -chart = winlossChart( data ); +const chart = winlossChart( data ); // Hide the terminal cursor: stdout.write( '\u001b[?25l' ); @@ -355,7 +350,7 @@ stdout.write( chart.render() ); chart.bufferSize = data.length; // Update the terminal chart with new data every second: -id = setInterval( update, 1000 ); +const id = setInterval( update, 1000 ); // After some time, stop updating and close: setTimeout( stop, 20000 ); diff --git a/lib/node_modules/@stdlib/process/README.md b/lib/node_modules/@stdlib/process/README.md index a0f621f8aa33..560078abbfc2 100644 --- a/lib/node_modules/@stdlib/process/README.md +++ b/lib/node_modules/@stdlib/process/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/process' ); +const ns = require( '@stdlib/process' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/process' ); Namespace containing process utilities. ```javascript -var proc = ns; +const proc = ns; // returns {...} ``` @@ -75,8 +75,8 @@ The namespace contains process utilities: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/process' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/process' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/process/argv/README.md b/lib/node_modules/@stdlib/process/argv/README.md index 69b0a13fd8b3..921254bde561 100644 --- a/lib/node_modules/@stdlib/process/argv/README.md +++ b/lib/node_modules/@stdlib/process/argv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ARGV = require( '@stdlib/process/argv' ); +const ARGV = require( '@stdlib/process/argv' ); ``` #### ARGV @@ -35,7 +35,7 @@ var ARGV = require( '@stdlib/process/argv' ); `Array` containing command-line arguments passed when launching the calling process. ```javascript -var execPath = ARGV[ 0 ]; +const execPath = ARGV[ 0 ]; // e.g., returns '/usr/local/bin/node' ``` @@ -65,7 +65,7 @@ var execPath = ARGV[ 0 ]; ```javascript -var ARGV = require( '@stdlib/process/argv' ); +const ARGV = require( '@stdlib/process/argv' ); console.log( ARGV ); // => [...] diff --git a/lib/node_modules/@stdlib/process/chdir/README.md b/lib/node_modules/@stdlib/process/chdir/README.md index 8a5b32088efc..6bd4b5ac513d 100644 --- a/lib/node_modules/@stdlib/process/chdir/README.md +++ b/lib/node_modules/@stdlib/process/chdir/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chdir = require( '@stdlib/process/chdir' ); +const chdir = require( '@stdlib/process/chdir' ); ``` #### chdir( path ) @@ -37,7 +37,7 @@ Changes the current working directory to the specified `path`. ```javascript -var err = chdir( '/foo/bar' ); +const err = chdir( '/foo/bar' ); ``` If the function encounters an error when attempting to change the working directory, the function returns an `error`; otherwise, the function returns `null`. @@ -63,15 +63,15 @@ If the function encounters an error when attempting to change the working direct ```javascript -var cwd = require( '@stdlib/process/cwd' ); -var chdir = require( '@stdlib/process/chdir' ); +const cwd = require( '@stdlib/process/cwd' ); +const chdir = require( '@stdlib/process/chdir' ); // Print the current working directory: -var dir = cwd(); +const dir = cwd(); console.log( dir ); // Change the current working directory to the directory of this file: -var err = chdir( __dirname ); +let err = chdir( __dirname ); if ( err ) { console.error( err.message ); } diff --git a/lib/node_modules/@stdlib/process/cwd/README.md b/lib/node_modules/@stdlib/process/cwd/README.md index 2d35f4a71629..099f690e478a 100644 --- a/lib/node_modules/@stdlib/process/cwd/README.md +++ b/lib/node_modules/@stdlib/process/cwd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cwd = require( '@stdlib/process/cwd' ); +const cwd = require( '@stdlib/process/cwd' ); ``` #### cwd() @@ -35,7 +35,7 @@ var cwd = require( '@stdlib/process/cwd' ); Returns the current working directory. ```javascript -var dir = cwd(); +const dir = cwd(); // e.g., returns '/path/to/current/working/directory' ``` @@ -60,10 +60,10 @@ var dir = cwd(); ```javascript -var PATH_SEP = require( '@stdlib/constants/path/sep' ); -var cwd = require( '@stdlib/process/cwd' ); +const PATH_SEP = require( '@stdlib/constants/path/sep' ); +const cwd = require( '@stdlib/process/cwd' ); -var parts = cwd().split( PATH_SEP ); +const parts = cwd().split( PATH_SEP ); console.log( parts ); ``` diff --git a/lib/node_modules/@stdlib/process/env/README.md b/lib/node_modules/@stdlib/process/env/README.md index 35219d2f2961..0c7d9a677c4f 100644 --- a/lib/node_modules/@stdlib/process/env/README.md +++ b/lib/node_modules/@stdlib/process/env/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ENV = require( '@stdlib/process/env' ); +const ENV = require( '@stdlib/process/env' ); ``` #### ENV @@ -35,7 +35,7 @@ var ENV = require( '@stdlib/process/env' ); `Object` containing the user environment. ```javascript -var user = ENV.USER; +const user = ENV.USER; // returns ``` @@ -64,7 +64,7 @@ var user = ENV.USER; ```javascript -var ENV = require( '@stdlib/process/env' ); +const ENV = require( '@stdlib/process/env' ); console.dir( ENV ); ``` diff --git a/lib/node_modules/@stdlib/process/exec-path/README.md b/lib/node_modules/@stdlib/process/exec-path/README.md index 40c73bc2182e..d2cd75d06582 100644 --- a/lib/node_modules/@stdlib/process/exec-path/README.md +++ b/lib/node_modules/@stdlib/process/exec-path/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var EXEC_PATH = require( '@stdlib/process/exec-path' ); +const EXEC_PATH = require( '@stdlib/process/exec-path' ); ``` #### EXEC_PATH @@ -60,7 +60,7 @@ console.log( EXEC_PATH ); ```javascript -var EXEC_PATH = require( '@stdlib/process/exec-path' ); +const EXEC_PATH = require( '@stdlib/process/exec-path' ); if ( EXEC_PATH ) { console.log( 'Executable: %s', EXEC_PATH ); diff --git a/lib/node_modules/@stdlib/process/getegid/README.md b/lib/node_modules/@stdlib/process/getegid/README.md index 34bbe1bb6862..f20752747b76 100644 --- a/lib/node_modules/@stdlib/process/getegid/README.md +++ b/lib/node_modules/@stdlib/process/getegid/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getegid = require( '@stdlib/process/getegid' ); +const getegid = require( '@stdlib/process/getegid' ); ``` #### getegid() @@ -35,7 +35,7 @@ var getegid = require( '@stdlib/process/getegid' ); Returns the effective numeric group identity of the calling process. ```javascript -var id = getegid(); +const id = getegid(); ``` @@ -58,9 +58,9 @@ var id = getegid(); ```javascript -var getegid = require( '@stdlib/process/getegid' ); +const getegid = require( '@stdlib/process/getegid' ); -var gid = getegid(); +const gid = getegid(); console.log( 'gid: %d', gid ); ``` diff --git a/lib/node_modules/@stdlib/process/geteuid/README.md b/lib/node_modules/@stdlib/process/geteuid/README.md index 1e77e2650218..f62e789ae2ab 100644 --- a/lib/node_modules/@stdlib/process/geteuid/README.md +++ b/lib/node_modules/@stdlib/process/geteuid/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var geteuid = require( '@stdlib/process/geteuid' ); +const geteuid = require( '@stdlib/process/geteuid' ); ``` #### geteuid() @@ -35,7 +35,7 @@ var geteuid = require( '@stdlib/process/geteuid' ); Returns the effective numeric user identity of the calling process. ```javascript -var id = geteuid(); +const id = geteuid(); ``` @@ -58,9 +58,9 @@ var id = geteuid(); ```javascript -var geteuid = require( '@stdlib/process/geteuid' ); +const geteuid = require( '@stdlib/process/geteuid' ); -var uid = geteuid(); +const uid = geteuid(); if ( uid === 0 ) { console.log( 'Effectively running as root.' ); } else { diff --git a/lib/node_modules/@stdlib/process/getgid/README.md b/lib/node_modules/@stdlib/process/getgid/README.md index b072229fe3c8..67da1e67b179 100644 --- a/lib/node_modules/@stdlib/process/getgid/README.md +++ b/lib/node_modules/@stdlib/process/getgid/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getgid = require( '@stdlib/process/getgid' ); +const getgid = require( '@stdlib/process/getgid' ); ``` #### getgid() @@ -35,7 +35,7 @@ var getgid = require( '@stdlib/process/getgid' ); Returns the numeric group identity of the calling process. ```javascript -var id = getgid(); +const id = getgid(); ``` @@ -58,9 +58,9 @@ var id = getgid(); ```javascript -var getgid = require( '@stdlib/process/getgid' ); +const getgid = require( '@stdlib/process/getgid' ); -var gid = getgid(); +const gid = getgid(); console.log( 'gid: %d', gid ); ``` diff --git a/lib/node_modules/@stdlib/process/getuid/README.md b/lib/node_modules/@stdlib/process/getuid/README.md index 127ffe75610c..ff00e28166b3 100644 --- a/lib/node_modules/@stdlib/process/getuid/README.md +++ b/lib/node_modules/@stdlib/process/getuid/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getuid = require( '@stdlib/process/getuid' ); +const getuid = require( '@stdlib/process/getuid' ); ``` #### getuid() @@ -35,7 +35,7 @@ var getuid = require( '@stdlib/process/getuid' ); Returns the numeric user identity of the calling process. ```javascript -var id = getuid(); +const id = getuid(); ``` @@ -58,9 +58,9 @@ var id = getuid(); ```javascript -var getuid = require( '@stdlib/process/getuid' ); +const getuid = require( '@stdlib/process/getuid' ); -var uid = getuid(); +const uid = getuid(); if ( uid === 0 ) { console.log( 'Likely running as root.' ); } else { diff --git a/lib/node_modules/@stdlib/process/node-version/README.md b/lib/node_modules/@stdlib/process/node-version/README.md index 091b7de68445..72231817e5ba 100644 --- a/lib/node_modules/@stdlib/process/node-version/README.md +++ b/lib/node_modules/@stdlib/process/node-version/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var NODE_VERSION = require( '@stdlib/process/node-version' ); +const NODE_VERSION = require( '@stdlib/process/node-version' ); ``` #### NODE_VERSION @@ -60,8 +60,8 @@ console.log( NODE_VERSION ); ```javascript -var semver = require( 'semver' ); -var NODE_VERSION = require( '@stdlib/process/node-version' ); +const semver = require( 'semver' ); +const NODE_VERSION = require( '@stdlib/process/node-version' ); if ( semver.lt( NODE_VERSION, '1.0.0' ) ) { console.log( 'Running on a pre-io.js version...' ); diff --git a/lib/node_modules/@stdlib/process/read-stdin/README.md b/lib/node_modules/@stdlib/process/read-stdin/README.md index 3edf247bc7b5..d33f32e8aa7e 100644 --- a/lib/node_modules/@stdlib/process/read-stdin/README.md +++ b/lib/node_modules/@stdlib/process/read-stdin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stdin = require( '@stdlib/process/read-stdin' ); +const stdin = require( '@stdlib/process/read-stdin' ); ``` #### stdin( \[encoding,] clbk ) @@ -69,7 +69,7 @@ When a file's calling Node.js process is running in a [TTY][tty] context (i.e., ```javascript -var stream = require( '@stdlib/streams/node/stdin' ); +const stream = require( '@stdlib/streams/node/stdin' ); function onRead( error, data ) { if ( error ) { @@ -97,9 +97,9 @@ stdin( 'utf8', onRead ); ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); -var stream = require( '@stdlib/streams/node/stdin' ); -var stdin = require( '@stdlib/process/read-stdin' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); +const stream = require( '@stdlib/streams/node/stdin' ); +const stdin = require( '@stdlib/process/read-stdin' ); function onRead( error, data ) { if ( error ) { diff --git a/lib/node_modules/@stdlib/process/umask/README.md b/lib/node_modules/@stdlib/process/umask/README.md index ef6b92b07cde..01ed481c2066 100644 --- a/lib/node_modules/@stdlib/process/umask/README.md +++ b/lib/node_modules/@stdlib/process/umask/README.md @@ -116,7 +116,7 @@ The `a` class indicates "all", which is the same as specifying `ugo`. This is th ## Usage ```javascript -var umask = require( '@stdlib/process/umask' ); +const umask = require( '@stdlib/process/umask' ); ``` #### umask( \[mask,] \[options] ) @@ -124,27 +124,27 @@ var umask = require( '@stdlib/process/umask' ); Returns the process mask. ```javascript -var mask = umask(); +const mask = umask(); // returns ``` To set the process mask, provide a `mask` argument. When provided a `mask`, the function returns the previous mask value. ```javascript -var mask = umask(); +const mask = umask(); // returns -var prev = umask( 0 ); +const prev = umask( 0 ); // returns -var bool = ( prev === mask ); +const bool = ( prev === mask ); // returns true ``` The `mask` argument may be either an integer value or a `string` representing the mask using symbolic notation. ```javascript -var mask = umask( 'u=rwx,g=rw,o=rw' ); +const mask = umask( 'u=rwx,g=rw,o=rw' ); ``` The function accepts the following `options`: @@ -154,12 +154,12 @@ The function accepts the following `options`: To return the process mask in symbolic notation, set the `symbolic` option to `true`. ```javascript -var opts = { +const opts = { 'symbolic': true }; // Get the mask: -var mask = umask( opts ); +let mask = umask( opts ); // e.g., returns 'u=rwx,g=rw,o=rw' // Set the mask: @@ -194,18 +194,18 @@ mask = umask( 0, opts ); ```javascript -var lpad = require( '@stdlib/string/left-pad' ); -var umask = require( '@stdlib/process/umask' ); +const lpad = require( '@stdlib/string/left-pad' ); +const umask = require( '@stdlib/process/umask' ); // Print the process mask as an integer: -var mask = umask(); +const mask = umask(); console.log( mask.toString() ); // Print the process mask as an octal string: console.log( lpad( mask.toString(), 4, '0' ) ); // Print the process mask using symbolic notation: -var opts = { +const opts = { 'symbolic': true }; console.log( umask( opts ) ); diff --git a/lib/node_modules/@stdlib/proxy/README.md b/lib/node_modules/@stdlib/proxy/README.md index e31008653b09..355187dc6232 100644 --- a/lib/node_modules/@stdlib/proxy/README.md +++ b/lib/node_modules/@stdlib/proxy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/proxy' ); +const ns = require( '@stdlib/proxy' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/proxy' ); Proxy namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/proxy' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/proxy' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/proxy/ctor/README.md b/lib/node_modules/@stdlib/proxy/ctor/README.md index 171025dd3edf..82bac9f08521 100644 --- a/lib/node_modules/@stdlib/proxy/ctor/README.md +++ b/lib/node_modules/@stdlib/proxy/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Proxy = require( '@stdlib/proxy/ctor' ); +const Proxy = require( '@stdlib/proxy/ctor' ); ``` #### Proxy( target, handlers ) @@ -49,15 +49,15 @@ function get( target, property ) { return target[ property ] * 2.0; } -var handlers = { +const handlers = { 'get': get }; -var p = new Proxy( {}, handlers ); +const p = new Proxy( {}, handlers ); p.a = 3.14; -var v = p.a; +const v = p.a; // returns 6.28 ``` @@ -138,17 +138,12 @@ All traps are **optional**. If a trap is not defined, the default behavior is to ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Proxy = require( '@stdlib/proxy/ctor' ); - -var handlers; -var arr; -var p; -var i; +const Float64Array = require( '@stdlib/array/float64' ); +const Proxy = require( '@stdlib/proxy/ctor' ); // Create a new typed array: -arr = new Float64Array( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Float64Array( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = i; } @@ -161,15 +156,15 @@ function get( obj, prop ) { } // Define the proxy handlers: -handlers = { +const handlers = { 'get': get }; // Create a proxy: -p = new Proxy( arr, handlers ); +const p = new Proxy( arr, handlers ); // Access array values... -for ( i = 0; i < p.length; i++ ) { +for ( let i = 0; i < p.length; i++ ) { console.log( 'arr[%d] = %d', i, p[ i ] ); } ``` diff --git a/lib/node_modules/@stdlib/random/README.md b/lib/node_modules/@stdlib/random/README.md index 14c7057be530..714a89018e0d 100644 --- a/lib/node_modules/@stdlib/random/README.md +++ b/lib/node_modules/@stdlib/random/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var random = require( '@stdlib/random' ); +const random = require( '@stdlib/random' ); ``` #### random @@ -35,7 +35,7 @@ var random = require( '@stdlib/random' ); Namespace containing random number functionality. ```javascript -var rand = random; +const rand = random; // returns {...} ``` @@ -81,8 +81,8 @@ It also contains the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/random' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/random' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/random/array/README.md b/lib/node_modules/@stdlib/random/array/README.md index 4e4468408c81..588bfb875a13 100644 --- a/lib/node_modules/@stdlib/random/array/README.md +++ b/lib/node_modules/@stdlib/random/array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/array' ); +const ns = require( '@stdlib/random/array' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/array' ); Namespace containing array creation pseudorandom number generator (PRNG) functions. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -98,10 +98,10 @@ The namespace contains the following: ```javascript -var ns = require( '@stdlib/random/array' ); +const ns = require( '@stdlib/random/array' ); // Generate arrays with ten random numbers drawn from the respective distributions: -var out = ns.arcsine( 10, 2.0, 5.0 ); +let out = ns.arcsine( 10, 2.0, 5.0 ); // returns out = ns.weibull( 10, 2.0, 5.0 ); @@ -113,7 +113,7 @@ out = ns.laplace( 10, 2.0, 5.0 ); // Factory methods: // 1. Basic factory usage (no parameters): -var random = ns.arcsine.factory(); +let random = ns.arcsine.factory(); out = random( 10, 2.0, 5.0 ); // returns diff --git a/lib/node_modules/@stdlib/random/array/arcsine/README.md b/lib/node_modules/@stdlib/random/array/arcsine/README.md index 84637b3ec46c..39790e8cee88 100644 --- a/lib/node_modules/@stdlib/random/array/arcsine/README.md +++ b/lib/node_modules/@stdlib/random/array/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arcsine = require( '@stdlib/random/array/arcsine' ); +const arcsine = require( '@stdlib/random/array/arcsine' ); ``` #### arcsine( len, a, b\[, options] ) @@ -35,7 +35,7 @@ var arcsine = require( '@stdlib/random/array/arcsine' ); Returns an array containing pseudorandom numbers drawn from an [arcsine][@stdlib/random/base/arcsine] distribution. ```javascript -var out = arcsine( 10, 2.0, 5.0 ); +const out = arcsine( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = arcsine( 10, 2.0, 5.0, opts ); +const out = arcsine( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = arcsine( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from an [arcsine][@stdlib/random/base/arcsine] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = arcsine.assign( 2.0, 5.0, x ); +const out = arcsine.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from an [arcsine][@stdlib/random/base/arcsine] distribution. ```javascript -var random = arcsine.factory(); +const random = arcsine.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = arcsine.factory( 2.0, 5.0 ); +const random = arcsine.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = arcsine.factory(); +const random = arcsine.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = arcsine.factory( 2.0, 5.0, opts ); +const random = arcsine.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = arcsine.factory( 2.0, 5.0, opts ); +const random = arcsine.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = arcsine.factory( 2.0, 5.0 ); +const random = arcsine.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = arcsine.PRNG; +const prng = arcsine.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = arcsine.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = arcsine.seed; +const seed = arcsine.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = arcsine.factory( 2.0, 5.0, { +const random = arcsine.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = arcsine.seedLength; +const len = arcsine.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = arcsine.factory( 2.0, 5.0, { +const random = arcsine.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = arcsine.state; +const state = arcsine.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = arcsine.factory( 2.0, 5.0, { +const random = arcsine.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = arcsine.stateLength; +const len = arcsine.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = arcsine.factory( 2.0, 5.0, { +const random = arcsine.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = arcsine.byteLength; +const sz = arcsine.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = arcsine.factory( 2.0, 5.0, { +const random = arcsine.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var arcsine = require( '@stdlib/random/array/arcsine' ); +const logEach = require( '@stdlib/console/log-each' ); +const arcsine = require( '@stdlib/random/array/arcsine' ); // Create a function for generating random arrays originating from the same state: -var random = arcsine.factory( 2.0, 5.0, { +let random = arcsine.factory( 2.0, 5.0, { 'state': arcsine.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = arcsine.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/bernoulli/README.md b/lib/node_modules/@stdlib/random/array/bernoulli/README.md index f779235c137f..ff1d6da7fd36 100644 --- a/lib/node_modules/@stdlib/random/array/bernoulli/README.md +++ b/lib/node_modules/@stdlib/random/array/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var bernoulli = require( '@stdlib/random/array/bernoulli' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); ``` #### bernoulli( len, p\[, options] ) @@ -35,7 +35,7 @@ var bernoulli = require( '@stdlib/random/array/bernoulli' ); Returns an array containing pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. ```javascript -var out = bernoulli( 10, 0.5 ); +const out = bernoulli( 10, 0.5 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = bernoulli( 10, 0.5, opts ); +const out = bernoulli( 10, 0.5, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = bernoulli( 10, 0.5, opts ); Fills an array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = bernoulli.assign( 0.5, x ); +const out = bernoulli.assign( 0.5, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. ```javascript -var random = bernoulli.factory(); +const random = bernoulli.factory(); -var out = random( 10, 0.5 ); +const out = random( 10, 0.5 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `p`, the returned generator returns random variates from the specified distribution. ```javascript -var random = bernoulli.factory( 0.5 ); +const random = bernoulli.factory( 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `p`, the returned generator requires that `p` be provided at each invocation. ```javascript -var random = bernoulli.factory(); +const random = bernoulli.factory(); -var out = random( 10, 0.5 ); +let out = random( 10, 0.5 ); // returns out = random( 10, 0.5 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = bernoulli.factory( 0.5, opts ); +const random = bernoulli.factory( 0.5, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = bernoulli.factory( 0.5, opts ); +const random = bernoulli.factory( 0.5, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = bernoulli.factory( 0.5 ); +const random = bernoulli.factory( 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = bernoulli.PRNG; +const prng = bernoulli.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = bernoulli.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = bernoulli.seed; +const seed = bernoulli.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory( 0.5, { +const random = bernoulli.factory( 0.5, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = bernoulli.seedLength; +const len = bernoulli.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory( 0.5, { +const random = bernoulli.factory( 0.5, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = bernoulli.state; +const state = bernoulli.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory( 0.5, { +const random = bernoulli.factory( 0.5, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = bernoulli.stateLength; +const len = bernoulli.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory( 0.5, { +const random = bernoulli.factory( 0.5, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = bernoulli.byteLength; +const sz = bernoulli.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory( 0.5, { +const random = bernoulli.factory( 0.5, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var bernoulli = require( '@stdlib/random/array/bernoulli' ); +const logEach = require( '@stdlib/console/log-each' ); +const bernoulli = require( '@stdlib/random/array/bernoulli' ); // Create a function for generating random arrays originating from the same state: -var random = bernoulli.factory( 0.5, { +let random = bernoulli.factory( 0.5, { 'state': bernoulli.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = bernoulli.factory( 0.5, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/beta/README.md b/lib/node_modules/@stdlib/random/array/beta/README.md index 5e0d4a783370..845a5b66f9d6 100644 --- a/lib/node_modules/@stdlib/random/array/beta/README.md +++ b/lib/node_modules/@stdlib/random/array/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var beta = require( '@stdlib/random/array/beta' ); +const beta = require( '@stdlib/random/array/beta' ); ``` #### beta( len, alpha, beta\[, options] ) @@ -35,7 +35,7 @@ var beta = require( '@stdlib/random/array/beta' ); Returns an array containing pseudorandom numbers drawn from a [beta][@stdlib/random/base/beta] distribution. ```javascript -var out = beta( 10, 2.0, 5.0 ); +const out = beta( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = beta( 10, 2.0, 5.0, opts ); +const out = beta( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = beta( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [beta][@stdlib/random/base/beta] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = beta.assign( 2.0, 5.0, x ); +const out = beta.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [beta][@stdlib/random/base/beta] distribution. ```javascript -var random = beta.factory(); +const random = beta.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = beta.factory( 2.0, 5.0 ); +const random = beta.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = beta.factory(); +const random = beta.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = beta.factory( 2.0, 5.0, opts ); +const random = beta.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = beta.factory( 2.0, 5.0, opts ); +const random = beta.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = beta.factory( 2.0, 5.0 ); +const random = beta.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = beta.PRNG; +const prng = beta.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = beta.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = beta.seed; +const seed = beta.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = beta.factory( 2.0, 5.0, { +const random = beta.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = beta.seedLength; +const len = beta.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = beta.factory( 2.0, 5.0, { +const random = beta.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = beta.state; +const state = beta.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = beta.factory( 2.0, 5.0, { +const random = beta.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = beta.stateLength; +const len = beta.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = beta.factory( 2.0, 5.0, { +const random = beta.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = beta.byteLength; +const sz = beta.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = beta.factory( 2.0, 5.0, { +const random = beta.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var beta = require( '@stdlib/random/array/beta' ); +const logEach = require( '@stdlib/console/log-each' ); +const beta = require( '@stdlib/random/array/beta' ); // Create a function for generating random arrays originating from the same state: -var random = beta.factory( 2.0, 5.0, { +let random = beta.factory( 2.0, 5.0, { 'state': beta.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = beta.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/betaprime/README.md b/lib/node_modules/@stdlib/random/array/betaprime/README.md index 3b7b5ef09cf7..ffc98d301cdd 100644 --- a/lib/node_modules/@stdlib/random/array/betaprime/README.md +++ b/lib/node_modules/@stdlib/random/array/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var betaprime = require( '@stdlib/random/array/betaprime' ); +const betaprime = require( '@stdlib/random/array/betaprime' ); ``` #### betaprime( len, alpha, beta\[, options] ) @@ -35,7 +35,7 @@ var betaprime = require( '@stdlib/random/array/betaprime' ); Returns an array containing pseudorandom numbers drawn from a [beta prime][@stdlib/random/base/betaprime] distribution. ```javascript -var out = betaprime( 10, 2.0, 5.0 ); +const out = betaprime( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = betaprime( 10, 2.0, 5.0, opts ); +const out = betaprime( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = betaprime( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [beta prime][@stdlib/random/base/betaprime] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = betaprime.assign( 2.0, 5.0, x ); +const out = betaprime.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [beta prime][@stdlib/random/base/betaprime] distribution. ```javascript -var random = betaprime.factory(); +const random = betaprime.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = betaprime.factory( 2.0, 5.0 ); +const random = betaprime.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = betaprime.factory(); +const random = betaprime.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = betaprime.factory( 2.0, 5.0, opts ); +const random = betaprime.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = betaprime.factory( 2.0, 5.0, opts ); +const random = betaprime.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = betaprime.factory( 2.0, 5.0 ); +const random = betaprime.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = betaprime.PRNG; +const prng = betaprime.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = betaprime.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = betaprime.seed; +const seed = betaprime.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = betaprime.factory( 2.0, 5.0, { +const random = betaprime.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = betaprime.seedLength; +const len = betaprime.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = betaprime.factory( 2.0, 5.0, { +const random = betaprime.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = betaprime.state; +const state = betaprime.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = betaprime.factory( 2.0, 5.0, { +const random = betaprime.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = betaprime.stateLength; +const len = betaprime.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = betaprime.factory( 2.0, 5.0, { +const random = betaprime.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = betaprime.byteLength; +const sz = betaprime.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = betaprime.factory( 2.0, 5.0, { +const random = betaprime.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var betaprime = require( '@stdlib/random/array/betaprime' ); +const logEach = require( '@stdlib/console/log-each' ); +const betaprime = require( '@stdlib/random/array/betaprime' ); // Create a function for generating random arrays originating from the same state: -var random = betaprime.factory( 2.0, 5.0, { +let random = betaprime.factory( 2.0, 5.0, { 'state': betaprime.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = betaprime.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/binomial/README.md b/lib/node_modules/@stdlib/random/array/binomial/README.md index dfa5db063393..fefdf6ac73ac 100644 --- a/lib/node_modules/@stdlib/random/array/binomial/README.md +++ b/lib/node_modules/@stdlib/random/array/binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binomial = require( '@stdlib/random/array/binomial' ); +const binomial = require( '@stdlib/random/array/binomial' ); ``` #### binomial( len, n, p\[, options] ) @@ -35,7 +35,7 @@ var binomial = require( '@stdlib/random/array/binomial' ); Returns an array containing pseudorandom numbers drawn from a [binomial][@stdlib/random/base/binomial] distribution. ```javascript -var out = binomial( 10, 17, 0.5 ); +const out = binomial( 10, 17, 0.5 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = binomial( 10, 17, 0.5, opts ); +const out = binomial( 10, 17, 0.5, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = binomial( 10, 17, 0.5, opts ); Fills an array with pseudorandom numbers drawn from a [binomial][@stdlib/random/base/binomial] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = binomial.assign( 17, 0.5, x ); +const out = binomial.assign( 17, 0.5, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [binomial][@stdlib/random/base/binomial] distribution. ```javascript -var random = binomial.factory(); +const random = binomial.factory(); -var out = random( 10, 17, 0.5 ); +const out = random( 10, 17, 0.5 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = binomial.factory( 17, 0.5 ); +const random = binomial.factory( 17, 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = binomial.factory(); +const random = binomial.factory(); -var out = random( 10, 17, 0.5 ); +let out = random( 10, 17, 0.5 ); // returns out = random( 10, 17, 0.5 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = binomial.factory( 17, 0.5, opts ); +const random = binomial.factory( 17, 0.5, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = binomial.factory( 17, 0.5, opts ); +const random = binomial.factory( 17, 0.5, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = binomial.factory( 17, 0.5 ); +const random = binomial.factory( 17, 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = binomial.PRNG; +const prng = binomial.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = binomial.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = binomial.seed; +const seed = binomial.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = binomial.factory( 17, 0.5, { +const random = binomial.factory( 17, 0.5, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = binomial.seedLength; +const len = binomial.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = binomial.factory( 17, 0.5, { +const random = binomial.factory( 17, 0.5, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = binomial.state; +const state = binomial.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = binomial.factory( 17, 0.5, { +const random = binomial.factory( 17, 0.5, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = binomial.stateLength; +const len = binomial.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = binomial.factory( 17, 0.5, { +const random = binomial.factory( 17, 0.5, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = binomial.byteLength; +const sz = binomial.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = binomial.factory( 17, 0.5, { +const random = binomial.factory( 17, 0.5, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var binomial = require( '@stdlib/random/array/binomial' ); +const logEach = require( '@stdlib/console/log-each' ); +const binomial = require( '@stdlib/random/array/binomial' ); // Create a function for generating random arrays originating from the same state: -var random = binomial.factory( 17, 0.5, { +let random = binomial.factory( 17, 0.5, { 'state': binomial.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = binomial.factory( 17, 0.5, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/cauchy/README.md b/lib/node_modules/@stdlib/random/array/cauchy/README.md index 1fa1331a4896..5af97539f8c1 100644 --- a/lib/node_modules/@stdlib/random/array/cauchy/README.md +++ b/lib/node_modules/@stdlib/random/array/cauchy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cauchy = require( '@stdlib/random/array/cauchy' ); +const cauchy = require( '@stdlib/random/array/cauchy' ); ``` #### cauchy( len, x0, gamma\[, options] ) @@ -35,7 +35,7 @@ var cauchy = require( '@stdlib/random/array/cauchy' ); Returns an array containing pseudorandom numbers drawn from a [Cauchy][@stdlib/random/base/cauchy] distribution. ```javascript -var out = cauchy( 10, 2.0, 5.0 ); +const out = cauchy( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = cauchy( 10, 2.0, 5.0, opts ); +const out = cauchy( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = cauchy( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Cauchy][@stdlib/random/base/cauchy] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = cauchy.assign( 2.0, 5.0, x ); +const out = cauchy.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Cauchy][@stdlib/random/base/cauchy] distribution. ```javascript -var random = cauchy.factory(); +const random = cauchy.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = cauchy.factory( 2.0, 5.0 ); +const random = cauchy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = cauchy.factory(); +const random = cauchy.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = cauchy.factory( 2.0, 5.0, opts ); +const random = cauchy.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = cauchy.factory( 2.0, 5.0, opts ); +const random = cauchy.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = cauchy.factory( 2.0, 5.0 ); +const random = cauchy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = cauchy.PRNG; +const prng = cauchy.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = cauchy.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = cauchy.seed; +const seed = cauchy.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cauchy.factory( 2.0, 5.0, { +const random = cauchy.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = cauchy.seedLength; +const len = cauchy.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cauchy.factory( 2.0, 5.0, { +const random = cauchy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = cauchy.state; +const state = cauchy.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cauchy.factory( 2.0, 5.0, { +const random = cauchy.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = cauchy.stateLength; +const len = cauchy.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cauchy.factory( 2.0, 5.0, { +const random = cauchy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = cauchy.byteLength; +const sz = cauchy.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cauchy.factory( 2.0, 5.0, { +const random = cauchy.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var cauchy = require( '@stdlib/random/array/cauchy' ); +const logEach = require( '@stdlib/console/log-each' ); +const cauchy = require( '@stdlib/random/array/cauchy' ); // Create a function for generating random arrays originating from the same state: -var random = cauchy.factory( 2.0, 5.0, { +let random = cauchy.factory( 2.0, 5.0, { 'state': cauchy.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = cauchy.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/chi/README.md b/lib/node_modules/@stdlib/random/array/chi/README.md index 1ba02600c153..c89a094c35f5 100644 --- a/lib/node_modules/@stdlib/random/array/chi/README.md +++ b/lib/node_modules/@stdlib/random/array/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi = require( '@stdlib/random/array/chi' ); +const chi = require( '@stdlib/random/array/chi' ); ``` #### chi( len, k\[, options] ) @@ -35,7 +35,7 @@ var chi = require( '@stdlib/random/array/chi' ); Returns an array containing pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution. ```javascript -var out = chi( 10, 2.0 ); +const out = chi( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = chi( 10, 2.0, opts ); +const out = chi( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = chi( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = chi.assign( 2.0, x ); +const out = chi.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution. ```javascript -var random = chi.factory(); +const random = chi.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `k`, the returned generator returns random variates from the specified distribution. ```javascript -var random = chi.factory( 2.0 ); +const random = chi.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `k`, the returned generator requires that `k` be provided at each invocation. ```javascript -var random = chi.factory(); +const random = chi.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = chi.factory( 2.0, opts ); +const random = chi.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = chi.factory( 2.0, opts ); +const random = chi.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = chi.factory( 2.0 ); +const random = chi.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = chi.PRNG; +const prng = chi.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = chi.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = chi.seed; +const seed = chi.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory( 2.0, { +const random = chi.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = chi.seedLength; +const len = chi.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory( 2.0, { +const random = chi.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = chi.state; +const state = chi.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory( 2.0, { +const random = chi.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = chi.stateLength; +const len = chi.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory( 2.0, { +const random = chi.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = chi.byteLength; +const sz = chi.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory( 2.0, { +const random = chi.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var chi = require( '@stdlib/random/array/chi' ); +const logEach = require( '@stdlib/console/log-each' ); +const chi = require( '@stdlib/random/array/chi' ); // Create a function for generating random arrays originating from the same state: -var random = chi.factory( 2.0, { +let random = chi.factory( 2.0, { 'state': chi.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = chi.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/chisquare/README.md b/lib/node_modules/@stdlib/random/array/chisquare/README.md index ffdb8425aaea..95bfe4632015 100644 --- a/lib/node_modules/@stdlib/random/array/chisquare/README.md +++ b/lib/node_modules/@stdlib/random/array/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chisquare = require( '@stdlib/random/array/chisquare' ); +const chisquare = require( '@stdlib/random/array/chisquare' ); ``` #### chisquare( len, k\[, options] ) @@ -35,7 +35,7 @@ var chisquare = require( '@stdlib/random/array/chisquare' ); Returns an array containing pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. ```javascript -var out = chisquare( 10, 2.0 ); +const out = chisquare( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = chisquare( 10, 2.0, opts ); +const out = chisquare( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = chisquare( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = chisquare.assign( 2.0, x ); +const out = chisquare.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. ```javascript -var random = chisquare.factory(); +const random = chisquare.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `k`, the returned generator returns random variates from the specified distribution. ```javascript -var random = chisquare.factory( 2.0 ); +const random = chisquare.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `k`, the returned generator requires that `k` be provided at each invocation. ```javascript -var random = chisquare.factory(); +const random = chisquare.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = chisquare.factory( 2.0, opts ); +const random = chisquare.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = chisquare.factory( 2.0, opts ); +const random = chisquare.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = chisquare.factory( 2.0 ); +const random = chisquare.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = chisquare.PRNG; +const prng = chisquare.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = chisquare.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = chisquare.seed; +const seed = chisquare.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory( 2.0, { +const random = chisquare.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = chisquare.seedLength; +const len = chisquare.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory( 2.0, { +const random = chisquare.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = chisquare.state; +const state = chisquare.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory( 2.0, { +const random = chisquare.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = chisquare.stateLength; +const len = chisquare.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory( 2.0, { +const random = chisquare.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = chisquare.byteLength; +const sz = chisquare.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory( 2.0, { +const random = chisquare.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var chisquare = require( '@stdlib/random/array/chisquare' ); +const logEach = require( '@stdlib/console/log-each' ); +const chisquare = require( '@stdlib/random/array/chisquare' ); // Create a function for generating random arrays originating from the same state: -var random = chisquare.factory( 2.0, { +let random = chisquare.factory( 2.0, { 'state': chisquare.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = chisquare.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/cosine/README.md b/lib/node_modules/@stdlib/random/array/cosine/README.md index f15ecdcc5276..210b92841cb2 100644 --- a/lib/node_modules/@stdlib/random/array/cosine/README.md +++ b/lib/node_modules/@stdlib/random/array/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosine = require( '@stdlib/random/array/cosine' ); +const cosine = require( '@stdlib/random/array/cosine' ); ``` #### cosine( len, mu, s\[, options] ) @@ -35,7 +35,7 @@ var cosine = require( '@stdlib/random/array/cosine' ); Returns an array containing pseudorandom numbers drawn from a [raised cosine][@stdlib/random/base/cosine] distribution. ```javascript -var out = cosine( 10, 2.0, 5.0 ); +const out = cosine( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = cosine( 10, 2.0, 5.0, opts ); +const out = cosine( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = cosine( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [raised cosine][@stdlib/random/base/cosine] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = cosine.assign( 2.0, 5.0, x ); +const out = cosine.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [raised cosine][@stdlib/random/base/cosine] distribution. ```javascript -var random = cosine.factory(); +const random = cosine.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = cosine.factory( 2.0, 5.0 ); +const random = cosine.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = cosine.factory(); +const random = cosine.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = cosine.factory( 2.0, 5.0, opts ); +const random = cosine.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = cosine.factory( 2.0, 5.0, opts ); +const random = cosine.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = cosine.factory( 2.0, 5.0 ); +const random = cosine.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = cosine.PRNG; +const prng = cosine.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = cosine.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = cosine.seed; +const seed = cosine.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cosine.factory( 2.0, 5.0, { +const random = cosine.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = cosine.seedLength; +const len = cosine.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cosine.factory( 2.0, 5.0, { +const random = cosine.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = cosine.state; +const state = cosine.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cosine.factory( 2.0, 5.0, { +const random = cosine.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = cosine.stateLength; +const len = cosine.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cosine.factory( 2.0, 5.0, { +const random = cosine.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = cosine.byteLength; +const sz = cosine.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = cosine.factory( 2.0, 5.0, { +const random = cosine.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var cosine = require( '@stdlib/random/array/cosine' ); +const logEach = require( '@stdlib/console/log-each' ); +const cosine = require( '@stdlib/random/array/cosine' ); // Create a function for generating random arrays originating from the same state: -var random = cosine.factory( 2.0, 5.0, { +let random = cosine.factory( 2.0, 5.0, { 'state': cosine.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = cosine.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/discrete-uniform/README.md b/lib/node_modules/@stdlib/random/array/discrete-uniform/README.md index a6cb52ccc251..3c2461dd8e2e 100644 --- a/lib/node_modules/@stdlib/random/array/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/random/array/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); ``` #### discreteUniform( len, a, b\[, options] ) @@ -35,7 +35,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); Returns an array containing pseudorandom numbers drawn from a [discrete uniform][@stdlib/random/base/discrete-uniform] distribution. ```javascript -var out = discreteUniform( 10, -10, 10 ); +const out = discreteUniform( 10, -10, 10 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = discreteUniform( 10, -10, 10, opts ); +const out = discreteUniform( 10, -10, 10, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = discreteUniform( 10, -10, 10, opts ); Fills an array with pseudorandom numbers drawn from a [discrete uniform][@stdlib/random/base/discrete-uniform] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = discreteUniform.assign( -10, 10, x ); +const out = discreteUniform.assign( -10, 10, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [discrete uniform][@stdlib/random/base/discrete-uniform] distribution. ```javascript -var random = discreteUniform.factory(); +const random = discreteUniform.factory(); -var out = random( 10, -10, 10 ); +const out = random( 10, -10, 10 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = discreteUniform.factory( -10, 10 ); +const random = discreteUniform.factory( -10, 10 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = discreteUniform.factory(); +const random = discreteUniform.factory(); -var out = random( 10, -10, 10 ); +let out = random( 10, -10, 10 ); // returns out = random( 10, -10, 10 ); @@ -132,26 +132,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd }; -var random = discreteUniform.factory( -10, 10, opts ); +const random = discreteUniform.factory( -10, 10, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = discreteUniform.factory( -10, 10, opts ); +const random = discreteUniform.factory( -10, 10, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -162,12 +162,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = discreteUniform.factory( -10, 10 ); +const random = discreteUniform.factory( -10, 10 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -179,7 +179,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = discreteUniform.PRNG; +const prng = discreteUniform.PRNG; // returns ``` @@ -188,20 +188,20 @@ var prng = discreteUniform.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = discreteUniform.seed; +const seed = discreteUniform.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var random = discreteUniform.factory( -10, 10, { +const random = discreteUniform.factory( -10, 10, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -210,20 +210,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = discreteUniform.seedLength; +const len = discreteUniform.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var random = discreteUniform.factory( -10, 10, { +const random = discreteUniform.factory( -10, 10, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -232,20 +232,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = discreteUniform.state; +const state = discreteUniform.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var random = discreteUniform.factory( -10, 10, { +const random = discreteUniform.factory( -10, 10, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -254,20 +254,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = discreteUniform.stateLength; +const len = discreteUniform.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var random = discreteUniform.factory( -10, 10, { +const random = discreteUniform.factory( -10, 10, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -276,20 +276,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = discreteUniform.byteLength; +const sz = discreteUniform.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var random = discreteUniform.factory( -10, 10, { +const random = discreteUniform.factory( -10, 10, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -315,19 +315,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const logEach = require( '@stdlib/console/log-each' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); // Create a function for generating random arrays originating from the same state: -var random = discreteUniform.factory( -10, 10, { +let random = discreteUniform.factory( -10, 10, { 'state': discreteUniform.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -339,7 +339,7 @@ random = discreteUniform.factory( -10, 10, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/erlang/README.md b/lib/node_modules/@stdlib/random/array/erlang/README.md index 2469e99cc3d9..3f071213272b 100644 --- a/lib/node_modules/@stdlib/random/array/erlang/README.md +++ b/lib/node_modules/@stdlib/random/array/erlang/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var erlang = require( '@stdlib/random/array/erlang' ); +const erlang = require( '@stdlib/random/array/erlang' ); ``` #### erlang( len, k, lambda\[, options] ) @@ -35,7 +35,7 @@ var erlang = require( '@stdlib/random/array/erlang' ); Returns an array containing pseudorandom numbers drawn from an [Erlang][@stdlib/random/base/erlang] distribution. ```javascript -var out = erlang( 10, 2, 5.0 ); +const out = erlang( 10, 2, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = erlang( 10, 2, 5.0, opts ); +const out = erlang( 10, 2, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = erlang( 10, 2, 5.0, opts ); Fills an array with pseudorandom numbers drawn from an [Erlang][@stdlib/random/base/erlang] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = erlang.assign( 2, 5.0, x ); +const out = erlang.assign( 2, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from an [Erlang][@stdlib/random/base/erlang] distribution. ```javascript -var random = erlang.factory(); +const random = erlang.factory(); -var out = random( 10, 2, 5.0 ); +const out = random( 10, 2, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = erlang.factory( 2, 5.0 ); +const random = erlang.factory( 2, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = erlang.factory(); +const random = erlang.factory(); -var out = random( 10, 2, 5.0 ); +let out = random( 10, 2, 5.0 ); // returns out = random( 10, 2, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = erlang.factory( 2, 5.0, opts ); +const random = erlang.factory( 2, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = erlang.factory( 2, 5.0, opts ); +const random = erlang.factory( 2, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = erlang.factory( 2, 5.0 ); +const random = erlang.factory( 2, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = erlang.PRNG; +const prng = erlang.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = erlang.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = erlang.seed; +const seed = erlang.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = erlang.factory( 2, 5.0, { +const random = erlang.factory( 2, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = erlang.seedLength; +const len = erlang.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = erlang.factory( 2, 5.0, { +const random = erlang.factory( 2, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = erlang.state; +const state = erlang.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = erlang.factory( 2, 5.0, { +const random = erlang.factory( 2, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = erlang.stateLength; +const len = erlang.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = erlang.factory( 2, 5.0, { +const random = erlang.factory( 2, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = erlang.byteLength; +const sz = erlang.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = erlang.factory( 2, 5.0, { +const random = erlang.factory( 2, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var erlang = require( '@stdlib/random/array/erlang' ); +const logEach = require( '@stdlib/console/log-each' ); +const erlang = require( '@stdlib/random/array/erlang' ); // Create a function for generating random arrays originating from the same state: -var random = erlang.factory( 2, 5.0, { +let random = erlang.factory( 2, 5.0, { 'state': erlang.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = erlang.factory( 2, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/exponential/README.md b/lib/node_modules/@stdlib/random/array/exponential/README.md index cff3c7f2b5a9..00fe31688016 100644 --- a/lib/node_modules/@stdlib/random/array/exponential/README.md +++ b/lib/node_modules/@stdlib/random/array/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponential = require( '@stdlib/random/array/exponential' ); +const exponential = require( '@stdlib/random/array/exponential' ); ``` #### exponential( len, lambda\[, options] ) @@ -35,7 +35,7 @@ var exponential = require( '@stdlib/random/array/exponential' ); Returns an array containing pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var out = exponential( 10, 2.0 ); +const out = exponential( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = exponential( 10, 2.0, opts ); +const out = exponential( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = exponential( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = exponential.assign( 2.0, x ); +const out = exponential.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var random = exponential.factory(); +const random = exponential.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `lambda`, the returned generator returns random variates from the specified distribution. ```javascript -var random = exponential.factory( 2.0 ); +const random = exponential.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `lambda`, the returned generator requires that `lambda` be provided at each invocation. ```javascript -var random = exponential.factory(); +const random = exponential.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = exponential.factory( 2.0, opts ); +const random = exponential.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = exponential.factory( 2.0, opts ); +const random = exponential.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = exponential.factory( 2.0 ); +const random = exponential.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = exponential.PRNG; +const prng = exponential.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = exponential.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = exponential.seed; +const seed = exponential.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory( 2.0, { +const random = exponential.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = exponential.seedLength; +const len = exponential.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory( 2.0, { +const random = exponential.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = exponential.state; +const state = exponential.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory( 2.0, { +const random = exponential.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = exponential.stateLength; +const len = exponential.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory( 2.0, { +const random = exponential.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = exponential.byteLength; +const sz = exponential.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory( 2.0, { +const random = exponential.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var exponential = require( '@stdlib/random/array/exponential' ); +const logEach = require( '@stdlib/console/log-each' ); +const exponential = require( '@stdlib/random/array/exponential' ); // Create a function for generating random arrays originating from the same state: -var random = exponential.factory( 2.0, { +let random = exponential.factory( 2.0, { 'state': exponential.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = exponential.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/f/README.md b/lib/node_modules/@stdlib/random/array/f/README.md index 57566a409add..f4370fd4eb8e 100644 --- a/lib/node_modules/@stdlib/random/array/f/README.md +++ b/lib/node_modules/@stdlib/random/array/f/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var f = require( '@stdlib/random/array/f' ); +const f = require( '@stdlib/random/array/f' ); ``` #### f( len, d1, d2\[, options] ) @@ -35,7 +35,7 @@ var f = require( '@stdlib/random/array/f' ); Returns an array containing pseudorandom numbers drawn from an [F][@stdlib/random/base/f] distribution. ```javascript -var out = f( 10, 2.0, 5.0 ); +const out = f( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = f( 10, 2.0, 5.0, opts ); +const out = f( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = f( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from an [F][@stdlib/random/base/f] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = f.assign( 2.0, 5.0, x ); +const out = f.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from an [F][@stdlib/random/base/f] distribution. ```javascript -var random = f.factory(); +const random = f.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = f.factory( 2.0, 5.0 ); +const random = f.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = f.factory(); +const random = f.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = f.factory( 2.0, 5.0, opts ); +const random = f.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = f.factory( 2.0, 5.0, opts ); +const random = f.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = f.factory( 2.0, 5.0 ); +const random = f.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = f.PRNG; +const prng = f.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = f.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = f.seed; +const seed = f.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = f.factory( 2.0, 5.0, { +const random = f.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = f.seedLength; +const len = f.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = f.factory( 2.0, 5.0, { +const random = f.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = f.state; +const state = f.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = f.factory( 2.0, 5.0, { +const random = f.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = f.stateLength; +const len = f.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = f.factory( 2.0, 5.0, { +const random = f.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = f.byteLength; +const sz = f.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = f.factory( 2.0, 5.0, { +const random = f.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var f = require( '@stdlib/random/array/f' ); +const logEach = require( '@stdlib/console/log-each' ); +const f = require( '@stdlib/random/array/f' ); // Create a function for generating random arrays originating from the same state: -var random = f.factory( 2.0, 5.0, { +let random = f.factory( 2.0, 5.0, { 'state': f.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = f.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/frechet/README.md b/lib/node_modules/@stdlib/random/array/frechet/README.md index 38be0d7bed02..43c7f307e416 100644 --- a/lib/node_modules/@stdlib/random/array/frechet/README.md +++ b/lib/node_modules/@stdlib/random/array/frechet/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var frechet = require( '@stdlib/random/array/frechet' ); +const frechet = require( '@stdlib/random/array/frechet' ); ``` #### frechet( len, alpha, s, m\[, options] ) @@ -35,7 +35,7 @@ var frechet = require( '@stdlib/random/array/frechet' ); Returns an array containing pseudorandom numbers drawn from a [Fréchet][@stdlib/random/base/frechet] distribution. ```javascript -var out = frechet( 10, 2.0, 5.0, 3.0 ); +const out = frechet( 10, 2.0, 5.0, 3.0 ); // returns ``` @@ -54,11 +54,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = frechet( 10, 2.0, 5.0, 3.0, opts ); +const out = frechet( 10, 2.0, 5.0, 3.0, opts ); // returns [...] ``` @@ -67,15 +67,15 @@ var out = frechet( 10, 2.0, 5.0, 3.0, opts ); Fills an array with pseudorandom numbers drawn from a [Fréchet][@stdlib/random/base/frechet] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = frechet.assign( 2.0, 5.0, 3.0, x ); +const out = frechet.assign( 2.0, 5.0, 3.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -91,21 +91,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Fréchet][@stdlib/random/base/frechet] distribution. ```javascript -var random = frechet.factory(); +const random = frechet.factory(); -var out = random( 10, 2.0, 5.0, 3.0 ); +const out = random( 10, 2.0, 5.0, 3.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = frechet.factory( 2.0, 5.0, 3.0 ); +const random = frechet.factory( 2.0, 5.0, 3.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -115,9 +115,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = frechet.factory(); +const random = frechet.factory(); -var out = random( 10, 2.0, 5.0, 3.0 ); +let out = random( 10, 2.0, 5.0, 3.0 ); // returns out = random( 10, 2.0, 5.0, 3.0 ); @@ -135,26 +135,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = frechet.factory( 2.0, 5.0, 3.0, opts ); +const random = frechet.factory( 2.0, 5.0, 3.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = frechet.factory( 2.0, 5.0, 3.0, opts ); +const random = frechet.factory( 2.0, 5.0, 3.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -165,12 +165,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = frechet.factory( 2.0, 5.0, 3.0 ); +const random = frechet.factory( 2.0, 5.0, 3.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -182,7 +182,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = frechet.PRNG; +const prng = frechet.PRNG; // returns ``` @@ -191,20 +191,20 @@ var prng = frechet.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = frechet.seed; +const seed = frechet.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = frechet.factory( 2.0, 5.0, 3.0, { +const random = frechet.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -213,20 +213,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = frechet.seedLength; +const len = frechet.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = frechet.factory( 2.0, 5.0, 3.0, { +const random = frechet.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -235,20 +235,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = frechet.state; +const state = frechet.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = frechet.factory( 2.0, 5.0, 3.0, { +const random = frechet.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -257,20 +257,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = frechet.stateLength; +const len = frechet.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = frechet.factory( 2.0, 5.0, 3.0, { +const random = frechet.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -279,20 +279,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = frechet.byteLength; +const sz = frechet.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = frechet.factory( 2.0, 5.0, 3.0, { +const random = frechet.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -318,19 +318,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var frechet = require( '@stdlib/random/array/frechet' ); +const logEach = require( '@stdlib/console/log-each' ); +const frechet = require( '@stdlib/random/array/frechet' ); // Create a function for generating random arrays originating from the same state: -var random = frechet.factory( 2.0, 5.0, 3.0, { +let random = frechet.factory( 2.0, 5.0, 3.0, { 'state': frechet.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -342,7 +342,7 @@ random = frechet.factory( 2.0, 5.0, 3.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/gamma/README.md b/lib/node_modules/@stdlib/random/array/gamma/README.md index a9f8d3d5bfd3..fda0eed2d552 100644 --- a/lib/node_modules/@stdlib/random/array/gamma/README.md +++ b/lib/node_modules/@stdlib/random/array/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gamma = require( '@stdlib/random/array/gamma' ); +const gamma = require( '@stdlib/random/array/gamma' ); ``` #### gamma( len, alpha, beta\[, options] ) @@ -35,7 +35,7 @@ var gamma = require( '@stdlib/random/array/gamma' ); Returns an array containing pseudorandom numbers drawn from a [gamma][@stdlib/random/base/gamma] distribution. ```javascript -var out = gamma( 10, 2.0, 5.0 ); +const out = gamma( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = gamma( 10, 2.0, 5.0, opts ); +const out = gamma( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = gamma( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [gamma][@stdlib/random/base/gamma] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = gamma.assign( 2.0, 5.0, x ); +const out = gamma.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [gamma][@stdlib/random/base/gamma] distribution. ```javascript -var random = gamma.factory(); +const random = gamma.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = gamma.factory( 2.0, 5.0 ); +const random = gamma.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = gamma.factory(); +const random = gamma.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = gamma.factory( 2.0, 5.0, opts ); +const random = gamma.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = gamma.factory( 2.0, 5.0, opts ); +const random = gamma.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = gamma.factory( 2.0, 5.0 ); +const random = gamma.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = gamma.PRNG; +const prng = gamma.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = gamma.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = gamma.seed; +const seed = gamma.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gamma.factory( 2.0, 5.0, { +const random = gamma.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = gamma.seedLength; +const len = gamma.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gamma.factory( 2.0, 5.0, { +const random = gamma.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = gamma.state; +const state = gamma.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gamma.factory( 2.0, 5.0, { +const random = gamma.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = gamma.stateLength; +const len = gamma.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gamma.factory( 2.0, 5.0, { +const random = gamma.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = gamma.byteLength; +const sz = gamma.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gamma.factory( 2.0, 5.0, { +const random = gamma.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var gamma = require( '@stdlib/random/array/gamma' ); +const logEach = require( '@stdlib/console/log-each' ); +const gamma = require( '@stdlib/random/array/gamma' ); // Create a function for generating random arrays originating from the same state: -var random = gamma.factory( 2.0, 5.0, { +let random = gamma.factory( 2.0, 5.0, { 'state': gamma.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = gamma.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/geometric/README.md b/lib/node_modules/@stdlib/random/array/geometric/README.md index 045873ce38bd..ff1a7bea9884 100644 --- a/lib/node_modules/@stdlib/random/array/geometric/README.md +++ b/lib/node_modules/@stdlib/random/array/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var geometric = require( '@stdlib/random/array/geometric' ); +const geometric = require( '@stdlib/random/array/geometric' ); ``` #### geometric( len, p\[, options] ) @@ -35,7 +35,7 @@ var geometric = require( '@stdlib/random/array/geometric' ); Returns an array containing pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript -var out = geometric( 10, 0.01 ); +const out = geometric( 10, 0.01 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = geometric( 10, 0.01, opts ); +const out = geometric( 10, 0.01, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = geometric( 10, 0.01, opts ); Fills an array with pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = geometric.assign( 0.01, x ); +const out = geometric.assign( 0.01, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript -var random = geometric.factory(); +const random = geometric.factory(); -var out = random( 10, 0.01 ); +const out = random( 10, 0.01 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `p`, the returned generator returns random variates from the specified distribution. ```javascript -var random = geometric.factory( 0.01 ); +const random = geometric.factory( 0.01 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `p`, the returned generator requires that `p` be provided at each invocation. ```javascript -var random = geometric.factory(); +const random = geometric.factory(); -var out = random( 10, 0.01 ); +let out = random( 10, 0.01 ); // returns out = random( 10, 0.01 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = geometric.factory( 0.01, opts ); +const random = geometric.factory( 0.01, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = geometric.factory( 0.01, opts ); +const random = geometric.factory( 0.01, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = geometric.factory( 0.01 ); +const random = geometric.factory( 0.01 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = geometric.PRNG; +const prng = geometric.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = geometric.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = geometric.seed; +const seed = geometric.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory( 0.01, { +const random = geometric.factory( 0.01, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = geometric.seedLength; +const len = geometric.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory( 0.01, { +const random = geometric.factory( 0.01, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = geometric.state; +const state = geometric.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory( 0.01, { +const random = geometric.factory( 0.01, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = geometric.stateLength; +const len = geometric.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory( 0.01, { +const random = geometric.factory( 0.01, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = geometric.byteLength; +const sz = geometric.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory( 0.01, { +const random = geometric.factory( 0.01, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var geometric = require( '@stdlib/random/array/geometric' ); +const logEach = require( '@stdlib/console/log-each' ); +const geometric = require( '@stdlib/random/array/geometric' ); // Create a function for generating random arrays originating from the same state: -var random = geometric.factory( 0.01, { +let random = geometric.factory( 0.01, { 'state': geometric.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = geometric.factory( 0.01, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/gumbel/README.md b/lib/node_modules/@stdlib/random/array/gumbel/README.md index 3861ec4da028..b8d39997e441 100644 --- a/lib/node_modules/@stdlib/random/array/gumbel/README.md +++ b/lib/node_modules/@stdlib/random/array/gumbel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gumbel = require( '@stdlib/random/array/gumbel' ); +const gumbel = require( '@stdlib/random/array/gumbel' ); ``` #### gumbel( len, mu, beta\[, options] ) @@ -35,7 +35,7 @@ var gumbel = require( '@stdlib/random/array/gumbel' ); Returns an array containing pseudorandom numbers drawn from a [Gumbel][@stdlib/random/base/gumbel] distribution. ```javascript -var out = gumbel( 10, 2.0, 5.0 ); +const out = gumbel( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = gumbel( 10, 2.0, 5.0, opts ); +const out = gumbel( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = gumbel( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Gumbel][@stdlib/random/base/gumbel] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = gumbel.assign( 2.0, 5.0, x ); +const out = gumbel.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Gumbel][@stdlib/random/base/gumbel] distribution. ```javascript -var random = gumbel.factory(); +const random = gumbel.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = gumbel.factory( 2.0, 5.0 ); +const random = gumbel.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = gumbel.factory(); +const random = gumbel.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = gumbel.factory( 2.0, 5.0, opts ); +const random = gumbel.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = gumbel.factory( 2.0, 5.0, opts ); +const random = gumbel.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = gumbel.factory( 2.0, 5.0 ); +const random = gumbel.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = gumbel.PRNG; +const prng = gumbel.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = gumbel.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = gumbel.seed; +const seed = gumbel.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gumbel.factory( 2.0, 5.0, { +const random = gumbel.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = gumbel.seedLength; +const len = gumbel.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gumbel.factory( 2.0, 5.0, { +const random = gumbel.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = gumbel.state; +const state = gumbel.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gumbel.factory( 2.0, 5.0, { +const random = gumbel.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = gumbel.stateLength; +const len = gumbel.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gumbel.factory( 2.0, 5.0, { +const random = gumbel.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = gumbel.byteLength; +const sz = gumbel.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = gumbel.factory( 2.0, 5.0, { +const random = gumbel.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var gumbel = require( '@stdlib/random/array/gumbel' ); +const logEach = require( '@stdlib/console/log-each' ); +const gumbel = require( '@stdlib/random/array/gumbel' ); // Create a function for generating random arrays originating from the same state: -var random = gumbel.factory( 2.0, 5.0, { +let random = gumbel.factory( 2.0, 5.0, { 'state': gumbel.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = gumbel.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/hypergeometric/README.md b/lib/node_modules/@stdlib/random/array/hypergeometric/README.md index 5eecdbb0385d..8ca384d39d6f 100644 --- a/lib/node_modules/@stdlib/random/array/hypergeometric/README.md +++ b/lib/node_modules/@stdlib/random/array/hypergeometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hypergeometric = require( '@stdlib/random/array/hypergeometric' ); +const hypergeometric = require( '@stdlib/random/array/hypergeometric' ); ``` #### hypergeometric( len, N, K, n\[, options] ) @@ -35,7 +35,7 @@ var hypergeometric = require( '@stdlib/random/array/hypergeometric' ); Returns an array containing pseudorandom numbers drawn from a [hypergeometric][@stdlib/random/base/hypergeometric] distribution. ```javascript -var out = hypergeometric( 10, 20, 10, 7 ); +const out = hypergeometric( 10, 20, 10, 7 ); // returns ``` @@ -54,11 +54,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = hypergeometric( 10, 20, 10, 7, opts ); +const out = hypergeometric( 10, 20, 10, 7, opts ); // returns [...] ``` @@ -67,15 +67,15 @@ var out = hypergeometric( 10, 20, 10, 7, opts ); Fills an array with pseudorandom numbers drawn from a [hypergeometric][@stdlib/random/base/hypergeometric] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = hypergeometric.assign( 20, 10, 7, x ); +const out = hypergeometric.assign( 20, 10, 7, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -91,21 +91,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [hypergeometric][@stdlib/random/base/hypergeometric] distribution. ```javascript -var random = hypergeometric.factory(); +const random = hypergeometric.factory(); -var out = random( 10, 20, 10, 7 ); +const out = random( 10, 20, 10, 7 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = hypergeometric.factory( 20, 10, 7 ); +const random = hypergeometric.factory( 20, 10, 7 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -115,9 +115,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = hypergeometric.factory(); +const random = hypergeometric.factory(); -var out = random( 10, 20, 10, 7 ); +let out = random( 10, 20, 10, 7 ); // returns out = random( 10, 20, 10, 7 ); @@ -135,26 +135,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = hypergeometric.factory( 20, 10, 7, opts ); +const random = hypergeometric.factory( 20, 10, 7, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = hypergeometric.factory( 20, 10, 7, opts ); +const random = hypergeometric.factory( 20, 10, 7, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -165,12 +165,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = hypergeometric.factory( 20, 10, 7 ); +const random = hypergeometric.factory( 20, 10, 7 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -182,7 +182,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = hypergeometric.PRNG; +const prng = hypergeometric.PRNG; // returns ``` @@ -191,20 +191,20 @@ var prng = hypergeometric.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = hypergeometric.seed; +const seed = hypergeometric.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = hypergeometric.factory( 20, 10, 7, { +const random = hypergeometric.factory( 20, 10, 7, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -213,20 +213,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = hypergeometric.seedLength; +const len = hypergeometric.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = hypergeometric.factory( 20, 10, 7, { +const random = hypergeometric.factory( 20, 10, 7, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -235,20 +235,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = hypergeometric.state; +const state = hypergeometric.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = hypergeometric.factory( 20, 10, 7, { +const random = hypergeometric.factory( 20, 10, 7, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -257,20 +257,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = hypergeometric.stateLength; +const len = hypergeometric.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = hypergeometric.factory( 20, 10, 7, { +const random = hypergeometric.factory( 20, 10, 7, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -279,20 +279,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = hypergeometric.byteLength; +const sz = hypergeometric.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = hypergeometric.factory( 20, 10, 7, { +const random = hypergeometric.factory( 20, 10, 7, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -318,19 +318,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var hypergeometric = require( '@stdlib/random/array/hypergeometric' ); +const logEach = require( '@stdlib/console/log-each' ); +const hypergeometric = require( '@stdlib/random/array/hypergeometric' ); // Create a function for generating random arrays originating from the same state: -var random = hypergeometric.factory( 20, 10, 7, { +let random = hypergeometric.factory( 20, 10, 7, { 'state': hypergeometric.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -342,7 +342,7 @@ random = hypergeometric.factory( 20, 10, 7, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/invgamma/README.md b/lib/node_modules/@stdlib/random/array/invgamma/README.md index 4fe96cef82e5..f3bd8ef077f3 100644 --- a/lib/node_modules/@stdlib/random/array/invgamma/README.md +++ b/lib/node_modules/@stdlib/random/array/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invgamma = require( '@stdlib/random/array/invgamma' ); +const invgamma = require( '@stdlib/random/array/invgamma' ); ``` #### invgamma( len, alpha, beta\[, options] ) @@ -35,7 +35,7 @@ var invgamma = require( '@stdlib/random/array/invgamma' ); Returns an array containing pseudorandom numbers drawn from a [inverse gamma][@stdlib/random/base/invgamma] distribution. ```javascript -var out = invgamma( 10, 2.0, 5.0 ); +const out = invgamma( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = invgamma( 10, 2.0, 5.0, opts ); +const out = invgamma( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = invgamma( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [inverse gamma][@stdlib/random/base/invgamma] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = invgamma.assign( 2.0, 5.0, x ); +const out = invgamma.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [inverse gamma][@stdlib/random/base/invgamma] distribution. ```javascript -var random = invgamma.factory(); +const random = invgamma.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = invgamma.factory( 2.0, 5.0 ); +const random = invgamma.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = invgamma.factory(); +const random = invgamma.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = invgamma.factory( 2.0, 5.0, opts ); +const random = invgamma.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = invgamma.factory( 2.0, 5.0, opts ); +const random = invgamma.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = invgamma.factory( 2.0, 5.0 ); +const random = invgamma.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = invgamma.PRNG; +const prng = invgamma.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = invgamma.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = invgamma.seed; +const seed = invgamma.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = invgamma.factory( 2.0, 5.0, { +const random = invgamma.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = invgamma.seedLength; +const len = invgamma.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = invgamma.factory( 2.0, 5.0, { +const random = invgamma.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = invgamma.state; +const state = invgamma.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = invgamma.factory( 2.0, 5.0, { +const random = invgamma.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = invgamma.stateLength; +const len = invgamma.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = invgamma.factory( 2.0, 5.0, { +const random = invgamma.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = invgamma.byteLength; +const sz = invgamma.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = invgamma.factory( 2.0, 5.0, { +const random = invgamma.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var invgamma = require( '@stdlib/random/array/invgamma' ); +const logEach = require( '@stdlib/console/log-each' ); +const invgamma = require( '@stdlib/random/array/invgamma' ); // Create a function for generating random arrays originating from the same state: -var random = invgamma.factory( 2.0, 5.0, { +let random = invgamma.factory( 2.0, 5.0, { 'state': invgamma.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = invgamma.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/kumaraswamy/README.md b/lib/node_modules/@stdlib/random/array/kumaraswamy/README.md index e68998b83534..429740607b29 100644 --- a/lib/node_modules/@stdlib/random/array/kumaraswamy/README.md +++ b/lib/node_modules/@stdlib/random/array/kumaraswamy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' ); +const kumaraswamy = require( '@stdlib/random/array/kumaraswamy' ); ``` #### kumaraswamy( len, a, b\[, options] ) @@ -35,7 +35,7 @@ var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' ); Returns an array containing pseudorandom numbers drawn from [Kumaraswamy's double bounded][@stdlib/random/base/kumaraswamy] distribution. ```javascript -var out = kumaraswamy( 10, 2.0, 5.0 ); +const out = kumaraswamy( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = kumaraswamy( 10, 2.0, 5.0, opts ); +const out = kumaraswamy( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = kumaraswamy( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from [Kumaraswamy's double bounded][@stdlib/random/base/kumaraswamy] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = kumaraswamy.assign( 2.0, 5.0, x ); +const out = kumaraswamy.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from [Kumaraswamy's double bounded][@stdlib/random/base/kumaraswamy] distribution. ```javascript -var random = kumaraswamy.factory(); +const random = kumaraswamy.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = kumaraswamy.factory( 2.0, 5.0 ); +const random = kumaraswamy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = kumaraswamy.factory(); +const random = kumaraswamy.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = kumaraswamy.factory( 2.0, 5.0, opts ); +const random = kumaraswamy.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = kumaraswamy.factory( 2.0, 5.0, opts ); +const random = kumaraswamy.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = kumaraswamy.factory( 2.0, 5.0 ); +const random = kumaraswamy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = kumaraswamy.PRNG; +const prng = kumaraswamy.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = kumaraswamy.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = kumaraswamy.seed; +const seed = kumaraswamy.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = kumaraswamy.factory( 2.0, 5.0, { +const random = kumaraswamy.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = kumaraswamy.seedLength; +const len = kumaraswamy.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = kumaraswamy.factory( 2.0, 5.0, { +const random = kumaraswamy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = kumaraswamy.state; +const state = kumaraswamy.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = kumaraswamy.factory( 2.0, 5.0, { +const random = kumaraswamy.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = kumaraswamy.stateLength; +const len = kumaraswamy.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = kumaraswamy.factory( 2.0, 5.0, { +const random = kumaraswamy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = kumaraswamy.byteLength; +const sz = kumaraswamy.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = kumaraswamy.factory( 2.0, 5.0, { +const random = kumaraswamy.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' ); +const logEach = require( '@stdlib/console/log-each' ); +const kumaraswamy = require( '@stdlib/random/array/kumaraswamy' ); // Create a function for generating random arrays originating from the same state: -var random = kumaraswamy.factory( 2.0, 5.0, { +let random = kumaraswamy.factory( 2.0, 5.0, { 'state': kumaraswamy.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = kumaraswamy.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/laplace/README.md b/lib/node_modules/@stdlib/random/array/laplace/README.md index f4cf00bbe8a7..faa2b3345710 100644 --- a/lib/node_modules/@stdlib/random/array/laplace/README.md +++ b/lib/node_modules/@stdlib/random/array/laplace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var laplace = require( '@stdlib/random/array/laplace' ); +const laplace = require( '@stdlib/random/array/laplace' ); ``` #### laplace( len, mu, b\[, options] ) @@ -35,7 +35,7 @@ var laplace = require( '@stdlib/random/array/laplace' ); Returns an array containing pseudorandom numbers drawn from a [Laplace (double exponential)][@stdlib/random/base/laplace] distribution. ```javascript -var out = laplace( 10, 2.0, 5.0 ); +const out = laplace( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = laplace( 10, 2.0, 5.0, opts ); +const out = laplace( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = laplace( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Laplace (double exponential)][@stdlib/random/base/laplace] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = laplace.assign( 2.0, 5.0, x ); +const out = laplace.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Laplace (double exponential)][@stdlib/random/base/laplace] distribution. ```javascript -var random = laplace.factory(); +const random = laplace.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = laplace.factory( 2.0, 5.0 ); +const random = laplace.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = laplace.factory(); +const random = laplace.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = laplace.factory( 2.0, 5.0, opts ); +const random = laplace.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = laplace.factory( 2.0, 5.0, opts ); +const random = laplace.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = laplace.factory( 2.0, 5.0 ); +const random = laplace.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = laplace.PRNG; +const prng = laplace.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = laplace.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = laplace.seed; +const seed = laplace.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = laplace.factory( 2.0, 5.0, { +const random = laplace.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = laplace.seedLength; +const len = laplace.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = laplace.factory( 2.0, 5.0, { +const random = laplace.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = laplace.state; +const state = laplace.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = laplace.factory( 2.0, 5.0, { +const random = laplace.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = laplace.stateLength; +const len = laplace.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = laplace.factory( 2.0, 5.0, { +const random = laplace.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = laplace.byteLength; +const sz = laplace.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = laplace.factory( 2.0, 5.0, { +const random = laplace.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var laplace = require( '@stdlib/random/array/laplace' ); +const logEach = require( '@stdlib/console/log-each' ); +const laplace = require( '@stdlib/random/array/laplace' ); // Create a function for generating random arrays originating from the same state: -var random = laplace.factory( 2.0, 5.0, { +let random = laplace.factory( 2.0, 5.0, { 'state': laplace.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = laplace.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/levy/README.md b/lib/node_modules/@stdlib/random/array/levy/README.md index 02ff0768d29a..deeb9584bd1a 100644 --- a/lib/node_modules/@stdlib/random/array/levy/README.md +++ b/lib/node_modules/@stdlib/random/array/levy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var levy = require( '@stdlib/random/array/levy' ); +const levy = require( '@stdlib/random/array/levy' ); ``` #### levy( len, mu, c\[, options] ) @@ -35,7 +35,7 @@ var levy = require( '@stdlib/random/array/levy' ); Returns an array containing pseudorandom numbers drawn from a [Lévy][@stdlib/random/base/levy] distribution. ```javascript -var out = levy( 10, 2.0, 5.0 ); +const out = levy( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = levy( 10, 2.0, 5.0, opts ); +const out = levy( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = levy( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Lévy][@stdlib/random/base/levy] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = levy.assign( 2.0, 5.0, x ); +const out = levy.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Lévy][@stdlib/random/base/levy] distribution. ```javascript -var random = levy.factory(); +const random = levy.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = levy.factory( 2.0, 5.0 ); +const random = levy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = levy.factory(); +const random = levy.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = levy.factory( 2.0, 5.0, opts ); +const random = levy.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = levy.factory( 2.0, 5.0, opts ); +const random = levy.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = levy.factory( 2.0, 5.0 ); +const random = levy.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = levy.PRNG; +const prng = levy.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = levy.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = levy.seed; +const seed = levy.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = levy.factory( 2.0, 5.0, { +const random = levy.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = levy.seedLength; +const len = levy.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = levy.factory( 2.0, 5.0, { +const random = levy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = levy.state; +const state = levy.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = levy.factory( 2.0, 5.0, { +const random = levy.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = levy.stateLength; +const len = levy.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = levy.factory( 2.0, 5.0, { +const random = levy.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = levy.byteLength; +const sz = levy.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = levy.factory( 2.0, 5.0, { +const random = levy.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var levy = require( '@stdlib/random/array/levy' ); +const logEach = require( '@stdlib/console/log-each' ); +const levy = require( '@stdlib/random/array/levy' ); // Create a function for generating random arrays originating from the same state: -var random = levy.factory( 2.0, 5.0, { +let random = levy.factory( 2.0, 5.0, { 'state': levy.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = levy.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/logistic/README.md b/lib/node_modules/@stdlib/random/array/logistic/README.md index 8fee54ba0213..296b83e4da44 100644 --- a/lib/node_modules/@stdlib/random/array/logistic/README.md +++ b/lib/node_modules/@stdlib/random/array/logistic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logistic = require( '@stdlib/random/array/logistic' ); +const logistic = require( '@stdlib/random/array/logistic' ); ``` #### logistic( len, mu, s\[, options] ) @@ -35,7 +35,7 @@ var logistic = require( '@stdlib/random/array/logistic' ); Returns an array containing pseudorandom numbers drawn from a [logistic][@stdlib/random/base/logistic] distribution. ```javascript -var out = logistic( 10, 2.0, 5.0 ); +const out = logistic( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = logistic( 10, 2.0, 5.0, opts ); +const out = logistic( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = logistic( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [logistic][@stdlib/random/base/logistic] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = logistic.assign( 2.0, 5.0, x ); +const out = logistic.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [logistic][@stdlib/random/base/logistic] distribution. ```javascript -var random = logistic.factory(); +const random = logistic.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = logistic.factory( 2.0, 5.0 ); +const random = logistic.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = logistic.factory(); +const random = logistic.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = logistic.factory( 2.0, 5.0, opts ); +const random = logistic.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = logistic.factory( 2.0, 5.0, opts ); +const random = logistic.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = logistic.factory( 2.0, 5.0 ); +const random = logistic.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = logistic.PRNG; +const prng = logistic.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = logistic.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = logistic.seed; +const seed = logistic.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = logistic.factory( 2.0, 5.0, { +const random = logistic.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = logistic.seedLength; +const len = logistic.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = logistic.factory( 2.0, 5.0, { +const random = logistic.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = logistic.state; +const state = logistic.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = logistic.factory( 2.0, 5.0, { +const random = logistic.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = logistic.stateLength; +const len = logistic.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = logistic.factory( 2.0, 5.0, { +const random = logistic.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = logistic.byteLength; +const sz = logistic.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = logistic.factory( 2.0, 5.0, { +const random = logistic.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var logistic = require( '@stdlib/random/array/logistic' ); +const logEach = require( '@stdlib/console/log-each' ); +const logistic = require( '@stdlib/random/array/logistic' ); // Create a function for generating random arrays originating from the same state: -var random = logistic.factory( 2.0, 5.0, { +let random = logistic.factory( 2.0, 5.0, { 'state': logistic.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = logistic.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/lognormal/README.md b/lib/node_modules/@stdlib/random/array/lognormal/README.md index c7c0a7c4ebcd..566446fd87ac 100644 --- a/lib/node_modules/@stdlib/random/array/lognormal/README.md +++ b/lib/node_modules/@stdlib/random/array/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lognormal = require( '@stdlib/random/array/lognormal' ); +const lognormal = require( '@stdlib/random/array/lognormal' ); ``` #### lognormal( len, mu, sigma\[, options] ) @@ -35,7 +35,7 @@ var lognormal = require( '@stdlib/random/array/lognormal' ); Returns an array containing pseudorandom numbers drawn from a [lognormal][@stdlib/random/base/lognormal] distribution. ```javascript -var out = lognormal( 10, 2.0, 5.0 ); +const out = lognormal( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = lognormal( 10, 2.0, 5.0, opts ); +const out = lognormal( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = lognormal( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [lognormal][@stdlib/random/base/lognormal] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = lognormal.assign( 2.0, 5.0, x ); +const out = lognormal.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [lognormal][@stdlib/random/base/lognormal] distribution. ```javascript -var random = lognormal.factory(); +const random = lognormal.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = lognormal.factory( 2.0, 5.0 ); +const random = lognormal.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = lognormal.factory(); +const random = lognormal.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = lognormal.factory( 2.0, 5.0, opts ); +const random = lognormal.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = lognormal.factory( 2.0, 5.0, opts ); +const random = lognormal.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = lognormal.factory( 2.0, 5.0 ); +const random = lognormal.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = lognormal.PRNG; +const prng = lognormal.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = lognormal.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = lognormal.seed; +const seed = lognormal.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = lognormal.factory( 2.0, 5.0, { +const random = lognormal.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = lognormal.seedLength; +const len = lognormal.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = lognormal.factory( 2.0, 5.0, { +const random = lognormal.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = lognormal.state; +const state = lognormal.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = lognormal.factory( 2.0, 5.0, { +const random = lognormal.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = lognormal.stateLength; +const len = lognormal.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = lognormal.factory( 2.0, 5.0, { +const random = lognormal.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = lognormal.byteLength; +const sz = lognormal.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = lognormal.factory( 2.0, 5.0, { +const random = lognormal.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var lognormal = require( '@stdlib/random/array/lognormal' ); +const logEach = require( '@stdlib/console/log-each' ); +const lognormal = require( '@stdlib/random/array/lognormal' ); // Create a function for generating random arrays originating from the same state: -var random = lognormal.factory( 2.0, 5.0, { +let random = lognormal.factory( 2.0, 5.0, { 'state': lognormal.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = lognormal.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/minstd-shuffle/README.md b/lib/node_modules/@stdlib/random/array/minstd-shuffle/README.md index 9ffdfe770af9..9f56fd8e2e03 100644 --- a/lib/node_modules/@stdlib/random/array/minstd-shuffle/README.md +++ b/lib/node_modules/@stdlib/random/array/minstd-shuffle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/array/minstd-shuffle' ); +const minstd = require( '@stdlib/random/array/minstd-shuffle' ); ``` #### minstd( len\[, options] ) @@ -35,7 +35,7 @@ var minstd = require( '@stdlib/random/array/minstd-shuffle' ); Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`. ```javascript -var out = minstd( 10 ); +const out = minstd( 10 ); // returns ``` @@ -51,11 +51,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = minstd( 10, opts ); +const out = minstd( 10, opts ); // returns [...] ``` @@ -64,7 +64,7 @@ var out = minstd( 10, opts ); Returns an array containing pseudorandom numbers on the interval `[0, 1)`. ```javascript -var out = minstd.normalized( 10 ); +const out = minstd.normalized( 10 ); // returns ``` @@ -80,11 +80,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = minstd.normalized( 10, opts ); +const out = minstd.normalized( 10, opts ); // returns [...] ``` @@ -93,12 +93,12 @@ var out = minstd.normalized( 10, opts ); Returns a function for creating arrays containing pseudorandom numbers generated using a [linear congruential pseudorandom number generator][@stdlib/random/base/minstd-shuffle] (LCG) whose output is shuffled. ```javascript -var random = minstd.factory(); +const random = minstd.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var len = out.length; +let len = out.length; // returns 10 out = random.normalized( 10 ); @@ -119,12 +119,12 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = minstd.factory( opts ); +const random = minstd.factory( opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -139,12 +139,12 @@ The returned function has a `normalized` method which accepts the following `opt To override the default output array data type, set the `dtype` option. ```javascript -var random = minstd.factory(); +const random = minstd.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -156,7 +156,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = minstd.PRNG; +const prng = minstd.PRNG; // returns ``` @@ -165,7 +165,7 @@ var prng = minstd.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = minstd.seed; +const seed = minstd.seed; // returns ``` @@ -174,7 +174,7 @@ var seed = minstd.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = minstd.seedLength; +const len = minstd.seedLength; // returns ``` @@ -183,7 +183,7 @@ var len = minstd.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = minstd.state; +const state = minstd.state; // returns ``` @@ -192,7 +192,7 @@ var state = minstd.state; Length of underlying pseudorandom number generator state. ```javascript -var len = minstd.stateLength; +const len = minstd.stateLength; // returns ``` @@ -201,7 +201,7 @@ var len = minstd.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = minstd.byteLength; +const sz = minstd.byteLength; // returns ``` @@ -229,19 +229,19 @@ var sz = minstd.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var minstd = require( '@stdlib/random/array/minstd-shuffle' ); +const logEach = require( '@stdlib/console/log-each' ); +const minstd = require( '@stdlib/random/array/minstd-shuffle' ); // Create a function for generating random arrays originating from the same state: -var random = minstd.factory({ +let random = minstd.factory({ 'state': minstd.state, 'copy': true }); // Generate 3 arrays: -var x1 = random.normalized( 5 ); -var x2 = random.normalized( 5 ); -var x3 = random.normalized( 5 ); +const x1 = random.normalized( 5 ); +const x2 = random.normalized( 5 ); +const x3 = random.normalized( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -253,7 +253,7 @@ random = minstd.factory({ }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random.normalized( 15 ); +const x4 = random.normalized( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/minstd/README.md b/lib/node_modules/@stdlib/random/array/minstd/README.md index 2cf782bc014a..6a8759db2ba7 100644 --- a/lib/node_modules/@stdlib/random/array/minstd/README.md +++ b/lib/node_modules/@stdlib/random/array/minstd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/array/minstd' ); +const minstd = require( '@stdlib/random/array/minstd' ); ``` #### minstd( len\[, options] ) @@ -35,7 +35,7 @@ var minstd = require( '@stdlib/random/array/minstd' ); Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`. ```javascript -var out = minstd( 10 ); +const out = minstd( 10 ); // returns ``` @@ -51,11 +51,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = minstd( 10, opts ); +const out = minstd( 10, opts ); // returns [...] ``` @@ -64,7 +64,7 @@ var out = minstd( 10, opts ); Returns an array containing pseudorandom numbers on the interval `[0, 1)`. ```javascript -var out = minstd.normalized( 10 ); +const out = minstd.normalized( 10 ); // returns ``` @@ -80,11 +80,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = minstd.normalized( 10, opts ); +const out = minstd.normalized( 10, opts ); // returns [...] ``` @@ -93,12 +93,12 @@ var out = minstd.normalized( 10, opts ); Returns a function for creating arrays containing pseudorandom numbers generated using a [linear congruential pseudorandom number generator][@stdlib/random/base/minstd] (LCG). ```javascript -var random = minstd.factory(); +const random = minstd.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var len = out.length; +let len = out.length; // returns 10 out = random.normalized( 10 ); @@ -119,12 +119,12 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = minstd.factory( opts ); +const random = minstd.factory( opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -139,12 +139,12 @@ The returned function has a `normalized` method which accepts the following `opt To override the default output array data type, set the `dtype` option. ```javascript -var random = minstd.factory(); +const random = minstd.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -156,7 +156,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = minstd.PRNG; +const prng = minstd.PRNG; // returns ``` @@ -165,7 +165,7 @@ var prng = minstd.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = minstd.seed; +const seed = minstd.seed; // returns ``` @@ -174,7 +174,7 @@ var seed = minstd.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = minstd.seedLength; +const len = minstd.seedLength; // returns ``` @@ -183,7 +183,7 @@ var len = minstd.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = minstd.state; +const state = minstd.state; // returns ``` @@ -192,7 +192,7 @@ var state = minstd.state; Length of underlying pseudorandom number generator state. ```javascript -var len = minstd.stateLength; +const len = minstd.stateLength; // returns ``` @@ -201,7 +201,7 @@ var len = minstd.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = minstd.byteLength; +const sz = minstd.byteLength; // returns ``` @@ -228,19 +228,19 @@ var sz = minstd.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var minstd = require( '@stdlib/random/array/minstd' ); +const logEach = require( '@stdlib/console/log-each' ); +const minstd = require( '@stdlib/random/array/minstd' ); // Create a function for generating random arrays originating from the same state: -var random = minstd.factory({ +let random = minstd.factory({ 'state': minstd.state, 'copy': true }); // Generate 3 arrays: -var x1 = random.normalized( 5 ); -var x2 = random.normalized( 5 ); -var x3 = random.normalized( 5 ); +const x1 = random.normalized( 5 ); +const x2 = random.normalized( 5 ); +const x3 = random.normalized( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -252,7 +252,7 @@ random = minstd.factory({ }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random.normalized( 15 ); +const x4 = random.normalized( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/mt19937/README.md b/lib/node_modules/@stdlib/random/array/mt19937/README.md index bcf52716cead..c90947cf6a89 100644 --- a/lib/node_modules/@stdlib/random/array/mt19937/README.md +++ b/lib/node_modules/@stdlib/random/array/mt19937/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mt19937 = require( '@stdlib/random/array/mt19937' ); +const mt19937 = require( '@stdlib/random/array/mt19937' ); ``` #### mt19937( len\[, options] ) @@ -35,7 +35,7 @@ var mt19937 = require( '@stdlib/random/array/mt19937' ); Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`. ```javascript -var out = mt19937( 10 ); +const out = mt19937( 10 ); // returns ``` @@ -51,11 +51,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = mt19937( 10, opts ); +const out = mt19937( 10, opts ); // returns [...] ``` @@ -64,7 +64,7 @@ var out = mt19937( 10, opts ); Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision. ```javascript -var out = mt19937.normalized( 10 ); +const out = mt19937.normalized( 10 ); // returns ``` @@ -80,11 +80,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = mt19937.normalized( 10, opts ); +const out = mt19937.normalized( 10, opts ); // returns [...] ``` @@ -93,12 +93,12 @@ var out = mt19937.normalized( 10, opts ); Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit [Mersenne Twister][@stdlib/random/base/mt19937] pseudorandom number generator. ```javascript -var random = mt19937.factory(); +const random = mt19937.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var len = out.length; +let len = out.length; // returns 10 out = random.normalized( 10 ); @@ -119,12 +119,12 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = mt19937.factory( opts ); +const random = mt19937.factory( opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -139,12 +139,12 @@ The returned function has a `normalized` method which accepts the following `opt To override the default output array data type, set the `dtype` option. ```javascript -var random = mt19937.factory(); +const random = mt19937.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -156,7 +156,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = mt19937.PRNG; +const prng = mt19937.PRNG; // returns ``` @@ -165,7 +165,7 @@ var prng = mt19937.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = mt19937.seed; +const seed = mt19937.seed; // returns ``` @@ -174,7 +174,7 @@ var seed = mt19937.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = mt19937.seedLength; +const len = mt19937.seedLength; // returns ``` @@ -183,7 +183,7 @@ var len = mt19937.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = mt19937.state; +const state = mt19937.state; // returns ``` @@ -192,7 +192,7 @@ var state = mt19937.state; Length of underlying pseudorandom number generator state. ```javascript -var len = mt19937.stateLength; +const len = mt19937.stateLength; // returns ``` @@ -201,7 +201,7 @@ var len = mt19937.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = mt19937.byteLength; +const sz = mt19937.byteLength; // returns ``` @@ -230,19 +230,19 @@ var sz = mt19937.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var mt19937 = require( '@stdlib/random/array/mt19937' ); +const logEach = require( '@stdlib/console/log-each' ); +const mt19937 = require( '@stdlib/random/array/mt19937' ); // Create a function for generating random arrays originating from the same state: -var random = mt19937.factory({ +let random = mt19937.factory({ 'state': mt19937.state, 'copy': true }); // Generate 3 arrays: -var x1 = random.normalized( 5 ); -var x2 = random.normalized( 5 ); -var x3 = random.normalized( 5 ); +const x1 = random.normalized( 5 ); +const x2 = random.normalized( 5 ); +const x3 = random.normalized( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -254,7 +254,7 @@ random = mt19937.factory({ }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random.normalized( 15 ); +const x4 = random.normalized( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/negative-binomial/README.md b/lib/node_modules/@stdlib/random/array/negative-binomial/README.md index 04b135719fe9..8a254d33c1c5 100644 --- a/lib/node_modules/@stdlib/random/array/negative-binomial/README.md +++ b/lib/node_modules/@stdlib/random/array/negative-binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var negativeBinomial = require( '@stdlib/random/array/negative-binomial' ); +const negativeBinomial = require( '@stdlib/random/array/negative-binomial' ); ``` #### negativeBinomial( len, r, p\[, options] ) @@ -35,7 +35,7 @@ var negativeBinomial = require( '@stdlib/random/array/negative-binomial' ); Returns an array containing pseudorandom numbers drawn from a [negative binomial][@stdlib/random/base/negative-binomial] distribution. ```javascript -var out = negativeBinomial( 10, 10, 0.5 ); +const out = negativeBinomial( 10, 10, 0.5 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = negativeBinomial( 10, 10, 0.5, opts ); +const out = negativeBinomial( 10, 10, 0.5, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = negativeBinomial( 10, 10, 0.5, opts ); Fills an array with pseudorandom numbers drawn from a [negative binomial][@stdlib/random/base/negative-binomial] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = negativeBinomial.assign( 10, 0.5, x ); +const out = negativeBinomial.assign( 10, 0.5, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [negative binomial][@stdlib/random/base/negative-binomial] distribution. ```javascript -var random = negativeBinomial.factory(); +const random = negativeBinomial.factory(); -var out = random( 10, 10, 0.5 ); +const out = random( 10, 10, 0.5 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = negativeBinomial.factory( 10, 0.5 ); +const random = negativeBinomial.factory( 10, 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = negativeBinomial.factory(); +const random = negativeBinomial.factory(); -var out = random( 10, 10, 0.5 ); +let out = random( 10, 10, 0.5 ); // returns out = random( 10, 10, 0.5 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = negativeBinomial.factory( 10, 0.5, opts ); +const random = negativeBinomial.factory( 10, 0.5, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = negativeBinomial.factory( 10, 0.5, opts ); +const random = negativeBinomial.factory( 10, 0.5, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = negativeBinomial.factory( 10, 0.5 ); +const random = negativeBinomial.factory( 10, 0.5 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = negativeBinomial.PRNG; +const prng = negativeBinomial.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = negativeBinomial.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = negativeBinomial.seed; +const seed = negativeBinomial.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = negativeBinomial.factory( 10, 0.5, { +const random = negativeBinomial.factory( 10, 0.5, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = negativeBinomial.seedLength; +const len = negativeBinomial.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = negativeBinomial.factory( 10, 0.5, { +const random = negativeBinomial.factory( 10, 0.5, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = negativeBinomial.state; +const state = negativeBinomial.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = negativeBinomial.factory( 10, 0.5, { +const random = negativeBinomial.factory( 10, 0.5, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = negativeBinomial.stateLength; +const len = negativeBinomial.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = negativeBinomial.factory( 10, 0.5, { +const random = negativeBinomial.factory( 10, 0.5, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = negativeBinomial.byteLength; +const sz = negativeBinomial.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = negativeBinomial.factory( 10, 0.5, { +const random = negativeBinomial.factory( 10, 0.5, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var negativeBinomial = require( '@stdlib/random/array/negative-binomial' ); +const logEach = require( '@stdlib/console/log-each' ); +const negativeBinomial = require( '@stdlib/random/array/negative-binomial' ); // Create a function for generating random arrays originating from the same state: -var random = negativeBinomial.factory( 10, 0.5, { +let random = negativeBinomial.factory( 10, 0.5, { 'state': negativeBinomial.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = negativeBinomial.factory( 10, 0.5, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/normal/README.md b/lib/node_modules/@stdlib/random/array/normal/README.md index 861bbecb3ef5..8f5bf8af1dce 100644 --- a/lib/node_modules/@stdlib/random/array/normal/README.md +++ b/lib/node_modules/@stdlib/random/array/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normal = require( '@stdlib/random/array/normal' ); +const normal = require( '@stdlib/random/array/normal' ); ``` #### normal( len, mu, sigma\[, options] ) @@ -35,7 +35,7 @@ var normal = require( '@stdlib/random/array/normal' ); Returns an array containing pseudorandom numbers drawn from a [normal][@stdlib/random/base/normal] distribution. ```javascript -var out = normal( 10, 2.0, 5.0 ); +const out = normal( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = normal( 10, 2.0, 5.0, opts ); +const out = normal( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = normal( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [normal][@stdlib/random/base/normal] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = normal.assign( 2.0, 5.0, x ); +const out = normal.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [normal][@stdlib/random/base/normal] distribution. ```javascript -var random = normal.factory(); +const random = normal.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = normal.factory( 2.0, 5.0 ); +const random = normal.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = normal.factory(); +const random = normal.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = normal.factory( 2.0, 5.0, opts ); +const random = normal.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = normal.factory( 2.0, 5.0, opts ); +const random = normal.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = normal.factory( 2.0, 5.0 ); +const random = normal.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = normal.PRNG; +const prng = normal.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = normal.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = normal.seed; +const seed = normal.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = normal.factory( 2.0, 5.0, { +const random = normal.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = normal.seedLength; +const len = normal.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = normal.factory( 2.0, 5.0, { +const random = normal.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = normal.state; +const state = normal.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = normal.factory( 2.0, 5.0, { +const random = normal.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = normal.stateLength; +const len = normal.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = normal.factory( 2.0, 5.0, { +const random = normal.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = normal.byteLength; +const sz = normal.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = normal.factory( 2.0, 5.0, { +const random = normal.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var normal = require( '@stdlib/random/array/normal' ); +const logEach = require( '@stdlib/console/log-each' ); +const normal = require( '@stdlib/random/array/normal' ); // Create a function for generating random arrays originating from the same state: -var random = normal.factory( 2.0, 5.0, { +let random = normal.factory( 2.0, 5.0, { 'state': normal.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = normal.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/pareto-type1/README.md b/lib/node_modules/@stdlib/random/array/pareto-type1/README.md index da39f2846810..fb6bbcbeb300 100644 --- a/lib/node_modules/@stdlib/random/array/pareto-type1/README.md +++ b/lib/node_modules/@stdlib/random/array/pareto-type1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pareto1 = require( '@stdlib/random/array/pareto-type1' ); +const pareto1 = require( '@stdlib/random/array/pareto-type1' ); ``` #### pareto1( len, alpha, beta\[, options] ) @@ -35,7 +35,7 @@ var pareto1 = require( '@stdlib/random/array/pareto-type1' ); Returns an array containing pseudorandom numbers drawn from a [Pareto (Type I)][@stdlib/random/base/pareto-type1] distribution. ```javascript -var out = pareto1( 10, 2.0, 5.0 ); +const out = pareto1( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = pareto1( 10, 2.0, 5.0, opts ); +const out = pareto1( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = pareto1( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Pareto (Type I)][@stdlib/random/base/pareto-type1] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = pareto1.assign( 2.0, 5.0, x ); +const out = pareto1.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Pareto (Type I)][@stdlib/random/base/pareto-type1] distribution. ```javascript -var random = pareto1.factory(); +const random = pareto1.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = pareto1.factory( 2.0, 5.0 ); +const random = pareto1.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = pareto1.factory(); +const random = pareto1.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = pareto1.factory( 2.0, 5.0, opts ); +const random = pareto1.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = pareto1.factory( 2.0, 5.0, opts ); +const random = pareto1.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = pareto1.factory( 2.0, 5.0 ); +const random = pareto1.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = pareto1.PRNG; +const prng = pareto1.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = pareto1.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = pareto1.seed; +const seed = pareto1.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = pareto1.factory( 2.0, 5.0, { +const random = pareto1.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = pareto1.seedLength; +const len = pareto1.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = pareto1.factory( 2.0, 5.0, { +const random = pareto1.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = pareto1.state; +const state = pareto1.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = pareto1.factory( 2.0, 5.0, { +const random = pareto1.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = pareto1.stateLength; +const len = pareto1.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = pareto1.factory( 2.0, 5.0, { +const random = pareto1.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = pareto1.byteLength; +const sz = pareto1.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = pareto1.factory( 2.0, 5.0, { +const random = pareto1.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var pareto1 = require( '@stdlib/random/array/pareto-type1' ); +const logEach = require( '@stdlib/console/log-each' ); +const pareto1 = require( '@stdlib/random/array/pareto-type1' ); // Create a function for generating random arrays originating from the same state: -var random = pareto1.factory( 2.0, 5.0, { +let random = pareto1.factory( 2.0, 5.0, { 'state': pareto1.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = pareto1.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/poisson/README.md b/lib/node_modules/@stdlib/random/array/poisson/README.md index 3ca9c6fae5e9..b36709e12ebe 100644 --- a/lib/node_modules/@stdlib/random/array/poisson/README.md +++ b/lib/node_modules/@stdlib/random/array/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var poisson = require( '@stdlib/random/array/poisson' ); +const poisson = require( '@stdlib/random/array/poisson' ); ``` #### poisson( len, lambda\[, options] ) @@ -35,7 +35,7 @@ var poisson = require( '@stdlib/random/array/poisson' ); Returns an array containing pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. ```javascript -var out = poisson( 10, 2.0 ); +const out = poisson( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = poisson( 10, 2.0, opts ); +const out = poisson( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = poisson( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = poisson.assign( 2.0, x ); +const out = poisson.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. ```javascript -var random = poisson.factory(); +const random = poisson.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `lambda`, the returned generator returns random variates from the specified distribution. ```javascript -var random = poisson.factory( 2.0 ); +const random = poisson.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `lambda`, the returned generator requires that `lambda` be provided at each invocation. ```javascript -var random = poisson.factory(); +const random = poisson.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = poisson.factory( 2.0, opts ); +const random = poisson.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = poisson.factory( 2.0, opts ); +const random = poisson.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = poisson.factory( 2.0 ); +const random = poisson.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = poisson.PRNG; +const prng = poisson.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = poisson.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = poisson.seed; +const seed = poisson.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory( 2.0, { +const random = poisson.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = poisson.seedLength; +const len = poisson.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory( 2.0, { +const random = poisson.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = poisson.state; +const state = poisson.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory( 2.0, { +const random = poisson.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = poisson.stateLength; +const len = poisson.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory( 2.0, { +const random = poisson.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = poisson.byteLength; +const sz = poisson.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory( 2.0, { +const random = poisson.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var poisson = require( '@stdlib/random/array/poisson' ); +const logEach = require( '@stdlib/console/log-each' ); +const poisson = require( '@stdlib/random/array/poisson' ); // Create a function for generating random arrays originating from the same state: -var random = poisson.factory( 2.0, { +let random = poisson.factory( 2.0, { 'state': poisson.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = poisson.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/randu/README.md b/lib/node_modules/@stdlib/random/array/randu/README.md index 059b9e224964..83ad1f003651 100644 --- a/lib/node_modules/@stdlib/random/array/randu/README.md +++ b/lib/node_modules/@stdlib/random/array/randu/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randu = require( '@stdlib/random/array/randu' ); +const randu = require( '@stdlib/random/array/randu' ); ``` #### randu( len\[, options] ) @@ -35,7 +35,7 @@ var randu = require( '@stdlib/random/array/randu' ); Returns an array containing [uniformly][@stdlib/random/base/randu] distributed pseudorandom numbers between `0` and `1`. ```javascript -var out = randu( 10 ); +const out = randu( 10 ); // returns ``` @@ -51,11 +51,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = randu( 10, opts ); +const out = randu( 10, opts ); // returns [...] ``` @@ -64,12 +64,12 @@ var out = randu( 10, opts ); Returns a function for creating arrays containing [uniformly][@stdlib/random/base/randu] distributed pseudorandom numbers between `0` and `1`. ```javascript -var random = randu.factory(); +const random = randu.factory(); -var out = random( 10 ); +const out = random( 10 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` @@ -94,24 +94,24 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var opts = { +const opts = { 'name': 'minstd-shuffle' }; -var random = randu.factory( opts ); +const random = randu.factory( opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = randu.factory( opts ); +const random = randu.factory( opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -122,12 +122,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = randu.factory(); +const random = randu.factory(); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -139,7 +139,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = randu.PRNG; +const prng = randu.PRNG; // returns ``` @@ -148,7 +148,7 @@ var prng = randu.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = randu.seed; +const seed = randu.seed; ``` #### randu.seedLength @@ -156,7 +156,7 @@ var seed = randu.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = randu.seedLength; +const len = randu.seedLength; // returns ``` @@ -165,7 +165,7 @@ var len = randu.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = randu.state; +const state = randu.state; ``` #### randu.stateLength @@ -173,7 +173,7 @@ var state = randu.state; Length of underlying pseudorandom number generator state. ```javascript -var len = randu.stateLength; +const len = randu.stateLength; // returns ``` @@ -182,7 +182,7 @@ var len = randu.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = randu.byteLength; +const sz = randu.byteLength; // returns ``` @@ -209,19 +209,19 @@ var sz = randu.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var randu = require( '@stdlib/random/array/randu' ); +const logEach = require( '@stdlib/console/log-each' ); +const randu = require( '@stdlib/random/array/randu' ); // Create a function for generating random arrays originating from the same state: -var random = randu.factory({ +let random = randu.factory({ 'state': randu.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -233,7 +233,7 @@ random = randu.factory({ }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/rayleigh/README.md b/lib/node_modules/@stdlib/random/array/rayleigh/README.md index a2327d81340a..b485ed87a7e4 100644 --- a/lib/node_modules/@stdlib/random/array/rayleigh/README.md +++ b/lib/node_modules/@stdlib/random/array/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rayleigh = require( '@stdlib/random/array/rayleigh' ); +const rayleigh = require( '@stdlib/random/array/rayleigh' ); ``` #### rayleigh( len, sigma\[, options] ) @@ -35,7 +35,7 @@ var rayleigh = require( '@stdlib/random/array/rayleigh' ); Returns an array containing pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution. ```javascript -var out = rayleigh( 10, 2.0 ); +const out = rayleigh( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = rayleigh( 10, 2.0, opts ); +const out = rayleigh( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = rayleigh( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = rayleigh.assign( 2.0, x ); +const out = rayleigh.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution. ```javascript -var random = rayleigh.factory(); +const random = rayleigh.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `sigma`, the returned generator returns random variates from the specified distribution. ```javascript -var random = rayleigh.factory( 2.0 ); +const random = rayleigh.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `sigma`, the returned generator requires that `sigma` be provided at each invocation. ```javascript -var random = rayleigh.factory(); +const random = rayleigh.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = rayleigh.factory( 2.0, opts ); +const random = rayleigh.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = rayleigh.factory( 2.0, opts ); +const random = rayleigh.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = rayleigh.factory( 2.0 ); +const random = rayleigh.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = rayleigh.PRNG; +const prng = rayleigh.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = rayleigh.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = rayleigh.seed; +const seed = rayleigh.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory( 2.0, { +const random = rayleigh.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = rayleigh.seedLength; +const len = rayleigh.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory( 2.0, { +const random = rayleigh.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = rayleigh.state; +const state = rayleigh.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory( 2.0, { +const random = rayleigh.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = rayleigh.stateLength; +const len = rayleigh.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory( 2.0, { +const random = rayleigh.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = rayleigh.byteLength; +const sz = rayleigh.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory( 2.0, { +const random = rayleigh.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var rayleigh = require( '@stdlib/random/array/rayleigh' ); +const logEach = require( '@stdlib/console/log-each' ); +const rayleigh = require( '@stdlib/random/array/rayleigh' ); // Create a function for generating random arrays originating from the same state: -var random = rayleigh.factory( 2.0, { +let random = rayleigh.factory( 2.0, { 'state': rayleigh.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = rayleigh.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/t/README.md b/lib/node_modules/@stdlib/random/array/t/README.md index cc77e78123de..d7cc4334c988 100644 --- a/lib/node_modules/@stdlib/random/array/t/README.md +++ b/lib/node_modules/@stdlib/random/array/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var t = require( '@stdlib/random/array/t' ); +const t = require( '@stdlib/random/array/t' ); ``` #### t( len, v\[, options] ) @@ -35,7 +35,7 @@ var t = require( '@stdlib/random/array/t' ); Returns an array containing pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution. ```javascript -var out = t( 10, 2.0 ); +const out = t( 10, 2.0 ); // returns ``` @@ -52,11 +52,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = t( 10, 2.0, opts ); +const out = t( 10, 2.0, opts ); // returns [...] ``` @@ -65,15 +65,15 @@ var out = t( 10, 2.0, opts ); Fills an array with pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = t.assign( 2.0, x ); +const out = t.assign( 2.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -87,21 +87,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution. ```javascript -var random = t.factory(); +const random = t.factory(); -var out = random( 10, 2.0 ); +const out = random( 10, 2.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided `v`, the returned generator returns random variates from the specified distribution. ```javascript -var random = t.factory( 2.0 ); +const random = t.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -111,9 +111,9 @@ out = random( 10 ); If not provided `v`, the returned generator requires that `v` be provided at each invocation. ```javascript -var random = t.factory(); +const random = t.factory(); -var out = random( 10, 2.0 ); +let out = random( 10, 2.0 ); // returns out = random( 10, 2.0 ); @@ -131,26 +131,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = t.factory( 2.0, opts ); +const random = t.factory( 2.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = t.factory( 2.0, opts ); +const random = t.factory( 2.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -161,12 +161,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = t.factory( 2.0 ); +const random = t.factory( 2.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -178,7 +178,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = t.PRNG; +const prng = t.PRNG; // returns ``` @@ -187,20 +187,20 @@ var prng = t.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = t.seed; +const seed = t.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory( 2.0, { +const random = t.factory( 2.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -209,20 +209,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = t.seedLength; +const len = t.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory( 2.0, { +const random = t.factory( 2.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -231,20 +231,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = t.state; +const state = t.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory( 2.0, { +const random = t.factory( 2.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -253,20 +253,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = t.stateLength; +const len = t.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory( 2.0, { +const random = t.factory( 2.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -275,20 +275,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = t.byteLength; +const sz = t.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory( 2.0, { +const random = t.factory( 2.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -314,19 +314,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var t = require( '@stdlib/random/array/t' ); +const logEach = require( '@stdlib/console/log-each' ); +const t = require( '@stdlib/random/array/t' ); // Create a function for generating random arrays originating from the same state: -var random = t.factory( 2.0, { +let random = t.factory( 2.0, { 'state': t.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -338,7 +338,7 @@ random = t.factory( 2.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/tools/README.md b/lib/node_modules/@stdlib/random/array/tools/README.md index 01fcc20d6d21..073e06bd878c 100644 --- a/lib/node_modules/@stdlib/random/array/tools/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/array/tools' ); +const ns = require( '@stdlib/random/array/tools' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/array/tools' ); Namespace containing array creation pseudorandom number generator (PRNG) function tools. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -68,17 +68,17 @@ The namespace contains the following: ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); -var randn = require( '@stdlib/random/base/improved-ziggurat' ); -var ns = require( '@stdlib/random/array/tools' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const randn = require( '@stdlib/random/base/improved-ziggurat' ); +const ns = require( '@stdlib/random/array/tools' ); // Create a binary PRNG array: -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var rand = new ns.binary( arcsine, dtypes, defaultDType ); -var x = rand.generate( 10, 2.0, 5.0 ); +let rand = new ns.binary( arcsine, dtypes, defaultDType ); +let x = rand.generate( 10, 2.0, 5.0 ); // e.g., returns [ ~3.65, ~4.34, ~3.52, ~4.68, ~2.62, ... ] // Create a unary PRNG array: diff --git a/lib/node_modules/@stdlib/random/array/tools/binary-factory/README.md b/lib/node_modules/@stdlib/random/array/tools/binary-factory/README.md index e16a0e6d681c..46ce0c9d3935 100644 --- a/lib/node_modules/@stdlib/random/array/tools/binary-factory/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/binary-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' ); +const binaryFactory = require( '@stdlib/random/array/tools/binary-factory' ); ``` #### binaryFactory( prng, dtypes, dtype ) @@ -35,11 +35,11 @@ var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' ); Returns a factory function for generating pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, 'float64' ); +const factory = binaryFactory( arcsine, dtypes, 'float64' ); // returns ``` @@ -56,14 +56,14 @@ The function has the following parameters: Returns a function for generating pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -92,17 +92,17 @@ If provided PRNG parameters, the function returns a partially applied function f Returns an array of pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0, 5.0 ); +const v = random( 10, 2.0, 5.0 ); // returns ``` @@ -118,17 +118,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0, 5.0, { +const v = random( 10, 2.0, 5.0, { 'dtype': 'float32' }); // returns @@ -139,24 +139,24 @@ var v = random( 10, 2.0, 5.0, { Fills an array with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var zeros = require( '@stdlib/array/zeros' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, 5.0, out ); +const v = random.assign( 2.0, 5.0, out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -173,17 +173,17 @@ The method has the following parameters: Returns an array of pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0 ); +const random = factory( 2.0, 5.0 ); // returns -var v = random( 10 ); +let v = random( 10 ); // returns v = random( 10 ); @@ -200,17 +200,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0 ); +const random = factory( 2.0, 5.0 ); // returns -var v = random( 10, { +let v = random( 10, { 'dtype': 'float32' }); // returns @@ -226,24 +226,24 @@ v = random( 10, { Fills an array with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var zeros = require( '@stdlib/array/zeros' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0 ); +const random = factory( 2.0, 5.0 ); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( out ); +const v = random.assign( out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -258,17 +258,17 @@ The method has the following parameters: The underlying pseudorandom number generator. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -277,37 +277,37 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -316,37 +316,37 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -355,37 +355,37 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -394,37 +394,37 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -433,37 +433,37 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); +const factory = binaryFactory( arcsine, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -486,19 +486,19 @@ var sz = random.byteLength; ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const binaryFactory = require( '@stdlib/random/array/tools/binary-factory' ); -var dt = dtypes( 'real_floating_point_and_generic' ); +const dt = dtypes( 'real_floating_point_and_generic' ); -var factory = binaryFactory( arcsine, dt, 'float64' ); +const factory = binaryFactory( arcsine, dt, 'float64' ); // returns -var random = factory(); +const random = factory(); // returns -var x = random( 10, 2.0, 5.0 ); +let x = random( 10, 2.0, 5.0 ); // returns x = random( 10, 2.0, 5.0, { diff --git a/lib/node_modules/@stdlib/random/array/tools/binary/README.md b/lib/node_modules/@stdlib/random/array/tools/binary/README.md index 1cdc0df420bd..53b3ac72d70d 100644 --- a/lib/node_modules/@stdlib/random/array/tools/binary/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/binary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var Random = require( '@stdlib/random/array/tools/binary' ); +const Random = require( '@stdlib/random/array/tools/binary' ); ``` #### Random( prng, dtypes, dtype ) @@ -35,12 +35,12 @@ var Random = require( '@stdlib/random/array/tools/binary' ); Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( arcsine, dtypes, defaultDType ); +const random = new Random( arcsine, dtypes, defaultDType ); ``` The constructor has the following parameters: @@ -54,14 +54,14 @@ The constructor has the following parameters: Returns an array filled with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( arcsine, dtypes, defaultDType ); +const random = new Random( arcsine, dtypes, defaultDType ); -var v = random.generate( 10, 2.0, 5.0 ); +const v = random.generate( 10, 2.0, 5.0 ); // returns ``` @@ -79,14 +79,14 @@ The method accepts the following options: By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( arcsine, dtypes, defaultDType ); +const random = new Random( arcsine, dtypes, defaultDType ); -var v = random.generate( 10, 2.0, 5.0, { +const v = random.generate( 10, 2.0, 5.0, { 'dtype': 'float32' }); // returns @@ -97,21 +97,21 @@ var v = random.generate( 10, 2.0, 5.0, { Fills an array with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var zeros = require( '@stdlib/array/zeros' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( arcsine, dtypes, defaultDType ); +const random = new Random( arcsine, dtypes, defaultDType ); -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, 5.0, out ); +const v = random.assign( 2.0, 5.0, out ); // returns -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -138,14 +138,14 @@ The method has the following parameters: ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var Random = require( '@stdlib/random/array/tools/binary' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const Random = require( '@stdlib/random/array/tools/binary' ); -var dt = dtypes( 'real_floating_point_and_generic' ); -var random = new Random( arcsine, dt, 'float64' ); +const dt = dtypes( 'real_floating_point_and_generic' ); +const random = new Random( arcsine, dt, 'float64' ); -var x = random.generate( 10, 2.0, 5.0 ); +let x = random.generate( 10, 2.0, 5.0 ); // returns x = random.generate( 10, 2.0, 5.0, { diff --git a/lib/node_modules/@stdlib/random/array/tools/nullary/README.md b/lib/node_modules/@stdlib/random/array/tools/nullary/README.md index b1439e01b2de..a81b7fd895ea 100644 --- a/lib/node_modules/@stdlib/random/array/tools/nullary/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/nullary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var Random = require( '@stdlib/random/array/tools/nullary' ); +const Random = require( '@stdlib/random/array/tools/nullary' ); ``` #### Random( prng, dtypes, dtype ) @@ -35,12 +35,12 @@ var Random = require( '@stdlib/random/array/tools/nullary' ); Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +const random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); ``` The constructor has the following parameters: @@ -54,14 +54,14 @@ The constructor has the following parameters: Returns an array filled with pseudorandom values drawn from a nullary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +const random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); -var v = random.generate( 10 ); +const v = random.generate( 10 ); // returns ``` @@ -77,14 +77,14 @@ The method accepts the following options: By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +const random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); -var v = random.generate( 10, { +const v = random.generate( 10, { 'dtype': 'float32' }); // returns @@ -95,21 +95,21 @@ var v = random.generate( 10, { Fills an array with pseudorandom values drawn from a nullary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var zeros = require( '@stdlib/array/zeros' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +const random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( out ); +const v = random.assign( out ); // returns -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -134,14 +134,14 @@ The method has the following parameters: ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var Random = require( '@stdlib/random/array/tools/nullary' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const Random = require( '@stdlib/random/array/tools/nullary' ); -var dt = dtypes( 'real_floating_point_and_generic' ); -var random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); +const dt = dtypes( 'real_floating_point_and_generic' ); +const random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); -var x = random.generate( 10 ); +let x = random.generate( 10 ); // returns x = random.generate( 10, { diff --git a/lib/node_modules/@stdlib/random/array/tools/ternary-factory/README.md b/lib/node_modules/@stdlib/random/array/tools/ternary-factory/README.md index 1793f8a6788c..f1bf59dbe696 100644 --- a/lib/node_modules/@stdlib/random/array/tools/ternary-factory/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/ternary-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' ); +const ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' ); ``` #### ternaryFactory( prng, dtypes, dtype ) @@ -35,11 +35,11 @@ var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' ); Returns a factory function for generating pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, 'float64' ); +const factory = ternaryFactory( triangular, dtypes, 'float64' ); // returns ``` @@ -56,14 +56,14 @@ The function has the following parameters: Returns a function for generating pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -93,17 +93,17 @@ If provided PRNG parameters, the function returns a partially applied function f Returns an array of pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0, 5.0, 3.33 ); +const v = random( 10, 2.0, 5.0, 3.33 ); // returns ``` @@ -120,17 +120,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0, 5.0, 3.33, { +const v = random( 10, 2.0, 5.0, 3.33, { 'dtype': 'float32' }); // returns @@ -141,24 +141,24 @@ var v = random( 10, 2.0, 5.0, 3.33, { Fills an array with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var zeros = require( '@stdlib/array/zeros' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, 5.0, 3.33, out ); +const v = random.assign( 2.0, 5.0, 3.33, out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -176,17 +176,17 @@ The method has the following parameters: Returns an array of pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0, 3.33 ); +const random = factory( 2.0, 5.0, 3.33 ); // returns -var v = random( 10 ); +let v = random( 10 ); // returns v = random( 10 ); @@ -203,17 +203,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0, 3.33 ); +const random = factory( 2.0, 5.0, 3.33 ); // returns -var v = random( 10, { +let v = random( 10, { 'dtype': 'float32' }); // returns @@ -229,24 +229,24 @@ v = random( 10, { Fills an array with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var zeros = require( '@stdlib/array/zeros' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0, 5.0, 3.33 ); +const random = factory( 2.0, 5.0, 3.33 ); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( out ); +const v = random.assign( out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -261,17 +261,17 @@ The method has the following parameters: The underlying pseudorandom number generator. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -280,37 +280,37 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -319,37 +319,37 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -358,37 +358,37 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -397,37 +397,37 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -436,37 +436,37 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); +const factory = ternaryFactory( triangular, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -489,19 +489,19 @@ var sz = random.byteLength; ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' ); -var dt = dtypes( 'real_floating_point_and_generic' ); +const dt = dtypes( 'real_floating_point_and_generic' ); -var factory = ternaryFactory( triangular, dt, 'float64' ); +const factory = ternaryFactory( triangular, dt, 'float64' ); // returns -var random = factory(); +const random = factory(); // returns -var x = random( 10, 2.0, 5.0, 3.33 ); +let x = random( 10, 2.0, 5.0, 3.33 ); // returns x = random( 10, 2.0, 5.0, 3.33, { diff --git a/lib/node_modules/@stdlib/random/array/tools/ternary/README.md b/lib/node_modules/@stdlib/random/array/tools/ternary/README.md index 4de17052c0da..f2d4fa1f8eff 100644 --- a/lib/node_modules/@stdlib/random/array/tools/ternary/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/ternary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var Random = require( '@stdlib/random/array/tools/ternary' ); +const Random = require( '@stdlib/random/array/tools/ternary' ); ``` #### Random( prng, dtypes, dtype ) @@ -35,12 +35,12 @@ var Random = require( '@stdlib/random/array/tools/ternary' ); Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( triangular, dtypes, defaultDType ); +const random = new Random( triangular, dtypes, defaultDType ); ``` The constructor has the following parameters: @@ -54,14 +54,14 @@ The constructor has the following parameters: Returns an array filled with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( triangular, dtypes, defaultDType ); +const random = new Random( triangular, dtypes, defaultDType ); -var v = random.generate( 10, 2.0, 5.0, 3.33 ); +const v = random.generate( 10, 2.0, 5.0, 3.33 ); // returns ``` @@ -80,14 +80,14 @@ The method accepts the following options: By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( triangular, dtypes, defaultDType ); +const random = new Random( triangular, dtypes, defaultDType ); -var v = random.generate( 10, 2.0, 5.0, 3.33, { +const v = random.generate( 10, 2.0, 5.0, 3.33, { 'dtype': 'float32' }); // returns @@ -98,21 +98,21 @@ var v = random.generate( 10, 2.0, 5.0, 3.33, { Fills an array with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var zeros = require( '@stdlib/array/zeros' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( triangular, dtypes, defaultDType ); +const random = new Random( triangular, dtypes, defaultDType ); -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, 5.0, 3.33, out ); +const v = random.assign( 2.0, 5.0, 3.33, out ); // returns -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -140,14 +140,14 @@ The method has the following parameters: ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var Random = require( '@stdlib/random/array/tools/ternary' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const Random = require( '@stdlib/random/array/tools/ternary' ); -var dt = dtypes( 'real_floating_point_and_generic' ); -var random = new Random( triangular, dt, 'float64' ); +const dt = dtypes( 'real_floating_point_and_generic' ); +const random = new Random( triangular, dt, 'float64' ); -var x = random.generate( 10, 2.0, 5.0, 3.33 ); +let x = random.generate( 10, 2.0, 5.0, 3.33 ); // returns x = random.generate( 10, 2.0, 5.0, 3.33, { diff --git a/lib/node_modules/@stdlib/random/array/tools/unary-factory/README.md b/lib/node_modules/@stdlib/random/array/tools/unary-factory/README.md index 3869a36b574b..b48efca4481a 100644 --- a/lib/node_modules/@stdlib/random/array/tools/unary-factory/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/unary-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); +const unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); ``` #### unaryFactory( prng, dtypes, dtype ) @@ -35,11 +35,11 @@ var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); Returns a factory function for generating pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, 'float64' ); +const factory = unaryFactory( exponential, dtypes, 'float64' ); // returns ``` @@ -56,14 +56,14 @@ The function has the following parameters: Returns a function for generating pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -89,17 +89,17 @@ The function supports the following options: Returns an array of pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0 ); +const v = random( 10, 2.0 ); // returns ``` @@ -114,17 +114,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var v = random( 10, 2.0, { +const v = random( 10, 2.0, { 'dtype': 'float32' }); // returns @@ -135,24 +135,24 @@ var v = random( 10, 2.0, { Fills an array with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var zeros = require( '@stdlib/array/zeros' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, out ); +const v = random.assign( 2.0, out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -168,17 +168,17 @@ The method has the following parameters: Returns an array of pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0 ); +const random = factory( 2.0 ); // returns -var v = random( 10 ); +let v = random( 10 ); // returns v = random( 10 ); @@ -195,17 +195,17 @@ The function accepts the following options: - **dtype**: output array data type. Setting this option overrides the default output array data type. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0 ); +const random = factory( 2.0 ); // returns -var v = random( 10, { +let v = random( 10, { 'dtype': 'float32' }); // returns @@ -221,24 +221,24 @@ v = random( 10, { Fills an array with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var zeros = require( '@stdlib/array/zeros' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory( 2.0 ); +const random = factory( 2.0 ); // returns -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( out ); +const v = random.assign( out ); // returns -var bool = ( out === v ); +const bool = ( out === v ); // returns true ``` @@ -253,17 +253,17 @@ The method has the following parameters: The underlying pseudorandom number generator. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -272,37 +272,37 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -311,37 +311,37 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -350,37 +350,37 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -389,37 +389,37 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -428,37 +428,37 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; +const dtypes = [ 'float64', 'float32', 'generic' ]; -var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +const factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -481,19 +481,19 @@ var sz = random.byteLength; ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); -var dt = dtypes( 'real_floating_point_and_generic' ); +const dt = dtypes( 'real_floating_point_and_generic' ); -var factory = unaryFactory( exponential, dt, 'float64' ); +const factory = unaryFactory( exponential, dt, 'float64' ); // returns -var random = factory(); +const random = factory(); // returns -var x = random( 10, 2.0 ); +let x = random( 10, 2.0 ); // returns x = random( 10, 2.0, { diff --git a/lib/node_modules/@stdlib/random/array/tools/unary/README.md b/lib/node_modules/@stdlib/random/array/tools/unary/README.md index 94c596834545..d9aa30bb04b3 100644 --- a/lib/node_modules/@stdlib/random/array/tools/unary/README.md +++ b/lib/node_modules/@stdlib/random/array/tools/unary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var Random = require( '@stdlib/random/array/tools/unary' ); +const Random = require( '@stdlib/random/array/tools/unary' ); ``` #### Random( prng, dtypes, dtype ) @@ -35,12 +35,12 @@ var Random = require( '@stdlib/random/array/tools/unary' ); Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential, dtypes, defaultDType ); +const random = new Random( exponential, dtypes, defaultDType ); ``` The constructor has the following parameters: @@ -54,14 +54,14 @@ The constructor has the following parameters: Returns an array filled with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential, dtypes, defaultDType ); +const random = new Random( exponential, dtypes, defaultDType ); -var v = random.generate( 10, 2.0 ); +const v = random.generate( 10, 2.0 ); // returns ``` @@ -78,14 +78,14 @@ The method accepts the following options: By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential, dtypes, defaultDType ); +const random = new Random( exponential, dtypes, defaultDType ); -var v = random.generate( 10, 2.0, { +const v = random.generate( 10, 2.0, { 'dtype': 'float32' }); // returns @@ -96,21 +96,21 @@ var v = random.generate( 10, 2.0, { Fills an array with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var zeros = require( '@stdlib/array/zeros' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); -var dtypes = [ 'float64', 'float32', 'generic' ]; -var defaultDType = 'float64'; +const dtypes = [ 'float64', 'float32', 'generic' ]; +const defaultDType = 'float64'; -var random = new Random( exponential, dtypes, defaultDType ); +const random = new Random( exponential, dtypes, defaultDType ); -var out = zeros( 10, 'float64' ); +const out = zeros( 10, 'float64' ); // returns -var v = random.assign( 2.0, out ); +const v = random.assign( 2.0, out ); // returns -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -136,14 +136,14 @@ The method has the following parameters: ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var dtypes = require( '@stdlib/array/dtypes' ); -var Random = require( '@stdlib/random/array/tools/unary' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const Random = require( '@stdlib/random/array/tools/unary' ); -var dt = dtypes( 'real_floating_point_and_generic' ); -var random = new Random( exponential, dt, 'float64' ); +const dt = dtypes( 'real_floating_point_and_generic' ); +const random = new Random( exponential, dt, 'float64' ); -var x = random.generate( 10, 2.0 ); +let x = random.generate( 10, 2.0 ); // returns x = random.generate( 10, 2.0, { diff --git a/lib/node_modules/@stdlib/random/array/triangular/README.md b/lib/node_modules/@stdlib/random/array/triangular/README.md index e1b975aaf98e..d2d6f35a63ac 100644 --- a/lib/node_modules/@stdlib/random/array/triangular/README.md +++ b/lib/node_modules/@stdlib/random/array/triangular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var triangular = require( '@stdlib/random/array/triangular' ); +const triangular = require( '@stdlib/random/array/triangular' ); ``` #### triangular( len, a, b, c\[, options] ) @@ -35,7 +35,7 @@ var triangular = require( '@stdlib/random/array/triangular' ); Returns an array containing pseudorandom numbers drawn from a [triangular][@stdlib/random/base/triangular] distribution. ```javascript -var out = triangular( 10, 2.0, 5.0, 3.0 ); +const out = triangular( 10, 2.0, 5.0, 3.0 ); // returns ``` @@ -54,11 +54,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = triangular( 10, 2.0, 5.0, 3.0, opts ); +const out = triangular( 10, 2.0, 5.0, 3.0, opts ); // returns [...] ``` @@ -67,15 +67,15 @@ var out = triangular( 10, 2.0, 5.0, 3.0, opts ); Fills an array with pseudorandom numbers drawn from a [triangular][@stdlib/random/base/triangular] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = triangular.assign( 2.0, 5.0, 3.0, x ); +const out = triangular.assign( 2.0, 5.0, 3.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -91,21 +91,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [triangular][@stdlib/random/base/triangular] distribution. ```javascript -var random = triangular.factory(); +const random = triangular.factory(); -var out = random( 10, 2.0, 5.0, 3.0 ); +const out = random( 10, 2.0, 5.0, 3.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = triangular.factory( 2.0, 5.0, 3.0 ); +const random = triangular.factory( 2.0, 5.0, 3.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -115,9 +115,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = triangular.factory(); +const random = triangular.factory(); -var out = random( 10, 2.0, 5.0, 3.0 ); +let out = random( 10, 2.0, 5.0, 3.0 ); // returns out = random( 10, 2.0, 5.0, 3.0 ); @@ -135,26 +135,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = triangular.factory( 2.0, 5.0, 3.0, opts ); +const random = triangular.factory( 2.0, 5.0, 3.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = triangular.factory( 2.0, 5.0, 3.0, opts ); +const random = triangular.factory( 2.0, 5.0, 3.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -165,12 +165,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = triangular.factory( 2.0, 5.0, 3.0 ); +const random = triangular.factory( 2.0, 5.0, 3.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -182,7 +182,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = triangular.PRNG; +const prng = triangular.PRNG; // returns ``` @@ -191,20 +191,20 @@ var prng = triangular.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = triangular.seed; +const seed = triangular.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = triangular.factory( 2.0, 5.0, 3.0, { +const random = triangular.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -213,20 +213,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = triangular.seedLength; +const len = triangular.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = triangular.factory( 2.0, 5.0, 3.0, { +const random = triangular.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -235,20 +235,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = triangular.state; +const state = triangular.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = triangular.factory( 2.0, 5.0, 3.0, { +const random = triangular.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -257,20 +257,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = triangular.stateLength; +const len = triangular.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = triangular.factory( 2.0, 5.0, 3.0, { +const random = triangular.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -279,20 +279,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = triangular.byteLength; +const sz = triangular.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = triangular.factory( 2.0, 5.0, 3.0, { +const random = triangular.factory( 2.0, 5.0, 3.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -318,19 +318,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var triangular = require( '@stdlib/random/array/triangular' ); +const logEach = require( '@stdlib/console/log-each' ); +const triangular = require( '@stdlib/random/array/triangular' ); // Create a function for generating random arrays originating from the same state: -var random = triangular.factory( 2.0, 5.0, 3.0, { +let random = triangular.factory( 2.0, 5.0, 3.0, { 'state': triangular.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -342,7 +342,7 @@ random = triangular.factory( 2.0, 5.0, 3.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/uniform/README.md b/lib/node_modules/@stdlib/random/array/uniform/README.md index c80b0b2d0e39..1d2f75286078 100644 --- a/lib/node_modules/@stdlib/random/array/uniform/README.md +++ b/lib/node_modules/@stdlib/random/array/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uniform = require( '@stdlib/random/array/uniform' ); +const uniform = require( '@stdlib/random/array/uniform' ); ``` #### uniform( len, a, b\[, options] ) @@ -35,7 +35,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); Returns an array containing pseudorandom numbers drawn from a [continuous uniform][@stdlib/random/base/uniform] distribution. ```javascript -var out = uniform( 10, 2.0, 5.0 ); +const out = uniform( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = uniform( 10, 2.0, 5.0, opts ); +const out = uniform( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = uniform( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [continuous uniform][@stdlib/random/base/uniform] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = uniform.assign( 2.0, 5.0, x ); +const out = uniform.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [continuous uniform][@stdlib/random/base/uniform] distribution. ```javascript -var random = uniform.factory(); +const random = uniform.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = uniform.factory( 2.0, 5.0 ); +const random = uniform.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = uniform.factory(); +const random = uniform.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = uniform.factory( 2.0, 5.0, opts ); +const random = uniform.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = uniform.factory( 2.0, 5.0, opts ); +const random = uniform.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = uniform.factory( 2.0, 5.0 ); +const random = uniform.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = uniform.PRNG; +const prng = uniform.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = uniform.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = uniform.seed; +const seed = uniform.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = uniform.factory( 2.0, 5.0, { +const random = uniform.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = uniform.seedLength; +const len = uniform.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = uniform.factory( 2.0, 5.0, { +const random = uniform.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = uniform.state; +const state = uniform.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = uniform.factory( 2.0, 5.0, { +const random = uniform.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = uniform.stateLength; +const len = uniform.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = uniform.factory( 2.0, 5.0, { +const random = uniform.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = uniform.byteLength; +const sz = uniform.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = uniform.factory( 2.0, 5.0, { +const random = uniform.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var uniform = require( '@stdlib/random/array/uniform' ); +const logEach = require( '@stdlib/console/log-each' ); +const uniform = require( '@stdlib/random/array/uniform' ); // Create a function for generating random arrays originating from the same state: -var random = uniform.factory( 2.0, 5.0, { +let random = uniform.factory( 2.0, 5.0, { 'state': uniform.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = uniform.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/array/weibull/README.md b/lib/node_modules/@stdlib/random/array/weibull/README.md index ad0143688863..7b97726b252d 100644 --- a/lib/node_modules/@stdlib/random/array/weibull/README.md +++ b/lib/node_modules/@stdlib/random/array/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var weibull = require( '@stdlib/random/array/weibull' ); +const weibull = require( '@stdlib/random/array/weibull' ); ``` #### weibull( len, k, lambda\[, options] ) @@ -35,7 +35,7 @@ var weibull = require( '@stdlib/random/array/weibull' ); Returns an array containing pseudorandom numbers drawn from a [Weibull][@stdlib/random/base/weibull] distribution. ```javascript -var out = weibull( 10, 2.0, 5.0 ); +const out = weibull( 10, 2.0, 5.0 ); // returns ``` @@ -53,11 +53,11 @@ The function accepts the following `options`: By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var out = weibull( 10, 2.0, 5.0, opts ); +const out = weibull( 10, 2.0, 5.0, opts ); // returns [...] ``` @@ -66,15 +66,15 @@ var out = weibull( 10, 2.0, 5.0, opts ); Fills an array with pseudorandom numbers drawn from a [Weibull][@stdlib/random/base/weibull] distribution. ```javascript -var zeros = require( '@stdlib/array/zeros' ); +const zeros = require( '@stdlib/array/zeros' ); -var x = zeros( 10, 'float64' ); +const x = zeros( 10, 'float64' ); // returns -var out = weibull.assign( 2.0, 5.0, x ); +const out = weibull.assign( 2.0, 5.0, x ); // returns -var bool = ( out === x ); +const bool = ( out === x ); // returns true ``` @@ -89,21 +89,21 @@ The function has the following parameters: Returns a function for creating arrays containing pseudorandom numbers drawn from a [Weibull][@stdlib/random/base/weibull] distribution. ```javascript -var random = weibull.factory(); +const random = weibull.factory(); -var out = random( 10, 2.0, 5.0 ); +const out = random( 10, 2.0, 5.0 ); // returns -var len = out.length; +const len = out.length; // returns 10 ``` If provided distribution parameters, the returned generator returns random variates from the specified distribution. ```javascript -var random = weibull.factory( 2.0, 5.0 ); +const random = weibull.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns out = random( 10 ); @@ -113,9 +113,9 @@ out = random( 10 ); If not provided distribution parameters, the returned generator requires that distribution parameters be provided at each invocation. ```javascript -var random = weibull.factory(); +const random = weibull.factory(); -var out = random( 10, 2.0, 5.0 ); +let out = random( 10, 2.0, 5.0 ); // returns out = random( 10, 2.0, 5.0 ); @@ -133,26 +133,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = weibull.factory( 2.0, 5.0, opts ); +const random = weibull.factory( 2.0, 5.0, opts ); -var out = random( 10 ); +const out = random( 10 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = weibull.factory( 2.0, 5.0, opts ); +const random = weibull.factory( 2.0, 5.0, opts ); -var out = random( 10, opts ); +const out = random( 10, opts ); // returns ``` @@ -163,12 +163,12 @@ The returned function accepts the following `options`: To override the default output array data type, set the `dtype` option. ```javascript -var random = weibull.factory( 2.0, 5.0 ); +const random = weibull.factory( 2.0, 5.0 ); -var out = random( 10 ); +let out = random( 10 ); // returns -var opts = { +const opts = { 'dtype': 'generic' }; out = random( 10, opts ); @@ -180,7 +180,7 @@ out = random( 10, opts ); The underlying pseudorandom number generator. ```javascript -var prng = weibull.PRNG; +const prng = weibull.PRNG; // returns ``` @@ -189,20 +189,20 @@ var prng = weibull.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = weibull.seed; +const seed = weibull.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = weibull.factory( 2.0, 5.0, { +const random = weibull.factory( 2.0, 5.0, { 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -211,20 +211,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = weibull.seedLength; +const len = weibull.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = weibull.factory( 2.0, 5.0, { +const random = weibull.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -233,20 +233,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = weibull.state; +const state = weibull.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = weibull.factory( 2.0, 5.0, { +const random = weibull.factory( 2.0, 5.0, { 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -255,20 +255,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = weibull.stateLength; +const len = weibull.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = weibull.factory( 2.0, 5.0, { +const random = weibull.factory( 2.0, 5.0, { 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -277,20 +277,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = weibull.byteLength; +const sz = weibull.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = weibull.factory( 2.0, 5.0, { +const random = weibull.factory( 2.0, 5.0, { 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -316,19 +316,19 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var weibull = require( '@stdlib/random/array/weibull' ); +const logEach = require( '@stdlib/console/log-each' ); +const weibull = require( '@stdlib/random/array/weibull' ); // Create a function for generating random arrays originating from the same state: -var random = weibull.factory( 2.0, 5.0, { +let random = weibull.factory( 2.0, 5.0, { 'state': weibull.state, 'copy': true }); // Generate 3 arrays: -var x1 = random( 5 ); -var x2 = random( 5 ); -var x3 = random( 5 ); +const x1 = random( 5 ); +const x2 = random( 5 ); +const x3 = random( 5 ); // Print the contents: logEach( '%f, %f, %f', x1, x2, x3 ); @@ -340,7 +340,7 @@ random = weibull.factory( 2.0, 5.0, { }); // Generate a single array which replicates the above pseudorandom number generation sequence: -var x4 = random( 15 ); +const x4 = random( 15 ); // Print the contents: logEach( '%f', x4 ); diff --git a/lib/node_modules/@stdlib/random/base/README.md b/lib/node_modules/@stdlib/random/base/README.md index 1c4f07e09fdc..65ef14ce5094 100644 --- a/lib/node_modules/@stdlib/random/base/README.md +++ b/lib/node_modules/@stdlib/random/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var random = require( '@stdlib/random/base' ); +const random = require( '@stdlib/random/base' ); ``` #### random @@ -35,7 +35,7 @@ var random = require( '@stdlib/random/base' ); Namespace containing "base" (i.e., lower-level) pseudorandom number generators (PRNGs). ```javascript -var ns = random; +const ns = random; // returns {...} ``` @@ -105,20 +105,16 @@ Attached to each PRNG are the following properties: Additionally, attached to each PRNG is a `.factory()` method which supports creating a seeded PRNG and thus generating a reproducible sequence of pseudorandom numbers. ```javascript -var rand; -var v; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - v = random.randu(); + const v = random.randu(); } // Generate the same pseudorandom values... -rand = random.randu.factory({ +const rand = random.randu.factory({ 'seed': random.randu.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { v = rand(); } ``` @@ -127,11 +123,11 @@ For parameterized PRNGs, the `.factory()` method supports specifying parameters ```javascript // Create a PRNG which requires providing parameters at each invocation: -var rand = random.normal.factory({ +let rand = random.normal.factory({ 'seed': 12345 }); -var r = rand( 1.0, 2.0 ); +let r = rand( 1.0, 2.0 ); // returns // Create a PRNG with fixed parameters: @@ -156,8 +152,8 @@ r = rand(); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var random = require( '@stdlib/random/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const random = require( '@stdlib/random/base' ); console.log( objectKeys( random ) ); ``` diff --git a/lib/node_modules/@stdlib/random/base/arcsine/README.md b/lib/node_modules/@stdlib/random/base/arcsine/README.md index 1c014f2139d7..14180c7324c0 100644 --- a/lib/node_modules/@stdlib/random/base/arcsine/README.md +++ b/lib/node_modules/@stdlib/random/base/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); ``` #### arcsine( a, b ) @@ -35,14 +35,14 @@ var arcsine = require( '@stdlib/random/base/arcsine' ); Returns a pseudorandom number drawn from an [arcsine][arcsine] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var r = arcsine( 2.0, 5.0 ); +const r = arcsine( 2.0, 5.0 ); // returns ``` If either `a` or `b` is `NaN` or `a >= b`, the function returns `NaN`. ```javascript -var r = arcsine( 2.0, 1.0 ); +let r = arcsine( 2.0, 1.0 ); // returns NaN r = arcsine( NaN, 1.0 ); @@ -57,9 +57,9 @@ r = arcsine( 1.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from an [arcsine][arcsine] distribution. ```javascript -var rand = arcsine.factory(); +const rand = arcsine.factory(); -var r = rand( 0.0, 1.0 ); +const r = rand( 0.0, 1.0 ); // returns ``` @@ -67,9 +67,9 @@ If provided `a` and `b`, the returned generator returns random variates from the ```javascript // Draw from arcsine( -2.0, 2.0 ) distribution: -var rand = arcsine.factory( -2.0, 2.0 ); +const rand = arcsine.factory( -2.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -79,9 +79,9 @@ r = rand(); If not provided `a` and `b`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = arcsine.factory(); +const rand = arcsine.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -98,57 +98,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 4.0 ); +const r = rand( 2.0, 4.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = arcsine.factory({ +const rand1 = arcsine.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 4.0 ); +const r1 = rand1( 2.0, 4.0 ); // returns -var rand2 = arcsine.factory( 2.0, 4.0, { +const rand2 = arcsine.factory( 2.0, 4.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = arcsine( 2.0, 4.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = arcsine( 2.0, 4.0 ); } // Create a new PRNG initialized to the current state of `arcsine`: -rand = arcsine.factory({ +const rand = arcsine.factory({ 'state': arcsine.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 4.0 ) === arcsine( 2.0, 4.0 ) ); +const bool = ( rand( 2.0, 4.0 ) === arcsine( 2.0, 4.0 ) ); // returns true ``` @@ -157,7 +152,7 @@ bool = ( rand( 2.0, 4.0 ) === arcsine( 2.0, 4.0 ) ); The generator name. ```javascript -var str = arcsine.NAME; +const str = arcsine.NAME; // returns 'arcsine' ``` @@ -166,7 +161,7 @@ var str = arcsine.NAME; The underlying pseudorandom number generator. ```javascript -var prng = arcsine.PRNG; +const prng = arcsine.PRNG; // returns ``` @@ -175,20 +170,16 @@ var prng = arcsine.PRNG; The value used to seed `arcsine()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = arcsine( 0.0, 10.0 ); + const r = arcsine( 0.0, 10.0 ); } // Generate the same pseudorandom values... -rand = arcsine.factory( 0.0, 10.0, { +const rand = arcsine.factory( 0.0, 10.0, { 'seed': arcsine.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { r = rand(); } ``` @@ -198,11 +189,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -211,7 +202,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = arcsine.seedLength; +const len = arcsine.seedLength; // returns ``` @@ -220,11 +211,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -233,7 +224,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = arcsine( 2.0, 4.0 ); +let r = arcsine( 2.0, 4.0 ); // returns r = arcsine( 2.0, 4.0 ); @@ -242,7 +233,7 @@ r = arcsine( 2.0, 4.0 ); // ... // Get a copy of the current state: -var state = arcsine.state; +const state = arcsine.state; // returns r = arcsine( 2.0, 4.0 ); @@ -269,11 +260,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -282,7 +273,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = arcsine.stateLength; +const len = arcsine.stateLength; // returns ``` @@ -291,11 +282,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -304,7 +295,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = arcsine.byteLength; +const sz = arcsine.byteLength; // returns ``` @@ -313,11 +304,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -326,7 +317,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = arcsine.toJSON(); +const o = arcsine.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -335,11 +326,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = arcsine.factory({ +const rand = arcsine.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -365,23 +356,19 @@ var o = rand.toJSON(); ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); - -var seed; -var rand; -var i; +const arcsine = require( '@stdlib/random/base/arcsine' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( arcsine( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = arcsine.factory( 2.0, 5.0, { +const seed = 1234; +let rand = arcsine.factory( 2.0, 5.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -389,7 +376,7 @@ for ( i = 0; i < 100; i++ ) { rand = arcsine.factory( 0.0, 1.0, { 'seed': arcsine.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/bernoulli/README.md b/lib/node_modules/@stdlib/random/base/bernoulli/README.md index fdb275c83fc4..e59e266591e5 100644 --- a/lib/node_modules/@stdlib/random/base/bernoulli/README.md +++ b/lib/node_modules/@stdlib/random/base/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); ``` #### bernoulli( p ) @@ -35,14 +35,14 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); Returns a pseudorandom number drawn from a [Bernoulli][bernoulli] distribution with success probability `p`. ```javascript -var r = bernoulli( 0.8 ); +const r = bernoulli( 0.8 ); // returns ``` If `p < 0` or `p > 1`, the function returns `NaN`. ```javascript -var r = bernoulli( 3.14 ); +let r = bernoulli( 3.14 ); // returns NaN r = bernoulli( -0.5 ); @@ -52,7 +52,7 @@ r = bernoulli( -0.5 ); If `p` is `NaN`, the function returns `NaN`. ```javascript -var r = bernoulli( NaN ); +const r = bernoulli( NaN ); // returns NaN ``` @@ -61,18 +61,18 @@ var r = bernoulli( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Bernoulli][bernoulli] distribution. ```javascript -var rand = bernoulli.factory(); +const rand = bernoulli.factory(); -var r = rand( 0.3 ); +const r = rand( 0.3 ); // returns ``` If provided `p`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = bernoulli.factory( 0.6 ); +const rand = bernoulli.factory( 0.6 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -82,9 +82,9 @@ r = rand(); If not provided `p`, the returned generator requires that `p` be provided at each invocation. ```javascript -var rand = bernoulli.factory(); +const rand = bernoulli.factory(); -var r = rand( 0.67 ); +let r = rand( 0.67 ); // returns r = rand( 0.42 ); @@ -101,57 +101,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': minstd.normalized }); -var r = rand( 0.3 ); +const r = rand( 0.3 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = bernoulli.factory({ +const rand1 = bernoulli.factory({ 'seed': 12345 }); -var r1 = rand1( 0.2 ); +const r1 = rand1( 0.2 ); // returns -var rand2 = bernoulli.factory( 0.2, { +const rand2 = bernoulli.factory( 0.2, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = bernoulli( 0.2 ); +for ( let i = 0; i < 1000; i++ ) { + const r = bernoulli( 0.2 ); } // Create a new PRNG initialized to the current state of `bernoulli`: -rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'state': bernoulli.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 0.2 ) === bernoulli( 0.2 ) ); +const bool = ( rand( 0.2 ) === bernoulli( 0.2 ) ); // returns true ``` @@ -160,7 +155,7 @@ bool = ( rand( 0.2 ) === bernoulli( 0.2 ) ); The generator name. ```javascript -var str = bernoulli.NAME; +const str = bernoulli.NAME; // returns 'bernoulli' ``` @@ -169,7 +164,7 @@ var str = bernoulli.NAME; The underlying pseudorandom number generator. ```javascript -var prng = bernoulli.PRNG; +const prng = bernoulli.PRNG; // returns ``` @@ -178,21 +173,17 @@ var prng = bernoulli.PRNG; The value used to seed `bernoulli()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = bernoulli( 0.5 ); +for ( let i = 0; i < 100; i++ ) { + const r = bernoulli( 0.5 ); } // Generate the same pseudorandom values... -rand = bernoulli.factory( 0.5, { +const rand = bernoulli.factory( 0.5, { 'seed': bernoulli.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -201,11 +192,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -214,7 +205,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = bernoulli.seedLength; +const len = bernoulli.seedLength; // returns ``` @@ -223,11 +214,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -236,7 +227,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = bernoulli( 0.3 ); +let r = bernoulli( 0.3 ); // returns r = bernoulli( 0.3 ); @@ -245,7 +236,7 @@ r = bernoulli( 0.3 ); // ... // Get a copy of the current state: -var state = bernoulli.state; +const state = bernoulli.state; // returns r = bernoulli( 0.3 ); @@ -272,11 +263,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -285,7 +276,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = bernoulli.stateLength; +const len = bernoulli.stateLength; // returns ``` @@ -294,11 +285,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -307,7 +298,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = bernoulli.byteLength; +const sz = bernoulli.byteLength; // returns ``` @@ -316,11 +307,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -329,7 +320,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = bernoulli.toJSON(); +const o = bernoulli.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -338,11 +329,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = bernoulli.factory({ +const rand = bernoulli.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -368,23 +359,19 @@ var o = rand.toJSON(); ```javascript -var bernoulli = require( '@stdlib/random/base/bernoulli' ); - -var seed; -var rand; -var i; +const bernoulli = require( '@stdlib/random/base/bernoulli' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( bernoulli( 0.4 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = bernoulli.factory( 0.4, { +const seed = 1234; +let rand = bernoulli.factory( 0.4, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -392,7 +379,7 @@ for ( i = 0; i < 100; i++ ) { rand = bernoulli.factory( 0.4, { 'seed': bernoulli.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/beta/README.md b/lib/node_modules/@stdlib/random/base/beta/README.md index 847e75756945..186d75ac890b 100644 --- a/lib/node_modules/@stdlib/random/base/beta/README.md +++ b/lib/node_modules/@stdlib/random/base/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var beta = require( '@stdlib/random/base/beta' ); +const beta = require( '@stdlib/random/base/beta' ); ``` #### beta( alpha, beta ) @@ -35,14 +35,14 @@ var beta = require( '@stdlib/random/base/beta' ); Returns a pseudorandom number drawn from a [beta][beta] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var r = beta( 2.0, 5.0 ); +const r = beta( 2.0, 5.0 ); // returns ``` If `alpha <= 0` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = beta( 2.0, -2.0 ); +let r = beta( 2.0, -2.0 ); // returns NaN r = beta( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = beta( -2.0, 2.0 ); If `alpha` or `beta` is `NaN`, the function returns `NaN`. ```javascript -var r = beta( NaN, 5.0 ); +let r = beta( NaN, 5.0 ); // returns NaN r = beta( 2.0, NaN ); @@ -64,9 +64,9 @@ r = beta( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [beta][beta] distribution. ```javascript -var rand = beta.factory(); +const rand = beta.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` @@ -74,9 +74,9 @@ If provided `alpha` and `beta`, the returned generator returns random variates f ```javascript // Draw from beta( 1.5, 1.5 ) distribution: -var rand = beta.factory( 1.5, 1.5 ); +const rand = beta.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `alpha` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = beta.factory(); +const rand = beta.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = beta.factory({ +const rand = beta.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 4.0 ); +const r = rand( 2.0, 4.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = beta.factory({ +const rand1 = beta.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = beta.factory( 2.0, 3.0, { +const rand2 = beta.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = beta( 2.0, 4.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = beta( 2.0, 4.0 ); } // Create a new PRNG initialized to the current state of `beta`: -rand = beta.factory({ +const rand = beta.factory({ 'state': beta.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 4.0 ) === beta( 2.0, 4.0 ) ); +const bool = ( rand( 2.0, 4.0 ) === beta( 2.0, 4.0 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 2.0, 4.0 ) === beta( 2.0, 4.0 ) ); The generator name. ```javascript -var str = beta.NAME; +const str = beta.NAME; // returns 'beta' ``` @@ -173,7 +168,7 @@ var str = beta.NAME; The underlying pseudorandom number generator. ```javascript -var prng = beta.PRNG; +const prng = beta.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = beta.PRNG; The value used to seed `beta()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = beta( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = beta( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = beta.factory( 2.0, 2.0, { +const rand = beta.factory( 2.0, 2.0, { 'seed': beta.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = beta.seedLength; +const len = beta.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = beta( 2.0, 5.0 ); +let r = beta( 2.0, 5.0 ); // returns r = beta( 2.0, 5.0 ); @@ -249,7 +240,7 @@ r = beta( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = beta.state; +const state = beta.state; // returns r = beta( 2.0, 5.0 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = beta.stateLength; +const len = beta.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = beta.byteLength; +const sz = beta.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = beta.toJSON(); +const o = beta.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = beta.factory({ +const rand = beta.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var beta = require( '@stdlib/random/base/beta' ); - -var seed; -var rand; -var i; +const beta = require( '@stdlib/random/base/beta' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( beta( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = beta.factory( 6.0, 2.0, { +const seed = 1234; +let rand = beta.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = beta.factory( 2.0, 2.0, { 'seed': beta.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/betaprime/README.md b/lib/node_modules/@stdlib/random/base/betaprime/README.md index 1405c3d7d7fc..7dc27a02e869 100644 --- a/lib/node_modules/@stdlib/random/base/betaprime/README.md +++ b/lib/node_modules/@stdlib/random/base/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var betaprime = require( '@stdlib/random/base/betaprime' ); +const betaprime = require( '@stdlib/random/base/betaprime' ); ``` #### betaprime( alpha, beta ) @@ -35,14 +35,14 @@ var betaprime = require( '@stdlib/random/base/betaprime' ); Returns a pseudorandom number drawn from a [beta prime][betaprime] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var r = betaprime( 2.0, 5.0 ); +const r = betaprime( 2.0, 5.0 ); // returns ``` If `alpha <= 0` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = betaprime( 2.0, -2.0 ); +let r = betaprime( 2.0, -2.0 ); // returns NaN r = betaprime( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = betaprime( -2.0, 2.0 ); If `alpha` or `beta` is `NaN`, the function returns `NaN`. ```javascript -var r = betaprime( NaN, 5.0 ); +let r = betaprime( NaN, 5.0 ); // returns NaN r = betaprime( 2.0, NaN ); @@ -64,9 +64,9 @@ r = betaprime( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [beta prime][betaprime] distribution. ```javascript -var rand = betaprime.factory(); +const rand = betaprime.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` @@ -74,9 +74,9 @@ If provided `alpha` and `beta`, the returned generator returns random variates f ```javascript // Draw from BetaPrime( 1.5, 1.5 ) distribution: -var rand = betaprime.factory( 1.5, 1.5 ); +const rand = betaprime.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `alpha` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = betaprime.factory(); +const rand = betaprime.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = betaprime.factory({ +const rand1 = betaprime.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = betaprime.factory( 2.0, 3.0, { +const rand2 = betaprime.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = betaprime( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = betaprime( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `betaprime`: -rand = betaprime.factory({ +const rand = betaprime.factory({ 'state': betaprime.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === betaprime( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === betaprime( 2.0, 3.0 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 2.0, 3.0 ) === betaprime( 2.0, 3.0 ) ); The generator name. ```javascript -var str = betaprime.NAME; +const str = betaprime.NAME; // returns 'betaprime' ``` @@ -173,7 +168,7 @@ var str = betaprime.NAME; The underlying pseudorandom number generator. ```javascript -var prng = betaprime.PRNG; +const prng = betaprime.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = betaprime.PRNG; The value used to seed `betaprime()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = betaprime( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = betaprime( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = betaprime.factory( 2.0, 2.0, { +const rand = betaprime.factory( 2.0, 2.0, { 'seed': betaprime.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = betaprime.seedLength; +const len = betaprime.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = betaprime( 2.0, 5.0 ); +let r = betaprime( 2.0, 5.0 ); // returns r = betaprime( 2.0, 5.0 ); @@ -249,7 +240,7 @@ r = betaprime( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = betaprime.state; +const state = betaprime.state; // returns r = betaprime( 2.0, 5.0 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = betaprime.stateLength; +const len = betaprime.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size of generator state. ```javascript -var sz = betaprime.byteLength; +const sz = betaprime.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = betaprime.toJSON(); +const o = betaprime.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = betaprime.factory({ +const rand = betaprime.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var betaprime = require( '@stdlib/random/base/betaprime' ); - -var seed; -var rand; -var i; +const betaprime = require( '@stdlib/random/base/betaprime' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( betaprime( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = betaprime.factory( 6.0, 2.0, { +const seed = 1234; +let rand = betaprime.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = betaprime.factory( 2.0, 2.0, { 'seed': betaprime.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/binomial/README.md b/lib/node_modules/@stdlib/random/base/binomial/README.md index 71fb34a8dda0..e0b576d3192d 100644 --- a/lib/node_modules/@stdlib/random/base/binomial/README.md +++ b/lib/node_modules/@stdlib/random/base/binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binomial = require( '@stdlib/random/base/binomial' ); +const binomial = require( '@stdlib/random/base/binomial' ); ``` #### binomial( n, p ) @@ -35,14 +35,14 @@ var binomial = require( '@stdlib/random/base/binomial' ); Returns a pseudorandom number drawn from a [binomial][binomial] distribution with number of trials `n` and success probability `p`. ```javascript -var r = binomial( 20, 0.8 ); +const r = binomial( 20, 0.8 ); // returns ``` If `n` is not a positive integer or `p` is not a probability, the function returns `NaN`. ```javascript -var r = binomial( 1.5, 0.5 ); +let r = binomial( 1.5, 0.5 ); // returns NaN r = binomial( 2, 1.5 ); @@ -52,7 +52,7 @@ r = binomial( 2, 1.5 ); If `n` or `p` is `NaN`, the function returns `NaN`. ```javascript -var r = binomial( NaN, 0.4 ); +let r = binomial( NaN, 0.4 ); // returns NaN r = binomial( 20, NaN ); @@ -64,9 +64,9 @@ r = binomial( 20, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [binomial][binomial] distribution. ```javascript -var rand = binomial.factory(); +const rand = binomial.factory(); -var r = rand( 20, 0.3 ); +const r = rand( 20, 0.3 ); // returns ``` @@ -74,9 +74,9 @@ If provided `n` and `p`, the returned generator returns random variates from the ```javascript // Draws from binomial( 10, 0.8 ): -var rand = binomial.factory( 10, 0.8 ); +const rand = binomial.factory( 10, 0.8 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `n` and `p`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = binomial.factory(); +const rand = binomial.factory(); -var r = rand( 20, 0.8 ); +let r = rand( 20, 0.8 ); // returns r = rand( 123, 0.21 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': minstd.normalized }); -var r = rand( 8, 0.9 ); +const r = rand( 8, 0.9 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = binomial.factory({ +const rand1 = binomial.factory({ 'seed': 12345 }); -var r1 = rand1( 8, 0.9 ); +const r1 = rand1( 8, 0.9 ); // returns -var rand2 = binomial.factory( 8, 0.9, { +const rand2 = binomial.factory( 8, 0.9, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = binomial( 8, 0.9 ); +for ( let i = 0; i < 1000; i++ ) { + const r = binomial( 8, 0.9 ); } // Create a new PRNG initialized to the current state of `binomial`: -rand = binomial.factory({ +const rand = binomial.factory({ 'state': binomial.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 8, 0.9 ) === binomial( 8, 0.9 ) ); +const bool = ( rand( 8, 0.9 ) === binomial( 8, 0.9 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 8, 0.9 ) === binomial( 8, 0.9 ) ); The generator name. ```javascript -var str = binomial.NAME; +const str = binomial.NAME; // returns 'binomial' ``` @@ -173,7 +168,7 @@ var str = binomial.NAME; The underlying pseudorandom number generator. ```javascript -var prng = binomial.PRNG; +const prng = binomial.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = binomial.PRNG; The value used to seed `binomial()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = binomial( 20, 0.5 ); +for ( let i = 0; i < 100; i++ ) { + const r = binomial( 20, 0.5 ); } // Generate the same pseudorandom values... -rand = binomial.factory( 20, 0.5, { +const rand = binomial.factory( 20, 0.5, { 'seed': binomial.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = binomial.seedLength; +const len = binomial.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = binomial( 20, 0.8 ); +let r = binomial( 20, 0.8 ); // returns r = binomial( 20, 0.8 ); @@ -249,7 +240,7 @@ r = binomial( 20, 0.8 ); // ... // Get a copy of the current state: -var state = binomial.state; +const state = binomial.state; // returns r = binomial( 20, 0.8 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = binomial.stateLength; +const len = binomial.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = binomial.byteLength; +const sz = binomial.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = binomial.toJSON(); +const o = binomial.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = binomial.factory({ +const rand = binomial.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var binomial = require( '@stdlib/random/base/binomial' ); - -var seed; -var rand; -var i; +const binomial = require( '@stdlib/random/base/binomial' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( binomial( 20, 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = binomial.factory( 10, 0.8, { +const seed = 1234; +let rand = binomial.factory( 10, 0.8, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = binomial.factory( 20, 0.5, { 'seed': binomial.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/box-muller/README.md b/lib/node_modules/@stdlib/random/base/box-muller/README.md index 8387e076ac83..8e2dd99816a0 100644 --- a/lib/node_modules/@stdlib/random/base/box-muller/README.md +++ b/lib/node_modules/@stdlib/random/base/box-muller/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randn = require( '@stdlib/random/base/box-muller' ); +const randn = require( '@stdlib/random/base/box-muller' ); ``` #### randn() @@ -35,7 +35,7 @@ var randn = require( '@stdlib/random/base/box-muller' ); Returns a standard normally distributed pseudorandom number. ```javascript -var r = randn(); +const r = randn(); // returns ``` @@ -44,7 +44,7 @@ var r = randn(); Returns a pseudorandom number generator (PRNG) for generating standard normally distributed pseudorandom numbers. ```javascript -var rand = randn.factory(); +const rand = randn.factory(); ``` The function accepts the following `options`: @@ -57,57 +57,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = randn.factory({ +const rand = randn.factory({ 'prng': minstd.normalized }); -var r = rand(); +const r = rand(); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = randn.factory({ +const rand1 = randn.factory({ 'seed': 12345 }); -var r1 = rand1(); +const r1 = rand1(); // returns -var rand2 = randn.factory({ +const rand2 = randn.factory({ 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = randn(); +for ( let i = 0; i < 1000; i++ ) { + const r = randn(); } // Create a new PRNG initialized to the current state of `randn`: -rand = randn.factory({ +const rand = randn.factory({ 'state': randn.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === randn() ); +const bool = ( rand() === randn() ); // returns true ``` @@ -116,7 +111,7 @@ bool = ( rand() === randn() ); The generator name. ```javascript -var str = randn.NAME; +const str = randn.NAME; // returns 'box-muller' ``` @@ -125,7 +120,7 @@ var str = randn.NAME; The underlying pseudorandom number generator for uniformly distributed numbers on the interval `[0,1)`. ```javascript -var prng = randn.PRNG; +const prng = randn.PRNG; // returns ``` @@ -134,7 +129,7 @@ var prng = randn.PRNG; Minimum possible value. ```javascript -var min = randn.MIN; +const min = randn.MIN; // returns ``` @@ -143,11 +138,11 @@ Note that this value is computed based on the minimum value of the underlying PR ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var min = rand.MIN; +const min = rand.MIN; // returns null ``` @@ -156,7 +151,7 @@ var min = rand.MIN; Maximum possible value. ```javascript -var max = randn.MAX; +const max = randn.MAX; // returns ``` @@ -165,11 +160,11 @@ Note that this value is computed based on the minimum value of the underlying PR ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var max = rand.MAX; +const max = rand.MAX; // returns null ``` @@ -178,21 +173,17 @@ var max = rand.MAX; The value used to seed `randn()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = randn(); +for ( let i = 0; i < 100; i++ ) { + const r = randn(); } // Generate the same pseudorandom values... -rand = randn.factory({ +const rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -201,11 +192,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -214,7 +205,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = randn.seedLength; +const len = randn.seedLength; // returns ``` @@ -223,11 +214,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -236,7 +227,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = randn(); +let r = randn(); // returns r = randn(); @@ -245,7 +236,7 @@ r = randn(); // ... // Get a copy of the current state: -var state = randn.state; +const state = randn.state; // returns r = randn(); @@ -272,11 +263,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -285,7 +276,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = randn.stateLength; +const len = randn.stateLength; // returns ``` @@ -294,11 +285,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -307,7 +298,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = randn.byteLength; +const sz = randn.byteLength; // returns ``` @@ -316,11 +307,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -329,7 +320,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = randn.toJSON(); +const o = randn.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -338,11 +329,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -369,23 +360,19 @@ var o = rand.toJSON(); ```javascript -var randn = require( '@stdlib/random/base/box-muller' ); - -var seed; -var rand; -var i; +const randn = require( '@stdlib/random/base/box-muller' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( randn() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = randn.factory({ +const seed = 1234; +let rand = randn.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -393,7 +380,7 @@ for ( i = 0; i < 100; i++ ) { rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/cauchy/README.md b/lib/node_modules/@stdlib/random/base/cauchy/README.md index bdd9e165fd1f..cd8e4e253d92 100644 --- a/lib/node_modules/@stdlib/random/base/cauchy/README.md +++ b/lib/node_modules/@stdlib/random/base/cauchy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cauchy = require( '@stdlib/random/base/cauchy' ); +const cauchy = require( '@stdlib/random/base/cauchy' ); ``` #### cauchy( x0, gamma ) @@ -35,14 +35,14 @@ var cauchy = require( '@stdlib/random/base/cauchy' ); Returns a pseudorandom number drawn from a [Cauchy][cauchy] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var r = cauchy( 2.0, 5.0 ); +const r = cauchy( 2.0, 5.0 ); // returns ``` If `x0` or `gamma` is `NaN` or `gamma <= 0`, the function returns `NaN`. ```javascript -var r = cauchy( 2.0, -2.0 ); +let r = cauchy( 2.0, -2.0 ); // returns NaN r = cauchy( NaN, 5.0 ); @@ -57,9 +57,9 @@ r = cauchy( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Cauchy][cauchy] distribution. ```javascript -var rand = cauchy.factory(); +const rand = cauchy.factory(); -var r = rand( 0.0, 1.5 ); +const r = rand( 0.0, 1.5 ); // returns ``` @@ -67,9 +67,9 @@ If provided `x0` and `gamma`, the returned generator returns random variates fro ```javascript // Draw from Cauchy( 0.0, 1.5 ) distribution: -var rand = cauchy.factory( 0.0, 1.5 ); +const rand = cauchy.factory( 0.0, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -79,9 +79,9 @@ r = rand(); If not provided `x0` and `gamma`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = cauchy.factory(); +const rand = cauchy.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -98,57 +98,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = cauchy.factory({ +const rand1 = cauchy.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = cauchy.factory( 2.0, 3.0, { +const rand2 = cauchy.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = cauchy( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = cauchy( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `cauchy`: -rand = cauchy.factory({ +const rand = cauchy.factory({ 'state': cauchy.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === cauchy( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === cauchy( 2.0, 3.0 ) ); // returns true ``` @@ -157,7 +152,7 @@ bool = ( rand( 2.0, 3.0 ) === cauchy( 2.0, 3.0 ) ); The generator name. ```javascript -var str = cauchy.NAME; +const str = cauchy.NAME; // returns 'cauchy' ``` @@ -166,7 +161,7 @@ var str = cauchy.NAME; The underlying pseudorandom number generator. ```javascript -var prng = cauchy.PRNG; +const prng = cauchy.PRNG; // returns ``` @@ -175,21 +170,17 @@ var prng = cauchy.PRNG; The value used to seed `cauchy()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = cauchy( 0.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = cauchy( 0.0, 2.0 ); } // Generate the same pseudorandom values... -rand = cauchy.factory( 0.0, 2.0, { +const rand = cauchy.factory( 0.0, 2.0, { 'seed': cauchy.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -198,11 +189,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -211,7 +202,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = cauchy.seedLength; +const len = cauchy.seedLength; // returns ``` @@ -220,11 +211,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -233,7 +224,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = cauchy( 2.0, 5.0 ); +let r = cauchy( 2.0, 5.0 ); // returns r = cauchy( 2.0, 5.0 ); @@ -242,7 +233,7 @@ r = cauchy( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = cauchy.state; +const state = cauchy.state; // returns r = cauchy( 2.0, 5.0 ); @@ -269,11 +260,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -282,7 +273,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = cauchy.stateLength; +const len = cauchy.stateLength; // returns ``` @@ -291,11 +282,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -304,7 +295,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = cauchy.byteLength; +const sz = cauchy.byteLength; // returns ``` @@ -313,11 +304,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -326,7 +317,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = cauchy.toJSON(); +const o = cauchy.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -335,11 +326,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = cauchy.factory({ +const rand = cauchy.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -365,23 +356,19 @@ var o = rand.toJSON(); ```javascript -var cauchy = require( '@stdlib/random/base/cauchy' ); - -var seed; -var rand; -var i; +const cauchy = require( '@stdlib/random/base/cauchy' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( cauchy( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = cauchy.factory( -6.0, 2.0, { +const seed = 1234; +let rand = cauchy.factory( -6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -389,7 +376,7 @@ for ( i = 0; i < 100; i++ ) { rand = cauchy.factory( 2.0, 2.0, { 'seed': cauchy.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/chi/README.md b/lib/node_modules/@stdlib/random/base/chi/README.md index 8a59d9400a03..19baf99c56ed 100644 --- a/lib/node_modules/@stdlib/random/base/chi/README.md +++ b/lib/node_modules/@stdlib/random/base/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi = require( '@stdlib/random/base/chi' ); +const chi = require( '@stdlib/random/base/chi' ); ``` #### chi( k ) @@ -35,14 +35,14 @@ var chi = require( '@stdlib/random/base/chi' ); Returns a pseudorandom number drawn from a [chi][chi] distribution with degrees of freedom `k`. ```javascript -var r = chi( 2 ); +const r = chi( 2 ); // returns ``` If `k <= 0` or `k` is `NaN`, the function returns `NaN`. ```javascript -var r = chi( -2 ); +let r = chi( -2 ); // returns NaN r = chi( NaN ); @@ -54,18 +54,18 @@ r = chi( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [chi][chi] distribution. ```javascript -var rand = chi.factory(); +const rand = chi.factory(); -var r = rand( 5 ); +const r = rand( 5 ); // returns ``` If provided `k`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = chi.factory( 1.0 ); +const rand = chi.factory( 1.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `k`, the returned generator requires that `k` be provided at each invocation. ```javascript -var rand = chi.factory(); +const rand = chi.factory(); -var r = rand( 4 ); +let r = rand( 4 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = chi.factory({ +const rand = chi.factory({ 'prng': minstd.normalized }); -var r = rand( 3 ); +const r = rand( 3 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = chi.factory({ +const rand1 = chi.factory({ 'seed': 12345 }); -var r1 = rand1( 3 ); +const r1 = rand1( 3 ); // returns -var rand2 = chi.factory( 3, { +const rand2 = chi.factory( 3, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = chi( 3 ); +for ( let i = 0; i < 1000; i++ ) { + const r = chi( 3 ); } // Create a new PRNG initialized to the current state of `chi`: -rand = chi.factory({ +const rand = chi.factory({ 'state': chi.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 3 ) === chi( 3 ) ); +const bool = ( rand( 3 ) === chi( 3 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 3 ) === chi( 3 ) ); The generator name. ```javascript -var str = chi.NAME; +const str = chi.NAME; // returns 'chi' ``` @@ -162,7 +157,7 @@ var str = chi.NAME; The underlying pseudorandom number generator. ```javascript -var prng = chi.PRNG; +const prng = chi.PRNG; // returns ``` @@ -171,21 +166,17 @@ var prng = chi.PRNG; The value used to seed `chi()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = chi( 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = chi( 2.0 ); } // Generate the same pseudorandom values... -rand = chi.factory( 2.0, { +const rand = chi.factory( 2.0, { 'seed': chi.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = chi.seedLength; +const len = chi.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = chi( 2 ); +let r = chi( 2 ); // returns r = chi( 2 ); @@ -238,7 +229,7 @@ r = chi( 2 ); // ... // Get a copy of the current state: -var state = chi.state; +const state = chi.state; // returns r = chi( 2 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = chi.stateLength; +const len = chi.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = chi.byteLength; +const sz = chi.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = chi.toJSON(); +const o = chi.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = chi.factory({ +const rand = chi.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -361,23 +352,19 @@ var o = rand.toJSON(); ```javascript -var chi = require( '@stdlib/random/base/chi' ); - -var seed; -var rand; -var i; +const chi = require( '@stdlib/random/base/chi' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( chi( 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = chi.factory( 5.0, { +const seed = 1234; +let rand = chi.factory( 5.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -385,7 +372,7 @@ for ( i = 0; i < 100; i++ ) { rand = chi.factory( 1.0, { 'seed': chi.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/chisquare/README.md b/lib/node_modules/@stdlib/random/base/chisquare/README.md index c3c0af1a87e3..bc8db8e2a716 100644 --- a/lib/node_modules/@stdlib/random/base/chisquare/README.md +++ b/lib/node_modules/@stdlib/random/base/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chisquare = require( '@stdlib/random/base/chisquare' ); +const chisquare = require( '@stdlib/random/base/chisquare' ); ``` #### chisquare( k ) @@ -35,14 +35,14 @@ var chisquare = require( '@stdlib/random/base/chisquare' ); Returns a pseudorandom number drawn from a [chi-square][chi-square] distribution with degrees of freedom `k`. ```javascript -var r = chisquare( 2 ); +const r = chisquare( 2 ); // returns ``` If `k <= 0` or `k` is `NaN`, the function returns `NaN`. ```javascript -var r = chisquare( -2 ); +let r = chisquare( -2 ); // returns NaN r = chisquare( NaN ); @@ -54,18 +54,18 @@ r = chisquare( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [chi-square][chi-square] distribution. ```javascript -var rand = chisquare.factory(); +const rand = chisquare.factory(); -var r = rand( 5 ); +const r = rand( 5 ); // returns ``` If provided `k`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = chisquare.factory( 1.0 ); +const rand = chisquare.factory( 1.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `k`, the returned generator requires that `k` be provided at each invocation. ```javascript -var rand = chisquare.factory(); +const rand = chisquare.factory(); -var r = rand( 4 ); +let r = rand( 4 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': minstd.normalized }); -var r = rand( 10 ); +const r = rand( 10 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = chisquare.factory({ +const rand1 = chisquare.factory({ 'seed': 12345 }); -var r1 = rand1( 3 ); +const r1 = rand1( 3 ); // returns -var rand2 = chisquare.factory( 3, { +const rand2 = chisquare.factory( 3, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = chisquare( 3 ); +for ( let i = 0; i < 1000; i++ ) { + const r = chisquare( 3 ); } // Create a new PRNG initialized to the current state of `chisquare`: -rand = chisquare.factory({ +const rand = chisquare.factory({ 'state': chisquare.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 3 ) === chisquare( 3 ) ); +const bool = ( rand( 3 ) === chisquare( 3 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 3 ) === chisquare( 3 ) ); The generator name. ```javascript -var str = chisquare.NAME; +const str = chisquare.NAME; // returns 'chisquare' ``` @@ -162,7 +157,7 @@ var str = chisquare.NAME; The underlying pseudorandom number generator. ```javascript -var prng = chisquare.PRNG; +const prng = chisquare.PRNG; // returns ``` @@ -171,21 +166,17 @@ var prng = chisquare.PRNG; The value used to seed `chisquare()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = chisquare( 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = chisquare( 2.0 ); } // Generate the same pseudorandom values... -rand = chisquare.factory( 2.0, { +const rand = chisquare.factory( 2.0, { 'seed': chisquare.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = chisquare.seedLength; +const len = chisquare.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = chisquare( 2 ); +let r = chisquare( 2 ); // returns r = chisquare( 2 ); @@ -238,7 +229,7 @@ r = chisquare( 2 ); // ... // Get a copy of the current state: -var state = chisquare.state; +const state = chisquare.state; // returns r = chisquare( 2 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = chisquare.stateLength; +const len = chisquare.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = chisquare.byteLength; +const sz = chisquare.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = chisquare.toJSON(); +const o = chisquare.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = chisquare.factory({ +const rand = chisquare.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -361,23 +352,19 @@ var o = rand.toJSON(); ```javascript -var chisquare = require( '@stdlib/random/base/chisquare' ); - -var seed; -var rand; -var i; +const chisquare = require( '@stdlib/random/base/chisquare' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( chisquare( 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = chisquare.factory( 5.0, { +const seed = 1234; +let rand = chisquare.factory( 5.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -385,7 +372,7 @@ for ( i = 0; i < 100; i++ ) { rand = chisquare.factory( 1.0, { 'seed': chisquare.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/cosine/README.md b/lib/node_modules/@stdlib/random/base/cosine/README.md index 58a255400b24..5760e54b9db9 100644 --- a/lib/node_modules/@stdlib/random/base/cosine/README.md +++ b/lib/node_modules/@stdlib/random/base/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosine = require( '@stdlib/random/base/cosine' ); +const cosine = require( '@stdlib/random/base/cosine' ); ``` #### cosine( mu, s ) @@ -35,14 +35,14 @@ var cosine = require( '@stdlib/random/base/cosine' ); Returns a pseudorandom number drawn from a [raised cosine][cosine] distribution with parameters `mu` (mean) and `s` (scale parameter). ```javascript -var r = cosine( 2.0, 5.0 ); +const r = cosine( 2.0, 5.0 ); // returns ``` If `mu` or `s` is `NaN` or `s <= 0`, the function returns `NaN`. ```javascript -var r = cosine( 2.0, -2.0 ); +let r = cosine( 2.0, -2.0 ); // returns NaN r = cosine( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = cosine( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [raised cosine][cosine] distribution. ```javascript -var rand = cosine.factory(); +const rand = cosine.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `s`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = cosine.factory( 10.0, 2.0 ); +const rand = cosine.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `s`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = cosine.factory(); +const rand = cosine.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = cosine.factory({ +const rand1 = cosine.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = cosine.factory( 1.0, 2.0, { +const rand2 = cosine.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = cosine( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = cosine( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `cosine`: -rand = cosine.factory({ +const rand = cosine.factory({ 'state': cosine.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === cosine( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === cosine( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === cosine( 1.0, 2.0 ) ); The generator name. ```javascript -var str = cosine.NAME; +const str = cosine.NAME; // returns 'cosine' ``` @@ -165,7 +160,7 @@ var str = cosine.NAME; The underlying pseudorandom number generator. ```javascript -var prng = cosine.PRNG; +const prng = cosine.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = cosine.PRNG; The value used to seed `cosine()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = cosine( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = cosine( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = cosine.factory( 2.0, 2.0, { +const rand = cosine.factory( 2.0, 2.0, { 'seed': cosine.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = cosine.seedLength; +const len = cosine.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = cosine( 2.0, 5.0 ); +let r = cosine( 2.0, 5.0 ); // returns r = cosine( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = cosine( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = cosine.state; +const state = cosine.state; // returns r = cosine( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = cosine.stateLength; +const len = cosine.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = cosine.byteLength; +const sz = cosine.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = cosine.toJSON(); +const o = cosine.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = cosine.factory({ +const rand = cosine.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var cosine = require( '@stdlib/random/base/cosine' ); - -var seed; -var rand; -var i; +const cosine = require( '@stdlib/random/base/cosine' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( cosine( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = cosine.factory( 5.0, 2.0, { +const seed = 1234; +let rand = cosine.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = cosine.factory( 0.0, 1.0, { 'seed': cosine.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/discrete-uniform/README.md b/lib/node_modules/@stdlib/random/base/discrete-uniform/README.md index ba288c2a886a..23852ac0822f 100644 --- a/lib/node_modules/@stdlib/random/base/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/random/base/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); ``` #### discreteUniform( a, b ) @@ -35,14 +35,14 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); Returns a pseudorandom number drawn from a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var r = discreteUniform( 2, 50 ); +const r = discreteUniform( 2, 50 ); // returns ``` If either `a` or `b` is not an integer value or `a > b`, the function returns `NaN`. ```javascript -var r = discreteUniform( 20, 10 ); +let r = discreteUniform( 20, 10 ); // returns NaN r = discreteUniform( NaN, 10 ); @@ -57,9 +57,9 @@ r = discreteUniform( 10, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [discrete uniform][discrete-uniform-distribution] distribution. ```javascript -var rand = discreteUniform.factory(); +const rand = discreteUniform.factory(); -var r = rand( 0, 10 ); +const r = rand( 0, 10 ); // returns ``` @@ -67,9 +67,9 @@ If provided `a` and `b`, the returned generator returns random variates from the ```javascript // Draw from discreteUniform( -20, 20 ) distribution: -var rand = discreteUniform.factory( -20, 20 ); +const rand = discreteUniform.factory( -20, 20 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -79,9 +79,9 @@ r = rand(); If not provided `a` and `b`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = discreteUniform.factory(); +const rand = discreteUniform.factory(); -var r = rand( 0, 10 ); +let r = rand( 0, 10 ); // returns r = rand( -20, 20 ); @@ -98,57 +98,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom integers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var r = rand( 20, 40 ); +const r = rand( 20, 40 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = discreteUniform.factory({ +const rand1 = discreteUniform.factory({ 'seed': 12345 }); -var r1 = rand1( 20, 40 ); +const r1 = rand1( 20, 40 ); // returns -var rand2 = discreteUniform.factory( 20, 40, { +const rand2 = discreteUniform.factory( 20, 40, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = discreteUniform( 20, 40 ); +for ( let i = 0; i < 1000; i++ ) { + const r = discreteUniform( 20, 40 ); } // Create a new PRNG initialized to the current state of `discreteUniform`: -rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'state': discreteUniform.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 20, 40 ) === discreteUniform( 20, 40 ) ); +const bool = ( rand( 20, 40 ) === discreteUniform( 20, 40 ) ); // returns true ``` @@ -157,7 +152,7 @@ bool = ( rand( 20, 40 ) === discreteUniform( 20, 40 ) ); The generator name. ```javascript -var str = discreteUniform.NAME; +const str = discreteUniform.NAME; // returns 'discrete-uniform' ``` @@ -166,7 +161,7 @@ var str = discreteUniform.NAME; The underlying pseudorandom number generator. ```javascript -var prng = discreteUniform.PRNG; +const prng = discreteUniform.PRNG; // returns ``` @@ -175,34 +170,30 @@ var prng = discreteUniform.PRNG; The value used to seed `discreteUniform()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = discreteUniform( 0, 10 ); + const r = discreteUniform( 0, 10 ); } // Generate the same pseudorandom values... -rand = discreteUniform.factory( 0, 10, { +const rand = discreteUniform.factory( 0, 10, { 'seed': discreteUniform.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` If provided a PRNG for uniformly distributed integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -211,20 +202,20 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = discreteUniform.seedLength; +const len = discreteUniform.seedLength; // returns ``` If provided a PRNG for uniformly distributed integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -233,7 +224,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = discreteUniform( -10, 10 ); +let r = discreteUniform( -10, 10 ); // returns r = discreteUniform( -10, 10 ); @@ -242,7 +233,7 @@ r = discreteUniform( -10, 10 ); // ... // Get a copy of the current state: -var state = discreteUniform.state; +const state = discreteUniform.state; // returns r = discreteUniform( -10, 10 ); @@ -267,13 +258,13 @@ r = discreteUniform( -10, 10 ); If provided a PRNG for uniformly distributed integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -282,20 +273,20 @@ var state = rand.state; Length of generator state. ```javascript -var len = discreteUniform.stateLength; +const len = discreteUniform.stateLength; // returns ``` If provided a PRNG for uniformly distributed integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -304,20 +295,20 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = discreteUniform.byteLength; +const sz = discreteUniform.byteLength; // returns ``` If provided a PRNG for uniformly distributed integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -326,20 +317,20 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = discreteUniform.toJSON(); +const o = discreteUniform.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` If provided a PRNG for uniformly distributed numbers, this method returns `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = discreteUniform.factory({ +const rand = discreteUniform.factory({ 'prng': minstd }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -365,23 +356,19 @@ var o = rand.toJSON(); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); - -var seed; -var rand; -var i; +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( discreteUniform( 0, 100 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = discreteUniform.factory( -20, 20, { +const seed = 1234; +let rand = discreteUniform.factory( -20, 20, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -389,7 +376,7 @@ for ( i = 0; i < 100; i++ ) { rand = discreteUniform.factory( -20, 20, { 'seed': discreteUniform.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/erlang/README.md b/lib/node_modules/@stdlib/random/base/erlang/README.md index e7752f10527d..9163bc266550 100644 --- a/lib/node_modules/@stdlib/random/base/erlang/README.md +++ b/lib/node_modules/@stdlib/random/base/erlang/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var erlang = require( '@stdlib/random/base/erlang' ); +const erlang = require( '@stdlib/random/base/erlang' ); ``` #### erlang( k, lambda ) @@ -35,28 +35,28 @@ var erlang = require( '@stdlib/random/base/erlang' ); Returns a pseudorandom number drawn from a [Erlang][erlang] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var r = erlang( 2, 5.0 ); +const r = erlang( 2, 5.0 ); // returns ``` If `k` is not a positive integer, the function returns `NaN`. ```javascript -var r = erlang( 2.2, 1.0 ); +const r = erlang( 2.2, 1.0 ); // returns NaN ``` If `lambda <= 0`, the function returns `NaN`. ```javascript -var r = erlang( 2, -2.0 ); +const r = erlang( 2, -2.0 ); // returns NaN ``` If either `k` or `lambda` is `NaN`, the function returns `NaN`. ```javascript -var r = erlang( NaN, 5.0 ); +let r = erlang( NaN, 5.0 ); // returns NaN r = erlang( 2, NaN ); @@ -68,9 +68,9 @@ r = erlang( 2, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Erlang][erlang] distribution. ```javascript -var rand = erlang.factory(); +const rand = erlang.factory(); -var r = rand( 2, 1.5 ); +const r = rand( 2, 1.5 ); // returns ``` @@ -78,9 +78,9 @@ If provided `k` and `lambda`, the returned generator returns random variates fro ```javascript // Draw from Erlang( 2, 1.5 ) distribution: -var rand = erlang.factory( 2, 1.5 ); +const rand = erlang.factory( 2, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -90,9 +90,9 @@ r = rand(); If not provided `k` and `lambda`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = erlang.factory(); +const rand = erlang.factory(); -var r = rand( 2, 1.0 ); +let r = rand( 2, 1.0 ); // returns r = rand( 4, 3.14 ); @@ -109,57 +109,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': minstd.normalized }); -var r = rand( 2, 3.0 ); +const r = rand( 2, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = erlang.factory({ +const rand1 = erlang.factory({ 'seed': 12345 }); -var r1 = rand1( 2, 3.0 ); +const r1 = rand1( 2, 3.0 ); // returns -var rand2 = erlang.factory( 2, 3.0, { +const rand2 = erlang.factory( 2, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = erlang( 2, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = erlang( 2, 3.0 ); } // Create a new PRNG initialized to the current state of `erlang`: -rand = erlang.factory({ +const rand = erlang.factory({ 'state': erlang.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2, 3.0 ) === erlang( 2, 3.0 ) ); +const bool = ( rand( 2, 3.0 ) === erlang( 2, 3.0 ) ); // returns true ``` @@ -168,7 +163,7 @@ bool = ( rand( 2, 3.0 ) === erlang( 2, 3.0 ) ); The generator name. ```javascript -var str = erlang.NAME; +const str = erlang.NAME; // returns 'erlang' ``` @@ -177,7 +172,7 @@ var str = erlang.NAME; The underlying pseudorandom number generator. ```javascript -var prng = erlang.PRNG; +const prng = erlang.PRNG; // returns ``` @@ -186,21 +181,17 @@ var prng = erlang.PRNG; The value used to seed `erlang()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = erlang( 2, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = erlang( 2, 2.0 ); } // Generate the same pseudorandom values... -rand = erlang.factory( 2, 2.0, { +const rand = erlang.factory( 2, 2.0, { 'seed': erlang.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -209,11 +200,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -222,7 +213,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = erlang.seedLength; +const len = erlang.seedLength; // returns ``` @@ -231,11 +222,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -244,7 +235,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = erlang( 2, 4.0 ); +let r = erlang( 2, 4.0 ); // returns r = erlang( 2, 4.0 ); @@ -253,7 +244,7 @@ r = erlang( 2, 4.0 ); // ... // Get a copy of the current state: -var state = erlang.state; +const state = erlang.state; // returns r = erlang( 2, 4.0 ); @@ -280,11 +271,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -293,7 +284,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = erlang.stateLength; +const len = erlang.stateLength; // returns ``` @@ -302,11 +293,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -315,7 +306,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = erlang.byteLength; +const sz = erlang.byteLength; // returns ``` @@ -324,11 +315,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -337,7 +328,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = erlang.toJSON(); +const o = erlang.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -346,11 +337,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = erlang.factory({ +const rand = erlang.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -376,23 +367,19 @@ var o = rand.toJSON(); ```javascript -var erlang = require( '@stdlib/random/base/erlang' ); - -var seed; -var rand; -var i; +const erlang = require( '@stdlib/random/base/erlang' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( erlang( 2, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = erlang.factory( 6, 2.0, { +const seed = 1234; +let rand = erlang.factory( 6, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -400,7 +387,7 @@ for ( i = 0; i < 100; i++ ) { rand = erlang.factory( 2, 2.0, { 'seed': erlang.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/exponential/README.md b/lib/node_modules/@stdlib/random/base/exponential/README.md index 2d65a276b2b5..2b35108dd3c8 100644 --- a/lib/node_modules/@stdlib/random/base/exponential/README.md +++ b/lib/node_modules/@stdlib/random/base/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); ``` #### exponential( lambda ) @@ -35,14 +35,14 @@ var exponential = require( '@stdlib/random/base/exponential' ); Returns a pseudorandom number drawn from an [exponential][exponential] distribution with rate parameter `lambda`. ```javascript -var r = exponential( 7.9 ); +const r = exponential( 7.9 ); // returns ``` If `lambda <= 0` or `lambda` is `NaN`, the function returns `NaN`. ```javascript -var r = exponential( -2.0 ); +let r = exponential( -2.0 ); // returns NaN r = exponential( NaN ); @@ -54,18 +54,18 @@ r = exponential( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from an [exponential][exponential] distribution. ```javascript -var rand = exponential.factory(); +const rand = exponential.factory(); -var r = rand( 5.0 ); +const r = rand( 5.0 ); // returns ``` If provided `lambda`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = exponential.factory( 10.0 ); +const rand = exponential.factory( 10.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `lambda`, the returned generator requires that `lambda` be provided at each invocation. ```javascript -var rand = exponential.factory(); +const rand = exponential.factory(); -var r = rand( 4.0 ); +let r = rand( 4.0 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': minstd.normalized }); -var r = rand( 3.0 ); +const r = rand( 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = exponential.factory({ +const rand1 = exponential.factory({ 'seed': 12345 }); -var r1 = rand1( 3.0 ); +const r1 = rand1( 3.0 ); // returns -var rand2 = exponential.factory( 3.0, { +const rand2 = exponential.factory( 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = exponential( 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = exponential( 3.0 ); } // Create a new PRNG initialized to the current state of `exponential`: -rand = exponential.factory({ +const rand = exponential.factory({ 'state': exponential.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 3.0 ) === exponential( 3.0 ) ); +const bool = ( rand( 3.0 ) === exponential( 3.0 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 3.0 ) === exponential( 3.0 ) ); The generator name. ```javascript -var str = exponential.NAME; +const str = exponential.NAME; // returns 'exponential' ``` @@ -162,7 +157,7 @@ var str = exponential.NAME; The underlying pseudorandom number generator. ```javascript -var prng = exponential.PRNG; +const prng = exponential.PRNG; // returns ``` @@ -171,21 +166,17 @@ var prng = exponential.PRNG; The value used to seed `exponential()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = exponential( 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = exponential( 2.0 ); } // Generate the same pseudorandom values... -rand = exponential.factory( 2.0, { +const rand = exponential.factory( 2.0, { 'seed': exponential.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = exponential.seedLength; +const len = exponential.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = exponential( 7.9 ); +let r = exponential( 7.9 ); // returns r = exponential( 7.9 ); @@ -238,7 +229,7 @@ r = exponential( 7.9 ); // ... // Get a copy of the current state: -var state = exponential.state; +const state = exponential.state; // returns r = exponential( 7.9 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = exponential.stateLength; +const len = exponential.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = exponential.byteLength; +const sz = exponential.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = exponential.toJSON(); +const o = exponential.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = exponential.factory({ +const rand = exponential.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -361,23 +352,19 @@ var o = rand.toJSON(); ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); - -var seed; -var rand; -var i; +const exponential = require( '@stdlib/random/base/exponential' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( exponential( 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = exponential.factory( 0.8, { +const seed = 1234; +let rand = exponential.factory( 0.8, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -385,7 +372,7 @@ for ( i = 0; i < 100; i++ ) { rand = exponential.factory( 0.5, { 'seed': exponential.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/f/README.md b/lib/node_modules/@stdlib/random/base/f/README.md index 0075e5e63fad..83168b86e3a4 100644 --- a/lib/node_modules/@stdlib/random/base/f/README.md +++ b/lib/node_modules/@stdlib/random/base/f/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var f = require( '@stdlib/random/base/f' ); +const f = require( '@stdlib/random/base/f' ); ``` #### f( d1, d2 ) @@ -35,14 +35,14 @@ var f = require( '@stdlib/random/base/f' ); Returns a pseudorandom number drawn from an [F][f] distribution with parameters `d1` (degrees of freedom) and `d2` (degrees of freedom). ```javascript -var r = f( 2.0, 5.0 ); +const r = f( 2.0, 5.0 ); // returns ``` If `d1 <= 0` or `d2 <= 0`, the function returns `NaN`. ```javascript -var r = f( 2.0, -2.0 ); +let r = f( 2.0, -2.0 ); // returns NaN r = f( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = f( -2.0, 2.0 ); If `d1` or `d2` is `NaN`, the function returns `NaN`. ```javascript -var r = f( NaN, 5.0 ); +let r = f( NaN, 5.0 ); // returns NaN r = f( 2.0, NaN ); @@ -64,9 +64,9 @@ r = f( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from am [F][f] distribution. ```javascript -var rand = f.factory(); +const rand = f.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` @@ -74,9 +74,9 @@ If provided `d1` and `d2`, the returned generator returns random variates from t ```javascript // Draw from F( 1.5, 1.5 ) distribution: -var rand = f.factory( 1.5, 1.5 ); +const rand = f.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `d1` and `d2`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = f.factory(); +const rand = f.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = f.factory({ +const rand = f.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = f.factory({ +const rand1 = f.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = f.factory( 2.0, 3.0, { +const rand2 = f.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = f( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = f( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `f`: -rand = f.factory({ +const rand = f.factory({ 'state': f.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === f( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === f( 2.0, 3.0 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 2.0, 3.0 ) === f( 2.0, 3.0 ) ); The generator name. ```javascript -var str = f.NAME; +const str = f.NAME; // returns 'f' ``` @@ -173,7 +168,7 @@ var str = f.NAME; The underlying pseudorandom number generator. ```javascript -var prng = f.PRNG; +const prng = f.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = f.PRNG; The value used to seed `f()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = f( 2.0, 2.0 ); + const r = f( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = f.factory( 2.0, 2.0, { +const rand = f.factory( 2.0, 2.0, { 'seed': f.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = f.seedLength; +const len = f.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = f( 2.0, 3.0 ); +let r = f( 2.0, 3.0 ); // returns r = f( 2.0, 3.0 ); @@ -249,7 +240,7 @@ r = f( 2.0, 3.0 ); // ... // Get a copy of the current state: -var state = f.state; +const state = f.state; // returns r = f( 2.0, 3.0 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = f.stateLength; +const len = f.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = f.byteLength; +const sz = f.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = f.toJSON(); +const o = f.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = f.factory({ +const rand = f.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var f = require( '@stdlib/random/base/f' ); - -var seed; -var rand; -var i; +const f = require( '@stdlib/random/base/f' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( f( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = f.factory( 6.0, 2.0, { +const seed = 1234; +let rand = f.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = f.factory( 2.0, 2.0, { 'seed': f.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/frechet/README.md b/lib/node_modules/@stdlib/random/base/frechet/README.md index a4d8004c5c6c..7123cd2d18e3 100644 --- a/lib/node_modules/@stdlib/random/base/frechet/README.md +++ b/lib/node_modules/@stdlib/random/base/frechet/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var frechet = require( '@stdlib/random/base/frechet' ); +const frechet = require( '@stdlib/random/base/frechet' ); ``` #### frechet( alpha, s, m ) @@ -35,14 +35,14 @@ var frechet = require( '@stdlib/random/base/frechet' ); Returns a pseudorandom number drawn from a [Fréchet][frechet] distribution with parameters `alpha` (shape), `s` (scale), and `m` (location). ```javascript -var r = frechet( 2.0, 5.0, 3.33 ); +const r = frechet( 2.0, 5.0, 3.33 ); // returns ``` If either `alpha`, `s`, or `m` is `NaN`, the function returns `NaN`. ```javascript -var r = frechet( NaN, 1.0, 0.5 ); +let r = frechet( NaN, 1.0, 0.5 ); // returns NaN r = frechet( 1.0, NaN, 2.42 ); @@ -55,7 +55,7 @@ r = frechet( 7.0, 10.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = frechet( 0.0, 3.0, 2.0 ); +let y = frechet( 0.0, 3.0, 2.0 ); // returns NaN y = frechet( -1.0, 2.0, 2.0 ); @@ -65,7 +65,7 @@ y = frechet( -1.0, 2.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = frechet( 1.0, 0.0, 2.0 ); +let y = frechet( 1.0, 0.0, 2.0 ); // returns NaN y = frechet( 1.0, -1.0, 2.0 ); @@ -77,18 +77,18 @@ y = frechet( 1.0, -1.0, 2.0 ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Fréchet][frechet] distribution. ```javascript -var rand = frechet.factory(); +const rand = frechet.factory(); -var r = rand( 2.0, 1.0, 0.5 ); +const r = rand( 2.0, 1.0, 0.5 ); // returns ``` If provided `alpha`, `s`, and `m`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = frechet.factory( 2.0, 2.0, 1.0 ); +const rand = frechet.factory( 2.0, 2.0, 1.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -98,9 +98,9 @@ r = rand(); If not provided `alpha`, `s`, and `m`, the returned generator requires that all three parameters be provided at each invocation. ```javascript -var rand = frechet.factory(); +const rand = frechet.factory(); -var r = rand( 4.0, 1.0, 0.75 ); +let r = rand( 4.0, 1.0, 0.75 ); // returns r = rand( 2.0, 8.0, 0.1 ); @@ -117,57 +117,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 4.0, 3.0 ); +const r = rand( 2.0, 4.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = frechet.factory({ +const rand1 = frechet.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 4.0, 3.0 ); +const r1 = rand1( 2.0, 4.0, 3.0 ); // returns -var rand2 = frechet.factory( 2.0, 4.0, 3.0, { +const rand2 = frechet.factory( 2.0, 4.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = frechet( 2.0, 2.0, 1.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = frechet( 2.0, 2.0, 1.0 ); } // Create a new PRNG initialized to the current state of `frechet`: -rand = frechet.factory({ +const rand = frechet.factory({ 'state': frechet.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 2.0, 1.0 ) === frechet( 2.0, 2.0, 1.0 ) ); +const bool = ( rand( 2.0, 2.0, 1.0 ) === frechet( 2.0, 2.0, 1.0 ) ); // returns true ``` @@ -176,7 +171,7 @@ bool = ( rand( 2.0, 2.0, 1.0 ) === frechet( 2.0, 2.0, 1.0 ) ); The generator name. ```javascript -var str = frechet.NAME; +const str = frechet.NAME; // returns 'frechet' ``` @@ -185,7 +180,7 @@ var str = frechet.NAME; The underlying pseudorandom number generator. ```javascript -var prng = frechet.PRNG; +const prng = frechet.PRNG; // returns ``` @@ -194,21 +189,17 @@ var prng = frechet.PRNG; The value used to seed `frechet()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = frechet( 4.0, 10.0, 3.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = frechet( 4.0, 10.0, 3.0 ); } // Generate the same pseudorandom values... -rand = frechet.factory( 4.0, 10.0, 3.0, { +const rand = frechet.factory( 4.0, 10.0, 3.0, { 'seed': frechet.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -217,11 +208,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -230,7 +221,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = frechet.seedLength; +const len = frechet.seedLength; // returns ``` @@ -239,11 +230,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -252,7 +243,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = frechet( 2.0, 2.0, 1.0 ); +let r = frechet( 2.0, 2.0, 1.0 ); // returns r = frechet( 2.0, 2.0, 1.0 ); @@ -261,7 +252,7 @@ r = frechet( 2.0, 2.0, 1.0 ); // ... // Get a copy of the current state: -var state = frechet.state; +const state = frechet.state; // returns r = frechet( 2.0, 2.0, 1.0 ); @@ -288,11 +279,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -301,7 +292,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = frechet.stateLength; +const len = frechet.stateLength; // returns ``` @@ -310,11 +301,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -323,7 +314,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = frechet.byteLength; +const sz = frechet.byteLength; // returns ``` @@ -332,11 +323,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -345,7 +336,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = frechet.toJSON(); +const o = frechet.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -354,11 +345,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = frechet.factory({ +const rand = frechet.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -384,23 +375,19 @@ var o = rand.toJSON(); ```javascript -var frechet = require( '@stdlib/random/base/frechet' ); - -var seed; -var rand; -var i; +const frechet = require( '@stdlib/random/base/frechet' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( frechet( 1.0, 1.0, 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = frechet.factory( 2.0, 5.0, 3.0, { +const seed = 1234; +let rand = frechet.factory( 2.0, 5.0, 3.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -408,7 +395,7 @@ for ( i = 0; i < 100; i++ ) { rand = frechet.factory( 1.0, 1.0, 0.5, { 'seed': frechet.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/gamma/README.md b/lib/node_modules/@stdlib/random/base/gamma/README.md index d2e227fa0e66..aaf13b092a92 100644 --- a/lib/node_modules/@stdlib/random/base/gamma/README.md +++ b/lib/node_modules/@stdlib/random/base/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gamma = require( '@stdlib/random/base/gamma' ); +const gamma = require( '@stdlib/random/base/gamma' ); ``` #### gamma( alpha, beta ) @@ -35,14 +35,14 @@ var gamma = require( '@stdlib/random/base/gamma' ); Returns a pseudorandom number drawn from a [gamma][gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var r = gamma( 2.0, 5.0 ); +const r = gamma( 2.0, 5.0 ); // returns ``` If `alpha <= 0` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = gamma( 2.0, -2.0 ); +let r = gamma( 2.0, -2.0 ); // returns NaN r = gamma( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = gamma( -2.0, 2.0 ); If `alpha` or `beta` is `NaN`, the function returns `NaN`. ```javascript -var r = gamma( NaN, 5.0 ); +let r = gamma( NaN, 5.0 ); // returns NaN r = gamma( 2.0, NaN ); @@ -64,9 +64,9 @@ r = gamma( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [gamma][gamma] distribution. ```javascript -var rand = gamma.factory(); +const rand = gamma.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` @@ -74,9 +74,9 @@ If provided `alpha` and `beta`, the returned generator returns random variates f ```javascript // Draw from Gamma( 1.5, 1.5 ) distribution: -var rand = gamma.factory( 1.5, 1.5 ); +const rand = gamma.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `alpha` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = gamma.factory(); +const rand = gamma.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = gamma.factory({ +const rand1 = gamma.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = gamma.factory( 2.0, 3.0, { +const rand2 = gamma.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = gamma( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = gamma( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `gamma`: -rand = gamma.factory({ +const rand = gamma.factory({ 'state': gamma.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === gamma( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === gamma( 2.0, 3.0 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 2.0, 3.0 ) === gamma( 2.0, 3.0 ) ); The generator name. ```javascript -var str = gamma.NAME; +const str = gamma.NAME; // returns 'gamma' ``` @@ -173,7 +168,7 @@ var str = gamma.NAME; The underlying pseudorandom number generator. ```javascript -var prng = gamma.PRNG; +const prng = gamma.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = gamma.PRNG; The value used to seed `gamma()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = gamma( 2.0, 2.0 ); + const r = gamma( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = gamma.factory( 2.0, 2.0, { +const rand = gamma.factory( 2.0, 2.0, { 'seed': gamma.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = gamma.seedLength; +const len = gamma.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = gamma( 2.0, 5.0 ); +let r = gamma( 2.0, 5.0 ); // returns r = gamma( 2.0, 5.0 ); @@ -249,7 +240,7 @@ r = gamma( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = gamma.state; +const state = gamma.state; // returns r = gamma( 2.0, 5.0 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = gamma.stateLength; +const len = gamma.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = gamma.byteLength; +const sz = gamma.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = gamma.toJSON(); +const o = gamma.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = gamma.factory({ +const rand = gamma.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var gamma = require( '@stdlib/random/base/gamma' ); - -var seed; -var rand; -var i; +const gamma = require( '@stdlib/random/base/gamma' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( gamma( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = gamma.factory( 6.0, 2.0, { +const seed = 1234; +let rand = gamma.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = gamma.factory( 2.0, 2.0, { 'seed': gamma.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/geometric/README.md b/lib/node_modules/@stdlib/random/base/geometric/README.md index e34c9953c96c..9c7ad1cf0d0f 100644 --- a/lib/node_modules/@stdlib/random/base/geometric/README.md +++ b/lib/node_modules/@stdlib/random/base/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var geometric = require( '@stdlib/random/base/geometric' ); +const geometric = require( '@stdlib/random/base/geometric' ); ``` #### geometric( p ) @@ -35,14 +35,14 @@ var geometric = require( '@stdlib/random/base/geometric' ); Returns a pseudorandom number drawn from a [geometric][geometric] distribution with success probability `p`. ```javascript -var r = geometric( 0.8 ); +const r = geometric( 0.8 ); // returns ``` If `p < 0` or `p > 1`, the function returns `NaN`. ```javascript -var r = geometric( 3.14 ); +let r = geometric( 3.14 ); // returns NaN r = geometric( -0.5 ); @@ -52,7 +52,7 @@ r = geometric( -0.5 ); If `p` is `NaN`, the function returns `NaN`. ```javascript -var r = geometric( NaN ); +const r = geometric( NaN ); // returns NaN ``` @@ -61,18 +61,18 @@ var r = geometric( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [geometric][geometric] distribution. ```javascript -var rand = geometric.factory(); +const rand = geometric.factory(); -var r = rand( 0.3 ); +const r = rand( 0.3 ); // returns ``` If provided `p`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = geometric.factory( 0.6 ); +const rand = geometric.factory( 0.6 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -82,9 +82,9 @@ r = rand(); If not provided `p`, the returned generator requires that `p` be provided at each invocation. ```javascript -var rand = geometric.factory(); +const rand = geometric.factory(); -var r = rand( 0.67 ); +let r = rand( 0.67 ); // returns r = rand( 0.42 ); @@ -101,57 +101,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': minstd.normalized }); -var r = rand( 0.9 ); +const r = rand( 0.9 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = geometric.factory({ +const rand1 = geometric.factory({ 'seed': 12345 }); -var r1 = rand1( 0.9 ); +const r1 = rand1( 0.9 ); // returns -var rand2 = geometric.factory( 0.9, { +const rand2 = geometric.factory( 0.9, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = geometric( 0.3 ); +for ( let i = 0; i < 1000; i++ ) { + const r = geometric( 0.3 ); } // Create a new PRNG initialized to the current state of `geometric`: -rand = geometric.factory({ +const rand = geometric.factory({ 'state': geometric.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 0.3 ) === geometric( 0.3 ) ); +const bool = ( rand( 0.3 ) === geometric( 0.3 ) ); // returns true ``` @@ -160,7 +155,7 @@ bool = ( rand( 0.3 ) === geometric( 0.3 ) ); The generator name. ```javascript -var str = geometric.NAME; +const str = geometric.NAME; // returns 'geometric' ``` @@ -169,7 +164,7 @@ var str = geometric.NAME; The underlying pseudorandom number generator. ```javascript -var prng = geometric.PRNG; +const prng = geometric.PRNG; // returns ``` @@ -178,21 +173,17 @@ var prng = geometric.PRNG; The value used to seed `geometric()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = geometric( 0.5 ); + const r = geometric( 0.5 ); } // Generate the same pseudorandom values... -rand = geometric.factory( 0.5, { +const rand = geometric.factory( 0.5, { 'seed': geometric.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -201,11 +192,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -214,7 +205,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = geometric.seedLength; +const len = geometric.seedLength; // returns ``` @@ -223,11 +214,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -236,7 +227,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = geometric( 0.3 ); +let r = geometric( 0.3 ); // returns r = geometric( 0.3 ); @@ -245,7 +236,7 @@ r = geometric( 0.3 ); // ... // Get a copy of the current state: -var state = geometric.state; +const state = geometric.state; // returns r = geometric( 0.3 ); @@ -272,11 +263,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -285,7 +276,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = geometric.stateLength; +const len = geometric.stateLength; // returns ``` @@ -294,11 +285,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -307,7 +298,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = geometric.byteLength; +const sz = geometric.byteLength; // returns ``` @@ -316,11 +307,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -329,7 +320,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = geometric.toJSON(); +const o = geometric.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -338,11 +329,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = geometric.factory({ +const rand = geometric.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -368,23 +359,19 @@ var o = rand.toJSON(); ```javascript -var geometric = require( '@stdlib/random/base/geometric' ); - -var seed; -var rand; -var i; +const geometric = require( '@stdlib/random/base/geometric' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( geometric( 0.4 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = geometric.factory( 0.4, { +const seed = 1234; +let rand = geometric.factory( 0.4, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -392,7 +379,7 @@ for ( i = 0; i < 100; i++ ) { rand = geometric.factory( 0.4, { 'seed': geometric.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/gumbel/README.md b/lib/node_modules/@stdlib/random/base/gumbel/README.md index 8b7c9e696ba9..101ea0959713 100644 --- a/lib/node_modules/@stdlib/random/base/gumbel/README.md +++ b/lib/node_modules/@stdlib/random/base/gumbel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gumbel = require( '@stdlib/random/base/gumbel' ); +const gumbel = require( '@stdlib/random/base/gumbel' ); ``` #### gumbel( mu, beta ) @@ -35,14 +35,14 @@ var gumbel = require( '@stdlib/random/base/gumbel' ); Returns a pseudorandom number drawn from a [Gumbel][gumbel] distribution with parameters `mu` (mean) and `beta` (scale parameter). ```javascript -var r = gumbel( 2.0, 5.0 ); +const r = gumbel( 2.0, 5.0 ); // returns ``` If `mu` or `beta` is `NaN` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = gumbel( 2.0, -2.0 ); +let r = gumbel( 2.0, -2.0 ); // returns NaN r = gumbel( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = gumbel( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Gumbel][gumbel] distribution. ```javascript -var rand = gumbel.factory(); +const rand = gumbel.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `beta`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = gumbel.factory( 10.0, 2.0 ); +const rand = gumbel.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = gumbel.factory(); +const rand = gumbel.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = gumbel.factory({ +const rand1 = gumbel.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = gumbel.factory( 1.0, 2.0, { +const rand2 = gumbel.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = gumbel( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = gumbel( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `gumbel`: -rand = gumbel.factory({ +const rand = gumbel.factory({ 'state': gumbel.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === gumbel( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === gumbel( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === gumbel( 1.0, 2.0 ) ); The generator name. ```javascript -var str = gumbel.NAME; +const str = gumbel.NAME; // returns 'gumbel' ``` @@ -165,7 +160,7 @@ var str = gumbel.NAME; The underlying pseudorandom number generator. ```javascript -var prng = gumbel.PRNG; +const prng = gumbel.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = gumbel.PRNG; The value used to seed `gumbel()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = gumbel( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = gumbel( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = gumbel.factory( 2.0, 2.0, { +const rand = gumbel.factory( 2.0, 2.0, { 'seed': gumbel.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = gumbel.seedLength; +const len = gumbel.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = gumbel( 2.0, 5.0 ); +let r = gumbel( 2.0, 5.0 ); // returns r = gumbel( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = gumbel( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = gumbel.state; +const state = gumbel.state; // returns r = gumbel( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = gumbel.stateLength; +const len = gumbel.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = gumbel.byteLength; +const sz = gumbel.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = gumbel.toJSON(); +const o = gumbel.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = gumbel.factory({ +const rand = gumbel.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var gumbel = require( '@stdlib/random/base/gumbel' ); - -var seed; -var rand; -var i; +const gumbel = require( '@stdlib/random/base/gumbel' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( gumbel( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = gumbel.factory( 5.0, 2.0, { +const seed = 1234; +let rand = gumbel.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = gumbel.factory( 0.0, 1.0, { 'seed': gumbel.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/hypergeometric/README.md b/lib/node_modules/@stdlib/random/base/hypergeometric/README.md index 4053b741bb27..cc63cb0441b4 100644 --- a/lib/node_modules/@stdlib/random/base/hypergeometric/README.md +++ b/lib/node_modules/@stdlib/random/base/hypergeometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hypergeometric = require( '@stdlib/random/base/hypergeometric' ); +const hypergeometric = require( '@stdlib/random/base/hypergeometric' ); ``` #### hypergeometric( N, K, n ) @@ -35,14 +35,14 @@ var hypergeometric = require( '@stdlib/random/base/hypergeometric' ); Returns a pseudorandom number drawn from a [hypergeometric][hypergeometric] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var r = hypergeometric( 20, 10, 7 ); +const r = hypergeometric( 20, 10, 7 ); // returns ``` `N`, `K`, and `n` must all be nonnegative integers; otherwise, the function returns `NaN`. ```javascript -var r = hypergeometric( 10.5, 10, 10 ); +let r = hypergeometric( 10.5, 10, 10 ); // returns NaN r = hypergeometric( 10, 4.4, 2 ); @@ -58,7 +58,7 @@ r = hypergeometric( NaN, NaN, NaN ); If `n > N` or `K > N`, the function returns `NaN`. ```javascript -var r = hypergeometric( 7, 5, 12 ); +const r = hypergeometric( 7, 5, 12 ); // returns NaN ``` @@ -67,18 +67,18 @@ var r = hypergeometric( 7, 5, 12 ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [hypergeometric][hypergeometric] distribution. ```javascript -var rand = hypergeometric.factory(); +const rand = hypergeometric.factory(); -var r = rand( 20, 10, 15 ); +const r = rand( 20, 10, 15 ); // returns ``` If provided `N`, `K`, and `n`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = hypergeometric.factory( 20, 10, 15 ); +const rand = hypergeometric.factory( 20, 10, 15 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -88,9 +88,9 @@ r = rand(); If not provided `N`, `K`, and `n`, the returned generator requires that all three parameters be specified at each invocation. ```javascript -var rand = hypergeometric.factory(); +const rand = hypergeometric.factory(); -var r = rand( 10, 7, 3 ); +let r = rand( 10, 7, 3 ); // returns r = rand( 104, 48, 21 ); @@ -107,57 +107,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': minstd.normalized }); -var r = rand( 10, 8, 5 ); +const r = rand( 10, 8, 5 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = hypergeometric.factory({ +const rand1 = hypergeometric.factory({ 'seed': 12345 }); -var r1 = rand1( 10, 8, 5 ); +const r1 = rand1( 10, 8, 5 ); // returns -var rand2 = hypergeometric.factory( 10, 8, 5, { +const rand2 = hypergeometric.factory( 10, 8, 5, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = hypergeometric( 10, 8, 5 ); +for ( let i = 0; i < 1000; i++ ) { + const r = hypergeometric( 10, 8, 5 ); } // Create a new PRNG initialized to the current state of `hypergeometric`: -rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'state': hypergeometric.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 10, 8, 5 ) === hypergeometric( 10, 8, 5 ) ); +const bool = ( rand( 10, 8, 5 ) === hypergeometric( 10, 8, 5 ) ); // returns true ``` @@ -166,7 +161,7 @@ bool = ( rand( 10, 8, 5 ) === hypergeometric( 10, 8, 5 ) ); The generator name. ```javascript -var str = hypergeometric.NAME; +const str = hypergeometric.NAME; // returns 'hypergeometric' ``` @@ -175,7 +170,7 @@ var str = hypergeometric.NAME; The underlying pseudorandom number generator. ```javascript -var prng = hypergeometric.PRNG; +const prng = hypergeometric.PRNG; // returns ``` @@ -184,21 +179,17 @@ var prng = hypergeometric.PRNG; The value used to seed `hypergeometric()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = hypergeometric( 20, 10, 15 ); +for ( let i = 0; i < 100; i++ ) { + const r = hypergeometric( 20, 10, 15 ); } // Generate the same pseudorandom values... -rand = hypergeometric.factory( 20, 10, 15, { +const rand = hypergeometric.factory( 20, 10, 15, { 'seed': hypergeometric.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -207,11 +198,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -220,7 +211,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = hypergeometric.seedLength; +const len = hypergeometric.seedLength; // returns ``` @@ -229,11 +220,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -242,7 +233,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = hypergeometric( 10, 8, 5 ); +let r = hypergeometric( 10, 8, 5 ); // returns r = hypergeometric( 10, 8, 5 ); @@ -251,7 +242,7 @@ r = hypergeometric( 10, 8, 5 ); // ... // Get a copy of the current state: -var state = hypergeometric.state; +const state = hypergeometric.state; // returns r = hypergeometric( 10, 8, 5 ); @@ -278,11 +269,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -291,7 +282,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = hypergeometric.stateLength; +const len = hypergeometric.stateLength; // returns ``` @@ -300,11 +291,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -313,7 +304,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = hypergeometric.byteLength; +const sz = hypergeometric.byteLength; // returns ``` @@ -322,11 +313,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -335,7 +326,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = hypergeometric.toJSON(); +const o = hypergeometric.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -344,11 +335,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = hypergeometric.factory({ +const rand = hypergeometric.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -374,23 +365,19 @@ var o = rand.toJSON(); ```javascript -var hypergeometric = require( '@stdlib/random/base/hypergeometric' ); - -var seed; -var rand; -var i; +const hypergeometric = require( '@stdlib/random/base/hypergeometric' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( hypergeometric( 10, 10, 10 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = hypergeometric.factory( 5, 3, 2, { +const seed = 1234; +let rand = hypergeometric.factory( 5, 3, 2, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -398,7 +385,7 @@ for ( i = 0; i < 100; i++ ) { rand = hypergeometric.factory( 10, 10, 10, { 'seed': hypergeometric.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/improved-ziggurat/README.md b/lib/node_modules/@stdlib/random/base/improved-ziggurat/README.md index 42bc5b2df194..d549979255e5 100644 --- a/lib/node_modules/@stdlib/random/base/improved-ziggurat/README.md +++ b/lib/node_modules/@stdlib/random/base/improved-ziggurat/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randn = require( '@stdlib/random/base/improved-ziggurat' ); +const randn = require( '@stdlib/random/base/improved-ziggurat' ); ``` #### randn() @@ -35,7 +35,7 @@ var randn = require( '@stdlib/random/base/improved-ziggurat' ); Returns a standard normally distributed pseudorandom number. ```javascript -var r = randn(); +const r = randn(); // returns ``` @@ -44,7 +44,7 @@ var r = randn(); Returns a pseudorandom number generator (PRNG) for generating standard normally distributed pseudorandom numbers. ```javascript -var rand = randn.factory(); +const rand = randn.factory(); ``` The function accepts the following `options`: @@ -57,57 +57,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = randn.factory({ +const rand = randn.factory({ 'prng': minstd.normalized }); -var r = rand(); +const r = rand(); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = randn.factory({ +const rand1 = randn.factory({ 'seed': 12345 }); -var r1 = rand1(); +const r1 = rand1(); // returns -var rand2 = randn.factory({ +const rand2 = randn.factory({ 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = randn(); +for ( let i = 0; i < 1000; i++ ) { + const r = randn(); } // Create a new PRNG initialized to the current state of `randn`: -rand = randn.factory({ +const rand = randn.factory({ 'state': randn.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === randn() ); +const bool = ( rand() === randn() ); // returns true ``` @@ -116,7 +111,7 @@ bool = ( rand() === randn() ); The generator name. ```javascript -var str = randn.NAME; +const str = randn.NAME; // returns 'improved-ziggurat' ``` @@ -125,7 +120,7 @@ var str = randn.NAME; The underlying pseudorandom number generator for uniformly distributed numbers on the interval `[0,1)`. ```javascript -var prng = randn.PRNG; +const prng = randn.PRNG; // returns ``` @@ -134,21 +129,17 @@ var prng = randn.PRNG; The value used to seed `randn()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = randn(); + const r = randn(); } // Generate the same pseudorandom values... -rand = randn.factory({ +const rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -157,11 +148,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -170,7 +161,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = randn.seedLength; +const len = randn.seedLength; // returns ``` @@ -179,11 +170,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -192,7 +183,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = randn(); +let r = randn(); // returns r = randn(); @@ -201,7 +192,7 @@ r = randn(); // ... // Get a copy of the current state: -var state = randn.state; +const state = randn.state; // returns r = randn(); @@ -228,11 +219,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -241,7 +232,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = randn.stateLength; +const len = randn.stateLength; // returns ``` @@ -250,11 +241,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -263,7 +254,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = randn.byteLength; +const sz = randn.byteLength; // returns ``` @@ -272,11 +263,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -285,7 +276,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = randn.toJSON(); +const o = randn.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -294,11 +285,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -324,23 +315,19 @@ var o = rand.toJSON(); ```javascript -var randn = require( '@stdlib/random/base/improved-ziggurat' ); - -var seed; -var rand; -var i; +const randn = require( '@stdlib/random/base/improved-ziggurat' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( randn() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = randn.factory({ +const seed = 1234; +let rand = randn.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -348,7 +335,7 @@ for ( i = 0; i < 100; i++ ) { rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/invgamma/README.md b/lib/node_modules/@stdlib/random/base/invgamma/README.md index b9573e44e064..59fb1fb04263 100644 --- a/lib/node_modules/@stdlib/random/base/invgamma/README.md +++ b/lib/node_modules/@stdlib/random/base/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invgamma = require( '@stdlib/random/base/invgamma' ); +const invgamma = require( '@stdlib/random/base/invgamma' ); ``` #### invgamma( alpha, beta ) @@ -35,14 +35,14 @@ var invgamma = require( '@stdlib/random/base/invgamma' ); Returns a pseudorandom number drawn from an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var r = invgamma( 2.0, 5.0 ); +const r = invgamma( 2.0, 5.0 ); // returns ``` If `alpha <= 0` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = invgamma( 2.0, -2.0 ); +let r = invgamma( 2.0, -2.0 ); // returns NaN r = invgamma( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = invgamma( -2.0, 2.0 ); If `alpha` or `beta` is `NaN`, the function returns `NaN`. ```javascript -var r = invgamma( NaN, 5.0 ); +let r = invgamma( NaN, 5.0 ); // returns NaN r = invgamma( 2.0, NaN ); @@ -64,18 +64,18 @@ r = invgamma( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from an [inverse gamma][inverse-gamma] distribution. ```javascript -var rand = invgamma.factory(); +const rand = invgamma.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` If provided `alpha` and `beta`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = invgamma.factory( 1.5, 1.5 ); +const rand = invgamma.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -85,9 +85,9 @@ r = rand(); If not provided `alpha` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = invgamma.factory(); +const rand = invgamma.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -104,57 +104,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = invgamma.factory({ +const rand1 = invgamma.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = invgamma.factory( 2.0, 3.0, { +const rand2 = invgamma.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = invgamma( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = invgamma( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `invgamma`: -rand = invgamma.factory({ +const rand = invgamma.factory({ 'state': invgamma.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === invgamma( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === invgamma( 2.0, 3.0 ) ); // returns true ``` @@ -163,7 +158,7 @@ bool = ( rand( 2.0, 3.0 ) === invgamma( 2.0, 3.0 ) ); The generator name. ```javascript -var str = invgamma.NAME; +const str = invgamma.NAME; // returns 'invgamma' ``` @@ -172,7 +167,7 @@ var str = invgamma.NAME; The underlying pseudorandom number generator. ```javascript -var prng = invgamma.PRNG; +const prng = invgamma.PRNG; // returns ``` @@ -181,21 +176,17 @@ var prng = invgamma.PRNG; The value used to seed `invgamma()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = invgamma( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = invgamma( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = invgamma.factory( 2.0, 2.0, { +const rand = invgamma.factory( 2.0, 2.0, { 'seed': invgamma.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -204,11 +195,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -217,7 +208,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = invgamma.seedLength; +const len = invgamma.seedLength; // returns ``` @@ -226,11 +217,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -239,7 +230,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = invgamma( 2.0, 5.0 ); +let r = invgamma( 2.0, 5.0 ); // returns r = invgamma( 2.0, 5.0 ); @@ -248,7 +239,7 @@ r = invgamma( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = invgamma.state; +const state = invgamma.state; // returns r = invgamma( 2.0, 5.0 ); @@ -275,11 +266,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -288,7 +279,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = invgamma.stateLength; +const len = invgamma.stateLength; // returns ``` @@ -297,11 +288,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -310,7 +301,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = invgamma.byteLength; +const sz = invgamma.byteLength; // returns ``` @@ -319,11 +310,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -332,7 +323,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = invgamma.toJSON(); +const o = invgamma.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -341,11 +332,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = invgamma.factory({ +const rand = invgamma.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -371,23 +362,19 @@ var o = rand.toJSON(); ```javascript -var invgamma = require( '@stdlib/random/base/invgamma' ); - -var seed; -var rand; -var i; +const invgamma = require( '@stdlib/random/base/invgamma' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( invgamma( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = invgamma.factory( 6.0, 2.0, { +const seed = 1234; +let rand = invgamma.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -395,7 +382,7 @@ for ( i = 0; i < 100; i++ ) { rand = invgamma.factory( 2.0, 2.0, { 'seed': invgamma.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/kumaraswamy/README.md b/lib/node_modules/@stdlib/random/base/kumaraswamy/README.md index 3b3990c79ace..6065c7cf4821 100644 --- a/lib/node_modules/@stdlib/random/base/kumaraswamy/README.md +++ b/lib/node_modules/@stdlib/random/base/kumaraswamy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' ); +const kumaraswamy = require( '@stdlib/random/base/kumaraswamy' ); ``` #### kumaraswamy( a, b ) @@ -35,14 +35,14 @@ var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' ); Returns a pseudorandom number drawn from [Kumaraswamy's double bounded][kumaraswamy] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var r = kumaraswamy( 2.0, 5.0 ); +const r = kumaraswamy( 2.0, 5.0 ); // returns ``` If `a <= 0` or `b <= 0`, the function returns `NaN`. ```javascript -var r = kumaraswamy( 2.0, -2.0 ); +let r = kumaraswamy( 2.0, -2.0 ); // returns NaN r = kumaraswamy( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = kumaraswamy( -2.0, 2.0 ); If `a` or `b` is `NaN`, the function returns `NaN`. ```javascript -var r = kumaraswamy( NaN, 5.0 ); +let r = kumaraswamy( NaN, 5.0 ); // returns NaN r = kumaraswamy( 2.0, NaN ); @@ -64,9 +64,9 @@ r = kumaraswamy( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from [Kumaraswamy's double bounded][kumaraswamy] distribution. ```javascript -var rand = kumaraswamy.factory(); +const rand = kumaraswamy.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` @@ -74,9 +74,9 @@ If provided `a` and `b`, the returned generator returns random variates from the ```javascript // Draw from Kumaraswamy( 1.5, 1.5 ) distribution: -var rand = kumaraswamy.factory( 1.5, 1.5 ); +const rand = kumaraswamy.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -86,9 +86,9 @@ r = rand(); If not provided `a` and `b`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = kumaraswamy.factory(); +const rand = kumaraswamy.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -105,57 +105,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = kumaraswamy.factory({ +const rand1 = kumaraswamy.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = kumaraswamy.factory( 2.0, 3.0, { +const rand2 = kumaraswamy.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = kumaraswamy( 2.0, 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = kumaraswamy( 2.0, 3.0 ); } // Create a new PRNG initialized to the current state of `kumaraswamy`: -rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'state': kumaraswamy.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 2.0, 3.0 ) === kumaraswamy( 2.0, 3.0 ) ); +const bool = ( rand( 2.0, 3.0 ) === kumaraswamy( 2.0, 3.0 ) ); // returns true ``` @@ -164,7 +159,7 @@ bool = ( rand( 2.0, 3.0 ) === kumaraswamy( 2.0, 3.0 ) ); The generator name. ```javascript -var str = kumaraswamy.NAME; +const str = kumaraswamy.NAME; // returns 'kumaraswamy' ``` @@ -173,7 +168,7 @@ var str = kumaraswamy.NAME; The underlying pseudorandom number generator. ```javascript -var prng = kumaraswamy.PRNG; +const prng = kumaraswamy.PRNG; // returns ``` @@ -182,21 +177,17 @@ var prng = kumaraswamy.PRNG; The value used to seed `kumaraswamy()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = kumaraswamy( 2.0, 2.0 ); + const r = kumaraswamy( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = kumaraswamy.factory( 2.0, 2.0, { +const rand = kumaraswamy.factory( 2.0, 2.0, { 'seed': kumaraswamy.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -205,11 +196,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -218,7 +209,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = kumaraswamy.seedLength; +const len = kumaraswamy.seedLength; // returns ``` @@ -227,11 +218,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -240,7 +231,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = kumaraswamy( 2.0, 5.0 ); +let r = kumaraswamy( 2.0, 5.0 ); // returns r = kumaraswamy( 2.0, 5.0 ); @@ -249,7 +240,7 @@ r = kumaraswamy( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = kumaraswamy.state; +const state = kumaraswamy.state; // returns r = kumaraswamy( 2.0, 5.0 ); @@ -276,11 +267,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -289,7 +280,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = kumaraswamy.stateLength; +const len = kumaraswamy.stateLength; // returns ``` @@ -298,11 +289,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -311,7 +302,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = kumaraswamy.byteLength; +const sz = kumaraswamy.byteLength; // returns ``` @@ -320,11 +311,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -333,7 +324,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = kumaraswamy.toJSON(); +const o = kumaraswamy.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -342,11 +333,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = kumaraswamy.factory({ +const rand = kumaraswamy.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -372,23 +363,19 @@ var o = rand.toJSON(); ```javascript -var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' ); - -var seed; -var rand; -var i; +const kumaraswamy = require( '@stdlib/random/base/kumaraswamy' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( kumaraswamy( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = kumaraswamy.factory( 6.0, 2.0, { +const seed = 1234; +let rand = kumaraswamy.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -396,7 +383,7 @@ for ( i = 0; i < 100; i++ ) { rand = kumaraswamy.factory( 2.0, 2.0, { 'seed': kumaraswamy.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/laplace/README.md b/lib/node_modules/@stdlib/random/base/laplace/README.md index 9877e41b2c1f..7b22717b1d41 100644 --- a/lib/node_modules/@stdlib/random/base/laplace/README.md +++ b/lib/node_modules/@stdlib/random/base/laplace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var laplace = require( '@stdlib/random/base/laplace' ); +const laplace = require( '@stdlib/random/base/laplace' ); ``` #### laplace( mu, b ) @@ -35,14 +35,14 @@ var laplace = require( '@stdlib/random/base/laplace' ); Returns a pseudorandom number drawn from a [Laplace (double exponential)][laplace] distribution with parameters `mu` (mean) and `b` (scale parameter). ```javascript -var r = laplace( 2.0, 5.0 ); +const r = laplace( 2.0, 5.0 ); // returns ``` If `mu` or `b` is `NaN` or `b <= 0`, the function returns `NaN`. ```javascript -var r = laplace( 2.0, -2.0 ); +let r = laplace( 2.0, -2.0 ); // returns NaN r = laplace( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = laplace( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Laplace (double exponential)][laplace] distribution. ```javascript -var rand = laplace.factory(); +const rand = laplace.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `b`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = laplace.factory( 10.0, 2.0 ); +const rand = laplace.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `b`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = laplace.factory(); +const rand = laplace.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = laplace.factory({ +const rand1 = laplace.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = laplace.factory( 1.0, 2.0, { +const rand2 = laplace.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = laplace( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = laplace( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `laplace`: -rand = laplace.factory({ +const rand = laplace.factory({ 'state': laplace.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === laplace( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === laplace( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === laplace( 1.0, 2.0 ) ); The generator name. ```javascript -var str = laplace.NAME; +const str = laplace.NAME; // returns 'laplace' ``` @@ -165,7 +160,7 @@ var str = laplace.NAME; The underlying pseudorandom number generator. ```javascript -var prng = laplace.PRNG; +const prng = laplace.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = laplace.PRNG; The value used to seed `laplace()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = laplace( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = laplace( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = laplace.factory( 2.0, 2.0, { +const rand = laplace.factory( 2.0, 2.0, { 'seed': laplace.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = laplace.seedLength; +const len = laplace.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = laplace( 2.0, 5.0 ); +let r = laplace( 2.0, 5.0 ); // returns r = laplace( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = laplace( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = laplace.state; +const state = laplace.state; // returns r = laplace( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = laplace.stateLength; +const len = laplace.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = laplace.byteLength; +const sz = laplace.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = laplace.toJSON(); +const o = laplace.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = laplace.factory({ +const rand = laplace.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var laplace = require( '@stdlib/random/base/laplace' ); - -var seed; -var rand; -var i; +const laplace = require( '@stdlib/random/base/laplace' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( laplace( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = laplace.factory( 5.0, 2.0, { +const seed = 1234; +let rand = laplace.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = laplace.factory( 0.0, 1.0, { 'seed': laplace.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/levy/README.md b/lib/node_modules/@stdlib/random/base/levy/README.md index 0e4b323f4165..729c474c81f8 100644 --- a/lib/node_modules/@stdlib/random/base/levy/README.md +++ b/lib/node_modules/@stdlib/random/base/levy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var levy = require( '@stdlib/random/base/levy' ); +const levy = require( '@stdlib/random/base/levy' ); ``` #### levy( mu, c ) @@ -35,14 +35,14 @@ var levy = require( '@stdlib/random/base/levy' ); Returns a pseudorandom number drawn from a [Lévy][levy] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var r = levy( 2.0, 5.0 ); +const r = levy( 2.0, 5.0 ); // returns ``` If `mu` or `c` is `NaN` or `c <= 0`, the function returns `NaN`. ```javascript -var r = levy( 2.0, -2.0 ); +let r = levy( 2.0, -2.0 ); // returns NaN r = levy( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = levy( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Lévy][levy] distribution. ```javascript -var rand = levy.factory(); +const rand = levy.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `c`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = levy.factory( 10.0, 2.0 ); +const rand = levy.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `c`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = levy.factory(); +const rand = levy.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = levy.factory({ +const rand = levy.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = levy.factory({ +const rand1 = levy.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = levy.factory( 1.0, 2.0, { +const rand2 = levy.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = levy( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = levy( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `levy`: -rand = levy.factory({ +const rand = levy.factory({ 'state': levy.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === levy( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === levy( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === levy( 1.0, 2.0 ) ); The generator name. ```javascript -var str = levy.NAME; +const str = levy.NAME; // returns 'levy' ``` @@ -165,7 +160,7 @@ var str = levy.NAME; The underlying pseudorandom number generator. ```javascript -var prng = levy.PRNG; +const prng = levy.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = levy.PRNG; The value used to seed `levy()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = levy( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = levy( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = levy.factory( 2.0, 2.0, { +const rand = levy.factory( 2.0, 2.0, { 'seed': levy.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = levy.seedLength; +const len = levy.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = levy( 2.0, 5.0 ); +let r = levy( 2.0, 5.0 ); // returns r = levy( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = levy( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = levy.state; +const state = levy.state; // returns r = levy( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = levy.stateLength; +const len = levy.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = levy.byteLength; +const sz = levy.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = levy.toJSON(); +const o = levy.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = levy.factory({ +const rand = levy.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var levy = require( '@stdlib/random/base/levy' ); - -var seed; -var rand; -var i; +const levy = require( '@stdlib/random/base/levy' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( levy( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = levy.factory( 5.0, 2.0, { +const seed = 1234; +let rand = levy.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = levy.factory( 0.0, 1.0, { 'seed': levy.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/logistic/README.md b/lib/node_modules/@stdlib/random/base/logistic/README.md index df412d461740..a48c3a4ba022 100644 --- a/lib/node_modules/@stdlib/random/base/logistic/README.md +++ b/lib/node_modules/@stdlib/random/base/logistic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logistic = require( '@stdlib/random/base/logistic' ); +const logistic = require( '@stdlib/random/base/logistic' ); ``` #### logistic( mu, s ) @@ -35,14 +35,14 @@ var logistic = require( '@stdlib/random/base/logistic' ); Returns a pseudorandom number drawn from a [logistic][logistic] distribution with parameters `mu` (mean) and `s` (scale parameter). ```javascript -var r = logistic( 2.0, 5.0 ); +const r = logistic( 2.0, 5.0 ); // returns ``` If `mu` or `s` is `NaN` or `s <= 0`, the function returns `NaN`. ```javascript -var r = logistic( 2.0, -2.0 ); +let r = logistic( 2.0, -2.0 ); // returns NaN r = logistic( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = logistic( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [logistic][logistic] distribution. ```javascript -var rand = logistic.factory(); +const rand = logistic.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `s`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = logistic.factory( 10.0, 2.0 ); +const rand = logistic.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `s`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = logistic.factory(); +const rand = logistic.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = logistic.factory({ +const rand1 = logistic.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = logistic.factory( 1.0, 2.0, { +const rand2 = logistic.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = logistic( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = logistic( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `logistic`: -rand = logistic.factory({ +const rand = logistic.factory({ 'state': logistic.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === logistic( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === logistic( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === logistic( 1.0, 2.0 ) ); The generator name. ```javascript -var str = logistic.NAME; +const str = logistic.NAME; // returns 'logistic' ``` @@ -165,7 +160,7 @@ var str = logistic.NAME; The underlying pseudorandom number generator. ```javascript -var prng = logistic.PRNG; +const prng = logistic.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = logistic.PRNG; The value used to seed `logistic()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = logistic( 2.0, 2.0 ); + const r = logistic( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = logistic.factory( 2.0, 2.0, { +const rand = logistic.factory( 2.0, 2.0, { 'seed': logistic.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = logistic.seedLength; +const len = logistic.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = logistic( 2.0, 5.0 ); +let r = logistic( 2.0, 5.0 ); // returns r = logistic( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = logistic( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = logistic.state; +const state = logistic.state; // returns r = logistic( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = logistic.stateLength; +const len = logistic.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = logistic.byteLength; +const sz = logistic.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = logistic.toJSON(); +const o = logistic.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = logistic.factory({ +const rand = logistic.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var logistic = require( '@stdlib/random/base/logistic' ); - -var seed; -var rand; -var i; +const logistic = require( '@stdlib/random/base/logistic' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( logistic( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = logistic.factory( 5.0, 2.0, { +const seed = 1234; +let rand = logistic.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = logistic.factory( 0.0, 1.0, { 'seed': logistic.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/lognormal/README.md b/lib/node_modules/@stdlib/random/base/lognormal/README.md index 4e75aed134d7..2d50272a401b 100644 --- a/lib/node_modules/@stdlib/random/base/lognormal/README.md +++ b/lib/node_modules/@stdlib/random/base/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lognormal = require( '@stdlib/random/base/lognormal' ); +const lognormal = require( '@stdlib/random/base/lognormal' ); ``` #### lognormal( mu, sigma ) @@ -35,14 +35,14 @@ var lognormal = require( '@stdlib/random/base/lognormal' ); Returns a pseudorandom number drawn from a [lognormal][lognormal] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var r = lognormal( 2.0, 5.0 ); +const r = lognormal( 2.0, 5.0 ); // returns ``` If `mu` or `sigma` is `NaN` or `sigma <= 0`, the function returns `NaN`. ```javascript -var r = lognormal( 2.0, -2.0 ); +let r = lognormal( 2.0, -2.0 ); // returns NaN r = lognormal( NaN, 5.0 ); @@ -57,18 +57,18 @@ r = lognormal( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [lognormal][lognormal] distribution. ```javascript -var rand = lognormal.factory(); +const rand = lognormal.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` If provided `mu` and `sigma`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = lognormal.factory( 10.0, 2.0 ); +const rand = lognormal.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -78,9 +78,9 @@ r = rand(); If not provided `mu` and `sigma`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = lognormal.factory(); +const rand = lognormal.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -97,57 +97,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = lognormal.factory({ +const rand1 = lognormal.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = lognormal.factory( 1.0, 2.0, { +const rand2 = lognormal.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = lognormal( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = lognormal( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `lognormal`: -rand = lognormal.factory({ +const rand = lognormal.factory({ 'state': lognormal.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === lognormal( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === lognormal( 1.0, 2.0 ) ); // returns true ``` @@ -156,7 +151,7 @@ bool = ( rand( 1.0, 2.0 ) === lognormal( 1.0, 2.0 ) ); The generator name. ```javascript -var str = lognormal.NAME; +const str = lognormal.NAME; // returns 'lognormal' ``` @@ -165,7 +160,7 @@ var str = lognormal.NAME; The underlying pseudorandom number generator. ```javascript -var prng = lognormal.PRNG; +const prng = lognormal.PRNG; // returns ``` @@ -174,21 +169,17 @@ var prng = lognormal.PRNG; The value used to seed `lognormal()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = lognormal( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = lognormal( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = lognormal.factory( 2.0, 2.0, { +const rand = lognormal.factory( 2.0, 2.0, { 'seed': lognormal.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -197,11 +188,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -210,7 +201,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = lognormal.seedLength; +const len = lognormal.seedLength; // returns ``` @@ -219,11 +210,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -232,7 +223,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = lognormal( 2.0, 5.0 ); +let r = lognormal( 2.0, 5.0 ); // returns r = lognormal( 2.0, 5.0 ); @@ -241,7 +232,7 @@ r = lognormal( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = lognormal.state; +const state = lognormal.state; // returns r = lognormal( 2.0, 5.0 ); @@ -268,11 +259,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -281,7 +272,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = lognormal.stateLength; +const len = lognormal.stateLength; // returns ``` @@ -290,11 +281,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -303,7 +294,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = lognormal.byteLength; +const sz = lognormal.byteLength; // returns ``` @@ -312,11 +303,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -325,7 +316,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = lognormal.toJSON(); +const o = lognormal.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -334,11 +325,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = lognormal.factory({ +const rand = lognormal.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -364,23 +355,19 @@ var o = rand.toJSON(); ```javascript -var lognormal = require( '@stdlib/random/base/lognormal' ); - -var seed; -var rand; -var i; +const lognormal = require( '@stdlib/random/base/lognormal' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( lognormal( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = lognormal.factory( 5.0, 2.0, { +const seed = 1234; +let rand = lognormal.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -388,7 +375,7 @@ for ( i = 0; i < 100; i++ ) { rand = lognormal.factory( 0.0, 1.0, { 'seed': lognormal.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/minstd-shuffle/README.md b/lib/node_modules/@stdlib/random/base/minstd-shuffle/README.md index 74c4c4d235db..449f5264d7e7 100644 --- a/lib/node_modules/@stdlib/random/base/minstd-shuffle/README.md +++ b/lib/node_modules/@stdlib/random/base/minstd-shuffle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); ``` #### minstd() @@ -35,7 +35,7 @@ var minstd = require( '@stdlib/random/base/minstd-shuffle' ); Returns a pseudorandom integer on the interval `[1, 2147483646]`. ```javascript -var v = minstd(); +const v = minstd(); // returns ``` @@ -44,7 +44,7 @@ var v = minstd(); Returns a pseudorandom number on the interval `[0,1)`. ```javascript -var v = minstd.normalized(); +const v = minstd.normalized(); // returns ``` @@ -53,7 +53,7 @@ var v = minstd.normalized(); Returns a linear congruential pseudorandom number generator ([LCG][lcg]) whose output is shuffled. ```javascript -var rand = minstd.factory(); +const rand = minstd.factory(); ``` The function accepts the following `options`: @@ -65,47 +65,42 @@ The function accepts the following `options`: By default, a random integer is used to seed the returned generator. To seed the generator, provide either an `integer` on the interval `[1, 2147483646]` ```javascript -var rand = minstd.factory({ +const rand = minstd.factory({ 'seed': 1234 }); -var v = rand(); +const v = rand(); // returns 1421600654 ``` or, for arbitrary length seeds, an array-like `object` containing signed 32-bit integers ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); -var rand = minstd.factory({ +const rand = minstd.factory({ 'seed': new Int32Array( [ 1234 ] ) }); -var r = rand(); +const r = rand(); // returns 1421600654 ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = minstd(); +for ( let i = 0; i < 1000; i++ ) { + const r = minstd(); } // Create a new PRNG initialized to the current state of `minstd`: -rand = minstd.factory({ +const rand = minstd.factory({ 'state': minstd.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === minstd() ); +const bool = ( rand() === minstd() ); // returns true ``` @@ -114,7 +109,7 @@ bool = ( rand() === minstd() ); The generator name. ```javascript -var str = minstd.NAME; +const str = minstd.NAME; // returns 'minstd-shuffle' ``` @@ -123,7 +118,7 @@ var str = minstd.NAME; Minimum possible value. ```javascript -var min = minstd.MIN; +const min = minstd.MIN; // returns 1 ``` @@ -132,7 +127,7 @@ var min = minstd.MIN; Maximum possible value. ```javascript -var max = minstd.MAX; +const max = minstd.MAX; // returns 2147483646 ``` @@ -141,21 +136,17 @@ var max = minstd.MAX; The value used to seed `minstd()`. ```javascript -var rand; -var v; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - v = minstd(); +for ( let i = 0; i < 100; i++ ) { + const v = minstd(); } // Generate the same pseudorandom values... -rand = minstd.factory({ +const rand = minstd.factory({ 'seed': minstd.seed }); -for ( i = 0; i < 100; i++ ) { - v = rand(); +for ( let i = 0; i < 100; i++ ) { + const v = rand(); } ``` @@ -164,7 +155,7 @@ for ( i = 0; i < 100; i++ ) { Length of generator seed. ```javascript -var len = minstd.seedLength; +const len = minstd.seedLength; // returns ``` @@ -173,7 +164,7 @@ var len = minstd.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = minstd(); +let r = minstd(); // returns r = minstd(); @@ -182,7 +173,7 @@ r = minstd(); // ... // Get a copy of the current state: -var state = minstd.state; +const state = minstd.state; // returns r = minstd(); @@ -209,7 +200,7 @@ r = minstd(); Length of generator state. ```javascript -var len = minstd.stateLength; +const len = minstd.stateLength; // returns ``` @@ -218,7 +209,7 @@ var len = minstd.stateLength; Size (in bytes) of generator state. ```javascript -var sz = minstd.byteLength; +const sz = minstd.byteLength; // returns ``` @@ -227,7 +218,7 @@ var sz = minstd.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = minstd.toJSON(); +const o = minstd.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -256,23 +247,19 @@ var o = minstd.toJSON(); ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); - -var seed; -var rand; -var i; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( minstd() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = minstd.factory({ +const seed = 1234; +let rand = minstd.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -280,7 +267,7 @@ for ( i = 0; i < 100; i++ ) { rand = minstd.factory({ 'seed': minstd.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/minstd/README.md b/lib/node_modules/@stdlib/random/base/minstd/README.md index a7269ba7f75d..6b350a683370 100644 --- a/lib/node_modules/@stdlib/random/base/minstd/README.md +++ b/lib/node_modules/@stdlib/random/base/minstd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); ``` #### minstd() @@ -35,7 +35,7 @@ var minstd = require( '@stdlib/random/base/minstd' ); Returns a pseudorandom integer on the interval `[1, 2147483646]`. ```javascript -var r = minstd(); +const r = minstd(); // returns ``` @@ -44,7 +44,7 @@ var r = minstd(); Returns a pseudorandom number on the interval `[0,1)`. ```javascript -var r = minstd.normalized(); +const r = minstd.normalized(); // returns ``` @@ -53,7 +53,7 @@ var r = minstd.normalized(); Returns a linear congruential pseudorandom number generator ([LCG][lcg]). ```javascript -var rand = minstd.factory(); +const rand = minstd.factory(); ``` The function accepts the following `options`: @@ -65,47 +65,42 @@ The function accepts the following `options`: By default, a random integer is used to seed the returned generator. To seed the generator, provide either an `integer` on the interval `[1, 2147483646]` ```javascript -var rand = minstd.factory({ +const rand = minstd.factory({ 'seed': 1234 }); -var r = rand(); +const r = rand(); // returns 20739838 ``` or, for arbitrary length seeds, an array-like `object` containing signed 32-bit integers ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); -var rand = minstd.factory({ +const rand = minstd.factory({ 'seed': new Int32Array( [ 1234 ] ) }); -var r = rand(); +const r = rand(); // returns 20739838 ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = minstd(); +for ( let i = 0; i < 1000; i++ ) { + const r = minstd(); } // Create a new PRNG initialized to the current state of `minstd`: -rand = minstd.factory({ +const rand = minstd.factory({ 'state': minstd.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === minstd() ); +const bool = ( rand() === minstd() ); // returns true ``` @@ -114,7 +109,7 @@ bool = ( rand() === minstd() ); The generator name. ```javascript -var str = minstd.NAME; +const str = minstd.NAME; // returns 'minstd' ``` @@ -123,7 +118,7 @@ var str = minstd.NAME; Minimum possible value. ```javascript -var min = minstd.MIN; +const min = minstd.MIN; // returns 1 ``` @@ -132,7 +127,7 @@ var min = minstd.MIN; Maximum possible value. ```javascript -var max = minstd.MAX; +const max = minstd.MAX; // returns 2147483646 ``` @@ -141,21 +136,17 @@ var max = minstd.MAX; The value used to seed `minstd()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = minstd(); +for ( let i = 0; i < 100; i++ ) { + const r = minstd(); } // Generate the same pseudorandom values... -rand = minstd.factory({ +const rand = minstd.factory({ 'seed': minstd.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -164,7 +155,7 @@ for ( i = 0; i < 100; i++ ) { Length of generator seed. ```javascript -var len = minstd.seedLength; +const len = minstd.seedLength; // returns ``` @@ -173,7 +164,7 @@ var len = minstd.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = minstd(); +let r = minstd(); // returns r = minstd(); @@ -182,7 +173,7 @@ r = minstd(); // ... // Get the current state: -var state = minstd.state; +const state = minstd.state; // returns r = minstd(); @@ -209,7 +200,7 @@ r = minstd(); Length of generator state. ```javascript -var len = minstd.stateLength; +const len = minstd.stateLength; // returns ``` @@ -218,7 +209,7 @@ var len = minstd.stateLength; Size (in bytes) of generator state. ```javascript -var sz = minstd.byteLength; +const sz = minstd.byteLength; // returns ``` @@ -227,7 +218,7 @@ var sz = minstd.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = minstd.toJSON(); +const o = minstd.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -255,23 +246,19 @@ var o = minstd.toJSON(); ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); - -var seed; -var rand; -var i; +const minstd = require( '@stdlib/random/base/minstd' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( minstd() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = minstd.factory({ +const seed = 1234; +let rand = minstd.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -279,7 +266,7 @@ for ( i = 0; i < 100; i++ ) { rand = minstd.factory({ 'seed': minstd.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/mt19937/README.md b/lib/node_modules/@stdlib/random/base/mt19937/README.md index e9506e1f5e0a..c08e5a4b7a42 100644 --- a/lib/node_modules/@stdlib/random/base/mt19937/README.md +++ b/lib/node_modules/@stdlib/random/base/mt19937/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mt19937 = require( '@stdlib/random/base/mt19937' ); +const mt19937 = require( '@stdlib/random/base/mt19937' ); ``` #### mt19937() @@ -35,7 +35,7 @@ var mt19937 = require( '@stdlib/random/base/mt19937' ); Returns a pseudorandom integer on the interval `[0, 4294967295]`. ```javascript -var r = mt19937(); +const r = mt19937(); // returns ``` @@ -44,7 +44,7 @@ var r = mt19937(); Returns a pseudorandom number on the interval `[0, 1)` with 53-bit precision. ```javascript -var r = mt19937.normalized(); +const r = mt19937.normalized(); // returns ``` @@ -53,7 +53,7 @@ var r = mt19937.normalized(); Returns a 32-bit [Mersenne Twister][mersenne-twister] pseudorandom number generator. ```javascript -var rand = mt19937.factory(); +const rand = mt19937.factory(); ``` The function accepts the following `options`: @@ -65,47 +65,42 @@ The function accepts the following `options`: By default, a random integer is used to seed the returned generator. To seed the generator, provide either a nonzero integer on the interval `[1, 4294967295]` ```javascript -var rand = mt19937.factory({ +const rand = mt19937.factory({ 'seed': 1234 }); -var r = rand(); +const r = rand(); // returns 822569775 ``` or, for arbitrary length seeds, an array-like object containing unsigned 32-bit integers ```javascript -var Uint32Array = require( '@stdlib/array/uint32' ); +const Uint32Array = require( '@stdlib/array/uint32' ); -var rand = mt19937.factory({ +const rand = mt19937.factory({ 'seed': new Uint32Array( [ 291, 564, 837, 1110 ] ) }); -var r = rand(); +const r = rand(); // returns 1067595299 ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = mt19937(); +for ( let i = 0; i < 1000; i++ ) { + const r = mt19937(); } // Create a new MT19937 PRNG initialized to the current state of `mt19937`: -rand = mt19937.factory({ +const rand = mt19937.factory({ 'state': mt19937.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === mt19937() ); +const bool = ( rand() === mt19937() ); // returns true ``` @@ -114,7 +109,7 @@ bool = ( rand() === mt19937() ); The generator name. ```javascript -var str = mt19937.NAME; +const str = mt19937.NAME; // returns 'mt19937' ``` @@ -123,7 +118,7 @@ var str = mt19937.NAME; Minimum possible value. ```javascript -var min = mt19937.MIN; +const min = mt19937.MIN; // returns 0 ``` @@ -132,7 +127,7 @@ var min = mt19937.MIN; Maximum possible value. ```javascript -var max = mt19937.MAX; +const max = mt19937.MAX; // returns 4294967295 ``` @@ -141,21 +136,17 @@ var max = mt19937.MAX; The value used to seed `mt19937()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = mt19937(); +for ( let i = 0; i < 100; i++ ) { + const r = mt19937(); } // Generate the same pseudorandom values... -rand = mt19937.factory({ +const rand = mt19937.factory({ 'seed': mt19937.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -164,7 +155,7 @@ for ( i = 0; i < 100; i++ ) { Length of generator seed. ```javascript -var len = mt19937.seedLength; +const len = mt19937.seedLength; // returns ``` @@ -173,7 +164,7 @@ var len = mt19937.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = mt19937(); +let r = mt19937(); // returns r = mt19937(); @@ -182,7 +173,7 @@ r = mt19937(); // ... // Get a copy of the current state: -var state = mt19937.state; +const state = mt19937.state; // returns r = mt19937(); @@ -209,7 +200,7 @@ r = mt19937(); Length of generator state. ```javascript -var len = mt19937.stateLength; +const len = mt19937.stateLength; // returns ``` @@ -218,7 +209,7 @@ var len = mt19937.stateLength; Size (in bytes) of generator state. ```javascript -var sz = mt19937.byteLength; +const sz = mt19937.byteLength; // returns ``` @@ -227,7 +218,7 @@ var sz = mt19937.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = mt19937.toJSON(); +const o = mt19937.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -257,23 +248,19 @@ var o = mt19937.toJSON(); ```javascript -var mt19937 = require( '@stdlib/random/base/mt19937' ); - -var seed; -var rand; -var i; +const mt19937 = require( '@stdlib/random/base/mt19937' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( mt19937() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = mt19937.factory({ +const seed = 1234; +let rand = mt19937.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -281,7 +268,7 @@ for ( i = 0; i < 100; i++ ) { rand = mt19937.factory({ 'seed': mt19937.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/negative-binomial/README.md b/lib/node_modules/@stdlib/random/base/negative-binomial/README.md index 4c9588f9080e..b66bdd60433c 100644 --- a/lib/node_modules/@stdlib/random/base/negative-binomial/README.md +++ b/lib/node_modules/@stdlib/random/base/negative-binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var negativeBinomial = require( '@stdlib/random/base/negative-binomial' ); +const negativeBinomial = require( '@stdlib/random/base/negative-binomial' ); ``` #### negativeBinomial( r, p ) @@ -35,14 +35,14 @@ var negativeBinomial = require( '@stdlib/random/base/negative-binomial' ); Returns a pseudorandom number drawn from a [negative binomial][negative-binomial] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var r = negativeBinomial( 20, 0.8 ); +const r = negativeBinomial( 20, 0.8 ); // returns ``` If `r` or `p` is `NaN`, the function returns `NaN`. ```javascript -var r = negativeBinomial( NaN, 0.4 ); +let r = negativeBinomial( NaN, 0.4 ); // returns NaN r = negativeBinomial( 20, NaN ); @@ -52,7 +52,7 @@ r = negativeBinomial( 20, NaN ); If `p` is not in the interval `(0,1)` (exclusive), the function returns `NaN`. ```javascript -var r = negativeBinomial( 10, 1.1 ); +let r = negativeBinomial( 10, 1.1 ); // returns NaN r = negativeBinomial( 10, 1.0 ); @@ -67,18 +67,18 @@ r = negativeBinomial( 10, 0.0 ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [negative binomial][negative-binomial] distribution. ```javascript -var rand = negativeBinomial.factory(); +const rand = negativeBinomial.factory(); -var r = rand( 20, 0.3 ); +const r = rand( 20, 0.3 ); // returns ``` If provided `r` and `p`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = negativeBinomial.factory( 10, 0.8 ); +const rand = negativeBinomial.factory( 10, 0.8 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -88,9 +88,9 @@ r = rand(); If not provided `r` and `p`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = negativeBinomial.factory(); +const rand = negativeBinomial.factory(); -var r = rand( 20, 0.8 ); +let r = rand( 20, 0.8 ); // returns r = rand( 123, 0.21 ); @@ -107,57 +107,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': minstd.normalized }); -var r = rand( 8, 0.9 ); +const r = rand( 8, 0.9 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = negativeBinomial.factory({ +const rand1 = negativeBinomial.factory({ 'seed': 12345 }); -var r1 = rand1( 8, 0.9 ); +const r1 = rand1( 8, 0.9 ); // returns -var rand2 = negativeBinomial.factory( 8, 0.9, { +const rand2 = negativeBinomial.factory( 8, 0.9, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = negativeBinomial( 8, 0.9 ); +for ( let i = 0; i < 1000; i++ ) { + const r = negativeBinomial( 8, 0.9 ); } // Create a new PRNG initialized to the current state of `negativeBinomial`: -rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'state': negativeBinomial.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 8, 0.9 ) === negativeBinomial( 8, 0.9 ) ); +const bool = ( rand( 8, 0.9 ) === negativeBinomial( 8, 0.9 ) ); // returns true ``` @@ -166,7 +161,7 @@ bool = ( rand( 8, 0.9 ) === negativeBinomial( 8, 0.9 ) ); The generator name. ```javascript -var str = negativeBinomial.NAME; +const str = negativeBinomial.NAME; // returns 'negative-binomial' ``` @@ -175,7 +170,7 @@ var str = negativeBinomial.NAME; The underlying pseudorandom number generator. ```javascript -var prng = negativeBinomial.PRNG; +const prng = negativeBinomial.PRNG; // returns ``` @@ -184,21 +179,17 @@ var prng = negativeBinomial.PRNG; The value used to seed `negativeBinomial()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = negativeBinomial( 20, 0.5 ); +for ( let i = 0; i < 100; i++ ) { + const r = negativeBinomial( 20, 0.5 ); } // Generate the same pseudorandom values... -rand = negativeBinomial.factory( 20, 0.5, { +const rand = negativeBinomial.factory( 20, 0.5, { 'seed': negativeBinomial.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -207,11 +198,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -220,7 +211,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = negativeBinomial.seedLength; +const len = negativeBinomial.seedLength; // returns ``` @@ -229,11 +220,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -242,7 +233,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = negativeBinomial( 20, 0.5 ); +let r = negativeBinomial( 20, 0.5 ); // returns r = negativeBinomial( 20, 0.5 ); @@ -251,7 +242,7 @@ r = negativeBinomial( 20, 0.5 ); // ... // Get a copy of the current state: -var state = negativeBinomial.state; +const state = negativeBinomial.state; // returns r = negativeBinomial( 20, 0.5 ); @@ -278,11 +269,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -291,7 +282,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = negativeBinomial.stateLength; +const len = negativeBinomial.stateLength; // returns ``` @@ -300,11 +291,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -313,7 +304,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = negativeBinomial.byteLength; +const sz = negativeBinomial.byteLength; // returns ``` @@ -322,11 +313,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -335,7 +326,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = negativeBinomial.toJSON(); +const o = negativeBinomial.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -344,11 +335,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = negativeBinomial.factory({ +const rand = negativeBinomial.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -375,23 +366,19 @@ var o = rand.toJSON(); ```javascript -var negativeBinomial = require( '@stdlib/random/base/negative-binomial' ); - -var seed; -var rand; -var i; +const negativeBinomial = require( '@stdlib/random/base/negative-binomial' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( negativeBinomial( 10, 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = negativeBinomial.factory( 8, 0.8, { +const seed = 1234; +let rand = negativeBinomial.factory( 8, 0.8, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -399,7 +386,7 @@ for ( i = 0; i < 100; i++ ) { rand = negativeBinomial.factory( 10, 0.5, { 'seed': negativeBinomial.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/normal/README.md b/lib/node_modules/@stdlib/random/base/normal/README.md index 1d2871356920..eb95f71730d2 100644 --- a/lib/node_modules/@stdlib/random/base/normal/README.md +++ b/lib/node_modules/@stdlib/random/base/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normal = require( '@stdlib/random/base/normal' ); +const normal = require( '@stdlib/random/base/normal' ); ``` #### normal( mu, sigma ) @@ -35,14 +35,14 @@ var normal = require( '@stdlib/random/base/normal' ); Returns a pseudorandom number drawn from a [normal][normal] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var r = normal( 2.0, 5.0 ); +const r = normal( 2.0, 5.0 ); // returns ``` If `mu` or `sigma` is `NaN` or `sigma <= 0`, the function returns `NaN`. ```javascript -var r = normal( 2.0, -2.0 ); +let r = normal( 2.0, -2.0 ); // returns NaN r = normal( NaN, 5.0 ); @@ -57,9 +57,9 @@ r = normal( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [normal][normal] distribution. ```javascript -var rand = normal.factory(); +const rand = normal.factory(); -var r = rand( 0.1, 1.5 ); +const r = rand( 0.1, 1.5 ); // returns ``` @@ -67,9 +67,9 @@ If provided `mu` and `sigma`, the returned generator returns random variates fro ```javascript // Draw from normal( 10.0, 2.0 ) distribution: -var rand = normal.factory( 10.0, 2.0 ); +const rand = normal.factory( 10.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -79,9 +79,9 @@ r = rand(); If not provided `mu` and `sigma`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = normal.factory(); +const rand = normal.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -98,57 +98,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = normal.factory({ +const rand = normal.factory({ 'prng': minstd.normalized }); -var r = rand( 1.0, 2.0 ); +const r = rand( 1.0, 2.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = normal.factory({ +const rand1 = normal.factory({ 'seed': 12345 }); -var r1 = rand1( 1.0, 2.0 ); +const r1 = rand1( 1.0, 2.0 ); // returns -var rand2 = normal.factory( 1.0, 2.0, { +const rand2 = normal.factory( 1.0, 2.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = normal( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = normal( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `normal`: -rand = normal.factory({ +const rand = normal.factory({ 'state': normal.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === normal( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === normal( 1.0, 2.0 ) ); // returns true ``` @@ -157,7 +152,7 @@ bool = ( rand( 1.0, 2.0 ) === normal( 1.0, 2.0 ) ); The generator name. ```javascript -var str = normal.NAME; +const str = normal.NAME; // returns 'normal' ``` @@ -166,7 +161,7 @@ var str = normal.NAME; The underlying pseudorandom number generator. ```javascript -var prng = normal.PRNG; +const prng = normal.PRNG; // returns ``` @@ -175,21 +170,17 @@ var prng = normal.PRNG; The value used to seed `normal()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = normal( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = normal( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = normal.factory( 2.0, 2.0, { +const rand = normal.factory( 2.0, 2.0, { 'seed': normal.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -198,11 +189,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -211,7 +202,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = normal.seedLength; +const len = normal.seedLength; // returns ``` @@ -220,11 +211,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -233,7 +224,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = normal( 2.0, 5.0 ); +let r = normal( 2.0, 5.0 ); // returns r = normal( 2.0, 5.0 ); @@ -242,7 +233,7 @@ r = normal( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = normal.state; +const state = normal.state; // returns r = normal( 2.0, 5.0 ); @@ -269,11 +260,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -282,7 +273,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = normal.stateLength; +const len = normal.stateLength; // returns ``` @@ -291,11 +282,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -304,7 +295,7 @@ var len = rand.stateLength; Size of generator state. ```javascript -var sz = normal.byteLength; +const sz = normal.byteLength; // returns ``` @@ -313,11 +304,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -326,7 +317,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = normal.toJSON(); +const o = normal.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -335,11 +326,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = normal.factory({ +const rand = normal.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -365,23 +356,19 @@ var o = rand.toJSON(); ```javascript -var normal = require( '@stdlib/random/base/normal' ); - -var seed; -var rand; -var i; +const normal = require( '@stdlib/random/base/normal' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( normal( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = normal.factory( 5.0, 2.0, { +const seed = 1234; +let rand = normal.factory( 5.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -389,7 +376,7 @@ for ( i = 0; i < 100; i++ ) { rand = normal.factory( 0.0, 1.0, { 'seed': normal.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/pareto-type1/README.md b/lib/node_modules/@stdlib/random/base/pareto-type1/README.md index f4393364d79c..caca1c619fe4 100644 --- a/lib/node_modules/@stdlib/random/base/pareto-type1/README.md +++ b/lib/node_modules/@stdlib/random/base/pareto-type1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pareto1 = require( '@stdlib/random/base/pareto-type1' ); +const pareto1 = require( '@stdlib/random/base/pareto-type1' ); ``` #### pareto1( alpha, beta ) @@ -35,14 +35,14 @@ var pareto1 = require( '@stdlib/random/base/pareto-type1' ); Returns a pseudorandom number drawn from a [Pareto (Type I)][pareto] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var r = pareto1( 2.0, 5.0 ); +const r = pareto1( 2.0, 5.0 ); // returns ``` If `alpha <= 0` or `beta <= 0`, the function returns `NaN`. ```javascript -var r = pareto1( 2.0, -2.0 ); +let r = pareto1( 2.0, -2.0 ); // returns NaN r = pareto1( -2.0, 2.0 ); @@ -52,7 +52,7 @@ r = pareto1( -2.0, 2.0 ); If `alpha` or `beta` is `NaN`, the function returns `NaN`. ```javascript -var r = pareto1( NaN, 5.0 ); +let r = pareto1( NaN, 5.0 ); // returns NaN r = pareto1( 2.0, NaN ); @@ -64,18 +64,18 @@ r = pareto1( 2.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Pareto (Type I)][pareto] distribution. ```javascript -var rand = pareto1.factory(); +const rand = pareto1.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` If provided `alpha` and `beta`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = pareto1.factory( 1.5, 1.5 ); +const rand = pareto1.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -85,9 +85,9 @@ r = rand(); If not provided `alpha` and `beta`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = pareto1.factory(); +const rand = pareto1.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -104,57 +104,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = pareto1.factory({ +const rand1 = pareto1.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = pareto1.factory( 2.0, 3.0, { +const rand2 = pareto1.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = pareto1( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = pareto1( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `pareto1`: -rand = pareto1.factory({ +const rand = pareto1.factory({ 'state': pareto1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === pareto1( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === pareto1( 1.0, 2.0 ) ); // returns true ``` @@ -163,7 +158,7 @@ bool = ( rand( 1.0, 2.0 ) === pareto1( 1.0, 2.0 ) ); The generator name. ```javascript -var str = pareto1.NAME; +const str = pareto1.NAME; // returns 'pareto-type1' ``` @@ -172,7 +167,7 @@ var str = pareto1.NAME; The underlying pseudorandom number generator. ```javascript -var prng = pareto1.PRNG; +const prng = pareto1.PRNG; // returns ``` @@ -181,21 +176,17 @@ var prng = pareto1.PRNG; The value used to seed `pareto1()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = pareto1( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = pareto1( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = pareto1.factory( 2.0, 2.0, { +const rand = pareto1.factory( 2.0, 2.0, { 'seed': pareto1.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -204,11 +195,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -217,7 +208,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = pareto1.seedLength; +const len = pareto1.seedLength; // returns ``` @@ -226,11 +217,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -239,7 +230,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = pareto1( 2.0, 5.0 ); +let r = pareto1( 2.0, 5.0 ); // returns r = pareto1( 2.0, 5.0 ); @@ -248,7 +239,7 @@ r = pareto1( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = pareto1.state; +const state = pareto1.state; // returns r = pareto1( 2.0, 5.0 ); @@ -275,11 +266,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -288,7 +279,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = pareto1.stateLength; +const len = pareto1.stateLength; // returns ``` @@ -297,11 +288,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -310,7 +301,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = pareto1.byteLength; +const sz = pareto1.byteLength; // returns ``` @@ -319,11 +310,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -332,7 +323,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = pareto1.toJSON(); +const o = pareto1.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -341,11 +332,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = pareto1.factory({ +const rand = pareto1.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -371,23 +362,19 @@ var o = rand.toJSON(); ```javascript -var pareto1 = require( '@stdlib/random/base/pareto-type1' ); - -var seed; -var rand; -var i; +const pareto1 = require( '@stdlib/random/base/pareto-type1' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( pareto1( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = pareto1.factory( 6.0, 2.0, { +const seed = 1234; +let rand = pareto1.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -395,7 +382,7 @@ for ( i = 0; i < 100; i++ ) { rand = pareto1.factory( 2.0, 2.0, { 'seed': pareto1.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/poisson/README.md b/lib/node_modules/@stdlib/random/base/poisson/README.md index bb9d4b05f1d4..e0e3bf2ee670 100644 --- a/lib/node_modules/@stdlib/random/base/poisson/README.md +++ b/lib/node_modules/@stdlib/random/base/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var poisson = require( '@stdlib/random/base/poisson' ); +const poisson = require( '@stdlib/random/base/poisson' ); ``` #### poisson( lambda ) @@ -35,14 +35,14 @@ var poisson = require( '@stdlib/random/base/poisson' ); Returns a pseudorandom number drawn from a [Poisson][poisson] distribution with mean parameter `lambda`. ```javascript -var r = poisson( 7.9 ); +const r = poisson( 7.9 ); // returns ``` If `lambda <= 0` or `lambda` is `NaN`, the function returns `NaN`. ```javascript -var r = poisson( -2.0 ); +let r = poisson( -2.0 ); // returns NaN r = poisson( NaN ); @@ -54,18 +54,18 @@ r = poisson( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Poisson][poisson] distribution. ```javascript -var rand = poisson.factory(); +const rand = poisson.factory(); -var r = rand( 15.0 ); +const r = rand( 15.0 ); // returns ``` If provided `lambda`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = poisson.factory( 10.0 ); +const rand = poisson.factory( 10.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `lambda`, the returned generator requires that `lambda` be provided at each invocation. ```javascript -var rand = poisson.factory(); +const rand = poisson.factory(); -var r = rand( 4.0 ); +let r = rand( 4.0 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': minstd.normalized }); -var r = rand( 3.0 ); +const r = rand( 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = poisson.factory({ +const rand1 = poisson.factory({ 'seed': 12345 }); -var r1 = rand1( 3.0 ); +const r1 = rand1( 3.0 ); // returns -var rand2 = poisson.factory( 3.0, { +const rand2 = poisson.factory( 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = poisson( 10.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = poisson( 10.0 ); } // Create a new PRNG initialized to the current state of `poisson`: -rand = poisson.factory({ +const rand = poisson.factory({ 'state': poisson.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 10.0 ) === poisson( 10.0 ) ); +const bool = ( rand( 10.0 ) === poisson( 10.0 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 10.0 ) === poisson( 10.0 ) ); The generator name. ```javascript -var str = poisson.NAME; +const str = poisson.NAME; // returns 'poisson' ``` @@ -162,7 +157,7 @@ var str = poisson.NAME; The underlying pseudorandom number generator. ```javascript -var prng = poisson.PRNG; +const prng = poisson.PRNG; // returns ``` @@ -171,20 +166,16 @@ var prng = poisson.PRNG; The value used to seed `poisson()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = poisson( 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = poisson( 2.0 ); } // Generate the same pseudorandom values... -rand = poisson.factory( 2.0, { +const rand = poisson.factory( 2.0, { 'seed': poisson.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = poisson.seedLength; +const len = poisson.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = poisson( 10.0 ); +let r = poisson( 10.0 ); // returns r = poisson( 10.0 ); @@ -238,7 +229,7 @@ r = poisson( 10.0 ); // ... // Get a copy of the current state: -var state = poisson.state; +const state = poisson.state; // returns r = poisson( 10.0 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = poisson.stateLength; +const len = poisson.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = poisson.byteLength; +const sz = poisson.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = poisson.toJSON(); +const o = poisson.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = poisson.factory({ +const rand = poisson.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -361,23 +352,19 @@ var o = rand.toJSON(); ```javascript -var poisson = require( '@stdlib/random/base/poisson' ); - -var seed; -var rand; -var i; +const poisson = require( '@stdlib/random/base/poisson' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( poisson( 8.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = poisson.factory( 0.8, { +const seed = 1234; +let rand = poisson.factory( 0.8, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -385,7 +372,7 @@ for ( i = 0; i < 100; i++ ) { rand = poisson.factory( 8.0, { 'seed': poisson.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/randi/README.md b/lib/node_modules/@stdlib/random/base/randi/README.md index 5be7905a466b..ba9f4a56b58e 100644 --- a/lib/node_modules/@stdlib/random/base/randi/README.md +++ b/lib/node_modules/@stdlib/random/base/randi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randi = require( '@stdlib/random/base/randi' ); +const randi = require( '@stdlib/random/base/randi' ); ``` #### randi() @@ -35,7 +35,7 @@ var randi = require( '@stdlib/random/base/randi' ); Returns a pseudorandom number having an integer value. ```javascript -var v = randi(); +const v = randi(); // returns ``` @@ -44,7 +44,7 @@ var v = randi(); Returns a pseudorandom number generator (PRNG) for generating random numbers. ```javascript -var rand = randi.factory(); +const rand = randi.factory(); ``` The function accepts the following `options`: @@ -66,55 +66,50 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var rand = randi.factory({ +const rand = randi.factory({ 'name': 'minstd-shuffle' }); -var v = rand(); +const v = rand(); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = randi.factory({ +const rand1 = randi.factory({ 'seed': 12345 }); -var r1 = rand1(); +const r1 = rand1(); // returns -var rand2 = randi.factory({ +const rand2 = randi.factory({ 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = randi(); +for ( let i = 0; i < 1000; i++ ) { + const r = randi(); } // Create a new PRNG initialized to the current state of `randi`: -rand = randi.factory({ +const rand = randi.factory({ 'state': randi.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === randi() ); +const bool = ( rand() === randi() ); // returns true ``` @@ -123,7 +118,7 @@ bool = ( rand() === randi() ); The generator name. ```javascript -var str = randi.NAME; +const str = randi.NAME; // returns 'randi' ``` @@ -132,7 +127,7 @@ var str = randi.NAME; The underlying pseudorandom number generator. ```javascript -var prng = randi.PRNG; +const prng = randi.PRNG; // returns ``` @@ -141,7 +136,7 @@ var prng = randi.PRNG; Minimum value lower bound (specific to underlying PRNG). ```javascript -var min = randi.MIN; +const min = randi.MIN; // returns ``` @@ -150,7 +145,7 @@ var min = randi.MIN; Maximum value upper bound (specific to underlying PRNG). ```javascript -var max = randi.MAX; +const max = randi.MAX; // returns ``` @@ -159,21 +154,17 @@ var max = randi.MAX; The value used to seed `randi()`. ```javascript -var rand; -var v; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - v = randi(); +for ( let i = 0; i < 100; i++ ) { + const v = randi(); } // Generate the same pseudorandom values... -rand = randi.factory({ +const rand = randi.factory({ 'seed': randi.seed }); -for ( i = 0; i < 100; i++ ) { - v = rand(); +for ( let i = 0; i < 100; i++ ) { + const v = rand(); } ``` @@ -182,7 +173,7 @@ for ( i = 0; i < 100; i++ ) { Length of generator seed. ```javascript -var len = randi.seedLength; +const len = randi.seedLength; // returns ``` @@ -191,7 +182,7 @@ var len = randi.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = randi(); +let r = randi(); // returns r = randi(); @@ -200,7 +191,7 @@ r = randi(); // ... // Get a copy of the current state: -var state = randi.state; +const state = randi.state; r = randi(); // returns @@ -226,7 +217,7 @@ r = randi(); Length of generator state. ```javascript -var len = randi.stateLength; +const len = randi.stateLength; // returns ``` @@ -235,7 +226,7 @@ var len = randi.stateLength; Size (in bytes) of generator state. ```javascript -var sz = randi.byteLength; +const sz = randi.byteLength; // returns ``` @@ -244,7 +235,7 @@ var sz = randi.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = randi.toJSON(); +const o = randi.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -271,23 +262,19 @@ var o = randi.toJSON(); ```javascript -var randi = require( '@stdlib/random/base/randi' ); - -var seed; -var rand; -var i; +const randi = require( '@stdlib/random/base/randi' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( randi() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = randi.factory({ +const seed = 1234; +let rand = randi.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -295,7 +282,7 @@ for ( i = 0; i < 100; i++ ) { rand = randi.factory({ 'seed': randi.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/randn/README.md b/lib/node_modules/@stdlib/random/base/randn/README.md index 16203ee0942e..13de19318123 100644 --- a/lib/node_modules/@stdlib/random/base/randn/README.md +++ b/lib/node_modules/@stdlib/random/base/randn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randn = require( '@stdlib/random/base/randn' ); +const randn = require( '@stdlib/random/base/randn' ); ``` #### randn() @@ -35,7 +35,7 @@ var randn = require( '@stdlib/random/base/randn' ); Returns a standard normally distributed pseudorandom number. ```javascript -var r = randn(); +const r = randn(); // returns ``` @@ -44,7 +44,7 @@ var r = randn(); Returns a pseudorandom number generator for creating standard normally distributed random numbers. ```javascript -var rand = randn.factory(); +const rand = randn.factory(); ``` The function accepts the following `options`: @@ -67,68 +67,63 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`improved-ziggurat`][@stdlib/random/base/improved-ziggurat]. To use a different PRNG, set the `name` option. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'name': 'box-muller' }); -var r = rand(); +const r = rand(); // returns ``` To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = randn.factory({ +const rand = randn.factory({ 'prng': minstd.normalized }); -var r = rand(); +const r = rand(); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = randn.factory({ +const rand1 = randn.factory({ 'seed': 12345 }); -var r1 = rand1(); +const r1 = rand1(); // returns -var rand2 = randn.factory({ +const rand2 = randn.factory({ 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = randn(); +for ( let i = 0; i < 1000; i++ ) { + const r = randn(); } // Create a new PRNG initialized to the current state of `randn`: -rand = randn.factory({ +const rand = randn.factory({ 'state': randn.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === randn() ); +const bool = ( rand() === randn() ); // returns true ``` @@ -137,7 +132,7 @@ bool = ( rand() === randn() ); The generator name. ```javascript -var str = randn.NAME; +const str = randn.NAME; // returns 'randn' ``` @@ -146,7 +141,7 @@ var str = randn.NAME; The underlying pseudorandom number generator. ```javascript -var prng = randn.PRNG; +const prng = randn.PRNG; // returns ``` @@ -155,21 +150,17 @@ var prng = randn.PRNG; The value used to seed `randn()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = randn(); +for ( let i = 0; i < 100; i++ ) { + const r = randn(); } // Generate the same pseudorandom values... -rand = randn.factory({ +const rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -178,11 +169,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -191,7 +182,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = randn.seedLength; +const len = randn.seedLength; // returns ``` @@ -200,11 +191,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -213,7 +204,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = randn(); +let r = randn(); // returns r = randn(); @@ -222,7 +213,7 @@ r = randn(); // ... // Get a copy of the current state: -var state = randn.state; +const state = randn.state; r = randn(); // returns @@ -248,11 +239,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -261,7 +252,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = randn.stateLength; +const len = randn.stateLength; // returns ``` @@ -270,11 +261,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -283,7 +274,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = randn.byteLength; +const sz = randn.byteLength; // returns ``` @@ -292,11 +283,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -305,7 +296,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = randn.toJSON(); +const o = randn.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -314,11 +305,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = randn.factory({ +const rand = randn.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -345,23 +336,19 @@ var o = rand.toJSON(); ```javascript -var randn = require( '@stdlib/random/base/randn' ); - -var seed; -var rand; -var i; +const randn = require( '@stdlib/random/base/randn' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( randn() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = randn.factory({ +const seed = 1234; +let rand = randn.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -369,7 +356,7 @@ for ( i = 0; i < 100; i++ ) { rand = randn.factory({ 'seed': randn.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/randu/README.md b/lib/node_modules/@stdlib/random/base/randu/README.md index 07ff15ee9a6f..09a37646d124 100644 --- a/lib/node_modules/@stdlib/random/base/randu/README.md +++ b/lib/node_modules/@stdlib/random/base/randu/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); ``` #### randu() @@ -35,7 +35,7 @@ var randu = require( '@stdlib/random/base/randu' ); Returns a uniformly distributed pseudorandom number on the interval `[0,1)`. ```javascript -var r = randu(); +const r = randu(); // returns ``` @@ -44,7 +44,7 @@ var r = randu(); Returns a pseudorandom number generator (PRNG) for generating uniformly distributed random numbers on the interval `[0,1)`. ```javascript -var rand = randu.factory(); +const rand = randu.factory(); ``` The function accepts the following `options`: @@ -66,55 +66,50 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var rand = randu.factory({ +const rand = randu.factory({ 'name': 'minstd-shuffle' }); -var r = rand(); +const r = rand(); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = randu.factory({ +const rand1 = randu.factory({ 'seed': 12345 }); -var r1 = rand1(); +const r1 = rand1(); // returns -var rand2 = randu.factory({ +const rand2 = randu.factory({ 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = randu(); +for ( let i = 0; i < 1000; i++ ) { + const r = randu(); } // Create a new PRNG initialized to the current state of `randu`: -rand = randu.factory({ +const rand = randu.factory({ 'state': randu.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand() === randu() ); +const bool = ( rand() === randu() ); // returns true ``` @@ -123,7 +118,7 @@ bool = ( rand() === randu() ); The generator name. ```javascript -var str = randu.NAME; +const str = randu.NAME; // returns 'randu' ``` @@ -132,7 +127,7 @@ var str = randu.NAME; The underlying pseudorandom number generator. ```javascript -var prng = randu.PRNG; +const prng = randu.PRNG; // returns ``` @@ -141,7 +136,7 @@ var prng = randu.PRNG; Minimum value lower bound. ```javascript -var min = randu.MIN; +const min = randu.MIN; // returns 0.0 ``` @@ -150,7 +145,7 @@ var min = randu.MIN; Maximum value upper bound (not greater than `1` exclusive). ```javascript -var max = randu.MAX; +const max = randu.MAX; // returns ``` @@ -159,21 +154,17 @@ var max = randu.MAX; The value used to seed `randu()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = randu(); +for ( let i = 0; i < 100; i++ ) { + const r = randu(); } // Generate the same pseudorandom values... -rand = randu.factory({ +const rand = randu.factory({ 'seed': randu.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -182,7 +173,7 @@ for ( i = 0; i < 100; i++ ) { Length of generator seed. ```javascript -var len = randu.seedLength; +const len = randu.seedLength; // returns ``` @@ -191,7 +182,7 @@ var len = randu.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = randu(); +let r = randu(); // returns r = randu(); @@ -200,7 +191,7 @@ r = randu(); // ... // Get a copy of the current state: -var state = randu.state; +const state = randu.state; r = randu(); // returns @@ -226,7 +217,7 @@ r = randu(); Length of generator state. ```javascript -var len = randu.stateLength; +const len = randu.stateLength; // returns ``` @@ -235,7 +226,7 @@ var len = randu.stateLength; Size (in bytes) of generator state. ```javascript -var sz = randu.byteLength; +const sz = randu.byteLength; // returns ``` @@ -244,7 +235,7 @@ var sz = randu.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = randu.toJSON(); +const o = randu.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -271,23 +262,19 @@ var o = randu.toJSON(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); - -var seed; -var rand; -var i; +const randu = require( '@stdlib/random/base/randu' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( randu() ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = randu.factory({ +const seed = 1234; +let rand = randu.factory({ 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -295,7 +282,7 @@ for ( i = 0; i < 100; i++ ) { rand = randu.factory({ 'seed': randu.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/rayleigh/README.md b/lib/node_modules/@stdlib/random/base/rayleigh/README.md index 3354eb16a246..363b8d005159 100644 --- a/lib/node_modules/@stdlib/random/base/rayleigh/README.md +++ b/lib/node_modules/@stdlib/random/base/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rayleigh = require( '@stdlib/random/base/rayleigh' ); +const rayleigh = require( '@stdlib/random/base/rayleigh' ); ``` #### rayleigh( sigma ) @@ -35,14 +35,14 @@ var rayleigh = require( '@stdlib/random/base/rayleigh' ); Returns a pseudorandom number drawn from a [Rayleigh][rayleigh] distribution with scale parameter `sigma`. ```javascript -var r = rayleigh( 2.5 ); +const r = rayleigh( 2.5 ); // returns ``` If `sigma <= 0` or `sigma` is `NaN`, the function returns `NaN`. ```javascript -var r = rayleigh( -2.0 ); +let r = rayleigh( -2.0 ); // returns NaN r = rayleigh( NaN ); @@ -54,18 +54,18 @@ r = rayleigh( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Rayleigh][rayleigh] distribution. ```javascript -var rand = rayleigh.factory(); +const rand = rayleigh.factory(); -var r = rand( 5.0 ); +const r = rand( 5.0 ); // returns ``` If provided `sigma`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = rayleigh.factory( 10.0 ); +const rand = rayleigh.factory( 10.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `sigma`, the returned generator requires that `sigma` be provided at each invocation. ```javascript -var rand = rayleigh.factory(); +const rand = rayleigh.factory(); -var r = rand( 4.0 ); +let r = rand( 4.0 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': minstd.normalized }); -var r = rand( 3.0 ); +const r = rand( 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = rayleigh.factory({ +const rand1 = rayleigh.factory({ 'seed': 12345 }); -var r1 = rand1( 3.0 ); +const r1 = rand1( 3.0 ); // returns -var rand2 = rayleigh.factory( 3.0, { +const rand2 = rayleigh.factory( 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = rayleigh( 5.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = rayleigh( 5.0 ); } // Create a new PRNG initialized to the current state of `rayleigh`: -rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'state': rayleigh.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 5.0 ) === rayleigh( 5.0 ) ); +const bool = ( rand( 5.0 ) === rayleigh( 5.0 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 5.0 ) === rayleigh( 5.0 ) ); The generator name. ```javascript -var str = rayleigh.NAME; +const str = rayleigh.NAME; // returns 'rayleigh' ``` @@ -162,7 +157,7 @@ var str = rayleigh.NAME; The underlying pseudorandom number generator. ```javascript -var prng = rayleigh.PRNG; +const prng = rayleigh.PRNG; // returns ``` @@ -171,21 +166,17 @@ var prng = rayleigh.PRNG; The value used to seed `rayleigh()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = rayleigh( 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = rayleigh( 2.0 ); } // Generate the same pseudorandom values... -rand = rayleigh.factory( 2.0, { +const rand = rayleigh.factory( 2.0, { 'seed': rayleigh.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = rayleigh.seedLength; +const len = rayleigh.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = rayleigh( 5.0 ); +let r = rayleigh( 5.0 ); // returns r = rayleigh( 5.0 ); @@ -238,7 +229,7 @@ r = rayleigh( 5.0 ); // ... // Get a copy of the current state: -var state = rayleigh.state; +const state = rayleigh.state; // returns r = rayleigh( 5.0 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = rayleigh.stateLength; +const len = rayleigh.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = rayleigh.byteLength; +const sz = rayleigh.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = rayleigh.toJSON(); +const o = rayleigh.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = rayleigh.factory({ +const rand = rayleigh.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -361,23 +352,19 @@ var o = rand.toJSON(); ```javascript -var rayleigh = require( '@stdlib/random/base/rayleigh' ); - -var seed; -var rand; -var i; +const rayleigh = require( '@stdlib/random/base/rayleigh' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rayleigh( 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = rayleigh.factory( 0.8, { +const seed = 1234; +let rand = rayleigh.factory( 0.8, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -385,7 +372,7 @@ for ( i = 0; i < 100; i++ ) { rand = rayleigh.factory( 0.5, { 'seed': rayleigh.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/reviver/README.md b/lib/node_modules/@stdlib/random/base/reviver/README.md index 8f873e344cad..4f917124f7a6 100644 --- a/lib/node_modules/@stdlib/random/base/reviver/README.md +++ b/lib/node_modules/@stdlib/random/base/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveBasePRNG = require( '@stdlib/random/base/reviver' ); +const reviveBasePRNG = require( '@stdlib/random/base/reviver' ); ``` #### reviveBasePRNG( key, value ) @@ -45,12 +45,12 @@ var reviveBasePRNG = require( '@stdlib/random/base/reviver' ); Revives a JSON-serialized pseudorandom number generator (PRNG). ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var randu = require( '@stdlib/random/base/randu' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const randu = require( '@stdlib/random/base/randu' ); -var str = JSON.stringify( randu ); +const str = JSON.stringify( randu ); -var rand = parseJSON( str, reviveBasePRNG ); +const rand = parseJSON( str, reviveBasePRNG ); // returns ``` @@ -77,31 +77,26 @@ For details on the JSON serialization format, see the `.toJSON()` method for, e. ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveBasePRNG = require( '@stdlib/random/base/reviver' ); - -// Progress the PRNG state... -var r1; -var i; -for ( i = 0; i < 100; i++ ) { - r1 = randu(); +const randu = require( '@stdlib/random/base/randu' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const reviveBasePRNG = require( '@stdlib/random/base/reviver' ); + +for ( let i = 0; i < 100; i++ ) { + const r1 = randu(); } // Serialize the PRNG as a JSON string: -var str = JSON.stringify( randu ); +const str = JSON.stringify( randu ); // Revive the JSON-serialized PRNG: -var rand = parseJSON( str, reviveBasePRNG ); +const rand = parseJSON( str, reviveBasePRNG ); if ( rand instanceof Error ) { console.error( rand.message ); } -// Generate duplicate sequences... -var r2; -for ( i = 0; i < 100; i++ ) { - r1 = randu(); - r2 = rand(); +for ( let i = 0; i < 100; i++ ) { + const r1 = randu(); + const r2 = rand(); console.log( '%d == %d ? %s', r1, r2, ( r1 === r2 ).toString() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/shared/README.md b/lib/node_modules/@stdlib/random/base/shared/README.md index 0fb371f5b787..574c0acc7958 100644 --- a/lib/node_modules/@stdlib/random/base/shared/README.md +++ b/lib/node_modules/@stdlib/random/base/shared/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/random/base/shared' ); +const headerDir = require( '@stdlib/random/base/shared' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/random/base/shared' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/random/base/shared' ); +const headerDir = require( '@stdlib/random/base/shared' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/random/base/t/README.md b/lib/node_modules/@stdlib/random/base/t/README.md index ba77344afe47..e2bd1406010a 100644 --- a/lib/node_modules/@stdlib/random/base/t/README.md +++ b/lib/node_modules/@stdlib/random/base/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var t = require( '@stdlib/random/base/t' ); +const t = require( '@stdlib/random/base/t' ); ``` #### t( v ) @@ -35,14 +35,14 @@ var t = require( '@stdlib/random/base/t' ); Returns a pseudorandom number drawn from a [Student's t][t]-distribution with degrees of freedom `v`. ```javascript -var r = t( 2.4 ); +const r = t( 2.4 ); // returns ``` If `v <= 0` or `v` is `NaN`, the function returns `NaN`. ```javascript -var r = t( -2.0 ); +let r = t( -2.0 ); // returns NaN r = t( NaN ); @@ -54,18 +54,18 @@ r = t( NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Student's t][t]-distribution. ```javascript -var rand = t.factory(); +const rand = t.factory(); -var r = rand( 5.0 ); +const r = rand( 5.0 ); // returns ``` If provided `v`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = t.factory( 1.0 ); +const rand = t.factory( 1.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -75,9 +75,9 @@ r = rand(); If not provided `v`, the returned generator requires that `v` be provided at each invocation. ```javascript -var rand = t.factory(); +const rand = t.factory(); -var r = rand( 4.0 ); +let r = rand( 4.0 ); // returns r = rand( 3.14 ); @@ -94,57 +94,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = t.factory({ +const rand = t.factory({ 'prng': minstd.normalized }); -var r = rand( 3.0 ); +const r = rand( 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = t.factory({ +const rand1 = t.factory({ 'seed': 12345 }); -var r1 = rand1( 3.0 ); +const r1 = rand1( 3.0 ); // returns -var rand2 = t.factory( 3.0, { +const rand2 = t.factory( 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = t( 3.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = t( 3.0 ); } // Create a new PRNG initialized to the current state of `t`: -rand = t.factory({ +const rand = t.factory({ 'state': t.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 3.0 ) === t( 3.0 ) ); +const bool = ( rand( 3.0 ) === t( 3.0 ) ); // returns true ``` @@ -153,7 +148,7 @@ bool = ( rand( 3.0 ) === t( 3.0 ) ); The generator name. ```javascript -var str = t.NAME; +const str = t.NAME; // returns 't' ``` @@ -162,7 +157,7 @@ var str = t.NAME; The underlying pseudorandom number generator. ```javascript -var prng = t.PRNG; +const prng = t.PRNG; // returns ``` @@ -171,21 +166,17 @@ var prng = t.PRNG; The value used to seed `t()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... for ( i = 0; i < 100; i++ ) { - r = t( 2.0 ); + const r = t( 2.0 ); } // Generate the same pseudorandom values... -rand = t.factory( 2.0, { +const rand = t.factory( 2.0, { 'seed': t.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -194,11 +185,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -207,7 +198,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = t.seedLength; +const len = t.seedLength; // returns ``` @@ -216,11 +207,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -229,7 +220,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = t( 10.0 ); +let r = t( 10.0 ); // returns r = t( 10.0 ); @@ -238,7 +229,7 @@ r = t( 10.0 ); // ... // Get a copy of the current state: -var state = t.state; +const state = t.state; // returns r = t( 10.0 ); @@ -265,11 +256,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -278,7 +269,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = t.stateLength; +const len = t.stateLength; // returns ``` @@ -287,11 +278,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -300,7 +291,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = t.byteLength; +const sz = t.byteLength; // returns ``` @@ -309,11 +300,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -322,7 +313,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = t.toJSON(); +const o = t.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -331,11 +322,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = t.factory({ +const rand = t.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -362,23 +353,19 @@ var o = rand.toJSON(); ```javascript -var t = require( '@stdlib/random/base/t' ); - -var seed; -var rand; -var i; +const t = require( '@stdlib/random/base/t' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( t( 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = t.factory( 5.0, { +const seed = 1234; +let rand = t.factory( 5.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -386,7 +373,7 @@ for ( i = 0; i < 100; i++ ) { rand = t.factory( 1.0, { 'seed': t.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/triangular/README.md b/lib/node_modules/@stdlib/random/base/triangular/README.md index dabd2cd1dd77..d3e6c59e647a 100644 --- a/lib/node_modules/@stdlib/random/base/triangular/README.md +++ b/lib/node_modules/@stdlib/random/base/triangular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); ``` #### triangular( a, b, c ) @@ -35,14 +35,14 @@ var triangular = require( '@stdlib/random/base/triangular' ); Returns a pseudorandom number drawn from a [triangular][triangular] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var r = triangular( 2.0, 5.0, 3.33 ); +const r = triangular( 2.0, 5.0, 3.33 ); // returns ``` If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`. ```javascript -var r = triangular( NaN, 1.0, 0.5 ); +let r = triangular( NaN, 1.0, 0.5 ); // returns NaN r = triangular( 1.0, NaN, 2.42 ); @@ -55,7 +55,7 @@ r = triangular( 1.0, 10.0, NaN ); If the condition `a <= c <= b` is not satisfied, the function returns `NaN`. ```javascript -var r = triangular( 13.0, 9.0, 0.5 ); +const r = triangular( 13.0, 9.0, 0.5 ); // returns NaN ``` @@ -64,18 +64,18 @@ var r = triangular( 13.0, 9.0, 0.5 ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [triangular][triangular] distribution. ```javascript -var rand = triangular.factory(); +const rand = triangular.factory(); -var r = rand( 0.0, 1.0, 0.5 ); +const r = rand( 0.0, 1.0, 0.5 ); // returns ``` If provided `a`, `b`, and `c`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = triangular.factory( -2.0, 2.0, 1.0 ); +const rand = triangular.factory( -2.0, 2.0, 1.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -85,9 +85,9 @@ r = rand(); If not provided `a`, `b`, and `c`, the returned generator requires that all three parameters be provided at each invocation. ```javascript -var rand = triangular.factory(); +const rand = triangular.factory(); -var r = rand( 0.0, 1.0, 0.75 ); +let r = rand( 0.0, 1.0, 0.75 ); // returns r = rand( -2.0, 2.0, 0.1 ); @@ -104,57 +104,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 4.0, 3.0 ); +const r = rand( 2.0, 4.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = triangular.factory({ +const rand1 = triangular.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 4.0, 3.0 ); +const r1 = rand1( 2.0, 4.0, 3.0 ); // returns -var rand2 = triangular.factory( 2.0, 4.0, 3.0, { +const rand2 = triangular.factory( 2.0, 4.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = triangular( 0.0, 1.0, 0.5 ); +for ( let i = 0; i < 1000; i++ ) { + const r = triangular( 0.0, 1.0, 0.5 ); } // Create a new PRNG initialized to the current state of `triangular`: -rand = triangular.factory({ +const rand = triangular.factory({ 'state': triangular.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 0.0, 1.0, 0.5 ) === triangular( 0.0, 1.0, 0.5 ) ); +const bool = ( rand( 0.0, 1.0, 0.5 ) === triangular( 0.0, 1.0, 0.5 ) ); // returns true ``` @@ -163,7 +158,7 @@ bool = ( rand( 0.0, 1.0, 0.5 ) === triangular( 0.0, 1.0, 0.5 ) ); The generator name. ```javascript -var str = triangular.NAME; +const str = triangular.NAME; // returns 'triangular' ``` @@ -172,7 +167,7 @@ var str = triangular.NAME; The underlying pseudorandom number generator. ```javascript -var prng = triangular.PRNG; +const prng = triangular.PRNG; // returns ``` @@ -181,21 +176,17 @@ var prng = triangular.PRNG; The value used to seed `triangular()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = triangular( 0.0, 10.0, 3.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = triangular( 0.0, 10.0, 3.0 ); } // Generate the same pseudorandom values... -rand = triangular.factory( 0.0, 10.0, 3.0, { +const rand = triangular.factory( 0.0, 10.0, 3.0, { 'seed': triangular.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -204,11 +195,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -217,7 +208,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = triangular.seedLength; +const len = triangular.seedLength; // returns ``` @@ -226,11 +217,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -239,7 +230,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = triangular( 0.0, 1.0, 0.5 ); +let r = triangular( 0.0, 1.0, 0.5 ); // returns r = triangular( 0.0, 1.0, 0.5 ); @@ -248,7 +239,7 @@ r = triangular( 0.0, 1.0, 0.5 ); // ... // Get a copy of the current state: -var state = triangular.state; +const state = triangular.state; // returns r = triangular( 0.0, 1.0, 0.5 ); @@ -275,11 +266,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -288,7 +279,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = triangular.stateLength; +const len = triangular.stateLength; // returns ``` @@ -297,11 +288,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -310,7 +301,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = triangular.byteLength; +const sz = triangular.byteLength; // returns ``` @@ -319,11 +310,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -332,7 +323,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = triangular.toJSON(); +const o = triangular.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -341,11 +332,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = triangular.factory({ +const rand = triangular.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -371,23 +362,19 @@ var o = rand.toJSON(); ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); - -var seed; -var rand; -var i; +const triangular = require( '@stdlib/random/base/triangular' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( triangular( 0.0, 1.0, 0.5 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = triangular.factory( 2.0, 5.0, 3.0, { +const seed = 1234; +let rand = triangular.factory( 2.0, 5.0, 3.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -395,7 +382,7 @@ for ( i = 0; i < 100; i++ ) { rand = triangular.factory( 0.0, 1.0, 0.5, { 'seed': triangular.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/uniform/README.md b/lib/node_modules/@stdlib/random/base/uniform/README.md index d6f78e1b7def..b5ed1ea57191 100644 --- a/lib/node_modules/@stdlib/random/base/uniform/README.md +++ b/lib/node_modules/@stdlib/random/base/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); +const uniform = require( '@stdlib/random/base/uniform' ); ``` #### uniform( a, b ) @@ -35,14 +35,14 @@ var uniform = require( '@stdlib/random/base/uniform' ); Returns a pseudorandom number drawn from a [continuous uniform][uniform] distribution with parameters `a` (minimum support; inclusive) and `b` (maximum support; exclusive). ```javascript -var r = uniform( 2.0, 5.0 ); +const r = uniform( 2.0, 5.0 ); // returns ``` If either `a` or `b` is `NaN` or `a >= b`, the function returns `NaN`. ```javascript -var r = uniform( 2.0, 1.0 ); +let r = uniform( 2.0, 1.0 ); // returns NaN r = uniform( NaN, 1.0 ); @@ -57,9 +57,9 @@ r = uniform( 1.0, NaN ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [uniform][uniform] distribution. ```javascript -var rand = uniform.factory(); +const rand = uniform.factory(); -var r = rand( 0.0, 1.0 ); +const r = rand( 0.0, 1.0 ); // returns ``` @@ -67,9 +67,9 @@ If provided `a` and `b`, the returned generator returns random variates from the ```javascript // Draw from uniform( -2.0, 2.0 ) distribution: -var rand = uniform.factory( -2.0, 2.0 ); +const rand = uniform.factory( -2.0, 2.0 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -79,9 +79,9 @@ r = rand(); If not provided `a` and `b`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = uniform.factory(); +const rand = uniform.factory(); -var r = rand( 0.0, 1.0 ); +let r = rand( 0.0, 1.0 ); // returns r = rand( -2.0, 2.0 ); @@ -98,57 +98,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 4.0 ); +const r = rand( 2.0, 4.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = uniform.factory({ +const rand1 = uniform.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 4.0 ); +const r1 = rand1( 2.0, 4.0 ); // returns -var rand2 = uniform.factory( 2.0, 4.0, { +const rand2 = uniform.factory( 2.0, 4.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = uniform( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = uniform( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `uniform`: -rand = uniform.factory({ +const rand = uniform.factory({ 'state': uniform.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === uniform( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === uniform( 1.0, 2.0 ) ); // returns true ``` @@ -157,7 +152,7 @@ bool = ( rand( 1.0, 2.0 ) === uniform( 1.0, 2.0 ) ); The generator name. ```javascript -var str = uniform.NAME; +const str = uniform.NAME; // returns 'uniform' ``` @@ -166,7 +161,7 @@ var str = uniform.NAME; The underlying pseudorandom number generator. ```javascript -var prng = uniform.PRNG; +const prng = uniform.PRNG; // returns ``` @@ -175,21 +170,17 @@ var prng = uniform.PRNG; The value used to seed `uniform()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = uniform( 0.0, 10.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = uniform( 0.0, 10.0 ); } // Generate the same pseudorandom values... -rand = uniform.factory( 0.0, 10.0, { +const rand = uniform.factory( 0.0, 10.0, { 'seed': uniform.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -198,11 +189,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -211,7 +202,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = uniform.seedLength; +const len = uniform.seedLength; // returns ``` @@ -220,11 +211,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -233,7 +224,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = uniform( 2.0, 5.0 ); +let r = uniform( 2.0, 5.0 ); // returns r = uniform( 2.0, 5.0 ); @@ -242,7 +233,7 @@ r = uniform( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = uniform.state; +const state = uniform.state; // returns r = uniform( 2.0, 5.0 ); @@ -269,11 +260,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -282,7 +273,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = uniform.stateLength; +const len = uniform.stateLength; // returns ``` @@ -291,11 +282,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -304,7 +295,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = uniform.byteLength; +const sz = uniform.byteLength; // returns ``` @@ -313,11 +304,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -326,7 +317,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = uniform.toJSON(); +const o = uniform.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -335,11 +326,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = uniform.factory({ +const rand = uniform.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -365,23 +356,19 @@ var o = rand.toJSON(); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); - -var seed; -var rand; -var i; +const uniform = require( '@stdlib/random/base/uniform' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( uniform( 0.0, 1.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = uniform.factory( 2.0, 5.0, { +const seed = 1234; +let rand = uniform.factory( 2.0, 5.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -389,7 +376,7 @@ for ( i = 0; i < 100; i++ ) { rand = uniform.factory( 0.0, 1.0, { 'seed': uniform.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/base/weibull/README.md b/lib/node_modules/@stdlib/random/base/weibull/README.md index 7dda0c2c294a..65f5fda7cbd6 100644 --- a/lib/node_modules/@stdlib/random/base/weibull/README.md +++ b/lib/node_modules/@stdlib/random/base/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var weibull = require( '@stdlib/random/base/weibull' ); +const weibull = require( '@stdlib/random/base/weibull' ); ``` #### weibull( k, lambda ) @@ -35,14 +35,14 @@ var weibull = require( '@stdlib/random/base/weibull' ); Returns a pseudorandom number drawn from a [Weibull][weibull] distribution with scale parameter `k` and shape parameter `lambda`. ```javascript -var r = weibull( 2.0, 5.0 ); +const r = weibull( 2.0, 5.0 ); // returns ``` If `k <= 0` or `lambda <= 0`, the function returns `NaN`. ```javascript -var r = weibull( -2.0, 2.0 ); +let r = weibull( -2.0, 2.0 ); // returns NaN r = weibull( 2.0, -2.0 ); @@ -52,7 +52,7 @@ r = weibull( 2.0, -2.0 ); If `k` or `lambda` is `NaN`, the function returns `NaN`. ```javascript -var r = weibull( 5.0, NaN ); +let r = weibull( 5.0, NaN ); // returns NaN r = weibull( NaN, 2.0 ); @@ -64,18 +64,18 @@ r = weibull( NaN, 2.0 ); Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Weibull][weibull] distribution. ```javascript -var rand = weibull.factory(); +const rand = weibull.factory(); -var r = rand( 1.5, 1.5 ); +const r = rand( 1.5, 1.5 ); // returns ``` If provided `k` and `lambda`, the returned generator returns random variates from the specified distribution. ```javascript -var rand = weibull.factory( 1.5, 1.5 ); +const rand = weibull.factory( 1.5, 1.5 ); -var r = rand(); +let r = rand(); // returns r = rand(); @@ -85,9 +85,9 @@ r = rand(); If not provided `k` and `lambda`, the returned generator requires that both parameters be provided at each invocation. ```javascript -var rand = weibull.factory(); +const rand = weibull.factory(); -var r = rand( 1.0, 1.0 ); +let r = rand( 1.0, 1.0 ); // returns r = rand( 3.14, 2.25 ); @@ -104,57 +104,52 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': minstd.normalized }); -var r = rand( 2.0, 3.0 ); +const r = rand( 2.0, 3.0 ); // returns ``` To seed a pseudorandom number generator, set the `seed` option. ```javascript -var rand1 = weibull.factory({ +const rand1 = weibull.factory({ 'seed': 12345 }); -var r1 = rand1( 2.0, 3.0 ); +const r1 = rand1( 2.0, 3.0 ); // returns -var rand2 = weibull.factory( 2.0, 3.0, { +const rand2 = weibull.factory( 2.0, 3.0, { 'seed': 12345 }); -var r2 = rand2(); +const r2 = rand2(); // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To return a generator having a specific initial state, set the generator `state` option. ```javascript -var rand; -var bool; -var r; -var i; - // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = weibull( 1.0, 2.0 ); +for ( let i = 0; i < 1000; i++ ) { + const r = weibull( 1.0, 2.0 ); } // Create a new PRNG initialized to the current state of `weibull`: -rand = weibull.factory({ +const rand = weibull.factory({ 'state': weibull.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( rand( 1.0, 2.0 ) === weibull( 1.0, 2.0 ) ); +const bool = ( rand( 1.0, 2.0 ) === weibull( 1.0, 2.0 ) ); // returns true ``` @@ -163,7 +158,7 @@ bool = ( rand( 1.0, 2.0 ) === weibull( 1.0, 2.0 ) ); The generator name. ```javascript -var str = weibull.NAME; +const str = weibull.NAME; // returns 'weibull' ``` @@ -172,7 +167,7 @@ var str = weibull.NAME; The underlying pseudorandom number generator. ```javascript -var prng = weibull.PRNG; +const prng = weibull.PRNG; // returns ``` @@ -181,21 +176,17 @@ var prng = weibull.PRNG; The value used to seed `weibull()`. ```javascript -var rand; -var r; -var i; - // Generate pseudorandom values... -for ( i = 0; i < 100; i++ ) { - r = weibull( 2.0, 2.0 ); +for ( let i = 0; i < 100; i++ ) { + const r = weibull( 2.0, 2.0 ); } // Generate the same pseudorandom values... -rand = weibull.factory( 2.0, 2.0, { +const rand = weibull.factory( 2.0, 2.0, { 'seed': weibull.seed }); -for ( i = 0; i < 100; i++ ) { - r = rand(); +for ( let i = 0; i < 100; i++ ) { + const r = rand(); } ``` @@ -204,11 +195,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var seed = rand.seed; +const seed = rand.seed; // returns null ``` @@ -217,7 +208,7 @@ var seed = rand.seed; Length of generator seed. ```javascript -var len = weibull.seedLength; +const len = weibull.seedLength; // returns ``` @@ -226,11 +217,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var len = rand.seedLength; +const len = rand.seedLength; // returns null ``` @@ -239,7 +230,7 @@ var len = rand.seedLength; Writable property for getting and setting the generator state. ```javascript -var r = weibull( 2.0, 5.0 ); +let r = weibull( 2.0, 5.0 ); // returns r = weibull( 2.0, 5.0 ); @@ -248,7 +239,7 @@ r = weibull( 2.0, 5.0 ); // ... // Get a copy of the current state: -var state = weibull.state; +const state = weibull.state; // returns r = weibull( 2.0, 5.0 ); @@ -275,11 +266,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var state = rand.state; +const state = rand.state; // returns null ``` @@ -288,7 +279,7 @@ var state = rand.state; Length of generator state. ```javascript -var len = weibull.stateLength; +const len = weibull.stateLength; // returns ``` @@ -297,11 +288,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var len = rand.stateLength; +const len = rand.stateLength; // returns null ``` @@ -310,7 +301,7 @@ var len = rand.stateLength; Size (in bytes) of generator state. ```javascript -var sz = weibull.byteLength; +const sz = weibull.byteLength; // returns ``` @@ -319,11 +310,11 @@ If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var sz = rand.byteLength; +const sz = rand.byteLength; // returns null ``` @@ -332,7 +323,7 @@ var sz = rand.byteLength; Serializes the pseudorandom number generator as a JSON object. ```javascript -var o = weibull.toJSON(); +const o = weibull.toJSON(); // returns { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] } ``` @@ -341,11 +332,11 @@ If provided a PRNG for uniformly distributed numbers, this method returns `null` ```javascript -var rand = weibull.factory({ +const rand = weibull.factory({ 'prng': Math.random }); -var o = rand.toJSON(); +const o = rand.toJSON(); // returns null ``` @@ -371,23 +362,19 @@ var o = rand.toJSON(); ```javascript -var weibull = require( '@stdlib/random/base/weibull' ); - -var seed; -var rand; -var i; +const weibull = require( '@stdlib/random/base/weibull' ); // Generate pseudorandom numbers... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( weibull( 2.0, 2.0 ) ); } // Create a new pseudorandom number generator... -seed = 1234; -rand = weibull.factory( 6.0, 2.0, { +const seed = 1234; +let rand = weibull.factory( 6.0, 2.0, { 'seed': seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } @@ -395,7 +382,7 @@ for ( i = 0; i < 100; i++ ) { rand = weibull.factory( 2.0, 2.0, { 'seed': weibull.seed }); -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( rand() ); } ``` diff --git a/lib/node_modules/@stdlib/random/exponential/README.md b/lib/node_modules/@stdlib/random/exponential/README.md index e1d4343623ef..05c61615e063 100644 --- a/lib/node_modules/@stdlib/random/exponential/README.md +++ b/lib/node_modules/@stdlib/random/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponential = require( '@stdlib/random/exponential' ); +const exponential = require( '@stdlib/random/exponential' ); ``` #### exponential( shape, lambda\[, options] ) @@ -35,7 +35,7 @@ var exponential = require( '@stdlib/random/exponential' ); Returns an [ndarray][@stdlib/ndarray/ctor] containing pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var arr = exponential( [ 3, 3 ], 2.0 ); +const arr = exponential( [ 3, 3 ], 2.0 ); // returns ``` @@ -48,28 +48,28 @@ The function has the following parameters: If provided an empty `shape`, the function returns a zero-dimensional [ndarray][@stdlib/ndarray/ctor]. ```javascript -var arr = exponential( [], 2.0 ); +const arr = exponential( [], 2.0 ); // returns -var shape = arr.shape; +const shape = arr.shape; // returns [] -var v = arr.get(); +const v = arr.get(); // returns ``` Distribution parameters may be either scalars or [ndarrays][@stdlib/ndarray/ctor]. When providing an [ndarray][@stdlib/ndarray/ctor], the [ndarray][@stdlib/ndarray/ctor] must be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes] with the specified output array `shape`. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); -var lambda = array( [ [ [ 2.0 ] ], [ [ 5.0 ] ] ] ); +const lambda = array( [ [ [ 2.0 ] ], [ [ 5.0 ] ] ] ); // returns -var shape = lambda.shape; +const shape = lambda.shape; // returns [ 2, 1, 1 ] -var arr = exponential( [ 2, 3, 3 ], lambda ); +const arr = exponential( [ 2, 3, 3 ], lambda ); // returns ``` @@ -84,14 +84,14 @@ The function accepts the following `options`: By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a `float64` data type. To return an [ndarray][@stdlib/ndarray/ctor] having a different data type, set the `dtype` option. ```javascript -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = exponential( [ 3, 3 ], 2.0, opts ); +const arr = exponential( [ 3, 3 ], 2.0, opts ); // returns -var dt = arr.dtype; +const dt = arr.dtype; // returns 'generic' ``` @@ -100,34 +100,34 @@ var dt = arr.dtype; Fills an [ndarray][@stdlib/ndarray/ctor] with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var zeros = require( '@stdlib/ndarray/zeros' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var arr = zeros( [ 3, 3 ] ); +const arr = zeros( [ 3, 3 ] ); // returns -var out = exponential.assign( arr, 2.0 ); +const out = exponential.assign( arr, 2.0 ); // returns -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` Distribution parameters may be either scalars or [ndarrays][@stdlib/ndarray/ctor]. When providing an [ndarray][@stdlib/ndarray/ctor], the [ndarray][@stdlib/ndarray/ctor] must be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes] with the output [ndarray][@stdlib/ndarray/ctor]. ```javascript -var array = require( '@stdlib/ndarray/array' ); -var zeros = require( '@stdlib/ndarray/zeros' ); +const array = require( '@stdlib/ndarray/array' ); +const zeros = require( '@stdlib/ndarray/zeros' ); -var lambda = array( [ [ [ 2.0 ] ], [ [ 5.0 ] ] ] ); +const lambda = array( [ [ [ 2.0 ] ], [ [ 5.0 ] ] ] ); // returns -var shape = lambda.shape; +const shape = lambda.shape; // returns [ 2, 1, 1 ] -var arr = zeros( [ 2, 3, 3 ] ); +const arr = zeros( [ 2, 3, 3 ] ); // returns -var out = exponential.assign( arr, lambda ); +const out = exponential.assign( arr, lambda ); // returns ``` @@ -136,12 +136,12 @@ var out = exponential.assign( arr, lambda ); Returns a function for generating pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var random = exponential.factory(); +const random = exponential.factory(); -var out = random( [ 3, 3 ], 2.0 ); +const out = random( [ 3, 3 ], 2.0 ); // returns -var sh = out.shape; +const sh = out.shape; // returns [ 3, 3 ] ``` @@ -160,26 +160,26 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = exponential.factory( opts ); +const random = exponential.factory( opts ); -var out = random( [ 3, 3 ], 2.0 ); +const out = random( [ 3, 3 ], 2.0 ); // returns ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var opts = { +const opts = { 'seed': 12345 }; -var random = exponential.factory( opts ); +const random = exponential.factory( opts ); -var out = random( [ 3, 3 ], 2.0, opts ); +const out = random( [ 3, 3 ], 2.0, opts ); // returns ``` @@ -194,15 +194,15 @@ The returned function accepts the following `options`, each of which overrides t To override the default output array data type, set the `dtype` option. ```javascript -var random = exponential.factory(); +const random = exponential.factory(); -var out = random( [ 3, 3 ], 2.0 ); +let out = random( [ 3, 3 ], 2.0 ); // returns -var dt = out.dtype; +let dt = out.dtype; // returns 'float64' -var opts = { +const opts = { 'dtype': 'generic' }; out = random( [ 3, 3 ], 2.0, opts ); @@ -217,7 +217,7 @@ dt = out.dtype; The underlying pseudorandom number generator. ```javascript -var prng = exponential.PRNG; +const prng = exponential.PRNG; // returns ``` @@ -226,20 +226,20 @@ var prng = exponential.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = exponential.seed; +const seed = exponential.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -248,20 +248,20 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = exponential.seedLength; +const len = exponential.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -270,20 +270,20 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = exponential.state; +const state = exponential.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); -var state = random.state; +const state = random.state; // returns null ``` @@ -292,20 +292,20 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = exponential.stateLength; +const len = exponential.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -314,20 +314,20 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = exponential.byteLength; +const sz = exponential.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -353,20 +353,20 @@ var sz = random.byteLength; ```javascript -var logEach = require( '@stdlib/console/log-each' ); -var toArray = require( '@stdlib/ndarray/to-array' ); -var exponential = require( '@stdlib/random/exponential' ); +const logEach = require( '@stdlib/console/log-each' ); +const toArray = require( '@stdlib/ndarray/to-array' ); +const exponential = require( '@stdlib/random/exponential' ); // Create a function for generating random arrays originating from the same state: -var random = exponential.factory({ +let random = exponential.factory({ 'state': exponential.state, 'copy': true }); // Generate 3 one-dimensional arrays: -var x1 = random( [ 5 ], 2.0 ); -var x2 = random( [ 5 ], 2.0 ); -var x3 = random( [ 5 ], 2.0 ); +const x1 = random( [ 5 ], 2.0 ); +const x2 = random( [ 5 ], 2.0 ); +const x3 = random( [ 5 ], 2.0 ); // Print the contents: logEach( '%f, %f, %f', toArray( x1 ), toArray( x2 ), toArray( x3 ) ); @@ -378,10 +378,10 @@ random = exponential.factory({ }); // Generate a two-dimensional array which replicates the above pseudorandom number generation sequence: -var x4 = random( [ 3, 5 ], 2.0 ); +const x4 = random( [ 3, 5 ], 2.0 ); // Convert to a list of nested arrays: -var arr = toArray( x4 ); +const arr = toArray( x4 ); // Print the contents: console.log( '' ); diff --git a/lib/node_modules/@stdlib/random/iter/README.md b/lib/node_modules/@stdlib/random/iter/README.md index 15da93027f55..83923e2f6817 100644 --- a/lib/node_modules/@stdlib/random/iter/README.md +++ b/lib/node_modules/@stdlib/random/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/iter' ); +const ns = require( '@stdlib/random/iter' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/iter' ); Namespace containing pseudorandom number generator (PRNG) iterators. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -104,33 +104,31 @@ The namespace contains the following functions for creating iterator protocol-co ```javascript -var roundn = require( '@stdlib/math/base/special/roundn' ); -var mean = require( '@stdlib/stats/base/mean' ); -var iter = require( '@stdlib/random/iter' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const mean = require( '@stdlib/stats/base/mean' ); +const iter = require( '@stdlib/random/iter' ); -var initialPrice = 100.0; -var currentPrice = initialPrice; -var numDays = 30; -var volatility = 0.02; // 2% daily volatility +const initialPrice = 100.0; +let currentPrice = initialPrice; +const numDays = 30; +const volatility = 0.02; // 2% daily volatility // Create iterator for random price movements: -var priceIter = iter.normal( 0.0, volatility ); -var prices = [ initialPrice ]; -var dailyReturns = []; +const priceIter = iter.normal( 0.0, volatility ); +const prices = [ initialPrice ]; +const dailyReturns = []; // Simulate price movements: -var change; -var i; -for ( i = 0; i < numDays; i++ ) { - change = priceIter.next().value; +for ( let i = 0; i < numDays; i++ ) { + const change = priceIter.next().value; currentPrice *= ( 1.0 + change ); prices.push( roundn( currentPrice, -2 ) ); dailyReturns.push( change * 100.0 ); } // Calculate summary statistics: -var totalReturn = ( ( currentPrice - initialPrice ) / initialPrice ) * 100.0; -var avgReturn = mean( numDays, dailyReturns, 1 ); +const totalReturn = ( ( currentPrice - initialPrice ) / initialPrice ) * 100.0; +const avgReturn = mean( numDays, dailyReturns, 1 ); // Print results: console.log( 'Stock Price Simulation Results:' ); diff --git a/lib/node_modules/@stdlib/random/iter/arcsine/README.md b/lib/node_modules/@stdlib/random/iter/arcsine/README.md index 4eae6a299952..db3a5b24750d 100644 --- a/lib/node_modules/@stdlib/random/iter/arcsine/README.md +++ b/lib/node_modules/@stdlib/random/iter/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/arcsine' ); +const iterator = require( '@stdlib/random/iter/arcsine' ); ``` #### iterator( a, b\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/arcsine' ); Returns an iterator for generating pseudorandom numbers drawn from an [arcsine][arcsine] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,71 +61,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -169,20 +163,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/arcsine' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/arcsine' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/bernoulli/README.md b/lib/node_modules/@stdlib/random/iter/bernoulli/README.md index f4b853d20cdc..af6de282b2b3 100644 --- a/lib/node_modules/@stdlib/random/iter/bernoulli/README.md +++ b/lib/node_modules/@stdlib/random/iter/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/bernoulli' ); +const iterator = require( '@stdlib/random/iter/bernoulli' ); ``` #### iterator( p\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/bernoulli' ); Returns an iterator for generating pseudorandom numbers drawn from a [Bernoulli][bernoulli] distribution with success probability `p`. ```javascript -var it = iterator( 0.3 ); +const it = iterator( 0.3 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `p < 0` or `p > 1`, the function throws an error. ```javascript -var it = iterator( 1.2 ); +const it = iterator( 1.2 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 0.5, { +const it = iterator( 0.5, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 0.5 ); +const it1 = iterator( 0.5 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 0.5, { +const it2 = iterator( 0.5, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 0.5, { +const it1 = iterator( 0.5, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 0.5, { +const it2 = iterator( 0.5, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 0.5, { +const it = iterator( 0.5, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/bernoulli' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/bernoulli' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 0.3, { +const it = iterator( 0.3, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/beta/README.md b/lib/node_modules/@stdlib/random/iter/beta/README.md index 9564e1343ed3..389f2fe782ab 100644 --- a/lib/node_modules/@stdlib/random/iter/beta/README.md +++ b/lib/node_modules/@stdlib/random/iter/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/beta' ); +const iterator = require( '@stdlib/random/iter/beta' ); ``` #### iterator( alpha, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/beta' ); Returns an iterator for generating pseudorandom numbers drawn from a [beta][beta] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `beta <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/beta' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/beta' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/betaprime/README.md b/lib/node_modules/@stdlib/random/iter/betaprime/README.md index 8e49c65f1d60..790d0e536bb7 100644 --- a/lib/node_modules/@stdlib/random/iter/betaprime/README.md +++ b/lib/node_modules/@stdlib/random/iter/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/betaprime' ); +const iterator = require( '@stdlib/random/iter/betaprime' ); ``` #### iterator( alpha, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/betaprime' ); Returns an iterator for generating pseudorandom numbers drawn from a [beta prime][betaprime] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `beta <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/betaprime' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/betaprime' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/binomial/README.md b/lib/node_modules/@stdlib/random/iter/binomial/README.md index 52cdd84ccb9f..2e35e4246a55 100644 --- a/lib/node_modules/@stdlib/random/iter/binomial/README.md +++ b/lib/node_modules/@stdlib/random/iter/binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/binomial' ); +const iterator = require( '@stdlib/random/iter/binomial' ); ``` #### iterator( n, p\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/binomial' ); Returns an iterator for generating pseudorandom numbers drawn from a [binomial][binomial] distribution with number of trials `n` and success probability `p`. ```javascript -var it = iterator( 10, 0.3 ); +const it = iterator( 10, 0.3 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `p < 0` or `p > 1`, the function throws an error. ```javascript -var it = iterator( 10, 1.2 ); +const it = iterator( 10, 1.2 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 8, 0.5, { +const it = iterator( 8, 0.5, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 8, 0.5 ); +const it1 = iterator( 8, 0.5 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 8, 0.5, { +const it2 = iterator( 8, 0.5, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 8, 0.5, { +const it1 = iterator( 8, 0.5, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 8, 0.5, { +const it2 = iterator( 8, 0.5, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 10, 0.5, { +const it = iterator( 10, 0.5, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/binomial' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/binomial' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 10, 0.5, { +const it = iterator( 10, 0.5, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/box-muller/README.md b/lib/node_modules/@stdlib/random/iter/box-muller/README.md index 354aa9e32860..b20adf41954c 100644 --- a/lib/node_modules/@stdlib/random/iter/box-muller/README.md +++ b/lib/node_modules/@stdlib/random/iter/box-muller/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/box-muller' ); +const iterator = require( '@stdlib/random/iter/box-muller' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/box-muller' ); Returns an iterator for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][box-muller]. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,50 +61,44 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator({ +const it = iterator({ 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it = iterator({ +let it = iterator({ 'seed': 12345 }); -var r = it.next().value; +let r = it.next().value; // returns ~0.349 it = iterator({ @@ -118,11 +112,11 @@ r = it.next().value; To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -166,20 +160,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/box-muller' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/box-muller' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/cauchy/README.md b/lib/node_modules/@stdlib/random/iter/cauchy/README.md index 73052a701a71..b2318edb4556 100644 --- a/lib/node_modules/@stdlib/random/iter/cauchy/README.md +++ b/lib/node_modules/@stdlib/random/iter/cauchy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/cauchy' ); +const iterator = require( '@stdlib/random/iter/cauchy' ); ``` #### iterator( x0, gamma\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/cauchy' ); Returns an iterator for generating pseudorandom numbers drawn from a [Cauchy][cauchy] distribution with parameters `x0` (mean) and `gamma` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `gamma <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/cauchy' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/cauchy' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/chi/README.md b/lib/node_modules/@stdlib/random/iter/chi/README.md index 80ff6511967a..3ce800e9437b 100644 --- a/lib/node_modules/@stdlib/random/iter/chi/README.md +++ b/lib/node_modules/@stdlib/random/iter/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/chi' ); +const iterator = require( '@stdlib/random/iter/chi' ); ``` #### iterator( k\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/chi' ); Returns an iterator for generating pseudorandom numbers drawn from a [chi][chi] distribution with degrees of freedom `k`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `k <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0 ); +const it1 = iterator( 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, { +const it1 = iterator( 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/chi' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/chi' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/chisquare/README.md b/lib/node_modules/@stdlib/random/iter/chisquare/README.md index 90034fa48ca5..344b1885b7e9 100644 --- a/lib/node_modules/@stdlib/random/iter/chisquare/README.md +++ b/lib/node_modules/@stdlib/random/iter/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/chisquare' ); +const iterator = require( '@stdlib/random/iter/chisquare' ); ``` #### iterator( k\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/chisquare' ); Returns an iterator for generating pseudorandom numbers drawn from a [chi-square][chi-square] distribution with degrees of freedom `k`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `k <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0 ); +const it1 = iterator( 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, { +const it1 = iterator( 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/chisquare' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/chisquare' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/cosine/README.md b/lib/node_modules/@stdlib/random/iter/cosine/README.md index 7a13e55e126c..10c2553631fd 100644 --- a/lib/node_modules/@stdlib/random/iter/cosine/README.md +++ b/lib/node_modules/@stdlib/random/iter/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/cosine' ); +const iterator = require( '@stdlib/random/iter/cosine' ); ``` #### iterator( mu, s\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/cosine' ); Returns an iterator for generating pseudorandom numbers drawn from a [raised cosine][cosine] distribution with parameters `mu` (location) and `s` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `s <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/cosine' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/cosine' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/discrete-uniform/README.md b/lib/node_modules/@stdlib/random/iter/discrete-uniform/README.md index 21b622383199..76771f8d4708 100644 --- a/lib/node_modules/@stdlib/random/iter/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/random/iter/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/discrete-uniform' ); +const iterator = require( '@stdlib/random/iter/discrete-uniform' ); ``` #### iterator( a, b\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/discrete-uniform' ); Returns an iterator for generating pseudorandom numbers drawn from a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var it = iterator( -2, 2 ); +const it = iterator( -2, 2 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If either `a` or `b` is not an integer value or `a > b`, the function returns th ```javascript -var it = iterator( 0, 3.5 ); +const it = iterator( 0, 3.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom integers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2, 4, { +const it = iterator( 2, 4, { 'prng': minstd }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2, 4 ); +const it1 = iterator( 2, 4 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2, 4, { +const it2 = iterator( 2, 4, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2, 4, { +const it1 = iterator( 2, 4, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2, 4, { +const it2 = iterator( 2, 4, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2, 4, { +const it = iterator( 2, 4, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/discrete-uniform' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/discrete-uniform' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -2, 2, { +const it = iterator( -2, 2, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/erlang/README.md b/lib/node_modules/@stdlib/random/iter/erlang/README.md index 7f74b8459716..4851cb395b1e 100644 --- a/lib/node_modules/@stdlib/random/iter/erlang/README.md +++ b/lib/node_modules/@stdlib/random/iter/erlang/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/erlang' ); +const iterator = require( '@stdlib/random/iter/erlang' ); ``` #### iterator( k, lambda\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/erlang' ); Returns an iterator for generating pseudorandom numbers drawn from an [Erlang][erlang] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var it = iterator( 2, 5.0 ); +const it = iterator( 2, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `k` is not a positive integer or `λ <= 0`, the function throws an error. ```javascript -var it = iterator( 0.5, 1.0 ); +const it = iterator( 0.5, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2, 4.0, { +const it = iterator( 2, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2, 4.0 ); +const it1 = iterator( 2, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2, 4.0, { +const it2 = iterator( 2, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2, 4.0, { +const it1 = iterator( 2, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2, 4.0, { +const it2 = iterator( 2, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2, 4.0, { +const it = iterator( 2, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/erlang' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/erlang' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2, 5.0, { +const it = iterator( 2, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/exponential/README.md b/lib/node_modules/@stdlib/random/iter/exponential/README.md index 8d49ea9ce45b..bc4b3367e2eb 100644 --- a/lib/node_modules/@stdlib/random/iter/exponential/README.md +++ b/lib/node_modules/@stdlib/random/iter/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/exponential' ); +const iterator = require( '@stdlib/random/iter/exponential' ); ``` #### iterator( lambda\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/exponential' ); Returns an iterator for generating pseudorandom numbers drawn from an [exponential][exponential] distribution with rate parameter `lambda`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `lambda <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0 ); +const it1 = iterator( 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, { +const it1 = iterator( 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/exponential' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/exponential' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/f/README.md b/lib/node_modules/@stdlib/random/iter/f/README.md index e0829525e7ce..65b234ec69dc 100644 --- a/lib/node_modules/@stdlib/random/iter/f/README.md +++ b/lib/node_modules/@stdlib/random/iter/f/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/f' ); +const iterator = require( '@stdlib/random/iter/f' ); ``` #### iterator( d1, d2\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/f' ); Returns an iterator for generating pseudorandom numbers drawn from an [F][f] distribution with parameters `d1` (degrees of freedom) and `d2` (degrees of freedom). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `d1 <= 0` or `d2 <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/f' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/f' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/frechet/README.md b/lib/node_modules/@stdlib/random/iter/frechet/README.md index a0e5c050171c..f919e4d4f60d 100644 --- a/lib/node_modules/@stdlib/random/iter/frechet/README.md +++ b/lib/node_modules/@stdlib/random/iter/frechet/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/frechet' ); +const iterator = require( '@stdlib/random/iter/frechet' ); ``` #### iterator( alpha, s, m\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/frechet' ); Returns an iterator for generating pseudorandom numbers drawn from a [Fréchet][frechet] distribution with parameters `alpha` (shape parameter), `s` (scale parameter), and `m` (location parameter). ```javascript -var it = iterator( 2.0, 5.0, 3.0 ); +const it = iterator( 2.0, 5.0, 3.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `s <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0, 0.0 ); +const it = iterator( -1.0, 1.0, 0.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, 2.0, { +const it = iterator( 2.0, 4.0, 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0, 2.0 ); +const it1 = iterator( 2.0, 4.0, 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, 2.0, { +const it2 = iterator( 2.0, 4.0, 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, 2.0, { +const it1 = iterator( 2.0, 4.0, 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, 2.0, { +const it2 = iterator( 2.0, 4.0, 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, 2.0, { +const it = iterator( 2.0, 4.0, 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/frechet' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/frechet' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, 3.0, { +const it = iterator( 2.0, 5.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/gamma/README.md b/lib/node_modules/@stdlib/random/iter/gamma/README.md index 80f4f22b56e7..8e82306a3e36 100644 --- a/lib/node_modules/@stdlib/random/iter/gamma/README.md +++ b/lib/node_modules/@stdlib/random/iter/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/gamma' ); +const iterator = require( '@stdlib/random/iter/gamma' ); ``` #### iterator( alpha, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/gamma' ); Returns an iterator for generating pseudorandom numbers drawn from a [gamma][gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `beta <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/gamma' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/gamma' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/geometric/README.md b/lib/node_modules/@stdlib/random/iter/geometric/README.md index dba6911b5eb2..42b2d90f3568 100644 --- a/lib/node_modules/@stdlib/random/iter/geometric/README.md +++ b/lib/node_modules/@stdlib/random/iter/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/geometric' ); +const iterator = require( '@stdlib/random/iter/geometric' ); ``` #### iterator( p\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/geometric' ); Returns an iterator for generating pseudorandom numbers drawn from a [geometric][geometric] distribution with success probability `p`. ```javascript -var it = iterator( 0.3 ); +const it = iterator( 0.3 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `p < 0` or `p > 1`, the function throws an error. ```javascript -var it = iterator( 1.2 ); +const it = iterator( 1.2 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 0.5, { +const it = iterator( 0.5, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 0.5 ); +const it1 = iterator( 0.5 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 0.5, { +const it2 = iterator( 0.5, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 0.5, { +const it1 = iterator( 0.5, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 0.5, { +const it2 = iterator( 0.5, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 0.5, { +const it = iterator( 0.5, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/geometric' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/geometric' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 0.3, { +const it = iterator( 0.3, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/gumbel/README.md b/lib/node_modules/@stdlib/random/iter/gumbel/README.md index 997d2951d6d4..192a1cedbc47 100644 --- a/lib/node_modules/@stdlib/random/iter/gumbel/README.md +++ b/lib/node_modules/@stdlib/random/iter/gumbel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/gumbel' ); +const iterator = require( '@stdlib/random/iter/gumbel' ); ``` #### iterator( mu, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/gumbel' ); Returns an iterator for generating pseudorandom numbers drawn from a [Gumbel][gumbel] distribution with parameters `mu` (mean) and `beta` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `beta <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/gumbel' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/gumbel' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/hypergeometric/README.md b/lib/node_modules/@stdlib/random/iter/hypergeometric/README.md index 76ffe493c63b..e5f1d3c834a5 100644 --- a/lib/node_modules/@stdlib/random/iter/hypergeometric/README.md +++ b/lib/node_modules/@stdlib/random/iter/hypergeometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/hypergeometric' ); +const iterator = require( '@stdlib/random/iter/hypergeometric' ); ``` #### iterator( N, K, n\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/hypergeometric' ); Returns an iterator for generating pseudorandom numbers drawn from a [hypergeometric][hypergeometric] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var it = iterator( 10, 5, 5 ); +const it = iterator( 10, 5, 5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If any of `N`, `K`, or `n` is not a nonnegative integer or `n > N`, the function ```javascript -var it = iterator( 20, 10, 22 ); +const it = iterator( 20, 10, 22 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 8, 4, 6, { +const it = iterator( 8, 4, 6, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 8, 4, 6 ); +const it1 = iterator( 8, 4, 6 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 8, 4, 6, { +const it2 = iterator( 8, 4, 6, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 8, 4, 6, { +const it1 = iterator( 8, 4, 6, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 8, 4, 6, { +const it2 = iterator( 8, 4, 6, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 10, 4, 6, { +const it = iterator( 10, 4, 6, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/hypergeometric' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/hypergeometric' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 20, 10, 7, { +const it = iterator( 20, 10, 7, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/improved-ziggurat/README.md b/lib/node_modules/@stdlib/random/iter/improved-ziggurat/README.md index 29a4ad7bf2cd..2e60cac2021a 100644 --- a/lib/node_modules/@stdlib/random/iter/improved-ziggurat/README.md +++ b/lib/node_modules/@stdlib/random/iter/improved-ziggurat/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/improved-ziggurat' ); +const iterator = require( '@stdlib/random/iter/improved-ziggurat' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/improved-ziggurat' ); Returns an iterator for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Improved Ziggurat][ziggurat-algorithm] algorithm. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,50 +61,44 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator({ +const it = iterator({ 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it = iterator({ +let it = iterator({ 'seed': 12345 }); -var r = it.next().value; +let r = it.next().value; // returns ~1.789 it = iterator({ @@ -118,11 +112,11 @@ r = it.next().value; To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -166,20 +160,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/improved-ziggurat' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/improved-ziggurat' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/invgamma/README.md b/lib/node_modules/@stdlib/random/iter/invgamma/README.md index 789da17981ad..32d83ec9b2f0 100644 --- a/lib/node_modules/@stdlib/random/iter/invgamma/README.md +++ b/lib/node_modules/@stdlib/random/iter/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/invgamma' ); +const iterator = require( '@stdlib/random/iter/invgamma' ); ``` #### iterator( alpha, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/invgamma' ); Returns an iterator for generating pseudorandom numbers drawn from an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var it = iterator( 2.0, 2.0 ); +const it = iterator( 2.0, 2.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `beta <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/invgamma' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/invgamma' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/kumaraswamy/README.md b/lib/node_modules/@stdlib/random/iter/kumaraswamy/README.md index f54cc4da7364..3d41f4e5726c 100644 --- a/lib/node_modules/@stdlib/random/iter/kumaraswamy/README.md +++ b/lib/node_modules/@stdlib/random/iter/kumaraswamy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/kumaraswamy' ); +const iterator = require( '@stdlib/random/iter/kumaraswamy' ); ``` #### iterator( a, b\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/kumaraswamy' ); Returns an iterator for generating pseudorandom numbers drawn from a [Kumaraswamy's double bounded][kumaraswamy] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var it = iterator( 2.0, 1.0 ); +const it = iterator( 2.0, 1.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `a <= 0` or `b <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 2.0, { +const it = iterator( 2.0, 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 2.0 ); +const it1 = iterator( 2.0, 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 2.0, { +const it2 = iterator( 2.0, 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 2.0, { +const it1 = iterator( 2.0, 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 2.0, { +const it2 = iterator( 2.0, 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 2.0, { +const it = iterator( 2.0, 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/kumaraswamy' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/kumaraswamy' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/laplace/README.md b/lib/node_modules/@stdlib/random/iter/laplace/README.md index bdc62419330d..0c6e1460cfd3 100644 --- a/lib/node_modules/@stdlib/random/iter/laplace/README.md +++ b/lib/node_modules/@stdlib/random/iter/laplace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/laplace' ); +const iterator = require( '@stdlib/random/iter/laplace' ); ``` #### iterator( mu, b\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/laplace' ); Returns an iterator for generating pseudorandom numbers drawn from a [Laplace (double exponential)][laplace] distribution with parameters `mu` (mean) and `b` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `b <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/laplace' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/laplace' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/levy/README.md b/lib/node_modules/@stdlib/random/iter/levy/README.md index 66ac4a0039b4..b1737fbd5b16 100644 --- a/lib/node_modules/@stdlib/random/iter/levy/README.md +++ b/lib/node_modules/@stdlib/random/iter/levy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/levy' ); +const iterator = require( '@stdlib/random/iter/levy' ); ``` #### iterator( mu, c\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/levy' ); Returns an iterator for generating pseudorandom numbers drawn from a [Lévy][levy] distribution with parameters `mu` (mean) and `c` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `c <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( -1.0, 2.0, { +const it = iterator( -1.0, 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( -1.0, 2.0 ); +const it1 = iterator( -1.0, 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( -1.0, 2.0, { +const it2 = iterator( -1.0, 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( -1.0, 2.0, { +const it1 = iterator( -1.0, 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( -1.0, 2.0, { +const it2 = iterator( -1.0, 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( -1.0, 2.0, { +const it = iterator( -1.0, 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/levy' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/levy' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/logistic/README.md b/lib/node_modules/@stdlib/random/iter/logistic/README.md index a01cd1c138f1..d4ad382db8d5 100644 --- a/lib/node_modules/@stdlib/random/iter/logistic/README.md +++ b/lib/node_modules/@stdlib/random/iter/logistic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/logistic' ); +const iterator = require( '@stdlib/random/iter/logistic' ); ``` #### iterator( mu, s\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/logistic' ); Returns an iterator for generating pseudorandom numbers drawn from a [logistic][logistic] distribution with parameters `mu` (mean) and `s` (scale). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `s <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/logistic' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/logistic' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/lognormal/README.md b/lib/node_modules/@stdlib/random/iter/lognormal/README.md index 071f837880ec..73006d664888 100644 --- a/lib/node_modules/@stdlib/random/iter/lognormal/README.md +++ b/lib/node_modules/@stdlib/random/iter/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/lognormal' ); +const iterator = require( '@stdlib/random/iter/lognormal' ); ``` #### iterator( mu, sigma\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/lognormal' ); Returns an iterator for generating pseudorandom numbers drawn from a [lognormal][lognormal] distribution with parameters `mu` (location) and `sigma` (scale). ```javascript -var it = iterator( 2.0, 2.0 ); +const it = iterator( 2.0, 2.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `sigma <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 1.0, { +const it = iterator( 2.0, 1.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 1.0 ); +const it1 = iterator( 2.0, 1.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 1.0, { +const it2 = iterator( 2.0, 1.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 1.0, { +const it1 = iterator( 2.0, 1.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 1.0, { +const it2 = iterator( 2.0, 1.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 1.0, { +const it = iterator( 2.0, 1.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/lognormal' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/lognormal' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/minstd-shuffle/README.md b/lib/node_modules/@stdlib/random/iter/minstd-shuffle/README.md index f6185439e7ce..234e79df9320 100644 --- a/lib/node_modules/@stdlib/random/iter/minstd-shuffle/README.md +++ b/lib/node_modules/@stdlib/random/iter/minstd-shuffle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/minstd-shuffle' ); +const iterator = require( '@stdlib/random/iter/minstd-shuffle' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/minstd-shuffle' ); Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator ([LCG][lcg]) whose output is shuffled. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,48 +61,42 @@ The function accepts the following `options`: To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var it = iterator({ +const it = iterator({ 'normalized': true }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it = iterator({ +let it = iterator({ 'seed': 12345 }); -var r = it.next().value; +let r = it.next().value; // returns 1982386332 it = iterator({ @@ -116,11 +110,11 @@ r = it.next().value; To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -165,20 +159,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/minstd-shuffle' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/minstd-shuffle' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/minstd/README.md b/lib/node_modules/@stdlib/random/iter/minstd/README.md index f6bf6ce51f1f..2b64d5557456 100644 --- a/lib/node_modules/@stdlib/random/iter/minstd/README.md +++ b/lib/node_modules/@stdlib/random/iter/minstd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/minstd' ); +const iterator = require( '@stdlib/random/iter/minstd' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/minstd' ); Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator ([LCG][lcg]) based on Park and Miller. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,48 +61,42 @@ The function accepts the following `options`: To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var it = iterator({ +const it = iterator({ 'normalized': true }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it = iterator({ +let it = iterator({ 'seed': 12345 }); -var r = it.next().value; +let r = it.next().value; // returns 207482415 it = iterator({ @@ -116,11 +110,11 @@ r = it.next().value; To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -165,20 +159,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/minstd' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/minstd' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/mt19937/README.md b/lib/node_modules/@stdlib/random/iter/mt19937/README.md index 760558e0caf8..2ec489a1030f 100644 --- a/lib/node_modules/@stdlib/random/iter/mt19937/README.md +++ b/lib/node_modules/@stdlib/random/iter/mt19937/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/mt19937' ); +const iterator = require( '@stdlib/random/iter/mt19937' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/mt19937' ); Returns an iterator for generating pseudorandom numbers via a 32-bit [Mersenne Twister][mersenne-twister] pseudorandom number generator. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -61,48 +61,42 @@ The function accepts the following `options`: To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var it = iterator({ +const it = iterator({ 'normalized': true }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it = iterator({ +let it = iterator({ 'seed': 12345 }); -var r = it.next().value; +let r = it.next().value; // returns 3992670690 it = iterator({ @@ -116,11 +110,11 @@ r = it.next().value; To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -165,20 +159,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/mt19937' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/mt19937' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/negative-binomial/README.md b/lib/node_modules/@stdlib/random/iter/negative-binomial/README.md index 0aa4f1f7dddb..810c59e3e7b4 100644 --- a/lib/node_modules/@stdlib/random/iter/negative-binomial/README.md +++ b/lib/node_modules/@stdlib/random/iter/negative-binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/negative-binomial' ); +const iterator = require( '@stdlib/random/iter/negative-binomial' ); ``` #### iterator( r, p\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/negative-binomial' ); Returns an iterator for generating pseudorandom numbers drawn from a [negative binomial][negative-binomial] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var it = iterator( 10, 0.3 ); +const it = iterator( 10, 0.3 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `p < 0` or `p > 1`, the function throws an error. ```javascript -var it = iterator( 10, 1.2 ); +const it = iterator( 10, 1.2 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 8, 0.5, { +const it = iterator( 8, 0.5, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 8, 0.5 ); +const it1 = iterator( 8, 0.5 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 8, 0.5, { +const it2 = iterator( 8, 0.5, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 8, 0.5, { +const it1 = iterator( 8, 0.5, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 8, 0.5, { +const it2 = iterator( 8, 0.5, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 8, 0.5, { +const it = iterator( 8, 0.5, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/negative-binomial' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/negative-binomial' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 10, 0.5, { +const it = iterator( 10, 0.5, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/normal/README.md b/lib/node_modules/@stdlib/random/iter/normal/README.md index 0f8379a272ca..f88d64be57d0 100644 --- a/lib/node_modules/@stdlib/random/iter/normal/README.md +++ b/lib/node_modules/@stdlib/random/iter/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/normal' ); +const iterator = require( '@stdlib/random/iter/normal' ); ``` #### iterator( mu, sigma\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/normal' ); Returns an iterator for generating pseudorandom numbers drawn from a [normal][normal] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `sigma <= 0`, the function throws an error. ```javascript -var it = iterator( 1.0, -1.0 ); +const it = iterator( 1.0, -1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/normal' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/normal' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( -1.0, 3.0, { +const it = iterator( -1.0, 3.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/pareto-type1/README.md b/lib/node_modules/@stdlib/random/iter/pareto-type1/README.md index 09ae8270c5a2..ec2a94b4364d 100644 --- a/lib/node_modules/@stdlib/random/iter/pareto-type1/README.md +++ b/lib/node_modules/@stdlib/random/iter/pareto-type1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/pareto-type1' ); +const iterator = require( '@stdlib/random/iter/pareto-type1' ); ``` #### iterator( alpha, beta\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/pareto-type1' ); Returns an iterator for generating pseudorandom numbers drawn from a [Pareto (Type I)][pareto] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `alpha <= 0` or `beta <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/pareto-type1' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/pareto-type1' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/poisson/README.md b/lib/node_modules/@stdlib/random/iter/poisson/README.md index 92106b9adbfb..3800dd6a2c57 100644 --- a/lib/node_modules/@stdlib/random/iter/poisson/README.md +++ b/lib/node_modules/@stdlib/random/iter/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/poisson' ); +const iterator = require( '@stdlib/random/iter/poisson' ); ``` #### iterator( lambda\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/poisson' ); Returns an iterator for generating pseudorandom numbers drawn from a [Poisson][poisson] distribution with mean `lambda`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `lambda <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.8, { +const it = iterator( 2.8, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.8 ); +const it1 = iterator( 2.8 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.8, { +const it2 = iterator( 2.8, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.8, { +const it1 = iterator( 2.8, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.8, { +const it2 = iterator( 2.8, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.8, { +const it = iterator( 2.8, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/poisson' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/poisson' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/randi/README.md b/lib/node_modules/@stdlib/random/iter/randi/README.md index 9cd753f8d34d..d88d81a62f15 100644 --- a/lib/node_modules/@stdlib/random/iter/randi/README.md +++ b/lib/node_modules/@stdlib/random/iter/randi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/randi' ); +const iterator = require( '@stdlib/random/iter/randi' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/randi' ); Returns an iterator for generating pseudorandom numbers having integer values. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -71,69 +71,63 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var it = iterator({ +const it = iterator({ 'name': 'minstd-shuffle' }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator({ +const it1 = iterator({ 'seed': 7823 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator({ +const it2 = iterator({ 'seed': 7823 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/randi' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/randi' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/randn/README.md b/lib/node_modules/@stdlib/random/iter/randn/README.md index f1a09a57e40a..9ae7560c89fc 100644 --- a/lib/node_modules/@stdlib/random/iter/randn/README.md +++ b/lib/node_modules/@stdlib/random/iter/randn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/randn' ); +const iterator = require( '@stdlib/random/iter/randn' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/randn' ); Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -72,82 +72,76 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`improved-ziggurat`][@stdlib/random/base/improved-ziggurat]. To use a different PRNG, set the `name` option. ```javascript -var it = iterator({ +const it = iterator({ 'name': 'box-muller' }); -var r = it.next().value; +const r = it.next().value; // returns ``` To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator({ +const it = iterator({ 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator({ +const it1 = iterator({ 'seed': 7823 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator({ +const it2 = iterator({ 'seed': 7823 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -192,20 +186,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/randn' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/randn' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/randu/README.md b/lib/node_modules/@stdlib/random/iter/randu/README.md index 224a021f7929..1a6847f955d5 100644 --- a/lib/node_modules/@stdlib/random/iter/randu/README.md +++ b/lib/node_modules/@stdlib/random/iter/randu/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/randu' ); +const iterator = require( '@stdlib/random/iter/randu' ); ``` #### iterator( \[options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/randu' ); Returns an iterator for generating uniformly distributed pseudorandom numbers between `0` and `1`. ```javascript -var it = iterator(); +const it = iterator(); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -71,69 +71,63 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var it = iterator({ +const it = iterator({ 'name': 'minstd-shuffle' }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator(); +const it1 = iterator(); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator({ +const it2 = iterator({ 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator({ +const it1 = iterator({ 'seed': 7823 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator({ +const it2 = iterator({ 'seed': 7823 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator({ +const it = iterator({ 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/randu' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/randu' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator({ +const it = iterator({ 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/rayleigh/README.md b/lib/node_modules/@stdlib/random/iter/rayleigh/README.md index 73ad3a1ee5b5..7f51d3487f10 100644 --- a/lib/node_modules/@stdlib/random/iter/rayleigh/README.md +++ b/lib/node_modules/@stdlib/random/iter/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/rayleigh' ); +const iterator = require( '@stdlib/random/iter/rayleigh' ); ``` #### iterator( sigma\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/rayleigh' ); Returns an iterator for generating pseudorandom numbers drawn from a [Rayleigh][rayleigh] distribution with scale parameter `sigma`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `sigma <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0 ); +const it1 = iterator( 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, { +const it1 = iterator( 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/rayleigh' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/rayleigh' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/t/README.md b/lib/node_modules/@stdlib/random/iter/t/README.md index b5fb1a200c3a..f10a1801e22e 100644 --- a/lib/node_modules/@stdlib/random/iter/t/README.md +++ b/lib/node_modules/@stdlib/random/iter/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/t' ); +const iterator = require( '@stdlib/random/iter/t' ); ``` #### iterator( v\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/t' ); Returns an iterator for generating pseudorandom numbers drawn from a [Student's t][t] distribution with degrees of freedom `v`. ```javascript -var it = iterator( 2.5 ); +const it = iterator( 2.5 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `v <= 0`, the function throws an error. ```javascript -var it = iterator( -0.5 ); +const it = iterator( -0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0 ); +const it1 = iterator( 2.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, { +const it1 = iterator( 2.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, { +const it2 = iterator( 2.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, { +const it = iterator( 2.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/t' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/t' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, { +const it = iterator( 2.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/triangular/README.md b/lib/node_modules/@stdlib/random/iter/triangular/README.md index d993ae7a4a7f..3c8f0f10c1b1 100644 --- a/lib/node_modules/@stdlib/random/iter/triangular/README.md +++ b/lib/node_modules/@stdlib/random/iter/triangular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/triangular' ); +const iterator = require( '@stdlib/random/iter/triangular' ); ``` #### iterator( a, b, c\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/triangular' ); Returns an iterator for generating pseudorandom numbers drawn from a [triangular][triangular] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var it = iterator( 2.0, 5.0, 3.0 ); +const it = iterator( 2.0, 5.0, 3.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If the condition `a <= c <= b` is not satisfied, the function throws an error. ```javascript -var it = iterator( 13.0, 9.0, 0.5 ); +const it = iterator( 13.0, 9.0, 0.5 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, 2.5, { +const it = iterator( 2.0, 4.0, 2.5, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0, 2.5 ); +const it1 = iterator( 2.0, 4.0, 2.5 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, 2.5, { +const it2 = iterator( 2.0, 4.0, 2.5, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, 2.5, { +const it1 = iterator( 2.0, 4.0, 2.5, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, 2.5, { +const it2 = iterator( 2.0, 4.0, 2.5, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, 3.5, { +const it = iterator( 2.0, 4.0, 3.5, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/triangular' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/triangular' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, 4.0, { +const it = iterator( 2.0, 5.0, 4.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/uniform/README.md b/lib/node_modules/@stdlib/random/iter/uniform/README.md index 84157ceb9a9b..09618fa087df 100644 --- a/lib/node_modules/@stdlib/random/iter/uniform/README.md +++ b/lib/node_modules/@stdlib/random/iter/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/uniform' ); +const iterator = require( '@stdlib/random/iter/uniform' ); ``` #### iterator( a, b\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/uniform' ); Returns an iterator for generating pseudorandom numbers drawn from a [continuous uniform][uniform] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If the condition `a < b` is not satisfied, the function throws an error. ```javascript -var it = iterator( 13.0, 9.0 ); +const it = iterator( 13.0, 9.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/uniform' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/uniform' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/iter/weibull/README.md b/lib/node_modules/@stdlib/random/iter/weibull/README.md index e51918b354fc..30ba8f1ba0ad 100644 --- a/lib/node_modules/@stdlib/random/iter/weibull/README.md +++ b/lib/node_modules/@stdlib/random/iter/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iterator = require( '@stdlib/random/iter/weibull' ); +const iterator = require( '@stdlib/random/iter/weibull' ); ``` #### iterator( k, lambda\[, options] ) @@ -35,10 +35,10 @@ var iterator = require( '@stdlib/random/iter/weibull' ); Returns an iterator for generating pseudorandom numbers drawn from a [Weibull][weibull] distribution with parameters `k` (scale parameter) and `lambda` (shape parameter). ```javascript -var it = iterator( 2.0, 5.0 ); +const it = iterator( 2.0, 5.0 ); // returns -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -55,7 +55,7 @@ If `k <= 0` or `lambda <= 0`, the function throws an error. ```javascript -var it = iterator( -1.0, 1.0 ); +const it = iterator( -1.0, 1.0 ); // throws ``` @@ -70,71 +70,65 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'prng': minstd.normalized }); -var r = it.next().value; +const r = it.next().value; // returns ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var bool; -var it1; -var it2; -var r; -var i; - -it1 = iterator( 2.0, 4.0 ); +const it1 = iterator( 2.0, 4.0 ); // Generate pseudorandom numbers, thus progressing the generator state: -for ( i = 0; i < 1000; i++ ) { - r = it1.next().value; +for ( let i = 0; i < 1000; i++ ) { + const r = it1.next().value; } // Create a new iterator initialized to the current state of `it1`: -it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'state': it1.state }); // Test that the generated pseudorandom numbers are the same: -bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` To seed the iterator, set the `seed` option. ```javascript -var it1 = iterator( 2.0, 4.0, { +const it1 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r1 = it1.next().value; +const r1 = it1.next().value; // returns -var it2 = iterator( 2.0, 4.0, { +const it2 = iterator( 2.0, 4.0, { 'seed': 12345 }); -var r2 = it2.next().value; +const r2 = it2.next().value; // returns -var bool = ( r1 === r2 ); +const bool = ( r1 === r2 ); // returns true ``` To limit the number of iterations, set the `iter` option. ```javascript -var it = iterator( 2.0, 4.0, { +const it = iterator( 2.0, 4.0, { 'iter': 2 }); -var r = it.next().value; +let r = it.next().value; // returns r = it.next().value; @@ -178,20 +172,17 @@ The returned iterator protocol-compliant object has the following properties: ```javascript -var iterator = require( '@stdlib/random/iter/weibull' ); - -var it; -var r; +const iterator = require( '@stdlib/random/iter/weibull' ); // Create a seeded iterator for generating pseudorandom numbers: -it = iterator( 2.0, 5.0, { +const it = iterator( 2.0, 5.0, { 'seed': 1234, 'iter': 10 }); // Perform manual iteration... while ( true ) { - r = it.next(); + const r = it.next(); if ( r.done ) { break; } diff --git a/lib/node_modules/@stdlib/random/sample/README.md b/lib/node_modules/@stdlib/random/sample/README.md index 3d73a57d5dac..286bce31344a 100644 --- a/lib/node_modules/@stdlib/random/sample/README.md +++ b/lib/node_modules/@stdlib/random/sample/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sample = require( '@stdlib/random/sample' ); +const sample = require( '@stdlib/random/sample' ); ``` #### sample( x\[, options] ) @@ -41,13 +41,13 @@ var sample = require( '@stdlib/random/sample' ); Samples elements from an `array`-like object. By default, elements are drawn with replacement from `x` to create an output `array` having the same length as `x`. ```javascript -var out = sample( [ 'a', 'b', 'c' ] ); +let out = sample( [ 'a', 'b', 'c' ] ); // e.g., returns [ 'a', 'a', 'b' ] out = sample( [ 3, 6, 9 ] ); // e.g., returns [ 3, 9, 6 ] -var bool = ( out.length === 3 ); +const bool = ( out.length === 3 ); // returns true ``` @@ -60,7 +60,7 @@ The function accepts the following `options`: By default, the function returns an `array` having the same length as `x`. To generate a sample of a different size, set the `size` option. ```javascript -var out = sample( [ 3, 6, 9 ], { +let out = sample( [ 3, 6, 9 ], { 'size': 10 }); // e.g., returns [ 6, 3, 9, 9, 9, 6, 9, 6, 9, 3 ] @@ -74,7 +74,7 @@ out = sample( [ 0, 1 ], { To draw a sample _without_ replacement, set the `replace` option to `false`. In this case, the `size` option cannot be an integer larger than the number of elements in `x`. ```javascript -var out = sample( [ 1, 2, 3, 4, 5, 6 ], { +let out = sample( [ 1, 2, 3, 4, 5, 6 ], { 'replace': false, 'size': 3 }); @@ -89,8 +89,8 @@ out = sample( [ 0, 1 ], { By default, the probability of sampling an element is the same for all elements. To assign elements different probabilities, set the `probs` option. ```javascript -var x = [ 1, 2, 3, 4, 5, 6 ]; -var out = sample( x, { +let x = [ 1, 2, 3, 4, 5, 6 ]; +let out = sample( x, { 'probs': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.5 ] }); // e.g., returns [ 5, 6, 6, 5, 6, 4 ] @@ -111,18 +111,18 @@ The `probs` option **must** be a numeric array consisting of nonnegative values Returns a `function` to sample elements from an `array`-like object. ```javascript -var mysample = sample.factory(); +const mysample = sample.factory(); -var out = mysample( [ 0, 1, 2, 3, 4 ] ); +const out = mysample( [ 0, 1, 2, 3, 4 ] ); // e.g., returns [ 4, 3, 4, 4 ] ``` If provided an array-like object `pool`, the returned function will always sample from the supplied object. ```javascript -var mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ] ); +const mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ] ); -var out = mysample(); +let out = mysample(); // e.g., returns [ 2, 4, 1, 6, 5, 1 ] out = mysample(); @@ -139,11 +139,11 @@ The function accepts the following `options`: To seed the pseudorandom number generator, set the `seed` option. ```javascript -var mysample = sample.factory({ +let mysample = sample.factory({ 'seed': 430 }); -var out = mysample( [ 1, 2, 3, 4, 5, 6 ] ); +let out = mysample( [ 1, 2, 3, 4, 5, 6 ] ); // e.g., returns [ 1, 1, 1, 5, 4, 4 ] mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ], { @@ -157,11 +157,11 @@ out = mysample(); To specify a sample size and/or override the default sample size, set the `size` option. ```javascript -var mysample = sample.factory({ +const mysample = sample.factory({ 'size': 4 }); -var out = mysample( [ 0, 1 ] ); +let out = mysample( [ 0, 1 ] ); // e.g., returns [ 0, 0, 0, 1 ] // Override the size option... @@ -174,25 +174,25 @@ out = mysample( [ 0, 1 ], { By default, the returned function draws samples _with_ replacement. To override the default `replace` strategy, set the `replace` option. ```javascript -var mysample = sample.factory({ +const mysample = sample.factory({ 'replace': false }); -var out = mysample( [ 1, 2, 3 ] ); +const out = mysample( [ 1, 2, 3 ] ); // e.g., returns [ 3, 1, 2 ] ``` If a population from which to sample is provided, the underlying `pool` remains constant for each function invocation. To mutate the `pool` by permanently removing observations when sampling _without_ replacement, set the `mutate` option. ```javascript -var mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ], { +const mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ], { 'mutate': true, 'replace': false, 'size': 3, 'seed': 342 }); -var out = mysample(); +let out = mysample(); // e.g., returns [ 6, 5, 3 ] // Override the mutate option... @@ -208,12 +208,12 @@ out = mysample(); The returned function returns `null` after all population units are exhausted. ```javascript -var mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ], { +const mysample = sample.factory( [ 1, 2, 3, 4, 5, 6 ], { 'mutate': true, 'replace': false }); -var out = mysample(); +let out = mysample(); // e.g., returns [ 3, 2, 1, 6, 5, 4 ] out = mysample(); @@ -231,11 +231,11 @@ out = mysample(); ```javascript -var sample = require( '@stdlib/random/sample' ); +const sample = require( '@stdlib/random/sample' ); // By default, sample uniformly with replacement: -var x = [ 'a', 'b', 'c', 'd' ]; -var out = sample( x, { +let x = [ 'a', 'b', 'c', 'd' ]; +let out = sample( x, { 'size': 10 }); // e.g., returns [ 'd', 'c', 'b', 'b', 'b', 'd', 'c', 'c', 'b', 'd' ] diff --git a/lib/node_modules/@stdlib/random/shuffle/README.md b/lib/node_modules/@stdlib/random/shuffle/README.md index 8b3c067da18f..6d6a4b80a6b0 100644 --- a/lib/node_modules/@stdlib/random/shuffle/README.md +++ b/lib/node_modules/@stdlib/random/shuffle/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var shuffle = require( '@stdlib/random/shuffle' ); +const shuffle = require( '@stdlib/random/shuffle' ); ``` #### shuffle( arr\[, options] ) @@ -41,8 +41,8 @@ var shuffle = require( '@stdlib/random/shuffle' ); Shuffles elements of an array-like object. ```javascript -var arr = [ 1, 2, 3 ]; -var out = shuffle( arr ); +const arr = [ 1, 2, 3 ]; +const out = shuffle( arr ); // e.g., returns [ 3, 1, 2 ] ``` @@ -53,27 +53,27 @@ The function accepts the following `options`: By default, the function returns a shallow copy. To mutate the input `array` (e.g., when input values can be discarded or when optimizing memory usage), set `copy` to `none`. ```javascript -var arr = [ 1, 2, 3 ]; -var out = shuffle( arr, { +const arr = [ 1, 2, 3 ]; +const out = shuffle( arr, { 'copy': 'none' }); -var bool = ( arr === out ); +const bool = ( arr === out ); // returns true ``` To return a deep copy, set the `copy` option to `deep`. ```javascript -var obj = { +const obj = { 'beep': 'boop' }; -var arr = [ [ obj ], [ obj ], [ obj ] ]; +const arr = [ [ obj ], [ obj ], [ obj ] ]; // Deep copy: -var out = shuffle( arr, { +let out = shuffle( arr, { 'copy': 'deep' }); -var bool = ( arr === out ); +let bool = ( arr === out ); // returns false bool = ( arr[2] === out[2] ); @@ -95,7 +95,7 @@ bool = ( arr[2] === out[2] ); Returns a `function` to shuffle elements of `array`-like objects. ```javascript -var myshuffle = shuffle.factory(); +const myshuffle = shuffle.factory(); ``` The function accepts the following `options`: @@ -106,26 +106,26 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var myshuffle = shuffle.factory({ +const myshuffle = shuffle.factory({ 'seed': 239 }); -var out = myshuffle( [ 0, 1, 2, 3, 4 ] ); +const out = myshuffle( [ 0, 1, 2, 3, 4 ] ); // e.g., returns [ 3, 4, 1, 0, 2 ] ``` By default, the returned functions create shallow copies when shuffling. To override the default `copy` strategy, set the `copy` option. ```javascript -var myshuffle = shuffle.factory({ +const myshuffle = shuffle.factory({ 'copy': 'none', 'seed': 867 }); // Created shuffle function mutates input array by default: -var arr = [ 1, 2, 3, 4, 5, 6 ]; -var out = myshuffle( arr ); -var bool = ( arr === out ); +let arr = [ 1, 2, 3, 4, 5, 6 ]; +let out = myshuffle( arr ); +let bool = ( arr === out ); // returns true // Default option can be overridden: @@ -148,19 +148,15 @@ bool = ( arr === out ); ```javascript -var shuffle = require( '@stdlib/random/shuffle' ); +const shuffle = require( '@stdlib/random/shuffle' ); -var result; -var data; -var i; - -data = new Array( 20 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Array( 20 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = i; } -for ( i = 0; i < 10; i++ ) { - result = shuffle( data ); +for ( let i = 0; i < 10; i++ ) { + const result = shuffle( data ); console.log( result ); } ``` diff --git a/lib/node_modules/@stdlib/random/streams/README.md b/lib/node_modules/@stdlib/random/streams/README.md index 4b85068e7e85..cd78ca84f9a7 100644 --- a/lib/node_modules/@stdlib/random/streams/README.md +++ b/lib/node_modules/@stdlib/random/streams/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/streams' ); +const ns = require( '@stdlib/random/streams' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/streams' ); Namespace containing pseudorandom number generator (PRNG) streams. ```javascript -var streams = ns; +const streams = ns; // returns {...} ``` @@ -104,8 +104,8 @@ The namespace contains the following functions for creating readable pseudorando ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/random/streams' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/random/streams' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/arcsine/README.md b/lib/node_modules/@stdlib/random/streams/arcsine/README.md index 17fa1947527d..e00cb899cfd1 100644 --- a/lib/node_modules/@stdlib/random/streams/arcsine/README.md +++ b/lib/node_modules/@stdlib/random/streams/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/arcsine' ); +const randomStream = require( '@stdlib/random/streams/arcsine' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/arcsine' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from an [arcsine][arcsine] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 5.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from an [arcsine][arcsine] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 5.0 ); +const createStream = randomStream.factory( 2.0, 5.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 5.0 ); -var stream2 = createStream( 2.0, 5.0 ); +const stream1 = createStream( 2.0, 5.0 ); +const stream2 = createStream( 2.0, 5.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 5.0, opts ); +const stream = randomStream.objectMode( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/arcsine' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/arcsine' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/bernoulli/README.md b/lib/node_modules/@stdlib/random/streams/bernoulli/README.md index d9f4e329350c..fb33d1de6a03 100644 --- a/lib/node_modules/@stdlib/random/streams/bernoulli/README.md +++ b/lib/node_modules/@stdlib/random/streams/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/bernoulli' ); +const randomStream = require( '@stdlib/random/streams/bernoulli' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/bernoulli' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Bernoulli][bernoulli] distribution with success probability `p`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 0.2 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 0.2 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.2, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.2, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 0.2, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.2, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 0.2, opts1 ); +let stream = randomStream( 0.2, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Bernoulli][bernoulli] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 0.2 ); +const createStream = randomStream.factory( 0.2 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 0.2 ); -var stream2 = createStream( 0.2 ); +const stream1 = createStream( 0.2 ); +const stream2 = createStream( 0.2 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 0.2, opts ); +const stream = randomStream.objectMode( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/bernoulli' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/bernoulli' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/beta/README.md b/lib/node_modules/@stdlib/random/streams/beta/README.md index 11dbdb11acb3..1e2c63888ff1 100644 --- a/lib/node_modules/@stdlib/random/streams/beta/README.md +++ b/lib/node_modules/@stdlib/random/streams/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/beta' ); +const randomStream = require( '@stdlib/random/streams/beta' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/beta' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [beta][beta] distribution with shape parameters `alpha` and `beta`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [beta][beta] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/beta' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/beta' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/betaprime/README.md b/lib/node_modules/@stdlib/random/streams/betaprime/README.md index 2b99bda4f8f2..cfefc2be2998 100644 --- a/lib/node_modules/@stdlib/random/streams/betaprime/README.md +++ b/lib/node_modules/@stdlib/random/streams/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/betaprime' ); +const randomStream = require( '@stdlib/random/streams/betaprime' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/betaprime' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [beta prime][betaprime] distribution with shape parameters `alpha` and `beta`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [beta prime][betaprime] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/betaprime' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/betaprime' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/binomial/README.md b/lib/node_modules/@stdlib/random/streams/binomial/README.md index 2c8d2afe180f..b967b2edacbe 100644 --- a/lib/node_modules/@stdlib/random/streams/binomial/README.md +++ b/lib/node_modules/@stdlib/random/streams/binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/binomial' ); +const randomStream = require( '@stdlib/random/streams/binomial' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/binomial' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [binomial][binomial] distribution with number of trials `n` and success probability `p`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 20, 0.3 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 20, 0.3 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 20, 0.3, opts ); +const stream = randomStream( 20, 0.3, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 5, 0.7, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 5, 0.7, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 5, 0.7, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 5, 0.7, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 5, 0.7, opts ); +const stream = randomStream( 5, 0.7, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20, 0.3, opts1 ); +let stream = randomStream( 20, 0.3, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 0.3, { +const stream = randomStream( 20, 0.3, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 0.3, { +const stream = randomStream( 20, 0.3, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 0.3, { +const stream = randomStream( 20, 0.3, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 0.3, { +const stream = randomStream( 20, 0.3, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 0.3 ); +const stream = randomStream( 20, 0.3 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 0.3, { +const stream = randomStream( 20, 0.3, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [binomial][binomial] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 20, 0.5 ); +const createStream = randomStream.factory( 20, 0.5 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 20, 0.5 ); -var stream2 = createStream( 20, 0.5 ); +const stream1 = createStream( 20, 0.5 ); +const stream2 = createStream( 20, 0.5 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 20, 0.5, opts ); +const stream = randomStream.objectMode( 20, 0.5, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 20, 0.3, opts ); +const stream = randomStream( 20, 0.3, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/binomial' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/binomial' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20, 0.3, opts ); +const stream = randomStream( 20, 0.3, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/box-muller/README.md b/lib/node_modules/@stdlib/random/streams/box-muller/README.md index 8a7ebdc625f3..8cf9b8fb0682 100644 --- a/lib/node_modules/@stdlib/random/streams/box-muller/README.md +++ b/lib/node_modules/@stdlib/random/streams/box-muller/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/box-muller' ); +const randomStream = require( '@stdlib/random/streams/box-muller' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/box-muller' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][@stdlib/random/base/box-muller]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,13 +317,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][@stdlib/random/base/box-muller]. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -338,21 +335,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -370,11 +367,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -410,24 +407,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/box-muller' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/box-muller' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/cauchy/README.md b/lib/node_modules/@stdlib/random/streams/cauchy/README.md index 636145b84d28..276d31e217c2 100644 --- a/lib/node_modules/@stdlib/random/streams/cauchy/README.md +++ b/lib/node_modules/@stdlib/random/streams/cauchy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/cauchy' ); +const randomStream = require( '@stdlib/random/streams/cauchy' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/cauchy' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Cauchy][cauchy] distribution with parameters `x0` (location) and `gamma` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( -2.0, 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( -2.0, 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Cauchy][cauchy] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/cauchy' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/cauchy' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/chi/README.md b/lib/node_modules/@stdlib/random/streams/chi/README.md index 44abe82d4199..da4af914361e 100644 --- a/lib/node_modules/@stdlib/random/streams/chi/README.md +++ b/lib/node_modules/@stdlib/random/streams/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/chi' ); +const randomStream = require( '@stdlib/random/streams/chi' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/chi' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [chi][chi] distribution with degrees of freedom `k`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 1.0, opts ); +const stream = randomStream( 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [chi][chi] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/chi' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/chi' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/chisquare/README.md b/lib/node_modules/@stdlib/random/streams/chisquare/README.md index 9fdcc8bf7c0d..aa7205b55350 100644 --- a/lib/node_modules/@stdlib/random/streams/chisquare/README.md +++ b/lib/node_modules/@stdlib/random/streams/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/chisquare' ); +const randomStream = require( '@stdlib/random/streams/chisquare' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/chisquare' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [chi-square][chi-square] distribution with degrees of freedom `k`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 1.0, opts ); +const stream = randomStream( 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [chi-square][chi-square] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/chisquare' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/chisquare' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/cosine/README.md b/lib/node_modules/@stdlib/random/streams/cosine/README.md index 292b0ada38df..001c96082fdb 100644 --- a/lib/node_modules/@stdlib/random/streams/cosine/README.md +++ b/lib/node_modules/@stdlib/random/streams/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/cosine' ); +const randomStream = require( '@stdlib/random/streams/cosine' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/cosine' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [raised cosine][cosine] distribution with parameters `mu` (location) and `s` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( -2.0, 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( -2.0, 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [raised cosine][cosine] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/cosine' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/cosine' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/discrete-uniform/README.md b/lib/node_modules/@stdlib/random/streams/discrete-uniform/README.md index c49578876c4b..ff196f7f4baf 100644 --- a/lib/node_modules/@stdlib/random/streams/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/random/streams/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/discrete-uniform' ); +const randomStream = require( '@stdlib/random/streams/discrete-uniform' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/discrete-uniform' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2, 5 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2, 5 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2, 5, opts ); +const stream = randomStream( 2, 5, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2, 5, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2, 5, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2, 5, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2, 5, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2, 5, opts ); +const stream = randomStream( 2, 5, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2, 5, opts1 ); +let stream = randomStream( 2, 5, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for random integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var stream = randomStream( 2, 5, { +const stream = randomStream( 2, 5, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for random integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var stream = randomStream( 2, 5, { +const stream = randomStream( 2, 5, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for random integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var stream = randomStream( 2, 5, { +const stream = randomStream( 2, 5, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for random integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var stream = randomStream( 2, 5, { +const stream = randomStream( 2, 5, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5 ); +const stream = randomStream( 2, 5 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for random integers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var stream = randomStream( 2, 5, { +const stream = randomStream( 2, 5, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [discrete uniform][discrete-uniform-distribution] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2, 5 ); +const createStream = randomStream.factory( 2, 5 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2, 5 ); -var stream2 = createStream( 2, 5 ); +const stream1 = createStream( 2, 5 ); +const stream2 = createStream( 2, 5 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2, 5, opts ); +const stream = randomStream.objectMode( 2, 5, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2, 5, opts ); +const stream = randomStream( 2, 5, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/discrete-uniform' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/discrete-uniform' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2, 5, opts ); +const stream = randomStream( 2, 5, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/erlang/README.md b/lib/node_modules/@stdlib/random/streams/erlang/README.md index dc777faf59d8..45d743ddf9b9 100644 --- a/lib/node_modules/@stdlib/random/streams/erlang/README.md +++ b/lib/node_modules/@stdlib/random/streams/erlang/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/erlang' ); +const randomStream = require( '@stdlib/random/streams/erlang' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/erlang' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from an [Erlang][erlang] distribution with parameters `k` (shape) and `lambda` (rate). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2, 5.0, opts ); +const stream = randomStream( 2, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2, 1.0, opts ); +const stream = randomStream( 2, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2, 5.0, opts1 ); +let stream = randomStream( 2, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2, 5.0, { +const stream = randomStream( 2, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2, 5.0, { +const stream = randomStream( 2, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2, 5.0, { +const stream = randomStream( 2, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2, 5.0, { +const stream = randomStream( 2, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2, 5.0 ); +const stream = randomStream( 2, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2, 5.0, { +const stream = randomStream( 2, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from an [Erlang][erlang] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2, 2.0 ); +const createStream = randomStream.factory( 2, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2, 2.0 ); -var stream2 = createStream( 2, 2.0 ); +const stream1 = createStream( 2, 2.0 ); +const stream2 = createStream( 2, 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2, 2.0, opts ); +const stream = randomStream.objectMode( 2, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2, 5.0, opts ); +const stream = randomStream( 2, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/erlang' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/erlang' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2, 2.0, opts ); +const stream = randomStream( 2, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/exponential/README.md b/lib/node_modules/@stdlib/random/streams/exponential/README.md index e8f439978963..ea89d91feae4 100644 --- a/lib/node_modules/@stdlib/random/streams/exponential/README.md +++ b/lib/node_modules/@stdlib/random/streams/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/exponential' ); +const randomStream = require( '@stdlib/random/streams/exponential' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/exponential' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from an [exponential][exponential] distribution with rate parameter `lambda`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 1.0, opts ); +const stream = randomStream( 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from an [exponential][exponential] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/exponential' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/exponential' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/f/README.md b/lib/node_modules/@stdlib/random/streams/f/README.md index f4c4764e9d75..0a46bf133d26 100644 --- a/lib/node_modules/@stdlib/random/streams/f/README.md +++ b/lib/node_modules/@stdlib/random/streams/f/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/f' ); +const randomStream = require( '@stdlib/random/streams/f' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/f' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from an [F][f] distribution with degrees of freedom `d1` and `d2`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from an [F][f] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/f' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/f' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/frechet/README.md b/lib/node_modules/@stdlib/random/streams/frechet/README.md index f42756c3a255..fda9227bdd59 100644 --- a/lib/node_modules/@stdlib/random/streams/frechet/README.md +++ b/lib/node_modules/@stdlib/random/streams/frechet/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/frechet' ); +const randomStream = require( '@stdlib/random/streams/frechet' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/frechet' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Fréchet][frechet] distribution with parameters `alpha` (shape), `s` (scale), and `m` (location). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0, 3.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0, 3.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, -1.0, opts ); +const stream = randomStream( 2.0, 5.0, -1.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 0.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, 0.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 5.0, 3.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, 3.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 5.0, 3.0, opts ); +const stream = randomStream( 2.0, 5.0, 3.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 3.0, opts1 ); +let stream = randomStream( 2.0, 5.0, 3.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0, -1.0 ); +const stream = randomStream( 2.0, 5.0, -1.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0, -1.0 ); +const stream = randomStream( 2.0, 5.0, -1.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, -1.0, { +const stream = randomStream( 2.0, 5.0, -1.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0, 3.0 ); +const stream = randomStream( 2.0, 5.0, 3.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 3.0, { +const stream = randomStream( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 3.0 ); +const stream = randomStream( 2.0, 5.0, 3.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 3.0, { +const stream = randomStream( 2.0, 5.0, 3.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 3.0 ); +const stream = randomStream( 2.0, 5.0, 3.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 3.0, { +const stream = randomStream( 2.0, 5.0, 3.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 3.0 ); +const stream = randomStream( 2.0, 5.0, 3.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 3.0, { +const stream = randomStream( 2.0, 5.0, 3.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Fréchet][frechet] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 5.0, 3.0 ); +const createStream = randomStream.factory( 2.0, 5.0, 3.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 5.0, 3.0 ); -var stream2 = createStream( 2.0, 5.0, 3.0 ); +const stream1 = createStream( 2.0, 5.0, 3.0 ); +const stream2 = createStream( 2.0, 5.0, 3.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 5.0, 3.0, opts ); +const stream = randomStream.objectMode( 2.0, 5.0, 3.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, 3.0, opts ); +const stream = randomStream( 2.0, 5.0, 3.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/frechet' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/frechet' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 3.0, opts ); +const stream = randomStream( 2.0, 5.0, 3.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/gamma/README.md b/lib/node_modules/@stdlib/random/streams/gamma/README.md index b7c0d522bc7d..212380aa655c 100644 --- a/lib/node_modules/@stdlib/random/streams/gamma/README.md +++ b/lib/node_modules/@stdlib/random/streams/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/gamma' ); +const randomStream = require( '@stdlib/random/streams/gamma' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/gamma' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [gamma][gamma] distribution with parameters `alpha` (shape) and `beta` (rate). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [gamma][gamma] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/gamma' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/gamma' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/geometric/README.md b/lib/node_modules/@stdlib/random/streams/geometric/README.md index bd4889f16957..af4b7f19215a 100644 --- a/lib/node_modules/@stdlib/random/streams/geometric/README.md +++ b/lib/node_modules/@stdlib/random/streams/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/geometric' ); +const randomStream = require( '@stdlib/random/streams/geometric' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/geometric' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [geometric][geometric] distribution with success probability `p`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 0.2 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 0.2 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.2, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.2, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 0.2, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.2, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 0.2, opts1 ); +let stream = randomStream( 0.2, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 0.2 ); +const stream = randomStream( 0.2 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 0.2, { +const stream = randomStream( 0.2, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [geometric][geometric] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 0.2 ); +const createStream = randomStream.factory( 0.2 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 0.2 ); -var stream2 = createStream( 0.2 ); +const stream1 = createStream( 0.2 ); +const stream2 = createStream( 0.2 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 0.2, opts ); +const stream = randomStream.objectMode( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/geometric' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/geometric' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 0.2, opts ); +const stream = randomStream( 0.2, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/gumbel/README.md b/lib/node_modules/@stdlib/random/streams/gumbel/README.md index 91b32b2ba5b5..1b48b978173b 100644 --- a/lib/node_modules/@stdlib/random/streams/gumbel/README.md +++ b/lib/node_modules/@stdlib/random/streams/gumbel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/gumbel' ); +const randomStream = require( '@stdlib/random/streams/gumbel' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/gumbel' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Gumbel][gumbel] distribution with parameters `mu` (mean) and `beta` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( -2.0, 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( -2.0, 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Gumbel][gumbel] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/gumbel' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/gumbel' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/hypergeometric/README.md b/lib/node_modules/@stdlib/random/streams/hypergeometric/README.md index e9be332d64e7..9b2bd943a06d 100644 --- a/lib/node_modules/@stdlib/random/streams/hypergeometric/README.md +++ b/lib/node_modules/@stdlib/random/streams/hypergeometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/hypergeometric' ); +const randomStream = require( '@stdlib/random/streams/hypergeometric' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/hypergeometric' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [hypergeometric][hypergeometric] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 20, 10, 7 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 20, 10, 7 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 10, 5, 5, opts ); +const stream = randomStream( 10, 5, 5, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 20, 5, 8, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 20, 5, 8, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 20, 10, 7, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 20, 10, 7, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 20, 10, 7, opts ); +const stream = randomStream( 20, 10, 7, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20, 10, 7, opts1 ); +let stream = randomStream( 20, 10, 7, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20, 10, 5 ); +const stream = randomStream( 20, 10, 5 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20, 10, 5 ); +const stream = randomStream( 20, 10, 5 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 10, 5, { +const stream = randomStream( 20, 10, 5, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 20, 10, 7 ); +const stream = randomStream( 20, 10, 7 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 10, 7, { +const stream = randomStream( 20, 10, 7, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 10, 7 ); +const stream = randomStream( 20, 10, 7 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 10, 7, { +const stream = randomStream( 20, 10, 7, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 10, 7 ); +const stream = randomStream( 20, 10, 7 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 10, 7, { +const stream = randomStream( 20, 10, 7, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20, 10, 7 ); +const stream = randomStream( 20, 10, 7 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20, 10, 7, { +const stream = randomStream( 20, 10, 7, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [hypergeometric][hypergeometric] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 20, 10, 7 ); +const createStream = randomStream.factory( 20, 10, 7 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 20, 10, 7 ); -var stream2 = createStream( 20, 10, 7 ); +const stream1 = createStream( 20, 10, 7 ); +const stream2 = createStream( 20, 10, 7 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 20, 10, 7, opts ); +const stream = randomStream.objectMode( 20, 10, 7, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 20, 10, 7, opts ); +const stream = randomStream( 20, 10, 7, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/hypergeometric' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/hypergeometric' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20, 10, 7, opts ); +const stream = randomStream( 20, 10, 7, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/improved-ziggurat/README.md b/lib/node_modules/@stdlib/random/streams/improved-ziggurat/README.md index f9d21d5942ff..c5851209303f 100644 --- a/lib/node_modules/@stdlib/random/streams/improved-ziggurat/README.md +++ b/lib/node_modules/@stdlib/random/streams/improved-ziggurat/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/improved-ziggurat' ); +const randomStream = require( '@stdlib/random/streams/improved-ziggurat' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/improved-ziggurat' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Improved Ziggurat][@stdlib/random/base/improved-ziggurat] algorithm. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,13 +317,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Improved Ziggurat][@stdlib/random/base/improved-ziggurat] algorithm. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -338,21 +335,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -370,11 +367,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -410,24 +407,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/improved-ziggurat' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/improved-ziggurat' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/invgamma/README.md b/lib/node_modules/@stdlib/random/streams/invgamma/README.md index 15246bb63424..83284ff88827 100644 --- a/lib/node_modules/@stdlib/random/streams/invgamma/README.md +++ b/lib/node_modules/@stdlib/random/streams/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/invgamma' ); +const randomStream = require( '@stdlib/random/streams/invgamma' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/invgamma' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape) and `beta` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from an [inverse gamma][inverse-gamma] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/invgamma' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/invgamma' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/kumaraswamy/README.md b/lib/node_modules/@stdlib/random/streams/kumaraswamy/README.md index 5895152ef42f..910d87f4047c 100644 --- a/lib/node_modules/@stdlib/random/streams/kumaraswamy/README.md +++ b/lib/node_modules/@stdlib/random/streams/kumaraswamy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/kumaraswamy' ); +const randomStream = require( '@stdlib/random/streams/kumaraswamy' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/kumaraswamy' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Kumaraswamy's double bounded][kumaraswamy] distribution with shape parameters `a` and `b`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Kumaraswamy's double bounded][kumaraswamy] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/kumaraswamy' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/kumaraswamy' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/laplace/README.md b/lib/node_modules/@stdlib/random/streams/laplace/README.md index dfe1d32a397e..e58f86b0e3b2 100644 --- a/lib/node_modules/@stdlib/random/streams/laplace/README.md +++ b/lib/node_modules/@stdlib/random/streams/laplace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/laplace' ); +const randomStream = require( '@stdlib/random/streams/laplace' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/laplace' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Laplace (double exponential)][laplace] distribution with parameters `mu` (mean) and `b` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Laplace (double exponential)][laplace] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/laplace' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/laplace' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/levy/README.md b/lib/node_modules/@stdlib/random/streams/levy/README.md index dcf5008c6d2d..403209d2122c 100644 --- a/lib/node_modules/@stdlib/random/streams/levy/README.md +++ b/lib/node_modules/@stdlib/random/streams/levy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/levy' ); +const randomStream = require( '@stdlib/random/streams/levy' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/levy' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Lévy][levy] distribution with parameters `mu` (mean) and `c` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( -2.0, 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( -2.0, 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Lévy][levy] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/levy' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/levy' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/logistic/README.md b/lib/node_modules/@stdlib/random/streams/logistic/README.md index 1caa8532dde3..1510806ba1ef 100644 --- a/lib/node_modules/@stdlib/random/streams/logistic/README.md +++ b/lib/node_modules/@stdlib/random/streams/logistic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/logistic' ); +const randomStream = require( '@stdlib/random/streams/logistic' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/logistic' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [logistic][logistic] distribution with parameters `mu` (mean) and `s` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [logistic][logistic] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/logistic' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/logistic' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/lognormal/README.md b/lib/node_modules/@stdlib/random/streams/lognormal/README.md index e8d0de78c194..0bd033bf24dd 100644 --- a/lib/node_modules/@stdlib/random/streams/lognormal/README.md +++ b/lib/node_modules/@stdlib/random/streams/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/lognormal' ); +const randomStream = require( '@stdlib/random/streams/lognormal' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/lognormal' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [lognormal][lognormal] distribution with parameters `mu` (location) and `sigma` (scale). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( -2.0, 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( -2.0, 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [lognormal][lognormal] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/lognormal' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/lognormal' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( -2.0, 2.0, opts ); +const stream = randomStream( -2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/minstd-shuffle/README.md b/lib/node_modules/@stdlib/random/streams/minstd-shuffle/README.md index c30208711419..3ddce1e7afb3 100644 --- a/lib/node_modules/@stdlib/random/streams/minstd-shuffle/README.md +++ b/lib/node_modules/@stdlib/random/streams/minstd-shuffle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/minstd-shuffle' ); +const randomStream = require( '@stdlib/random/streams/minstd-shuffle' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/minstd-shuffle' ); Returns a [readable stream][readable-stream] for a linear congruential pseudorandom number generator ([LCG][@stdlib/random/base/minstd-shuffle]) whose output is shuffled. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'normalized': true }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,19 +120,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -142,24 +140,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -167,29 +165,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -207,9 +205,9 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; // returns ``` @@ -218,9 +216,9 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` @@ -229,9 +227,9 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; // returns ``` @@ -240,9 +238,9 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` @@ -251,9 +249,9 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` @@ -264,13 +262,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers via a linear congruential pseudorandom number generator ([LCG][@stdlib/random/base/minstd-shuffle]) whose output is shuffled. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -282,21 +280,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -314,11 +312,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -356,24 +354,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/minstd-shuffle' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/minstd-shuffle' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/minstd/README.md b/lib/node_modules/@stdlib/random/streams/minstd/README.md index edac17b269e3..5a6785fc0979 100644 --- a/lib/node_modules/@stdlib/random/streams/minstd/README.md +++ b/lib/node_modules/@stdlib/random/streams/minstd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/minstd' ); +const randomStream = require( '@stdlib/random/streams/minstd' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/minstd' ); Returns a [readable stream][readable-stream] for a linear congruential pseudorandom number generator ([LCG][@stdlib/random/base/minstd]) based on Park and Miller. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'normalized': true }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,19 +120,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -142,24 +140,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -167,29 +165,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -207,9 +205,9 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; // returns ``` @@ -218,9 +216,9 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` @@ -229,9 +227,9 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; // returns ``` @@ -240,9 +238,9 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` @@ -251,9 +249,9 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` @@ -264,13 +262,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers via a linear congruential pseudorandom number generator ([LCG][@stdlib/random/base/minstd]) based on Park and Miller. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -282,21 +280,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -314,11 +312,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -356,24 +354,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/minstd' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/minstd' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/mt19937/README.md b/lib/node_modules/@stdlib/random/streams/mt19937/README.md index f27e16ee8d32..0285d1d5dd0c 100644 --- a/lib/node_modules/@stdlib/random/streams/mt19937/README.md +++ b/lib/node_modules/@stdlib/random/streams/mt19937/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/mt19937' ); +const randomStream = require( '@stdlib/random/streams/mt19937' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/mt19937' ); Returns a [readable stream][readable-stream] for a 32-bit [Mersenne Twister][@stdlib/random/base/mt19937] pseudorandom number generator. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); To return pseudorandom numbers on the interval `[0,1)`, set the `normalized` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'normalized': true }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,19 +120,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -142,24 +140,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -167,29 +165,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -207,9 +205,9 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; // returns ``` @@ -218,9 +216,9 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` @@ -229,9 +227,9 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; // returns ``` @@ -240,9 +238,9 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` @@ -251,9 +249,9 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` @@ -264,13 +262,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers via a 32-bit [Mersenne Twister][@stdlib/random/base/mt19937] pseudorandom number generator. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -282,21 +280,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -314,11 +312,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -356,24 +354,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/mt19937' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/mt19937' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/negative-binomial/README.md b/lib/node_modules/@stdlib/random/streams/negative-binomial/README.md index c6793450ebd1..9bd5106cfaa9 100644 --- a/lib/node_modules/@stdlib/random/streams/negative-binomial/README.md +++ b/lib/node_modules/@stdlib/random/streams/negative-binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/negative-binomial' ); +const randomStream = require( '@stdlib/random/streams/negative-binomial' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/negative-binomial' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [negative binomial][negative-binomial] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 20.0, 0.3, opts ); +const stream = randomStream( 20.0, 0.3, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 5, 0.7, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 5, 0.7, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 5, 0.7, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 5, 0.7, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 5, 0.7, opts ); +const stream = randomStream( 5, 0.7, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20.0, 0.3, opts1 ); +let stream = randomStream( 20.0, 0.3, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20.0, 0.3, { +const stream = randomStream( 20.0, 0.3, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20.0, 0.3, { +const stream = randomStream( 20.0, 0.3, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20.0, 0.3, { +const stream = randomStream( 20.0, 0.3, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20.0, 0.3, { +const stream = randomStream( 20.0, 0.3, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 20.0, 0.3 ); +const stream = randomStream( 20.0, 0.3 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 20.0, 0.3, { +const stream = randomStream( 20.0, 0.3, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [negative binomial][negative-binomial] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 20.0, 0.5 ); +const createStream = randomStream.factory( 20.0, 0.5 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 20.0, 0.5 ); -var stream2 = createStream( 20.0, 0.5 ); +const stream1 = createStream( 20.0, 0.5 ); +const stream2 = createStream( 20.0, 0.5 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 20.0, 0.5, opts ); +const stream = randomStream.objectMode( 20.0, 0.5, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 20.0, 0.3, opts ); +const stream = randomStream( 20.0, 0.3, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/negative-binomial' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/negative-binomial' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 20.0, 0.3, opts ); +const stream = randomStream( 20.0, 0.3, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/normal/README.md b/lib/node_modules/@stdlib/random/streams/normal/README.md index b34ab221103b..c39803a9898e 100644 --- a/lib/node_modules/@stdlib/random/streams/normal/README.md +++ b/lib/node_modules/@stdlib/random/streams/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/normal' ); +const randomStream = require( '@stdlib/random/streams/normal' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/normal' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [normal][normal] distribution with mean `mu` and standard deviation `sigma`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 0.0, 2.0, opts ); +const stream = randomStream( 0.0, 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 0.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 0.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts1 ); +let stream = randomStream( 2.0, 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 2.0 ); +const stream = randomStream( 2.0, 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 2.0, { +const stream = randomStream( 2.0, 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [normal][normal] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/normal' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/normal' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( -2.0, 2.0, opts ); +const stream = randomStream( -2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/pareto-type1/README.md b/lib/node_modules/@stdlib/random/streams/pareto-type1/README.md index 1624addc5fc3..129fe7c36ea0 100644 --- a/lib/node_modules/@stdlib/random/streams/pareto-type1/README.md +++ b/lib/node_modules/@stdlib/random/streams/pareto-type1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/pareto-type1' ); +const randomStream = require( '@stdlib/random/streams/pareto-type1' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/pareto-type1' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Pareto (Type I)][pareto] distribution with shape parameter `alpha` and scale parameter `beta`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Pareto (Type I)][pareto] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/pareto-type1' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/pareto-type1' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/poisson/README.md b/lib/node_modules/@stdlib/random/streams/poisson/README.md index 125f80f11a1a..3c6d1ca94b1c 100644 --- a/lib/node_modules/@stdlib/random/streams/poisson/README.md +++ b/lib/node_modules/@stdlib/random/streams/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/poisson' ); +const randomStream = require( '@stdlib/random/streams/poisson' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/poisson' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Poisson][poisson] distribution with mean parameter `lambda`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 1.0, opts ); +const stream = randomStream( 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Poisson][poisson] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/poisson' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/poisson' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/randi/README.md b/lib/node_modules/@stdlib/random/streams/randi/README.md index 55c515325c2e..f8878a8a32a6 100644 --- a/lib/node_modules/@stdlib/random/streams/randi/README.md +++ b/lib/node_modules/@stdlib/random/streams/randi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/randi' ); +const randomStream = require( '@stdlib/random/streams/randi' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/randi' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers having integer values. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -86,30 +84,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -117,19 +115,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -137,35 +135,35 @@ stream.pipe( iStream ); By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var opts = { +const opts = { 'name': 'minstd-shuffle' }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'name': 'mt19937', 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -173,30 +171,30 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'name': 'mt19937', 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'name': 'mt19937', 'objectMode': true, 'iter': 10, @@ -215,9 +213,9 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; ``` ##### stream.seedLength @@ -225,9 +223,9 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` @@ -236,9 +234,9 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; ``` ##### stream.stateLength @@ -246,9 +244,9 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` @@ -257,9 +255,9 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` @@ -270,13 +268,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers having integer values. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -288,21 +286,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -320,11 +318,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -361,24 +359,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/randi' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/randi' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/randn/README.md b/lib/node_modules/@stdlib/random/streams/randn/README.md index b260be146201..4eced114600d 100644 --- a/lib/node_modules/@stdlib/random/streams/randn/README.md +++ b/lib/node_modules/@stdlib/random/streams/randn/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/randn' ); +const randomStream = require( '@stdlib/random/streams/randn' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/randn' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a standard normal distribution. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -87,30 +85,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -118,19 +116,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -138,47 +136,47 @@ stream.pipe( iStream ); By default, the underlying pseudorandom number generator is [`improved-ziggurat`][@stdlib/random/base/improved-ziggurat]. To use a different PRNG, set the `name` option. ```javascript -var opts = { +const opts = { 'name': 'box-muller' }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var minstd = require( '@stdlib/random/base/minstd' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'name': 'improved-ziggurat', 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -186,30 +184,30 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'name': 'improved-ziggurat', 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'name': 'improved-ziggurat', 'objectMode': true, 'iter': 10, @@ -228,21 +226,21 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -251,22 +249,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -275,21 +273,21 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -298,22 +296,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -322,22 +320,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream({ +const stream = randomStream({ 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -348,13 +346,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a standard normal distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -366,21 +364,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -398,11 +396,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -439,24 +437,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/randn' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/randn' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/randu/README.md b/lib/node_modules/@stdlib/random/streams/randu/README.md index f9e4745e79e6..670627d65581 100644 --- a/lib/node_modules/@stdlib/random/streams/randu/README.md +++ b/lib/node_modules/@stdlib/random/streams/randu/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/randu' ); +const randomStream = require( '@stdlib/random/streams/randu' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/randu' ); Returns a [readable stream][readable-stream] for generating uniformly distributed pseudorandom numbers between `0` and `1`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream(); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream(); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -86,30 +84,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -117,19 +115,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( opts ); -var iStream = inspectStream( log ); +const stream = randomStream( opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -137,35 +135,35 @@ stream.pipe( iStream ); By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var opts = { +const opts = { 'name': 'minstd-shuffle' }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'name': 'mt19937', 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -173,30 +171,30 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'name': 'mt19937', 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts1 ); +let stream = randomStream( opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'name': 'mt19937', 'objectMode': true, 'iter': 10, @@ -215,9 +213,9 @@ stream.pipe( iStream ); The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var seed = stream.seed; +const seed = stream.seed; ``` ##### stream.seedLength @@ -225,9 +223,9 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` @@ -236,9 +234,9 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var state = stream.state; +const state = stream.state; ``` ##### stream.stateLength @@ -246,9 +244,9 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` @@ -257,9 +255,9 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream(); +const stream = randomStream(); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` @@ -270,13 +268,13 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate uniformly distributed pseudorandom numbers between `0` and `1`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` The method accepts the same `options` as [`randomStream()`](#random-stream). @@ -288,21 +286,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( opts ); +const stream = randomStream.objectMode( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -320,11 +318,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); stream.on( 'state', onState ); @@ -361,24 +359,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/randu' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/randu' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( opts ); +const stream = randomStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/rayleigh/README.md b/lib/node_modules/@stdlib/random/streams/rayleigh/README.md index 3f3bfdc44f13..6b71fd28a335 100644 --- a/lib/node_modules/@stdlib/random/streams/rayleigh/README.md +++ b/lib/node_modules/@stdlib/random/streams/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/rayleigh' ); +const randomStream = require( '@stdlib/random/streams/rayleigh' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/rayleigh' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Rayleigh][rayleigh] distribution with scale parameter `sigma`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Rayleigh][rayleigh] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/rayleigh' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/rayleigh' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/t/README.md b/lib/node_modules/@stdlib/random/streams/t/README.md index 8011bb725583..97b3222f9eda 100644 --- a/lib/node_modules/@stdlib/random/streams/t/README.md +++ b/lib/node_modules/@stdlib/random/streams/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/t' ); +const randomStream = require( '@stdlib/random/streams/t' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/t' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Student's t][t] distribution with degrees of freedom `v`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts1 ); +let stream = randomStream( 2.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0 ); +const stream = randomStream( 2.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, { +const stream = randomStream( 2.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Student's t][t] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0 ); +const createStream = randomStream.factory( 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0 ); -var stream2 = createStream( 2.0 ); +const stream1 = createStream( 2.0 ); +const stream2 = createStream( 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, opts ); +const stream = randomStream.objectMode( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/t' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/t' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, opts ); +const stream = randomStream( 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/triangular/README.md b/lib/node_modules/@stdlib/random/streams/triangular/README.md index 9afa25411286..4d8c036bb36b 100644 --- a/lib/node_modules/@stdlib/random/streams/triangular/README.md +++ b/lib/node_modules/@stdlib/random/streams/triangular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/triangular' ); +const randomStream = require( '@stdlib/random/streams/triangular' ); ``` @@ -37,10 +37,7 @@ var randomStream = require( '@stdlib/random/streams/triangular' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [triangular][triangular] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -71,30 +68,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +99,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +119,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +144,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 4.0, opts1 ); +let stream = randomStream( 2.0, 5.0, 4.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +184,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +195,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 4.0, { +const stream = randomStream( 2.0, 5.0, 4.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +219,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 4.0, { +const stream = randomStream( 2.0, 5.0, 4.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +243,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 4.0, { +const stream = randomStream( 2.0, 5.0, 4.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +267,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 4.0, { +const stream = randomStream( 2.0, 5.0, 4.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +291,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0, 4.0 ); +const stream = randomStream( 2.0, 5.0, 4.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, 4.0, { +const stream = randomStream( 2.0, 5.0, 4.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +317,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [triangular][triangular] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 5.0, 4.0 ); +const createStream = randomStream.factory( 2.0, 5.0, 4.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 5.0, 4.0 ); -var stream2 = createStream( 2.0, 5.0, 4.0 ); +const stream1 = createStream( 2.0, 5.0, 4.0 ); +const stream2 = createStream( 2.0, 5.0, 4.0 ); // ... ``` @@ -358,21 +355,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts ); +const stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +387,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); stream.on( 'state', onState ); @@ -430,24 +427,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/triangular' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/triangular' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, 4.0, opts ); +const stream = randomStream( 2.0, 5.0, 4.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/uniform/README.md b/lib/node_modules/@stdlib/random/streams/uniform/README.md index d7fe6a3865fa..c167559480b1 100644 --- a/lib/node_modules/@stdlib/random/streams/uniform/README.md +++ b/lib/node_modules/@stdlib/random/streams/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/uniform' ); +const randomStream = require( '@stdlib/random/streams/uniform' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/uniform' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [uniform][uniform] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 5.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 5.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [uniform][uniform] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 5.0 ); +const createStream = randomStream.factory( 2.0, 5.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 5.0 ); -var stream2 = createStream( 2.0, 5.0 ); +const stream1 = createStream( 2.0, 5.0 ); +const stream2 = createStream( 2.0, 5.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 5.0, opts ); +const stream = randomStream.objectMode( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/uniform' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/uniform' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/streams/weibull/README.md b/lib/node_modules/@stdlib/random/streams/weibull/README.md index ecdf6bb70a7e..9cf6ed6dae3c 100644 --- a/lib/node_modules/@stdlib/random/streams/weibull/README.md +++ b/lib/node_modules/@stdlib/random/streams/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randomStream = require( '@stdlib/random/streams/weibull' ); +const randomStream = require( '@stdlib/random/streams/weibull' ); ``` @@ -37,10 +37,9 @@ var randomStream = require( '@stdlib/random/streams/weibull' ); Returns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [Weibull][weibull] distribution with parameters `k` (scale) and `lambda` (shape). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; +const stream = randomStream( 2.0, 5.0 ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -49,8 +48,7 @@ function log( chunk, idx ) { } } -stream = randomStream( 2.0, 5.0 ); -iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -71,30 +69,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); ``` By default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -102,19 +100,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = randomStream( 2.0, 1.0, opts ); -var iStream = inspectStream( log ); +const stream = randomStream( 2.0, 1.0, opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -122,24 +120,24 @@ stream.pipe( iStream ); To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10, 'seed': 1234 }; -var stream = randomStream( 2.0, 1.0, opts ); +const stream = randomStream( 2.0, 1.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -147,29 +145,29 @@ stream.pipe( iStream ); To return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts1 = { +const opts1 = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 5.0, opts1 ); +let stream = randomStream( 2.0, 5.0, opts1 ); -var opts2 = { +const opts2 = { 'objectMode': true }; -var iStream = inspectStream( opts2, log ); +let iStream = inspectStream( opts2, log ); // Stream pseudorandom numbers, thus progressing the underlying generator state: stream.pipe( iStream ); // Create a new PRNG stream initialized to the last state of the previous stream: -var opts3 = { +const opts3 = { 'objectMode': true, 'iter': 10, 'state': stream.state @@ -187,9 +185,9 @@ stream.pipe( iStream ); The underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var prng = stream.PRNG; +const prng = stream.PRNG; // returns ``` @@ -198,22 +196,22 @@ var prng = stream.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var seed = stream.seed; +const seed = stream.seed; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var seed = stream.seed; +const seed = stream.seed; // returns null ``` @@ -222,22 +220,22 @@ var seed = stream.seed; Length of underlying pseudorandom number generator seed. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.seedLength; +const len = stream.seedLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.seedLength; +const len = stream.seedLength; // returns null ``` @@ -246,22 +244,22 @@ var len = stream.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var state = stream.state; +const state = stream.state; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var state = stream.state; +const state = stream.state; // returns null ``` @@ -270,22 +268,22 @@ var state = stream.state; Length of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var len = stream.stateLength; +const len = stream.stateLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var len = stream.stateLength; +const len = stream.stateLength; // returns null ``` @@ -294,22 +292,22 @@ var len = stream.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var stream = randomStream( 2.0, 5.0 ); +const stream = randomStream( 2.0, 5.0 ); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns ``` If provided a PRNG for uniformly distributed numbers, this value is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var stream = randomStream( 2.0, 5.0, { +const stream = randomStream( 2.0, 5.0, { 'prng': minstd }); -var sz = stream.byteLength; +const sz = stream.byteLength; // returns null ``` @@ -320,32 +318,32 @@ var sz = stream.byteLength; Returns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [Weibull][weibull] distribution. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = randomStream.factory( opts ); +const createStream = randomStream.factory( opts ); ``` If provided distribution parameters, the returned function returns [readable streams][readable-stream] which generate pseudorandom numbers drawn from the specified distribution. ```javascript -var createStream = randomStream.factory( 2.0, 2.0 ); +const createStream = randomStream.factory( 2.0, 2.0 ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided distribution parameters, the returned function requires that distribution parameters be provided at each invocation. ```javascript -var createStream = randomStream.factory(); +const createStream = randomStream.factory(); -var stream1 = createStream( 2.0, 2.0 ); -var stream2 = createStream( 2.0, 2.0 ); +const stream1 = createStream( 2.0, 2.0 ); +const stream2 = createStream( 2.0, 2.0 ); // ... ``` @@ -358,21 +356,21 @@ The method accepts the same `options` as [`randomStream()`](#random-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = randomStream.objectMode( 2.0, 2.0, opts ); +const stream = randomStream.objectMode( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -390,11 +388,11 @@ In addition to the standard [readable stream][readable-stream] events, the follo Emitted after internally generating `siter` pseudorandom numbers. ```javascript -var opts = { +const opts = { 'siter': 10 // emit the PRNG state every 10 pseudorandom numbers }; -var stream = randomStream( 2.0, 5.0, opts ); +const stream = randomStream( 2.0, 5.0, opts ); stream.on( 'state', onState ); @@ -430,24 +428,24 @@ function onState( state ) { ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randomStream = require( '@stdlib/random/streams/weibull' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randomStream = require( '@stdlib/random/streams/weibull' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = randomStream( 2.0, 2.0, opts ); +const stream = randomStream( 2.0, 2.0, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/random/strided/README.md b/lib/node_modules/@stdlib/random/strided/README.md index b0d649e0d39a..da3778059677 100644 --- a/lib/node_modules/@stdlib/random/strided/README.md +++ b/lib/node_modules/@stdlib/random/strided/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/strided' ); +const ns = require( '@stdlib/random/strided' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/strided' ); Namespace containing strided array pseudorandom number generator (PRNG) functions. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -86,8 +86,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/random/strided' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/random/strided' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/random/strided/arcsine/README.md b/lib/node_modules/@stdlib/random/strided/arcsine/README.md index d712bed380be..c44ebe10efd3 100644 --- a/lib/node_modules/@stdlib/random/strided/arcsine/README.md +++ b/lib/node_modules/@stdlib/random/strided/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arcsine = require( '@stdlib/random/strided/arcsine' ); +const arcsine = require( '@stdlib/random/strided/arcsine' ); ``` #### arcsine( N, a, sa, b, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var arcsine = require( '@stdlib/random/strided/arcsine' ); Fills a strided array with pseudorandom numbers drawn from an [arcsine][@stdlib/random/base/arcsine] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; arcsine( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var a0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var b0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const a0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const b0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var a1 = new Float64Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var b1 = new Float64Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const a1 = new Float64Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const b1 = new Float64Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: arcsine( out.length, a1, -2, b1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from an [arcsine][@stdlib/random/base/arcsine] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; arcsine.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `arcsine()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var arcsine = require( '@stdlib/random/strided/arcsine' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const arcsine = require( '@stdlib/random/strided/arcsine' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: arcsine( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: arcsine( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/bernoulli/README.md b/lib/node_modules/@stdlib/random/strided/bernoulli/README.md index f144cd58fabf..ef493b9aa739 100644 --- a/lib/node_modules/@stdlib/random/strided/bernoulli/README.md +++ b/lib/node_modules/@stdlib/random/strided/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var bernoulli = require( '@stdlib/random/strided/bernoulli' ); +const bernoulli = require( '@stdlib/random/strided/bernoulli' ); ``` #### bernoulli( N, p, sp, out, so ) @@ -35,10 +35,10 @@ var bernoulli = require( '@stdlib/random/strided/bernoulli' ); Fills a strided array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: bernoulli( out.length, [ 0.5 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bernoulli( 3, [ 0.5 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var p0 = new Float64Array( [ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ] ); +const p0 = new Float64Array( [ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ] ); // Create offset view: -var p1 = new Float64Array( p0.buffer, p0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const p1 = new Float64Array( p0.buffer, p0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: bernoulli( out.length, p1, -1, out, 1 ); @@ -85,10 +85,10 @@ bernoulli( out.length, p1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; bernoulli.ndarray( 3, [ 0.5 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ bernoulli.ndarray( 3, [ 0.5 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = bernoulli.factory(); +const random = bernoulli.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 0.5 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = bernoulli.factory( opts ); +const random = bernoulli.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 0.5 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = bernoulli.factory( opts ); +const random = bernoulli.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 0.5 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 0.5 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = bernoulli.PRNG; +const prng = bernoulli.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = bernoulli.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = bernoulli.seed; +const seed = bernoulli.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory({ +const random = bernoulli.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = bernoulli.seedLength; +const len = bernoulli.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory({ +const random = bernoulli.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = bernoulli.state; +const state = bernoulli.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory({ +const random = bernoulli.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = bernoulli.stateLength; +const len = bernoulli.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory({ +const random = bernoulli.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = bernoulli.byteLength; +const sz = bernoulli.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = bernoulli.factory({ +const random = bernoulli.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var bernoulli = require( '@stdlib/random/strided/bernoulli' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const bernoulli = require( '@stdlib/random/strided/bernoulli' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = bernoulli.factory( opts ); +const rand1 = bernoulli.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 0.5 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = bernoulli.factory( opts ); +const rand2 = bernoulli.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 0.5 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/beta/README.md b/lib/node_modules/@stdlib/random/strided/beta/README.md index 37befbac91e9..ec646e85f0d6 100644 --- a/lib/node_modules/@stdlib/random/strided/beta/README.md +++ b/lib/node_modules/@stdlib/random/strided/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var beta = require( '@stdlib/random/strided/beta' ); +const beta = require( '@stdlib/random/strided/beta' ); ``` #### beta( N, alpha, sa, beta, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var beta = require( '@stdlib/random/strided/beta' ); Fills a strided array with pseudorandom numbers drawn from a [beta][@stdlib/random/base/beta] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; beta( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: beta( out.length, alpha1, -2, beta1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [beta][@stdlib/random/base/beta] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; beta.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `beta()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var beta = require( '@stdlib/random/strided/beta' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const beta = require( '@stdlib/random/strided/beta' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: beta( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: beta( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/betaprime/README.md b/lib/node_modules/@stdlib/random/strided/betaprime/README.md index 4f232d13c0b8..2c8f9e1006c8 100644 --- a/lib/node_modules/@stdlib/random/strided/betaprime/README.md +++ b/lib/node_modules/@stdlib/random/strided/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var betaprime = require( '@stdlib/random/strided/betaprime' ); +const betaprime = require( '@stdlib/random/strided/betaprime' ); ``` #### betaprime( N, alpha, sa, beta, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var betaprime = require( '@stdlib/random/strided/betaprime' ); Fills a strided array with pseudorandom numbers drawn from a [beta prime][@stdlib/random/base/betaprime] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; betaprime( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: betaprime( out.length, alpha1, -2, beta1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [beta prime][@stdlib/random/base/betaprime] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; betaprime.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `betaprime()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var betaprime = require( '@stdlib/random/strided/betaprime' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const betaprime = require( '@stdlib/random/strided/betaprime' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: betaprime( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: betaprime( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/chi/README.md b/lib/node_modules/@stdlib/random/strided/chi/README.md index 1557eebbc486..4692395bfb41 100644 --- a/lib/node_modules/@stdlib/random/strided/chi/README.md +++ b/lib/node_modules/@stdlib/random/strided/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi = require( '@stdlib/random/strided/chi' ); +const chi = require( '@stdlib/random/strided/chi' ); ``` #### chi( N, k, sk, out, so ) @@ -35,10 +35,10 @@ var chi = require( '@stdlib/random/strided/chi' ); Fills a strided array with pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: chi( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; chi( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var k0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const k0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: chi( out.length, k1, -1, out, 1 ); @@ -85,10 +85,10 @@ chi( out.length, k1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: chi.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; chi.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ chi.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [chi][@stdlib/random/base/chi] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = chi.factory(); +const random = chi.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = chi.factory( opts ); +const random = chi.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = chi.factory( opts ); +const random = chi.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = chi.PRNG; +const prng = chi.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = chi.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = chi.seed; +const seed = chi.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory({ +const random = chi.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = chi.seedLength; +const len = chi.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory({ +const random = chi.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = chi.state; +const state = chi.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory({ +const random = chi.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = chi.stateLength; +const len = chi.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory({ +const random = chi.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = chi.byteLength; +const sz = chi.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chi.factory({ +const random = chi.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var chi = require( '@stdlib/random/strided/chi' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const chi = require( '@stdlib/random/strided/chi' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = chi.factory( opts ); +const rand1 = chi.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = chi.factory( opts ); +const rand2 = chi.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/chisquare/README.md b/lib/node_modules/@stdlib/random/strided/chisquare/README.md index 2b86d022c6b4..9ba6f967f36c 100644 --- a/lib/node_modules/@stdlib/random/strided/chisquare/README.md +++ b/lib/node_modules/@stdlib/random/strided/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chisquare = require( '@stdlib/random/strided/chisquare' ); +const chisquare = require( '@stdlib/random/strided/chisquare' ); ``` #### chisquare( N, k, sk, out, so ) @@ -35,10 +35,10 @@ var chisquare = require( '@stdlib/random/strided/chisquare' ); Fills a strided array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: chisquare( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; chisquare( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var k0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const k0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: chisquare( out.length, k1, -1, out, 1 ); @@ -85,10 +85,10 @@ chisquare( out.length, k1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; chisquare.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ chisquare.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = chisquare.factory(); +const random = chisquare.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = chisquare.factory( opts ); +const random = chisquare.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = chisquare.factory( opts ); +const random = chisquare.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = chisquare.PRNG; +const prng = chisquare.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = chisquare.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = chisquare.seed; +const seed = chisquare.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory({ +const random = chisquare.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = chisquare.seedLength; +const len = chisquare.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory({ +const random = chisquare.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = chisquare.state; +const state = chisquare.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory({ +const random = chisquare.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = chisquare.stateLength; +const len = chisquare.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory({ +const random = chisquare.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = chisquare.byteLength; +const sz = chisquare.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = chisquare.factory({ +const random = chisquare.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var chisquare = require( '@stdlib/random/strided/chisquare' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const chisquare = require( '@stdlib/random/strided/chisquare' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = chisquare.factory( opts ); +const rand1 = chisquare.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = chisquare.factory( opts ); +const rand2 = chisquare.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/cosine/README.md b/lib/node_modules/@stdlib/random/strided/cosine/README.md index 8801a08e1865..bb72afdeee4c 100644 --- a/lib/node_modules/@stdlib/random/strided/cosine/README.md +++ b/lib/node_modules/@stdlib/random/strided/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosine = require( '@stdlib/random/strided/cosine' ); +const cosine = require( '@stdlib/random/strided/cosine' ); ``` #### cosine( N, mu, sm, s, ss, out, so\[, options] ) @@ -35,10 +35,10 @@ var cosine = require( '@stdlib/random/strided/cosine' ); Fills a strided array with pseudorandom numbers drawn from a [raised cosine][@stdlib/random/base/cosine] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosine( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var s0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const s0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var s1 = new Float64Array( s0.buffer, s0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const s1 = new Float64Array( s0.buffer, s0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: cosine( out.length, mu1, -2, s1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [raised cosine][@stdlib/random/base/cosine] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cosine.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `cosine()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var cosine = require( '@stdlib/random/strided/cosine' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const cosine = require( '@stdlib/random/strided/cosine' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: cosine( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: cosine( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/discrete-uniform/README.md b/lib/node_modules/@stdlib/random/strided/discrete-uniform/README.md index 038328b7d2ed..1fdf36916944 100644 --- a/lib/node_modules/@stdlib/random/strided/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/random/strided/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' ); +const discreteUniform = require( '@stdlib/random/strided/discrete-uniform' ); ``` #### discreteUniform( N, a, sa, b, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' ); Fills a strided array with pseudorandom numbers drawn from a [discrete uniform][@stdlib/random/base/uniform] distribution. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Create an array: -var out = new Int32Array( 10 ); +const out = new Int32Array( 10 ); // Fill the array with pseudorandom numbers: discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0, 0, 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; discreteUniform( 3, [ -10 ], 0, [ 10 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Initial arrays... -var a0 = new Int32Array( [ -10, -10, -10, 0, 0, 0 ] ); -var b0 = new Int32Array( [ 10, 10, 10, 10, 10, 10 ] ); +const a0 = new Int32Array( [ -10, -10, -10, 0, 0, 0 ] ); +const b0 = new Int32Array( [ 10, 10, 10, 10, 10, 10 ] ); // Create offset views... -var a1 = new Int32Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var b1 = new Int32Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const a1 = new Int32Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const b1 = new Int32Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Int32Array( 3 ); +const out = new Int32Array( 3 ); // Fill the output array: discreteUniform( out.length, a1, -2, b1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Int32Array = require( '@stdlib/array/int32' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd }; -var out = new Int32Array( 10 ); +const out = new Int32Array( 10 ); discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Int32Array( 10 ); +const out = new Int32Array( 10 ); discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [discrete uniform][@stdlib/random/base/uniform] distribution using alternative indexing semantics. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); // Create an array: -var out = new Int32Array( 10 ); +const out = new Int32Array( 10 ); // Fill the array with pseudorandom numbers: discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0, 0, 0, 0, 0, 0 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; discreteUniform.ndarray( 3, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `discreteUniform ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const discreteUniform = require( '@stdlib/random/strided/discrete-uniform' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'int32' ); +const x1 = zeros( 10, 'int32' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: discreteUniform( x1.length, [ -10 ], 0, [ 10 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: discreteUniform( x2.length, [ -10 ], 0, [ 10 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/exponential/README.md b/lib/node_modules/@stdlib/random/strided/exponential/README.md index bceeda602f53..0471fdb8093a 100644 --- a/lib/node_modules/@stdlib/random/strided/exponential/README.md +++ b/lib/node_modules/@stdlib/random/strided/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponential = require( '@stdlib/random/strided/exponential' ); +const exponential = require( '@stdlib/random/strided/exponential' ); ``` #### exponential( N, lambda, sl, out, so ) @@ -35,10 +35,10 @@ var exponential = require( '@stdlib/random/strided/exponential' ); Fills a strided array with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: exponential( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; exponential( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var lambda0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const lambda0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: exponential( out.length, lambda1, -1, out, 1 ); @@ -85,10 +85,10 @@ exponential( out.length, lambda1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; exponential.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ exponential.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = exponential.factory(); +const random = exponential.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = exponential.factory( opts ); +const random = exponential.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = exponential.factory( opts ); +const random = exponential.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = exponential.PRNG; +const prng = exponential.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = exponential.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = exponential.seed; +const seed = exponential.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = exponential.seedLength; +const len = exponential.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = exponential.state; +const state = exponential.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = exponential.stateLength; +const len = exponential.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = exponential.byteLength; +const sz = exponential.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = exponential.factory({ +const random = exponential.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var exponential = require( '@stdlib/random/strided/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const exponential = require( '@stdlib/random/strided/exponential' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = exponential.factory( opts ); +const rand1 = exponential.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = exponential.factory( opts ); +const rand2 = exponential.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/gamma/README.md b/lib/node_modules/@stdlib/random/strided/gamma/README.md index 5ea03bb8bc02..0e591a9aef10 100644 --- a/lib/node_modules/@stdlib/random/strided/gamma/README.md +++ b/lib/node_modules/@stdlib/random/strided/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gamma = require( '@stdlib/random/strided/gamma' ); +const gamma = require( '@stdlib/random/strided/gamma' ); ``` #### gamma( N, alpha, sa, beta, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var gamma = require( '@stdlib/random/strided/gamma' ); Fills a strided array with pseudorandom numbers drawn from a [gamma][@stdlib/random/base/gamma] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; gamma( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: gamma( out.length, alpha1, -2, beta1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [gamma][@stdlib/random/base/gamma] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; gamma.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `gamma()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var gamma = require( '@stdlib/random/strided/gamma' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const gamma = require( '@stdlib/random/strided/gamma' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: gamma( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: gamma( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/geometric/README.md b/lib/node_modules/@stdlib/random/strided/geometric/README.md index 6ee1718603c2..f7ff28686f86 100644 --- a/lib/node_modules/@stdlib/random/strided/geometric/README.md +++ b/lib/node_modules/@stdlib/random/strided/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var geometric = require( '@stdlib/random/strided/geometric' ); +const geometric = require( '@stdlib/random/strided/geometric' ); ``` #### geometric( N, p, sp, out, so ) @@ -35,10 +35,10 @@ var geometric = require( '@stdlib/random/strided/geometric' ); Fills a strided array with pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: geometric( out.length, [ 0.01 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; geometric( 3, [ 0.01 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var p0 = new Float64Array( [ 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ] ); +const p0 = new Float64Array( [ 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ] ); // Create offset view: -var p1 = new Float64Array( p0.buffer, p0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const p1 = new Float64Array( p0.buffer, p0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: geometric( out.length, p1, -1, out, 1 ); @@ -85,10 +85,10 @@ geometric( out.length, p1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: geometric.ndarray( out.length, [ 0.01 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; geometric.ndarray( 3, [ 0.01 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ geometric.ndarray( 3, [ 0.01 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = geometric.factory(); +const random = geometric.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 0.01 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = geometric.factory( opts ); +const random = geometric.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 0.01 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = geometric.factory( opts ); +const random = geometric.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 0.01 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 0.01 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = geometric.PRNG; +const prng = geometric.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = geometric.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = geometric.seed; +const seed = geometric.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory({ +const random = geometric.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = geometric.seedLength; +const len = geometric.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory({ +const random = geometric.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = geometric.state; +const state = geometric.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory({ +const random = geometric.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = geometric.stateLength; +const len = geometric.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory({ +const random = geometric.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = geometric.byteLength; +const sz = geometric.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = geometric.factory({ +const random = geometric.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var geometric = require( '@stdlib/random/strided/geometric' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const geometric = require( '@stdlib/random/strided/geometric' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = geometric.factory( opts ); +const rand1 = geometric.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 0.01 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = geometric.factory( opts ); +const rand2 = geometric.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 0.01 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/invgamma/README.md b/lib/node_modules/@stdlib/random/strided/invgamma/README.md index f011b1a5d3f6..0af91095644e 100644 --- a/lib/node_modules/@stdlib/random/strided/invgamma/README.md +++ b/lib/node_modules/@stdlib/random/strided/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invgamma = require( '@stdlib/random/strided/invgamma' ); +const invgamma = require( '@stdlib/random/strided/invgamma' ); ``` #### invgamma( N, alpha, sa, beta, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var invgamma = require( '@stdlib/random/strided/invgamma' ); Fills a strided array with pseudorandom numbers drawn from an [inverse gamma][@stdlib/random/base/invgamma] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; invgamma( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const alpha0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const beta0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const alpha1 = new Float64Array( alpha0.buffer, alpha0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const beta1 = new Float64Array( beta0.buffer, beta0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: invgamma( out.length, alpha1, -2, beta1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [inverse gamma][@stdlib/random/base/invgamma] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; invgamma.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `invgamma()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var invgamma = require( '@stdlib/random/strided/invgamma' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const invgamma = require( '@stdlib/random/strided/invgamma' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: invgamma( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: invgamma( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/lognormal/README.md b/lib/node_modules/@stdlib/random/strided/lognormal/README.md index 8bff3bcb7fd1..e342fee0ef89 100644 --- a/lib/node_modules/@stdlib/random/strided/lognormal/README.md +++ b/lib/node_modules/@stdlib/random/strided/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lognormal = require( '@stdlib/random/strided/lognormal' ); +const lognormal = require( '@stdlib/random/strided/lognormal' ); ``` #### lognormal( N, mu, sm, sigma, ss, out, so\[, options] ) @@ -35,10 +35,10 @@ var lognormal = require( '@stdlib/random/strided/lognormal' ); Fills a strided array with pseudorandom numbers drawn from a [lognormal][@stdlib/random/base/lognormal] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; lognormal( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var sigma0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const sigma0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: lognormal( out.length, mu1, -2, sigma1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [lognormal][@stdlib/random/base/lognormal] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; lognormal.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `lognormal()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var lognormal = require( '@stdlib/random/strided/lognormal' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const lognormal = require( '@stdlib/random/strided/lognormal' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: lognormal( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: lognormal( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/minstd-shuffle/README.md b/lib/node_modules/@stdlib/random/strided/minstd-shuffle/README.md index 9ee1d17b7bb3..9d877f935b26 100644 --- a/lib/node_modules/@stdlib/random/strided/minstd-shuffle/README.md +++ b/lib/node_modules/@stdlib/random/strided/minstd-shuffle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/strided/minstd-shuffle' ); +const minstd = require( '@stdlib/random/strided/minstd-shuffle' ); ``` #### minstd( N, out, so\[, options] ) @@ -35,10 +35,10 @@ var minstd = require( '@stdlib/random/strided/minstd-shuffle' ); Fills a strided array with pseudorandom integers between `1` and `2147483646`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd( out.length, out, 1 ); @@ -53,7 +53,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; minstd( 3, out, 2 ); ``` @@ -63,13 +63,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var out0 = new Float64Array( 6 ); +const out0 = new Float64Array( 6 ); // Create offset views: -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill the output array: minstd( out1.length, out1, 1 ); @@ -84,13 +84,13 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); minstd( out.length, out, 1, opts ); ``` @@ -99,10 +99,10 @@ minstd( out.length, out, 1, opts ); Fills a strided array with pseudorandom integers between `1` and `2147483646` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.ndarray( out.length, out, 1, 0 ); @@ -115,7 +115,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; minstd.ndarray( 3, out, 2, 1 ); ``` @@ -127,10 +127,10 @@ The function accepts the same `options` as documented above for `minstd()`. Fills a strided array with pseudorandom numbers between `0` and `1`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.normalized( out.length, out, 1 ); @@ -149,10 +149,10 @@ The function accepts the same `options` as documented above for `minstd()`. Fills a strided array with pseudorandom numbers between `0` and `1` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.normalized.ndarray( out.length, out, 1, 0 ); @@ -186,27 +186,27 @@ The function accepts the same `options` as documented above for `minstd()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var minstd = require( '@stdlib/random/strided/minstd-shuffle' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const minstd = require( '@stdlib/random/strided/minstd-shuffle' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: minstd.normalized( x1.length, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: minstd.normalized( x2.length, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/minstd/README.md b/lib/node_modules/@stdlib/random/strided/minstd/README.md index 66efe28f0888..4ec2efa6b06d 100644 --- a/lib/node_modules/@stdlib/random/strided/minstd/README.md +++ b/lib/node_modules/@stdlib/random/strided/minstd/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minstd = require( '@stdlib/random/strided/minstd' ); +const minstd = require( '@stdlib/random/strided/minstd' ); ``` #### minstd( N, out, so\[, options] ) @@ -35,10 +35,10 @@ var minstd = require( '@stdlib/random/strided/minstd' ); Fills a strided array with pseudorandom integers between `1` and `2147483646`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd( out.length, out, 1 ); @@ -53,7 +53,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; minstd( 3, out, 2 ); ``` @@ -63,13 +63,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var out0 = new Float64Array( 6 ); +const out0 = new Float64Array( 6 ); // Create offset views: -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill the output array: minstd( out1.length, out1, 1 ); @@ -84,13 +84,13 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); minstd( out.length, out, 1, opts ); ``` @@ -99,10 +99,10 @@ minstd( out.length, out, 1, opts ); Fills a strided array with pseudorandom integers between `1` and `2147483646` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.ndarray( out.length, out, 1, 0 ); @@ -115,7 +115,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; minstd.ndarray( 3, out, 2, 1 ); ``` @@ -127,10 +127,10 @@ The function accepts the same `options` as documented above for `minstd()`. Fills a strided array with pseudorandom numbers between `0` and `1`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.normalized( out.length, out, 1 ); @@ -149,10 +149,10 @@ The function accepts the same `options` as documented above for `minstd()`. Fills a strided array with pseudorandom numbers between `0` and `1` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: minstd.normalized.ndarray( out.length, out, 1, 0 ); @@ -186,27 +186,27 @@ The function accepts the same `options` as documented above for `minstd()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var minstd = require( '@stdlib/random/strided/minstd' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const minstd = require( '@stdlib/random/strided/minstd' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: minstd.normalized( x1.length, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: minstd.normalized( x2.length, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/mt19937/README.md b/lib/node_modules/@stdlib/random/strided/mt19937/README.md index b04911e4f48f..b888a212471c 100644 --- a/lib/node_modules/@stdlib/random/strided/mt19937/README.md +++ b/lib/node_modules/@stdlib/random/strided/mt19937/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var mt19937 = require( '@stdlib/random/strided/mt19937' ); +const mt19937 = require( '@stdlib/random/strided/mt19937' ); ``` #### mt19937( N, out, so\[, options] ) @@ -35,10 +35,10 @@ var mt19937 = require( '@stdlib/random/strided/mt19937' ); Fills a strided array with pseudorandom integers between `0` and `4294967295`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: mt19937( out.length, out, 1 ); @@ -53,7 +53,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mt19937( 3, out, 2 ); ``` @@ -63,13 +63,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var out0 = new Float64Array( 6 ); +const out0 = new Float64Array( 6 ); // Create offset views: -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill the output array: mt19937( out1.length, out1, 1 ); @@ -84,13 +84,13 @@ The function accepts the following `options`: To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); mt19937( out.length, out, 1, opts ); ``` @@ -99,10 +99,10 @@ mt19937( out.length, out, 1, opts ); Fills a strided array with pseudorandom integers between `0` and `4294967295` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: mt19937.ndarray( out.length, out, 1, 0 ); @@ -115,7 +115,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mt19937.ndarray( 3, out, 2, 1 ); ``` @@ -127,10 +127,10 @@ The function accepts the same `options` as documented above for `mt19937()`. Fills a strided array with pseudorandom numbers between `0` and `1`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: mt19937.normalized( out.length, out, 1 ); @@ -149,10 +149,10 @@ The function accepts the same `options` as documented above for `mt19937()`. Fills a strided array with pseudorandom numbers between `0` and `1` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: mt19937.normalized.ndarray( out.length, out, 1, 0 ); @@ -186,27 +186,27 @@ The function accepts the same `options` as documented above for `mt19937()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var mt19937 = require( '@stdlib/random/strided/mt19937' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const mt19937 = require( '@stdlib/random/strided/mt19937' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: mt19937.normalized( x1.length, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: mt19937.normalized( x2.length, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/normal/README.md b/lib/node_modules/@stdlib/random/strided/normal/README.md index 43d963d1fc29..67b9bd069ac9 100644 --- a/lib/node_modules/@stdlib/random/strided/normal/README.md +++ b/lib/node_modules/@stdlib/random/strided/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normal = require( '@stdlib/random/strided/normal' ); +const normal = require( '@stdlib/random/strided/normal' ); ``` #### normal( N, mu, sm, sigma, ss, out, so\[, options] ) @@ -35,10 +35,10 @@ var normal = require( '@stdlib/random/strided/normal' ); Fills a strided array with pseudorandom numbers drawn from a [normal][@stdlib/random/base/normal] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; normal( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var sigma0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const mu0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const sigma0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const mu1 = new Float64Array( mu0.buffer, mu0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: normal( out.length, mu1, -2, sigma1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [normal][@stdlib/random/base/normal] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; normal.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `normal()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var normal = require( '@stdlib/random/strided/normal' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const normal = require( '@stdlib/random/strided/normal' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: normal( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: normal( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/poisson/README.md b/lib/node_modules/@stdlib/random/strided/poisson/README.md index 2cfd51818363..3a5da6d2eb85 100644 --- a/lib/node_modules/@stdlib/random/strided/poisson/README.md +++ b/lib/node_modules/@stdlib/random/strided/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var poisson = require( '@stdlib/random/strided/poisson' ); +const poisson = require( '@stdlib/random/strided/poisson' ); ``` #### poisson( N, lambda, sl, out, so ) @@ -35,10 +35,10 @@ var poisson = require( '@stdlib/random/strided/poisson' ); Fills a strided array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: poisson( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; poisson( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var lambda0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const lambda0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: poisson( out.length, lambda1, -1, out, 1 ); @@ -85,10 +85,10 @@ poisson( out.length, lambda1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; poisson.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ poisson.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = poisson.factory(); +const random = poisson.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = poisson.factory( opts ); +const random = poisson.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = poisson.factory( opts ); +const random = poisson.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = poisson.PRNG; +const prng = poisson.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = poisson.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = poisson.seed; +const seed = poisson.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory({ +const random = poisson.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = poisson.seedLength; +const len = poisson.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory({ +const random = poisson.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = poisson.state; +const state = poisson.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory({ +const random = poisson.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = poisson.stateLength; +const len = poisson.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory({ +const random = poisson.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = poisson.byteLength; +const sz = poisson.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = poisson.factory({ +const random = poisson.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var poisson = require( '@stdlib/random/strided/poisson' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const poisson = require( '@stdlib/random/strided/poisson' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = poisson.factory( opts ); +const rand1 = poisson.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = poisson.factory( opts ); +const rand2 = poisson.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/randu/README.md b/lib/node_modules/@stdlib/random/strided/randu/README.md index 3fcf0a11f91a..166bd0923acb 100644 --- a/lib/node_modules/@stdlib/random/strided/randu/README.md +++ b/lib/node_modules/@stdlib/random/strided/randu/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var randu = require( '@stdlib/random/strided/randu' ); +const randu = require( '@stdlib/random/strided/randu' ); ``` #### randu( N, out, so\[, options] ) @@ -35,10 +35,10 @@ var randu = require( '@stdlib/random/strided/randu' ); Fills a strided array with [uniformly][@stdlib/random/base/randu] distributed pseudorandom numbers between `0` and `1`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: randu( out.length, out, 1 ); @@ -53,7 +53,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; randu( 3, out, 2 ); ``` @@ -63,13 +63,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var out0 = new Float64Array( 6 ); +const out0 = new Float64Array( 6 ); // Create offset views: -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Fill the output array: randu( out1.length, out1, 1 ); @@ -94,26 +94,26 @@ The function accepts the following `options`: By default, the underlying pseudorandom number generator is [`mt19937`][@stdlib/random/base/mt19937]. To use a different PRNG, set the `name` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'name': 'minstd-shuffle' }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); randu( out.length, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); randu( out.length, out, 1, opts ); ``` @@ -122,10 +122,10 @@ randu( out.length, out, 1, opts ); Fills a strided array with [uniformly][@stdlib/random/base/randu] distributed pseudorandom numbers between `0` and `1` using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: randu.ndarray( out.length, out, 1, 0 ); @@ -138,7 +138,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; randu.ndarray( 3, out, 2, 1 ); ``` @@ -167,27 +167,27 @@ The function accepts the same `options` as documented above for `randu()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var randu = require( '@stdlib/random/strided/randu' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const randu = require( '@stdlib/random/strided/randu' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: randu( x1.length, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: randu( x2.length, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/rayleigh/README.md b/lib/node_modules/@stdlib/random/strided/rayleigh/README.md index b8db84c6581d..26e57fd3788d 100644 --- a/lib/node_modules/@stdlib/random/strided/rayleigh/README.md +++ b/lib/node_modules/@stdlib/random/strided/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rayleigh = require( '@stdlib/random/strided/rayleigh' ); +const rayleigh = require( '@stdlib/random/strided/rayleigh' ); ``` #### rayleigh( N, sigma, ss, out, so ) @@ -35,10 +35,10 @@ var rayleigh = require( '@stdlib/random/strided/rayleigh' ); Fills a strided array with pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: rayleigh( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; rayleigh( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var sigma0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const sigma0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const sigma1 = new Float64Array( sigma0.buffer, sigma0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: rayleigh( out.length, sigma1, -1, out, 1 ); @@ -85,10 +85,10 @@ rayleigh( out.length, sigma1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: rayleigh.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; rayleigh.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ rayleigh.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Rayleigh][@stdlib/random/base/rayleigh] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = rayleigh.factory(); +const random = rayleigh.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = rayleigh.factory( opts ); +const random = rayleigh.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = rayleigh.factory( opts ); +const random = rayleigh.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = rayleigh.PRNG; +const prng = rayleigh.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = rayleigh.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = rayleigh.seed; +const seed = rayleigh.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory({ +const random = rayleigh.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = rayleigh.seedLength; +const len = rayleigh.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory({ +const random = rayleigh.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = rayleigh.state; +const state = rayleigh.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory({ +const random = rayleigh.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = rayleigh.stateLength; +const len = rayleigh.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory({ +const random = rayleigh.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = rayleigh.byteLength; +const sz = rayleigh.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = rayleigh.factory({ +const random = rayleigh.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var rayleigh = require( '@stdlib/random/strided/rayleigh' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const rayleigh = require( '@stdlib/random/strided/rayleigh' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = rayleigh.factory( opts ); +const rand1 = rayleigh.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = rayleigh.factory( opts ); +const rand2 = rayleigh.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/t/README.md b/lib/node_modules/@stdlib/random/strided/t/README.md index 205ef64b69ac..e7f29fee5c11 100644 --- a/lib/node_modules/@stdlib/random/strided/t/README.md +++ b/lib/node_modules/@stdlib/random/strided/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var t = require( '@stdlib/random/strided/t' ); +const t = require( '@stdlib/random/strided/t' ); ``` #### t( N, v, sv, out, so ) @@ -35,10 +35,10 @@ var t = require( '@stdlib/random/strided/t' ); Fills a strided array with pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: t( out.length, [ 2.0 ], 0, out, 1 ); @@ -55,7 +55,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; t( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -65,16 +65,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial array: -var v0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const v0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); // Create offset view: -var v1 = new Float64Array( v0.buffer, v0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const v1 = new Float64Array( v0.buffer, v0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: t( out.length, v1, -1, out, 1 ); @@ -85,10 +85,10 @@ t( out.length, v1, -1, out, 1 ); Fills a strided array with pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: t.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); @@ -102,7 +102,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; t.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -112,13 +112,13 @@ t.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Student's t][@stdlib/random/base/t]-distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var random = t.factory(); +const random = t.factory(); // returns // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: random( out.length, [ 2.0 ], 0, out, 1 ); @@ -134,29 +134,29 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = t.factory( opts ); +const random = t.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var random = t.factory( opts ); +const random = t.factory( opts ); -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -167,7 +167,7 @@ random( out.length, [ 2.0 ], 0, out, 1 ); The underlying pseudorandom number generator. ```javascript -var prng = t.PRNG; +const prng = t.PRNG; // returns ``` @@ -176,21 +176,21 @@ var prng = t.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var seed = t.seed; +const seed = t.seed; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory({ +const random = t.factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -199,21 +199,21 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var len = t.seedLength; +const len = t.seedLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory({ +const random = t.factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -222,21 +222,21 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var state = t.state; +const state = t.state; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory({ +const random = t.factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -245,21 +245,21 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var len = t.stateLength; +const len = t.stateLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory({ +const random = t.factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -268,21 +268,21 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var sz = t.byteLength; +const sz = t.byteLength; // returns ``` If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var random = t.factory({ +const random = t.factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -312,37 +312,37 @@ var sz = random.byteLength; ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var t = require( '@stdlib/random/strided/t' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const t = require( '@stdlib/random/strided/t' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a seeded PRNG: -var rand1 = t.factory( opts ); +const rand1 = t.factory( opts ); // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = t.factory( opts ); +const rand2 = t.factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/tools/README.md b/lib/node_modules/@stdlib/random/strided/tools/README.md index ca598042095d..2136c569d62b 100644 --- a/lib/node_modules/@stdlib/random/strided/tools/README.md +++ b/lib/node_modules/@stdlib/random/strided/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/random/strided/tools' ); +const ns = require( '@stdlib/random/strided/tools' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/random/strided/tools' ); Namespace containing strided array pseudorandom number generator (PRNG) function tools. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/random/strided/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/random/strided/tools' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/random/strided/tools/binary-factory/README.md b/lib/node_modules/@stdlib/random/strided/tools/binary-factory/README.md index 981132e24179..8e8540759f19 100644 --- a/lib/node_modules/@stdlib/random/strided/tools/binary-factory/README.md +++ b/lib/node_modules/@stdlib/random/strided/tools/binary-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binaryFactory = require( '@stdlib/random/strided/tools/binary-factory' ); +const binaryFactory = require( '@stdlib/random/strided/tools/binary-factory' ); ``` #### binaryFactory( prng ) @@ -35,9 +35,9 @@ var binaryFactory = require( '@stdlib/random/strided/tools/binary-factory' ); Returns a factory function for filling strided arrays with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns ``` @@ -52,12 +52,12 @@ The function has the following parameters: Returns a function for filling strided arrays with pseudorandom values drawn from a binary PRNG. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -75,41 +75,41 @@ The function supports the following options: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var opts = { +const opts = { 'seed': 12345 }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); ``` @@ -120,19 +120,19 @@ random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); Fills a strided array with pseudorandom values drawn from a binary PRNG. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); +const v = random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); // returns ``` @@ -149,16 +149,16 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -168,25 +168,25 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns // Initial arrays: -var param1 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); -var param2 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const param1 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const param2 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views: -var view1 = new Float64Array( param1.buffer, param1.BYTES_PER_ELEMENT*3 ); // start at 4th element -var view2 = new Float64Array( param2.buffer, param2.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const view1 = new Float64Array( param1.buffer, param1.BYTES_PER_ELEMENT*3 ); // start at 4th element +const view2 = new Float64Array( param2.buffer, param2.BYTES_PER_ELEMENT*2 ); // start at 3rd element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: random( out.length, view1, -1, view2, 1, out, 1 ); @@ -197,19 +197,19 @@ random( out.length, view1, -1, view2, 1, out, 1 ); Fills a strided array with pseudorandom values drawn from a binary PRNG using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arcsine = require( '@stdlib/random/base/arcsine' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); +const v = random.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); // returns ``` @@ -222,15 +222,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -242,15 +242,15 @@ random.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); The underlying pseudorandom number generator. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -259,33 +259,33 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -294,33 +294,33 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -329,33 +329,33 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -364,33 +364,33 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -399,33 +399,33 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var arcsine = require( '@stdlib/random/base/arcsine' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const arcsine = require( '@stdlib/random/base/arcsine' ); -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -448,43 +448,43 @@ var sz = random.byteLength; ```javascript -var arcsine = require( '@stdlib/random/base/arcsine' ); -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var binaryFactory = require( '@stdlib/random/strided/tools/binary-factory' ); +const arcsine = require( '@stdlib/random/base/arcsine' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const binaryFactory = require( '@stdlib/random/strided/tools/binary-factory' ); // Create a PRNG factory function: -var factory = binaryFactory( arcsine ); +const factory = binaryFactory( arcsine ); // returns // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a function for filling strided arrays: -var rand1 = factory( opts ); +const rand1 = factory( opts ); // returns // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = factory( opts ); +const rand2 = factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/tools/ternary-factory/README.md b/lib/node_modules/@stdlib/random/strided/tools/ternary-factory/README.md index 4eef0b1e6841..01cb8c656db3 100644 --- a/lib/node_modules/@stdlib/random/strided/tools/ternary-factory/README.md +++ b/lib/node_modules/@stdlib/random/strided/tools/ternary-factory/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var ternaryFactory = require( '@stdlib/random/strided/tools/ternary-factory' ); +const ternaryFactory = require( '@stdlib/random/strided/tools/ternary-factory' ); ``` #### ternaryFactory( prng ) @@ -37,9 +37,9 @@ var ternaryFactory = require( '@stdlib/random/strided/tools/ternary-factory' ); Returns a factory function for filling strided arrays with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns ``` @@ -54,12 +54,12 @@ The function has the following parameters: Returns a function for filling strided arrays with pseudorandom values drawn from a ternary PRNG. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -77,41 +77,41 @@ The function supports the following options: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var opts = { +const opts = { 'seed': 12345 }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 1 ); ``` @@ -122,19 +122,19 @@ random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 1 ); Fills a strided array with pseudorandom values drawn from a ternary PRNG. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 1 ); +const v = random( out.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 1 ); // returns ``` @@ -153,16 +153,16 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random( 3, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, out, 2 ); ``` @@ -172,27 +172,27 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns // Initial arrays: -var param1 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); -var param2 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); -var param3 = new Float64Array( [ 3.0, 3.0, 3.0, 3.0, 3.0, 3.0 ] ); +const param1 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); +const param2 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const param3 = new Float64Array( [ 3.0, 3.0, 3.0, 3.0, 3.0, 3.0 ] ); // Create offset views: -var view1 = new Float64Array( param1.buffer, param1.BYTES_PER_ELEMENT*3 ); // start at 4th element -var view2 = new Float64Array( param2.buffer, param2.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var view3 = new Float64Array( param3.buffer, param3.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const view1 = new Float64Array( param1.buffer, param1.BYTES_PER_ELEMENT*3 ); // start at 4th element +const view2 = new Float64Array( param2.buffer, param2.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const view3 = new Float64Array( param3.buffer, param3.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: random( out.length, view1, -1, view2, 1, view3, 1, out, 1 ); @@ -205,19 +205,19 @@ Fills a strided array with pseudorandom values drawn from a ternary PRNG using a ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var triangular = require( '@stdlib/random/base/triangular' ); +const Float64Array = require( '@stdlib/array/float64' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, [ 3.0 ], 0, 0, out, 1, 0 ); +const v = random.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, [ 3.0 ], 0, 0, out, 1, 0 ); // returns ``` @@ -231,15 +231,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, [ 3.0 ], 0, 0, out, 2, 1 ); ``` @@ -251,15 +251,15 @@ random.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, [ 3.0 ], 0, 0, out, 2, 1 ); The underlying pseudorandom number generator. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -268,33 +268,33 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -303,33 +303,33 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -338,33 +338,33 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -373,33 +373,33 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -408,33 +408,33 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var triangular = require( '@stdlib/random/base/triangular' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const triangular = require( '@stdlib/random/base/triangular' ); -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -457,43 +457,43 @@ var sz = random.byteLength; ```javascript -var triangular = require( '@stdlib/random/base/triangular' ); -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var ternaryFactory = require( '@stdlib/random/strided/tools/ternary-factory' ); +const triangular = require( '@stdlib/random/base/triangular' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const ternaryFactory = require( '@stdlib/random/strided/tools/ternary-factory' ); // Create a PRNG factory function: -var factory = ternaryFactory( triangular ); +const factory = ternaryFactory( triangular ); // returns // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a function for filling strided arrays: -var rand1 = factory( opts ); +const rand1 = factory( opts ); // returns // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = factory( opts ); +const rand2 = factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, [ 3.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/tools/unary-factory/README.md b/lib/node_modules/@stdlib/random/strided/tools/unary-factory/README.md index 5340353054b2..8a676bff00a8 100644 --- a/lib/node_modules/@stdlib/random/strided/tools/unary-factory/README.md +++ b/lib/node_modules/@stdlib/random/strided/tools/unary-factory/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' ); +const unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' ); ``` #### unaryFactory( prng ) @@ -35,9 +35,9 @@ var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' ); Returns a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns ``` @@ -52,12 +52,12 @@ The function has the following parameters: Returns a function for filling strided arrays with pseudorandom values drawn from a unary PRNG. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns ``` @@ -75,41 +75,41 @@ The function supports the following options: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var opts = { +const opts = { 'prng': minstd.normalized }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var opts = { +const opts = { 'seed': 12345 }; -var random = factory( opts ); +const random = factory( opts ); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); random( out.length, [ 2.0 ], 0, out, 1 ); ``` @@ -120,19 +120,19 @@ random( out.length, [ 2.0 ], 0, out, 1 ); Fills a strided array with pseudorandom values drawn from a unary PRNG. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random( out.length, [ 2.0 ], 0, out, 1 ); +const v = random( out.length, [ 2.0 ], 0, out, 1 ); // returns ``` @@ -147,16 +147,16 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random( 3, [ 2.0 ], 0, out, 2 ); ``` @@ -166,23 +166,23 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns // Initial array: -var param0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const param0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset view: -var param1 = new Float64Array( param0.buffer, param0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const param1 = new Float64Array( param0.buffer, param0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: random( out.length, param1, -1, out, 1 ); @@ -193,19 +193,19 @@ random( out.length, param1, -1, out, 1 ); Fills a strided array with pseudorandom values drawn from a unary PRNG using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var exponential = require( '@stdlib/random/base/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // returns -var v = random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +const v = random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); // returns ``` @@ -217,15 +217,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; random.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); ``` @@ -237,15 +237,15 @@ random.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); The underlying pseudorandom number generator. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var prng = random.PRNG; +const prng = random.PRNG; // returns ``` @@ -254,33 +254,33 @@ var prng = random.PRNG; The value used to seed the underlying pseudorandom number generator. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var seed = random.seed; +const seed = random.seed; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var seed = random.seed; +const seed = random.seed; // returns null ``` @@ -289,33 +289,33 @@ var seed = random.seed; Length of underlying pseudorandom number generator seed. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.seedLength; +const len = random.seedLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.seedLength; +const len = random.seedLength; // returns null ``` @@ -324,33 +324,33 @@ var len = random.seedLength; Writable property for getting and setting the underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var state = random.state; +const state = random.state; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var state = random.state; +const state = random.state; // returns null ``` @@ -359,33 +359,33 @@ var state = random.state; Length of underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var len = random.stateLength; +const len = random.stateLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var len = random.stateLength; +const len = random.stateLength; // returns null ``` @@ -394,33 +394,33 @@ var len = random.stateLength; Size (in bytes) of underlying pseudorandom number generator state. ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory(); +const random = factory(); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns ``` If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. ```javascript -var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; -var exponential = require( '@stdlib/random/base/exponential' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +const exponential = require( '@stdlib/random/base/exponential' ); -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns -var random = factory({ +const random = factory({ 'prng': minstd }); // returns -var sz = random.byteLength; +const sz = random.byteLength; // returns null ``` @@ -443,43 +443,43 @@ var sz = random.byteLength; ```javascript -var exponential = require( '@stdlib/random/base/exponential' ); -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' ); +const exponential = require( '@stdlib/random/base/exponential' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' ); // Create a PRNG factory function: -var factory = unaryFactory( exponential ); +const factory = unaryFactory( exponential ); // returns // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create a function for filling strided arrays: -var rand1 = factory( opts ); +const rand1 = factory( opts ); // returns // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Fill the array with pseudorandom numbers: rand1( x1.length, [ 2.0 ], 0, x1, 1 ); // Create another function for filling strided arrays: -var rand2 = factory( opts ); +const rand2 = factory( opts ); // returns // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: rand2( x2.length, [ 2.0 ], 0, x2, 1 ); // Create a list of indices: -var idx = zeroTo( x1.length, 'generic' ); +const idx = zeroTo( x1.length, 'generic' ); // Print the array contents: logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/lib/node_modules/@stdlib/random/strided/uniform/README.md b/lib/node_modules/@stdlib/random/strided/uniform/README.md index 8e8fb60bd43d..de5f238ed718 100644 --- a/lib/node_modules/@stdlib/random/strided/uniform/README.md +++ b/lib/node_modules/@stdlib/random/strided/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uniform = require( '@stdlib/random/strided/uniform' ); +const uniform = require( '@stdlib/random/strided/uniform' ); ``` #### uniform( N, a, sa, b, sb, out, so\[, options] ) @@ -35,10 +35,10 @@ var uniform = require( '@stdlib/random/strided/uniform' ); Fills a strided array with pseudorandom numbers drawn from a [continuous uniform][@stdlib/random/base/uniform] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; uniform( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var a0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var b0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const a0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const b0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var a1 = new Float64Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var b1 = new Float64Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const a1 = new Float64Array( a0.buffer, a0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const b1 = new Float64Array( b0.buffer, b0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: uniform( out.length, a1, -2, b1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [continuous uniform][@stdlib/random/base/uniform] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; uniform.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `uniform()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var uniform = require( '@stdlib/random/strided/uniform' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const uniform = require( '@stdlib/random/strided/uniform' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: uniform( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: uniform( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/random/strided/weibull/README.md b/lib/node_modules/@stdlib/random/strided/weibull/README.md index bacec20159d4..fa4f11d08504 100644 --- a/lib/node_modules/@stdlib/random/strided/weibull/README.md +++ b/lib/node_modules/@stdlib/random/strided/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var weibull = require( '@stdlib/random/strided/weibull' ); +const weibull = require( '@stdlib/random/strided/weibull' ); ``` #### weibull( N, k, sk, lambda, sl, out, so\[, options] ) @@ -35,10 +35,10 @@ var weibull = require( '@stdlib/random/strided/weibull' ); Fills a strided array with pseudorandom numbers drawn from a [Weibull][@stdlib/random/base/weibull] distribution. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 ); @@ -57,7 +57,7 @@ The function has the following parameters: The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; weibull( 3, [ 2.0 ], 0, [ 5.0 ], 0, out, 2 ); ``` @@ -67,18 +67,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var k0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); -var lambda0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); +const k0 = new Float64Array( [ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ] ); +const lambda0 = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] ); // Create offset views... -var k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element // Create an output array: -var out = new Float64Array( 3 ); +const out = new Float64Array( 3 ); // Fill the output array: weibull( out.length, k1, -2, lambda1, 1, out, 1 ); @@ -94,27 +94,27 @@ The function accepts the following `options`: To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minstd = require( '@stdlib/random/base/minstd' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minstd = require( '@stdlib/random/base/minstd' ); -var opts = { +const opts = { 'prng': minstd.normalized }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` To seed the underlying pseudorandom number generator, set the `seed` option. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var opts = { +const opts = { 'seed': 12345 }; -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); ``` @@ -123,10 +123,10 @@ weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1, opts ); Fills a strided array with pseudorandom numbers drawn from a [Weibull][@stdlib/random/base/weibull] distribution using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Create an array: -var out = new Float64Array( 10 ); +const out = new Float64Array( 10 ); // Fill the array with pseudorandom numbers: weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 ); @@ -141,7 +141,7 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, ```javascript -var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; weibull.ndarray( 3, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 2, 1 ); ``` @@ -170,27 +170,27 @@ The function accepts the same `options` as documented above for `weibull()`. ```javascript -var zeros = require( '@stdlib/array/zeros' ); -var zeroTo = require( '@stdlib/array/base/zero-to' ); -var logEach = require( '@stdlib/console/log-each' ); -var weibull = require( '@stdlib/random/strided/weibull' ); +const zeros = require( '@stdlib/array/zeros' ); +const zeroTo = require( '@stdlib/array/base/zero-to' ); +const logEach = require( '@stdlib/console/log-each' ); +const weibull = require( '@stdlib/random/strided/weibull' ); // Specify a PRNG seed: -var opts = { +const opts = { 'seed': 1234 }; // Create an array: -var x1 = zeros( 10, 'float64' ); +const x1 = zeros( 10, 'float64' ); // Create a list of indices: -var idx = zeroTo( x1.length ); +const idx = zeroTo( x1.length ); // Fill the array with pseudorandom numbers: weibull( x1.length, [ 2.0 ], 0, [ 5.0 ], 0, x1, 1, opts ); // Create a second array: -var x2 = zeros( 10, 'generic' ); +const x2 = zeros( 10, 'generic' ); // Fill the array with the same pseudorandom numbers: weibull( x2.length, [ 2.0 ], 0, [ 5.0 ], 0, x2, 1, opts ); diff --git a/lib/node_modules/@stdlib/regexp/README.md b/lib/node_modules/@stdlib/regexp/README.md index 554cbb58c70a..52f85165862b 100644 --- a/lib/node_modules/@stdlib/regexp/README.md +++ b/lib/node_modules/@stdlib/regexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var regexp = require( '@stdlib/regexp' ); +const regexp = require( '@stdlib/regexp' ); ``` #### regexp @@ -35,7 +35,7 @@ var regexp = require( '@stdlib/regexp' ); Namespace containing regular expressions. ```javascript -var re = regexp; +const re = regexp; // returns {...} ``` @@ -88,8 +88,8 @@ The following regular expressions are currently exported: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var regexp = require( '@stdlib/regexp' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const regexp = require( '@stdlib/regexp' ); console.log( objectKeys( regexp ) ); ``` diff --git a/lib/node_modules/@stdlib/regexp/basename-posix/README.md b/lib/node_modules/@stdlib/regexp/basename-posix/README.md index 3b2091f25c3e..cb1f9e67ec22 100644 --- a/lib/node_modules/@stdlib/regexp/basename-posix/README.md +++ b/lib/node_modules/@stdlib/regexp/basename-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reBasenamePosix = require( '@stdlib/regexp/basename-posix' ); +const reBasenamePosix = require( '@stdlib/regexp/basename-posix' ); ``` #### reBasenamePosix() @@ -35,8 +35,8 @@ var reBasenamePosix = require( '@stdlib/regexp/basename-posix' ); Returns a [regular expression][regexp] to capture the last part of a [POSIX][posix] path. ```javascript -var RE_BASENAME_POSIX = reBasenamePosix(); -var base = RE_BASENAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; +const RE_BASENAME_POSIX = reBasenamePosix(); +const base = RE_BASENAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; // returns 'index.js' ``` @@ -45,7 +45,7 @@ var base = RE_BASENAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; [Regular expression][regexp] to capture the last part of a [POSIX][posix] path. ```javascript -var base = reBasenamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; +const base = reBasenamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; // returns 'index.js' ``` @@ -60,10 +60,10 @@ var base = reBasenamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; ```javascript -var reBasenamePosix = require( '@stdlib/regexp/basename-posix' ); +const reBasenamePosix = require( '@stdlib/regexp/basename-posix' ); -var RE_BASENAME_POSIX = reBasenamePosix(); -var base = RE_BASENAME_POSIX.exec( 'index.js' )[ 1 ]; +const RE_BASENAME_POSIX = reBasenamePosix(); +let base = RE_BASENAME_POSIX.exec( 'index.js' )[ 1 ]; // returns 'index.js' base = RE_BASENAME_POSIX.exec( '/foo/bar/home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/basename-windows/README.md b/lib/node_modules/@stdlib/regexp/basename-windows/README.md index 1b55c07e7787..ea98053aab15 100644 --- a/lib/node_modules/@stdlib/regexp/basename-windows/README.md +++ b/lib/node_modules/@stdlib/regexp/basename-windows/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reBasenameWindows = require( '@stdlib/regexp/basename-windows' ); +const reBasenameWindows = require( '@stdlib/regexp/basename-windows' ); ``` #### reBasenameWindows() @@ -35,8 +35,8 @@ var reBasenameWindows = require( '@stdlib/regexp/basename-windows' ); Returns a [regular expression][regexp] to capture the last part of a Windows path. ```javascript -var RE = reBasenameWindows(); -var base = RE.exec( 'foo\\bar\\index.js' )[ 1 ]; +const RE = reBasenameWindows(); +const base = RE.exec( 'foo\\bar\\index.js' )[ 1 ]; // returns 'index.js' ``` @@ -45,7 +45,7 @@ var base = RE.exec( 'foo\\bar\\index.js' )[ 1 ]; [Regular expression][regexp] to capture the last part of a Windows path. ```javascript -var match = reBasenameWindows.REGEXP.exec( 'foo\\file.pdf' )[ 1 ]; +const match = reBasenameWindows.REGEXP.exec( 'foo\\file.pdf' )[ 1 ]; // returns 'file.pdf' ``` @@ -60,10 +60,10 @@ var match = reBasenameWindows.REGEXP.exec( 'foo\\file.pdf' )[ 1 ]; ```javascript -var reBasenameWindows = require( '@stdlib/regexp/basename-windows' ); +const reBasenameWindows = require( '@stdlib/regexp/basename-windows' ); -var RE_BASENAME_WINDOWS = reBasenameWindows(); -var base = RE_BASENAME_WINDOWS.exec( 'index.js' )[ 1 ]; +const RE_BASENAME_WINDOWS = reBasenameWindows(); +let base = RE_BASENAME_WINDOWS.exec( 'index.js' )[ 1 ]; // returns 'index.js' base = RE_BASENAME_WINDOWS.exec( 'C:\\foo\\bar\\home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/basename/README.md b/lib/node_modules/@stdlib/regexp/basename/README.md index c5734a3e1185..6364602b909a 100644 --- a/lib/node_modules/@stdlib/regexp/basename/README.md +++ b/lib/node_modules/@stdlib/regexp/basename/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reBasename = require( '@stdlib/regexp/basename' ); +const reBasename = require( '@stdlib/regexp/basename' ); ``` #### reBasename( \[platform] ) @@ -35,13 +35,13 @@ var reBasename = require( '@stdlib/regexp/basename' ); Returns a [regular expression][regexp] to capture the last part of a path. ```javascript -var RE = reBasename(); +let RE = reBasename(); // returns RE = reBasename( 'posix' ); // returns -var base = RE.exec( '/foo/bar/index.js' )[ 1 ]; +let base = RE.exec( '/foo/bar/index.js' )[ 1 ]; // returns 'index.js' RE = reBasename( 'win32' ); @@ -56,7 +56,7 @@ base = RE.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; [Regular expression][regexp] to capture the last part of a path. ```javascript -var bool = ( reBasename.REGEXP.toString() === reBasename().toString() ); +const bool = ( reBasename.REGEXP.toString() === reBasename().toString() ); // returns true ``` @@ -65,7 +65,7 @@ var bool = ( reBasename.REGEXP.toString() === reBasename().toString() ); [Regular expression][@stdlib/regexp/basename-posix] to capture the last part of a [POSIX][posix] path. ```javascript -var base = reBasename.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; +const base = reBasename.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; // returns 'index.js' ``` @@ -74,7 +74,7 @@ var base = reBasename.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; [Regular expression][@stdlib/regexp/basename-windows] to capture the last part of a Windows path. ```javascript -var base = reBasename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; +const base = reBasename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; // returns 'index.js' ``` @@ -99,11 +99,11 @@ var base = reBasename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; ```javascript -var reBasename = require( '@stdlib/regexp/basename' ); -var RE_BASENAME = reBasename(); +const reBasename = require( '@stdlib/regexp/basename' ); +const RE_BASENAME = reBasename(); // Assuming a POSIX platform... -var base = RE_BASENAME.exec( '/foo/bar/index.js' )[ 1 ]; +let base = RE_BASENAME.exec( '/foo/bar/index.js' )[ 1 ]; // returns 'index.js' base = reBasename.REGEXP_POSIX.exec( '/foo/bar/home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/color-hexadecimal/README.md b/lib/node_modules/@stdlib/regexp/color-hexadecimal/README.md index d22bfe801029..abbb1d437715 100644 --- a/lib/node_modules/@stdlib/regexp/color-hexadecimal/README.md +++ b/lib/node_modules/@stdlib/regexp/color-hexadecimal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reColorHexadecimal = require( '@stdlib/regexp/color-hexadecimal' ); +const reColorHexadecimal = require( '@stdlib/regexp/color-hexadecimal' ); ``` #### reColorHexadecimal( \[mode] ) @@ -35,10 +35,10 @@ var reColorHexadecimal = require( '@stdlib/regexp/color-hexadecimal' ); Returns a [regular expression][mdn-regexp] to match a full hexadecimal color. ```javascript -var RE = reColorHexadecimal(); +const RE = reColorHexadecimal(); // returns -var bool = RE.test( 'ffffff' ); +let bool = RE.test( 'ffffff' ); // returns true bool = RE.test( '000' ); @@ -48,20 +48,20 @@ bool = RE.test( '000' ); To return a [regular expression][mdn-regexp] that matches a shorthand hexadecimal color, set the `mode` argument to `shorthand`. ```javascript -var RE = reColorHexadecimal( 'shorthand' ); +const RE = reColorHexadecimal( 'shorthand' ); // returns -var bool = RE.test( '000' ); +const bool = RE.test( '000' ); // returns true ``` To return a [regular expression][mdn-regexp] that matches **either** a shorthand or a full length hexadecimal color, set the `mode` argument to `either`. ```javascript -var RE = reColorHexadecimal( 'either' ); +const RE = reColorHexadecimal( 'either' ); // returns -var bool = RE.test( '000' ); +const bool = RE.test( '000' ); // returns true ``` @@ -70,7 +70,7 @@ var bool = RE.test( '000' ); [Regular expression][mdn-regexp] to match a full length hexadecimal color. ```javascript -var bool = reColorHexadecimal.REGEXP.test( 'ffffff' ); +let bool = reColorHexadecimal.REGEXP.test( 'ffffff' ); // returns true bool = reColorHexadecimal.REGEXP.test( '000' ); @@ -82,7 +82,7 @@ bool = reColorHexadecimal.REGEXP.test( '000' ); [Regular expression][mdn-regexp] to match a shorthand hexadecimal color. ```javascript -var bool = reColorHexadecimal.REGEXP_SHORTHAND.test( 'ffffff' ); +let bool = reColorHexadecimal.REGEXP_SHORTHAND.test( 'ffffff' ); // returns false bool = reColorHexadecimal.REGEXP_SHORTHAND.test( '000' ); @@ -94,7 +94,7 @@ bool = reColorHexadecimal.REGEXP_SHORTHAND.test( '000' ); [Regular expression][mdn-regexp] to match **either** a shorthand or a full length hexadecimal color. ```javascript -var bool = reColorHexadecimal.REGEXP_EITHER.test( 'ffffff' ); +let bool = reColorHexadecimal.REGEXP_EITHER.test( 'ffffff' ); // returns true bool = reColorHexadecimal.REGEXP_EITHER.test( '000' ); @@ -112,8 +112,8 @@ bool = reColorHexadecimal.REGEXP_EITHER.test( '000' ); ```javascript -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var reColorHexadecimal = require( '@stdlib/regexp/color-hexadecimal' ); +const isString = require( '@stdlib/assert/is-string' ).isPrimitive; +const reColorHexadecimal = require( '@stdlib/regexp/color-hexadecimal' ); function isHexColor( value, mode ) { if ( !isString( value ) ) { @@ -128,7 +128,7 @@ function isHexColor( value, mode ) { return reColorHexadecimal.REGEXP.test( value ); } -var bool = isHexColor( 'ffffff', 'full' ); +let bool = isHexColor( 'ffffff', 'full' ); // returns true bool = isHexColor( '474747', 'either' ); diff --git a/lib/node_modules/@stdlib/regexp/decimal-number/README.md b/lib/node_modules/@stdlib/regexp/decimal-number/README.md index 84de1334e411..fe1fcd6ae203 100644 --- a/lib/node_modules/@stdlib/regexp/decimal-number/README.md +++ b/lib/node_modules/@stdlib/regexp/decimal-number/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reDecimalNumber = require( '@stdlib/regexp/decimal-number' ); +const reDecimalNumber = require( '@stdlib/regexp/decimal-number' ); ``` #### reDecimalNumber( \[options] ) @@ -35,9 +35,9 @@ var reDecimalNumber = require( '@stdlib/regexp/decimal-number' ); Returns a [regular expression][mdn-regexp] to match a decimal number. ```javascript -var RE_DECIMAL_NUMBER = reDecimalNumber(); +const RE_DECIMAL_NUMBER = reDecimalNumber(); -var out = RE_DECIMAL_NUMBER.test( 'foo 1.234.' ); +let out = RE_DECIMAL_NUMBER.test( 'foo 1.234.' ); // returns true out = RE_DECIMAL_NUMBER.test( '2:3' ); @@ -52,25 +52,25 @@ The function accepts an `options` object with optional properties: By default, the function returns a regular expression which does not have any flags specified. To specify [flags][mdn-regexp-flags], set the `flags` option with a list of flags (which may be in any order). ```javascript -var replace = require( '@stdlib/string/replace' ); +const replace = require( '@stdlib/string/replace' ); -var RE_DECIMAL_NUMBER = reDecimalNumber({ +const RE_DECIMAL_NUMBER = reDecimalNumber({ 'flags': 'g' }); -var str = 'beep 1.234 boop 1.234'; -var out = replace( str, RE_DECIMAL_NUMBER, '' ); +const str = 'beep 1.234 boop 1.234'; +const out = replace( str, RE_DECIMAL_NUMBER, '' ); // returns 'beep boop ' ``` By default, the function returns a regular expression which does not capture the part of a string matching the regular expression. To capture matches, set the `capture` option. ```javascript -var RE_DECIMAL_NUMBER = reDecimalNumber({ +const RE_DECIMAL_NUMBER = reDecimalNumber({ 'capture': true }); -var out = RE_DECIMAL_NUMBER.exec( 'beep 1.234 boop' ).slice(); +let out = RE_DECIMAL_NUMBER.exec( 'beep 1.234 boop' ).slice(); // returns [ '1.234', '1.234' ] out = RE_DECIMAL_NUMBER.exec( '' ); @@ -82,7 +82,7 @@ out = RE_DECIMAL_NUMBER.exec( '' ); [Regular expression][mdn-regexp] to match a decimal number. ```javascript -var bool = reDecimalNumber.REGEXP.test( '2:3' ); +const bool = reDecimalNumber.REGEXP.test( '2:3' ); // returns false ``` @@ -91,7 +91,7 @@ var bool = reDecimalNumber.REGEXP.test( '2:3' ); [Regular expression][mdn-regexp] to capture characters matching a decimal number. ```javascript -var parts = reDecimalNumber.REGEXP_CAPTURE.exec( '1.234' ); +const parts = reDecimalNumber.REGEXP_CAPTURE.exec( '1.234' ); // returns [ '1.234', '1.234' ] ``` @@ -106,14 +106,14 @@ var parts = reDecimalNumber.REGEXP_CAPTURE.exec( '1.234' ); - A leading digit is not required. ```javascript - var bool = reDecimalNumber.REGEXP.test( '.5' ); + const bool = reDecimalNumber.REGEXP.test( '.5' ); // returns true ``` - A decimal point and at least one trailing digit is required. ```javascript - var bool = reDecimalNumber.REGEXP.test( '5.' ); + const bool = reDecimalNumber.REGEXP.test( '5.' ); // returns false ``` @@ -140,11 +140,11 @@ var parts = reDecimalNumber.REGEXP_CAPTURE.exec( '1.234' ); ```javascript -var reDecimalNumber = require( '@stdlib/regexp/decimal-number' ); +const reDecimalNumber = require( '@stdlib/regexp/decimal-number' ); -var RE_DECIMAL_NUMBER = reDecimalNumber(); +const RE_DECIMAL_NUMBER = reDecimalNumber(); -var bool = RE_DECIMAL_NUMBER.test( '1.234' ); +let bool = RE_DECIMAL_NUMBER.test( '1.234' ); // returns true bool = RE_DECIMAL_NUMBER.test( 'beep 1.234' ); diff --git a/lib/node_modules/@stdlib/regexp/dirname-posix/README.md b/lib/node_modules/@stdlib/regexp/dirname-posix/README.md index 0532b62acbb0..e5e58968ce11 100644 --- a/lib/node_modules/@stdlib/regexp/dirname-posix/README.md +++ b/lib/node_modules/@stdlib/regexp/dirname-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reDirnamePosix = require( '@stdlib/regexp/dirname-posix' ); +const reDirnamePosix = require( '@stdlib/regexp/dirname-posix' ); ``` #### reDirnamePosix() @@ -35,8 +35,8 @@ var reDirnamePosix = require( '@stdlib/regexp/dirname-posix' ); Returns a [regular expression][regexp] to capture a [POSIX][posix] path [dirname][dirname]. ```javascript -var RE_DIRNAME_POSIX = reDirnamePosix(); -var dir = RE_DIRNAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; +const RE_DIRNAME_POSIX = reDirnamePosix(); +const dir = RE_DIRNAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; // returns 'foo/bar' ``` @@ -45,7 +45,7 @@ var dir = RE_DIRNAME_POSIX.exec( 'foo/bar/index.js' )[ 1 ]; [Regular expression][regexp] to capture a [POSIX][posix] path [dirname][dirname]. ```javascript -var dir = reDirnamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; +const dir = reDirnamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; // returns 'foo/bar' ``` @@ -60,12 +60,11 @@ var dir = reDirnamePosix.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]; ```javascript -var reDirnamePosix = require( '@stdlib/regexp/dirname-posix' ); +const reDirnamePosix = require( '@stdlib/regexp/dirname-posix' ); -var RE_DIRNAME_POSIX = reDirnamePosix(); -var dir; +const RE_DIRNAME_POSIX = reDirnamePosix(); -dir = RE_DIRNAME_POSIX.exec( 'index.js' )[ 1 ]; +let dir = RE_DIRNAME_POSIX.exec( 'index.js' )[ 1 ]; // returns '' dir = RE_DIRNAME_POSIX.exec( '.' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/dirname-windows/README.md b/lib/node_modules/@stdlib/regexp/dirname-windows/README.md index 708205e89e00..dadd7d4ec53a 100644 --- a/lib/node_modules/@stdlib/regexp/dirname-windows/README.md +++ b/lib/node_modules/@stdlib/regexp/dirname-windows/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reDirnameWindows = require( '@stdlib/regexp/dirname-windows' ); +const reDirnameWindows = require( '@stdlib/regexp/dirname-windows' ); ``` #### reDirnameWindows() @@ -35,8 +35,8 @@ var reDirnameWindows = require( '@stdlib/regexp/dirname-windows' ); Returns a [regular expression][regexp] to capture a Windows path [dirname][dirname]. ```javascript -var RE_DIRNAME_WINDOWS = reDirnameWindows(); -var dir = RE_DIRNAME_WINDOWS.exec( 'foo\\bar\\index.js' )[ 1 ]; +const RE_DIRNAME_WINDOWS = reDirnameWindows(); +const dir = RE_DIRNAME_WINDOWS.exec( 'foo\\bar\\index.js' )[ 1 ]; // returns 'foo\bar' ``` @@ -45,7 +45,7 @@ var dir = RE_DIRNAME_WINDOWS.exec( 'foo\\bar\\index.js' )[ 1 ]; [Regular expression][regexp] to capture a Windows path [dirname][dirname]. ```javascript -var dir = reDirnameWindows.REGEXP.exec( 'foo\\bar\\index.js' )[ 1 ]; +const dir = reDirnameWindows.REGEXP.exec( 'foo\\bar\\index.js' )[ 1 ]; // returns 'foo\bar' ``` @@ -60,11 +60,11 @@ var dir = reDirnameWindows.REGEXP.exec( 'foo\\bar\\index.js' )[ 1 ]; ```javascript -var reDirnameWindows = require( '@stdlib/regexp/dirname-windows' ); +const reDirnameWindows = require( '@stdlib/regexp/dirname-windows' ); -var RE_DIRNAME_WINDOWS = reDirnameWindows(); +const RE_DIRNAME_WINDOWS = reDirnameWindows(); -var dir = RE_DIRNAME_WINDOWS.exec( 'index.js' )[ 1 ]; +let dir = RE_DIRNAME_WINDOWS.exec( 'index.js' )[ 1 ]; // returns '' dir = RE_DIRNAME_WINDOWS.exec( 'C:\\foo\\bar\\home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/dirname/README.md b/lib/node_modules/@stdlib/regexp/dirname/README.md index ef484f16821e..bcc543a632c6 100644 --- a/lib/node_modules/@stdlib/regexp/dirname/README.md +++ b/lib/node_modules/@stdlib/regexp/dirname/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reDirname = require( '@stdlib/regexp/dirname' ); +const reDirname = require( '@stdlib/regexp/dirname' ); ``` #### reDirname( \[platform] ) @@ -35,13 +35,13 @@ var reDirname = require( '@stdlib/regexp/dirname' ); Returns a [regular expression][regexp] to capture a path [dirname][dirname]. ```javascript -var RE = reDirname(); +let RE = reDirname(); // returns RE = reDirname( 'posix' ); // returns -var dir = RE.exec( '/foo/bar/index.js' )[ 1 ]; +let dir = RE.exec( '/foo/bar/index.js' )[ 1 ]; // returns '/foo/bar' RE = reDirname( 'win32' ); @@ -56,7 +56,7 @@ dir = RE.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; [Regular expression][regexp] to capture a path dirname. ```javascript -var bool = ( reDirname.REGEXP.toString() === reDirname().toString() ); +const bool = ( reDirname.REGEXP.toString() === reDirname().toString() ); // returns true ``` @@ -65,7 +65,7 @@ var bool = ( reDirname.REGEXP.toString() === reDirname().toString() ); [Regular expression][@stdlib/regexp/dirname-posix] to capture a [POSIX][posix] path dirname. ```javascript -var dir = reDirname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; +const dir = reDirname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; // returns '/foo/bar' ``` @@ -74,7 +74,7 @@ var dir = reDirname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; [Regular expression][@stdlib/regexp/dirname-windows] to capture a Windows path dirname. ```javascript -var dir = reDirname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; +const dir = reDirname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; // returns 'C:\foo\bar' ``` @@ -99,12 +99,11 @@ var dir = reDirname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; ```javascript -var reDirname = require( '@stdlib/regexp/dirname' ); -var RE_DIRNAME = reDirname(); -var dir; +const reDirname = require( '@stdlib/regexp/dirname' ); +const RE_DIRNAME = reDirname(); // Assuming a POSIX platform... -dir = RE_DIRNAME.exec( '/foo/bar/index.js' )[ 1 ]; +let dir = RE_DIRNAME.exec( '/foo/bar/index.js' )[ 1 ]; // returns '/foo/bar' dir = reDirname.REGEXP_POSIX.exec( '/foo/bar/home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/duration-string/README.md b/lib/node_modules/@stdlib/regexp/duration-string/README.md index ad2a7fa49337..955c212e2c80 100644 --- a/lib/node_modules/@stdlib/regexp/duration-string/README.md +++ b/lib/node_modules/@stdlib/regexp/duration-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reDurationString = require( '@stdlib/regexp/duration-string' ); +const reDurationString = require( '@stdlib/regexp/duration-string' ); ``` #### reDurationString() @@ -35,10 +35,10 @@ var reDurationString = require( '@stdlib/regexp/duration-string' ); Returns a [regular expression][mdn-regexp] to match a duration string. ```javascript -var RE_DURATION = reDurationString(); +const RE_DURATION = reDurationString(); // returns -var parts = RE_DURATION.exec( '3d2ms' ); +let parts = RE_DURATION.exec( '3d2ms' ); /* returns [ '3d2ms', @@ -74,7 +74,7 @@ parts = RE_DURATION.exec( '4h3m20s' ); [Regular expression][mdn-regexp] to match a duration string. ```javascript -var bool = reDurationString.REGEXP.test( '3d12h' ); +const bool = reDurationString.REGEXP.test( '3d12h' ); // returns true ``` @@ -117,11 +117,11 @@ var bool = reDurationString.REGEXP.test( '3d12h' ); ```javascript -var reDurationString = require( '@stdlib/regexp/duration-string' ); +const reDurationString = require( '@stdlib/regexp/duration-string' ); -var RE_DURATION = reDurationString(); +const RE_DURATION = reDurationString(); -var bool = RE_DURATION.test( '3d12h' ); +let bool = RE_DURATION.test( '3d12h' ); // returns true bool = RE_DURATION.test( '1M3S10MS' ); diff --git a/lib/node_modules/@stdlib/regexp/eol/README.md b/lib/node_modules/@stdlib/regexp/eol/README.md index 992a33a23de4..7787e2640e7a 100644 --- a/lib/node_modules/@stdlib/regexp/eol/README.md +++ b/lib/node_modules/@stdlib/regexp/eol/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reEOL = require( '@stdlib/regexp/eol' ); +const reEOL = require( '@stdlib/regexp/eol' ); ``` #### reEOL( \[options] ) @@ -35,9 +35,9 @@ var reEOL = require( '@stdlib/regexp/eol' ); Returns a [Regular expression][mdn-regexp] to match a [newline][newline] character sequence. ```javascript -var RE_EOL = reEOL(); +const RE_EOL = reEOL(); -var bool = RE_EOL.test( '\n' ); +let bool = RE_EOL.test( '\n' ); // returns true bool = RE_EOL.test( '\r\n' ); @@ -55,26 +55,26 @@ The function accepts an `options` object with optional properties: By default, the function returns a regular expression which does not have any flags specified. To specify [flags][mdn-regexp-flags], set the `flags` option with a list of flags (which may be in any order). ```javascript -var replace = require( '@stdlib/string/replace' ); +const replace = require( '@stdlib/string/replace' ); -var RE_EOL = reEOL({ +const RE_EOL = reEOL({ 'flags': 'g' }); -var str = '1\n2\n3'; -var out = replace( str, RE_EOL, '' ); +const str = '1\n2\n3'; +const out = replace( str, RE_EOL, '' ); // returns '123' ``` By default, the function returns a regular expression which does not capture the part of a string matching the regular expression. To capture matches, set the `capture` option. ```javascript -var RE_EOL = reEOL({ +const RE_EOL = reEOL({ 'capture': true }); -var str = 'beep\nboop'; -var arr = str.split( RE_EOL ); +const str = 'beep\nboop'; +const arr = str.split( RE_EOL ); // returns [ 'beep', '\n', 'boop' ] ``` @@ -83,7 +83,7 @@ var arr = str.split( RE_EOL ); [Regular expression][mdn-regexp] to match a [newline][newline] character sequence. ```javascript -var bool = reEOL.REGEXP.test( 'abc' ); +const bool = reEOL.REGEXP.test( 'abc' ); // returns false ``` @@ -92,7 +92,7 @@ var bool = reEOL.REGEXP.test( 'abc' ); [Regular expression][mdn-regexp] to capture a [newline][newline] character sequence. ```javascript -var parts = reEOL.REGEXP_CAPTURE.exec( '\n' ); +const parts = reEOL.REGEXP_CAPTURE.exec( '\n' ); // returns [ '\n', '\n' ] ``` @@ -107,13 +107,11 @@ var parts = reEOL.REGEXP_CAPTURE.exec( '\n' ); ```javascript -var reEOL = require( '@stdlib/regexp/eol' ); +const reEOL = require( '@stdlib/regexp/eol' ); -var RE_EOL = reEOL(); -var bool; -var str; +const RE_EOL = reEOL(); -bool = RE_EOL.test( '\r\n' ); +let bool = RE_EOL.test( '\r\n' ); // returns true bool = RE_EOL.test( '\n' ); @@ -128,9 +126,9 @@ bool = RE_EOL.test( '\\r\\n' ); bool = RE_EOL.test( 'beep' ); // returns false -str = 'This is\na newline\r\ndelimited string.'; +const str = 'This is\na newline\r\ndelimited string.'; -var arr = str.split( RE_EOL ); +const arr = str.split( RE_EOL ); // returns [ 'This is', 'a newline', 'delimited string.' ] ``` diff --git a/lib/node_modules/@stdlib/regexp/extended-length-path/README.md b/lib/node_modules/@stdlib/regexp/extended-length-path/README.md index de60d8e91201..11b23e07ceb9 100644 --- a/lib/node_modules/@stdlib/regexp/extended-length-path/README.md +++ b/lib/node_modules/@stdlib/regexp/extended-length-path/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' ); +const reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' ); ``` #### reExtendedLengthPath() @@ -35,8 +35,8 @@ var reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' ); Returns a [regular expression][regexp] to detect an [extended-length path][extended-length-path] (i.e., a Windows path which begins with the characters `\\?\`). ```javascript -var RE = reExtendedLengthPath(); -var bool = RE.test( '\\\\?\\C:\\foo\\bar' ); +const RE = reExtendedLengthPath(); +const bool = RE.test( '\\\\?\\C:\\foo\\bar' ); // returns true ``` @@ -51,14 +51,12 @@ var bool = RE.test( '\\\\?\\C:\\foo\\bar' ); ```javascript -var reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' ); +const reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' ); -var RE_EXTENDED_LENGTH_PATH = reExtendedLengthPath(); -var bool; -var path; +const RE_EXTENDED_LENGTH_PATH = reExtendedLengthPath(); -path = '\\\\?\\C:\\foo\\bar'; -bool = RE_EXTENDED_LENGTH_PATH.test( path ); +let path = '\\\\?\\C:\\foo\\bar'; +let bool = RE_EXTENDED_LENGTH_PATH.test( path ); // returns true path = '\\\\?\\UNC\\server\\share'; diff --git a/lib/node_modules/@stdlib/regexp/extname-posix/README.md b/lib/node_modules/@stdlib/regexp/extname-posix/README.md index 2bb097523b8d..100eb830b96c 100644 --- a/lib/node_modules/@stdlib/regexp/extname-posix/README.md +++ b/lib/node_modules/@stdlib/regexp/extname-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reExtnamePosix = require( '@stdlib/regexp/extname-posix' ); +const reExtnamePosix = require( '@stdlib/regexp/extname-posix' ); ``` #### reExtnamePosix() @@ -35,8 +35,8 @@ var reExtnamePosix = require( '@stdlib/regexp/extname-posix' ); Returns a [regular expression][regexp] to capture a [POSIX][posix] filename extension. ```javascript -var RE_EXTNAME_POSIX = reExtnamePosix(); -var ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]; +const RE_EXTNAME_POSIX = reExtnamePosix(); +const ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]; // returns '.js' ``` @@ -45,7 +45,7 @@ var ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]; [Regular expression][regexp] to capture a [POSIX][posix] filename extension. ```javascript -var ext = reExtnamePosix.REGEXP.exec( 'index.js' )[ 1 ]; +const ext = reExtnamePosix.REGEXP.exec( 'index.js' )[ 1 ]; // returns '.js' ``` @@ -60,7 +60,7 @@ var ext = reExtnamePosix.REGEXP.exec( 'index.js' )[ 1 ]; - When executed against dotfile filenames (e.g., `.gitignore`), the [regular expression][regexp] does **not** capture the basename as a filename extension. ```javascript - var ext = reExtnamePosix.REGEXP.exec( '.bash_profile' )[ 1 ]; + let ext = reExtnamePosix.REGEXP.exec( '.bash_profile' )[ 1 ]; // returns '' ext = reExtnamePosix.REGEXP.exec( '.travis.yml' )[ 1 ]; @@ -78,12 +78,11 @@ var ext = reExtnamePosix.REGEXP.exec( 'index.js' )[ 1 ]; ```javascript -var reExtnamePosix = require( '@stdlib/regexp/extname-posix' ); +const reExtnamePosix = require( '@stdlib/regexp/extname-posix' ); -var RE_EXTNAME_POSIX = reExtnamePosix(); -var ext; +const RE_EXTNAME_POSIX = reExtnamePosix(); -ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]; +let ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]; // returns '.js' ext = RE_EXTNAME_POSIX.exec( '/foo/bar/home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/extname-windows/README.md b/lib/node_modules/@stdlib/regexp/extname-windows/README.md index 6a3d4e1ee6d9..010193107d6a 100644 --- a/lib/node_modules/@stdlib/regexp/extname-windows/README.md +++ b/lib/node_modules/@stdlib/regexp/extname-windows/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reExtnameWindows = require( '@stdlib/regexp/extname-windows' ); +const reExtnameWindows = require( '@stdlib/regexp/extname-windows' ); ``` #### reExtnameWindows() @@ -35,8 +35,8 @@ var reExtnameWindows = require( '@stdlib/regexp/extname-windows' ); Returns a [regular expression][regexp] to capture a Windows filename extension. ```javascript -var RE_EXTNAME_WINDOWS = reExtnameWindows(); -var ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]; +const RE_EXTNAME_WINDOWS = reExtnameWindows(); +const ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]; // returns '.js' ``` @@ -45,7 +45,7 @@ var ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]; [Regular expression][regexp] to capture a Windows filename extension. ```javascript -var ext = reExtnameWindows.REGEXP.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; +const ext = reExtnameWindows.REGEXP.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; // returns '.js' ``` @@ -60,7 +60,7 @@ var ext = reExtnameWindows.REGEXP.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; - When executed against dotfile filenames (e.g., `.gitignore`), the [regular expression][regexp] does **not** capture the basename as a filename extension. ```javascript - var ext = reExtnameWindows.REGEXP.exec( '.bash_profile' )[ 1 ]; + let ext = reExtnameWindows.REGEXP.exec( '.bash_profile' )[ 1 ]; // returns '' ext = reExtnameWindows.REGEXP.exec( '.travis.yml' )[ 1 ]; @@ -78,12 +78,11 @@ var ext = reExtnameWindows.REGEXP.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; ```javascript -var reExtnameWindows = require( '@stdlib/regexp/extname-windows' ); +const reExtnameWindows = require( '@stdlib/regexp/extname-windows' ); -var RE_EXTNAME_WINDOWS = reExtnameWindows(); -var ext; +const RE_EXTNAME_WINDOWS = reExtnameWindows(); -ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]; +let ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]; // returns '.js' ext = RE_EXTNAME_WINDOWS.exec( 'C:\\foo\\bar\\home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/extname/README.md b/lib/node_modules/@stdlib/regexp/extname/README.md index b32d45498432..e8922e211b28 100644 --- a/lib/node_modules/@stdlib/regexp/extname/README.md +++ b/lib/node_modules/@stdlib/regexp/extname/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reExtname = require( '@stdlib/regexp/extname' ); +const reExtname = require( '@stdlib/regexp/extname' ); ``` #### reExtname( \[platform] ) @@ -35,13 +35,13 @@ var reExtname = require( '@stdlib/regexp/extname' ); Returns a [regular expression][regexp] to capture a filename extension. ```javascript -var RE = reExtname(); +let RE = reExtname(); // returns RE = reExtname( 'posix' ); // returns -var ext = RE.exec( '/foo/bar/index.js' )[ 1 ]; +let ext = RE.exec( '/foo/bar/index.js' )[ 1 ]; // returns '.js' RE = reExtname( 'win32' ); @@ -56,7 +56,7 @@ ext = RE.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; [Regular expression][regexp] to capture a filename extension. ```javascript -var bool = ( reExtname.REGEXP.toString() === reExtname().toString() ); +const bool = ( reExtname.REGEXP.toString() === reExtname().toString() ); // returns true ``` @@ -65,7 +65,7 @@ var bool = ( reExtname.REGEXP.toString() === reExtname().toString() ); [Regular expression][@stdlib/regexp/extname-posix] to capture a [POSIX][posix] filename extension. ```javascript -var ext = reExtname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; +const ext = reExtname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; // returns '.js' ``` @@ -74,7 +74,7 @@ var ext = reExtname.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]; [Regular expression][@stdlib/regexp/extname-windows] to capture a Windows filename extension. ```javascript -var ext = reExtname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; +const ext = reExtname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; // returns '.js' ``` @@ -99,12 +99,11 @@ var ext = reExtname.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]; ```javascript -var reExtname = require( '@stdlib/regexp/extname' ); -var RE_EXTNAME = reExtname(); -var ext; +const reExtname = require( '@stdlib/regexp/extname' ); +const RE_EXTNAME = reExtname(); // Assuming a POSIX platform... -ext = RE_EXTNAME.exec( '/foo/bar/index.js' )[ 1 ]; +let ext = RE_EXTNAME.exec( '/foo/bar/index.js' )[ 1 ]; // returns '.js' ext = reExtname.REGEXP_WIN32.exec( '/foo/bar/home.html' )[ 1 ]; diff --git a/lib/node_modules/@stdlib/regexp/filename-posix/README.md b/lib/node_modules/@stdlib/regexp/filename-posix/README.md index 64e9da5f1259..afac2432adb2 100644 --- a/lib/node_modules/@stdlib/regexp/filename-posix/README.md +++ b/lib/node_modules/@stdlib/regexp/filename-posix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reFilenamePosix = require( '@stdlib/regexp/filename-posix' ); +const reFilenamePosix = require( '@stdlib/regexp/filename-posix' ); ``` #### reFilenamePosix() @@ -35,8 +35,8 @@ var reFilenamePosix = require( '@stdlib/regexp/filename-posix' ); Returns a [regular expression][mdn-regexp] to split a [POSIX][posix] filename. ```javascript -var RE_FILENAME_POSIX = reFilenamePosix(); -var parts = RE_FILENAME_POSIX.exec( '/foo/bar/index.js' ).slice(); +const RE_FILENAME_POSIX = reFilenamePosix(); +const parts = RE_FILENAME_POSIX.exec( '/foo/bar/index.js' ).slice(); /* returns [ '/foo/bar/index.js', // input value @@ -53,7 +53,7 @@ var parts = RE_FILENAME_POSIX.exec( '/foo/bar/index.js' ).slice(); [Regular expression][mdn-regexp] to split a [POSIX][posix] filename. ```javascript -var parts = reFilenamePosix.REGEXP.exec( '/foo/bar/index.js' ).slice(); +const parts = reFilenamePosix.REGEXP.exec( '/foo/bar/index.js' ).slice(); /* returns [ '/foo/bar/index.js', // input value @@ -76,7 +76,7 @@ var parts = reFilenamePosix.REGEXP.exec( '/foo/bar/index.js' ).slice(); - When executed against dotfile filenames (e.g., `.gitignore`), the [regular expression][mdn-regexp] does **not** capture the basename as a filename extension. ```javascript - var parts = reFilenamePosix.REGEXP.exec( '.bash_profile' ).slice(); + let parts = reFilenamePosix.REGEXP.exec( '.bash_profile' ).slice(); /* returns [ '.bash_profile', @@ -110,10 +110,10 @@ var parts = reFilenamePosix.REGEXP.exec( '/foo/bar/index.js' ).slice(); ```javascript -var reFilenamePosix = require( '@stdlib/regexp/filename-posix' ); +const reFilenamePosix = require( '@stdlib/regexp/filename-posix' ); -var RE_FILENAME_POSIX = reFilenamePosix(); -var parts = RE_FILENAME_POSIX.exec( 'index.js' ).slice(); +const RE_FILENAME_POSIX = reFilenamePosix(); +let parts = RE_FILENAME_POSIX.exec( 'index.js' ).slice(); /* returns [ 'index.js', diff --git a/lib/node_modules/@stdlib/regexp/filename-windows/README.md b/lib/node_modules/@stdlib/regexp/filename-windows/README.md index ac02b0e01505..cd55ce7a0c5f 100644 --- a/lib/node_modules/@stdlib/regexp/filename-windows/README.md +++ b/lib/node_modules/@stdlib/regexp/filename-windows/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reFilenameWindows = require( '@stdlib/regexp/filename-windows' ); +const reFilenameWindows = require( '@stdlib/regexp/filename-windows' ); ``` #### reFilenameWindows() @@ -37,8 +37,8 @@ Returns a [regular expression][mdn-regexp] to split a Windows filename. ```javascript -var RE_FILENAME_WINDOWS = reFilenameWindows(); -var parts = RE_FILENAME_WINDOWS.exec( 'C:\\foo\\bar\\index.js' ).slice(); +const RE_FILENAME_WINDOWS = reFilenameWindows(); +const parts = RE_FILENAME_WINDOWS.exec( 'C:\\foo\\bar\\index.js' ).slice(); /* returns [ 'C:\\foo\\bar\\index.js', // input value @@ -56,7 +56,7 @@ var parts = RE_FILENAME_WINDOWS.exec( 'C:\\foo\\bar\\index.js' ).slice(); [Regular expression][mdn-regexp] to split a Windows filename. ```javascript -var parts = reFilenameWindows.REGEXP.exec( 'C:\\foo\\bar\\home.html' ).slice(); +const parts = reFilenameWindows.REGEXP.exec( 'C:\\foo\\bar\\home.html' ).slice(); /* returns [ 'C:\\foo\\bar\\home.html', @@ -80,7 +80,7 @@ var parts = reFilenameWindows.REGEXP.exec( 'C:\\foo\\bar\\home.html' ).slice(); - When executed against dotfile filenames (e.g., `.gitignore`), the [regular expression][mdn-regexp] does **not** capture the basename as a filename extension. ```javascript - var parts = reFilenameWindows.REGEXP.exec( '.bash_profile' ).slice(); + let parts = reFilenameWindows.REGEXP.exec( '.bash_profile' ).slice(); /* returns [ '.bash_profile', @@ -116,10 +116,10 @@ var parts = reFilenameWindows.REGEXP.exec( 'C:\\foo\\bar\\home.html' ).slice(); ```javascript -var reFilenameWindows = require( '@stdlib/regexp/filename-windows' ); +const reFilenameWindows = require( '@stdlib/regexp/filename-windows' ); -var RE_FILENAME_WINDOWS = reFilenameWindows(); -var parts = RE_FILENAME_WINDOWS.exec( 'index.js' ).slice(); +const RE_FILENAME_WINDOWS = reFilenameWindows(); +let parts = RE_FILENAME_WINDOWS.exec( 'index.js' ).slice(); /* returns [ 'index.js', diff --git a/lib/node_modules/@stdlib/regexp/filename/README.md b/lib/node_modules/@stdlib/regexp/filename/README.md index 49dc17496141..d8d1910462ba 100644 --- a/lib/node_modules/@stdlib/regexp/filename/README.md +++ b/lib/node_modules/@stdlib/regexp/filename/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reFilename = require( '@stdlib/regexp/filename' ); +const reFilename = require( '@stdlib/regexp/filename' ); ``` #### reFilename( \[platform] ) @@ -35,13 +35,13 @@ var reFilename = require( '@stdlib/regexp/filename' ); Returns a [regular expression][mdn-regexp] to split a filename. ```javascript -var RE = reFilename(); +let RE = reFilename(); // returns RE = reFilename( 'posix' ); // returns -var parts = RE.exec( '/foo/bar/index.js' ).slice(); +let parts = RE.exec( '/foo/bar/index.js' ).slice(); /* returns [ '/foo/bar/index.js', // input value @@ -73,7 +73,7 @@ parts = RE.exec( 'C:\\foo\\bar\\index.js' ).slice(); [Regular expression][mdn-regexp] to split a filename. ```javascript -var bool = ( reFilename.REGEXP.toString() === reFilename().toString() ); +const bool = ( reFilename.REGEXP.toString() === reFilename().toString() ); // returns true ``` @@ -82,7 +82,7 @@ var bool = ( reFilename.REGEXP.toString() === reFilename().toString() ); [Regular expression][@stdlib/regexp/filename-posix] to split a [POSIX][posix] filename. ```javascript -var parts = reFilename.REGEXP_POSIX.exec( '/foo/bar/index.js' ).slice(); +const parts = reFilename.REGEXP_POSIX.exec( '/foo/bar/index.js' ).slice(); /* returns [ '/foo/bar/index.js', // input value @@ -99,7 +99,7 @@ var parts = reFilename.REGEXP_POSIX.exec( '/foo/bar/index.js' ).slice(); [Regular expression][@stdlib/regexp/filename-windows] to split a Windows filename. ```javascript -var parts = reFilename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' ).slice(); +const parts = reFilename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' ).slice(); /* returns [ 'C:\\foo\\bar\\index.js', // input value @@ -133,11 +133,11 @@ var parts = reFilename.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' ).slice(); ```javascript -var reFilename = require( '@stdlib/regexp/filename' ); -var RE_FILENAME = reFilename(); +const reFilename = require( '@stdlib/regexp/filename' ); +const RE_FILENAME = reFilename(); // Assuming a POSIX platform... -var parts = RE_FILENAME.exec( '/foo/bar/index.js' ).slice(); +let parts = RE_FILENAME.exec( '/foo/bar/index.js' ).slice(); /* returns [ '/foo/bar/index.js', diff --git a/lib/node_modules/@stdlib/regexp/function-name/README.md b/lib/node_modules/@stdlib/regexp/function-name/README.md index 5d85427146a5..ae406c533e2a 100644 --- a/lib/node_modules/@stdlib/regexp/function-name/README.md +++ b/lib/node_modules/@stdlib/regexp/function-name/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reFunctionName = require( '@stdlib/regexp/function-name' ); +const reFunctionName = require( '@stdlib/regexp/function-name' ); ``` #### reFunctionName() @@ -39,8 +39,8 @@ function beep() { return 'boop'; } -var RE_FUNCTION_NAME = reFunctionName(); -var str = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]; +const RE_FUNCTION_NAME = reFunctionName(); +const str = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]; // returns 'beep' ``` @@ -51,7 +51,7 @@ var str = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]; ```javascript -var str = reFunctionName.REGEXP.exec( Math.sqrt.toString() )[ 1 ]; +const str = reFunctionName.REGEXP.exec( Math.sqrt.toString() )[ 1 ]; // returns 'sqrt' ``` @@ -68,15 +68,15 @@ var str = reFunctionName.REGEXP.exec( Math.sqrt.toString() )[ 1 ]; ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var reFunctionName = require( '@stdlib/regexp/function-name' ); -var RE_FUNCTION_NAME = reFunctionName(); +const Int8Array = require( '@stdlib/array/int8' ); +const reFunctionName = require( '@stdlib/regexp/function-name' ); +const RE_FUNCTION_NAME = reFunctionName(); function fname( fcn ) { return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ]; } -var f = fname( Math.sqrt ); +let f = fname( Math.sqrt ); // returns 'sqrt' f = fname( Int8Array ); diff --git a/lib/node_modules/@stdlib/regexp/native-function/README.md b/lib/node_modules/@stdlib/regexp/native-function/README.md index 12492d646494..a751531b3670 100644 --- a/lib/node_modules/@stdlib/regexp/native-function/README.md +++ b/lib/node_modules/@stdlib/regexp/native-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reNativeFunction = require( '@stdlib/regexp/native-function' ); +const reNativeFunction = require( '@stdlib/regexp/native-function' ); ``` #### reNativeFunction() @@ -35,8 +35,8 @@ var reNativeFunction = require( '@stdlib/regexp/native-function' ); Returns a [regular expression][regexp] to match a native `function`. ```javascript -var RE_NATIVE_FUNCTION = reNativeFunction(); -var bool = RE_NATIVE_FUNCTION.test( Date.toString() ); +const RE_NATIVE_FUNCTION = reNativeFunction(); +const bool = RE_NATIVE_FUNCTION.test( Date.toString() ); // returns true ``` @@ -45,7 +45,7 @@ var bool = RE_NATIVE_FUNCTION.test( Date.toString() ); [Regular expression][regexp] to match a native `function`. ```javascript -var bool = reNativeFunction.REGEXP.test( Date.toString() ); +const bool = reNativeFunction.REGEXP.test( Date.toString() ); // returns true ``` @@ -62,15 +62,15 @@ var bool = reNativeFunction.REGEXP.test( Date.toString() ); ```javascript -var Int8Array = require( '@stdlib/array/int8' ); -var reNativeFunction = require( '@stdlib/regexp/native-function' ); +const Int8Array = require( '@stdlib/array/int8' ); +const reNativeFunction = require( '@stdlib/regexp/native-function' ); -var RE_NATIVE_FUNCTION = reNativeFunction(); +const RE_NATIVE_FUNCTION = reNativeFunction(); function isNativeFunction( fcn ) { return RE_NATIVE_FUNCTION.test( fcn.toString() ); } -var bool = isNativeFunction( Math.sqrt ); +let bool = isNativeFunction( Math.sqrt ); // returns true bool = isNativeFunction( String ); diff --git a/lib/node_modules/@stdlib/regexp/regexp/README.md b/lib/node_modules/@stdlib/regexp/regexp/README.md index 26e9b8317e1c..a653f7d4b1a8 100644 --- a/lib/node_modules/@stdlib/regexp/regexp/README.md +++ b/lib/node_modules/@stdlib/regexp/regexp/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reRegExp = require( '@stdlib/regexp/regexp' ); +const reRegExp = require( '@stdlib/regexp/regexp' ); ``` #### reRegExp() @@ -37,14 +37,14 @@ Returns a [regular expression][regexp] to parse a [regular expression][regexp] ` ```javascript -var RE_REGEXP = reRegExp(); -var bool = RE_REGEXP.test( '/^beep$/' ); +const RE_REGEXP = reRegExp(); +let bool = RE_REGEXP.test( '/^beep$/' ); // returns true bool = RE_REGEXP.test( '' ); // returns false -var parts = RE_REGEXP.exec( '/^.*$/ig' ); +const parts = RE_REGEXP.exec( '/^.*$/ig' ); // returns [ '/^.*$/ig', '^.*$', 'ig', 'index': 0, 'input': '/^.*$/ig' ] ``` @@ -53,9 +53,9 @@ var parts = RE_REGEXP.exec( '/^.*$/ig' ); ```javascript -var RE_REGEXP = reRegExp(); +const RE_REGEXP = reRegExp(); -var bool = RE_REGEXP.test( '/^\/([^\/]+)\/(.*)$/' ); +let bool = RE_REGEXP.test( '/^\/([^\/]+)\/(.*)$/' ); // returns false bool = RE_REGEXP.test( '/^\\/([^\\/]+)\\/(.*)$/' ); @@ -67,7 +67,7 @@ bool = RE_REGEXP.test( '/^\\/([^\\/]+)\\/(.*)$/' ); [Regular expression][regexp] to parse a [regular expression][regexp] `string`. ```javascript -var bool = reRegExp.REGEXP.test( '/^beep$/' ); +const bool = reRegExp.REGEXP.test( '/^beep$/' ); // returns true ``` @@ -84,11 +84,11 @@ var bool = reRegExp.REGEXP.test( '/^beep$/' ); ```javascript -var reRegExp = require( '@stdlib/regexp/regexp' ); +const reRegExp = require( '@stdlib/regexp/regexp' ); -var RE_REGEXP = reRegExp(); +const RE_REGEXP = reRegExp(); -var bool = RE_REGEXP.test( '/beep/' ); +let bool = RE_REGEXP.test( '/beep/' ); // returns true bool = RE_REGEXP.test( '/^.*$/ig' ); diff --git a/lib/node_modules/@stdlib/regexp/reviver/README.md b/lib/node_modules/@stdlib/regexp/reviver/README.md index e809f582324a..6e3737d9b804 100644 --- a/lib/node_modules/@stdlib/regexp/reviver/README.md +++ b/lib/node_modules/@stdlib/regexp/reviver/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reviveRegExp = require( '@stdlib/regexp/reviver' ); +const reviveRegExp = require( '@stdlib/regexp/reviver' ); ``` #### reviveRegExp( key, value ) @@ -45,11 +45,11 @@ var reviveRegExp = require( '@stdlib/regexp/reviver' ); Revives a JSON-serialized [regular expression][mdn-regexp]. ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var str = '{"type":"RegExp","pattern":"ab+c","flags":""}'; +const str = '{"type":"RegExp","pattern":"ab+c","flags":""}'; -var re = parseJSON( str, reviveRegExp ); +const re = parseJSON( str, reviveRegExp ); // returns ``` @@ -66,20 +66,20 @@ For details on the JSON serialization format, see [`@stdlib/regexp/to-json`][@st ## Examples ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var regexp2json = require( '@stdlib/regexp/to-json' ); -var reviveRegExp = require( '@stdlib/regexp/reviver' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); +const regexp2json = require( '@stdlib/regexp/to-json' ); +const reviveRegExp = require( '@stdlib/regexp/reviver' ); -var re1 = /ab+c/; -var json = regexp2json( re1 ); +const re1 = /ab+c/; +const json = regexp2json( re1 ); -var str = JSON.stringify( json ); +const str = JSON.stringify( json ); // returns '{"type":"RegExp","pattern":"ab+c","flags":""}' -var re2 = parseJSON( str, reviveRegExp ); +const re2 = parseJSON( str, reviveRegExp ); // returns -var bool = ( re1.toString() === re2.toString() ); +const bool = ( re1.toString() === re2.toString() ); // returns true ``` diff --git a/lib/node_modules/@stdlib/regexp/semver/README.md b/lib/node_modules/@stdlib/regexp/semver/README.md index 38806acdd0a9..0b19742d83d5 100644 --- a/lib/node_modules/@stdlib/regexp/semver/README.md +++ b/lib/node_modules/@stdlib/regexp/semver/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reSemVer = require( '@stdlib/regexp/semver' ); +const reSemVer = require( '@stdlib/regexp/semver' ); ``` #### reSemVer() @@ -35,10 +35,10 @@ var reSemVer = require( '@stdlib/regexp/semver' ); Returns a [regular expression][mdn-regexp] to match a [semantic version][semantic-version] string. ```javascript -var RE_SEMVER = reSemVer(); +const RE_SEMVER = reSemVer(); // returns -var parts = RE_SEMVER.exec( '1.0.0' ); +let parts = RE_SEMVER.exec( '1.0.0' ); /* returns [ '1.0.0', @@ -74,7 +74,7 @@ parts = RE_SEMVER.exec( '1.0.0-alpha.1' ); [Regular expression][mdn-regexp] to match a [semantic version][semantic-version] string. ```javascript -var parts = reSemVer.REGEXP.exec( '0.2.3' ); +const parts = reSemVer.REGEXP.exec( '0.2.3' ); /* returns [ '0.2.3', @@ -101,12 +101,12 @@ var parts = reSemVer.REGEXP.exec( '0.2.3' ); ```javascript -var reSemVer = require( '@stdlib/regexp/semver' ); +const reSemVer = require( '@stdlib/regexp/semver' ); -var RE_SEMVER = reSemVer(); +const RE_SEMVER = reSemVer(); -var version = '1.0.0'; -var bool = RE_SEMVER.test( version ); +let version = '1.0.0'; +let bool = RE_SEMVER.test( version ); // returns true version = '1.0.0-alpha.1'; diff --git a/lib/node_modules/@stdlib/regexp/to-json/README.md b/lib/node_modules/@stdlib/regexp/to-json/README.md index 46aeff3c9408..cc617a526c2c 100644 --- a/lib/node_modules/@stdlib/regexp/to-json/README.md +++ b/lib/node_modules/@stdlib/regexp/to-json/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var regexp2json = require( '@stdlib/regexp/to-json' ); +const regexp2json = require( '@stdlib/regexp/to-json' ); ``` #### regexp2json( regexp ) @@ -45,7 +45,7 @@ var regexp2json = require( '@stdlib/regexp/to-json' ); Returns a [JSON][json] representation of a [regular expression][mdn-regexp]. ```javascript -var json = regexp2json( /ab+c/ ); +const json = regexp2json( /ab+c/ ); /* returns { 'type': 'RegExp', @@ -74,9 +74,9 @@ The returned object has the following properties: ```javascript -var regexp2json = require( '@stdlib/regexp/to-json' ); +const regexp2json = require( '@stdlib/regexp/to-json' ); -var out = regexp2json( /.*/ ); +let out = regexp2json( /.*/ ); /* returns { 'type': 'RegExp', diff --git a/lib/node_modules/@stdlib/regexp/unc-path/README.md b/lib/node_modules/@stdlib/regexp/unc-path/README.md index 8efbbb903afd..91fcbebf6e30 100644 --- a/lib/node_modules/@stdlib/regexp/unc-path/README.md +++ b/lib/node_modules/@stdlib/regexp/unc-path/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reUncPath = require( '@stdlib/regexp/unc-path' ); +const reUncPath = require( '@stdlib/regexp/unc-path' ); ``` #### reUncPath() @@ -35,8 +35,8 @@ var reUncPath = require( '@stdlib/regexp/unc-path' ); Returns a [regular expression][regexp] to parse a [UNC][unc] path. ```javascript -var RE_UNC_PATH = reUncPath(); -var parts = RE_UNC_PATH.exec( '\\\\server\\share\\foo\\bar\\baz:a:b' ); +const RE_UNC_PATH = reUncPath(); +let parts = RE_UNC_PATH.exec( '\\\\server\\share\\foo\\bar\\baz:a:b' ); /* returns [ '\\\\server\\share\\foo\\bar\\baz:a:b', @@ -74,7 +74,7 @@ parts = RE_UNC_PATH.exec( '\\\\server\\share' ); [Regular expression][regexp] to parse a [UNC][unc] path. ```javascript -var parts = reUncPath.REGEXP.exec( '\\\\server\\share\\foo\\bar\\baz' )[ 1 ]; +const parts = reUncPath.REGEXP.exec( '\\\\server\\share\\foo\\bar\\baz' )[ 1 ]; // returns 'server' ``` @@ -89,14 +89,12 @@ var parts = reUncPath.REGEXP.exec( '\\\\server\\share\\foo\\bar\\baz' )[ 1 ]; ```javascript -var reUncPath = require( '@stdlib/regexp/unc-path' ); +const reUncPath = require( '@stdlib/regexp/unc-path' ); -var RE_UNC_PATH = reUncPath(); -var bool; -var path; +const RE_UNC_PATH = reUncPath(); -path = '\\\\server\\share\\foo\\bar\\baz:a:b'; -bool = RE_UNC_PATH.test( path ); +let path = '\\\\server\\share\\foo\\bar\\baz:a:b'; +let bool = RE_UNC_PATH.test( path ); // returns true path = '\\\\server\\share\\foo\\bar\\baz::b'; diff --git a/lib/node_modules/@stdlib/regexp/utf16-surrogate-pair/README.md b/lib/node_modules/@stdlib/regexp/utf16-surrogate-pair/README.md index 2b4f38ca7855..939334c2f8a3 100644 --- a/lib/node_modules/@stdlib/regexp/utf16-surrogate-pair/README.md +++ b/lib/node_modules/@stdlib/regexp/utf16-surrogate-pair/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' ); +const reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' ); ``` #### reUtf16SurrogatePair() @@ -35,9 +35,9 @@ var reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' ); Returns a [regular expression][mdn-regexp] to match a [UTF-16][utf-16] surrogate pair. ```javascript -var RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair(); +const RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair(); -var bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' ); +const bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' ); // returns true ``` @@ -46,7 +46,7 @@ var bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' ); [Regular expression][mdn-regexp] to match a [UTF-16][utf-16] surrogate pair. ```javascript -var bool = reUtf16SurrogatePair.REGEXP.test( 'abc\uD800\uDC00def' ); +const bool = reUtf16SurrogatePair.REGEXP.test( 'abc\uD800\uDC00def' ); // returns true ``` @@ -61,11 +61,11 @@ var bool = reUtf16SurrogatePair.REGEXP.test( 'abc\uD800\uDC00def' ); ```javascript -var reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' ); +const reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' ); -var RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair(); +const RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair(); -var bool = RE_UTF16_SURROGATE_PAIR.test( '\uD800\uDC00' ); +let bool = RE_UTF16_SURROGATE_PAIR.test( '\uD800\uDC00' ); // returns true bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' ); diff --git a/lib/node_modules/@stdlib/regexp/utf16-unpaired-surrogate/README.md b/lib/node_modules/@stdlib/regexp/utf16-unpaired-surrogate/README.md index 0c0c5c96cf8d..be4df5ffc851 100644 --- a/lib/node_modules/@stdlib/regexp/utf16-unpaired-surrogate/README.md +++ b/lib/node_modules/@stdlib/regexp/utf16-unpaired-surrogate/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var reUtf16UnpairedSurrogate = require( '@stdlib/regexp/utf16-unpaired-surrogate' ); +const reUtf16UnpairedSurrogate = require( '@stdlib/regexp/utf16-unpaired-surrogate' ); ``` #### reUtf16UnpairedSurrogate() @@ -39,9 +39,9 @@ Returns a [regular expression][mdn-regexp] to match an unpaired [UTF-16][utf-16] ```javascript -var RE_UTF16_UNPAIRED_SURROGATE = reUtf16UnpairedSurrogate(); +const RE_UTF16_UNPAIRED_SURROGATE = reUtf16UnpairedSurrogate(); -var bool = RE_UTF16_UNPAIRED_SURROGATE.test( 'abc\uD800def' ); +const bool = RE_UTF16_UNPAIRED_SURROGATE.test( 'abc\uD800def' ); // returns true ``` @@ -50,7 +50,7 @@ var bool = RE_UTF16_UNPAIRED_SURROGATE.test( 'abc\uD800def' ); [Regular expression][mdn-regexp] to match an unpaired [UTF-16][utf-16] surrogate. ```javascript -var bool = reUtf16UnpairedSurrogate.REGEXP.test( 'abc\uD800def' ); +const bool = reUtf16UnpairedSurrogate.REGEXP.test( 'abc\uD800def' ); // returns true ``` @@ -67,11 +67,11 @@ var bool = reUtf16UnpairedSurrogate.REGEXP.test( 'abc\uD800def' ); ```javascript -var reUtf16UnpairedSurrogate = require( '@stdlib/regexp/utf16-unpaired-surrogate' ); +const reUtf16UnpairedSurrogate = require( '@stdlib/regexp/utf16-unpaired-surrogate' ); -var RE_UTF16_UNPAIRED_SURROGATE = reUtf16UnpairedSurrogate(); +const RE_UTF16_UNPAIRED_SURROGATE = reUtf16UnpairedSurrogate(); -var bool = RE_UTF16_UNPAIRED_SURROGATE.test( '\uD800' ); +let bool = RE_UTF16_UNPAIRED_SURROGATE.test( '\uD800' ); // returns true bool = RE_UTF16_UNPAIRED_SURROGATE.test( '\uDC00' ); diff --git a/lib/node_modules/@stdlib/regexp/whitespace/README.md b/lib/node_modules/@stdlib/regexp/whitespace/README.md index 6ee0e1afc4af..89cf6e87f299 100644 --- a/lib/node_modules/@stdlib/regexp/whitespace/README.md +++ b/lib/node_modules/@stdlib/regexp/whitespace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reWhitespace = require( '@stdlib/regexp/whitespace' ); +const reWhitespace = require( '@stdlib/regexp/whitespace' ); ``` #### reWhitespace( \[options] ) @@ -35,9 +35,9 @@ var reWhitespace = require( '@stdlib/regexp/whitespace' ); Returns a [regular expression][regexp] to match a [white space][whitespace] character. ```javascript -var RE_WHITESPACE = reWhitespace(); +const RE_WHITESPACE = reWhitespace(); -var bool = RE_WHITESPACE.test( '\n' ); +let bool = RE_WHITESPACE.test( '\n' ); // returns true bool = RE_WHITESPACE.test( ' ' ); @@ -52,12 +52,12 @@ The function accepts an `options` object with optional properties: By default, the function returns a regular expression which does not have any flags specified. To specify [flags][mdn-regexp-flags], set the `flags` option with a list of flags (which may be in any order). ```javascript -var RE_WHITESPACE = reWhitespace({ +const RE_WHITESPACE = reWhitespace({ 'flags': 'gm' }); -var str = 'Hello World!'; -var bool = RE_WHITESPACE.test( str ); +const str = 'Hello World!'; +let bool = RE_WHITESPACE.test( str ); // returns true bool = RE_WHITESPACE.test( str ); @@ -67,11 +67,11 @@ bool = RE_WHITESPACE.test( str ); By default, the function returns a regular expression which does not capture the part of a string matching the regular expression. To capture matches, set the `capture` option. ```javascript -var RE_WHITESPACE = reWhitespace({ +const RE_WHITESPACE = reWhitespace({ 'capture': true }); -var str = 'Hello World!'; -var arr = str.split( RE_WHITESPACE ); +const str = 'Hello World!'; +const arr = str.split( RE_WHITESPACE ); // returns [ 'Hello', ' ', 'World!' ] ``` @@ -80,7 +80,7 @@ var arr = str.split( RE_WHITESPACE ); [Regular expression][regexp] to match a [white space][whitespace] character. ```javascript -var bool = reWhitespace.REGEXP.test( '\n' ); +let bool = reWhitespace.REGEXP.test( '\n' ); // returns true bool = reWhitespace.REGEXP.test( '\\n' ); @@ -92,10 +92,10 @@ bool = reWhitespace.REGEXP.test( '\\n' ); [Regular expression][regexp] to capture characters matching a [white space][whitespace] character. ```javascript -var replace = require( '@stdlib/string/replace' ); +const replace = require( '@stdlib/string/replace' ); -var str = 'Duplicate capture'; -var out = replace( str, reWhitespace.REGEXP_CAPTURE, '$1$1' ); +const str = 'Duplicate capture'; +const out = replace( str, reWhitespace.REGEXP_CAPTURE, '$1$1' ); // returns 'Duplicate capture' ``` @@ -134,11 +134,11 @@ var out = replace( str, reWhitespace.REGEXP_CAPTURE, '$1$1' ); ```javascript -var reWhitespace = require( '@stdlib/regexp/whitespace' ); +const reWhitespace = require( '@stdlib/regexp/whitespace' ); -var RE_WHITESPACE = reWhitespace(); +const RE_WHITESPACE = reWhitespace(); -var bool = RE_WHITESPACE.test( 'beep boop' ); +let bool = RE_WHITESPACE.test( 'beep boop' ); // returns true bool = RE_WHITESPACE.test( '\n' ); @@ -153,9 +153,9 @@ bool = RE_WHITESPACE.test( '\t' ); bool = RE_WHITESPACE.test( 'beep' ); // returns false -var str = 'This is\na newline\r\ndelimited string.'; +const str = 'This is\na newline\r\ndelimited string.'; -var arr = str.split( RE_WHITESPACE ); +const arr = str.split( RE_WHITESPACE ); // returns [ 'This', 'is', 'a', 'newline', '', 'delimited', 'string.' ] ``` diff --git a/lib/node_modules/@stdlib/repl/README.md b/lib/node_modules/@stdlib/repl/README.md index 7647a61919fd..b9c9f1cfccba 100644 --- a/lib/node_modules/@stdlib/repl/README.md +++ b/lib/node_modules/@stdlib/repl/README.md @@ -43,7 +43,7 @@ The REPL environment exposed here is available both as a standalone application ## Usage ```javascript -var REPL = require( '@stdlib/repl' ); +const REPL = require( '@stdlib/repl' ); ``` #### REPL( \[options] ) @@ -52,7 +52,7 @@ Returns a `REPL` instance. ```javascript // Create a new REPL: -var repl = new REPL(); +const repl = new REPL(); // ... @@ -94,15 +94,15 @@ The function supports specifying the following settings: Returns the REPL viewport. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Query the REPL viewport: -var v = repl.viewport(); +const v = repl.viewport(); // Close the REPL: repl.close(); @@ -113,17 +113,17 @@ repl.close(); Returns a REPL context. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // ... // Return a new REPL context: -var ctx = repl.createContext(); +const ctx = repl.createContext(); // ... @@ -136,10 +136,10 @@ repl.close(); Resets a REPL's execution context. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -159,10 +159,10 @@ repl.close(); Clears a REPL's history. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -182,10 +182,10 @@ repl.close(); Clears user-defined documentation. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -205,17 +205,17 @@ repl.close(); Returns a list of all available themes for syntax highlighting. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // ... // Fetch all available themes: -var themes = repl.themes(); +const themes = repl.themes(); // returns [...] // ... @@ -229,10 +229,10 @@ repl.close(); Returns a theme's color palette for syntax highlighting. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -244,7 +244,7 @@ repl.addTheme( 'myTheme', { }); // Get a theme's color palette: -var theme = repl.getTheme( 'myTheme' ); +const theme = repl.getTheme( 'myTheme' ); // returns { 'keyword': 'red' } // ... @@ -258,10 +258,10 @@ repl.close(); Adds a syntax highlighting theme. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -304,10 +304,10 @@ The syntax-highlighter supports the following tokens and associated theme fields Deletes a specified theme from the syntax-highlighter. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -335,10 +335,10 @@ repl.close(); Renames a specified theme in the syntax-highlighter. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -368,10 +368,10 @@ Loads and evaluates a JavaScript file line-by-line. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -391,10 +391,10 @@ function done() { Resets a REPL. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -414,10 +414,10 @@ repl.close(); Clears the entire REPL screen and scrollback history. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -439,10 +439,10 @@ This method is **only** applicable for TTY REPLs. In non-TTY REPLs, this method Clears the current line. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -464,10 +464,10 @@ This method is **only** applicable for TTY REPLs. In non-TTY REPLs, this method Clears the current REPL command buffer (i.e., clear any command which has been buffered but not yet executed). ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -487,17 +487,17 @@ repl.close(); Returns REPL settings. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // ... // Retrieve REPL settings: -var o = repl.settings(); +const o = repl.settings(); // ... @@ -508,17 +508,17 @@ repl.close(); To retrieve the current value for a specific setting, provide a `name` argument. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // ... // Retrieve current setting value: -var v = repl.settings( 'autoClosePairs' ); +const v = repl.settings( 'autoClosePairs' ); // ... @@ -529,10 +529,10 @@ repl.close(); To update a specific setting, provide a `value` argument. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -552,10 +552,10 @@ repl.close(); Closes a REPL. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); @@ -1503,8 +1503,8 @@ In [1]: workspaces( { 'details': true } ) ```javascript -var join = require( 'path' ).join; -var REPL = require( '@stdlib/repl' ); +const join = require( 'path' ).join; +const REPL = require( '@stdlib/repl' ); function onExit() { console.log( '' ); @@ -1512,7 +1512,7 @@ function onExit() { } // Create a new REPL: -var repl = new REPL(); +const repl = new REPL(); repl.on( 'exit', onExit ); // Load a history file: diff --git a/lib/node_modules/@stdlib/repl/code-blocks/README.md b/lib/node_modules/@stdlib/repl/code-blocks/README.md index d934c5885768..a93385e9ca46 100644 --- a/lib/node_modules/@stdlib/repl/code-blocks/README.md +++ b/lib/node_modules/@stdlib/repl/code-blocks/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var example = require( '@stdlib/repl/code-blocks' ); +const example = require( '@stdlib/repl/code-blocks' ); ``` #### example( alias ) @@ -45,14 +45,14 @@ var example = require( '@stdlib/repl/code-blocks' ); Returns an example associated with a provided alias. ```javascript -var out = example( 'base.sin' ); +const out = example( 'base.sin' ); // returns ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var out = example( 'unrecognized_alias_beep_boop_bop_bip' ); +const out = example( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,20 +79,15 @@ var out = example( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var example = require( '@stdlib/repl/code-blocks' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const example = require( '@stdlib/repl/code-blocks' ); -var list; -var len; -var idx; -var i; +const list = aliases(); +const len = list.length; -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( example( list[ idx ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/repl/help/README.md b/lib/node_modules/@stdlib/repl/help/README.md index 24126d6603dc..13ba90beeedf 100644 --- a/lib/node_modules/@stdlib/repl/help/README.md +++ b/lib/node_modules/@stdlib/repl/help/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var help = require( '@stdlib/repl/help' ); +const help = require( '@stdlib/repl/help' ); ``` #### help( alias ) @@ -45,14 +45,14 @@ var help = require( '@stdlib/repl/help' ); Returns help text for a provided alias. ```javascript -var txt = help( 'base.sin' ); +const txt = help( 'base.sin' ); // returns ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var txt = help( 'unrecognized_alias_beep_boop_bop_bip' ); +const txt = help( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,20 +79,15 @@ var txt = help( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var help = require( '@stdlib/repl/help' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const help = require( '@stdlib/repl/help' ); -var list; -var len; -var idx; -var i; +const list = aliases(); +const len = list.length; -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( help( list[ idx ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/repl/info/README.md b/lib/node_modules/@stdlib/repl/info/README.md index 18c187a63289..916bfa72e3dd 100644 --- a/lib/node_modules/@stdlib/repl/info/README.md +++ b/lib/node_modules/@stdlib/repl/info/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var info = require( '@stdlib/repl/info' ); +const info = require( '@stdlib/repl/info' ); ``` #### info( alias ) @@ -45,14 +45,14 @@ var info = require( '@stdlib/repl/info' ); Returns abbreviated help text for a provided alias. ```javascript -var txt = info( 'base.sin' ); +const txt = info( 'base.sin' ); // returns ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var txt = info( 'unrecognized_alias_beep_boop_bop_bip' ); +const txt = info( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,20 +79,15 @@ var txt = info( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var info = require( '@stdlib/repl/info' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const info = require( '@stdlib/repl/info' ); -var list; -var len; -var idx; -var i; +const list = aliases(); +const len = list.length; -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); console.log( info( list[ idx ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/repl/presentation/README.md b/lib/node_modules/@stdlib/repl/presentation/README.md index d89fb3627258..8f952775ae73 100644 --- a/lib/node_modules/@stdlib/repl/presentation/README.md +++ b/lib/node_modules/@stdlib/repl/presentation/README.md @@ -135,7 +135,7 @@ By default, code blocks are assumed to be JavaScript. To explicitly specify the This is a slide with code. ```javascript -var x = 3.14; +const x = 3.14; ``` ```` @@ -329,7 +329,7 @@ And lastly, custom patterns can include [emoji][@stdlib/datasets/emoji]. For exa ```javascript -var Presentation = require( '@stdlib/repl/presentation' ); +const Presentation = require( '@stdlib/repl/presentation' ); ``` #### Presentation( \[text,] repl\[, options] ) @@ -339,16 +339,16 @@ Returns a [REPL][@stdlib/repl] presentation instance for running a presentation ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -379,21 +379,21 @@ Returns the current presentation slide index. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... // Return the current presentation slide index: -var idx = pres.currentSlide; +const idx = pres.currentSlide; // ... @@ -410,16 +410,16 @@ Jumps to the last fragment of the last slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -439,16 +439,16 @@ Jumps to the first slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -468,16 +468,16 @@ Jumps to the first fragment of the current slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -497,19 +497,19 @@ Returns the presentation height. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // Return the presentation height: -var height = pres.height; +const height = pres.height; // Close the REPL: repl.close(); @@ -522,16 +522,16 @@ Jumps a specified number of slides. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -556,16 +556,16 @@ Jumps to a specified slide, where `n` is the nominal (i.e., one-based) slide num ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -585,16 +585,16 @@ Jumps to the last slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -614,16 +614,16 @@ Jumps to the last fragment of the current slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -643,21 +643,21 @@ Returns the presentation length (i.e., number of slides). ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... // Return the presentation length: -var len = pres.length; +const len = pres.length; // ... @@ -672,16 +672,16 @@ Loads a presentation from a `file`. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -707,16 +707,16 @@ Moves the presentation to the next slide or slide fragment. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -736,16 +736,16 @@ Moves the presentation to the next slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -765,16 +765,16 @@ Moves the presentation to the previous slide or slide fragment. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -794,16 +794,16 @@ Moves the presentation to the previous slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -823,16 +823,16 @@ Reloads a presentation. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -856,21 +856,21 @@ Renders the current presentation slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... // Render the current presentation slide: -var slide = pres.render(); +const slide = pres.render(); if ( slide === null ) { console.log( 'Unable to render slide.' ); } @@ -888,16 +888,16 @@ Runs any code on the current presentation slide. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -917,16 +917,16 @@ Shows a presentation slide (i.e., writes a rendered slide to the presentation [R ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -946,19 +946,19 @@ Returns the presentation content height. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // Return the presentation slide content height: -var h = pres.slideHeight; +const h = pres.slideHeight; // Close the REPL: repl.close(); @@ -971,19 +971,19 @@ Returns the presentation content width. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // Return the presentation slide content width: -var h = pres.slideWidth; +const h = pres.slideWidth; // Close the REPL: repl.close(); @@ -996,16 +996,16 @@ Stops watching a presentation file for changes. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -1034,16 +1034,16 @@ Watches a presentation source file for changes. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // ... @@ -1069,19 +1069,19 @@ Returns the presentation width. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); // Return the presentation width: -var width = pres.width; +const width = pres.width; // Close the REPL: repl.close(); @@ -1314,20 +1314,20 @@ This event is emitted upon watching a source presentation file. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); function onWatch() { console.log( 'Watching a source file.' ); } // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); pres.on( 'watch', onWatch ); // ... @@ -1343,20 +1343,20 @@ When watching a source presentation file, this event is emitted whenever a sourc ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); function onChange() { console.log( 'Source file changed.' ); } // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); pres.on( 'change', onChange ); // ... @@ -1372,8 +1372,8 @@ This event is emitted upon no longer watching a source presentation file. ```javascript -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); function onUnwatch( error ) { console.log( 'No longer watching a source file.' ); @@ -1384,12 +1384,12 @@ function onUnwatch( error ) { } // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); // Create a new REPL presentation: -var pres = new Presentation( repl ); +const pres = new Presentation( repl ); pres.on( 'unwatch', onUnwatch ); // ... @@ -1429,10 +1429,10 @@ repl.close(); ```javascript -var join = require( 'path' ).join; -var debug = require( '@stdlib/streams/node/debug-sink' ); -var REPL = require( '@stdlib/repl' ); -var Presentation = require( '@stdlib/repl/presentation' ); +const join = require( 'path' ).join; +const debug = require( '@stdlib/streams/node/debug-sink' ); +const REPL = require( '@stdlib/repl' ); +const Presentation = require( '@stdlib/repl/presentation' ); function onExit() { console.log( '' ); @@ -1440,13 +1440,13 @@ function onExit() { } // Create a new REPL: -var repl = new REPL({ +const repl = new REPL({ 'output': debug() }); repl.on( 'exit', onExit ); // Create a new REPL presentation: -var pres = new Presentation( repl, { +const pres = new Presentation( repl, { 'counter': 'progress' }); @@ -1454,7 +1454,7 @@ var pres = new Presentation( repl, { pres.load( join( __dirname, 'examples', 'presentation.txt' ) ); // Get the number of slides: -var len = pres.length; +const len = pres.length; // Render the first slide: pres.show(); diff --git a/lib/node_modules/@stdlib/repl/server/README.md b/lib/node_modules/@stdlib/repl/server/README.md index db7934ccb931..d52f4bf467df 100644 --- a/lib/node_modules/@stdlib/repl/server/README.md +++ b/lib/node_modules/@stdlib/repl/server/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var repl = require( '@stdlib/repl/server' ); +const repl = require( '@stdlib/repl/server' ); ``` #### repl( \[options], clbk ) @@ -57,7 +57,7 @@ function onStart( error, server ) { ```javascript -var repl = require( '@stdlib/repl/server' ); +const repl = require( '@stdlib/repl/server' ); // Start the REPL: repl( onStart ); diff --git a/lib/node_modules/@stdlib/repl/signature/README.md b/lib/node_modules/@stdlib/repl/signature/README.md index 9603b62febc8..1e36948162ba 100644 --- a/lib/node_modules/@stdlib/repl/signature/README.md +++ b/lib/node_modules/@stdlib/repl/signature/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var signature = require( '@stdlib/repl/signature' ); +const signature = require( '@stdlib/repl/signature' ); ``` #### signature( alias ) @@ -45,14 +45,14 @@ var signature = require( '@stdlib/repl/signature' ); Returns the signature(s) for a provided alias. ```javascript -var out = signature( 'base.sin' ); +const out = signature( 'base.sin' ); // returns [ '...' ] ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var txt = signature( 'unrecognized_alias_beep_boop_bop_bip' ); +const txt = signature( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,16 @@ var txt = signature( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var signature = require( '@stdlib/repl/signature' ); - -var list; -var len; -var idx; -var sig; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - sig = signature( list[ idx ] ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const signature = require( '@stdlib/repl/signature' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const sig = signature( list[ idx ] ); if ( sig ) { console.log( sig.join( '\n' ) ); } diff --git a/lib/node_modules/@stdlib/repl/typed-signature/README.md b/lib/node_modules/@stdlib/repl/typed-signature/README.md index a625720d7526..6ed5d38c345e 100644 --- a/lib/node_modules/@stdlib/repl/typed-signature/README.md +++ b/lib/node_modules/@stdlib/repl/typed-signature/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typedSignature = require( '@stdlib/repl/typed-signature' ); +const typedSignature = require( '@stdlib/repl/typed-signature' ); ``` #### typedSignature( alias ) @@ -45,14 +45,14 @@ var typedSignature = require( '@stdlib/repl/typed-signature' ); Returns the typed signature(s) for a provided alias. ```javascript -var out = typedSignature( 'base.sin' ); +const out = typedSignature( 'base.sin' ); // returns [ '...' ] ``` If provided an unrecognized `alias`, the function returns `null`. ```javascript -var txt = typedSignature( 'unrecognized_alias_beep_boop_bop_bip' ); +const txt = typedSignature( 'unrecognized_alias_beep_boop_bop_bip' ); // returns null ``` @@ -79,22 +79,16 @@ var txt = typedSignature( 'unrecognized_alias_beep_boop_bop_bip' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var aliases = require( '@stdlib/namespace/aliases' ); -var typedSignature = require( '@stdlib/repl/typed-signature' ); - -var list; -var len; -var idx; -var sig; -var i; - -list = aliases(); -len = list.length; - -for ( i = 0; i < 100; i++ ) { - idx = discreteUniform( 0, len-1 ); - sig = typedSignature( list[ idx ] ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const aliases = require( '@stdlib/namespace/aliases' ); +const typedSignature = require( '@stdlib/repl/typed-signature' ); + +const list = aliases(); +const len = list.length; + +for ( let i = 0; i < 100; i++ ) { + const idx = discreteUniform( 0, len-1 ); + const sig = typedSignature( list[ idx ] ); if ( sig ) { console.log( sig.join( '\n' ) ); } diff --git a/lib/node_modules/@stdlib/simulate/README.md b/lib/node_modules/@stdlib/simulate/README.md index 9561e9b540f0..13d69781b138 100644 --- a/lib/node_modules/@stdlib/simulate/README.md +++ b/lib/node_modules/@stdlib/simulate/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var simulate = require( '@stdlib/simulate' ); +const simulate = require( '@stdlib/simulate' ); ``` #### simulate @@ -35,7 +35,7 @@ var simulate = require( '@stdlib/simulate' ); Namespace containing simulation utilities. ```javascript -var ns = simulate; +const ns = simulate; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/simulate' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/simulate' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/simulate/iter/README.md b/lib/node_modules/@stdlib/simulate/iter/README.md index c4b19303f686..6023e8e10b23 100644 --- a/lib/node_modules/@stdlib/simulate/iter/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/simulate/iter' ); +const ns = require( '@stdlib/simulate/iter' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/simulate/iter' ); Namespace containing simulation iterators. ```javascript -var iterators = ns; +const iterators = ns; // returns {...} ``` @@ -79,8 +79,8 @@ The namespace contains the following functions for creating iterator protocol-co ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/simulate/iter' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/simulate/iter' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/simulate/iter/awgn/README.md b/lib/node_modules/@stdlib/simulate/iter/awgn/README.md index 0756acfbde1b..9942c015e596 100644 --- a/lib/node_modules/@stdlib/simulate/iter/awgn/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/awgn/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var iterawgn = require( '@stdlib/simulate/iter/awgn' ); +const iterawgn = require( '@stdlib/simulate/iter/awgn' ); ``` #### iterawgn( iterator, sigma\[, options] ) @@ -43,12 +43,12 @@ var iterawgn = require( '@stdlib/simulate/iter/awgn' ); Returns an [iterator][mdn-iterator-protocol] which introduces [additive white Gaussian noise][awgn] (AWGN) with standard deviation `sigma`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawgn( arr, 0.2 ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawgn( arr, 0.2 ); -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -78,63 +78,61 @@ The function accepts the following `options`: By default, an iterator uses the [improved ziggurat][@stdlib/random/base/improved-ziggurat] algorithm to generate pseudorandom numbers drawn from a standard normal distribution. To use a different PRNG, set the `prng` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var boxMuller = require( '@stdlib/random/base/box-muller' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const boxMuller = require( '@stdlib/random/base/box-muller' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawgn( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawgn( arr, 0.2, { 'prng': boxMuller }); -var v = it.next().value; +const v = it.next().value; // returns ``` To seed an iterator, set the `seed` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawgn( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it1 = iterawgn( arr, 0.2, { 'seed': 12345 }); -var v1 = it1.next().value; +const v1 = it1.next().value; // returns -var it2 = iterawgn( arr, 0.2, { +const it2 = iterawgn( arr, 0.2, { 'seed': 12345 }); -var v2 = it2.next().value; +const v2 = it2.next().value; // returns -var bool = ( v1 === v2 ); +const bool = ( v1 === v2 ); // returns true ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawgn( arr, 0.2 ); +const it1 = iterawgn( arr, 0.2 ); -// Progress the underlying generator state: -var i; -for ( i = 0; i < 3; i++ ) { +for ( let i = 0; i < 3; i++ ) { it1.next(); } // Create a new iterator initialized to the current state of `it1`: -var it2 = iterawgn( arr, 0.2, { +const it2 = iterawgn( arr, 0.2, { 'state': it1.state }); // Test that the iterator values are the same: -var bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` @@ -165,20 +163,20 @@ var bool = ( it1.next().value === it2.next().value ); ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterawgn = require( '@stdlib/simulate/iter/awgn' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterawgn = require( '@stdlib/simulate/iter/awgn' ); // Create an iterator for generating a sine wave: -var sine = iterSineWave({ +const sine = iterSineWave({ 'iter': 100, 'amplitude': 10.0 }); // Create an iterator for introducing additive white Gaussian noise: -var it = iterawgn( sine, 3.0 ); +const it = iterawgn( sine, 3.0 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/awln/README.md b/lib/node_modules/@stdlib/simulate/iter/awln/README.md index 3669f229c700..97b93c17c38f 100644 --- a/lib/node_modules/@stdlib/simulate/iter/awln/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/awln/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var iterawln = require( '@stdlib/simulate/iter/awln' ); +const iterawln = require( '@stdlib/simulate/iter/awln' ); ``` #### iterawln( iterator, sigma\[, options] ) @@ -43,12 +43,12 @@ var iterawln = require( '@stdlib/simulate/iter/awln' ); Returns an [iterator][mdn-iterator-protocol] which introduces additive white Laplacian (a.k.a. biexponential or double-exponential) noise (AWLN) with standard deviation `sigma`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawln( arr, 0.2 ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawln( arr, 0.2 ); -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -78,63 +78,61 @@ The function accepts the following `options`: By default, an iterator uses the [MT19937][@stdlib/random/base/mt19937] algorithm to generate uniformly distributed pseudorandom numbers on the interval `[0,1)`. To use a different PRNG, set the `prng` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawln( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawln( arr, 0.2, { 'prng': minstd.normalized }); -var v = it.next().value; +const v = it.next().value; // returns ``` To seed an iterator, set the `seed` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawln( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it1 = iterawln( arr, 0.2, { 'seed': 12345 }); -var v1 = it1.next().value; +const v1 = it1.next().value; // returns -var it2 = iterawln( arr, 0.2, { +const it2 = iterawln( arr, 0.2, { 'seed': 12345 }); -var v2 = it2.next().value; +const v2 = it2.next().value; // returns -var bool = ( v1 === v2 ); +const bool = ( v1 === v2 ); // returns true ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawln( arr, 0.2 ); +const it1 = iterawln( arr, 0.2 ); -// Progress the underlying generator state: -var i; -for ( i = 0; i < 3; i++ ) { +for ( let i = 0; i < 3; i++ ) { it1.next(); } // Create a new iterator initialized to the current state of `it1`: -var it2 = iterawln( arr, 0.2, { +const it2 = iterawln( arr, 0.2, { 'state': it1.state }); // Test that the iterator values are the same: -var bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` @@ -165,20 +163,20 @@ var bool = ( it1.next().value === it2.next().value ); ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterawln = require( '@stdlib/simulate/iter/awln' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterawln = require( '@stdlib/simulate/iter/awln' ); // Create an iterator for generating a sine wave: -var sine = iterSineWave({ +const sine = iterSineWave({ 'iter': 100, 'amplitude': 10.0 }); // Create an iterator for introducing additive white Laplacian noise: -var it = iterawln( sine, 3.0 ); +const it = iterawln( sine, 3.0 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/awun/README.md b/lib/node_modules/@stdlib/simulate/iter/awun/README.md index a4c6ad91a644..8bb7f7e3be08 100644 --- a/lib/node_modules/@stdlib/simulate/iter/awun/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/awun/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var iterawun = require( '@stdlib/simulate/iter/awun' ); +const iterawun = require( '@stdlib/simulate/iter/awun' ); ``` #### iterawun( iterator, sigma\[, options] ) @@ -43,12 +43,12 @@ var iterawun = require( '@stdlib/simulate/iter/awun' ); Returns an [iterator][mdn-iterator-protocol] which introduces additive white uniform noise (AWUN) with standard deviation `sigma`. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawun( arr, 0.2 ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawun( arr, 0.2 ); -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -78,63 +78,61 @@ The function accepts the following `options`: By default, an iterator uses the [MT19937][@stdlib/random/base/mt19937] algorithm to generate uniformly distributed pseudorandom numbers on the interval `[0,1)`. To use a different PRNG, set the `prng` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var minstd = require( '@stdlib/random/base/minstd-shuffle' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const minstd = require( '@stdlib/random/base/minstd-shuffle' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it = iterawun( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it = iterawun( arr, 0.2, { 'prng': minstd.normalized }); -var v = it.next().value; +const v = it.next().value; // returns ``` To seed an iterator, set the `seed` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawun( arr, 0.2, { +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const it1 = iterawun( arr, 0.2, { 'seed': 12345 }); -var v1 = it1.next().value; +const v1 = it1.next().value; // returns -var it2 = iterawun( arr, 0.2, { +const it2 = iterawun( arr, 0.2, { 'seed': 12345 }); -var v2 = it2.next().value; +const v2 = it2.next().value; // returns -var bool = ( v1 === v2 ); +const bool = ( v1 === v2 ); // returns true ``` To return an iterator having a specific initial state, set the iterator `state` option. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +const array2iterator = require( '@stdlib/array/to-iterator' ); +const arr = array2iterator( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var it1 = iterawun( arr, 0.2 ); +const it1 = iterawun( arr, 0.2 ); -// Progress the underlying generator state: -var i; -for ( i = 0; i < 3; i++ ) { +for ( let i = 0; i < 3; i++ ) { it1.next(); } // Create a new iterator initialized to the current state of `it1`: -var it2 = iterawun( arr, 0.2, { +const it2 = iterawun( arr, 0.2, { 'state': it1.state }); // Test that the iterator values are the same: -var bool = ( it1.next().value === it2.next().value ); +const bool = ( it1.next().value === it2.next().value ); // returns true ``` @@ -165,20 +163,20 @@ var bool = ( it1.next().value === it2.next().value ); ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); -var iterawun = require( '@stdlib/simulate/iter/awun' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterawun = require( '@stdlib/simulate/iter/awun' ); // Create an iterator for generating a sine wave: -var sine = iterSineWave({ +const sine = iterSineWave({ 'iter': 100, 'amplitude': 10.0 }); // Create an iterator for introducing additive white uniform noise: -var it = iterawun( sine, 3.0 ); +const it = iterawun( sine, 3.0 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/bartlett-hann-pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/bartlett-hann-pulse/README.md index 1699ab6f7eb2..207b4d4d22c7 100644 --- a/lib/node_modules/@stdlib/simulate/iter/bartlett-hann-pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/bartlett-hann-pulse/README.md @@ -56,7 +56,7 @@ where `T` is the pulse period, `τ` is the pulse duration, `A` is the amplitude, ## Usage ```javascript -var iterBartlettHannPulse = require( '@stdlib/simulate/iter/bartlett-hann-pulse' ); +const iterBartlettHannPulse = require( '@stdlib/simulate/iter/bartlett-hann-pulse' ); ``` #### iterBartlettHannPulse( \[options] ) @@ -64,10 +64,10 @@ var iterBartlettHannPulse = require( '@stdlib/simulate/iter/bartlett-hann-pulse' Returns an iterator which generates a Bartlett-Hann pulse waveform. ```javascript -var it = iterBartlettHannPulse(); +const it = iterBartlettHannPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -95,14 +95,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 10 }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -114,15 +114,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `100%` (i.e., the waveform duration equals the waveform period). To specify an alternative duty cycle, set the `duration` option. For example, to generate a waveform having a period of `10` iterations and a `50%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5 // 5/10 = 0.50 => 50% }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -158,16 +158,16 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': -7 }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -191,16 +191,16 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': 2 }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -221,19 +221,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -262,20 +262,20 @@ var bool = it.next().done; ```javascript -var iterBartlettHannPulse = require( '@stdlib/simulate/iter/bartlett-hann-pulse' ); +const iterBartlettHannPulse = require( '@stdlib/simulate/iter/bartlett-hann-pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 50, 'duration': 25, 'amplitude': 10.0, 'offset': -25, 'iter': 100 }; -var it = iterBartlettHannPulse( opts ); +const it = iterBartlettHannPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/bartlett-pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/bartlett-pulse/README.md index 72c4ad6c4578..25a8125291be 100644 --- a/lib/node_modules/@stdlib/simulate/iter/bartlett-pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/bartlett-pulse/README.md @@ -56,7 +56,7 @@ where `T` is the pulse period, `τ` is the pulse duration, `a` is the amplitude, ## Usage ```javascript -var iterBartlettPulse = require( '@stdlib/simulate/iter/bartlett-pulse' ); +const iterBartlettPulse = require( '@stdlib/simulate/iter/bartlett-pulse' ); ``` #### iterBartlettPulse( \[options] ) @@ -64,10 +64,10 @@ var iterBartlettPulse = require( '@stdlib/simulate/iter/bartlett-pulse' ); Returns an iterator which generates a Bartlett pulse waveform. ```javascript -var it = iterBartlettPulse(); +const it = iterBartlettPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -95,14 +95,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 10 }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -114,15 +114,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `100%` (i.e., the waveform duration equals the waveform period). To specify an alternative duty cycle, set the `duration` option. For example, to generate a waveform having a period of `10` iterations and a `50%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5 // 5/10 = 0.50 => 50% }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -158,16 +158,16 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': -7 }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -191,16 +191,16 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': 2 }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -221,19 +221,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -262,20 +262,20 @@ var bool = it.next().done; ```javascript -var iterBartlettPulse = require( '@stdlib/simulate/iter/bartlett-pulse' ); +const iterBartlettPulse = require( '@stdlib/simulate/iter/bartlett-pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 50, 'duration': 25, 'amplitude': 10.0, 'offset': -25, 'iter': 100 }; -var it = iterBartlettPulse( opts ); +const it = iterBartlettPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/cosine-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/cosine-wave/README.md index 694e15745790..602e4e00d3ee 100644 --- a/lib/node_modules/@stdlib/simulate/iter/cosine-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/cosine-wave/README.md @@ -56,7 +56,7 @@ where `τ` is the period, `a` is the peak amplitude, and `φ` is the phase offse ## Usage ```javascript -var iterCosineWave = require( '@stdlib/simulate/iter/cosine-wave' ); +const iterCosineWave = require( '@stdlib/simulate/iter/cosine-wave' ); ``` #### iterCosineWave( \[options] ) @@ -64,10 +64,10 @@ var iterCosineWave = require( '@stdlib/simulate/iter/cosine-wave' ); Returns an iterator which generates a cosine wave. ```javascript -var it = iterCosineWave(); +const it = iterCosineWave(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -94,14 +94,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a cosine wave that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterCosineWave( opts ); +const it = iterCosineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -122,15 +122,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': -1 }; -var it = iterCosineWave( opts ); +const it = iterCosineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -151,15 +151,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': 1 }; -var it = iterCosineWave( opts ); +const it = iterCosineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -180,19 +180,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterCosineWave( opts ); +const it = iterCosineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -221,19 +221,19 @@ var bool = it.next().done; ```javascript -var iterCosineWave = require( '@stdlib/simulate/iter/cosine-wave' ); +const iterCosineWave = require( '@stdlib/simulate/iter/cosine-wave' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'amplitude': 10.0, 'offset': -5, 'iter': 100 }; -var it = iterCosineWave( opts ); +const it = iterCosineWave( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/dirac-comb/README.md b/lib/node_modules/@stdlib/simulate/iter/dirac-comb/README.md index d77fc84127d6..6a101c62f908 100644 --- a/lib/node_modules/@stdlib/simulate/iter/dirac-comb/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/dirac-comb/README.md @@ -56,7 +56,7 @@ where `δ` is the Dirac delta function, `T` is the period, and `φ` is the phase ## Usage ```javascript -var iterDiracComb = require( '@stdlib/simulate/iter/dirac-comb' ); +const iterDiracComb = require( '@stdlib/simulate/iter/dirac-comb' ); ``` #### iterDiracComb( \[options] ) @@ -64,10 +64,10 @@ var iterDiracComb = require( '@stdlib/simulate/iter/dirac-comb' ); Returns an iterator which generates a Dirac comb. ```javascript -var it = iterDiracComb(); +const it = iterDiracComb(); // returns -var v = it.next().value; +let v = it.next().value; // returns Infinity v = it.next().value; @@ -93,14 +93,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a Dirac delta function that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterDiracComb( opts ); +const it = iterDiracComb( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns Infinity v = it.next().value; @@ -121,15 +121,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': -1 }; -var it = iterDiracComb( opts ); +const it = iterDiracComb( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -150,15 +150,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': 1 }; -var it = iterDiracComb( opts ); +const it = iterDiracComb( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -179,19 +179,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterDiracComb( opts ); +const it = iterDiracComb( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns Infinity v = it.next().value; // returns 0.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -220,18 +220,18 @@ var bool = it.next().done; ```javascript -var iterDiracComb = require( '@stdlib/simulate/iter/dirac-comb' ); +const iterDiracComb = require( '@stdlib/simulate/iter/dirac-comb' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'offset': -5, 'iter': 100 }; -var it = iterDiracComb( opts ); +const it = iterDiracComb( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/flat-top-pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/flat-top-pulse/README.md index 85940a43e886..5be55a222096 100644 --- a/lib/node_modules/@stdlib/simulate/iter/flat-top-pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/flat-top-pulse/README.md @@ -64,7 +64,7 @@ The coefficients are ## Usage ```javascript -var iterFlatTopPulse = require( '@stdlib/simulate/iter/flat-top-pulse' ); +const iterFlatTopPulse = require( '@stdlib/simulate/iter/flat-top-pulse' ); ``` #### iterFlatTopPulse( \[options] ) @@ -72,10 +72,10 @@ var iterFlatTopPulse = require( '@stdlib/simulate/iter/flat-top-pulse' ); Returns an iterator which generates a flat top pulse waveform. ```javascript -var it = iterFlatTopPulse(); +const it = iterFlatTopPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -103,14 +103,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 10 }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -122,15 +122,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `100%` (i.e., the waveform duration equals the waveform period). To specify an alternative duty cycle, set the `duration` option. For example, to generate a waveform having a period of `10` iterations and a `50%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5 // 5/10 = 0.50 => 50% }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -166,16 +166,16 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': -7 }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -199,16 +199,16 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': 2 }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -229,19 +229,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -270,20 +270,20 @@ var bool = it.next().done; ```javascript -var iterFlatTopPulse = require( '@stdlib/simulate/iter/flat-top-pulse' ); +const iterFlatTopPulse = require( '@stdlib/simulate/iter/flat-top-pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 50, 'duration': 25, 'amplitude': 10.0, 'offset': -25, 'iter': 100 }; -var it = iterFlatTopPulse( opts ); +const it = iterFlatTopPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/hann-pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/hann-pulse/README.md index 3dcb2270adf3..d2d6e2ea2e5b 100644 --- a/lib/node_modules/@stdlib/simulate/iter/hann-pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/hann-pulse/README.md @@ -56,7 +56,7 @@ where `T` is the pulse period, `τ` is the pulse duration, `a` is the amplitude, ## Usage ```javascript -var iterHannPulse = require( '@stdlib/simulate/iter/hann-pulse' ); +const iterHannPulse = require( '@stdlib/simulate/iter/hann-pulse' ); ``` #### iterHannPulse( \[options] ) @@ -64,10 +64,10 @@ var iterHannPulse = require( '@stdlib/simulate/iter/hann-pulse' ); Returns an iterator which generates a Hann pulse waveform. ```javascript -var it = iterHannPulse(); +const it = iterHannPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -95,14 +95,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 10 }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -114,15 +114,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `100%` (i.e., the waveform duration equals the waveform period). To specify an alternative duty cycle, set the `duration` option. For example, to generate a waveform having a period of `10` iterations and a `50%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5 // 5/10 = 0.50 => 50% }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -158,16 +158,16 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': -7 }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -191,16 +191,16 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': 2 }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -221,19 +221,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -262,20 +262,20 @@ var bool = it.next().done; ```javascript -var iterHannPulse = require( '@stdlib/simulate/iter/hann-pulse' ); +const iterHannPulse = require( '@stdlib/simulate/iter/hann-pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 50, 'duration': 25, 'amplitude': 10.0, 'offset': -25, 'iter': 100 }; -var it = iterHannPulse( opts ); +const it = iterHannPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/lanczos-pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/lanczos-pulse/README.md index 287a46358616..13a8f1f45c6a 100644 --- a/lib/node_modules/@stdlib/simulate/iter/lanczos-pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/lanczos-pulse/README.md @@ -56,7 +56,7 @@ where `T` is the pulse period, `τ` is the pulse duration, `a` is the amplitude, ## Usage ```javascript -var iterLanczosPulse = require( '@stdlib/simulate/iter/lanczos-pulse' ); +const iterLanczosPulse = require( '@stdlib/simulate/iter/lanczos-pulse' ); ``` #### iterLanczosPulse( \[options] ) @@ -64,10 +64,10 @@ var iterLanczosPulse = require( '@stdlib/simulate/iter/lanczos-pulse' ); Returns an iterator which generates a Lanczos pulse waveform. ```javascript -var it = iterLanczosPulse(); +const it = iterLanczosPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -95,14 +95,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 10 }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -114,15 +114,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `100%` (i.e., the waveform duration equals the waveform period). To specify an alternative duty cycle, set the `duration` option. For example, to generate a waveform having a period of `10` iterations and a `50%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5 // 5/10 = 0.50 => 50% }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -158,16 +158,16 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': -7 }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -191,16 +191,16 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 10, 'duration': 5, 'offset': 2 }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -221,19 +221,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -262,20 +262,20 @@ var bool = it.next().done; ```javascript -var iterLanczosPulse = require( '@stdlib/simulate/iter/lanczos-pulse' ); +const iterLanczosPulse = require( '@stdlib/simulate/iter/lanczos-pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 50, 'duration': 25, 'amplitude': 10.0, 'offset': -25, 'iter': 100 }; -var it = iterLanczosPulse( opts ); +const it = iterLanczosPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/periodic-sinc/README.md b/lib/node_modules/@stdlib/simulate/iter/periodic-sinc/README.md index 4b7b7d0080d6..b27c719f5192 100644 --- a/lib/node_modules/@stdlib/simulate/iter/periodic-sinc/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/periodic-sinc/README.md @@ -118,7 +118,7 @@ D_N(\pi x; N, A) = A \cdot \frac{\mathop{\mathrm{sinc}}(Nx/2)} {\mathop{\mathrm{ ## Usage ```javascript -var iterPeriodicSinc = require( '@stdlib/simulate/iter/periodic-sinc' ); +const iterPeriodicSinc = require( '@stdlib/simulate/iter/periodic-sinc' ); ``` #### iterPeriodicSinc( n\[, options] ) @@ -126,10 +126,10 @@ var iterPeriodicSinc = require( '@stdlib/simulate/iter/periodic-sinc' ); Returns an iterator which generates a periodic [sinc][@stdlib/math/base/special/sinc] waveform of order `n`. ```javascript -var it = iterPeriodicSinc( 7 ); +const it = iterPeriodicSinc( 7 ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -156,14 +156,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `100` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 1000 }; -var it = iterPeriodicSinc( 7, opts ); +const it = iterPeriodicSinc( 7, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -175,15 +175,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 100, 'offset': -1 }; -var it = iterPeriodicSinc( 7, opts ); +const it = iterPeriodicSinc( 7, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -195,15 +195,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 100, 'offset': 1 }; -var it = iterPeriodicSinc( 7, opts ); +const it = iterPeriodicSinc( 7, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -215,19 +215,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPeriodicSinc( 7, opts ); +const it = iterPeriodicSinc( 7, opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -256,19 +256,19 @@ var bool = it.next().done; ```javascript -var iterPeriodicSinc = require( '@stdlib/simulate/iter/periodic-sinc' ); +const iterPeriodicSinc = require( '@stdlib/simulate/iter/periodic-sinc' ); // Create an iterator: -var opts = { +const opts = { 'period': 100, 'amplitude': 10.0, 'offset': -50, 'iter': 100 }; -var it = iterPeriodicSinc( 7, opts ); +const it = iterPeriodicSinc( 7, opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/pulse/README.md b/lib/node_modules/@stdlib/simulate/iter/pulse/README.md index 9402e47e98a1..5b0bedd4b4c2 100644 --- a/lib/node_modules/@stdlib/simulate/iter/pulse/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/pulse/README.md @@ -56,7 +56,7 @@ where `T` is the pulse period, `τ` is the pulse duration, `a` is the amplitude, ## Usage ```javascript -var iterPulse = require( '@stdlib/simulate/iter/pulse' ); +const iterPulse = require( '@stdlib/simulate/iter/pulse' ); ``` #### iterPulse( \[options] ) @@ -64,10 +64,10 @@ var iterPulse = require( '@stdlib/simulate/iter/pulse' ); Returns an iterator which generates a pulse waveform. ```javascript -var it = iterPulse(); +const it = iterPulse(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -96,14 +96,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a waveform that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -124,15 +124,15 @@ v = it.next().value; By default, the function returns an iterator which generates a waveform that has a duty cycle of `50%` (i.e., the waveform spends `50%` of its time at maximum amplitude). To specify an alternative duty cycle, set the `duration` option. For example, to generate a pulse wave having a period of `4` iterations and a `25%` duty cycle, ```javascript -var opts = { +const opts = { 'period': 4, 'duration': 1 // 1/4 = 0.25 => 25% }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -153,15 +153,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 6, 'offset': -2 }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -182,15 +182,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 6, 'offset': 2 }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -211,19 +211,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns 1.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -252,10 +252,10 @@ var bool = it.next().done; ```javascript -var iterPulse = require( '@stdlib/simulate/iter/pulse' ); +const iterPulse = require( '@stdlib/simulate/iter/pulse' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'duration': 2, 'min': -10.0, @@ -263,10 +263,10 @@ var opts = { 'offset': -5, 'iter': 100 }; -var it = iterPulse( opts ); +const it = iterPulse( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/sawtooth-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/sawtooth-wave/README.md index 9bc2665c985a..6c9c86180eea 100644 --- a/lib/node_modules/@stdlib/simulate/iter/sawtooth-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/sawtooth-wave/README.md @@ -56,7 +56,7 @@ where `τ` is the period, `a` is the peak amplitude, and `φ` is the phase offse ## Usage ```javascript -var iterSawtoothWave = require( '@stdlib/simulate/iter/sawtooth-wave' ); +const iterSawtoothWave = require( '@stdlib/simulate/iter/sawtooth-wave' ); ``` #### iterSawtoothWave( \[options] ) @@ -64,10 +64,10 @@ var iterSawtoothWave = require( '@stdlib/simulate/iter/sawtooth-wave' ); Returns an iterator which generates a sawtooth wave. ```javascript -var it = iterSawtoothWave(); +const it = iterSawtoothWave(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -94,14 +94,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a sawtooth wave that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterSawtoothWave( opts ); +const it = iterSawtoothWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -122,15 +122,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': -1 }; -var it = iterSawtoothWave( opts ); +const it = iterSawtoothWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~0.5 v = it.next().value; @@ -151,15 +151,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': 1 }; -var it = iterSawtoothWave( opts ); +const it = iterSawtoothWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns ~-0.5 v = it.next().value; @@ -180,19 +180,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterSawtoothWave( opts ); +const it = iterSawtoothWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -221,19 +221,19 @@ var bool = it.next().done; ```javascript -var iterSawtoothWave = require( '@stdlib/simulate/iter/sawtooth-wave' ); +const iterSawtoothWave = require( '@stdlib/simulate/iter/sawtooth-wave' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'amplitude': 10.0, 'offset': -5, 'iter': 100 }; -var it = iterSawtoothWave( opts ); +const it = iterSawtoothWave( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/sine-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/sine-wave/README.md index 006a90ab18b3..36ed1ac43b0b 100644 --- a/lib/node_modules/@stdlib/simulate/iter/sine-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/sine-wave/README.md @@ -56,7 +56,7 @@ where `τ` is the period, `a` is the peak amplitude, and `φ` is the phase offse ## Usage ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); ``` #### iterSineWave( \[options] ) @@ -64,10 +64,10 @@ var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); Returns an iterator which generates a sine wave. ```javascript -var it = iterSineWave(); +const it = iterSineWave(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -94,14 +94,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a sine wave that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterSineWave( opts ); +const it = iterSineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -122,15 +122,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': -1 }; -var it = iterSineWave( opts ); +const it = iterSineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -151,15 +151,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': 1 }; -var it = iterSineWave( opts ); +const it = iterSineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1.0 v = it.next().value; @@ -180,19 +180,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterSineWave( opts ); +const it = iterSineWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -221,19 +221,19 @@ var bool = it.next().done; ```javascript -var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); +const iterSineWave = require( '@stdlib/simulate/iter/sine-wave' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'amplitude': 10.0, 'offset': -5, 'iter': 100 }; -var it = iterSineWave( opts ); +const it = iterSineWave( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/square-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/square-wave/README.md index cbc415d2f7ef..7ce28e2419f1 100644 --- a/lib/node_modules/@stdlib/simulate/iter/square-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/square-wave/README.md @@ -56,7 +56,7 @@ where `τ` is the period, `a` is the amplitude, and `φ` is the phase offset. ## Usage ```javascript -var iterSquareWave = require( '@stdlib/simulate/iter/square-wave' ); +const iterSquareWave = require( '@stdlib/simulate/iter/square-wave' ); ``` #### iterSquareWave( \[options] ) @@ -64,10 +64,10 @@ var iterSquareWave = require( '@stdlib/simulate/iter/square-wave' ); Returns an iterator which generates a square wave. ```javascript -var it = iterSquareWave(); +const it = iterSquareWave(); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -95,14 +95,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a square wave that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterSquareWave( opts ); +const it = iterSquareWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -123,15 +123,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 6, 'offset': -2 }; -var it = iterSquareWave( opts ); +const it = iterSquareWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -152,15 +152,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 6, 'offset': 2 }; -var it = iterSquareWave( opts ); +const it = iterSquareWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1.0 v = it.next().value; @@ -181,19 +181,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterSquareWave( opts ); +const it = iterSquareWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns 1.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -222,20 +222,20 @@ var bool = it.next().done; ```javascript -var iterSquareWave = require( '@stdlib/simulate/iter/square-wave' ); +const iterSquareWave = require( '@stdlib/simulate/iter/square-wave' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'min': -10.0, 'max': 10.0, 'offset': -5, 'iter': 100 }; -var it = iterSquareWave( opts ); +const it = iterSquareWave( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md index 60a405f19741..53c8e6298eaa 100644 --- a/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md @@ -56,7 +56,7 @@ where `τ` is the period, `a` is the peak amplitude, and `φ` is the phase offse ## Usage ```javascript -var iterTriangleWave = require( '@stdlib/simulate/iter/triangle-wave' ); +const iterTriangleWave = require( '@stdlib/simulate/iter/triangle-wave' ); ``` #### iterTriangleWave( \[options] ) @@ -64,10 +64,10 @@ var iterTriangleWave = require( '@stdlib/simulate/iter/triangle-wave' ); Returns an iterator which generates a triangle wave. ```javascript -var it = iterTriangleWave(); +const it = iterTriangleWave(); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; @@ -94,14 +94,14 @@ The function supports the following `options`: By default, the function returns an iterator which generates a triangle wave that repeats every `10` iterations. To specify an alternative period, set the `period` option. ```javascript -var opts = { +const opts = { 'period': 4 }; -var it = iterTriangleWave( opts ); +const it = iterTriangleWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 0.0 v = it.next().value; @@ -122,15 +122,15 @@ v = it.next().value; To adjust at what point the iterator begins in the waveform cycle, set the phase `offset` option. For example, to translate the waveform to the left, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': -1 }; -var it = iterTriangleWave( opts ); +const it = iterTriangleWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; @@ -151,15 +151,15 @@ v = it.next().value; To translate the waveform to the right, ```javascript -var opts = { +const opts = { 'period': 4, 'offset': 1 }; -var it = iterTriangleWave( opts ); +const it = iterTriangleWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns -1.0 v = it.next().value; @@ -180,19 +180,19 @@ v = it.next().value; By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript -var opts = { +const opts = { 'iter': 2 }; -var it = iterTriangleWave( opts ); +const it = iterTriangleWave( opts ); // returns -var v = it.next().value; +let v = it.next().value; // returns v = it.next().value; // returns -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -221,19 +221,19 @@ var bool = it.next().done; ```javascript -var iterTriangleWave = require( '@stdlib/simulate/iter/triangle-wave' ); +const iterTriangleWave = require( '@stdlib/simulate/iter/triangle-wave' ); // Create an iterator: -var opts = { +const opts = { 'period': 10, 'amplitude': 10.0, 'offset': -5, 'iter': 100 }; -var it = iterTriangleWave( opts ); +const it = iterTriangleWave( opts ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/slice/README.md b/lib/node_modules/@stdlib/slice/README.md index b9c3a30b85e4..7c20b6e42b9d 100644 --- a/lib/node_modules/@stdlib/slice/README.md +++ b/lib/node_modules/@stdlib/slice/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/slice' ); +const ns = require( '@stdlib/slice' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/slice' ); Slice namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -67,8 +67,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/slice' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/slice' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/slice/base/README.md b/lib/node_modules/@stdlib/slice/base/README.md index 64afcd721a4d..acb694cf2cc8 100644 --- a/lib/node_modules/@stdlib/slice/base/README.md +++ b/lib/node_modules/@stdlib/slice/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/slice/base' ); +const ns = require( '@stdlib/slice/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/slice/base' ); Base slice namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -77,8 +77,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/slice/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/slice/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/slice/base/args2multislice/README.md b/lib/node_modules/@stdlib/slice/base/args2multislice/README.md index f69e68829edb..b568185c0bb3 100644 --- a/lib/node_modules/@stdlib/slice/base/args2multislice/README.md +++ b/lib/node_modules/@stdlib/slice/base/args2multislice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var args2multislice = require( '@stdlib/slice/base/args2multislice' ); +const args2multislice = require( '@stdlib/slice/base/args2multislice' ); ``` @@ -47,12 +47,12 @@ var args2multislice = require( '@stdlib/slice/base/args2multislice' ); Creates a [`MultiSlice`][@stdlib/slice/multi] object from a list of [`MultiSlice`][@stdlib/slice/multi] constructor arguments. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = args2multislice( [ 0, new Slice( 2, 10, 1 ), 1 ] ); +const s = args2multislice( [ 0, new Slice( 2, 10, 1 ), 1 ] ); // returns -var d = s.data; +const d = s.data; // returns [ 0, , 1 ] ``` @@ -81,13 +81,13 @@ var d = s.data; ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var args2multislice = require( '@stdlib/slice/base/args2multislice' ); +const Slice = require( '@stdlib/slice/ctor' ); +const args2multislice = require( '@stdlib/slice/base/args2multislice' ); -var s = args2multislice( [ null, null, null ] ); +let s = args2multislice( [ null, null, null ] ); // returns -var d = s.data; +let d = s.data; // returns [ null, null, null ] s = args2multislice( [ 10, new Slice( 2, 10, 1 ), null ] ); diff --git a/lib/node_modules/@stdlib/slice/base/int2slice/README.md b/lib/node_modules/@stdlib/slice/base/int2slice/README.md index 8d49ffddd3d1..3d70f49e62ce 100644 --- a/lib/node_modules/@stdlib/slice/base/int2slice/README.md +++ b/lib/node_modules/@stdlib/slice/base/int2slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var int2slice = require( '@stdlib/slice/base/int2slice' ); +const int2slice = require( '@stdlib/slice/base/int2slice' ); ``` @@ -49,23 +49,23 @@ Converts an integer to a [`Slice`][@stdlib/slice/ctor] object, where `max` speci ```javascript -var s = int2slice( -4, 10, false ); +const s = int2slice( -4, 10, false ); // returns -var start = s.start; +const start = s.start; // returns 6 -var stop = s.stop; +const stop = s.stop; // returns 7 -var step = s.step; +const step = s.step; // returns 1 ``` When `strict` is `true`, the function returns an error object if an input value exceeds index bounds. ```javascript -var s = int2slice( 100, 10, true ); +const s = int2slice( 100, 10, true ); // returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' } ``` @@ -94,9 +94,9 @@ A returned error object may have one of the following error codes: ```javascript -var int2slice = require( '@stdlib/slice/base/int2slice' ); +const int2slice = require( '@stdlib/slice/base/int2slice' ); -var s = int2slice( -1, 7, false ); +let s = int2slice( -1, 7, false ); console.log( '%s', s.toString() ); s = int2slice( 3, 5, false ); diff --git a/lib/node_modules/@stdlib/slice/base/length/README.md b/lib/node_modules/@stdlib/slice/base/length/README.md index eb61f82b022c..7048fb7e28b9 100644 --- a/lib/node_modules/@stdlib/slice/base/length/README.md +++ b/lib/node_modules/@stdlib/slice/base/length/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceLength = require( '@stdlib/slice/base/length' ); +const sliceLength = require( '@stdlib/slice/base/length' ); ``` @@ -47,13 +47,13 @@ var sliceLength = require( '@stdlib/slice/base/length' ); Returns the number of elements in a [normalized slice][@stdlib/slice/base/normalize-slice]. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); +const Slice = require( '@stdlib/slice/ctor' ); +const normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); -var s = normalizeSlice( new Slice( -3, null, -1 ), 10, false ); +const s = normalizeSlice( new Slice( -3, null, -1 ), 10, false ); // returns -var len = sliceLength( s ); +const len = sliceLength( s ); // returns 8 ``` @@ -78,14 +78,14 @@ var len = sliceLength( s ); ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); -var incrspace = require( '@stdlib/array/base/incrspace' ); -var sliceLength = require( '@stdlib/slice/base/length' ); - -var s1 = new Slice( 2, null, -1 ); -var s2 = normalizeSlice( s1, 10, false ); -var v = sliceLength( s2 ); +const Slice = require( '@stdlib/slice/ctor' ); +const normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const sliceLength = require( '@stdlib/slice/base/length' ); + +let s1 = new Slice( 2, null, -1 ); +let s2 = normalizeSlice( s1, 10, false ); +let v = sliceLength( s2 ); console.log( '%s => %s => %d', s1.toString(), s2.toString(), v ); console.log( '[ %s ]', incrspace( s2.start, s2.stop || -1, s2.step ).join( ', ' ) ); // => '[ 2, 1, 0 ]' diff --git a/lib/node_modules/@stdlib/slice/base/nonreduced-dimensions/README.md b/lib/node_modules/@stdlib/slice/base/nonreduced-dimensions/README.md index 939768b84494..da934c4dafad 100644 --- a/lib/node_modules/@stdlib/slice/base/nonreduced-dimensions/README.md +++ b/lib/node_modules/@stdlib/slice/base/nonreduced-dimensions/README.md @@ -39,7 +39,7 @@ In a multi-axis indexing expression (e.g., '1,:,2,:,0:10:1'), a non-reduced dime ## Usage ```javascript -var nonreducedDimensions = require( '@stdlib/slice/base/nonreduced-dimensions' ); +const nonreducedDimensions = require( '@stdlib/slice/base/nonreduced-dimensions' ); ``` @@ -49,13 +49,13 @@ var nonreducedDimensions = require( '@stdlib/slice/base/nonreduced-dimensions' ) Returns a list of non-reduced dimensions in an un-normalized [`MultiSlice`][@stdlib/slice/multi] object. ```javascript -var MultiSlice = require( '@stdlib/slice/multi' ); -var Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) ); +const s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) ); // returns -var indices = nonreducedDimensions( s ); +const indices = nonreducedDimensions( s ); // returns [ 1, 3, 4 ] ``` @@ -82,12 +82,12 @@ var indices = nonreducedDimensions( s ); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var nonreducedDimensions = require( '@stdlib/slice/base/nonreduced-dimensions' ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const nonreducedDimensions = require( '@stdlib/slice/base/nonreduced-dimensions' ); -var s = new MultiSlice( null, S(), -1 ); -var out = nonreducedDimensions( s ); +let s = new MultiSlice( null, S(), -1 ); +let out = nonreducedDimensions( s ); console.log( '%s => [%s]', s.toString(), out.join( ',' ) ); s = new MultiSlice( null ); diff --git a/lib/node_modules/@stdlib/slice/base/normalize-multi-slice/README.md b/lib/node_modules/@stdlib/slice/base/normalize-multi-slice/README.md index 1cfa68950015..e8888051af52 100644 --- a/lib/node_modules/@stdlib/slice/base/normalize-multi-slice/README.md +++ b/lib/node_modules/@stdlib/slice/base/normalize-multi-slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); +const normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); ``` @@ -49,28 +49,28 @@ Normalizes a [`MultiSlice`][@stdlib/slice/multi] object, where `shape` specifies ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); -var shape = [ 10, 10, 10 ]; +const shape = [ 10, 10, 10 ]; -var s1 = new MultiSlice( new Slice( 2, null, 2 ), null, -4 ); -var s2 = normalizeMultiSlice( s1, shape, false ); +const s1 = new MultiSlice( new Slice( 2, null, 2 ), null, -4 ); +const s2 = normalizeMultiSlice( s1, shape, false ); // returns -var d = s2.data; +const d = s2.data; // returns [ , , ] -var v = d[ 0 ]; +let v = d[ 0 ]; // returns -var start = v.start; +let start = v.start; // returns 2 -var stop = v.stop; +let stop = v.stop; // returns 10 -var step = v.step; +let step = v.step; // returns 2 v = d[ 1 ]; @@ -101,11 +101,11 @@ step = v.step; When `strict` is `true`, the function returns an error object if an input slice exceeds index bounds. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); +const Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); -var s1 = new MultiSlice( new Slice( -20, 20, 1 ) ); -var s2 = normalizeMultiSlice( s1, [ 10 ], true ); +const s1 = new MultiSlice( new Slice( -20, 20, 1 ) ); +const s2 = normalizeMultiSlice( s1, [ 10 ], true ); // returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' } ``` @@ -136,12 +136,12 @@ A returned error object may have one of the following error codes: ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); -var s1 = new MultiSlice( null, S(), -1 ); -var s2 = normalizeMultiSlice( s1, [ 5, 10, 7 ], false ); +let s1 = new MultiSlice( null, S(), -1 ); +let s2 = normalizeMultiSlice( s1, [ 5, 10, 7 ], false ); console.log( '%s => %s', s1.toString(), s2.toString() ); s1 = new MultiSlice( null ); diff --git a/lib/node_modules/@stdlib/slice/base/normalize-slice/README.md b/lib/node_modules/@stdlib/slice/base/normalize-slice/README.md index 518bac951602..2431ce83809f 100644 --- a/lib/node_modules/@stdlib/slice/base/normalize-slice/README.md +++ b/lib/node_modules/@stdlib/slice/base/normalize-slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); +const normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); ``` @@ -47,12 +47,12 @@ var normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); Normalizes a [`Slice`][@stdlib/slice/ctor] object, where `len` specifies the maximum number of elements allowed in the slice. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = normalizeSlice( new Slice( -1, null, -1 ), 10, false ); +const s = normalizeSlice( new Slice( -1, null, -1 ), 10, false ); // returns -var v = s.start; +let v = s.start; // returns 9 v = s.stop; @@ -65,9 +65,9 @@ v = s.step; When `strict` is `true`, the function returns an error object if an input slice exceeds index bounds. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = normalizeSlice( new Slice( -20, 20, 1 ), 10, true ); +const s = normalizeSlice( new Slice( -20, 20, 1 ), 10, true ); // returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' } ``` @@ -96,10 +96,10 @@ A returned error object may have one of the following error codes: ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); +const Slice = require( '@stdlib/slice/ctor' ); +const normalizeSlice = require( '@stdlib/slice/base/normalize-slice' ); -var s = normalizeSlice( new Slice(), 5, false ); +let s = normalizeSlice( new Slice(), 5, false ); console.log( 'start: %s. stop: %s. step: %s.', s.start, s.stop, s.step ); // => 'start: 0. stop: 5. step: 1.' diff --git a/lib/node_modules/@stdlib/slice/base/reduced-dimensions/README.md b/lib/node_modules/@stdlib/slice/base/reduced-dimensions/README.md index 56cf5b92ff10..caabe79a0c7e 100644 --- a/lib/node_modules/@stdlib/slice/base/reduced-dimensions/README.md +++ b/lib/node_modules/@stdlib/slice/base/reduced-dimensions/README.md @@ -39,7 +39,7 @@ In a multi-axis indexing expression (e.g., '1,:,2,:,0:10:1'), a non-reduced dime ## Usage ```javascript -var reducedDimensions = require( '@stdlib/slice/base/reduced-dimensions' ); +const reducedDimensions = require( '@stdlib/slice/base/reduced-dimensions' ); ``` @@ -49,13 +49,13 @@ var reducedDimensions = require( '@stdlib/slice/base/reduced-dimensions' ); Returns a list of reduced dimensions in an un-normalized [`MultiSlice`][@stdlib/slice/multi] object. ```javascript -var MultiSlice = require( '@stdlib/slice/multi' ); -var Slice = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) ); +const s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) ); // returns -var indices = reducedDimensions( s ); +const indices = reducedDimensions( s ); // returns [ 0, 2 ] ``` @@ -82,12 +82,12 @@ var indices = reducedDimensions( s ); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var reducedDimensions = require( '@stdlib/slice/base/reduced-dimensions' ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const reducedDimensions = require( '@stdlib/slice/base/reduced-dimensions' ); -var s = new MultiSlice( null, S(), -1 ); -var out = reducedDimensions( s ); +let s = new MultiSlice( null, S(), -1 ); +let out = reducedDimensions( s ); console.log( '%s => [%s]', s.toString(), out.join( ',' ) ); s = new MultiSlice( null ); diff --git a/lib/node_modules/@stdlib/slice/base/sargs2multislice/README.md b/lib/node_modules/@stdlib/slice/base/sargs2multislice/README.md index d08a5b6208b8..709cf0925bc5 100644 --- a/lib/node_modules/@stdlib/slice/base/sargs2multislice/README.md +++ b/lib/node_modules/@stdlib/slice/base/sargs2multislice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sargs2multislice = require( '@stdlib/slice/base/sargs2multislice' ); +const sargs2multislice = require( '@stdlib/slice/base/sargs2multislice' ); ``` @@ -47,17 +47,17 @@ var sargs2multislice = require( '@stdlib/slice/base/sargs2multislice' ); Creates a [`MultiSlice`][@stdlib/slice/multi] object from a comma-separated list of string-serialized [`MultiSlice`][@stdlib/slice/multi] constructor arguments. ```javascript -var s = sargs2multislice( '0,Slice(2,10,1),1' ); +const s = sargs2multislice( '0,Slice(2,10,1),1' ); // returns -var d = s.data; +const d = s.data; // returns [ 0, , 1 ] ``` The function returns `null` if provided an invalid string. ```javascript -var s = sargs2multislice( 'foo,bar' ); +const s = sargs2multislice( 'foo,bar' ); // returns null ``` @@ -74,21 +74,21 @@ var s = sargs2multislice( 'foo,bar' ); - This function is useful from wanting to create a [`MultiSlice`][@stdlib/slice/multi] object from an array of constructor arguments which has been serialized to a string (e.g., when working with [`Proxy`][@stdlib/proxy/ctor] objects supporting slicing]. ```javascript - var Slice = require( '@stdlib/slice/ctor' ); + const Slice = require( '@stdlib/slice/ctor' ); - var args = [ 0, new Slice( 2, 10, 1 ), 1 ]; + const args = [ 0, new Slice( 2, 10, 1 ), 1 ]; // ... - var sargs = args.toString(); + const sargs = args.toString(); // returns '0,Slice(2,10,1),1' // ... - var s = sargs2multislice( sargs ); + const s = sargs2multislice( sargs ); // returns - var d = s.data; + const d = s.data; // returns [ 0, , 1 ] ``` @@ -105,10 +105,10 @@ var s = sargs2multislice( 'foo,bar' ); ```javascript -var sargs2multislice = require( '@stdlib/slice/base/sargs2multislice' ); +const sargs2multislice = require( '@stdlib/slice/base/sargs2multislice' ); -var s = sargs2multislice( 'null,null,null' ); -var d = s.data; +let s = sargs2multislice( 'null,null,null' ); +let d = s.data; // returns [ null, null, null ] s = sargs2multislice( '10,Slice(2,10,1),null' ); diff --git a/lib/node_modules/@stdlib/slice/base/seq2multislice/README.md b/lib/node_modules/@stdlib/slice/base/seq2multislice/README.md index 484deaea2cb1..3c8628260c50 100644 --- a/lib/node_modules/@stdlib/slice/base/seq2multislice/README.md +++ b/lib/node_modules/@stdlib/slice/base/seq2multislice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var seq2multislice = require( '@stdlib/slice/base/seq2multislice' ); +const seq2multislice = require( '@stdlib/slice/base/seq2multislice' ); ``` @@ -47,13 +47,13 @@ var seq2multislice = require( '@stdlib/slice/base/seq2multislice' ); Converts a multidimensional subsequence string to a [`MultiSlice`][@stdlib/slice/multi] object, where `shape` specifies the maximum allowed slice shape. ```javascript -var s = seq2multislice( ':5', [ 10 ], false ); +const s = seq2multislice( ':5', [ 10 ], false ); // returns -var s0 = s.data[ 0 ]; +const s0 = s.data[ 0 ]; // returns -var v = s0.start; +let v = s0.start; // returns 0 v = s0.stop; @@ -87,14 +87,14 @@ A multidimensional subsequence string is a comma-separated list of single-dimens are all valid multidimensional subsequence strings. The function returns an error object if provided an invalid subsequence string. ```javascript -var s = seq2multislice( '1:2:3:4', [ 10 ], false ); +const s = seq2multislice( '1:2:3:4', [ 10 ], false ); // returns { 'code': 'ERR_SLICE_INVALID_SUBSEQUENCE' } ``` When `strict` is `true`, the function returns an error object if a subsequence string resolves to a slice exceeding index bounds. ```javascript -var s = seq2multislice( '10:20', [ 10 ], true ); +const s = seq2multislice( '10:20', [ 10 ], true ); // returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' } ``` @@ -136,10 +136,10 @@ A returned error object may have one of the following error codes: ```javascript -var seq2multislice = require( '@stdlib/slice/base/seq2multislice' ); +const seq2multislice = require( '@stdlib/slice/base/seq2multislice' ); -var s = seq2multislice( ':,:,:', [ 10, 10, 10 ], false ); -var d = s.data; +let s = seq2multislice( ':,:,:', [ 10, 10, 10 ], false ); +let d = s.data; // returns [ , , ] s = seq2multislice( '3,2:10,:', [ 10, 10, 10 ], false ); diff --git a/lib/node_modules/@stdlib/slice/base/seq2slice/README.md b/lib/node_modules/@stdlib/slice/base/seq2slice/README.md index bd9fd988840e..79ae52eb04ba 100644 --- a/lib/node_modules/@stdlib/slice/base/seq2slice/README.md +++ b/lib/node_modules/@stdlib/slice/base/seq2slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var seq2slice = require( '@stdlib/slice/base/seq2slice' ); +const seq2slice = require( '@stdlib/slice/base/seq2slice' ); ``` @@ -47,10 +47,10 @@ var seq2slice = require( '@stdlib/slice/base/seq2slice' ); Converts a subsequence string to a [`Slice`][@stdlib/slice/ctor] object, where `len` specifies the maximum number of elements allowed in the slice. ```javascript -var s = seq2slice( ':5', 10, false ); +const s = seq2slice( ':5', 10, false ); // returns -var v = s.start; +let v = s.start; // returns 0 v = s.stop; @@ -77,10 +77,10 @@ where - The `end` keyword resolves to the provided length `len`. Thus, `:-1` is equivalent to `:end-1`, `:-2` is equivalent to `:end-2`, and so on and so forth. The exception is when performing a division operation when the `increment` is less than zero; in which case, `end` is equal to `len-1` in order to preserve user expectations when `end/d` equals a whole number and slicing from right-to-left. The result from a division operation is **rounded down** to the nearest integer value. ```javascript -var s = seq2slice( 'end:2:-1', 10, false ); +let s = seq2slice( 'end:2:-1', 10, false ); // returns -var v = s.start; +let v = s.start; // returns 9 v = s.stop; @@ -117,14 +117,14 @@ v = s.step; The function returns an error object if provided an invalid subsequence string. ```javascript -var s = seq2slice( '1:2:3:4', 10, false ); +const s = seq2slice( '1:2:3:4', 10, false ); // returns { 'code': 'ERR_SLICE_INVALID_SUBSEQUENCE' } ``` When `strict` is `true`, the function returns an error object if a subsequence string resolves to a slice exceeding index bounds. ```javascript -var s = seq2slice( '10:20', 10, true ); +const s = seq2slice( '10:20', 10, true ); // returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' } ``` @@ -164,9 +164,9 @@ A returned error object may have one of the following error codes: ```javascript -var seq2slice = require( '@stdlib/slice/base/seq2slice' ); +const seq2slice = require( '@stdlib/slice/base/seq2slice' ); -var s = seq2slice( ':', 5, false ); +let s = seq2slice( ':', 5, false ); console.log( 'start: %s. stop: %s. step: %s.', s.start, s.stop, s.step ); // => 'start: 0. stop: 5. step: 1.' diff --git a/lib/node_modules/@stdlib/slice/base/shape/README.md b/lib/node_modules/@stdlib/slice/base/shape/README.md index 55517f3ce180..670647871dac 100644 --- a/lib/node_modules/@stdlib/slice/base/shape/README.md +++ b/lib/node_modules/@stdlib/slice/base/shape/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sliceShape = require( '@stdlib/slice/base/shape' ); +const sliceShape = require( '@stdlib/slice/base/shape' ); ``` @@ -49,17 +49,17 @@ Returns the shape of a [normalized multi-slice][@stdlib/slice/base/normalize-mul ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); -var s = new MultiSlice( S( -4, null, -1 ), S( 2, 10, 1 ) ); +let s = new MultiSlice( S( -4, null, -1 ), S( 2, 10, 1 ) ); // returns s = normalizeMultiSlice( s, [ 10, 10 ], false ); // returns -var sh = sliceShape( s ); +const sh = sliceShape( s ); // returns [ 7, 8 ] ``` @@ -86,14 +86,14 @@ var sh = sliceShape( s ); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); -var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); -var sliceShape = require( '@stdlib/slice/base/shape' ); - -var s1 = new MultiSlice( S( 3, null, -1 ), S( 3, 7, 1 ) ); -var s2 = normalizeMultiSlice( s1, [ 10, 10 ], false ); -var sh = sliceShape( s2 ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); +const normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' ); +const sliceShape = require( '@stdlib/slice/base/shape' ); + +let s1 = new MultiSlice( S( 3, null, -1 ), S( 3, 7, 1 ) ); +let s2 = normalizeMultiSlice( s1, [ 10, 10 ], false ); +let sh = sliceShape( s2 ); console.log( '%s => %s', s1.toString(), s2.toString() ); console.log( '[ %s ]', sh.join( ', ' ) ); // => '[ 4, 4 ]' diff --git a/lib/node_modules/@stdlib/slice/base/slice2seq/README.md b/lib/node_modules/@stdlib/slice/base/slice2seq/README.md index 89a3b9b05789..6f66ef11ca7b 100644 --- a/lib/node_modules/@stdlib/slice/base/slice2seq/README.md +++ b/lib/node_modules/@stdlib/slice/base/slice2seq/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var slice2seq = require( '@stdlib/slice/base/slice2seq' ); +const slice2seq = require( '@stdlib/slice/base/slice2seq' ); ``` @@ -47,9 +47,9 @@ var slice2seq = require( '@stdlib/slice/base/slice2seq' ); Converts a [`Slice`][@stdlib/slice/ctor] object to a subsequence string. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var str = slice2seq( new Slice( 0, 5, 1 ) ); +const str = slice2seq( new Slice( 0, 5, 1 ) ); // returns '0:5:1' ``` @@ -74,10 +74,10 @@ var str = slice2seq( new Slice( 0, 5, 1 ) ); ```javascript -var Slice = require( '@stdlib/slice/ctor' ); -var slice2seq = require( '@stdlib/slice/base/slice2seq' ); +const Slice = require( '@stdlib/slice/ctor' ); +const slice2seq = require( '@stdlib/slice/base/slice2seq' ); -var str = slice2seq( new Slice( null, null, null ) ); +let str = slice2seq( new Slice( null, null, null ) ); // returns ':' str = slice2seq( new Slice() ); diff --git a/lib/node_modules/@stdlib/slice/base/str2multislice/README.md b/lib/node_modules/@stdlib/slice/base/str2multislice/README.md index 95dfba4c4f7e..95903dc2c16e 100644 --- a/lib/node_modules/@stdlib/slice/base/str2multislice/README.md +++ b/lib/node_modules/@stdlib/slice/base/str2multislice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2multislice = require( '@stdlib/slice/base/str2multislice' ); +const str2multislice = require( '@stdlib/slice/base/str2multislice' ); ``` @@ -47,17 +47,17 @@ var str2multislice = require( '@stdlib/slice/base/str2multislice' ); Parses a string-serialized [`MultiSlice`][@stdlib/slice/multi] object. ```javascript -var s = str2multislice( 'MultiSlice(0,Slice(2,10,1),1)' ); +const s = str2multislice( 'MultiSlice(0,Slice(2,10,1),1)' ); // returns -var d = s.data; +const d = s.data; // returns [ 0, , 1 ] ``` The function returns `null` if provided an invalid string. ```javascript -var s = str2multislice( 'MultiSlice(foo,bar)' ); +const s = str2multislice( 'MultiSlice(foo,bar)' ); // returns null ``` @@ -74,13 +74,13 @@ var s = str2multislice( 'MultiSlice(foo,bar)' ); - The string serialization format must match that of a [`MultiSlice`][@stdlib/slice/multi] object. ```javascript - var Slice = require( '@stdlib/slice/ctor' ); - var MultiSlice = require( '@stdlib/slice/multi' ); + const Slice = require( '@stdlib/slice/ctor' ); + const MultiSlice = require( '@stdlib/slice/multi' ); - var s = new MultiSlice( null, new Slice( 2, 10, 1 ), 10 ); + const s = new MultiSlice( null, new Slice( 2, 10, 1 ), 10 ); // returns - var str = s.toString(); + const str = s.toString(); // returns 'MultiSlice(null,Slice(2,10,1),10)' ``` @@ -97,10 +97,10 @@ var s = str2multislice( 'MultiSlice(foo,bar)' ); ```javascript -var str2multislice = require( '@stdlib/slice/base/str2multislice' ); +const str2multislice = require( '@stdlib/slice/base/str2multislice' ); -var s = str2multislice( 'MultiSlice(null,null,null)' ); -var d = s.data; +let s = str2multislice( 'MultiSlice(null,null,null)' ); +let d = s.data; // returns [ null, null, null ] s = str2multislice( 'MultiSlice(10,Slice(2,10,1),null)' ); diff --git a/lib/node_modules/@stdlib/slice/base/str2slice/README.md b/lib/node_modules/@stdlib/slice/base/str2slice/README.md index b1664e2274b0..de06f0218105 100644 --- a/lib/node_modules/@stdlib/slice/base/str2slice/README.md +++ b/lib/node_modules/@stdlib/slice/base/str2slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2slice = require( '@stdlib/slice/base/str2slice' ); +const str2slice = require( '@stdlib/slice/base/str2slice' ); ``` @@ -47,10 +47,10 @@ var str2slice = require( '@stdlib/slice/base/str2slice' ); Parses a string-serialized [`Slice`][@stdlib/slice/ctor] object. ```javascript -var s = str2slice( 'Slice(0,5,1)' ); +const s = str2slice( 'Slice(0,5,1)' ); // returns -var v = s.start; +let v = s.start; // returns 0 v = s.stop; @@ -63,7 +63,7 @@ v = s.step; The function returns `null` if provided an invalid string. ```javascript -var s = str2slice( 'Slice(foo,bar)' ); +const s = str2slice( 'Slice(foo,bar)' ); // returns null ``` @@ -80,12 +80,12 @@ var s = str2slice( 'Slice(foo,bar)' ); - The string serialization format must match that of a [`Slice`][@stdlib/slice/ctor] object. ```javascript - var Slice = require( '@stdlib/slice/ctor' ); + const Slice = require( '@stdlib/slice/ctor' ); - var s = new Slice( 2, 10, 1 ); + const s = new Slice( 2, 10, 1 ); // returns - var str = s.toString(); + const str = s.toString(); // returns 'Slice(2,10,1)' ``` @@ -102,9 +102,9 @@ var s = str2slice( 'Slice(foo,bar)' ); ```javascript -var str2slice = require( '@stdlib/slice/base/str2slice' ); +const str2slice = require( '@stdlib/slice/base/str2slice' ); -var s = str2slice( 'Slice(null,null,null)' ); +let s = str2slice( 'Slice(null,null,null)' ); console.log( 'start: %s. stop: %s. step: %s.', s.start, s.stop, s.step ); // => 'start: null. stop: null. step: null.' diff --git a/lib/node_modules/@stdlib/slice/ctor/README.md b/lib/node_modules/@stdlib/slice/ctor/README.md index fb08fd328832..066b4524aa38 100644 --- a/lib/node_modules/@stdlib/slice/ctor/README.md +++ b/lib/node_modules/@stdlib/slice/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); ``` @@ -47,7 +47,7 @@ var Slice = require( '@stdlib/slice/ctor' ); Returns a `Slice` instance. ```javascript -var s = new Slice(); +let s = new Slice(); // returns s = new Slice(); @@ -63,7 +63,7 @@ The constructor accepts the following arguments: Returns a `Slice` instance. ```javascript -var s = new Slice( 0, 10 ); +let s = new Slice( 0, 10 ); // returns s = new Slice( 0, 10, 1 ); @@ -87,7 +87,7 @@ The constructor accepts the following arguments: String value of the `Slice` constructor name. ```javascript -var str = Slice.name; +const str = Slice.name; // returns 'Slice' ``` @@ -98,10 +98,10 @@ var str = Slice.name; **Read-only** property returning the slice starting index. ```javascript -var s = new Slice( 10 ); +let s = new Slice( 10 ); // returns -var start = s.start; +let start = s.start; // returns null s = new Slice( 2, 10 ); @@ -120,10 +120,10 @@ start = s.start; ```javascript -var s = new Slice( null ); +let s = new Slice( null ); // returns -var stop = s.stop; +let stop = s.stop; // returns null s = new Slice( 10 ); @@ -146,10 +146,10 @@ stop = s.stop; **Read-only** property returning the slice index increment. ```javascript -var s = new Slice( 10 ); +let s = new Slice( 10 ); // returns -var step = s.step; +let step = s.step; // returns null s = new Slice( 2, 10 ); @@ -176,10 +176,10 @@ step = s.step; Serializes a `Slice` as a string. ```javascript -var s = new Slice( 10 ); +let s = new Slice( 10 ); // returns -var str = s.toString(); +let str = s.toString(); // returns 'Slice(null,10,null)' s = new Slice( 2, 10, 1 ); @@ -196,10 +196,10 @@ str = s.toString(); Serializes a `Slice` as a [JSON][json] object. ```javascript -var s = new Slice( 10 ); +let s = new Slice( 10 ); // returns -var o = s.toJSON(); +let o = s.toJSON(); // returns { 'type': 'Slice', 'data': [ null, 10, null ] } s = new Slice( 2, 10, 1 ); @@ -243,28 +243,28 @@ o = s.toJSON(); ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 9, -10, -1 ); +const s = new Slice( 9, -10, -1 ); // returns -var start = s.start; +const start = s.start; console.log( 'Start: %d', start ); // => 'Start: 9' -var stop = s.stop; +const stop = s.stop; console.log( 'Stop: %d', stop ); // => 'Stop: -10' -var step = s.step; +const step = s.step; console.log( 'Step: %d', step ); // => 'Step: -1' -var str = s.toString(); +const str = s.toString(); console.log( str ); // => 'Slice(9,-10,-1)' -var o = s.toJSON(); +const o = s.toJSON(); console.log( JSON.stringify( o ) ); // => '{"type":"Slice","data":[9,-10,-1]}' ``` diff --git a/lib/node_modules/@stdlib/slice/multi/README.md b/lib/node_modules/@stdlib/slice/multi/README.md index 6acac45e27e4..56d96e73a99a 100644 --- a/lib/node_modules/@stdlib/slice/multi/README.md +++ b/lib/node_modules/@stdlib/slice/multi/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var MultiSlice = require( '@stdlib/slice/multi' ); +const MultiSlice = require( '@stdlib/slice/multi' ); ``` @@ -47,12 +47,12 @@ var MultiSlice = require( '@stdlib/slice/multi' ); Returns a `MultiSlice` instance. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 0, 10 ); +const s = new Slice( 0, 10 ); // returns -var ms = new MultiSlice( 2, s, null ); +const ms = new MultiSlice( 2, s, null ); // returns ``` @@ -71,7 +71,7 @@ The constructor accepts the following arguments: String value of the `MultiSlice` constructor name. ```javascript -var str = MultiSlice.name; +const str = MultiSlice.name; // returns 'MultiSlice' ``` @@ -82,15 +82,15 @@ var str = MultiSlice.name; **Read-only** property returning the number of slice dimensions. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 0, 10 ); +const s = new Slice( 0, 10 ); // returns -var ms = new MultiSlice( 2, s, null ); +const ms = new MultiSlice( 2, s, null ); // returns -var ndims = ms.ndims; +const ndims = ms.ndims; // returns 3 ``` @@ -101,15 +101,15 @@ var ndims = ms.ndims; **Read-only** property returning the slice data. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 0, 10 ); +const s = new Slice( 0, 10 ); // returns -var ms = new MultiSlice( 2, s, null ); +const ms = new MultiSlice( 2, s, null ); // returns -var data = ms.data; +const data = ms.data; // returns [ 2, , null ] ``` @@ -124,15 +124,15 @@ var data = ms.data; Serializes a `MultiSlice` as a string. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 10 ); +const s = new Slice( 10 ); // returns -var ms = new MultiSlice( 2, s, null ); +const ms = new MultiSlice( 2, s, null ); // returns -var str = ms.toString(); +const str = ms.toString(); // returns 'MultiSlice(2,Slice(null,10,null),null)' ``` @@ -143,15 +143,15 @@ var str = ms.toString(); Serializes a `MultiSlice` as a [JSON][json] object. ```javascript -var Slice = require( '@stdlib/slice/ctor' ); +const Slice = require( '@stdlib/slice/ctor' ); -var s = new Slice( 10 ); +const s = new Slice( 10 ); // returns -var ms = new MultiSlice( 2, s, null ); +const ms = new MultiSlice( 2, s, null ); // returns -var o = ms.toJSON(); +const o = ms.toJSON(); // returns { 'type': 'MultiSlice', 'data': [ 2, { 'type': 'Slice', 'data': [ null, 10, null ] }, null ] } ``` @@ -189,23 +189,23 @@ var o = ms.toJSON(); ```javascript -var S = require( '@stdlib/slice/ctor' ); -var MultiSlice = require( '@stdlib/slice/multi' ); +const S = require( '@stdlib/slice/ctor' ); +const MultiSlice = require( '@stdlib/slice/multi' ); // Alias `undefined` for more concise expressions: -var _ = void 0; +const _ = void 0; // Create a 6-dimensional slice: -var s = new MultiSlice( S( 9, -10, -1 ), S( 2, _, 2 ), 2, S( 5, _, 2 ), 3, _ ); +const s = new MultiSlice( S( 9, -10, -1 ), S( 2, _, 2 ), 2, S( 5, _, 2 ), 3, _ ); // returns // Serialize the slice to a string: -var str = s.toString(); +const str = s.toString(); console.log( str ); // => 'MultiSlice(Slice(9,-10,-1),Slice(2,null,2),2,Slice(5,null,2),3,null)' // Serialize the slice to JSON: -var o = s.toJSON(); +const o = s.toJSON(); console.log( JSON.stringify( o ) ); // => '{"type":"MultiSlice","data":[{"type":"Slice","data":[9,-10,-1]},{"type":"Slice","data":[2,null,2]},2,{"type":"Slice","data":[5,null,2]},3,null]}' ``` diff --git a/lib/node_modules/@stdlib/slice/seq2slice/README.md b/lib/node_modules/@stdlib/slice/seq2slice/README.md index dd7144f67539..26f293123d50 100644 --- a/lib/node_modules/@stdlib/slice/seq2slice/README.md +++ b/lib/node_modules/@stdlib/slice/seq2slice/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var seq2slice = require( '@stdlib/slice/seq2slice' ); +const seq2slice = require( '@stdlib/slice/seq2slice' ); ``` @@ -47,10 +47,10 @@ var seq2slice = require( '@stdlib/slice/seq2slice' ); Converts a subsequence string to a [`Slice`][@stdlib/slice/ctor] object, where `len` specifies the maximum number of elements allowed in the slice. ```javascript -var s = seq2slice( ':5', 10, false ); +const s = seq2slice( ':5', 10, false ); // returns -var v = s.start; +let v = s.start; // returns 0 v = s.stop; @@ -77,10 +77,10 @@ where - The `end` keyword resolves to the provided length `len`. Thus, `:-1` is equivalent to `:end-1`, `:-2` is equivalent to `:end-2`, and so on and so forth. The exception is when performing a division operation when the `increment` is less than zero; in which case, `end` is equal to `len-1` in order to preserve user expectations when `end/d` equals a whole number and slicing from right-to-left. The result from a division operation is **rounded down** to the nearest integer value. ```javascript -var s = seq2slice( 'end:2:-1', 10, false ); +let s = seq2slice( 'end:2:-1', 10, false ); // returns -var v = s.start; +let v = s.start; // returns 9 v = s.stop; @@ -119,7 +119,7 @@ When `strict` is `true`, the function throws an error if a subsequence string re ```javascript -var s = seq2slice( '10:20', 10, true ); +const s = seq2slice( '10:20', 10, true ); // throws ``` @@ -153,9 +153,9 @@ var s = seq2slice( '10:20', 10, true ); ```javascript -var seq2slice = require( '@stdlib/slice/seq2slice' ); +const seq2slice = require( '@stdlib/slice/seq2slice' ); -var s = seq2slice( ':', 5, false ); +let s = seq2slice( ':', 5, false ); console.log( 'start: %s. stop: %s. step: %s.', s.start, s.stop, s.step ); // => 'start: 0. stop: 5. step: 1.' diff --git a/lib/node_modules/@stdlib/stats/README.md b/lib/node_modules/@stdlib/stats/README.md index 92324b9f349e..e9904fae8951 100644 --- a/lib/node_modules/@stdlib/stats/README.md +++ b/lib/node_modules/@stdlib/stats/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var statistics = require( '@stdlib/stats' ); +const statistics = require( '@stdlib/stats' ); ``` #### statistics @@ -35,7 +35,7 @@ var statistics = require( '@stdlib/stats' ); Namespace containing statistical functions. ```javascript -var stats = statistics; +const stats = statistics; // returns {...} ``` @@ -119,8 +119,8 @@ Other statistical functions included are: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var statistics = require( '@stdlib/stats' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const statistics = require( '@stdlib/stats' ); console.log( objectKeys( statistics ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/anova1/README.md b/lib/node_modules/@stdlib/stats/anova1/README.md index 0346440c82d9..ce24794bc9ec 100644 --- a/lib/node_modules/@stdlib/stats/anova1/README.md +++ b/lib/node_modules/@stdlib/stats/anova1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var anova1 = require( '@stdlib/stats/anova1' ); +const anova1 = require( '@stdlib/stats/anova1' ); ``` #### anova1( x, factor\[, opts] ) @@ -50,14 +50,10 @@ For an [array][mdn-array] or [typed array][mdn-typed-array] of numeric values `x The function returns an object containing the treatment and error squared errors, degrees of freedom, mean squared errors, and both the p-value and F score. ```javascript -var out; -var x; -var y; +const x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; +const y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; -x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; -y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; - -out = anova1( x, y ); +const out = anova1( x, y ); /* returns { 'treatment': { 'df': 11, 'ss': 15, 'ms': 5 }, @@ -77,14 +73,10 @@ out = anova1( x, y ); The returned object comes with a `.print()` method which when invoked will print a formatted output of the results of the hypothesis test. `print` accepts a `digits` option that controls the number of decimal digits displayed for the outputs and a `decision` option, which when set to `false` will hide the test decision. ```javascript -var out; -var x; -var y; - -x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; -y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; +const x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; +const y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; -out = anova1( x, y ); +const out = anova1( x, y ); console.log( out.print() ); /* => One-Way ANOVA @@ -108,11 +100,11 @@ The function accepts the following `options`: By default, the test is carried out at a significance level of `0.05`. To choose a custom significance level, set the `alpha` option. ```javascript -var x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; -var y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; +const x = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; +const y = [ 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Control' ]; -var out = anova1( x, y ); -var table = out.print(); +let out = anova1( x, y ); +let table = out.print(); /* e.g., returns One-Way ANOVA @@ -165,12 +157,12 @@ table = out.print(); ```javascript -var anova1 = require( '@stdlib/stats/anova1' ); +const anova1 = require( '@stdlib/stats/anova1' ); -var x = [ 3, 4, 5, 6, 2, 5, 10, 12, 8, 10 ]; -var f = [ 'control', 'treatA', 'treatB', 'control', 'treatA', 'treatB', 'control', 'treatA', 'treatB', 'control' ]; +const x = [ 3, 4, 5, 6, 2, 5, 10, 12, 8, 10 ]; +const f = [ 'control', 'treatA', 'treatB', 'control', 'treatA', 'treatB', 'control', 'treatA', 'treatB', 'control' ]; -var out = anova1( x, f, { +let out = anova1( x, f, { 'decision': true }); diff --git a/lib/node_modules/@stdlib/stats/bartlett-test/README.md b/lib/node_modules/@stdlib/stats/bartlett-test/README.md index b1a3dcba7704..9e8e2c05afbf 100644 --- a/lib/node_modules/@stdlib/stats/bartlett-test/README.md +++ b/lib/node_modules/@stdlib/stats/bartlett-test/README.md @@ -52,7 +52,7 @@ where `N` is the total number of observations, `S_i` are the biased group-level ## Usage ```javascript -var bartlettTest = require( '@stdlib/stats/bartlett-test' ); +const bartlettTest = require( '@stdlib/stats/bartlett-test' ); ``` #### bartlettTest( a\[,b,...,k]\[, opts] ) @@ -61,11 +61,11 @@ For input arrays `a`, `b`, ... holding numeric observations, this function calcu ```javascript // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = bartlettTest( x, y, z ); +const out = bartlettTest( x, y, z ); /* returns { 'rejected': false, @@ -86,11 +86,11 @@ The function accepts the following `options`: By default, the test is carried out at a significance level of `0.05`. To choose a custom significance level, set the `alpha` option. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = bartlettTest( x, y, z, { +const out = bartlettTest( x, y, z, { 'alpha': 0.01 }); /* returns @@ -110,17 +110,17 @@ The function provides an alternate interface by supplying an array of group indi ```javascript -var arr = [ +const arr = [ 2.9, 3.0, 2.5, 2.6, 3.2, 3.8, 2.7, 4.0, 2.4, 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var groups = [ +const groups = [ 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'c' ]; -var out = bartlettTest( arr, { +const out = bartlettTest( arr, { 'groups': groups }); ``` @@ -128,11 +128,11 @@ var out = bartlettTest( arr, { The returned object comes with a `.print()` method which when invoked will print a formatted output of the results of the hypothesis test. `print` accepts a `digits` option that controls the number of decimal digits displayed for the outputs and a `decision` option, which when set to `false` will hide the test decision. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = bartlettTest( x, y, z ); +const out = bartlettTest( x, y, z ); console.log( out.print() ); /* => Bartlett's test of equal variances @@ -158,14 +158,14 @@ console.log( out.print() ); ```javascript -var bartlettTest = require( '@stdlib/stats/bartlett-test' ); +const bartlettTest = require( '@stdlib/stats/bartlett-test' ); // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = bartlettTest( x, y, z ); +const out = bartlettTest( x, y, z ); /* returns { 'rejected': false, @@ -177,7 +177,7 @@ var out = bartlettTest( x, y, z ); } */ -var table = out.print(); +const table = out.print(); /* returns Bartlett's test of equal variances diff --git a/lib/node_modules/@stdlib/stats/base/README.md b/lib/node_modules/@stdlib/stats/base/README.md index 494dcb18d9d2..6a0df9f5c884 100644 --- a/lib/node_modules/@stdlib/stats/base/README.md +++ b/lib/node_modules/@stdlib/stats/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stats = require( '@stdlib/stats/base' ); +const stats = require( '@stdlib/stats/base' ); ``` #### stats @@ -35,7 +35,7 @@ var stats = require( '@stdlib/stats/base' ); Namespace containing "base" (i.e., lower-level) statistical functions. ```javascript -var ns = stats; +const ns = stats; // returns {...} ``` @@ -300,8 +300,8 @@ The namespace contains the following statistical functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/stats/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/stats/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/cumax/README.md b/lib/node_modules/@stdlib/stats/base/cumax/README.md index 8fc639da98f0..4a9a3ae770f9 100644 --- a/lib/node_modules/@stdlib/stats/base/cumax/README.md +++ b/lib/node_modules/@stdlib/stats/base/cumax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cumax = require( '@stdlib/stats/base/cumax' ); +const cumax = require( '@stdlib/stats/base/cumax' ); ``` #### cumax( N, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var cumax = require( '@stdlib/stats/base/cumax' ); Computes the cumulative maximum of a strided array. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumax( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 2.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum of every other element in `x`, ```javascript -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var v = cumax( 4, x, 2, y, 1 ); +const v = cumax( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cumax( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -90,8 +90,8 @@ cumax( 4, x1, -2, y1, 1 ); Computes the cumulative maximum of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumax.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 2.0 ] @@ -105,8 +105,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 1.0, 1.0 ] @@ -134,18 +134,14 @@ cumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cumax = require( '@stdlib/stats/base/cumax' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const cumax = require( '@stdlib/stats/base/cumax' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/cumaxabs/README.md b/lib/node_modules/@stdlib/stats/base/cumaxabs/README.md index 876d6b193da2..e8dd1b88cb56 100644 --- a/lib/node_modules/@stdlib/stats/base/cumaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/cumaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cumaxabs = require( '@stdlib/stats/base/cumaxabs' ); +const cumaxabs = require( '@stdlib/stats/base/cumaxabs' ); ``` #### cumaxabs( N, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var cumaxabs = require( '@stdlib/stats/base/cumaxabs' ); Computes the cumulative maximum absolute value of a strided array. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumaxabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 2.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`, ```javascript -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var v = cumaxabs( 4, x, 2, y, 1 ); +const v = cumaxabs( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cumaxabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -90,8 +90,8 @@ cumaxabs( 4, x1, -2, y1, 1 ); Computes the cumulative maximum absolute value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumaxabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 2.0 ] @@ -105,8 +105,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0 ] @@ -134,18 +134,14 @@ cumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cumaxabs = require( '@stdlib/stats/base/cumaxabs' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const cumaxabs = require( '@stdlib/stats/base/cumaxabs' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/cumin/README.md b/lib/node_modules/@stdlib/stats/base/cumin/README.md index 85c7af9fd962..bfef0f0cb2a7 100644 --- a/lib/node_modules/@stdlib/stats/base/cumin/README.md +++ b/lib/node_modules/@stdlib/stats/base/cumin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cumin = require( '@stdlib/stats/base/cumin' ); +const cumin = require( '@stdlib/stats/base/cumin' ); ``` #### cumin( N, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var cumin = require( '@stdlib/stats/base/cumin' ); Computes the cumulative minimum of a strided array. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumin( x.length, x, 1, y, 1 ); // y => [ 1.0, -2.0, -2.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum of every other element in `x`, ```javascript -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var v = cumin( 4, x, 2, y, 1 ); +const v = cumin( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cumin( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, -2.0, -2.0, 0.0 ] @@ -90,8 +90,8 @@ cumin( 4, x1, -2, y1, 1 ); Computes the cumulative minimum of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cumin.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -2.0, -2.0 ] @@ -105,8 +105,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, -2.0, -2.0, -2.0, 1.0 ] @@ -134,18 +134,14 @@ cumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cumin = require( '@stdlib/stats/base/cumin' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const cumin = require( '@stdlib/stats/base/cumin' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/cuminabs/README.md b/lib/node_modules/@stdlib/stats/base/cuminabs/README.md index dcf7b9b77c03..ec6e866f76aa 100644 --- a/lib/node_modules/@stdlib/stats/base/cuminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/cuminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cuminabs = require( '@stdlib/stats/base/cuminabs' ); +const cuminabs = require( '@stdlib/stats/base/cuminabs' ); ``` #### cuminabs( N, x, strideX, y, strideY ) @@ -41,8 +41,8 @@ var cuminabs = require( '@stdlib/stats/base/cuminabs' ); Computes the cumulative minimum absolute value of a strided array. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cuminabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 1.0 ] @@ -59,10 +59,10 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum absolute value of every other element in `x`, ```javascript -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var v = cuminabs( 4, x, 2, y, 1 ); +const v = cuminabs( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element cuminabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0, 0.0 ] @@ -90,8 +90,8 @@ cuminabs( 4, x1, -2, y1, 1 ); Computes the cumulative minimum absolute value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var y = [ 0.0, 0.0, 0.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; +const y = [ 0.0, 0.0, 0.0 ]; cuminabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 1.0 ] @@ -105,8 +105,8 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; cuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] @@ -134,18 +134,14 @@ cuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cuminabs = require( '@stdlib/stats/base/cuminabs' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const cuminabs = require( '@stdlib/stats/base/cuminabs' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/dcumax/README.md b/lib/node_modules/@stdlib/stats/base/dcumax/README.md index eb8b28eadfb3..9dc60bcf768b 100644 --- a/lib/node_modules/@stdlib/stats/base/dcumax/README.md +++ b/lib/node_modules/@stdlib/stats/base/dcumax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcumax = require( '@stdlib/stats/base/dcumax' ); +const dcumax = require( '@stdlib/stats/base/dcumax' ); ``` #### dcumax( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcumax = require( '@stdlib/stats/base/dcumax' ); Computes the cumulative maximum of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumax( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcumax( 4, x, 2, y, 1 ); +const v = dcumax( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcumax( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -94,10 +94,10 @@ dcumax( 4, x1, -2, y1, 1 ); Computes the cumulative maximum of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumax.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 1.0, 1.0 ] @@ -141,18 +141,14 @@ dcumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcumax = require( '@stdlib/stats/base/dcumax' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcumax = require( '@stdlib/stats/base/dcumax' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/dcumaxabs/README.md b/lib/node_modules/@stdlib/stats/base/dcumaxabs/README.md index 68619273f235..7721d7861445 100644 --- a/lib/node_modules/@stdlib/stats/base/dcumaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dcumaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcumaxabs = require( '@stdlib/stats/base/dcumaxabs' ); +const dcumaxabs = require( '@stdlib/stats/base/dcumaxabs' ); ``` #### dcumaxabs( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcumaxabs = require( '@stdlib/stats/base/dcumaxabs' ); Computes the cumulative maximum absolute value of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumaxabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcumaxabs( 4, x, 2, y, 1 ); +const v = dcumaxabs( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcumaxabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -94,10 +94,10 @@ dcumaxabs( 4, x1, -2, y1, 1 ); Computes the cumulative maximum absolute value of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumaxabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0 ] @@ -141,18 +141,14 @@ dcumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcumaxabs = require( '@stdlib/stats/base/dcumaxabs' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcumaxabs = require( '@stdlib/stats/base/dcumaxabs' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/dcumin/README.md b/lib/node_modules/@stdlib/stats/base/dcumin/README.md index 3439c8de3e3f..241c599c98d0 100644 --- a/lib/node_modules/@stdlib/stats/base/dcumin/README.md +++ b/lib/node_modules/@stdlib/stats/base/dcumin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcumin = require( '@stdlib/stats/base/dcumin' ); +const dcumin = require( '@stdlib/stats/base/dcumin' ); ``` #### dcumin( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcumin = require( '@stdlib/stats/base/dcumin' ); Computes the cumulative minimum of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumin( x.length, x, 1, y, 1 ); // y => [ 1.0, -2.0, -2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcumin( 4, x, 2, y, 1 ); +const v = dcumin( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcumin( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, -2.0, -2.0, 0.0 ] @@ -94,10 +94,10 @@ dcumin( 4, x1, -2, y1, 1 ); Computes the cumulative minimum of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcumin.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -2.0, -2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, -2.0, -2.0, -2.0, 1.0 ] @@ -141,18 +141,14 @@ dcumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcumin = require( '@stdlib/stats/base/dcumin' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcumin = require( '@stdlib/stats/base/dcumin' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/dcuminabs/README.md b/lib/node_modules/@stdlib/stats/base/dcuminabs/README.md index 911643f1f861..c17a54b7a6e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dcuminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dcuminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dcuminabs = require( '@stdlib/stats/base/dcuminabs' ); +const dcuminabs = require( '@stdlib/stats/base/dcuminabs' ); ``` #### dcuminabs( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var dcuminabs = require( '@stdlib/stats/base/dcuminabs' ); Computes the cumulative minimum absolute value of double-precision floating-point strided array elements. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcuminabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 1.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float64Array( x.length ); -var v = dcuminabs( 4, x, 2, y, 1 ); +const v = dcuminabs( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float64Array( x0.length ); +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float64Array( x0.length ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dcuminabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0, 0.0 ] @@ -94,10 +94,10 @@ dcuminabs( 4, x1, -2, y1, 1 ); Computes the cumulative minimum absolute value of double-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float64Array( x.length ); dcuminabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 1.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float64Array( x.length ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float64Array( x.length ); dcuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] @@ -141,18 +141,14 @@ dcuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dcuminabs = require( '@stdlib/stats/base/dcuminabs' ); - -var y; -var x; -var i; - -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dcuminabs = require( '@stdlib/stats/base/dcuminabs' ); + +const x = new Float64Array( 10 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/README.md b/lib/node_modules/@stdlib/stats/base/dists/README.md index f8590b979e6d..d3de8a689f8f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dists = require( '@stdlib/stats/base/dists' ); +const dists = require( '@stdlib/stats/base/dists' ); ``` #### dists @@ -35,7 +35,7 @@ var dists = require( '@stdlib/stats/base/dists' ); Namespace containing "base" (i.e., lower-level) probability distribution modules. ```javascript -var distributions = dists; +const distributions = dists; // returns {...} ``` @@ -121,8 +121,8 @@ var distributions = dists; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var dists = require( '@stdlib/stats/base/dists' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const dists = require( '@stdlib/stats/base/dists' ); console.log( objectKeys( dists ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/README.md index 52514daef227..701a52b010bc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arcsine = require( '@stdlib/stats/base/dists/arcsine' ); +const arcsine = require( '@stdlib/stats/base/dists/arcsine' ); ``` #### arcsine @@ -35,7 +35,7 @@ var arcsine = require( '@stdlib/stats/base/dists/arcsine' ); [Arcsine][arcsine-distribution] distribution. ```javascript -var dist = arcsine; +const dist = arcsine; // returns {...} ``` @@ -87,10 +87,10 @@ The namespace contains a constructor function for creating an [arcsine][arcsine- ```javascript -var Arcsine = require( '@stdlib/stats/base/dists/arcsine' ).Arcsine; -var dist = new Arcsine( 2.0, 4.0 ); +const Arcsine = require( '@stdlib/stats/base/dists/arcsine' ).Arcsine; +const dist = new Arcsine( 2.0, 4.0 ); -var mu = dist.mean; +const mu = dist.mean; // returns 3.0 ``` @@ -107,8 +107,8 @@ var mu = dist.mean; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var arcsine = require( '@stdlib/stats/base/dists/arcsine' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const arcsine = require( '@stdlib/stats/base/dists/arcsine' ); console.log( objectKeys( arcsine ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/cdf/README.md index 47786ff85507..ebf24a6c6df2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/cdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/arcsine/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/arcsine/cdf' ); ``` #### cdf( x, a, b ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/arcsine/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = cdf( 9.0, 0.0, 10.0 ); +let y = cdf( 9.0, 0.0, 10.0 ); // returns ~0.795 y = cdf( 0.5, 0.0, 2.0 ); @@ -74,7 +74,7 @@ y = cdf( +Infinity, 2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = cdf( 1.0, 2.5, 2.0 ); +const y = cdf( 1.0, 2.5, 2.0 ); // returns NaN ``` @@ -96,8 +96,8 @@ var y = cdf( 1.0, 2.5, 2.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mycdf = cdf.factory( 0.0, 10.0 ); -var y = mycdf( 0.5 ); +const mycdf = cdf.factory( 0.0, 10.0 ); +let y = mycdf( 0.5 ); // returns ~0.144 y = mycdf( 8.0 ); @@ -115,20 +115,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/arcsine/cdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = ( randu()*20.0 ) - 10.0; - a = ( randu()*20.0 ) - 20.0; - b = a + ( randu()*40.0 ); - y = cdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/arcsine/cdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = ( randu()*20.0 ) - 10.0; + const a = ( randu()*20.0 ) - 20.0; + const b = a + ( randu()*40.0 ); + const y = cdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/README.md index 164799067a20..b6815560cc86 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Arcsine = require( '@stdlib/stats/base/dists/arcsine/ctor' ); +const Arcsine = require( '@stdlib/stats/base/dists/arcsine/ctor' ); ``` #### Arcsine( \[a, b] ) @@ -45,18 +45,18 @@ var Arcsine = require( '@stdlib/stats/base/dists/arcsine/ctor' ); Returns an [arcsine][arcsine-distribution] distribution object. ```javascript -var arcsine = new Arcsine(); +const arcsine = new Arcsine(); -var mu = arcsine.mean; +const mu = arcsine.mean; // returns 0.5 ``` By default, `a = 0.0` and `b = 1.0`. To create a distribution having a different `a` (minimum support) and `b` (maximum support), provide the corresponding arguments. ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var mu = arcsine.mean; +const mu = arcsine.mean; // returns 3.0 ``` @@ -73,9 +73,9 @@ An [arcsine][arcsine-distribution] distribution object has the following propert Minimum support of the distribution. `a` **must** be a number less than `b`. ```javascript -var arcsine = new Arcsine(); +const arcsine = new Arcsine(); -var a = arcsine.a; +let a = arcsine.a; // returns 0.0 arcsine.a = 0.5; @@ -89,9 +89,9 @@ a = arcsine.a; Maximum support of the distribution. `b` **must** be a number greater than `a`. ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var b = arcsine.b; +let b = arcsine.b; // returns 4.0 arcsine.b = 3.0; @@ -109,9 +109,9 @@ b = arcsine.b; Returns the [differential entropy][entropy]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var entropy = arcsine.entropy; +const entropy = arcsine.entropy; // returns ~1.838 ``` @@ -120,9 +120,9 @@ var entropy = arcsine.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var kurtosis = arcsine.kurtosis; +const kurtosis = arcsine.kurtosis; // returns -1.5 ``` @@ -131,9 +131,9 @@ var kurtosis = arcsine.kurtosis; Returns the [expected value][expected-value]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var mu = arcsine.mean; +const mu = arcsine.mean; // returns 8.0 ``` @@ -142,9 +142,9 @@ var mu = arcsine.mean; Returns the [median][median]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var median = arcsine.median; +const median = arcsine.median; // returns 8.0 ``` @@ -153,9 +153,9 @@ var median = arcsine.median; Returns the [mode][mode]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var mode = arcsine.mode; +const mode = arcsine.mode; // returns 4.0 ``` @@ -164,9 +164,9 @@ var mode = arcsine.mode; Returns the [skewness][skewness]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var skewness = arcsine.skewness; +const skewness = arcsine.skewness; // returns 0.0 ``` @@ -175,9 +175,9 @@ var skewness = arcsine.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var s = arcsine.stdev; +const s = arcsine.stdev; // returns ~2.828 ``` @@ -186,9 +186,9 @@ var s = arcsine.stdev; Returns the [variance][variance]. ```javascript -var arcsine = new Arcsine( 4.0, 12.0 ); +const arcsine = new Arcsine( 4.0, 12.0 ); -var s2 = arcsine.variance; +const s2 = arcsine.variance; // returns 8.0 ``` @@ -201,9 +201,9 @@ var s2 = arcsine.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var y = arcsine.cdf( 2.5 ); +const y = arcsine.cdf( 2.5 ); // returns ~0.333 ``` @@ -212,9 +212,9 @@ var y = arcsine.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var y = arcsine.logcdf( 2.5 ); +const y = arcsine.logcdf( 2.5 ); // returns ~-1.1 ``` @@ -223,9 +223,9 @@ var y = arcsine.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var y = arcsine.logpdf( 2.5 ); +const y = arcsine.logpdf( 2.5 ); // returns ~-1.0 ``` @@ -234,9 +234,9 @@ var y = arcsine.logpdf( 2.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var y = arcsine.pdf( 2.5 ); +const y = arcsine.pdf( 2.5 ); // returns ~0.368 ``` @@ -245,9 +245,9 @@ var y = arcsine.pdf( 2.5 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var y = arcsine.quantile( 0.5 ); +let y = arcsine.quantile( 0.5 ); // returns 3.0 y = arcsine.quantile( 1.9 ); @@ -277,20 +277,20 @@ y = arcsine.quantile( 1.9 ); ```javascript -var Arcsine = require( '@stdlib/stats/base/dists/arcsine/ctor' ); +const Arcsine = require( '@stdlib/stats/base/dists/arcsine/ctor' ); -var arcsine = new Arcsine( 2.0, 4.0 ); +const arcsine = new Arcsine( 2.0, 4.0 ); -var mu = arcsine.mean; +const mu = arcsine.mean; // returns 3.0 -var median = arcsine.median; +const median = arcsine.median; // returns 3.0 -var s2 = arcsine.variance; +const s2 = arcsine.variance; // returns 0.5 -var y = arcsine.cdf( 2.5 ); +const y = arcsine.cdf( 2.5 ); // returns ~0.333 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy/README.md index add9cb2023a6..262f2380f20d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy/README.md @@ -52,7 +52,7 @@ h\left( X \right) = \ln {\tfrac{\pi}{4}} ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/arcsine/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/arcsine/entropy' ); ``` #### entropy( a, b ) @@ -60,7 +60,7 @@ var entropy = require( '@stdlib/stats/base/dists/arcsine/entropy' ); Returns the [differential entropy][entropy] of an [arcsine][arcsine-distribution] distribution with minimum support `a` and maximum support `b` (in [nats][nats]). ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns ~-0.242 v = entropy( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = entropy( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -83,7 +83,7 @@ v = entropy( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = entropy( 3.0, 2.0 ); +let y = entropy( 3.0, 2.0 ); // returns NaN y = entropy( 3.0, 3.0 ); @@ -111,19 +111,14 @@ y = entropy( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/arcsine/entropy' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a + EPS; - v = entropy( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/arcsine/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a + EPS; + const v = entropy( a, b ); console.log( 'a: %d, b: %d, h(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/kurtosis/README.md index 13f91fc8a4ff..84083ceb8a2a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for an [arcsine][arcsine-distribution] random va ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/arcsine/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/arcsine/kurtosis' ); ``` #### kurtosis( a, b ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/arcsine/kurtosis' ); Returns the [excess kurtosis][kurtosis] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns -1.5 v = kurtosis( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = kurtosis( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -83,7 +83,7 @@ v = kurtosis( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = kurtosis( 3.0, 2.0 ); +let y = kurtosis( 3.0, 2.0 ); // returns NaN y = kurtosis( 3.0, 3.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/arcsine/kurtosis' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = kurtosis( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/arcsine/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = kurtosis( a, b ); console.log( 'a: %d, b: %d, Kurt(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/logcdf/README.md index 191e1d965834..2c84b5ae3900 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/logcdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/arcsine/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/arcsine/logcdf' ); ``` #### logcdf( x, a, b ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/arcsine/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logcdf( 9.0, 0.0, 10.0 ); +let y = logcdf( 9.0, 0.0, 10.0 ); // returns ~-0.23 y = logcdf( 0.5, 0.0, 2.0 ); @@ -74,7 +74,7 @@ y = logcdf( +Infinity, 2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = logcdf( 1.0, 2.5, 2.0 ); +const y = logcdf( 1.0, 2.5, 2.0 ); // returns NaN ``` @@ -96,8 +96,8 @@ var y = logcdf( 1.0, 2.5, 2.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mylogcdf = logcdf.factory( 0.0, 10.0 ); -var y = mylogcdf( 0.5 ); +const mylogcdf = logcdf.factory( 0.0, 10.0 ); +let y = mylogcdf( 0.5 ); // returns ~-1.941 y = mylogcdf( 8.0 ); @@ -125,20 +125,14 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/arcsine/logcdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = ( randu()*20.0 ) - 10.0; - a = ( randu()*20.0 ) - 20.0; - b = a + ( randu()*40.0 ); - y = logcdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/arcsine/logcdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = ( randu()*20.0 ) - 10.0; + const a = ( randu()*20.0 ) - 20.0; + const b = a + ( randu()*40.0 ); + const y = logcdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(F(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/logpdf/README.md index bae539ff0040..a1000d354941 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/logpdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/arcsine/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/arcsine/logpdf' ); ``` #### logpdf( x, a, b ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/arcsine/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logpdf( 2.0, 0.0, 4.0 ); +let y = logpdf( 2.0, 0.0, 4.0 ); // returns ~-1.838 y = logpdf( 5.0, 0.0, 4.0 ); @@ -71,7 +71,7 @@ y = logpdf( 0.25, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = logpdf( 2.5, 3.0, 2.0 ); +let y = logpdf( 2.5, 3.0, 2.0 ); // returns NaN y = logpdf( 2.5, 3.0, 3.0 ); @@ -96,8 +96,8 @@ y = logpdf( 2.5, 3.0, 3.0 ); Returns a `function` for evaluating the logarithm of the [PDF][pdf] for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mylogPDF = logpdf.factory( 6.0, 7.0 ); -var y = mylogPDF( 7.0 ); +const mylogPDF = logpdf.factory( 6.0, 7.0 ); +let y = mylogPDF( 7.0 ); // returns Infinity y = mylogPDF( 5.0 ); @@ -125,20 +125,14 @@ y = mylogPDF( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/arcsine/logpdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = ( randu()*20.0 ) - 10.0; - a = ( randu()*20.0 ) - 20.0; - b = a + ( randu()*40.0 ); - y = logpdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/arcsine/logpdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = ( randu()*20.0 ) - 10.0; + const a = ( randu()*20.0 ) - 20.0; + const b = a + ( randu()*40.0 ); + const y = logpdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(f(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/mean/README.md index 8b84b9892a86..b453f7935eee 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/mean/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/arcsine/mean' ); +const mean = require( '@stdlib/stats/base/dists/arcsine/mean' ); ``` #### mean( a, b ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/arcsine/mean' ); Returns the [expected value][expected-value] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns 0.5 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = mean( 3.0, 2.0 ); +let y = mean( 3.0, 2.0 ); // returns NaN y = mean( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = mean( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/arcsine/mean' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = mean( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/arcsine/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = mean( a, b ); console.log( 'a: %d, b: %d, E(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/median/README.md index 205f340d97a5..22f9722552df 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/median/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/arcsine/median' ); +const median = require( '@stdlib/stats/base/dists/arcsine/median' ); ``` #### median( a, b ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/arcsine/median' ); Returns the [median][median] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = median( 0.0, 1.0 ); +let v = median( 0.0, 1.0 ); // returns 0.5 v = median( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = median( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -85,7 +85,7 @@ v = median( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = median( 3.0, 2.0 ); +let y = median( 3.0, 2.0 ); // returns NaN y = median( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = median( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/arcsine/median' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = median( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/arcsine/median' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = median( a, b ); console.log( 'a: %d, b: %d, Median(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/mode/README.md index a91f37f5b608..842cdf52d73e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for an [arcsine][arcsine-distribution] random variable with wit ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/arcsine/mode' ); +const mode = require( '@stdlib/stats/base/dists/arcsine/mode' ); ``` #### mode( a, b ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/arcsine/mode' ); Returns the [mode][mode] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns 0.0 v = mode( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = mode( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -83,7 +83,7 @@ v = mode( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = mode( 3.0, 2.0 ); +let y = mode( 3.0, 2.0 ); // returns NaN y = mode( 3.0, 3.0 ); @@ -111,18 +111,13 @@ y = mode( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/arcsine/mode' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = mode( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/arcsine/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = mode( a, b ); console.log( 'a: %d, b: %d, mode(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/pdf/README.md index 2cfd41f1c4f6..3314f8189475 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/pdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/arcsine/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/arcsine/pdf' ); ``` #### pdf( x, a, b ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/arcsine/pdf' ); Evaluates the [probability density function][pdf] (PDF) for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = pdf( 2.0, 0.0, 4.0 ); +let y = pdf( 2.0, 0.0, 4.0 ); // returns ~0.159 y = pdf( 5.0, 0.0, 4.0 ); @@ -71,7 +71,7 @@ y = pdf( 0.25, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = pdf( 2.5, 3.0, 2.0 ); +let y = pdf( 2.5, 3.0, 2.0 ); // returns NaN y = pdf( 2.5, 3.0, 3.0 ); @@ -96,8 +96,8 @@ y = pdf( 2.5, 3.0, 3.0 ); Returns a `function` for evaluating the [PDF][pdf] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myPDF = pdf.factory( 6.0, 7.0 ); -var y = myPDF( 7.0 ); +const myPDF = pdf.factory( 6.0, 7.0 ); +let y = myPDF( 7.0 ); // returns Infinity y = myPDF( 5.0 ); @@ -115,20 +115,14 @@ y = myPDF( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/arcsine/pdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = ( randu()*20.0 )- 10.0; - a = ( randu()*20.0 )- 20.0; - b = a + ( randu()*40.0 ); - y = pdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/arcsine/pdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = ( randu()*20.0 )- 10.0; + const a = ( randu()*20.0 )- 20.0; + const b = a + ( randu()*40.0 ); + const y = pdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, f(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/README.md index a3a7c2793a69..79083af9ac72 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `a` is the minimum support and `b` is the maximum suppo ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/arcsine/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/arcsine/quantile' ); ``` #### quantile( p, a, b ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/arcsine/quantile' ); Evaluates the [quantile function][quantile-function] for an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = quantile( 0.8, 0.0, 1.0 ); +let y = quantile( 0.8, 0.0, 1.0 ); // returns ~0.905 y = quantile( 0.5, 0.0, 10.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 0.0, 10.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 2.0, 1.0 ); +const y = quantile( 0.4, 2.0, 1.0 ); // returns NaN ``` @@ -100,9 +100,9 @@ var y = quantile( 0.4, 2.0, 1.0 ); Returns a function for evaluating the quantile function of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myquantile = quantile.factory( 0.0, 4.0 ); +const myquantile = quantile.factory( 0.0, 4.0 ); -var y = myquantile( 0.8 ); +const y = myquantile( 0.8 ); // returns ~3.618 ``` @@ -117,20 +117,14 @@ var y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/arcsine/quantile' ); - -var a; -var b; -var p; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - p = randu(); - a = ( randu()*20.0 ) - 20.0; - b = a + ( randu()*40.0 ); - y = quantile( p, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/arcsine/quantile' ); + +for ( let i = 0; i < 25; i++ ) { + const p = randu(); + const a = ( randu()*20.0 ) - 20.0; + const b = a + ( randu()*40.0 ); + const y = quantile( p, a, b ); console.log( 'p: %d, a: %d, b: %d, Q(p;a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/README.md index 2fea75c2beb1..3b41f2c075ea 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for an [arcsine][arcsine-distribution] random variable ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/arcsine/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/arcsine/skewness' ); ``` #### skewness( a, b ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/arcsine/skewness' ); Returns the [skewness][skewness] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = skewness( 0.0, 1.0 ); +let v = skewness( 0.0, 1.0 ); // returns 0.0 v = skewness( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = skewness( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -83,7 +83,7 @@ v = skewness( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = skewness( 3.0, 2.0 ); +let y = skewness( 3.0, 2.0 ); // returns NaN y = skewness( 3.0, 3.0 ); @@ -111,18 +111,13 @@ y = skewness( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/arcsine/skewness' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = skewness( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/arcsine/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = skewness( a, b ); console.log( 'a: %d, b: %d, skew(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/README.md index 8fa83b0c8201..adb33564d914 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][stdev] for an [arcsine][arcsine-distribution] random va ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/arcsine/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/arcsine/stdev' ); ``` #### stdev( a, b ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/arcsine/stdev' ); Returns the [standard deviation][stdev] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns ~0.354 v = stdev( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = stdev( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -83,7 +83,7 @@ v = stdev( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var v = stdev( 3.0, 2.0 ); +let v = stdev( 3.0, 2.0 ); // returns NaN v = stdev( 3.0, 3.0 ); @@ -111,18 +111,13 @@ v = stdev( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/arcsine/stdev' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = stdev( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/arcsine/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = stdev( a, b ); console.log( 'a: %d, b: %d, SD(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/arcsine/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/arcsine/variance/README.md index 10393c094308..233dd59ec67a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/arcsine/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/arcsine/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for an [arcsine][arcsine-distribution] random variable ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/arcsine/variance' ); +const variance = require( '@stdlib/stats/base/dists/arcsine/variance' ); ``` #### variance( a, b ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/arcsine/variance' ); Returns the [variance][variance] of an [arcsine][arcsine-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns ~0.125 v = variance( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = variance( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -83,7 +83,7 @@ v = variance( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var v = variance( 3.0, 2.0 ); +let v = variance( 3.0, 2.0 ); // returns NaN v = variance( 3.0, 3.0 ); @@ -111,18 +111,13 @@ v = variance( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/arcsine/variance' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = variance( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/arcsine/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = variance( a, b ); console.log( 'a: %d, b: %d, Var(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/README.md index 1e8f7d9bae59..883b02d13f85 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ); +const bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ); ``` #### bernoulli @@ -35,7 +35,7 @@ var bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ); Bernoulli distribution. ```javascript -var dist = bernoulli; +const dist = bernoulli; // returns {...} ``` @@ -86,11 +86,11 @@ The namespace contains a constructor function for creating a [Bernoulli][bernoul ```javascript -var Bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ).Bernoulli; +const Bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ).Bernoulli; -var dist = new Bernoulli( 0.2 ); +const dist = new Bernoulli( 0.2 ); -var y = dist.pmf( 0.0 ); +let y = dist.pmf( 0.0 ); // returns 0.8 y = dist.pmf( 1.0 ); @@ -110,8 +110,8 @@ y = dist.pmf( 1.0 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const bernoulli = require( '@stdlib/stats/base/dists/bernoulli' ); console.log( objectKeys( bernoulli ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/README.md index 061d52fadeef..c3b67c8e8f7f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/bernoulli/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/bernoulli/cdf' ); ``` #### cdf( x, p ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/bernoulli/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var y = cdf( 1.0, 0.5 ); +let y = cdf( 1.0, 0.5 ); // returns 1.0 y = cdf( 0.5, 0.5 ); @@ -68,7 +68,7 @@ y = cdf( 0.5, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.5 ); +let y = cdf( NaN, 0.5 ); // returns NaN y = cdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = cdf( 0.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = cdf( 0.9, -1.0 ); +let y = cdf( 0.9, -1.0 ); // returns NaN y = cdf( 0.9, 1.5 ); @@ -90,8 +90,8 @@ y = cdf( 0.9, 1.5 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p` ```javascript -var mycdf = cdf.factory( 0.5 ); -var y = mycdf( 0.5 ); +const mycdf = cdf.factory( 0.5 ); +let y = mycdf( 0.5 ); // returns 0.5 y = mycdf( 2.0 ); @@ -109,18 +109,13 @@ y = mycdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/bernoulli/cdf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 5.0; - p = randu(); - y = cdf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/bernoulli/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 5.0; + const p = randu(); + const y = cdf( x, p ); console.log( 'x: %d, p: %d, F(x;p): %d', x.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/ctor/README.md index 78d001259860..68ec792df255 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Bernoulli = require( '@stdlib/stats/base/dists/bernoulli/ctor' ); +const Bernoulli = require( '@stdlib/stats/base/dists/bernoulli/ctor' ); ``` #### Bernoulli( \[p] ) @@ -45,18 +45,18 @@ var Bernoulli = require( '@stdlib/stats/base/dists/bernoulli/ctor' ); Returns a [Bernoulli][bernoulli-distribution] distribution object. ```javascript -var bernoulli = new Bernoulli(); +const bernoulli = new Bernoulli(); -var mean = bernoulli.mean; +const mean = bernoulli.mean; // returns 0.5 ``` By default, `p = 0.5`. To create a distribution having a different success probability `p`, provide a parameter value. ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var mean = bernoulli.mean; +const mean = bernoulli.mean; // returns 0.2 ``` @@ -73,9 +73,9 @@ A [Bernoulli][bernoulli-distribution] distribution object has the following prop Success probability of the distribution. `p` **must** be a probability. ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var p = bernoulli.p; +let p = bernoulli.p; // returns 0.2 bernoulli.p = 0.3; @@ -93,9 +93,9 @@ p = bernoulli.p; Returns the [differential entropy][entropy]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var entropy = bernoulli.entropy; +const entropy = bernoulli.entropy; // returns ~0.673 ``` @@ -104,9 +104,9 @@ var entropy = bernoulli.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var kurtosis = bernoulli.kurtosis; +const kurtosis = bernoulli.kurtosis; // returns ~-1.833 ``` @@ -115,9 +115,9 @@ var kurtosis = bernoulli.kurtosis; Returns the [median][expected-value]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var mu = bernoulli.mean; +const mu = bernoulli.mean; // returns 0.4 ``` @@ -126,9 +126,9 @@ var mu = bernoulli.mean; Returns the [median][median]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var median = bernoulli.median; +const median = bernoulli.median; // returns 0.0 ``` @@ -137,9 +137,9 @@ var median = bernoulli.median; Returns the [mode][mode]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var mode = bernoulli.mode; +const mode = bernoulli.mode; // returns 0.0 ``` @@ -148,9 +148,9 @@ var mode = bernoulli.mode; Returns the [skewness][skewness]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var skewness = bernoulli.skewness; +const skewness = bernoulli.skewness; // returns ~0.408 ``` @@ -159,9 +159,9 @@ var skewness = bernoulli.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var s = bernoulli.stdev; +const s = bernoulli.stdev; // returns ~0.49 ``` @@ -170,9 +170,9 @@ var s = bernoulli.stdev; Returns the [variance][variance]. ```javascript -var bernoulli = new Bernoulli( 0.4 ); +const bernoulli = new Bernoulli( 0.4 ); -var s2 = bernoulli.variance; +const s2 = bernoulli.variance; // returns 0.24 ``` @@ -185,9 +185,9 @@ var s2 = bernoulli.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var y = bernoulli.cdf( 0.5 ); +const y = bernoulli.cdf( 0.5 ); // returns 0.8 ``` @@ -196,9 +196,9 @@ var y = bernoulli.cdf( 0.5 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var y = bernoulli.mgf( -3.0 ); +const y = bernoulli.mgf( -3.0 ); // returns ~0.81 ``` @@ -207,9 +207,9 @@ var y = bernoulli.mgf( -3.0 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var y = bernoulli.pmf( 0.0 ); +let y = bernoulli.pmf( 0.0 ); // returns 0.8 y = bernoulli.pmf( 1.0 ); @@ -221,9 +221,9 @@ y = bernoulli.pmf( 1.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var bernoulli = new Bernoulli( 0.2 ); +const bernoulli = new Bernoulli( 0.2 ); -var y = bernoulli.quantile( 0.5 ); +let y = bernoulli.quantile( 0.5 ); // returns 0 y = bernoulli.quantile( 0.9 ); @@ -253,17 +253,17 @@ y = bernoulli.quantile( 0.9 ); ```javascript -var Bernoulli = require( '@stdlib/stats/base/dists/bernoulli/ctor' ); +const Bernoulli = require( '@stdlib/stats/base/dists/bernoulli/ctor' ); -var bernoulli = new Bernoulli( 0.5 ); +const bernoulli = new Bernoulli( 0.5 ); -var mu = bernoulli.mean; +const mu = bernoulli.mean; // returns 0.5 -var s2 = bernoulli.variance; +const s2 = bernoulli.variance; // returns 0.25 -var y = bernoulli.cdf( 2.0 ); +const y = bernoulli.cdf( 2.0 ); // returns 1.0 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/README.md index f0b52ae1f06d..95f1ce8a5321 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/entropy/README.md @@ -54,7 +54,7 @@ where `p` is the success probability and `q = 1 - p`. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/bernoulli/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/bernoulli/entropy' ); ``` #### entropy( p ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/bernoulli/entropy' ); Returns the [entropy][entropy] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p` (in [nats][nats]). ```javascript -var v = entropy( 0.1 ); +let v = entropy( 0.1 ); // returns ~0.325 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = entropy( NaN ); +let v = entropy( NaN ); // returns NaN v = entropy( 1.5 ); @@ -103,17 +103,13 @@ v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/bernoulli/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/bernoulli/entropy' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = entropy( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = entropy( p ); console.log( 'p: %d, H(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/README.md index adcde8cccd5c..a21841a3ce7d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/README.md @@ -54,7 +54,7 @@ where `p` is the success probability and `q = 1 - p`. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/bernoulli/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/bernoulli/kurtosis' ); ``` #### kurtosis( p ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/bernoulli/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = kurtosis( 0.1 ); +let v = kurtosis( 0.1 ); // returns ~5.111 v = kurtosis( 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = kurtosis( NaN ); +let v = kurtosis( NaN ); // returns NaN v = kurtosis( 1.5 ); @@ -103,17 +103,13 @@ v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/bernoulli/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/bernoulli/kurtosis' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = kurtosis( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = kurtosis( p ); console.log( 'p: %d, Kurt(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mean/README.md index 6f269498f7c8..6fd17b37273d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mean/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/bernoulli/mean' ); +const mean = require( '@stdlib/stats/base/dists/bernoulli/mean' ); ``` #### mean( p ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/bernoulli/mean' ); Returns the [expected value][expected-value] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = mean( 0.1 ); +let v = mean( 0.1 ); // returns 0.1 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mean( NaN ); +let v = mean( NaN ); // returns NaN v = mean( 1.5 ); @@ -103,17 +103,13 @@ v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/bernoulli/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/bernoulli/mean' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = mean( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = mean( p ); console.log( 'p: %d, E(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/median/README.md index 7097fab40060..fb815fad2312 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/median/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/bernoulli/median' ); +const median = require( '@stdlib/stats/base/dists/bernoulli/median' ); ``` #### median( p ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/bernoulli/median' ); Returns the [median][median] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = median( 0.1 ); +let v = median( 0.1 ); // returns 0 v = median( 0.8 ); @@ -72,7 +72,7 @@ v = median( 0.8 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = median( NaN ); +let v = median( NaN ); // returns NaN v = median( 1.5 ); @@ -103,17 +103,13 @@ v = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/bernoulli/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/bernoulli/median' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = median( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = median( p ); console.log( 'p: %d, Median(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/README.md index 1ab6daaee82c..7deb9ff8ab8d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/README.md @@ -54,7 +54,7 @@ where `0 <= p <= 1` is the success probability. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/bernoulli/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/bernoulli/mgf' ); ``` #### mgf( t, p ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/bernoulli/mgf' ); Evaluates the moment-generating function ([MGF][mgf]) of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var y = mgf( 0.2, 0.5 ); +let y = mgf( 0.2, 0.5 ); // returns ~1.111 y = mgf( 0.4, 0.5 ); @@ -72,7 +72,7 @@ y = mgf( 0.4, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0 ); +let y = mgf( NaN, 0.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -82,7 +82,7 @@ y = mgf( 0.0, NaN ); If provided a success probability `p` outside of the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = mgf( -2.0, -1.0 ); +let y = mgf( -2.0, -1.0 ); // returns NaN y = mgf( 0.2, 2.0 ); @@ -94,8 +94,8 @@ y = mgf( 0.2, 2.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [Bernoulli][bernoulli-distribution] distribution with parameter `p` (success probability). ```javascript -var mymgf = mgf.factory( 0.8 ); -var y = mymgf( -0.2 ); +const mymgf = mgf.factory( 0.8 ); +const y = mymgf( -0.2 ); // returns ~0.855 ``` @@ -120,18 +120,13 @@ var y = mymgf( -0.2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/bernoulli/mgf' ); - -var p; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = ( randu() * 4.0 ) - 2.0; - p = randu(); - y = mgf( t, p ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/bernoulli/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = ( randu() * 4.0 ) - 2.0; + const p = randu(); + const y = mgf( t, p ); console.log( 't: %d, p: %d, M_X(t;p): %d', t, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mode/README.md index 07d5d02ac741..51c3c0383818 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/mode/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/bernoulli/mode' ); +const mode = require( '@stdlib/stats/base/dists/bernoulli/mode' ); ``` #### mode( p ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/bernoulli/mode' ); Returns the [mode][mode] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = mode( 0.1 ); +let v = mode( 0.1 ); // returns 0 v = mode( 0.5 ); @@ -75,7 +75,7 @@ v = mode( 0.8 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mode( NaN ); +let v = mode( NaN ); // returns NaN v = mode( 1.5 ); @@ -110,17 +110,13 @@ v = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/bernoulli/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/bernoulli/mode' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = mode( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = mode( p ); console.log( 'p: %d, Mode(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/pmf/README.md index 3a40c291f459..cc210899ebd2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/pmf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' ); ``` #### pmf( x, p ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' ); Evaluates the [probability mass function][pmf] (PMF) of a [Bernoulli][bernoulli-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var y = pmf( 1.0, 0.3 ); +let y = pmf( 1.0, 0.3 ); // returns 0.3 y = pmf( 0.0, 0.3 ); @@ -71,7 +71,7 @@ y = pmf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 0.0 ); +let y = pmf( NaN, 0.0 ); // returns NaN y = pmf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = pmf( 0.0, NaN ); If provided a success probability `p` outside of the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = pmf( 0.0, -1.0 ); +let y = pmf( 0.0, -1.0 ); // returns NaN y = pmf( 0.0, 1.5 ); @@ -93,8 +93,8 @@ y = pmf( 0.0, 1.5 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [Bernoulli][bernoulli-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var mypmf = pmf.factory( 0.8 ); -var y = mypmf( 0.0 ); +const mypmf = pmf.factory( 0.8 ); +let y = mypmf( 0.0 ); // returns 0.2 y = mypmf( 0.5 ); @@ -112,19 +112,14 @@ y = mypmf( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 2.0 ); - p = randu(); - y = pmf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/bernoulli/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 2.0 ); + const p = randu(); + const y = pmf( x, p ); console.log( 'x: %d, p: %d, P( X = x; p ): %d', x, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/README.md index ed3daca7c5be..2ab57d2b0129 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= r <= 1`, where `p` is the success probability. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/bernoulli/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/bernoulli/quantile' ); ``` #### quantile( r, p ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/bernoulli/quantile' ); Evaluates the [quantile function][quantile-function] for a [Bernoulli][bernoulli-distribution] distribution with success probability `p` at a value `r`. ```javascript -var y = quantile( 0.8, 0.4 ); +let y = quantile( 0.8, 0.4 ); // returns 1 y = quantile( 0.5, 0.4 ); @@ -71,7 +71,7 @@ y = quantile( 0.9, 0.1 ); If provided `r <= 0` or `r >= 0`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.5 ); +let y = quantile( 1.9, 0.5 ); // returns NaN y = quantile( -0.1, 0.5 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN ); @@ -91,7 +91,7 @@ y = quantile( 0.0, NaN ); If provided a success probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +let y = quantile( 0.4, -1.0 ); // returns NaN y = quantile( 0.4, 1.5 ); @@ -103,8 +103,8 @@ y = quantile( 0.4, 1.5 ); Returns a function for evaluating the [quantile function][quantile-function] for a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var myquantile = quantile.factory( 0.4 ); -var y = myquantile( 0.4 ); +const myquantile = quantile.factory( 0.4 ); +let y = myquantile( 0.4 ); // returns 0 y = myquantile( 0.8 ); @@ -125,18 +125,13 @@ y = myquantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/bernoulli/quantile' ); - -var p; -var r; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - r = randu(); - p = randu(); - y = quantile( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/bernoulli/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu(); + const p = randu(); + const y = quantile( r, p ); console.log( 'r: %d, p: %d, Q(r;p): %d', r.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/README.md index fc0e7c2e750c..9a72ded8424f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/bernoulli/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/bernoulli/skewness' ); ``` #### skewness( p ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/bernoulli/skewness' ); Returns the [skewness][skewness] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = skewness( 0.1 ); +let v = skewness( 0.1 ); // returns ~2.667 v = skewness( 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = skewness( NaN ); +let v = skewness( NaN ); // returns NaN v = skewness( 1.5 ); @@ -103,17 +103,13 @@ v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/bernoulli/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/bernoulli/skewness' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = skewness( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = skewness( p ); console.log( 'p: %d, skew(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/stdev/README.md index e0eb1385a01b..d1981fd91654 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/stdev/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/bernoulli/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/bernoulli/stdev' ); ``` #### stdev( p ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/bernoulli/stdev' ); Returns the [standard deviation][standard-deviation] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = stdev( 0.1 ); +let v = stdev( 0.1 ); // returns ~0.3 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = stdev( NaN ); +let v = stdev( NaN ); // returns NaN v = stdev( 1.5 ); @@ -103,17 +103,13 @@ v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/bernoulli/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/bernoulli/stdev' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = stdev( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = stdev( p ); console.log( 'p: %d, SD(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/variance/README.md index 94082044a5cd..c400f0070b31 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bernoulli/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bernoulli/variance/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/bernoulli/variance' ); +const variance = require( '@stdlib/stats/base/dists/bernoulli/variance' ); ``` #### variance( p ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/bernoulli/variance' ); Returns the [variance][variance] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`. ```javascript -var v = variance( 0.1 ); +let v = variance( 0.1 ); // returns ~0.09 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = variance( NaN ); +let v = variance( NaN ); // returns NaN v = variance( 1.5 ); @@ -103,17 +103,13 @@ v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/bernoulli/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/bernoulli/variance' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = variance( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = variance( p ); console.log( 'p: %d, Var(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/README.md index 32cf46148790..e0288b0e6d38 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var beta = require( '@stdlib/stats/base/dists/beta' ); +const beta = require( '@stdlib/stats/base/dists/beta' ); ``` #### beta @@ -35,7 +35,7 @@ var beta = require( '@stdlib/stats/base/dists/beta' ); [Beta][beta-distribution] distribution. ```javascript -var dist = beta; +const dist = beta; // returns {...} ``` @@ -88,10 +88,10 @@ The namespace contains a constructor function for creating a [beta][beta-distrib ```javascript -var Beta = require( '@stdlib/stats/base/dists/beta' ).Beta; -var dist = new Beta( 2.0, 4.0 ); +const Beta = require( '@stdlib/stats/base/dists/beta' ).Beta; +const dist = new Beta( 2.0, 4.0 ); -var mu = dist.mean; +const mu = dist.mean; // returns ~0.333 ``` @@ -108,8 +108,8 @@ var mu = dist.mean; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var beta = require( '@stdlib/stats/base/dists/beta' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const beta = require( '@stdlib/stats/base/dists/beta' ); console.log( objectKeys( beta ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md index 987c6a101ae6..949d130cddf9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter and `beta > 0` is the second shap ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/beta/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/beta/cdf' ); ``` #### cdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/beta/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = cdf( 0.5, 1.0, 1.0 ); +let y = cdf( 0.5, 1.0, 1.0 ); // returns 0.5 y = cdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +let y = cdf( 2.0, -1.0, 0.5 ); // returns NaN y = cdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = cdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mycdf = cdf.factory( 0.5, 0.5 ); +const mycdf = cdf.factory( 0.5, 0.5 ); -var y = mycdf( 0.8 ); +let y = mycdf( 0.8 ); // returns ~0.705 y = mycdf( 0.3 ); @@ -141,21 +141,15 @@ y = mycdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var cdf = require( '@stdlib/stats/base/dists/beta/cdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = cdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const cdf = require( '@stdlib/stats/base/dists/beta/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = cdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, F(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/ctor/README.md index 20b321697c7f..256c014fe62a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Beta = require( '@stdlib/stats/base/dists/beta/ctor' ); +const Beta = require( '@stdlib/stats/base/dists/beta/ctor' ); ``` #### Beta( \[alpha, beta] ) @@ -45,18 +45,18 @@ var Beta = require( '@stdlib/stats/base/dists/beta/ctor' ); Returns a [beta][beta-distribution] distribution object. ```javascript -var beta = new Beta(); +const beta = new Beta(); -var mu = beta.mean; +const mu = beta.mean; // returns 0.5 ``` By default, `alpha = 1.0` and `beta = 1.0`. To create a distribution having a different `alpha` (first shape parameter) and `beta` (second shape parameter), provide the corresponding arguments. ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var mu = beta.mean; +const mu = beta.mean; // returns ~0.333 ``` @@ -73,9 +73,9 @@ A [beta][beta-distribution] distribution object has the following properties and First shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var beta = new Beta(); +const beta = new Beta(); -var alpha = beta.alpha; +let alpha = beta.alpha; // returns 1.0 beta.alpha = 3.0; @@ -89,9 +89,9 @@ alpha = beta.alpha; Second shape parameter of the distribution. `beta` **must** be a positive number. ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var b = beta.beta; +let b = beta.beta; // returns 4.0 beta.beta = 3.0; @@ -109,9 +109,9 @@ b = beta.beta; Returns the [differential entropy][entropy]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var entropy = beta.entropy; +const entropy = beta.entropy; // returns ~-0.869 ``` @@ -120,9 +120,9 @@ var entropy = beta.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var kurtosis = beta.kurtosis; +const kurtosis = beta.kurtosis; // returns ~0.082 ``` @@ -131,9 +131,9 @@ var kurtosis = beta.kurtosis; Returns the [expected value][expected-value]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var mu = beta.mean; +const mu = beta.mean; // returns 0.25 ``` @@ -142,9 +142,9 @@ var mu = beta.mean; Returns the [median][median]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var median = beta.median; +const median = beta.median; // returns ~0.239 ``` @@ -153,9 +153,9 @@ var median = beta.median; Returns the [mode][mode]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var mode = beta.mode; +const mode = beta.mode; // returns ~0.214 ``` @@ -164,9 +164,9 @@ var mode = beta.mode; Returns the [skewness][skewness]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var skewness = beta.skewness; +const skewness = beta.skewness; // returns ~0.529 ``` @@ -175,9 +175,9 @@ var skewness = beta.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var s = beta.stdev; +const s = beta.stdev; // returns ~0.105 ``` @@ -186,9 +186,9 @@ var s = beta.stdev; Returns the [variance][variance]. ```javascript -var beta = new Beta( 4.0, 12.0 ); +const beta = new Beta( 4.0, 12.0 ); -var s2 = beta.variance; +const s2 = beta.variance; // returns ~0.011 ``` @@ -201,9 +201,9 @@ var s2 = beta.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.cdf( 0.5 ); +const y = beta.cdf( 0.5 ); // returns ~0.813 ``` @@ -212,9 +212,9 @@ var y = beta.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.logcdf( 0.5 ); +const y = beta.logcdf( 0.5 ); // returns ~-0.208 ``` @@ -223,9 +223,9 @@ var y = beta.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.logpdf( 0.8 ); +const y = beta.logpdf( 0.8 ); // returns ~-2.0557 ``` @@ -234,9 +234,9 @@ var y = beta.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.mgf( 0.5 ); +const y = beta.mgf( 0.5 ); // returns ~1.186 ``` @@ -245,9 +245,9 @@ var y = beta.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.pdf( 0.8 ); +const y = beta.pdf( 0.8 ); // returns ~0.128 ``` @@ -256,9 +256,9 @@ var y = beta.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var y = beta.quantile( 0.5 ); +let y = beta.quantile( 0.5 ); // returns ~0.314 y = beta.quantile( 1.9 ); @@ -288,20 +288,20 @@ y = beta.quantile( 1.9 ); ```javascript -var Beta = require( '@stdlib/stats/base/dists/beta/ctor' ); +const Beta = require( '@stdlib/stats/base/dists/beta/ctor' ); -var beta = new Beta( 2.0, 4.0 ); +const beta = new Beta( 2.0, 4.0 ); -var mu = beta.mean; +const mu = beta.mean; // returns ~0.333 -var median = beta.median; +const median = beta.median; // returns ~0.314 -var s2 = beta.variance; +const s2 = beta.variance; // returns ~0.032 -var y = beta.cdf( 0.8 ); +const y = beta.cdf( 0.8 ); // returns ~0.993 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/entropy/README.md index cdab8e4a55f7..755c1d389148 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/entropy/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/beta/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/beta/entropy' ); ``` #### entropy( alpha, beta ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/beta/entropy' ); Returns the [differential entropy][entropy] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = entropy( 1.0, 1.0 ); +let v = entropy( 1.0, 1.0 ); // returns 0.0 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, 0.0 ); +let v = entropy( 1.0, 0.0 ); // returns NaN v = entropy( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/beta/entropy' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = entropy( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/beta/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = entropy( alpha, beta ); console.log( 'α: %d, β: %d, h(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/kurtosis/README.md index b6e1f128d016..9f4358df27a5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/kurtosis/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/beta/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/beta/kurtosis' ); ``` #### kurtosis( alpha, beta ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/beta/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = kurtosis( 1.0, 1.0 ); +let v = kurtosis( 1.0, 1.0 ); // returns -1.2 v = kurtosis( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns NaN v = kurtosis( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 0.0 ); +let v = kurtosis( 1.0, 0.0 ); // returns NaN v = kurtosis( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = kurtosis( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/beta/kurtosis' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = kurtosis( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/beta/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = kurtosis( alpha, beta ); console.log( 'α: %d, β: %d, Kurt(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md index 994c72a9a062..a507cb058465 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter and `beta > 0` is the second shap ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/beta/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/beta/logcdf' ); ``` #### logcdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/beta/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = logcdf( 0.5, 1.0, 1.0 ); +let y = logcdf( 0.5, 1.0, 1.0 ); // returns ~-0.693 y = logcdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = logcdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0, 0.5 ); +let y = logcdf( 2.0, -1.0, 0.5 ); // returns NaN y = logcdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = logcdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.5, -1.0 ); +let y = logcdf( 2.0, 0.5, -1.0 ); // returns NaN y = logcdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = logcdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mylogcdf = logcdf.factory( 0.5, 0.5 ); +const mylogcdf = logcdf.factory( 0.5, 0.5 ); -var y = mylogcdf( 0.8 ); +let y = mylogcdf( 0.8 ); // returns ~-0.35 y = mylogcdf( 0.3 ); @@ -151,21 +151,15 @@ y = mylogcdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logcdf = require( '@stdlib/stats/base/dists/beta/logcdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = logcdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logcdf = require( '@stdlib/stats/base/dists/beta/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = logcdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(F(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/README.md index 07f9e3bf2a08..8b9bcc60d5d5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter and `beta > 0` is the second shap ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/beta/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/beta/logpdf' ); ``` #### logpdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/beta/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = logpdf( 0.5, 0.5, 1.0 ); +let y = logpdf( 0.5, 0.5, 1.0 ); // returns ~-0.347 y = logpdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = logpdf( 0.8, 4.0, 2.0 ); If provided an input value `x` outside the support `[0,1]`, the function returns `-Infinity`. ```javascript -var y = logpdf( -0.1, 1.0, 1.0 ); +let y = logpdf( -0.1, 1.0, 1.0 ); // returns -Infinity y = logpdf( 1.1, 1.0, 1.0 ); @@ -81,7 +81,7 @@ y = logpdf( 1.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 0.5, 0.0, 1.0 ); +let y = logpdf( 0.5, 0.0, 1.0 ); // returns NaN y = logpdf( 0.5, -1.0, 1.0 ); @@ -104,7 +104,7 @@ y = logpdf( 0.5, -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 0.5, 1.0, 0.0 ); +let y = logpdf( 0.5, 1.0, 0.0 ); // returns NaN y = logpdf( 0.5, 1.0, -1.0 ); @@ -116,9 +116,9 @@ y = logpdf( 0.5, 1.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mylogPDF = logpdf.factory( 0.5, 0.5 ); +const mylogPDF = logpdf.factory( 0.5, 0.5 ); -var y = mylogPDF( 0.8 ); +let y = mylogPDF( 0.8 ); // returns ~-0.228 y = mylogPDF( 0.3 ); @@ -146,21 +146,15 @@ y = mylogPDF( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logpdf = require( '@stdlib/stats/base/dists/beta/logpdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = logpdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logpdf = require( '@stdlib/stats/base/dists/beta/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = logpdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(f(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/mean/README.md index d26824a6b22f..a1c9169ba993 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/mean/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/beta/mean' ); +const mean = require( '@stdlib/stats/base/dists/beta/mean' ); ``` #### mean( alpha, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/beta/mean' ); Returns the [expected value][expected-value] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = mean( 1.0, 1.0 ); +let v = mean( 1.0, 1.0 ); // returns 0.5 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mean( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.0 ); +let v = mean( 1.0, 0.0 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/beta/mean' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mean( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/beta/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mean( alpha, beta ); console.log( 'α: %d, β: %d, E(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/median/README.md index 2bef1a90b5df..6142822493c6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/median/README.md @@ -55,7 +55,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/beta/median' ); +const median = require( '@stdlib/stats/base/dists/beta/median' ); ``` #### median( alpha, beta ) @@ -63,7 +63,7 @@ var median = require( '@stdlib/stats/base/dists/beta/median' ); Returns the [median][median] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = median( 1.0, 1.0 ); +let v = median( 1.0, 1.0 ); // returns 0.5 v = median( 4.0, 12.0 ); @@ -76,7 +76,7 @@ v = median( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -86,7 +86,7 @@ v = median( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = median( 0.0, 1.0 ); +let v = median( 0.0, 1.0 ); // returns NaN v = median( -1.0, 1.0 ); @@ -96,7 +96,7 @@ v = median( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = median( 1.0, 0.0 ); +let v = median( 1.0, 0.0 ); // returns NaN v = median( 1.0, -1.0 ); @@ -124,19 +124,14 @@ v = median( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var median = require( '@stdlib/stats/base/dists/beta/median' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = median( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const median = require( '@stdlib/stats/base/dists/beta/median' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = median( alpha, beta ); console.log( 'α: %d, β: %d, Median(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/mgf/README.md index b771ccd0316b..2ab8c817fcea 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/mgf/README.md @@ -54,7 +54,7 @@ where `alpha > 0` is the first shape parameter and `beta > 0` is the second shap ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/beta/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/beta/mgf' ); ``` #### mgf( t, alpha, beta ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/beta/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = mgf( 0.5, 1.0, 1.0 ); +let y = mgf( 0.5, 1.0, 1.0 ); // returns ~1.297 y = mgf( 0.5, 2.0, 4.0 ); @@ -78,7 +78,7 @@ y = mgf( -0.8, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1.0, 1.0 ); +let y = mgf( NaN, 1.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = mgf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, -1.0, 0.5 ); +let y = mgf( 2.0, -1.0, 0.5 ); // returns NaN y = mgf( 2.0, 0.0, 0.5 ); @@ -101,7 +101,7 @@ y = mgf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 0.5, -1.0 ); +let y = mgf( 2.0, 0.5, -1.0 ); // returns NaN y = mgf( 2.0, 0.5, 0.0 ); @@ -113,9 +113,9 @@ y = mgf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [moment-generating function][mgf] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mymgf = mgf.factory( 0.5, 0.5 ); +const mymgf = mgf.factory( 0.5, 0.5 ); -var y = mymgf( 0.8 ); +let y = mymgf( 0.8 ); // returns ~1.552 y = mymgf( 0.3 ); @@ -143,21 +143,15 @@ y = mymgf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mgf = require( '@stdlib/stats/base/dists/beta/mgf' ); - -var alpha; -var beta; -var t; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 20.0; - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - v = mgf( t, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mgf = require( '@stdlib/stats/base/dists/beta/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 20.0; + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const v = mgf( t, alpha, beta ); console.log( 't: %d, α: %d, β: %d, M_X(t;α,β): %d', t.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/mode/README.md index 695bbed096fd..c8b1f1bfb3b6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/mode/README.md @@ -54,7 +54,7 @@ for `α > 1` and `β > 1`. For other values of first shape parameter `α` and se ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/beta/mode' ); +const mode = require( '@stdlib/stats/base/dists/beta/mode' ); ``` #### mode( alpha, beta ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/beta/mode' ); Returns the [mode][mode] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = mode( 2.5, 1.5 ); +let v = mode( 2.5, 1.5 ); // returns 0.75 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 2.0, NaN ); If provided `alpha <= 1`, the function returns `NaN`. ```javascript -var v = mode( 0.5, 1.0 ); +let v = mode( 0.5, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 1.0 ); If provided `beta <= 1`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.5 ); +let v = mode( 1.0, 0.5 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/beta/mode' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + 1.0 + EPS; - beta = ( randu()*10.0 ) + 1.0 + EPS; - v = mode( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/beta/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + 1.0 + EPS; + const beta = ( randu()*10.0 ) + 1.0 + EPS; + const v = mode( alpha, beta ); console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/pdf/README.md index 4c65b8242228..f2dff298b901 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/pdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter and `beta > 0` is the second shap ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/beta/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/beta/pdf' ); ``` #### pdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/beta/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = pdf( 0.5, 0.5, 1.0 ); +let y = pdf( 0.5, 0.5, 1.0 ); // returns ~0.707 y = pdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( 0.8, 4.0, 2.0 ); If provided a `x` outside the support `[0,1]`, the function returns `0`. ```javascript -var y = pdf( -0.1, 1.0, 1.0 ); +let y = pdf( -0.1, 1.0, 1.0 ); // returns 0.0 y = pdf( 1.1, 1.0, 1.0 ); @@ -81,7 +81,7 @@ y = pdf( 1.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 0.5, 0.0, 1.0 ); +let y = pdf( 0.5, 0.0, 1.0 ); // returns NaN y = pdf( 0.5, -1.0, 1.0 ); @@ -104,7 +104,7 @@ y = pdf( 0.5, -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 0.5, 1.0, 0.0 ); +let y = pdf( 0.5, 1.0, 0.0 ); // returns NaN y = pdf( 0.5, 1.0, -1.0 ); @@ -116,9 +116,9 @@ y = pdf( 0.5, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mypdf = pdf.factory( 0.5, 0.5 ); +const mypdf = pdf.factory( 0.5, 0.5 ); -var y = mypdf( 0.8 ); +let y = mypdf( 0.8 ); // returns ~0.796 y = mypdf( 0.3 ); @@ -136,21 +136,15 @@ y = mypdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var pdf = require( '@stdlib/stats/base/dists/beta/pdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = pdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const pdf = require( '@stdlib/stats/base/dists/beta/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = pdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, f(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/quantile/README.md index 0b1382401331..34879df7bc98 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `alpha > 0` is the first shape parameter and `beta > 0` ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/beta/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/beta/quantile' ); ``` #### quantile( p, alpha, beta ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/beta/quantile' ); Evaluates the [quantile function][quantile-function] for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = quantile( 0.8, 2.0, 1.0 ); +let y = quantile( 0.8, 2.0, 1.0 ); // returns ~0.894 y = quantile( 0.5, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.5, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.5, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +let y = quantile( 0.4, -1.0, 1.0 ); // returns NaN y = quantile( 0.4, 0.0, 1.0 ); @@ -101,7 +101,7 @@ y = quantile( 0.4, 0.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +let y = quantile( 0.4, 1.0, -1.0 ); // returns NaN y = quantile( 0.4, 1.0, 0.0 ); @@ -113,9 +113,9 @@ y = quantile( 0.4, 1.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var myquantile = quantile.factory( 2.0, 2.0 ); +const myquantile = quantile.factory( 2.0, 2.0 ); -var y = myquantile( 0.8 ); +let y = myquantile( 0.8 ); // returns ~0.713 y = myquantile( 0.4 ); @@ -133,21 +133,15 @@ y = myquantile( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var quantile = require( '@stdlib/stats/base/dists/beta/quantile' ); - -var alpha; -var beta; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = quantile( p, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const quantile = require( '@stdlib/stats/base/dists/beta/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = quantile( p, alpha, beta ); console.log( 'p: %d, α: %d, β: %d, Q(p;α,β): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/skewness/README.md index 4e60bdf3ed23..c2498259ac42 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/skewness/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/beta/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/beta/skewness' ); ``` #### skewness( alpha, beta ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/beta/skewness' ); Returns the [skewness][skewness] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = skewness( 1.0, 1.0 ); +let v = skewness( 1.0, 1.0 ); // returns 0.0 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 0.0, 1.0 ); +let v = skewness( 0.0, 1.0 ); // returns NaN v = skewness( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = skewness( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 0.0 ); +let v = skewness( 1.0, 0.0 ); // returns NaN v = skewness( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/beta/skewness' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = skewness( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/beta/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = skewness( alpha, beta ); console.log( 'α: %d, β: %d, skew(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/stdev/README.md index 444ea66821db..d6a084004d78 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/stdev/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/beta/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/beta/stdev' ); ``` #### stdev( alpha, beta ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/beta/stdev' ); Returns the [standard deviation][stdev] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = stdev( 1.0, 1.0 ); +let v = stdev( 1.0, 1.0 ); // returns ~0.289 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 0.0 ); +let v = stdev( 1.0, 0.0 ); // returns NaN v = stdev( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = stdev( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/beta/stdev' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = stdev( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/beta/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = stdev( alpha, beta ); console.log( 'α: %d, β: %d, SD(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/variance/README.md index a5bb9bc9e445..151dd89fdd99 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/variance/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/beta/variance' ); +const variance = require( '@stdlib/stats/base/dists/beta/variance' ); ``` #### variance( alpha, beta ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/beta/variance' ); Returns the [variance][variance] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = variance( 1.0, 1.0 ); +let v = variance( 1.0, 1.0 ); // returns ~0.083 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 0.0 ); +let v = variance( 1.0, 0.0 ); // returns NaN v = variance( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = variance( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/beta/variance' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = variance( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/beta/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = variance( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/README.md index 8fb50b56a741..76f9367c2f72 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var betaprime = require( '@stdlib/stats/base/dists/betaprime' ); +const betaprime = require( '@stdlib/stats/base/dists/betaprime' ); ``` #### betaprime @@ -35,7 +35,7 @@ var betaprime = require( '@stdlib/stats/base/dists/betaprime' ); Beta prime distribution. ```javascript -var dist = betaprime; +const dist = betaprime; // returns {...} ``` @@ -85,11 +85,11 @@ The namespace contains a constructor function for creating a [betaprime][betapri ```javascript -var BetaPrime = require( '@stdlib/stats/base/dists/betaprime' ).BetaPrime; +const BetaPrime = require( '@stdlib/stats/base/dists/betaprime' ).BetaPrime; -var dist = new BetaPrime( 2.0, 4.0 ); +const dist = new BetaPrime( 2.0, 4.0 ); -var mu = dist.mean; +const mu = dist.mean; // returns ~0.667 ``` @@ -106,8 +106,8 @@ var mu = dist.mean; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var betaprime = require( '@stdlib/stats/base/dists/betaprime' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const betaprime = require( '@stdlib/stats/base/dists/betaprime' ); console.log( objectKeys( betaprime ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/cdf/README.md index 6bf8934a1c85..6b1cb18583a9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/cdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter, `beta > 0` is the second shape p ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/betaprime/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/betaprime/cdf' ); ``` #### cdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/betaprime/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = cdf( 0.5, 1.0, 1.0 ); +let y = cdf( 0.5, 1.0, 1.0 ); // returns ~0.333 y = cdf( 0.5, 2.0, 4.0 ); @@ -80,7 +80,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -93,7 +93,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +let y = cdf( 2.0, -1.0, 0.5 ); // returns NaN y = cdf( 2.0, 0.0, 0.5 ); @@ -103,7 +103,7 @@ y = cdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -115,9 +115,9 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mycdf = cdf.factory( 0.5, 0.5 ); +const mycdf = cdf.factory( 0.5, 0.5 ); -var y = mycdf( 0.8 ); +let y = mycdf( 0.8 ); // returns ~0.465 y = mycdf( 0.3 ); @@ -135,21 +135,15 @@ y = mycdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var cdf = require( '@stdlib/stats/base/dists/betaprime/cdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = cdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const cdf = require( '@stdlib/stats/base/dists/betaprime/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = cdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, F(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/ctor/README.md index c21c15ccec5e..8e7513d480b6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var BetaPrime = require( '@stdlib/stats/base/dists/betaprime/ctor' ); +const BetaPrime = require( '@stdlib/stats/base/dists/betaprime/ctor' ); ``` #### BetaPrime( \[alpha, beta] ) @@ -45,18 +45,18 @@ var BetaPrime = require( '@stdlib/stats/base/dists/betaprime/ctor' ); Returns a [beta prime][betaprime-distribution] distribution object. ```javascript -var betaprime = new BetaPrime(); +const betaprime = new BetaPrime(); -var mode = betaprime.mode; +const mode = betaprime.mode; // returns 0.0 ``` By default, `alpha = 1.0` and `beta = 1.0`. To create a distribution having a different `alpha` (first shape parameter) and `beta` (second shape parameter), provide the corresponding arguments. ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var mu = betaprime.mean; +const mu = betaprime.mean; // returns ~0.667 ``` @@ -73,9 +73,9 @@ A [beta prime][betaprime-distribution] distribution object has the following pro First shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var betaprime = new BetaPrime(); +const betaprime = new BetaPrime(); -var alpha = betaprime.alpha; +let alpha = betaprime.alpha; // returns 1.0 betaprime.alpha = 3.0; @@ -89,9 +89,9 @@ alpha = betaprime.alpha; Second shape parameter of the distribution. `beta` **must** be a positive number. ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var b = betaprime.beta; +let b = betaprime.beta; // returns 4.0 betaprime.beta = 3.0; @@ -109,9 +109,9 @@ b = betaprime.beta; Returns the [excess kurtosis][kurtosis]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var kurtosis = betaprime.kurtosis; +const kurtosis = betaprime.kurtosis; // returns ~5.764 ``` @@ -120,9 +120,9 @@ var kurtosis = betaprime.kurtosis; Returns the [expected value][expected-value]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var mu = betaprime.mean; +const mu = betaprime.mean; // returns ~0.364 ``` @@ -131,9 +131,9 @@ var mu = betaprime.mean; Returns the [mode][mode]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var mode = betaprime.mode; +const mode = betaprime.mode; // returns ~0.231 ``` @@ -142,9 +142,9 @@ var mode = betaprime.mode; Returns the [skewness][skewness]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var skewness = betaprime.skewness; +const skewness = betaprime.skewness; // returns ~1.724 ``` @@ -153,9 +153,9 @@ var skewness = betaprime.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var s = betaprime.stdev; +const s = betaprime.stdev; // returns ~0.223 ``` @@ -164,9 +164,9 @@ var s = betaprime.stdev; Returns the [variance][variance]. ```javascript -var betaprime = new BetaPrime( 4.0, 12.0 ); +const betaprime = new BetaPrime( 4.0, 12.0 ); -var s2 = betaprime.variance; +const s2 = betaprime.variance; // returns ~0.05 ``` @@ -179,9 +179,9 @@ var s2 = betaprime.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var y = betaprime.cdf( 0.5 ); +const y = betaprime.cdf( 0.5 ); // returns ~0.539 ``` @@ -190,9 +190,9 @@ var y = betaprime.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var y = betaprime.logcdf( 0.5 ); +const y = betaprime.logcdf( 0.5 ); // returns ~-0.618 ``` @@ -201,9 +201,9 @@ var y = betaprime.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var y = betaprime.logpdf( 0.8 ); +const y = betaprime.logpdf( 0.8 ); // returns ~-0.754 ``` @@ -212,9 +212,9 @@ var y = betaprime.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var y = betaprime.pdf( 0.8 ); +const y = betaprime.pdf( 0.8 ); // returns ~0.47 ``` @@ -223,9 +223,9 @@ var y = betaprime.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var y = betaprime.quantile( 0.5 ); +let y = betaprime.quantile( 0.5 ); // returns ~0.457 y = betaprime.quantile( 1.9 ); @@ -255,20 +255,20 @@ y = betaprime.quantile( 1.9 ); ```javascript -var BetaPrime = require( '@stdlib/stats/base/dists/betaprime/ctor' ); +const BetaPrime = require( '@stdlib/stats/base/dists/betaprime/ctor' ); -var betaprime = new BetaPrime( 2.0, 4.0 ); +const betaprime = new BetaPrime( 2.0, 4.0 ); -var mu = betaprime.mean; +const mu = betaprime.mean; // returns ~0.667 -var mode = betaprime.mode; +const mode = betaprime.mode; // returns 0.2 -var s2 = betaprime.variance; +const s2 = betaprime.variance; // returns ~0.556 -var y = betaprime.cdf( 0.8 ); +const y = betaprime.cdf( 0.8 ); // returns ~0.735 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/kurtosis/README.md index 506f0043993e..102508ee5eb8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/kurtosis/README.md @@ -54,7 +54,7 @@ when `α > 0` and `β > 4`. Otherwise, the excess kurtosis is not defined. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/betaprime/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/betaprime/kurtosis' ); ``` #### kurtosis( alpha, beta ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/betaprime/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = kurtosis( 2.0, 5.0 ); +let v = kurtosis( 2.0, 5.0 ); // returns 54.0 v = kurtosis( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 12.0, 6.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 5.0 ); +let v = kurtosis( NaN, 5.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 5.0 ); +let v = kurtosis( 0.0, 5.0 ); // returns NaN v = kurtosis( -1.0, 5.0 ); @@ -95,7 +95,7 @@ v = kurtosis( -1.0, 5.0 ); If provided `beta <= 4`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 3.5 ); +let v = kurtosis( 1.0, 3.5 ); // returns NaN v = kurtosis( 1.0, 2.0 ); @@ -126,19 +126,14 @@ v = kurtosis( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/betaprime/kurtosis' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + 4.0 + EPS; - v = kurtosis( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/betaprime/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + 4.0 + EPS; + const v = kurtosis( alpha, beta ); console.log( 'α: %d, β: %d, Kurt(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/logcdf/README.md index aad12eb68b63..403b4dd0b59b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/logcdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the first shape parameter, `beta > 0` is the second shape p ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/betaprime/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/betaprime/logcdf' ); ``` #### logcdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/betaprime/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = logcdf( 0.5, 1.0, 1.0 ); +let y = logcdf( 0.5, 1.0, 1.0 ); // returns ~-1.099 y = logcdf( 0.5, 2.0, 4.0 ); @@ -80,7 +80,7 @@ y = logcdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -93,7 +93,7 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0, 0.5 ); +let y = logcdf( 2.0, -1.0, 0.5 ); // returns NaN y = logcdf( 2.0, 0.0, 0.5 ); @@ -103,7 +103,7 @@ y = logcdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.5, -1.0 ); +let y = logcdf( 2.0, 0.5, -1.0 ); // returns NaN y = logcdf( 2.0, 0.5, 0.0 ); @@ -115,9 +115,9 @@ y = logcdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mylogcdf = logcdf.factory( 0.5, 0.5 ); +const mylogcdf = logcdf.factory( 0.5, 0.5 ); -var y = mylogcdf( 0.8 ); +let y = mylogcdf( 0.8 ); // returns ~-0.767 y = mylogcdf( 0.3 ); @@ -145,21 +145,15 @@ y = mylogcdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logcdf = require( '@stdlib/stats/base/dists/betaprime/logcdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = logcdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logcdf = require( '@stdlib/stats/base/dists/betaprime/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = logcdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(F(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/logpdf/README.md index c6380247ebd3..848989169698 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/logpdf/README.md @@ -50,7 +50,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/betaprime/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/betaprime/logpdf' ); ``` #### logpdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/betaprime/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = logpdf( 0.5, 0.5, 1.0 ); +let y = logpdf( 0.5, 0.5, 1.0 ); // returns ~-0.955 y = logpdf( 0.1, 1.0, 1.0 ); @@ -71,14 +71,14 @@ y = logpdf( 0.8, 4.0, 2.0 ); If provided an input value `x` outside smaller or equal to zero, the function returns `-Infinity`. ```javascript -var y = logpdf( -0.1, 1.0, 1.0 ); +const y = logpdf( -0.1, 1.0, 1.0 ); // returns -Infinity ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 0.5, 0.0, 1.0 ); +let y = logpdf( 0.5, 0.0, 1.0 ); // returns NaN y = logpdf( 0.5, -1.0, 1.0 ); @@ -101,7 +101,7 @@ y = logpdf( 0.5, -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 0.5, 1.0, 0.0 ); +let y = logpdf( 0.5, 1.0, 0.0 ); // returns NaN y = logpdf( 0.5, 1.0, -1.0 ); @@ -113,9 +113,9 @@ y = logpdf( 0.5, 1.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mylogPDF = logpdf.factory( 0.5, 0.5 ); +const mylogPDF = logpdf.factory( 0.5, 0.5 ); -var y = mylogPDF( 0.8 ); +let y = mylogPDF( 0.8 ); // returns ~-1.62 y = mylogPDF( 0.3 ); @@ -143,21 +143,15 @@ y = mylogPDF( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logpdf = require( '@stdlib/stats/base/dists/betaprime/logpdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = logpdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logpdf = require( '@stdlib/stats/base/dists/betaprime/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = logpdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(f(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/mean/README.md index 7124b729c025..d7cc22f148fa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/mean/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 1` is the second shape par ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/betaprime/mean' ); +const mean = require( '@stdlib/stats/base/dists/betaprime/mean' ); ``` #### mean( alpha, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/betaprime/mean' ); Returns the [expected value][expected-value] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = mean( 1.0, 2.0 ); +let v = mean( 1.0, 2.0 ); // returns 1.0 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mean( -1.0, 1.0 ); If provided `beta <= 1`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.8 ); +let v = mean( 1.0, 0.8 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/betaprime/mean' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + 1.0 + EPS; - v = mean( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/betaprime/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + 1.0 + EPS; + const v = mean( alpha, beta ); console.log( 'α: %d, β: %d, E(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/mode/README.md index 470a8db2387b..6ce95d551c89 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/mode/README.md @@ -54,7 +54,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/betaprime/mode' ); +const mode = require( '@stdlib/stats/base/dists/betaprime/mode' ); ``` #### mode( alpha, beta ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/betaprime/mode' ); Returns the [mode][mode] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = mode( 8.0, 2.0 ); +let v = mode( 8.0, 2.0 ); // returns ~2.333 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.0 ); +let v = mode( 1.0, 0.0 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/betaprime/mode' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mode( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/betaprime/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mode( alpha, beta ); console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/README.md index 76e4f334d43c..b4d8821b2a21 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/README.md @@ -50,7 +50,7 @@ where `α > 0` is the first shape parameter and `β > 0` is the second shape par ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/betaprime/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/betaprime/pdf' ); ``` #### pdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/betaprime/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = pdf( 0.5, 0.5, 1.0 ); +let y = pdf( 0.5, 0.5, 1.0 ); // returns ~0.385 y = pdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( 0.8, 4.0, 2.0 ); If provided a `x <= 0`, the function returns `0`. ```javascript -var y = pdf( -0.1, 1.0, 1.0 ); +let y = pdf( -0.1, 1.0, 1.0 ); // returns 0.0 y = pdf( 0.0, 1.0, 1.0 ); @@ -81,7 +81,7 @@ y = pdf( 0.0, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 0.5, 0.0, 1.0 ); +let y = pdf( 0.5, 0.0, 1.0 ); // returns NaN y = pdf( 0.5, -1.0, 1.0 ); @@ -104,7 +104,7 @@ y = pdf( 0.5, -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 0.5, 1.0, 0.0 ); +let y = pdf( 0.5, 1.0, 0.0 ); // returns NaN y = pdf( 0.5, 1.0, -1.0 ); @@ -116,9 +116,9 @@ y = pdf( 0.5, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var mypdf = pdf.factory( 0.5, 0.5 ); +const mypdf = pdf.factory( 0.5, 0.5 ); -var y = mypdf( 0.8 ); +let y = mypdf( 0.8 ); // returns ~0.198 y = mypdf( 0.3 ); @@ -136,21 +136,15 @@ y = mypdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var pdf = require( '@stdlib/stats/base/dists/betaprime/pdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = pdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const pdf = require( '@stdlib/stats/base/dists/betaprime/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = pdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, f(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/README.md index eff820a35c03..82798dc0ee4d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `G^-1` denotes the quantile function of a [beta][beta-d ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/betaprime/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/betaprime/quantile' ); ``` #### quantile( p, alpha, beta ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/betaprime/quantile' ); Evaluates the [quantile function][quantile-function] for a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var y = quantile( 0.8, 2.0, 1.0 ); +let y = quantile( 0.8, 2.0, 1.0 ); // returns ~8.472 y = quantile( 0.5, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.5, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.5, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +let y = quantile( 0.4, -1.0, 1.0 ); // returns NaN y = quantile( 0.4, 0.0, 1.0 ); @@ -101,7 +101,7 @@ y = quantile( 0.4, 0.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +let y = quantile( 0.4, 1.0, -1.0 ); // returns NaN y = quantile( 0.4, 1.0, 0.0 ); @@ -113,9 +113,9 @@ y = quantile( 0.4, 1.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var myQuantile = quantile.factory( 2.0, 2.0 ); +const myQuantile = quantile.factory( 2.0, 2.0 ); -var y = myQuantile( 0.8 ); +let y = myQuantile( 0.8 ); // returns ~2.483 y = myQuantile( 0.4 ); @@ -133,21 +133,15 @@ y = myQuantile( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var quantile = require( '@stdlib/stats/base/dists/betaprime/quantile' ); - -var alpha; -var beta; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - alpha = ( randu()*5.0 ) + EPS; - beta = ( randu()*5.0 ) + EPS; - y = quantile( p, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const quantile = require( '@stdlib/stats/base/dists/betaprime/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const alpha = ( randu()*5.0 ) + EPS; + const beta = ( randu()*5.0 ) + EPS; + const y = quantile( p, alpha, beta ); console.log( 'p: %d, α: %d, β: %d, Q(p;α,β): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/README.md index 11c8e781c133..bea989970a3b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/README.md @@ -54,7 +54,7 @@ when `α > 0` and `β > 3`. Otherwise, the skewness is not defined. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/betaprime/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/betaprime/skewness' ); ``` #### skewness( alpha, beta ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/betaprime/skewness' ); Returns the [skewness][skewness] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = skewness( 2.0, 4.0 ); +let v = skewness( 2.0, 4.0 ); // returns ~6.261 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 8.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 4.0 ); +let v = skewness( NaN, 4.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 0.0, 4.0 ); +let v = skewness( 0.0, 4.0 ); // returns NaN v = skewness( -1.0, 4.0 ); @@ -95,7 +95,7 @@ v = skewness( -1.0, 4.0 ); If provided `beta <= 3`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 2.5 ); +let v = skewness( 1.0, 2.5 ); // returns NaN v = skewness( 1.0, 0.0 ); @@ -126,19 +126,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/betaprime/skewness' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + 3.0 + EPS; - v = skewness( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/betaprime/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + 3.0 + EPS; + const v = skewness( alpha, beta ); console.log( 'α: %d, β: %d, skew(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/README.md index 51c74a128973..f7846465f6e6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/README.md @@ -54,7 +54,7 @@ when `α > 0` and `β > 2`. Otherwise, the standard deviation is not defined. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/betaprime/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/betaprime/stdev' ); ``` #### stdev( alpha, beta ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/betaprime/stdev' ); Returns the [standard deviation][stdev] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = stdev( 1.0, 3.0 ); +let v = stdev( 1.0, 3.0 ); // returns ~0.866 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `beta <= 2`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 2.0 ); +let v = stdev( 1.0, 2.0 ); // returns NaN v = stdev( 1.0, 0.0 ); @@ -126,19 +126,14 @@ v = stdev( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/betaprime/stdev' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + 2.0 + EPS; - v = stdev( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/betaprime/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + 2.0 + EPS; + const v = stdev( alpha, beta ); console.log( 'α: %d, β: %d, SD(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/README.md index 45617fadc8b0..9eceb04ce2f7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/README.md @@ -54,7 +54,7 @@ when `α > 0` and `β > 2`. Otherwise, the variance is not defined. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/betaprime/variance' ); +const variance = require( '@stdlib/stats/base/dists/betaprime/variance' ); ``` #### variance( alpha, beta ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/betaprime/variance' ); Returns the [variance][variance] of a [beta prime][betaprime-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). ```javascript -var v = variance( 1.0, 3.0 ); +let v = variance( 1.0, 3.0 ); // returns ~0.75 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `beta <= 2`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 2.0 ); +let v = variance( 1.0, 2.0 ); // returns NaN v = variance( 1.0, 0.0 ); @@ -126,19 +126,14 @@ v = variance( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/betaprime/variance' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + 2.0 + EPS; - v = variance( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/betaprime/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + 2.0 + EPS; + const v = variance( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/README.md index e1f09dbe67f8..fdd29305215e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binomial = require( '@stdlib/stats/base/dists/binomial' ); +const binomial = require( '@stdlib/stats/base/dists/binomial' ); ``` #### binomial @@ -35,7 +35,7 @@ var binomial = require( '@stdlib/stats/base/dists/binomial' ); Binomial distribution. ```javascript -var dist = binomial; +const dist = binomial; // returns {...} ``` @@ -87,10 +87,10 @@ The namespace contains a constructor function for creating a [binomial][binomial ```javascript -var Binomial = require( '@stdlib/stats/base/dists/binomial' ).Binomial; -var dist = new Binomial( 10, 0.4 ); +const Binomial = require( '@stdlib/stats/base/dists/binomial' ).Binomial; +const dist = new Binomial( 10, 0.4 ); -var mu = dist.mean; +const mu = dist.mean; // returns 4 ``` @@ -107,15 +107,15 @@ var mu = dist.mean; ```javascript -var binomial = require( '@stdlib/stats/base/dists/binomial' ); +const binomial = require( '@stdlib/stats/base/dists/binomial' ); /* * Let's take an example of rolling a fair dice 10 times and counting the number of times a 6 is rolled. * This situation can be modeled using a Binomial distribution with n = 10 and p = 1/6 */ -var n = 10; -var p = 1/6; +const n = 10; +const p = 1/6; // Mean can be used to calculate the average number of times a 6 is rolled: console.log( binomial.mean( n, p ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/cdf/README.md index 44a044f55476..77d3ee2d6d48 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/cdf/README.md @@ -65,7 +65,7 @@ where `I` is the [lower regularized incomplete beta function][incomplete-beta]. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/binomial/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/binomial/cdf' ); ``` #### cdf( x, n, p ) @@ -73,7 +73,7 @@ var cdf = require( '@stdlib/stats/base/dists/binomial/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var y = cdf( 3.0, 20, 0.2 ); +let y = cdf( 3.0, 20, 0.2 ); // returns ~0.411 y = cdf( 21.0, 20, 0.2 ); @@ -89,7 +89,7 @@ y = cdf( 0.0, 10, 0.4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 20, 0.5 ); +let y = cdf( NaN, 20, 0.5 ); // returns NaN y = cdf( 0.0, NaN, 0.5 ); @@ -102,7 +102,7 @@ y = cdf( 0.0, 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 1.5, 0.5 ); +let y = cdf( 2.0, 1.5, 0.5 ); // returns NaN y = cdf( 2.0, -2.0, 0.5 ); @@ -112,7 +112,7 @@ y = cdf( 2.0, -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 20, -1.0 ); +let y = cdf( 2.0, 20, -1.0 ); // returns NaN y = cdf( 2.0, 20, 1.5 ); @@ -124,9 +124,9 @@ y = cdf( 2.0, 20, 1.5 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var mycdf = cdf.factory( 10, 0.5 ); +const mycdf = cdf.factory( 10, 0.5 ); -var y = mycdf( 3.0 ); +let y = mycdf( 3.0 ); // returns ~0.172 y = mycdf( 1.0 ); @@ -144,21 +144,15 @@ y = mycdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/binomial/cdf' ); - -var i; -var n; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 20.0; - n = round( randu() * 100.0 ); - p = randu(); - y = cdf( x, n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/binomial/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 20.0; + const n = round( randu() * 100.0 ); + const p = randu(); + const y = cdf( x, n, p ); console.log( 'x: %d, n: %d, p: %d, F(x;n,p): %d', x.toFixed( 4 ), n, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/ctor/README.md index f657d7f7e089..1a6a58146a09 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Binomial = require( '@stdlib/stats/base/dists/binomial/ctor' ); +const Binomial = require( '@stdlib/stats/base/dists/binomial/ctor' ); ``` #### Binomial( \[n, p] ) @@ -45,18 +45,18 @@ var Binomial = require( '@stdlib/stats/base/dists/binomial/ctor' ); Returns a [binomial][binomial-distribution] distribution object. ```javascript -var binomial = new Binomial(); +const binomial = new Binomial(); -var mu = binomial.mean; +const mu = binomial.mean; // returns 0.5 ``` By default, `n = 1` and `p = 0.5`, which corresponds to a [Bernoulli][bernoulli-distribution] distribution. To create a distribution having a different `n` (number of trials) and `p` (success probability), provide the corresponding arguments. ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var mu = binomial.mean; +const mu = binomial.mean; // returns 0.8 ``` @@ -73,9 +73,9 @@ A [binomial][binomial-distribution] distribution object has the following proper Number of trials of the distribution. `n` **must** be a positive integer. ```javascript -var binomial = new Binomial(); +const binomial = new Binomial(); -var n = binomial.n; +let n = binomial.n; // returns 1.0 binomial.n = 4; @@ -89,9 +89,9 @@ n = binomial.n; Success probability of the distribution. `p` **must** be a number between 0 and 1. ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var p = binomial.p; +let p = binomial.p; // returns 0.2 binomial.p = 0.7; @@ -109,9 +109,9 @@ p = binomial.p; Returns the [excess kurtosis][kurtosis]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var kurtosis = binomial.kurtosis; +const kurtosis = binomial.kurtosis; // returns ~-0.153 ``` @@ -120,9 +120,9 @@ var kurtosis = binomial.kurtosis; Returns the [expected value][expected-value]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var mu = binomial.mean; +const mu = binomial.mean; // returns ~4.8 ``` @@ -131,9 +131,9 @@ var mu = binomial.mean; Returns the [median][median]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var median = binomial.median; +const median = binomial.median; // returns 5.0 ``` @@ -142,9 +142,9 @@ var median = binomial.median; Returns the [mode][mode]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var mode = binomial.mode; +const mode = binomial.mode; // returns 5.0 ``` @@ -153,9 +153,9 @@ var mode = binomial.mode; Returns the [skewness][skewness]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var skewness = binomial.skewness; +const skewness = binomial.skewness; // returns ~0.118 ``` @@ -164,9 +164,9 @@ var skewness = binomial.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var s = binomial.stdev; +const s = binomial.stdev; // returns ~1.697 ``` @@ -175,9 +175,9 @@ var s = binomial.stdev; Returns the [variance][variance]. ```javascript -var binomial = new Binomial( 12, 0.4 ); +const binomial = new Binomial( 12, 0.4 ); -var s2 = binomial.variance; +const s2 = binomial.variance; // returns ~2.88 ``` @@ -190,9 +190,9 @@ var s2 = binomial.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var y = binomial.cdf( 0.5 ); +const y = binomial.cdf( 0.5 ); // returns ~0.41 ``` @@ -201,9 +201,9 @@ var y = binomial.cdf( 0.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF). ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var y = binomial.logpmf( 2.0 ); +const y = binomial.logpmf( 2.0 ); // returns ~-1.873 ``` @@ -212,9 +212,9 @@ var y = binomial.logpmf( 2.0 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var y = binomial.mgf( 0.5 ); +const y = binomial.mgf( 0.5 ); // returns ~1.629 ``` @@ -223,9 +223,9 @@ var y = binomial.mgf( 0.5 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var y = binomial.pmf( 2.0 ); +const y = binomial.pmf( 2.0 ); // returns ~0.154 ``` @@ -234,9 +234,9 @@ var y = binomial.pmf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var binomial = new Binomial( 4, 0.2 ); +const binomial = new Binomial( 4, 0.2 ); -var y = binomial.quantile( 0.5 ); +let y = binomial.quantile( 0.5 ); // returns 1.0 y = binomial.quantile( 1.9 ); @@ -266,20 +266,20 @@ y = binomial.quantile( 1.9 ); ```javascript -var Binomial = require( '@stdlib/stats/base/dists/binomial/ctor' ); +const Binomial = require( '@stdlib/stats/base/dists/binomial/ctor' ); -var binomial = new Binomial( 10, 0.4 ); +const binomial = new Binomial( 10, 0.4 ); -var mu = binomial.mean; +const mu = binomial.mean; // returns 4.0 -var mode = binomial.mode; +const mode = binomial.mode; // returns 4.0 -var s2 = binomial.variance; +const s2 = binomial.variance; // returns 2.4 -var y = binomial.cdf( 0.8 ); +const y = binomial.cdf( 0.8 ); // returns ~0.006 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/entropy/README.md index c26c36728b6e..899a91e75410 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/entropy/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/binomial/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/binomial/entropy' ); ``` #### entropy( n, p ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/binomial/entropy' ); Returns the [entropy][entropy] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p` (in [nats][nats]). ```javascript -var v = entropy( 20, 0.1 ); +let v = entropy( 20, 0.1 ); // returns ~1.667 v = entropy( 50, 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 0.5 ); +let v = entropy( NaN, 0.5 ); // returns NaN v = entropy( 20, NaN ); @@ -82,7 +82,7 @@ v = entropy( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = entropy( 1.5, 0.5 ); +let v = entropy( 1.5, 0.5 ); // returns NaN v = entropy( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = entropy( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = entropy( 20, -1.0 ); +let v = entropy( 20, -1.0 ); // returns NaN v = entropy( 20, 1.5 ); @@ -120,19 +120,14 @@ v = entropy( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/binomial/entropy' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = entropy( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/binomial/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = entropy( n, p ); console.log( 'n: %d, p: %d, H(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/kurtosis/README.md index de3dd1b3c36d..9e3ee590615c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/kurtosis/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/binomial/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/binomial/kurtosis' ); ``` #### kurtosis( n, p ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/binomial/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = kurtosis( 20, 0.1 ); +let v = kurtosis( 20, 0.1 ); // returns ~0.256 v = kurtosis( 50, 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 0.5 ); +let v = kurtosis( NaN, 0.5 ); // returns NaN v = kurtosis( 20, NaN ); @@ -82,7 +82,7 @@ v = kurtosis( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = kurtosis( 1.5, 0.5 ); +let v = kurtosis( 1.5, 0.5 ); // returns NaN v = kurtosis( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = kurtosis( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = kurtosis( 20, -1.0 ); +let v = kurtosis( 20, -1.0 ); // returns NaN v = kurtosis( 20, 1.5 ); @@ -120,19 +120,14 @@ v = kurtosis( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/binomial/kurtosis' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = kurtosis( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/binomial/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = kurtosis( n, p ); console.log( 'n: %d, p: %d, Kurt(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/logpmf/README.md index 22da4e70062f..299fbd025672 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/logpmf/README.md @@ -50,7 +50,7 @@ where `n` is the number of trials and `0 <= p <= 1` is the success probability. ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/binomial/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/binomial/logpmf' ); ``` #### logpmf( x, n, p ) @@ -58,7 +58,7 @@ var logpmf = require( '@stdlib/stats/base/dists/binomial/logpmf' ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF) for a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var y = logpmf( 3.0, 20, 0.2 ); +let y = logpmf( 3.0, 20, 0.2 ); // returns ~-1.583 y = logpmf( 21.0, 20, 0.2 ); @@ -74,7 +74,7 @@ y = logpmf( 0.0, 10, 0.4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, 20, 0.5 ); +let y = logpmf( NaN, 20, 0.5 ); // returns NaN y = logpmf( 0.0, NaN, 0.5 ); @@ -87,7 +87,7 @@ y = logpmf( 0.0, 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 1.5, 0.5 ); +let y = logpmf( 2.0, 1.5, 0.5 ); // returns NaN y = logpmf( 2.0, -2.0, 0.5 ); @@ -97,7 +97,7 @@ y = logpmf( 2.0, -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 20, -1.0 ); +let y = logpmf( 2.0, 20, -1.0 ); // returns NaN y = logpmf( 2.0, 20, 1.5 ); @@ -109,9 +109,9 @@ y = logpmf( 2.0, 20, 1.5 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var mylogpmf = logpmf.factory( 10, 0.5 ); +const mylogpmf = logpmf.factory( 10, 0.5 ); -var y = mylogpmf( 3.0 ); +let y = mylogpmf( 3.0 ); // returns ~-2.144 y = mylogpmf( 5.0 ); @@ -129,21 +129,15 @@ y = mylogpmf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/binomial/logpmf' ); - -var i; -var n; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 20.0 ); - n = round( randu() * 100.0 ); - p = randu(); - y = logpmf( x, n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/binomial/logpmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 20.0 ); + const n = round( randu() * 100.0 ); + const p = randu(); + const y = logpmf( x, n, p ); console.log( 'x: %d, n: %d, p: %d, ln(P(X = x;n,p)): %d', x, n, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/mean/README.md index e8d6be031166..a835cb92319a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/mean/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/binomial/mean' ); +const mean = require( '@stdlib/stats/base/dists/binomial/mean' ); ``` #### mean( n, p ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/binomial/mean' ); Returns the [expected value][expected-value] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = mean( 20, 0.1 ); +let v = mean( 20, 0.1 ); // returns 2.0 v = mean( 50, 0.5 ); @@ -72,7 +72,7 @@ v = mean( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 0.5 ); +let v = mean( NaN, 0.5 ); // returns NaN v = mean( 20, NaN ); @@ -82,7 +82,7 @@ v = mean( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = mean( 1.5, 0.5 ); +let v = mean( 1.5, 0.5 ); // returns NaN v = mean( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = mean( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mean( 20, -1.0 ); +let v = mean( 20, -1.0 ); // returns NaN v = mean( 20, 1.5 ); @@ -120,19 +120,14 @@ v = mean( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/binomial/mean' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = mean( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/binomial/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = mean( n, p ); console.log( 'n: %d, p: %d, E(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/median/README.md index f75406b8a83c..5f05ee52b187 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/median/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials, `p` is the success probability, and `[x]` is ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/binomial/median' ); +const median = require( '@stdlib/stats/base/dists/binomial/median' ); ``` #### median( n, p ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/binomial/median' ); Returns the [median][median] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = median( 20, 0.1 ); +let v = median( 20, 0.1 ); // returns 2 v = median( 50, 0.5 ); @@ -72,7 +72,7 @@ v = median( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 0.5 ); +let v = median( NaN, 0.5 ); // returns NaN v = median( 20, NaN ); @@ -82,7 +82,7 @@ v = median( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = median( 1.5, 0.5 ); +let v = median( 1.5, 0.5 ); // returns NaN v = median( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = median( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = median( 20, -1.0 ); +let v = median( 20, -1.0 ); // returns NaN v = median( 20, 1.5 ); @@ -120,19 +120,14 @@ v = median( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/binomial/median' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = median( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/binomial/median' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = median( n, p ); console.log( 'n: %d, p: %d, Median(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/mgf/README.md index 6d7bb3acb1fa..a32848f96c85 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/mgf/README.md @@ -54,7 +54,7 @@ where the nonnegative integer `n` is the number of trials and `0 <= p <= 1` is t ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/binomial/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/binomial/mgf' ); ``` #### mgf( t, n, p ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/binomial/mgf' ); Evaluates the [moment-generating function][mgf] for a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var y = mgf( 0.5, 20, 0.2 ); +let y = mgf( 0.5, 20, 0.2 ); // returns ~11.471 y = mgf( 5.0, 20, 0.2 ); @@ -78,7 +78,7 @@ y = mgf( 0.0, 10, 0.4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 20, 0.5 ); +let y = mgf( NaN, 20, 0.5 ); // returns NaN y = mgf( 0.0, NaN, 0.5 ); @@ -91,7 +91,7 @@ y = mgf( 0.0, 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 1.5, 0.5 ); +let y = mgf( 0.2, 1.5, 0.5 ); // returns NaN y = mgf( 0.2, -2.0, 0.5 ); @@ -101,7 +101,7 @@ y = mgf( 0.2, -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 20, -1.0 ); +let y = mgf( 0.2, 20, -1.0 ); // returns NaN y = mgf( 0.2, 20, 1.5 ); @@ -113,9 +113,9 @@ y = mgf( 0.2, 20, 1.5 ); Returns a function for evaluating the [moment-generating function][mgf] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var myMGF = mgf.factory( 10, 0.5 ); +const myMGF = mgf.factory( 10, 0.5 ); -var y = myMGF( 0.3 ); +const y = myMGF( 0.3 ); // returns ~5.013 ``` @@ -140,21 +140,15 @@ var y = myMGF( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mgf = require( '@stdlib/stats/base/dists/binomial/mgf' ); - -var n; -var p; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = round( randu() * 5.0 ); - n = round( randu() * 10.0 ); - p = randu(); - y = mgf( t, n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mgf = require( '@stdlib/stats/base/dists/binomial/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = round( randu() * 5.0 ); + const n = round( randu() * 10.0 ); + const p = randu(); + const y = mgf( t, n, p ); console.log( 't: %d, n: %d, p: %d, M_X(t;n,p): %d', t, n, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/mode/README.md index e82d7c4f8654..ca276c26496c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/mode/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials, `p` is the success probability, and `⌊x⌋` ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/binomial/mode' ); +const mode = require( '@stdlib/stats/base/dists/binomial/mode' ); ``` #### mode( n, p ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/binomial/mode' ); Returns the [mode][mode] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = mode( 20, 0.1 ); +let v = mode( 20, 0.1 ); // returns 2 v = mode( 50, 0.5 ); @@ -72,7 +72,7 @@ v = mode( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 0.5 ); +let v = mode( NaN, 0.5 ); // returns NaN v = mode( 20, NaN ); @@ -82,7 +82,7 @@ v = mode( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = mode( 1.5, 0.5 ); +let v = mode( 1.5, 0.5 ); // returns NaN v = mode( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = mode( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mode( 20, -1.0 ); +let v = mode( 20, -1.0 ); // returns NaN v = mode( 20, 1.5 ); @@ -120,19 +120,14 @@ v = mode( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/binomial/mode' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = mode( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/binomial/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = mode( n, p ); console.log( 'n: %d, p: %d, mode(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/pmf/README.md index b4725a5d5719..231b6593fd35 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/pmf/README.md @@ -50,7 +50,7 @@ where `n` is the number of trials and `0 <= p <= 1` is the success probability. ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/binomial/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/binomial/pmf' ); ``` #### pmf( x, n, p ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/binomial/pmf' ); Evaluates the [probability mass function][pmf] (PMF) for a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var y = pmf( 3.0, 20, 0.2 ); +let y = pmf( 3.0, 20, 0.2 ); // returns ~0.205 y = pmf( 21.0, 20, 0.2 ); @@ -74,7 +74,7 @@ y = pmf( 0.0, 10, 0.4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 20, 0.5 ); +let y = pmf( NaN, 20, 0.5 ); // returns NaN y = pmf( 0.0, NaN, 0.5 ); @@ -87,7 +87,7 @@ y = pmf( 0.0, 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 1.5, 0.5 ); +let y = pmf( 2.0, 1.5, 0.5 ); // returns NaN y = pmf( 2.0, -2.0, 0.5 ); @@ -97,7 +97,7 @@ y = pmf( 2.0, -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 20, -1.0 ); +let y = pmf( 2.0, 20, -1.0 ); // returns NaN y = pmf( 2.0, 20, 1.5 ); @@ -109,9 +109,9 @@ y = pmf( 2.0, 20, 1.5 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var mypmf = pmf.factory( 10, 0.5 ); +const mypmf = pmf.factory( 10, 0.5 ); -var y = mypmf( 3.0 ); +let y = mypmf( 3.0 ); // returns ~0.117 y = mypmf( 5.0 ); @@ -129,21 +129,15 @@ y = mypmf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/binomial/pmf' ); - -var i; -var n; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 20.0 ); - n = round( randu() * 100.0 ); - p = randu(); - y = pmf( x, n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/binomial/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 20.0 ); + const n = round( randu() * 100.0 ); + const p = randu(); + const y = pmf( x, n, p ); console.log( 'x: %d, n: %d, p: %d, P(X = x;n,p): %d', x, n, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/quantile/README.md index fae5f103c3fa..a9048b18ad87 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/quantile/README.md @@ -50,7 +50,7 @@ holds, where `F` is the cumulative distribution function (CDF) of a binomial ran ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/binomial/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/binomial/quantile' ); ``` #### quantile( r, n, p ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/binomial/quantile' ); Evaluates the [quantile function][quantile-function] for a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p` at value `r`. ```javascript -var y = quantile( 0.4, 20, 0.2 ); +let y = quantile( 0.4, 20, 0.2 ); // returns 3 y = quantile( 0.8, 20, 0.2 ); @@ -77,7 +77,7 @@ y = quantile( 1.0, 10, 0.4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 20, 0.5 ); +let y = quantile( NaN, 20, 0.5 ); // returns NaN y = quantile( 0.2, NaN, 0.5 ); @@ -90,7 +90,7 @@ y = quantile( 0.2, 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = quantile( 0.5, 1.5, 0.5 ); +let y = quantile( 0.5, 1.5, 0.5 ); // returns NaN y = quantile( 0.5, -2.0, 0.5 ); @@ -100,7 +100,7 @@ y = quantile( 0.5, -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 0.5, 20, -1.0 ); +let y = quantile( 0.5, 20, -1.0 ); // returns NaN y = quantile( 0.5, 20, 1.5 ); @@ -112,9 +112,9 @@ y = quantile( 0.5, 20, 1.5 ); Returns a function for evaluating the [quantile function][quantile-function] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var myquantile = quantile.factory( 10, 0.5 ); +const myquantile = quantile.factory( 10, 0.5 ); -var y = myquantile( 0.1 ); +let y = myquantile( 0.1 ); // returns 3 y = myquantile( 0.9 ); @@ -132,21 +132,15 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var quantile = require( '@stdlib/stats/base/dists/binomial/quantile' ); - -var r; -var i; -var n; -var p; -var y; - -for ( i = 0; i < 10; i++ ) { - r = randu(); - n = round( randu() * 100.0 ); - p = randu(); - y = quantile( r, n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const quantile = require( '@stdlib/stats/base/dists/binomial/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu(); + const n = round( randu() * 100.0 ); + const p = randu(); + const y = quantile( r, n, p ); console.log( 'r: %d, n: %d, p: %d, Q(r;n,p): %d', r.toFixed( 4 ), n, p.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/skewness/README.md index e3e0295aad82..78580c5fda8c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/skewness/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/binomial/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/binomial/skewness' ); ``` #### skewness( n, p ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/binomial/skewness' ); Returns the [skewness][skewness] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = skewness( 20, 0.1 ); +let v = skewness( 20, 0.1 ); // returns ~0.596 v = skewness( 50, 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 0.5 ); +let v = skewness( NaN, 0.5 ); // returns NaN v = skewness( 20, NaN ); @@ -82,7 +82,7 @@ v = skewness( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = skewness( 1.5, 0.5 ); +let v = skewness( 1.5, 0.5 ); // returns NaN v = skewness( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = skewness( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = skewness( 20, -1.0 ); +let v = skewness( 20, -1.0 ); // returns NaN v = skewness( 20, 1.5 ); @@ -120,19 +120,14 @@ v = skewness( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/binomial/skewness' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = skewness( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/binomial/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = skewness( n, p ); console.log( 'n: %d, p: %d, skew(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/stdev/README.md index 4c100329b085..00edeeb72993 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/stdev/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/binomial/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/binomial/stdev' ); ``` #### stdev( n, p ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/binomial/stdev' ); Returns the [standard deviation][stdev] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = stdev( 20, 0.1 ); +let v = stdev( 20, 0.1 ); // returns ~1.342 v = stdev( 50, 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 0.5 ); +let v = stdev( NaN, 0.5 ); // returns NaN v = stdev( 20, NaN ); @@ -82,7 +82,7 @@ v = stdev( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = stdev( 1.5, 0.5 ); +let v = stdev( 1.5, 0.5 ); // returns NaN v = stdev( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = stdev( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = stdev( 20, -1.0 ); +let v = stdev( 20, -1.0 ); // returns NaN v = stdev( 20, 1.5 ); @@ -120,19 +120,14 @@ v = stdev( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/binomial/stdev' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = stdev( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/binomial/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = stdev( n, p ); console.log( 'n: %d, p: %d, SD(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/binomial/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/binomial/variance/README.md index 5aefba7068f3..f196e50dcd18 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/binomial/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/binomial/variance/README.md @@ -54,7 +54,7 @@ where `n` is the number of trials and `p` is the success probability. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/binomial/variance' ); +const variance = require( '@stdlib/stats/base/dists/binomial/variance' ); ``` #### variance( n, p ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/binomial/variance' ); Returns the [variance][variance] of a [binomial][binomial-distribution] distribution with number of trials `n` and success probability `p`. ```javascript -var v = variance( 20, 0.1 ); +let v = variance( 20, 0.1 ); // returns 1.8 v = variance( 50, 0.5 ); @@ -72,7 +72,7 @@ v = variance( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 0.5 ); +let v = variance( NaN, 0.5 ); // returns NaN v = variance( 20, NaN ); @@ -82,7 +82,7 @@ v = variance( 20, NaN ); If provided a number of trials `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = variance( 1.5, 0.5 ); +let v = variance( 1.5, 0.5 ); // returns NaN v = variance( -2.0, 0.5 ); @@ -92,7 +92,7 @@ v = variance( -2.0, 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = variance( 20, -1.0 ); +let v = variance( 20, -1.0 ); // returns NaN v = variance( 20, 1.5 ); @@ -120,19 +120,14 @@ v = variance( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/binomial/variance' ); - -var v; -var i; -var n; -var p; - -for ( i = 0; i < 10; i++ ) { - n = round( randu() * 100.0 ); - p = randu(); - v = variance( n, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/binomial/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const n = round( randu() * 100.0 ); + const p = randu(); + const v = variance( n, p ); console.log( 'n: %d, p: %d, Var(X;n,p): %d', n, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/README.md index e84af063b866..9d342882eb18 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cauchy = require( '@stdlib/stats/base/dists/cauchy' ); +const cauchy = require( '@stdlib/stats/base/dists/cauchy' ); ``` #### cauchy @@ -35,7 +35,7 @@ var cauchy = require( '@stdlib/stats/base/dists/cauchy' ); Cauchy distribution. ```javascript -var dist = cauchy; +const dist = cauchy; // returns {...} ``` @@ -82,11 +82,11 @@ The namespace contains a constructor function for creating a [Cauchy][cauchy-dis ```javascript -var Cauchy = require( '@stdlib/stats/base/dists/cauchy' ).Cauchy; +const Cauchy = require( '@stdlib/stats/base/dists/cauchy' ).Cauchy; -var dist = new Cauchy( 2.0, 4.0 ); +const dist = new Cauchy( 2.0, 4.0 ); -var median = dist.median; +const median = dist.median; // returns 2.0 ``` @@ -103,8 +103,8 @@ var median = dist.median; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var cauchy = require( '@stdlib/stats/base/dists/cauchy' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const cauchy = require( '@stdlib/stats/base/dists/cauchy' ); console.log( objectKeys( cauchy ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md index a394e32655e7..3f54f804923c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md @@ -50,7 +50,7 @@ where `x0` is the location parameter and `gamma > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/cauchy/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/cauchy/cdf' ); ``` #### cdf( x, x0, gamma ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/cauchy/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var y = cdf( 4.0, 0.0, 2.0 ); +let y = cdf( 4.0, 0.0, 2.0 ); // returns ~0.852 y = cdf( 1.0, 0.0, 2.0 ); @@ -71,7 +71,7 @@ y = cdf( 1.0, 3.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 2.0 ); +let y = cdf( NaN, 0.0, 2.0 ); // returns NaN y = cdf( 1.0, 2.0, NaN ); @@ -84,7 +84,7 @@ y = cdf( 1.0, NaN, 3.0 ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +let y = cdf( 2.0, 0.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = cdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns 0.5 y = mycdf( 12.0 ); @@ -116,21 +116,15 @@ y = mycdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var cdf = require( '@stdlib/stats/base/dists/cauchy/cdf' ); - -var gamma; -var x0; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - x0 = randu() * 10.0; - gamma = ( randu()*10.0 ) + EPS; - y = cdf( x, x0, gamma ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const cdf = require( '@stdlib/stats/base/dists/cauchy/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const x0 = randu() * 10.0; + const gamma = ( randu()*10.0 ) + EPS; + const y = cdf( x, x0, gamma ); console.log( 'x: %d, x0: %d, γ: %d, F(x;x0,γ): %d', x.toFixed( 4 ), x0.toFixed( 4 ), gamma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/ctor/README.md index 3db13673aed9..f1cbd0f1438a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Cauchy = require( '@stdlib/stats/base/dists/cauchy/ctor' ); +const Cauchy = require( '@stdlib/stats/base/dists/cauchy/ctor' ); ``` #### Cauchy( \[x0, gamma] ) @@ -45,18 +45,18 @@ var Cauchy = require( '@stdlib/stats/base/dists/cauchy/ctor' ); Returns a [Cauchy][cauchy-distribution] distribution object. ```javascript -var cauchy = new Cauchy(); +const cauchy = new Cauchy(); -var median = cauchy.median; +const median = cauchy.median; // returns 0.0 ``` By default, `x0 = 0.0` and `gamma = 1.0`. To create a distribution having a different `x0` (location parameter) and `gamma` (scale parameter), provide the corresponding arguments. ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var median = cauchy.median; +const median = cauchy.median; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [Cauchy][cauchy-distribution] distribution object has the following properties Location parameter of the distribution. ```javascript -var cauchy = new Cauchy(); +const cauchy = new Cauchy(); -var x0 = cauchy.x0; +let x0 = cauchy.x0; // returns 0.0 cauchy.x0 = 3.0; @@ -89,9 +89,9 @@ x0 = cauchy.x0; Scale parameter of the distribution. `gamma` **must** be a positive number. ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var gamma = cauchy.gamma; +let gamma = cauchy.gamma; // returns 4.0 cauchy.gamma = 3.0; @@ -109,9 +109,9 @@ gamma = cauchy.gamma; Returns the [differential entropy][entropy]. ```javascript -var cauchy = new Cauchy( 4.0, 12.0 ); +const cauchy = new Cauchy( 4.0, 12.0 ); -var entropy = cauchy.entropy; +const entropy = cauchy.entropy; // returns ~5.016 ``` @@ -120,9 +120,9 @@ var entropy = cauchy.entropy; Returns the [median][median]. ```javascript -var cauchy = new Cauchy( 4.0, 12.0 ); +const cauchy = new Cauchy( 4.0, 12.0 ); -var median = cauchy.median; +const median = cauchy.median; // returns 4.0 ``` @@ -131,9 +131,9 @@ var median = cauchy.median; Returns the [mode][mode]. ```javascript -var cauchy = new Cauchy( 4.0, 12.0 ); +const cauchy = new Cauchy( 4.0, 12.0 ); -var mode = cauchy.mode; +const mode = cauchy.mode; // returns 4.0 ``` @@ -146,9 +146,9 @@ var mode = cauchy.mode; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var y = cauchy.cdf( 0.5 ); +const y = cauchy.cdf( 0.5 ); // returns ~0.386 ``` @@ -157,9 +157,9 @@ var y = cauchy.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var y = cauchy.logcdf( 0.5 ); +const y = cauchy.logcdf( 0.5 ); // returns ~-0.952 ``` @@ -168,9 +168,9 @@ var y = cauchy.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var y = cauchy.logpdf( 0.8 ); +const y = cauchy.logpdf( 0.8 ); // returns ~-2.617 ``` @@ -179,9 +179,9 @@ var y = cauchy.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var y = cauchy.pdf( 0.8 ); +const y = cauchy.pdf( 0.8 ); // returns ~0.073 ``` @@ -190,9 +190,9 @@ var y = cauchy.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var y = cauchy.quantile( 0.5 ); +let y = cauchy.quantile( 0.5 ); // returns 2.0 y = cauchy.quantile( 1.9 ); @@ -222,20 +222,20 @@ y = cauchy.quantile( 1.9 ); ```javascript -var Cauchy = require( '@stdlib/stats/base/dists/cauchy/ctor' ); +const Cauchy = require( '@stdlib/stats/base/dists/cauchy/ctor' ); -var cauchy = new Cauchy( 2.0, 4.0 ); +const cauchy = new Cauchy( 2.0, 4.0 ); -var entropy = cauchy.entropy; +const entropy = cauchy.entropy; // returns ~3.917 -var median = cauchy.median; +const median = cauchy.median; // returns 2.0 -var mode = cauchy.mode; +const mode = cauchy.mode; // returns 2.0 -var y = cauchy.cdf( 0.8 ); +const y = cauchy.cdf( 0.8 ); // returns ~0.407 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/entropy/README.md index 18a9ad352c92..8db21510834f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/entropy/README.md @@ -52,7 +52,7 @@ h\left( X \right) = \log(\gamma)\,+\,\log(4\,\pi) ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/cauchy/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/cauchy/entropy' ); ``` #### entropy( x0, gamma ) @@ -60,7 +60,7 @@ var entropy = require( '@stdlib/stats/base/dists/cauchy/entropy' ); Returns the [differential entropy][entropy] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma` (in [nats][nats]). ```javascript -var v = entropy( 10.0, 5.0 ); +let v = entropy( 10.0, 5.0 ); // returns ~4.14 v = entropy( 7.0, 2.0 ); @@ -70,7 +70,7 @@ v = entropy( 7.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 5.0 ); +let v = entropy( NaN, 5.0 ); // returns NaN v = entropy( 20.0, NaN ); @@ -80,7 +80,7 @@ v = entropy( 20.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, -1.0 ); +let v = entropy( 1.0, -1.0 ); // returns NaN v = entropy( 1.0, 0.0 ); @@ -108,19 +108,14 @@ v = entropy( 1.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/cauchy/entropy' ); - -var gamma; -var x0; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x0 = randu() * 100.0; - gamma = ( randu()*10.0 ) + EPS; - v = entropy( x0, gamma ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/cauchy/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const x0 = randu() * 100.0; + const gamma = ( randu()*10.0 ) + EPS; + const v = entropy( x0, gamma ); console.log( 'x0: %d, γ: %d, h(X;x0,γ): %d', x0.toFixed( 4 ), gamma.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md index 3f9f131d2406..4ffd4ae816b6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md @@ -50,7 +50,7 @@ where `x0` is the location parameter and `gamma > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/cauchy/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/cauchy/logcdf' ); ``` #### logcdf( x, x0, gamma ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/cauchy/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var y = logcdf( 4.0, 0.0, 2.0 ); +let y = logcdf( 4.0, 0.0, 2.0 ); // returns ~-0.16 y = logcdf( 1.0, 0.0, 2.0 ); @@ -71,7 +71,7 @@ y = logcdf( 1.0, 3.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 2.0 ); +let y = logcdf( NaN, 0.0, 2.0 ); // returns NaN y = logcdf( 1.0, 2.0, NaN ); @@ -84,7 +84,7 @@ y = logcdf( 1.0, NaN, 3.0 ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +let y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN y = logcdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = logcdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.693 y = mylogcdf( 12.0 ); @@ -126,21 +126,15 @@ y = mylogcdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logcdf = require( '@stdlib/stats/base/dists/cauchy/logcdf' ); - -var gamma; -var x0; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - x0 = randu() * 10.0; - gamma = ( randu()*10.0 ) + EPS; - y = logcdf( x, x0, gamma ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logcdf = require( '@stdlib/stats/base/dists/cauchy/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const x0 = randu() * 10.0; + const gamma = ( randu()*10.0 ) + EPS; + const y = logcdf( x, x0, gamma ); console.log( 'x: %d, x0: %d, γ: %d, ln(F(x;x0,γ)): %d', x, x0, gamma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/README.md index d125b82385de..2e7f828bc2cb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/README.md @@ -50,7 +50,7 @@ where `x0` is the location parameter and `gamma > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/cauchy/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/cauchy/logpdf' ); ``` #### logpdf( x, x0, gamma ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/cauchy/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var y = logpdf( 2.0, 1.0, 1.0 ); +let y = logpdf( 2.0, 1.0, 1.0 ); // returns ~-1.838 y = logpdf( 4.0, 3.0, 0.1 ); @@ -71,7 +71,7 @@ y = logpdf( 4.0, 3.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 2.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 2.0, 1.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +const y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN ``` @@ -93,9 +93,9 @@ var y = logpdf( 2.0, 0.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma`. ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-1.838 y = mylogpdf( 5.0 ); @@ -123,21 +123,15 @@ y = mylogpdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logpdf = require( '@stdlib/stats/base/dists/cauchy/logpdf' ); - -var gamma; -var x0; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - x0 = ( randu()*10.0 ) - 5.0; - gamma = ( randu()*20.0 ) + EPS; - y = logpdf( x, gamma, x0 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logpdf = require( '@stdlib/stats/base/dists/cauchy/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const x0 = ( randu()*10.0 ) - 5.0; + const gamma = ( randu()*20.0 ) + EPS; + const y = logpdf( x, gamma, x0 ); console.log( 'x: %d, x0: %d, γ: %d, ln(f(x;x0,γ)): %d', x.toFixed(4), x0.toFixed(4), gamma.toFixed(4), y.toFixed(4) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/README.md index 4ac1af07e9ee..b4d09c831760 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [Cauchy][cauchy-distribution] random variable with lo ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/cauchy/median' ); +const median = require( '@stdlib/stats/base/dists/cauchy/median' ); ``` #### median( x0, gamma ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/cauchy/median' ); Returns the [median][median] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma`. ```javascript -var v = median( 10.0, 5.0 ); +let v = median( 10.0, 5.0 ); // returns 10.0 v = median( 7.0, 2.0 ); @@ -70,7 +70,7 @@ v = median( 7.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 5.0 ); +let v = median( NaN, 5.0 ); // returns NaN v = median( 20.0, NaN ); @@ -80,7 +80,7 @@ v = median( 20.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var v = median( 1.0, -1.0 ); +let v = median( 1.0, -1.0 ); // returns NaN v = median( 1.0, 0.0 ); @@ -108,19 +108,14 @@ v = median( 1.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var median = require( '@stdlib/stats/base/dists/cauchy/median' ); - -var gamma; -var x0; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x0 = randu() * 100.0; - gamma = ( randu()*10.0 ) + EPS; - v = median( x0, gamma ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const median = require( '@stdlib/stats/base/dists/cauchy/median' ); + +for ( let i = 0; i < 10; i++ ) { + const x0 = randu() * 100.0; + const gamma = ( randu()*10.0 ) + EPS; + const v = median( x0, gamma ); console.log( 'x0: %d, γ: %d, Median(X;x0,γ): %d', x0.toFixed( 4 ), gamma.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/README.md index ff53f798d003..3bb92bd2f389 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Cauchy][cauchy-distribution] random variable with locati ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/cauchy/mode' ); +const mode = require( '@stdlib/stats/base/dists/cauchy/mode' ); ``` #### mode( x0, gamma ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/cauchy/mode' ); Returns the [mode][mode] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma`. ```javascript -var v = mode( 10.0, 5.0 ); +let v = mode( 10.0, 5.0 ); // returns 10.0 v = mode( 7.0, 2.0 ); @@ -70,7 +70,7 @@ v = mode( 7.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 5.0 ); +let v = mode( NaN, 5.0 ); // returns NaN v = mode( 20.0, NaN ); @@ -80,7 +80,7 @@ v = mode( 20.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, -1.0 ); +let v = mode( 1.0, -1.0 ); // returns NaN v = mode( 1.0, 0.0 ); @@ -108,19 +108,14 @@ v = mode( 1.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/cauchy/mode' ); - -var gamma; -var x0; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x0 = randu() * 100.0; - gamma = ( randu()*10.0 ) + EPS; - v = mode( x0, gamma ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/cauchy/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const x0 = randu() * 100.0; + const gamma = ( randu()*10.0 ) + EPS; + const v = mode( x0, gamma ); console.log( 'x0: %d, γ: %d, mode(X;x0,γ): %d', x0.toFixed( 4 ), gamma.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md index 6496cdbc5696..6d88590d8f73 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md @@ -50,7 +50,7 @@ where `x0` is the location parameter and `gamma > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/cauchy/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/cauchy/pdf' ); ``` #### pdf( x, x0, gamma ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/cauchy/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var y = pdf( 2.0, 1.0, 1.0 ); +let y = pdf( 2.0, 1.0, 1.0 ); // returns ~0.159 y = pdf( 4.0, 3.0, 0.1 ); @@ -71,7 +71,7 @@ y = pdf( 4.0, 3.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 2.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 2.0, 1.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +let y = pdf( 2.0, 0.0, -1.0 ); // returns NaN y = pdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = pdf( 2.0, 0.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma`. ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns ~0.159 y = mypdf( 5.0 ); @@ -116,21 +116,15 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var pdf = require( '@stdlib/stats/base/dists/cauchy/pdf' ); - -var gamma; -var x0; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - x0 = ( randu()*10.0 ) - 5.0; - gamma = ( randu()*20.0 ) + EPS; - y = pdf( x, gamma, x0 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const pdf = require( '@stdlib/stats/base/dists/cauchy/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const x0 = ( randu()*10.0 ) - 5.0; + const gamma = ( randu()*20.0 ) + EPS; + const y = pdf( x, gamma, x0 ); console.log( 'x: %d, x0: %d, γ: %d, f(x;x0,γ): %d', x.toFixed(4), x0.toFixed(4), gamma.toFixed(4), y.toFixed(4) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/README.md index 44de22c8b69a..8a2758c1fbbe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `x0` is the location parameter and `gamma > 0` is the s ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/cauchy/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/cauchy/quantile' ); ``` #### quantile( p, x0, gamma ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/cauchy/quantile' ); Evaluates the [quantile function][quantile-function] for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns 0.0 y = quantile( 0.2, 4.0, 2.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.9, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `gamma <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +let y = quantile( 0.4, 0.0, -1.0 ); // returns NaN y = quantile( 0.4, 0.0, 0.0 ); @@ -106,9 +106,9 @@ y = quantile( 0.4, 0.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma > 0`. ```javascript -var myquantile = quantile.factory( 10.0, 2.0 ); +const myquantile = quantile.factory( 10.0, 2.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~7.247 y = myquantile( 0.8 ); @@ -126,21 +126,15 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var quantile = require( '@stdlib/stats/base/dists/cauchy/quantile' ); - -var gamma; -var x0; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - x0 = ( randu()*10.0 ) - 5.0; - gamma = ( randu()*20.0 ) + EPS; - y = quantile( p, gamma, x0 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const quantile = require( '@stdlib/stats/base/dists/cauchy/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const x0 = ( randu()*10.0 ) - 5.0; + const gamma = ( randu()*20.0 ) + EPS; + const y = quantile( p, gamma, x0 ); console.log( 'p: %d, x0: %d, γ: %d, Q(p;x0,γ): %d', p.toFixed(4), x0.toFixed(4), gamma.toFixed(4), y.toFixed(4) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/README.md index 7a194f7eaed6..971b1ae74ea3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi = require( '@stdlib/stats/base/dists/chi' ); +const chi = require( '@stdlib/stats/base/dists/chi' ); ``` #### chi @@ -35,7 +35,7 @@ var chi = require( '@stdlib/stats/base/dists/chi' ); Chi distribution. ```javascript -var dist = chi; +const dist = chi; // returns {...} ``` @@ -85,11 +85,11 @@ The namespace contains a constructor function for creating a [Chi][chi-distribut ```javascript -var Chi = require( '@stdlib/stats/base/dists/chi' ).Chi; +const Chi = require( '@stdlib/stats/base/dists/chi' ).Chi; -var dist = new Chi( 4.0 ); +const dist = new Chi( 4.0 ); -var mu = dist.mean; +const mu = dist.mean; // returns ~1.88 ``` @@ -104,30 +104,30 @@ var mu = dist.mean; ```javascript -var chiRandomFactory = require( '@stdlib/random/base/chi' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var variance = require( '@stdlib/stats/base/variance' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); -var absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); -var mean = require( '@stdlib/stats/base/mean' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var max = require( '@stdlib/math/base/special/max' ); -var chi = require( '@stdlib/stats/base/dists/chi' ); +const chiRandomFactory = require( '@stdlib/random/base/chi' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const variance = require( '@stdlib/stats/base/variance' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); +const absdiff = require( '@stdlib/math/base/utils/absolute-difference' ); +const mean = require( '@stdlib/stats/base/mean' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const max = require( '@stdlib/math/base/special/max' ); +const chi = require( '@stdlib/stats/base/dists/chi' ); // Define the degrees of freedom parameter: -var k = 2; +const k = 2; // Generate an array of x values: -var x = linspace( 0, 10, 100 ); +const x = linspace( 0, 10, 100 ); // Compute the PDF for each x: -var chiPDF = chi.pdf.factory( k ); -var pdf = filledarrayBy( x.length, 'float64', chiPDF ); +const chiPDF = chi.pdf.factory( k ); +const pdf = filledarrayBy( x.length, 'float64', chiPDF ); // Compute the CDF for each x: -var chiCDF = chi.cdf.factory( k ); -var cdf = filledarrayBy( x.length, 'float64', chiCDF ); +const chiCDF = chi.cdf.factory( k ); +const cdf = filledarrayBy( x.length, 'float64', chiCDF ); // Output the PDF and CDF values: console.log( 'x values: ', x ); @@ -135,10 +135,10 @@ console.log( 'PDF values: ', pdf ); console.log( 'CDF values: ', cdf ); // Compute statistical properties: -var theoreticalMean = chi.mean( k ); -var theoreticalVariance = chi.variance( k ); -var theoreticalSkewness = chi.skewness( k ); -var theoreticalKurtosis = chi.kurtosis( k ); +const theoreticalMean = chi.mean( k ); +const theoreticalVariance = chi.variance( k ); +const theoreticalSkewness = chi.skewness( k ); +const theoreticalKurtosis = chi.kurtosis( k ); console.log( 'Theoretical Mean: ', theoreticalMean ); console.log( 'Theoretical Variance: ', theoreticalVariance ); @@ -146,13 +146,13 @@ console.log( 'Skewness: ', theoreticalSkewness ); console.log( 'Kurtosis: ', theoreticalKurtosis ); // Generate random samples from the Chi distribution: -var rchi = chiRandomFactory( k ); -var n = 1000; -var samples = filledarrayBy( n, 'float64', rchi ); +const rchi = chiRandomFactory( k ); +const n = 1000; +const samples = filledarrayBy( n, 'float64', rchi ); // Compute sample mean and variance: -var sampleMean = mean( n, samples, 1 ); -var sampleVariance = variance( n, 1, samples, 1 ); +const sampleMean = mean( n, samples, 1 ); +const sampleVariance = variance( n, 1, samples, 1 ); console.log( 'Sample Mean: ', sampleMean ); console.log( 'Sample Variance: ', sampleVariance ); @@ -162,24 +162,21 @@ console.log( 'Difference in Mean: ', abs( theoreticalMean - sampleMean ) ); console.log( 'Difference in Variance: ', abs( theoreticalVariance - sampleVariance ) ); // Demonstrate the relationship with the Rayleigh distribution when k=2: -var rayleighPDF = rayleigh.pdf.factory( 1.0 ); -var rayleighCDF = rayleigh.cdf.factory( 1.0 ); +const rayleighPDF = rayleigh.pdf.factory( 1.0 ); +const rayleighCDF = rayleigh.cdf.factory( 1.0 ); // Compute Rayleigh PDF and CDF for each x: -var rayleighPDFValues = filledarrayBy( x.length, 'float64', rayleighPDF ); +const rayleighPDFValues = filledarrayBy( x.length, 'float64', rayleighPDF ); -var rayleighCDFValues = filledarrayBy( x.length, 'float64', rayleighCDF ); +const rayleighCDFValues = filledarrayBy( x.length, 'float64', rayleighCDF ); // Compare Chi and Rayleigh PDFs and CDFs: -var maxDiffPDF = 0.0; -var maxDiffCDF = 0.0; -var diffPDF; -var diffCDF; -var i; -for ( i = 0; i < x.length; i++ ) { - diffPDF = absdiff( pdf[ i ], rayleighPDFValues[ i ] ); +let maxDiffPDF = 0.0; +let maxDiffCDF = 0.0; +for ( let i = 0; i < x.length; i++ ) { + const diffPDF = absdiff( pdf[ i ], rayleighPDFValues[ i ] ); maxDiffPDF = max( maxDiffPDF, diffPDF ); - diffCDF = absdiff( cdf[ i ], rayleighCDFValues[ i ] ); + const diffCDF = absdiff( cdf[ i ], rayleighCDFValues[ i ] ); maxDiffCDF = max( maxDiffCDF, diffCDF ); } console.log( 'Maximum difference between Chi(k=2) PDF and Rayleigh PDF: ', maxDiffPDF ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/cdf/README.md index 69fd8267ff03..5a471b26d22b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/cdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `P` is the lower regularized incomplete ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/chi/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/chi/cdf' ); ``` #### cdf( x, k ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/chi/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var y = cdf( 2.0, 1.0 ); +let y = cdf( 2.0, 1.0 ); // returns ~0.954 y = cdf( 2.0, 3.0 ); @@ -80,7 +80,7 @@ y = cdf( +Infinity, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0 ); +let y = cdf( NaN, 1.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -90,14 +90,14 @@ y = cdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -2.0 ); +const y = cdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( 2.0, 0.0 ); +let y = cdf( 2.0, 0.0 ); // returns 1.0 y = cdf( -2.0, 0.0 ); @@ -112,9 +112,9 @@ y = cdf( 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var mycdf = cdf.factory( 3.0 ); +const mycdf = cdf.factory( 3.0 ); -var y = mycdf( 6.0 ); +let y = mycdf( 6.0 ); // returns ~1.0 y = mycdf( 1.5 ); @@ -132,19 +132,14 @@ y = mycdf( 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/chi/cdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = round( randu()*5.0 ); - y = cdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/chi/cdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = round( randu()*5.0 ); + const y = cdf( x, k ); console.log( 'x: %d, k: %d, F(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/ctor/README.md index 0ac4ea5b3ad5..c5c4e72921ab 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Chi = require( '@stdlib/stats/base/dists/chi/ctor' ); +const Chi = require( '@stdlib/stats/base/dists/chi/ctor' ); ``` #### Chi( \[k] ) @@ -45,18 +45,18 @@ var Chi = require( '@stdlib/stats/base/dists/chi/ctor' ); Returns an [chi][chi-distribution] distribution object. ```javascript -var chi = new Chi(); +const chi = new Chi(); -var mu = chi.mean; +const mu = chi.mean; // returns ~0.798 ``` By default, `k = 1.0`. To create a distribution having a different degrees of freedom `k`, provide a parameter value. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var mu = chi.mean; +const mu = chi.mean; // returns ~1.88 ``` @@ -73,9 +73,9 @@ A [chi][chi-distribution] distribution object has the following properties and m Degrees of freedom of the distribution. `k` **must** be a positive number. ```javascript -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var k = chi.k; +let k = chi.k; // returns 2.0 chi.k = 3.0; @@ -93,9 +93,9 @@ k = chi.k; Returns the [differential entropy][entropy]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var entropy = chi.entropy; +const entropy = chi.entropy; // returns ~1.019 ``` @@ -104,9 +104,9 @@ var entropy = chi.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var kurtosis = chi.kurtosis; +const kurtosis = chi.kurtosis; // returns ~0.059 ``` @@ -115,9 +115,9 @@ var kurtosis = chi.kurtosis; Returns the [expected value][expected-value]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var mu = chi.mean; +const mu = chi.mean; // returns ~1.88 ``` @@ -126,9 +126,9 @@ var mu = chi.mean; Returns the [mode][mode]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var mode = chi.mode; +const mode = chi.mode; // returns ~1.732 ``` @@ -137,9 +137,9 @@ var mode = chi.mode; Returns the [skewness][skewness]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var skewness = chi.skewness; +const skewness = chi.skewness; // returns ~0.406 ``` @@ -148,9 +148,9 @@ var skewness = chi.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var s = chi.stdev; +const s = chi.stdev; // returns ~0.682 ``` @@ -159,9 +159,9 @@ var s = chi.stdev; Returns the [variance][variance]. ```javascript -var chi = new Chi( 4.0 ); +const chi = new Chi( 4.0 ); -var s2 = chi.variance; +const s2 = chi.variance; // returns ~0.466 ``` @@ -174,9 +174,9 @@ var s2 = chi.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var y = chi.cdf( 0.5 ); +const y = chi.cdf( 0.5 ); // returns ~0.118 ``` @@ -185,9 +185,9 @@ var y = chi.cdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var y = chi.logpdf( 0.8 ); +const y = chi.logpdf( 0.8 ); // returns ~-0.543 ``` @@ -196,9 +196,9 @@ var y = chi.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var y = chi.pdf( 0.8 ); +const y = chi.pdf( 0.8 ); // returns ~0.581 ``` @@ -207,9 +207,9 @@ var y = chi.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var y = chi.quantile( 0.5 ); +let y = chi.quantile( 0.5 ); // returns ~1.177 y = chi.quantile( 1.9 ); @@ -239,20 +239,20 @@ y = chi.quantile( 1.9 ); ```javascript -var Chi = require( '@stdlib/stats/base/dists/chi/ctor' ); +const Chi = require( '@stdlib/stats/base/dists/chi/ctor' ); -var chi = new Chi( 2.0 ); +const chi = new Chi( 2.0 ); -var mu = chi.mean; +const mu = chi.mean; // returns ~1.253 -var mode = chi.mode; +const mode = chi.mode; // returns 1.0 -var s2 = chi.variance; +const s2 = chi.variance; // returns ~0.429 -var y = chi.cdf( 0.8 ); +const y = chi.cdf( 0.8 ); // returns ~0.274 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/entropy/README.md index c78f293a8618..09cd9ab59780 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/entropy/README.md @@ -54,7 +54,7 @@ where `k > 0` is the degrees of freedom and `Γ` and `Ψ` denote the [gamma][gam ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/chi/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/chi/entropy' ); ``` #### entropy( k ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/chi/entropy' ); Returns the [differential entropy][entropy] of a [chi][chi-distribution] distribution with degrees of freedom `k` (in [nats][nats]). ```javascript -var v = entropy( 9.0 ); +let v = entropy( 9.0 ); // returns ~1.052 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = entropy( -1.0 ); +const v = entropy( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/chi/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/chi/entropy' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = entropy( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = entropy( k ); console.log( 'k: %d, h(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/README.md index d20225afa405..f32dd3910fb8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/README.md @@ -54,7 +54,7 @@ where `μ` is the mean of the distribution, `σ` its standard deviation, and `γ ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/chi/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/chi/kurtosis' ); ``` #### kurtosis( k ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/chi/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = kurtosis( 9.0 ); +let v = kurtosis( 9.0 ); // returns ~0.011 v = kurtosis( 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( -1.0 ); +const v = kurtosis( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/chi/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/chi/kurtosis' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = kurtosis( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = kurtosis( k ); console.log( 'k: %d, Kurt(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md index 589f12925a80..e7b1659ac49f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `Γ` denotes the [gamma][gamma-function] ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/chi/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/chi/logpdf' ); ``` #### logpdf( x, k ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/chi/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var y = logpdf( 0.1, 1.0 ); +let y = logpdf( 0.1, 1.0 ); // returns ~-0.231 y = logpdf( 0.5, 2.0 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0 ); +let y = logpdf( NaN, 1.0 ); // returns NaN y = logpdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -2.0 ); +const y = logpdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the natural logarithm of the [PDF][pdf] for a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logpdf( 2.0, 0.0 ); +let y = logpdf( 2.0, 0.0 ); // returns -Infinity y = logpdf( 0.0, 0.0 ); @@ -100,9 +100,9 @@ y = logpdf( 0.0, 0.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var mylogPDF = logpdf.factory( 6.0 ); +const mylogPDF = logpdf.factory( 6.0 ); -var y = mylogPDF( 3.0 ); +let y = mylogPDF( 3.0 ); // returns ~-1.086 y = mylogPDF( 1.0 ); @@ -120,18 +120,13 @@ y = mylogPDF( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/chi/logpdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = randu() * 10.0; - y = logpdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/chi/logpdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = randu() * 10.0; + const y = logpdf( x, k ); console.log( 'x: %d, k: %d, ln(f(x;k)): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/mean/README.md index 47ad34179296..848e2f9d249d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/mean/README.md @@ -54,7 +54,7 @@ where `k` is the degrees of freedom. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/chi/mean' ); +const mean = require( '@stdlib/stats/base/dists/chi/mean' ); ``` #### mean( k ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/chi/mean' ); Returns the [expected value][expected-value] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = mean( 9.0 ); +let v = mean( 9.0 ); // returns ~2.918 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = mean( -1.0 ); +const v = mean( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/chi/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/chi/mean' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = mean( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = mean( k ); console.log( 'k: %d, E(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/mode/README.md index 2ef7bf3bffdb..dba7edb8ea50 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/mode/README.md @@ -54,7 +54,7 @@ for degrees of freedom `k >= 1`. For other values of `k`, the mode is not define ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/chi/mode' ); +const mode = require( '@stdlib/stats/base/dists/chi/mode' ); ``` #### mode( k ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/chi/mode' ); Returns the [mode][mode] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = mode( 9.0 ); +let v = mode( 9.0 ); // returns ~2.828 v = mode( 1.5 ); @@ -72,7 +72,7 @@ v = mode( 1.5 ); If provided `k < 1`, the function returns `NaN`. ```javascript -var v = mode( -1.0 ); +let v = mode( -1.0 ); // returns NaN v = mode( 0.9 ); @@ -100,17 +100,13 @@ v = mode( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/chi/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/chi/mode' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = mode( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = mode( k ); console.log( 'k: %d, mode(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/pdf/README.md index 002a94a54bfb..1a97fd49499a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/pdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `Γ` denotes the [gamma][gamma-function] ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/chi/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/chi/pdf' ); ``` #### pdf( x, k ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/chi/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var y = pdf( 0.1, 1.0 ); +let y = pdf( 0.1, 1.0 ); // returns ~0.794 y = pdf( 0.5, 2.0 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0 ); +let y = pdf( NaN, 1.0 ); // returns NaN y = pdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = pdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -2.0 ); +const y = pdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = pdf( 2.0, 0.0 ); +let y = pdf( 2.0, 0.0 ); // returns 0.0 y = pdf( 0.0, 0.0 ); @@ -100,9 +100,9 @@ y = pdf( 0.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var myPDF = pdf.factory( 6.0 ); +const myPDF = pdf.factory( 6.0 ); -var y = myPDF( 3.0 ); +let y = myPDF( 3.0 ); // returns ~0.337 y = myPDF( 1.0 ); @@ -120,18 +120,13 @@ y = myPDF( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/chi/pdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = randu() * 10.0; - y = pdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/chi/pdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = randu() * 10.0; + const y = pdf( x, k ); console.log( 'x: %d, k: %d, f(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/quantile/README.md index 199f1f907c90..932b0baf8f6b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `k` is the degrees of freedom and `P^{-1}` is the invers ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/chi/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/chi/quantile' ); ``` #### quantile( p, k ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/chi/quantile' ); Evaluates the [quantile function][quantile-function] for a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var y = quantile( 0.8, 1.0 ); +let y = quantile( 0.8, 1.0 ); // returns ~1.282 y = quantile( 0.5, 4.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.8, 0.1 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0 ); +let y = quantile( 1.9, 1.0 ); // returns NaN y = quantile( -0.1, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.2, NaN ); @@ -91,14 +91,14 @@ y = quantile( 0.2, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +const y = quantile( 0.4, -1.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = quantile( 0.3, 0.0 ); +let y = quantile( 0.3, 0.0 ); // returns 0.0 y = quantile( 0.9, 0.0 ); @@ -110,9 +110,9 @@ y = quantile( 0.9, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var myquantile = quantile.factory( 0.4 ); +const myquantile = quantile.factory( 0.4 ); -var y = myquantile( 0.9 ); +let y = myquantile( 0.9 ); // returns ~1.1 y = myquantile( 1.0 ); @@ -130,18 +130,13 @@ y = myquantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/chi/quantile' ); - -var k; -var p; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - p = randu(); - k = randu() * 10.0; - y = quantile( p, k ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/chi/quantile' ); + +for ( let i = 0; i < 20; i++ ) { + const p = randu(); + const k = randu() * 10.0; + const y = quantile( p, k ); console.log( 'p: %d, k: %d, Q(p;k): %d', p.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/skewness/README.md index 807ded90093f..66ca573f3e22 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/skewness/README.md @@ -54,7 +54,7 @@ where `μ` is the mean of the distribution and `σ` its standard deviation. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/chi/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/chi/skewness' ); ``` #### skewness( k ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/chi/skewness' ); Returns the [skewness][skewness] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = skewness( 9.0 ); +let v = skewness( 9.0 ); // returns ~0.252 v = skewness( 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = skewness( -1.0 ); +const v = skewness( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/chi/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/chi/skewness' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = skewness( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = skewness( k ); console.log( 'k: %d, skew(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/stdev/README.md index 289ace4c55f8..c1386059056e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/stdev/README.md @@ -54,7 +54,7 @@ where `k >= 0` is the degrees of freedom. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/chi/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/chi/stdev' ); ``` #### stdev( k ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/chi/stdev' ); Returns the [standard deviation][stdev] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = stdev( 9.0 ); +let v = stdev( 9.0 ); // returns ~0.697 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = stdev( -1.0 ); +const v = stdev( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/chi/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/chi/stdev' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = stdev( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = stdev( k ); console.log( 'k: %d, SD(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/variance/README.md index 52891431b888..100a252d7dc2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/variance/README.md @@ -54,7 +54,7 @@ where `k >= 0` is the degrees of freedom. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/chi/variance' ); +const variance = require( '@stdlib/stats/base/dists/chi/variance' ); ``` #### variance( k ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/chi/variance' ); Returns the [variance][variance] of a [chi][chi-distribution] distribution with degrees of freedom `k`. ```javascript -var v = variance( 9.0 ); +let v = variance( 9.0 ); // returns ~0.485 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = variance( -1.0 ); +const v = variance( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/chi/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/chi/variance' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = variance( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = variance( k ); console.log( 'k: %d, Var(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/README.md index 7d4d99dadb69..9f92b55fe85c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chisquare = require( '@stdlib/stats/base/dists/chisquare' ); +const chisquare = require( '@stdlib/stats/base/dists/chisquare' ); ``` #### chisquare @@ -35,7 +35,7 @@ var chisquare = require( '@stdlib/stats/base/dists/chisquare' ); Chi-squared distribution. ```javascript -var dist = chisquare; +const dist = chisquare; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [Chi-squared][chisq ```javascript -var ChiSquare = require( '@stdlib/stats/base/dists/chisquare' ).ChiSquare; +const ChiSquare = require( '@stdlib/stats/base/dists/chisquare' ).ChiSquare; -var dist = new ChiSquare( 4.0 ); +const dist = new ChiSquare( 4.0 ); -var mu = dist.mean; +const mu = dist.mean; // returns 4.0 ``` @@ -108,11 +108,11 @@ var mu = dist.mean; ```javascript -var roundn = require( '@stdlib/math/base/special/roundn' ); -var chisquare = require( '@stdlib/stats/base/dists/chisquare' ); +const roundn = require( '@stdlib/math/base/special/roundn' ); +const chisquare = require( '@stdlib/stats/base/dists/chisquare' ); // Define degrees of freedom: -var k = 5.0; +const k = 5.0; // Calculate distribution properties: console.log( 'Mean: %d', chisquare.mean( k ) ); @@ -125,18 +125,18 @@ console.log( 'Excess Kurtosis: %d', roundn( chisquare.kurtosis( k ), -4 ) ); console.log( 'Entropy: %d', roundn( chisquare.entropy( k ), -4 ) ); // Evaluate probability functions: -var x = 3.0; +const x = 3.0; console.log( '\nEvaluating at x = %d', x ); console.log( 'PDF: %d', roundn( chisquare.pdf( x, k ), -4 ) ); console.log( 'logPDF: %d', roundn( chisquare.logpdf( x, k ), -4 ) ); console.log( 'CDF: %d', roundn( chisquare.cdf( x, k ), -4 ) ); // Calculate quantiles: -var p = 0.7; +const p = 0.7; console.log( '\nQuantile at p = %d: %d', p, roundn( chisquare.quantile( p, k ), -4 ) ); // Evaluate moment-generating function: -var t = 0.1; +const t = 0.1; console.log( 'MGF at t = %d: %d', t, roundn( chisquare.mgf( t, k ), -4 ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/cdf/README.md index 1421631e38e6..c8cec0bd702a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/cdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `P` is the lower regularized incomplete ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' ); ``` #### cdf( x, k ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var y = cdf( 2.0, 1.0 ); +let y = cdf( 2.0, 1.0 ); // returns ~0.843 y = cdf( 2.0, 3.0 ); @@ -80,7 +80,7 @@ y = cdf( +Infinity, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0 ); +let y = cdf( NaN, 1.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -90,14 +90,14 @@ y = cdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -2.0 ); +const y = cdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( 2.0, 0.0 ); +let y = cdf( 2.0, 0.0 ); // returns 1.0 y = cdf( -2.0, 0.0 ); @@ -112,9 +112,9 @@ y = cdf( 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var mycdf = cdf.factory( 3.0 ); +const mycdf = cdf.factory( 3.0 ); -var y = mycdf( 6.0 ); +let y = mycdf( 6.0 ); // returns ~0.888 y = mycdf( 1.5 ); @@ -132,19 +132,14 @@ y = mycdf( 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = round( randu()*5.0 ); - y = cdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/chisquare/cdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = round( randu()*5.0 ); + const y = cdf( x, k ); console.log( 'x: %d, k: %d, F(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/ctor/README.md index c9244b3157e8..7ff321ea6a9c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ChiSquare = require( '@stdlib/stats/base/dists/chisquare/ctor' ); +const ChiSquare = require( '@stdlib/stats/base/dists/chisquare/ctor' ); ``` #### ChiSquare( \[k] ) @@ -45,18 +45,18 @@ var ChiSquare = require( '@stdlib/stats/base/dists/chisquare/ctor' ); Returns an [chi-squared][chisquare-distribution] distribution object. ```javascript -var chisquare = new ChiSquare(); +const chisquare = new ChiSquare(); -var mu = chisquare.mean; +const mu = chisquare.mean; // returns 1.0 ``` By default, `k = 1.0`. To create a distribution having a different degrees of freedom `k`, provide a parameter value. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var mu = chisquare.mean; +const mu = chisquare.mean; // returns 4.0 ``` @@ -73,9 +73,9 @@ A [chi-squared][chisquare-distribution] distribution object has the following pr Rate parameter of the distribution. `k` **must** be a positive number. ```javascript -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var k = chisquare.k; +let k = chisquare.k; // returns 2.0 chisquare.k = 3.0; @@ -93,9 +93,9 @@ k = chisquare.k; Returns the [differential entropy][entropy]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var entropy = chisquare.entropy; +const entropy = chisquare.entropy; // returns ~2.27 ``` @@ -104,9 +104,9 @@ var entropy = chisquare.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var kurtosis = chisquare.kurtosis; +const kurtosis = chisquare.kurtosis; // returns 3.0 ``` @@ -115,9 +115,9 @@ var kurtosis = chisquare.kurtosis; Returns the [expected value][expected-value]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var mu = chisquare.mean; +const mu = chisquare.mean; // returns 4.0 ``` @@ -126,9 +126,9 @@ var mu = chisquare.mean; Returns the [median][median]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var median = chisquare.median; +const median = chisquare.median; // returns ~3.357 ``` @@ -137,9 +137,9 @@ var median = chisquare.median; Returns the [mode][mode]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var mode = chisquare.mode; +const mode = chisquare.mode; // returns 2.0 ``` @@ -148,9 +148,9 @@ var mode = chisquare.mode; Returns the [skewness][skewness]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var skewness = chisquare.skewness; +const skewness = chisquare.skewness; // returns ~1.414 ``` @@ -159,9 +159,9 @@ var skewness = chisquare.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var s = chisquare.stdev; +const s = chisquare.stdev; // returns ~2.828 ``` @@ -170,9 +170,9 @@ var s = chisquare.stdev; Returns the [variance][variance]. ```javascript -var chisquare = new ChiSquare( 4.0 ); +const chisquare = new ChiSquare( 4.0 ); -var s2 = chisquare.variance; +const s2 = chisquare.variance; // returns 8.0 ``` @@ -185,9 +185,9 @@ var s2 = chisquare.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var y = chisquare.cdf( 0.5 ); +const y = chisquare.cdf( 0.5 ); // returns ~0.221 ``` @@ -196,9 +196,9 @@ var y = chisquare.cdf( 0.5 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var y = chisquare.mgf( 0.2 ); +const y = chisquare.mgf( 0.2 ); // returns ~1.667 ``` @@ -207,9 +207,9 @@ var y = chisquare.mgf( 0.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var y = chisquare.pdf( 0.8 ); +const y = chisquare.pdf( 0.8 ); // returns ~0.335 ``` @@ -218,9 +218,9 @@ var y = chisquare.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var y = chisquare.quantile( 0.5 ); +let y = chisquare.quantile( 0.5 ); // returns ~1.386 y = chisquare.quantile( 1.9 ); @@ -250,20 +250,20 @@ y = chisquare.quantile( 1.9 ); ```javascript -var ChiSquare = require( '@stdlib/stats/base/dists/chisquare/ctor' ); +const ChiSquare = require( '@stdlib/stats/base/dists/chisquare/ctor' ); -var chisquare = new ChiSquare( 2.0 ); +const chisquare = new ChiSquare( 2.0 ); -var mu = chisquare.mean; +const mu = chisquare.mean; // returns 2.0 -var mode = chisquare.mode; +const mode = chisquare.mode; // returns 0.0 -var s2 = chisquare.variance; +const s2 = chisquare.variance; // returns 4.0 -var y = chisquare.cdf( 0.8 ); +const y = chisquare.cdf( 0.8 ); // returns ~0.33 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/entropy/README.md index 2ade1c2c62d8..3918df214e64 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/entropy/README.md @@ -54,7 +54,7 @@ where `k > 0` is the degrees of freedom. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/chisquare/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/chisquare/entropy' ); ``` #### entropy( k ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/chisquare/entropy' ); Returns the [differential entropy][entropy] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k` (in [nats][nats]). ```javascript -var v = entropy( 9.0 ); +let v = entropy( 9.0 ); // returns ~2.786 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = entropy( -1.0 ); +const v = entropy( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/chisquare/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/chisquare/entropy' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = entropy( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = entropy( k ); console.log( 'k: %d, entropy(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/README.md index 5e5812babc96..d99b6c7a0dc9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/README.md @@ -54,7 +54,7 @@ where `k > 0` is the degrees of freedom. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/chisquare/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/chisquare/kurtosis' ); ``` #### kurtosis( k ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/chisquare/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = kurtosis( 9.0 ); +let v = kurtosis( 9.0 ); // returns ~1.333 v = kurtosis( 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( -1.0 ); +const v = kurtosis( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/chisquare/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/chisquare/kurtosis' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = kurtosis( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = kurtosis( k ); console.log( 'k: %d, Kurt(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/logpdf/README.md index 4f7b156dd857..0fb4b59ed494 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/logpdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `Γ` denotes the [gamma function][gamma- ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/chisquare/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/chisquare/logpdf' ); ``` #### logpdf( x, k ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/chisquare/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var y = logpdf( 0.1, 1.0 ); +let y = logpdf( 0.1, 1.0 ); // returns ~0.182 y = logpdf( 0.5, 2.0 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0 ); +let y = logpdf( NaN, 1.0 ); // returns NaN y = logpdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -2.0 ); +const y = logpdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logpdf( 2.0, 0.0 ); +let y = logpdf( 2.0, 0.0 ); // returns -Infinity y = logpdf( 0.0, 0.0 ); @@ -100,9 +100,9 @@ y = logpdf( 0.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var myLogPDF = logpdf.factory( 6.0 ); +const myLogPDF = logpdf.factory( 6.0 ); -var y = myLogPDF( 3.0 ); +let y = myLogPDF( 3.0 ); // returns ~-2.075 y = myLogPDF( 1.0 ); @@ -120,18 +120,13 @@ y = myLogPDF( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/chisquare/logpdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = randu() * 10.0; - y = logpdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/chisquare/logpdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = randu() * 10.0; + const y = logpdf( x, k ); console.log( 'x: %d, k: %d, ln(f(x;k)): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mean/README.md index af9b10e8bc63..13388a13e947 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mean/README.md @@ -54,7 +54,7 @@ where `k` is the degrees of freedom. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/chisquare/mean' ); +const mean = require( '@stdlib/stats/base/dists/chisquare/mean' ); ``` #### mean( k ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/chisquare/mean' ); Returns the [expected value][expected-value] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = mean( 9.0 ); +let v = mean( 9.0 ); // returns 9.0 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = mean( -1.0 ); +const v = mean( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/chisquare/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/chisquare/mean' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = mean( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = mean( k ); console.log( 'k: %d, E(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/median/README.md index 40f5d6cf08f5..33c4efba5e56 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/median/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/chisquare/median' ); +const median = require( '@stdlib/stats/base/dists/chisquare/median' ); ``` #### median( k ) @@ -45,7 +45,7 @@ var median = require( '@stdlib/stats/base/dists/chisquare/median' ); Returns the [median][median] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = median( 9.0 ); +let v = median( 9.0 ); // returns ~8.343 v = median( 2.0 ); @@ -55,7 +55,7 @@ v = median( 2.0 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = median( -1.0 ); +const y = median( -1.0 ); // returns NaN ``` @@ -80,17 +80,13 @@ var y = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/chisquare/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/chisquare/median' ); -var k; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - y = median( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const y = median( k ); console.log( 'k: %d, Median(X,k): %d', k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/README.md index 6973dee0e708..d1b42cba7114 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/README.md @@ -54,7 +54,7 @@ where `k` is the degrees of freedom. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/chisquare/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/chisquare/mgf' ); ``` #### mgf( t, k ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/chisquare/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var y = mgf( 0.4, 2 ); +let y = mgf( 0.4, 2 ); // returns ~5.0 y = mgf( -1.0, 5.0 ); @@ -75,7 +75,7 @@ y = mgf( 0.0, 10.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1.0 ); +let y = mgf( NaN, 1.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -85,14 +85,14 @@ y = mgf( 0.0, NaN ); If provided `t >= 0.5`, the function returns `NaN`. ```javascript -var y = mgf( 0.8, 1.0 ); +const y = mgf( 0.8, 1.0 ); // returns NaN ``` If provided `k < 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, -2.0 ); +const y = mgf( 2.0, -2.0 ); // returns NaN ``` @@ -101,9 +101,9 @@ var y = mgf( 2.0, -2.0 ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var mymgf = mgf.factory( 1.0 ); +const mymgf = mgf.factory( 1.0 ); -var y = mymgf( 0.2 ); +let y = mymgf( 0.2 ); // returns ~1.291 y = mymgf( 0.4 ); @@ -131,18 +131,13 @@ y = mymgf( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/chisquare/mgf' ); - -var t; -var k; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 0.5; - k = randu() * 10.0; - y = mgf( t, k ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/chisquare/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 0.5; + const k = randu() * 10.0; + const y = mgf( t, k ); console.log( 'x: %d, k: %d, M_X(t;k): %d', t.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mode/README.md index 630e19bffe34..638665398929 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/mode/README.md @@ -54,7 +54,7 @@ where `k >= 0` is the degrees of freedom. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/chisquare/mode' ); +const mode = require( '@stdlib/stats/base/dists/chisquare/mode' ); ``` #### mode( k ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/chisquare/mode' ); Returns the [mode][mode] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = mode( 9.0 ); +let v = mode( 9.0 ); // returns 7.0 v = mode( 0.5 ); @@ -72,7 +72,7 @@ v = mode( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = mode( -1.0 ); +const v = mode( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/chisquare/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/chisquare/mode' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = mode( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = mode( k ); console.log( 'k: %d, mode(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/pdf/README.md index 4b6466190a5f..dd554efc1f14 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/pdf/README.md @@ -50,7 +50,7 @@ where `k` is the degrees of freedom and `Γ` denotes the [gamma function][gamma- ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/chisquare/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/chisquare/pdf' ); ``` #### pdf( x, k ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/chisquare/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var y = pdf( 0.1, 1.0 ); +let y = pdf( 0.1, 1.0 ); // returns ~1.2 y = pdf( 0.5, 2.0 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0 ); +let y = pdf( NaN, 1.0 ); // returns NaN y = pdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = pdf( 0.0, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -2.0 ); +const y = pdf( 2.0, -2.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = pdf( 2.0, 0.0 ); +let y = pdf( 2.0, 0.0 ); // returns 0.0 y = pdf( 0.0, 0.0 ); @@ -100,9 +100,9 @@ y = pdf( 0.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var myPDF = pdf.factory( 6.0 ); +const myPDF = pdf.factory( 6.0 ); -var y = myPDF( 3.0 ); +let y = myPDF( 3.0 ); // returns ~0.126 y = myPDF( 1.0 ); @@ -120,18 +120,13 @@ y = myPDF( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/chisquare/pdf' ); - -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = randu() * 10.0; - y = pdf( x, k ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/chisquare/pdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = randu() * 10.0; + const y = pdf( x, k ); console.log( 'x: %d, k: %d, f(x;k): %d', x.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/quantile/README.md index 314a61e07c4e..7e0455e64622 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `k` is the degrees of freedom and `P^{-1}` is the invers ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/chisquare/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/chisquare/quantile' ); ``` #### quantile( p, k ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/chisquare/quantile' ); Evaluates the [quantile function][quantile-function] for a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var y = quantile( 0.8, 1.0 ); +let y = quantile( 0.8, 1.0 ); // returns ~1.642 y = quantile( 0.5, 4.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.8, 0.1 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0 ); +let y = quantile( 1.9, 1.0 ); // returns NaN y = quantile( -0.1, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.2, NaN ); @@ -91,14 +91,14 @@ y = quantile( 0.2, NaN ); If provided `k < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +const y = quantile( 0.4, -1.0 ); // returns NaN ``` If provided `k = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = quantile( 0.3, 0.0 ); +let y = quantile( 0.3, 0.0 ); // returns 0.0 y = quantile( 0.9, 0.0 ); @@ -110,9 +110,9 @@ y = quantile( 0.9, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var myquantile = quantile.factory( 0.4 ); +const myquantile = quantile.factory( 0.4 ); -var y = myquantile( 0.9 ); +let y = myquantile( 0.9 ); // returns ~1.21 y = myquantile( 1.0 ); @@ -130,18 +130,13 @@ y = myquantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/chisquare/quantile' ); - -var k; -var p; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - p = randu(); - k = randu() * 10.0; - y = quantile( p, k ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/chisquare/quantile' ); + +for ( let i = 0; i < 20; i++ ) { + const p = randu(); + const k = randu() * 10.0; + const y = quantile( p, k ); console.log( 'p: %d, k: %d, Q(p;k): %d', p.toFixed( 4 ), k.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/skewness/README.md index 635234837203..7975088a370d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/skewness/README.md @@ -54,7 +54,7 @@ where `k > 0` is the degrees of freedom. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/chisquare/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/chisquare/skewness' ); ``` #### skewness( k ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/chisquare/skewness' ); Returns the [skewness][skewness] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = skewness( 9.0 ); +let v = skewness( 9.0 ); // returns ~0.943 v = skewness( 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 0.5 ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = skewness( -1.0 ); +const v = skewness( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/chisquare/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/chisquare/skewness' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = skewness( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = skewness( k ); console.log( 'k: %d, skew(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/stdev/README.md index 314871116e24..f5c423488925 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/stdev/README.md @@ -54,7 +54,7 @@ where `k >= 0` is the degrees of freedom. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/chisquare/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/chisquare/stdev' ); ``` #### stdev( k ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/chisquare/stdev' ); Returns the [standard deviation][stdev] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = stdev( 9.0 ); +let v = stdev( 9.0 ); // returns ~4.243 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = stdev( -1.0 ); +const v = stdev( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/chisquare/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/chisquare/stdev' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = stdev( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = stdev( k ); console.log( 'k: %d, SD(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/chisquare/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/chisquare/variance/README.md index f7f44388f41e..bfc65df9d72d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chisquare/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chisquare/variance/README.md @@ -54,7 +54,7 @@ where `k >= 0` is the degrees of freedom. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/chisquare/variance' ); +const variance = require( '@stdlib/stats/base/dists/chisquare/variance' ); ``` #### variance( k ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/chisquare/variance' ); Returns the [variance][variance] of a [chi-squared][chisquare-distribution] distribution with degrees of freedom `k`. ```javascript -var v = variance( 9.0 ); +let v = variance( 9.0 ); // returns 18.0 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided `k < 0`, the function returns `NaN`. ```javascript -var v = variance( -1.0 ); +const v = variance( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/chisquare/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/chisquare/variance' ); -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = randu() * 20.0; - v = variance( k ); +for ( let i = 0; i < 10; i++ ) { + const k = randu() * 20.0; + const v = variance( k ); console.log( 'k: %d, Var(X,k): %d', k.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/README.md index 279e9a5b9e72..92ac18bfb491 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var cosine = require( '@stdlib/stats/base/dists/cosine' ); +const cosine = require( '@stdlib/stats/base/dists/cosine' ); ``` #### cosine @@ -35,7 +35,7 @@ var cosine = require( '@stdlib/stats/base/dists/cosine' ); Raised cosine distribution. ```javascript -var dist = cosine; +const dist = cosine; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [raised cosine][cos ```javascript -var Cosine = require( '@stdlib/stats/base/dists/cosine' ).Cosine; +const Cosine = require( '@stdlib/stats/base/dists/cosine' ).Cosine; -var dist = new Cosine( 2.0, 4.0 ); +const dist = new Cosine( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.165 ``` @@ -108,12 +108,12 @@ var y = dist.cdf( 0.5 ); ```javascript -var cosine = require( '@stdlib/stats/base/dists/cosine' ); +const cosine = require( '@stdlib/stats/base/dists/cosine' ); // Create a raised cosine distribution: -var mu = 2.0; -var s = 1.5; -var dist = new cosine.Cosine( mu, s ); +const mu = 2.0; +const s = 1.5; +const dist = new cosine.Cosine( mu, s ); // Calculate various distribution properties: console.log( 'Mean: %d', dist.mean ); @@ -132,7 +132,7 @@ console.log( 'Variance: %d', dist.variance ); // => 'Variance: 0.29405467360947996' // Evaluate the probability density function (PDF): -var x = 1.5; +const x = 1.5; console.log( 'PDF( %d ): %d', x, dist.pdf( x ) ); // => 'PDF( 1.5 ): 0.5' diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/cdf/README.md index bfd34eec0963..f5fecf5786a0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/cdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/cosine/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/cosine/cdf' ); ``` #### cdf( x, mu, s ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/cosine/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = cdf( 2.0, 0.0, 3.0 ); +let y = cdf( 2.0, 0.0, 3.0 ); // returns ~0.971 y = cdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = cdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +const y = cdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = cdf( 2.0, 8.0, 0.0 ); +let y = cdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = cdf( 8.0, 8.0, 0.0 ); @@ -106,9 +106,9 @@ y = cdf( 10.0, 8.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns 0.5 y = mycdf( 8.0 ); @@ -129,20 +129,14 @@ y = mycdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/cosine/cdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = cdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/cosine/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = cdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, F(x;µ,s): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/ctor/README.md index 4c009cb89074..85a6ed1bacfd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Cosine = require( '@stdlib/stats/base/dists/cosine/ctor' ); +const Cosine = require( '@stdlib/stats/base/dists/cosine/ctor' ); ``` #### Cosine( \[mu, s] ) @@ -45,18 +45,18 @@ var Cosine = require( '@stdlib/stats/base/dists/cosine/ctor' ); Returns a [raised cosine][cosine-distribution] distribution object. ```javascript -var cosine = new Cosine(); +const cosine = new Cosine(); -var mu = cosine.mean; +const mu = cosine.mean; // returns 0.0 ``` By default, `mu = 0.0` and `s = 1.0`. To create a distribution having a different `mu` (location parameter) and `s` (scale parameter), provide the corresponding arguments. ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var mu = cosine.mean; +const mu = cosine.mean; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [raised cosine][cosine-distribution] distribution object has the following pro Location parameter of the distribution. ```javascript -var cosine = new Cosine(); +const cosine = new Cosine(); -var mu = cosine.mu; +let mu = cosine.mu; // returns 0.0 cosine.mu = 3.0; @@ -89,9 +89,9 @@ mu = cosine.mu; Scale parameter of the distribution. `s` **must** be a positive number. ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var s = cosine.s; +let s = cosine.s; // returns 4.0 cosine.s = 3.0; @@ -109,9 +109,9 @@ s = cosine.s; Returns the [excess kurtosis][kurtosis]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var kurtosis = cosine.kurtosis; +const kurtosis = cosine.kurtosis; // returns ~-0.594 ``` @@ -120,9 +120,9 @@ var kurtosis = cosine.kurtosis; Returns the [expected value][expected-value]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var mu = cosine.mean; +const mu = cosine.mean; // returns 4.0 ``` @@ -131,9 +131,9 @@ var mu = cosine.mean; Returns the [median][median]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var median = cosine.median; +const median = cosine.median; // returns 4.0 ``` @@ -142,9 +142,9 @@ var median = cosine.median; Returns the [mode][mode]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var mode = cosine.mode; +const mode = cosine.mode; // returns 4.0 ``` @@ -153,9 +153,9 @@ var mode = cosine.mode; Returns the [skewness][skewness]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var skewness = cosine.skewness; +const skewness = cosine.skewness; // returns 0.0 ``` @@ -164,9 +164,9 @@ var skewness = cosine.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var s = cosine.stdev; +const s = cosine.stdev; // returns ~4.338 ``` @@ -175,9 +175,9 @@ var s = cosine.stdev; Returns the [variance][variance]. ```javascript -var cosine = new Cosine( 4.0, 12.0 ); +const cosine = new Cosine( 4.0, 12.0 ); -var s2 = cosine.variance; +const s2 = cosine.variance; // returns ~18.819 ``` @@ -190,9 +190,9 @@ var s2 = cosine.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.cdf( 0.5 ); +const y = cosine.cdf( 0.5 ); // returns ~0.165 ``` @@ -201,9 +201,9 @@ var y = cosine.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.logcdf( 0.5 ); +const y = cosine.logcdf( 0.5 ); // returns ~-1.799 ``` @@ -212,9 +212,9 @@ var y = cosine.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.logpdf( 0.8 ); +const y = cosine.logpdf( 0.8 ); // returns ~-1.617 ``` @@ -223,9 +223,9 @@ var y = cosine.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.mgf( 0.2 ); +const y = cosine.mgf( 0.2 ); // returns ~1.555 ``` @@ -234,9 +234,9 @@ var y = cosine.mgf( 0.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.pdf( 2.0 ); +const y = cosine.pdf( 2.0 ); // returns 0.25 ``` @@ -245,9 +245,9 @@ var y = cosine.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var y = cosine.quantile( 0.9 ); +let y = cosine.quantile( 0.9 ); // returns ~3.929 y = cosine.quantile( 1.9 ); @@ -277,20 +277,20 @@ y = cosine.quantile( 1.9 ); ```javascript -var Cosine = require( '@stdlib/stats/base/dists/cosine/ctor' ); +const Cosine = require( '@stdlib/stats/base/dists/cosine/ctor' ); -var cosine = new Cosine( 2.0, 4.0 ); +const cosine = new Cosine( 2.0, 4.0 ); -var mean = cosine.mean; +const mean = cosine.mean; // returns 2.0 -var median = cosine.median; +const median = cosine.median; // returns 2.0 -var s2 = cosine.variance; +const s2 = cosine.variance; // returns ~2.091 -var y = cosine.cdf( 0.8 ); +const y = cosine.cdf( 0.8 ); // returns ~0.221 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/kurtosis/README.md index a1dd9d9a8a32..e104cb2fdf24 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [raised cosine][cosine-distribution] rando ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/cosine/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/cosine/kurtosis' ); ``` #### kurtosis( mu, s ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/cosine/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns ~-0.594 y = kurtosis( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -83,7 +83,7 @@ y = kurtosis( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/cosine/kurtosis' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = kurtosis( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/cosine/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = kurtosis( mu, s ); console.log( 'µ: %d, s: %d, Kurt(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/logcdf/README.md index 7603cbad0e47..62c9257a135b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/logcdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/cosine/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/cosine/logcdf' ); ``` #### logcdf( x, mu, s ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/cosine/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = logcdf( 2.0, 0.0, 3.0 ); +let y = logcdf( 2.0, 0.0, 3.0 ); // returns ~-0.029 y = logcdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = logcdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +const y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the logarithm of the [CDF][cdf] for a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logcdf( 2.0, 8.0, 0.0 ); +let y = logcdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logcdf( 8.0, 8.0, 0.0 ); @@ -106,9 +106,9 @@ y = logcdf( 10.0, 8.0, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.693 y = mylogcdf( 8.0 ); @@ -139,20 +139,14 @@ y = mylogcdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/cosine/logcdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = logcdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/cosine/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = logcdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, ln(F(x;µ,s)): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/logpdf/README.md index 0b74b206266b..58956c9d6778 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/logpdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/cosine/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/cosine/logpdf' ); ``` #### logpdf( x, mu, s ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/cosine/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = logpdf( 2.0, 0.0, 3.0 ); +let y = logpdf( 2.0, 0.0, 3.0 ); // returns ~-2.485 y = logpdf( -1.0, 2.0, 4.0 ); @@ -68,7 +68,7 @@ y = logpdf( -1.0, 2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +const y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logpdf( 2.0, 8.0, 0.0 ); +let y = logpdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logpdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = logpdf( 8.0, 8.0, 0.0 ); Returns a function for evaluating the logarithm of the [probability density function][pdf] (PDF) of a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-0.693 y = mylogpdf( 9.0 ); @@ -130,20 +130,14 @@ y = mylogpdf( 9.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/cosine/logpdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = logpdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/cosine/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = logpdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, ln(f(x;µ,s)): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/mean/README.md index 9527f117ca44..3af88637a0fd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/mean/README.md @@ -52,7 +52,7 @@ The [mean][mean] for a [raised cosine][cosine-distribution] random variable with ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/cosine/mean' ); +const mean = require( '@stdlib/stats/base/dists/cosine/mean' ); ``` #### mean( mu, s ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/cosine/mean' ); Returns the [expected value][mean] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns 2.0 y = mean( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mean( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/cosine/mean' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = mean( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/cosine/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = mean( mu, s ); console.log( 'µ: %d, s: %d, E(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/median/README.md index 01caa20e621e..ce785c4cccbc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [raised cosine][cosine-distribution] random variable ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/cosine/median' ); +const median = require( '@stdlib/stats/base/dists/cosine/median' ); ``` #### median( mu, s ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/cosine/median' ); Returns the [median][median] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns 2.0 y = median( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -83,7 +83,7 @@ y = median( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/cosine/median' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = median( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/cosine/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = median( mu, s ); console.log( 'µ: %d, s: %d, Median(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/mgf/README.md index ad7a3d74bb89..c81c077394f0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/mgf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/cosine/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/cosine/mgf' ); ``` #### mgf( t, mu, s ) @@ -58,7 +58,7 @@ var mgf = require( '@stdlib/stats/base/dists/cosine/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = mgf( 2.0, 0.0, 3.0 ); +let y = mgf( 2.0, 0.0, 3.0 ); // returns ~7.234 y = mgf( 0.5, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = mgf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = mgf( 0.0, 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, 0.0, -1.0 ); +let y = mgf( 0.5, 0.0, -1.0 ); // returns NaN y = mgf( 0.5, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = mgf( 0.5, 0.0, 0.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mymgf = mgf.factory( 10.0, 2.0 ); +const mymgf = mgf.factory( 10.0, 2.0 ); -var y = mymgf( 0.1 ); +const y = mymgf( 0.1 ); // returns ~2.725 ``` @@ -113,20 +113,14 @@ var y = mymgf( 0.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/cosine/mgf' ); - -var mu; -var s; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = mgf( t, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/cosine/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = mgf( t, mu, s ); console.log( 't: %d, µ: %d, s: %d, M_X(t;µ,s): %d', t.toFixed( 4 ), mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/mode/README.md index 6a2ef13c044b..9cfccb09e51f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [raised cosine][cosine-distribution] random variable with ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/cosine/mode' ); +const mode = require( '@stdlib/stats/base/dists/cosine/mode' ); ``` #### mode( mu, s ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/cosine/mode' ); Returns the [mode][mode] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns 2.0 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/cosine/mode' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = mode( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/cosine/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = mode( mu, s ); console.log( 'µ: %d, s: %d, mode(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/pdf/README.md index ee64a2b799d1..82cdec2ff2da 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/pdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/cosine/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/cosine/pdf' ); ``` #### pdf( x, mu, s ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/cosine/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = pdf( 2.0, 0.0, 3.0 ); +let y = pdf( 2.0, 0.0, 3.0 ); // returns ~0.083 y = pdf( 2.0, 4.0, 4.0 ); @@ -68,7 +68,7 @@ y = pdf( 2.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = pdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +const y = pdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = pdf( 2.0, 8.0, 0.0 ); +let y = pdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = pdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = pdf( 8.0, 8.0, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mypdf = pdf.factory( 0.0, 3.0 ); +const mypdf = pdf.factory( 0.0, 3.0 ); -var y = mypdf( 2.0 ); +let y = mypdf( 2.0 ); // returns ~0.083 y = mypdf( 5.0 ); @@ -120,20 +120,14 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/cosine/pdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = pdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/cosine/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = pdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, f(x;µ,s): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/quantile/README.md index 06f040b02def..cb47b8441b27 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/quantile/README.md @@ -31,7 +31,7 @@ limitations under the License. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/cosine/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/cosine/quantile' ); ``` #### quantile( p, mu, s ) @@ -39,7 +39,7 @@ var quantile = require( '@stdlib/stats/base/dists/cosine/quantile' ); Evaluates the [quantile function][quantile-function] for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns ~0.0 y = quantile( 0.2, 4.0, 2.0 ); @@ -49,7 +49,7 @@ y = quantile( 0.2, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -59,7 +59,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -72,14 +72,14 @@ y = quantile( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +const y = quantile( 0.4, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = quantile( 0.3, 8.0, 0.0 ); +let y = quantile( 0.3, 8.0, 0.0 ); // returns 8.0 y = quantile( 0.9, 8.0, 0.0 ); @@ -91,9 +91,9 @@ y = quantile( 0.9, 8.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [raised cosine][cosine-distribution] distribution with parameters `mu` and `s`. ```javascript -var myQuantile = quantile.factory( 10.0, 2.0 ); +const myQuantile = quantile.factory( 10.0, 2.0 ); -var y = myQuantile( 0.2 ); +let y = myQuantile( 0.2 ); // returns ~9.345 y = myQuantile( 0.9 ); @@ -111,20 +111,14 @@ y = myQuantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/cosine/quantile' ); - -var mu; -var s; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = randu() * 10.0; - s = randu() * 10.0; - y = quantile( p, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/cosine/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = quantile( p, mu, s ); console.log( 'p: %d, µ: %d, s: %d, Q(p;µ,s): %d', p, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/README.md index b6b352571c29..1fbafccd8676 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [raised cosine][cosine-distribution] random varia ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/cosine/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/cosine/skewness' ); ``` #### skewness( mu, s ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/cosine/skewness' ); Returns the [skewness][skewness] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns 0.0 y = skewness( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = skewness( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -83,7 +83,7 @@ y = skewness( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/cosine/skewness' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = skewness( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/cosine/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = skewness( mu, s ); console.log( 'µ: %d, s: %d, skew(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/stdev/README.md index 6b22b0b93e6a..d0916a88cbf8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][stdev] for a [raised cosine][cosine-distribution] rando ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/cosine/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/cosine/stdev' ); ``` #### stdev( mu, s ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/cosine/stdev' ); Returns the [standard deviation][stdev] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns ~0.362 y = stdev( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -83,7 +83,7 @@ y = stdev( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/cosine/stdev' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = stdev( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/cosine/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = stdev( mu, s ); console.log( 'µ: %d, s: %d, SD(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/cosine/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/cosine/variance/README.md index e0876fd6c90b..9431272c88ae 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cosine/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cosine/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [raised cosine][cosine-distribution] random varia ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/cosine/variance' ); +const variance = require( '@stdlib/stats/base/dists/cosine/variance' ); ``` #### variance( mu, s ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/cosine/variance' ); Returns the [variance][variance] for a [raised cosine][cosine-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns ~0.131 y = variance( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -83,7 +83,7 @@ y = variance( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/cosine/variance' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = variance( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/cosine/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = variance( mu, s ); console.log( 'µ: %d, s: %d, Var(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/README.md index 3bf3dd291565..55f81a01169d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var degenerate = require( '@stdlib/stats/base/dists/degenerate' ); +const degenerate = require( '@stdlib/stats/base/dists/degenerate' ); ``` #### degenerate @@ -35,7 +35,7 @@ var degenerate = require( '@stdlib/stats/base/dists/degenerate' ); Degenerate distribution. ```javascript -var dist = degenerate; +const dist = degenerate; // returns {...} ``` @@ -100,8 +100,8 @@ The namespace contains a constructor function for creating a degenerate distribu ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var degenerate = require( '@stdlib/stats/base/dists/degenerate' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const degenerate = require( '@stdlib/stats/base/dists/degenerate' ); console.log( objectKeys( degenerate ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/cdf/README.md index bccf6615bc39..665f86a6c488 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/cdf/README.md @@ -50,7 +50,7 @@ where `µ` is the constant value of the distribution. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' ); ``` #### cdf( x, mu ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' ); Evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = cdf( 2.0, 8.0 ); +let y = cdf( 2.0, 8.0 ); // returns 0.0 y = cdf( 8.0, 8.0 ); @@ -73,9 +73,9 @@ y = cdf( 10.0, 8.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mycdf = cdf.factory( 10.0 ); +const mycdf = cdf.factory( 10.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns 1.0 y = mycdf( 8.0 ); @@ -93,19 +93,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*10.0 ); - mu = round( randu()*10.0 ); - y = cdf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*10.0 ); + const mu = round( randu()*10.0 ); + const y = cdf( x, mu ); console.log( 'x: %d, µ: %d, F(x;µ): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/ctor/README.md index c4123b0fcb4f..1e8d56901b5f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Degenerate = require( '@stdlib/stats/base/dists/degenerate/ctor' ); +const Degenerate = require( '@stdlib/stats/base/dists/degenerate/ctor' ); ``` #### Degenerate( \[mu] ) @@ -45,18 +45,18 @@ var Degenerate = require( '@stdlib/stats/base/dists/degenerate/ctor' ); Returns a [Degenerate][degenerate-distribution] distribution object. ```javascript -var degenerate = new Degenerate(); +const degenerate = new Degenerate(); -var mean = degenerate.mean; +const mean = degenerate.mean; // returns 0.0 ``` By default, `mu = 0.0`. To create a distribution having a different mean value `mu`, provide a parameter value. ```javascript -var degenerate = new Degenerate( 20.0 ); +const degenerate = new Degenerate( 20.0 ); -var mean = degenerate.mean; +const mean = degenerate.mean; // returns 20.0 ``` @@ -73,9 +73,9 @@ A [Degenerate][degenerate-distribution] distribution object has the following pr Constant value of the distribution. ```javascript -var degenerate = new Degenerate( 2.0 ); +const degenerate = new Degenerate( 2.0 ); -var mu = degenerate.mu; +let mu = degenerate.mu; // returns 2.0 degenerate.mu = -2.0; @@ -93,9 +93,9 @@ mu = degenerate.mu; Returns the [differential entropy][entropy]. ```javascript -var degenerate = new Degenerate( 4.0 ); +const degenerate = new Degenerate( 4.0 ); -var entropy = degenerate.entropy; +const entropy = degenerate.entropy; // returns 0.0 ``` @@ -104,9 +104,9 @@ var entropy = degenerate.entropy; Returns the [mean][expected-value]. ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var mu = degenerate.mean; +const mu = degenerate.mean; // returns 10.0 ``` @@ -115,9 +115,9 @@ var mu = degenerate.mean; Returns the [median][median]. ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var median = degenerate.median; +const median = degenerate.median; // returns 10.0 ``` @@ -126,9 +126,9 @@ var median = degenerate.median; Returns the [mode][mode]. ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var mode = degenerate.mode; +const mode = degenerate.mode; // returns 10.0 ``` @@ -137,9 +137,9 @@ var mode = degenerate.mode; Returns the [standard deviation][standard-deviation]. ```javascript -var degenerate = new Degenerate( 4.0 ); +const degenerate = new Degenerate( 4.0 ); -var s = degenerate.stdev; +const s = degenerate.stdev; // returns 0.0 ``` @@ -148,9 +148,9 @@ var s = degenerate.stdev; Returns the [variance][variance]. ```javascript -var degenerate = new Degenerate( 4.0 ); +const degenerate = new Degenerate( 4.0 ); -var s2 = degenerate.variance; +const s2 = degenerate.variance; // returns 0.0 ``` @@ -163,9 +163,9 @@ var s2 = degenerate.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var degenerate = new Degenerate( 0.2 ); +const degenerate = new Degenerate( 0.2 ); -var y = degenerate.cdf( 0.5 ); +const y = degenerate.cdf( 0.5 ); // returns 1.0 ``` @@ -174,9 +174,9 @@ var y = degenerate.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (logCDF). ```javascript -var degenerate = new Degenerate( 0.2 ); +const degenerate = new Degenerate( 0.2 ); -var y = degenerate.logcdf( 0.5 ); +const y = degenerate.logcdf( 0.5 ); // returns 0.0 ``` @@ -185,9 +185,9 @@ var y = degenerate.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (logPDF). ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.logpdf( 9.0 ); +let y = degenerate.logpdf( 9.0 ); // returns -Infinity y = degenerate.logpdf( 10.0 ); @@ -199,9 +199,9 @@ y = degenerate.logpdf( 10.0 ); Evaluates the natural logarithm of the [probability mass function][pmf] (logPMF). ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.logpmf( 9.0 ); +let y = degenerate.logpmf( 9.0 ); // returns -Infinity y = degenerate.logpmf( 10.0 ); @@ -213,9 +213,9 @@ y = degenerate.logpmf( 10.0 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.mgf( 0.1 ); +const y = degenerate.mgf( 0.1 ); // returns ~2.718 ``` @@ -224,9 +224,9 @@ var y = degenerate.mgf( 0.1 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.pdf( 2.0 ); +let y = degenerate.pdf( 2.0 ); // returns 0.0 y = degenerate.pdf( 10.0 ); @@ -238,9 +238,9 @@ y = degenerate.pdf( 10.0 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.pmf( 2.0 ); +let y = degenerate.pmf( 2.0 ); // returns 0.0 y = degenerate.pmf( 10.0 ); @@ -252,9 +252,9 @@ y = degenerate.pmf( 10.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var degenerate = new Degenerate( 10.0 ); +const degenerate = new Degenerate( 10.0 ); -var y = degenerate.quantile( 0.5 ); +let y = degenerate.quantile( 0.5 ); // returns 10.0 y = degenerate.quantile( 0.9 ); @@ -284,17 +284,17 @@ y = degenerate.quantile( 0.9 ); ```javascript -var Degenerate = require( '@stdlib/stats/base/dists/degenerate/ctor' ); +const Degenerate = require( '@stdlib/stats/base/dists/degenerate/ctor' ); -var degenerate = new Degenerate( 0.5 ); +const degenerate = new Degenerate( 0.5 ); -var mu = degenerate.mean; +const mu = degenerate.mean; // returns 0.5 -var s2 = degenerate.variance; +const s2 = degenerate.variance; // returns 0.0 -var y = degenerate.cdf( 2.0 ); +const y = degenerate.cdf( 2.0 ); // returns 1.0 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/entropy/README.md index ef70f4c226de..4e77491c021e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/entropy/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/degenerate/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/degenerate/entropy' ); ``` #### entropy( mu ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/degenerate/entropy' ); Returns the [entropy][entropy] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = entropy( 10.0 ); +let v = entropy( 10.0 ); // returns 0.0 v = entropy( -0.5 ); @@ -93,16 +93,12 @@ v = entropy( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/degenerate/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/degenerate/entropy' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = entropy( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = entropy( mu ); console.log( 'µ: %d, H(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logcdf/README.md index b1b41f6e1baf..8205b5d2f526 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logcdf/README.md @@ -50,7 +50,7 @@ where `µ` is the constant value of the distribution. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/degenerate/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/degenerate/logcdf' ); ``` #### logcdf( x, mu ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/degenerate/logcdf' ); Evaluates the natural logarithm of the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logcdf( 2.0, 8.0 ); +let y = logcdf( 2.0, 8.0 ); // returns -Infinity y = logcdf( 8.0, 8.0 ); @@ -73,9 +73,9 @@ y = logcdf( 10.0, 8.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mylogcdf = logcdf.factory( 10.0 ); +const mylogcdf = logcdf.factory( 10.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns 0.0 y = mylogcdf( 8.0 ); @@ -93,19 +93,14 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logcdf = require( '@stdlib/stats/base/dists/degenerate/logcdf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*10.0 ); - mu = round( randu()*10.0 ); - y = logcdf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logcdf = require( '@stdlib/stats/base/dists/degenerate/logcdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*10.0 ); + const mu = round( randu()*10.0 ); + const y = logcdf( x, mu ); console.log( 'x: %d, µ: %d, ln(F(x;µ)): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpdf/README.md index c32a7dba915d..7d3ba3a0256b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpdf/README.md @@ -63,7 +63,7 @@ where `delta` is the Dirac delta function. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/degenerate/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/degenerate/logpdf' ); ``` #### logpdf( x, mu ) @@ -71,7 +71,7 @@ var logpdf = require( '@stdlib/stats/base/dists/degenerate/logpdf' ); Evaluates the natural logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logpdf( 2.0, 8.0 ); +let y = logpdf( 2.0, 8.0 ); // returns -Infinity y = logpdf( 8.0, 8.0 ); @@ -83,9 +83,9 @@ y = logpdf( 8.0, 8.0 ); Returns a function for evaluating the natural logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mylogpdf = logpdf.factory( 10.0 ); +const mylogpdf = logpdf.factory( 10.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns Infinity y = mylogpdf( 5.0 ); @@ -106,19 +106,14 @@ y = mylogpdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpdf = require( '@stdlib/stats/base/dists/degenerate/logpdf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*5.0 ); - mu = round( randu()*5.0 ); - y = logpdf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpdf = require( '@stdlib/stats/base/dists/degenerate/logpdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*5.0 ); + const mu = round( randu()*5.0 ); + const y = logpdf( x, mu ); console.log( 'x: %d, µ: %d, ln(f(x;µ)): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpmf/README.md index 320c6bd066d7..1e56511d85bd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/logpmf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/degenerate/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/degenerate/logpmf' ); ``` #### logpmf( x, mu ) @@ -41,7 +41,7 @@ var logpmf = require( '@stdlib/stats/base/dists/degenerate/logpmf' ); Evaluates the natural logarithm of the [PMF][pmf] for a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logpmf( 2.0, 8.0 ); +let y = logpmf( 2.0, 8.0 ); // returns -Infinity y = logpmf( 8.0, 8.0 ); @@ -53,9 +53,9 @@ y = logpmf( 8.0, 8.0 ); Returns a function for evaluating the natural logarithm of the [PMF][pmf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mylogpmf = logpmf.factory( 10.0 ); +const mylogpmf = logpmf.factory( 10.0 ); -var y = mylogpmf( 10.0 ); +let y = mylogpmf( 10.0 ); // returns 0.0 y = mylogpmf( 5.0 ); @@ -76,19 +76,14 @@ y = mylogpmf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/degenerate/logpmf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*5.0 ); - mu = round( randu()*5.0 ); - y = logpmf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/degenerate/logpmf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*5.0 ); + const mu = round( randu()*5.0 ); + const y = logpmf( x, mu ); console.log( 'x: %d, µ: %d, ln(P(X=x;µ)): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/README.md index 359b9a54a820..a180f2ee2507 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/degenerate/mean' ); +const mean = require( '@stdlib/stats/base/dists/degenerate/mean' ); ``` #### mean( mu ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/degenerate/mean' ); Returns the [expected value][expected-value] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = mean( 10.0 ); +let v = mean( 10.0 ); // returns 10.0 v = mean( -0.5 ); @@ -90,16 +90,12 @@ v = mean( -0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/degenerate/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/degenerate/mean' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = mean( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = mean( mu ); console.log( 'µ: %d, E(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/median/README.md index e176b85e9fbe..fe54c5fd7622 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/median/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/degenerate/median' ); +const median = require( '@stdlib/stats/base/dists/degenerate/median' ); ``` #### median( mu ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/degenerate/median' ); Returns the [median][median] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = median( 10.0 ); +let v = median( 10.0 ); // returns 10.0 v = median( -0.5 ); @@ -90,16 +90,12 @@ v = median( -0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/degenerate/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/degenerate/median' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = median( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = median( mu ); console.log( 'µ: %d, Median(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/README.md index 4c413bc39279..47c7fd1f926d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/README.md @@ -54,7 +54,7 @@ where `mu` is the distribution mean. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/degenerate/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/degenerate/mgf' ); ``` #### mgf( t, mu ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/degenerate/mgf' ); Evaluates the moment-generating function ([MGF][mgf]) of a [degenerate][degenerate] distribution with parameter `mu` (mean). ```javascript -var y = mgf( 1.0, 1.0 ); +let y = mgf( 1.0, 1.0 ); // returns ~2.718 y = mgf( 2.0, 3.0 ); @@ -72,7 +72,7 @@ y = mgf( 2.0, 3.0 ); If provided `NaN` for any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0 ); +let y = mgf( NaN, 0.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -84,9 +84,9 @@ y = mgf( 0.0, NaN ); Returns a function for evaluating the [moment-generating function][mgf] of a [degenerate][degenerate] distribution with parameter `mu` (mean). ```javascript -var mymgf = mgf.factory( 10.0 ); +const mymgf = mgf.factory( 10.0 ); -var y = mymgf( 0.1 ); +const y = mymgf( 0.1 ); // returns ~2.718 ``` @@ -111,19 +111,14 @@ var y = mymgf( 0.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mgf = require( '@stdlib/stats/base/dists/degenerate/mgf' ); - -var mu; -var t; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - t = round( randu()*5.0 ); - mu = round( randu()*5.0 ); - y = mgf( t, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mgf = require( '@stdlib/stats/base/dists/degenerate/mgf' ); + +for ( let i = 0; i < 100; i++ ) { + const t = round( randu()*5.0 ); + const mu = round( randu()*5.0 ); + const y = mgf( t, mu ); console.log( 'x: %d, µ: %d, M_X(t;µ): %d', t, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mode/README.md index 3995f484b9a2..87c9ea32e7e1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/mode/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/degenerate/mode' ); +const mode = require( '@stdlib/stats/base/dists/degenerate/mode' ); ``` #### mode( mu ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/degenerate/mode' ); Returns the [mode][mode] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = mode( 10.0 ); +let v = mode( 10.0 ); // returns 10.0 v = mode( -0.5 ); @@ -90,16 +90,12 @@ v = mode( -0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/degenerate/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/degenerate/mode' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = mode( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = mode( mu ); console.log( 'µ: %d, Mode(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md index 3788a5468ea9..05e10d5fc513 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md @@ -63,7 +63,7 @@ where `delta` is the Dirac delta function. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' ); ``` #### pdf( x, mu ) @@ -71,7 +71,7 @@ var pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' ); Evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = pdf( 2.0, 8.0 ); +let y = pdf( 2.0, 8.0 ); // returns 0.0 y = pdf( 8.0, 8.0 ); @@ -83,9 +83,9 @@ y = pdf( 8.0, 8.0 ); Returns a function for evaluating the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mypdf = pdf.factory( 10.0 ); +const mypdf = pdf.factory( 10.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns Infinity y = mypdf( 5.0 ); @@ -106,19 +106,14 @@ y = mypdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*5.0 ); - mu = round( randu()*5.0 ); - y = pdf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pdf = require( '@stdlib/stats/base/dists/degenerate/pdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*5.0 ); + const mu = round( randu()*5.0 ); + const y = pdf( x, mu ); console.log( 'x: %d, µ: %d, f(x;µ): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pmf/README.md index 6e9a97e76341..9648815b1cda 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pmf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/degenerate/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/degenerate/pmf' ); ``` #### pmf( x, mu ) @@ -41,7 +41,7 @@ var pmf = require( '@stdlib/stats/base/dists/degenerate/pmf' ); Evaluates the [PMF][pmf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = pmf( 2.0, 8.0 ); +let y = pmf( 2.0, 8.0 ); // returns 0.0 y = pmf( 8.0, 8.0 ); @@ -53,9 +53,9 @@ y = pmf( 8.0, 8.0 ); Returns a function for evaluating the [PMF][pmf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var mypmf = pmf.factory( 10.0 ); +const mypmf = pmf.factory( 10.0 ); -var y = mypmf( 10.0 ); +let y = mypmf( 10.0 ); // returns 1.0 y = mypmf( 5.0 ); @@ -76,19 +76,14 @@ y = mypmf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/degenerate/pmf' ); - -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = round( randu()*5.0 ); - mu = round( randu()*5.0 ); - y = pmf( x, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/degenerate/pmf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = round( randu()*5.0 ); + const mu = round( randu()*5.0 ); + const y = pmf( x, mu ); console.log( 'x: %d, µ: %d, P(X=x;µ): %d', x, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/quantile/README.md index d88ee8a4a413..73f210282664 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1` and where `µ` is the constant value of the distribution. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' ); ``` #### quantile( p, mu ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' ); Evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = quantile( 0.3, 8.0 ); +let y = quantile( 0.3, 8.0 ); // returns 8.0 y = quantile( 0.9, 8.0 ); @@ -70,9 +70,9 @@ y = quantile( 0.9, 8.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var myquantile = quantile.factory( 10.0 ); +const myquantile = quantile.factory( 10.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns 10.0 y = myquantile( 1.1 ); @@ -90,18 +90,13 @@ y = myquantile( 1.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' ); - -var mu; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = ( randu()*10.0 ) - 5.0; - y = quantile( p, mu ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/degenerate/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = ( randu()*10.0 ) - 5.0; + const y = quantile( p, mu ); console.log( 'p: %d, µ: %d, Q(p;µ): %d', p, mu, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/README.md index d99f1b79ed9e..ca0e56367af8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); ``` #### stdev( mu ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); Returns the [standard deviation][standard-deviation] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = stdev( 10.0 ); +let v = stdev( 10.0 ); // returns 0.0 v = stdev( -0.5 ); @@ -93,16 +93,12 @@ v = stdev( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = stdev( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = stdev( mu ); console.log( 'µ: %d, SD(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/variance/README.md index 7e7e00d483f8..61e554bcd1f9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/variance/README.md @@ -54,7 +54,7 @@ where `μ` is the constant value of the distribution. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/degenerate/variance' ); +const variance = require( '@stdlib/stats/base/dists/degenerate/variance' ); ``` #### variance( mu ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/degenerate/variance' ); Returns the [variance][variance] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. ```javascript -var v = variance( 10.0 ); +let v = variance( 10.0 ); // returns 0.0 v = variance( -0.5 ); @@ -93,16 +93,12 @@ v = variance( NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/degenerate/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/degenerate/variance' ); -var mu; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu(); - v = variance( mu ); +for ( let i = 0; i < 10; i++ ) { + const mu = randu(); + const v = variance( mu ); console.log( 'µ: %d, Var(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/README.md index 07cdb8b8927f..cc60c796b952 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var discreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ); +const discreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ); ``` #### discreteUniform @@ -35,7 +35,7 @@ var discreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ); Discrete uniform distribution. ```javascript -var dist = discreteUniform; +const dist = discreteUniform; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [discrete uniform][ ```javascript -var DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ).DiscreteUniform; +const DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ).DiscreteUniform; -var dist = new DiscreteUniform( 2, 4 ); +const dist = new DiscreteUniform( 2, 4 ); -var y = dist.pmf( 3, 0 ); +const y = dist.pmf( 3, 0 ); // returns ~0.333 ``` @@ -108,8 +108,8 @@ var y = dist.pmf( 3, 0 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var discreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const discreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform' ); console.log( objectKeys( discreteUniform ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/cdf/README.md index 05944fe83f11..7eb35208c695 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/cdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/discrete-uniform/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/discrete-uniform/cdf' ); ``` #### cdf( x, a, b ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/discrete-uniform/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = cdf( 9.0, 0, 10 ); +let y = cdf( 9.0, 0, 10 ); // returns ~0.909 y = cdf( 0.5, -2, 2 ); @@ -74,7 +74,7 @@ y = cdf( Infinity, 2, 4 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = cdf( 0.2, 1, 5.5 ); +let y = cdf( 0.2, 1, 5.5 ); // returns NaN y = cdf( NaN, 0, 1 ); @@ -90,7 +90,7 @@ y = cdf( 0.0, 0, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var y = cdf( 0.5, 3, 2); +const y = cdf( 0.5, 3, 2); // returns NaN ``` @@ -99,8 +99,8 @@ var y = cdf( 0.5, 3, 2); Returns a function for evaluating the [cumulative distribution function][cdf] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mycdf = cdf.factory( 0, 10 ); -var y = mycdf( 0.5 ); +const mycdf = cdf.factory( 0, 10 ); +let y = mycdf( 0.5 ); // returns ~0.091 y = mycdf( 8.0 ); @@ -118,23 +118,18 @@ y = mycdf( 8.0 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/discrete-uniform/cdf' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var x; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 15.0; - a = randa(); - b = randb( a, a+randa() ); - v = cdf( x, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/discrete-uniform/cdf' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 15.0; + const a = randa(); + const b = randb( a, a+randa() ); + const v = cdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/ctor/README.md index 515d5179d52f..4cd5be9c27fe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform/ctor' ); +const DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform/ctor' ); ``` #### DiscreteUniform( \[a, b] ) @@ -45,18 +45,18 @@ var DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform/ctor' Returns a [discrete uniform][discrete-uniform-distribution] distribution object. ```javascript -var discreteUniform = new DiscreteUniform(); +const discreteUniform = new DiscreteUniform(); -var mu = discreteUniform.mean; +const mu = discreteUniform.mean; // returns 0.5 ``` By default, `a = 0` and `b = 1`. To create a distribution having a different `a` (minimum support) and `b` (maximum support), provide the corresponding arguments. ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var mu = discreteUniform.mean; +const mu = discreteUniform.mean; // returns 3.0 ``` @@ -73,9 +73,9 @@ A [discrete uniform][discrete-uniform-distribution] distribution object has the Minimum support of the distribution. `a` **must** be an integer smaller than or equal to `b`. ```javascript -var discreteUniform = new DiscreteUniform( -2, 2 ); +const discreteUniform = new DiscreteUniform( -2, 2 ); -var a = discreteUniform.a; +let a = discreteUniform.a; // returns -2 discreteUniform.a = 0; @@ -89,9 +89,9 @@ a = discreteUniform.a; Maximum support of the distribution. `b` **must** be an integer larger than or equal to `a`. ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var b = discreteUniform.b; +let b = discreteUniform.b; // returns 4 discreteUniform.b = 3; @@ -109,9 +109,9 @@ b = discreteUniform.b; Returns the [differential entropy][entropy]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var entropy = discreteUniform.entropy; +const entropy = discreteUniform.entropy; // returns ~2.197 ``` @@ -120,9 +120,9 @@ var entropy = discreteUniform.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var kurtosis = discreteUniform.kurtosis; +const kurtosis = discreteUniform.kurtosis; // returns -1.23 ``` @@ -131,9 +131,9 @@ var kurtosis = discreteUniform.kurtosis; Returns the [expected value][expected-value]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var mu = discreteUniform.mean; +const mu = discreteUniform.mean; // returns 8.0 ``` @@ -142,9 +142,9 @@ var mu = discreteUniform.mean; Returns the [median][median]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var median = discreteUniform.median; +const median = discreteUniform.median; // returns 8.0 ``` @@ -153,9 +153,9 @@ var median = discreteUniform.median; Returns the [skewness][skewness]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var skewness = discreteUniform.skewness; +const skewness = discreteUniform.skewness; // returns 0.0 ``` @@ -164,9 +164,9 @@ var skewness = discreteUniform.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var s = discreteUniform.stdev; +const s = discreteUniform.stdev; // returns ~2.582 ``` @@ -175,9 +175,9 @@ var s = discreteUniform.stdev; Returns the [variance][variance]. ```javascript -var discreteUniform = new DiscreteUniform( 4, 12 ); +const discreteUniform = new DiscreteUniform( 4, 12 ); -var s2 = discreteUniform.variance; +const s2 = discreteUniform.variance; // returns ~6.667 ``` @@ -190,9 +190,9 @@ var s2 = discreteUniform.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var y = discreteUniform.cdf( 2.5 ); +const y = discreteUniform.cdf( 2.5 ); // returns ~0.333 ``` @@ -201,9 +201,9 @@ var y = discreteUniform.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var y = discreteUniform.logcdf( 2.5 ); +const y = discreteUniform.logcdf( 2.5 ); // returns ~-1.099 ``` @@ -212,9 +212,9 @@ var y = discreteUniform.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF). ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var y = discreteUniform.logpmf( 4.0 ); +const y = discreteUniform.logpmf( 4.0 ); // returns ~-1.099 ``` @@ -223,9 +223,9 @@ var y = discreteUniform.logpmf( 4.0 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var y = discreteUniform.pmf( 3, 0 ); +const y = discreteUniform.pmf( 3, 0 ); // returns ~0.333 ``` @@ -234,9 +234,9 @@ var y = discreteUniform.pmf( 3, 0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var discreteUniform = new DiscreteUniform( 2, 4 ); +const discreteUniform = new DiscreteUniform( 2, 4 ); -var y = discreteUniform.quantile( 0.5 ); +let y = discreteUniform.quantile( 0.5 ); // returns 3.0 y = discreteUniform.quantile( 1.9 ); @@ -266,20 +266,20 @@ y = discreteUniform.quantile( 1.9 ); ```javascript -var DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform/ctor' ); +const DiscreteUniform = require( '@stdlib/stats/base/dists/discrete-uniform/ctor' ); -var discreteUniform = new DiscreteUniform( -2, 2 ); +const discreteUniform = new DiscreteUniform( -2, 2 ); -var mu = discreteUniform.mean; +const mu = discreteUniform.mean; // returns 0.0 -var median = discreteUniform.median; +const median = discreteUniform.median; // returns 0.0 -var s2 = discreteUniform.variance; +const s2 = discreteUniform.variance; // returns 2.0 -var y = discreteUniform.cdf( 2.5 ); +const y = discreteUniform.cdf( 2.5 ); // returns 1.0 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/entropy/README.md index 13bc4c40c93c..b6077fac43fb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/entropy/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/discrete-uniform/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/discrete-uniform/entropy' ); ``` #### entropy( a, b ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/discrete-uniform/entropy' ); Returns the [entropy][entropy] of a [discrete uniform][discrete-uniform-distribution] distribution with minimum support `a` and maximum support `b` (in [nats][nats]). ```javascript -var v = entropy( 0, 1 ); +let v = entropy( 0, 1 ); // returns ~0.693 v = entropy( 4, 12 ); @@ -75,7 +75,7 @@ v = entropy( 2, 8 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = entropy( 0.1, 2 ); +let v = entropy( 0.1, 2 ); // returns NaN v = entropy( 0, 2.2 ); @@ -91,7 +91,7 @@ v = entropy( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var v = entropy( 3, 2 ); +let v = entropy( 3, 2 ); // returns NaN v = entropy( -1, -2 ); @@ -119,20 +119,16 @@ v = entropy( -1, -2 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var entropy = require( '@stdlib/stats/base/dists/discrete-uniform/entropy' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randa(); - b = randb( a, a+randa() ); - v = entropy( a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const entropy = require( '@stdlib/stats/base/dists/discrete-uniform/entropy' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const a = randa(); + const b = randb( a, a+randa() ); + const v = entropy( a, b ); console.log( 'a: %d, b: %d, H(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/kurtosis/README.md index fed3209c1f41..a9d855bbcea8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/kurtosis/README.md @@ -54,7 +54,7 @@ where `n = b - a + 1`. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/discrete-uniform/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/discrete-uniform/kurtosis' ); ``` #### kurtosis( a, b ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/discrete-uniform/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = kurtosis( 0, 1 ); +let v = kurtosis( 0, 1 ); // returns -2.0 v = kurtosis( 4, 12 ); @@ -75,7 +75,7 @@ v = kurtosis( 2, 8 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = kurtosis( 0.1, 2 ); +let v = kurtosis( 0.1, 2 ); // returns NaN v = kurtosis( 0, 2.2 ); @@ -91,7 +91,7 @@ v = kurtosis( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var v = kurtosis( 3, 2 ); +let v = kurtosis( 3, 2 ); // returns NaN v = kurtosis( -1, -2 ); @@ -119,20 +119,16 @@ v = kurtosis( -1, -2 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var kurtosis = require( '@stdlib/stats/base/dists/discrete-uniform/kurtosis' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randa(); - b = randb( a, a+randa() ); - v = kurtosis( a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const kurtosis = require( '@stdlib/stats/base/dists/discrete-uniform/kurtosis' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const a = randa(); + const b = randb( a, a+randa() ); + const v = kurtosis( a, b ); console.log( 'a: %d, b: %d, Kurt(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logcdf/README.md index dff609d5733b..779411bd8c8e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logcdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/discrete-uniform/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/discrete-uniform/logcdf' ); ``` #### logcdf( x, a, b ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/discrete-uniform/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logcdf( 9.0, 0, 10 ); +let y = logcdf( 9.0, 0, 10 ); // returns ~-0.095 y = logcdf( 0.5, -2, 2 ); @@ -74,21 +74,21 @@ y = logcdf( Infinity, 2, 4 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 1, 5.5 ); +const y = logcdf( 2.0, 1, 5.5 ); // returns NaN ``` If provided `a > b`, the function returns `NaN`. ```javascript -var y = logcdf( 0.5, 3, 2); +const y = logcdf( 0.5, 3, 2); // returns NaN ``` If provided `NaN` for any parameter, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0, 1 ); +let y = logcdf( NaN, 0, 1 ); // returns NaN y = logcdf( 0.0, NaN, 1 ); @@ -103,8 +103,8 @@ y = logcdf( 0.0, 0, NaN ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myLogCDF = logcdf.factory( 0, 10 ); -var y = myLogCDF( 0.5 ); +const myLogCDF = logcdf.factory( 0, 10 ); +let y = myLogCDF( 0.5 ); // returns ~-2.398 y = myLogCDF( 8.0 ); @@ -122,23 +122,18 @@ y = myLogCDF( 8.0 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/discrete-uniform/logcdf' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var x; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 15.0; - a = randa(); - b = randb( a, a+randa() ); - v = logcdf( x, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/discrete-uniform/logcdf' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 15.0; + const a = randa(); + const b = randb( a, a+randa() ); + const v = logcdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(F(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/README.md index 96776ac91cc0..011b7a23468d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/discrete-uniform/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/discrete-uniform/logpmf' ); ``` #### logpmf( x, a, b ) @@ -58,7 +58,7 @@ var logpmf = require( '@stdlib/stats/base/dists/discrete-uniform/logpmf' ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF) for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logpmf( 2.0, 0, 4 ); +let y = logpmf( 2.0, 0, 4 ); // returns ~-1.609 y = logpmf( 5.0, 0, 4 ); @@ -71,7 +71,7 @@ y = logpmf( 3, -4, 4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, -2, 2 ); +let y = logpmf( NaN, -2, 2 ); // returns NaN y = logpmf( 1.0, NaN, 4 ); @@ -84,14 +84,14 @@ y = logpmf( 2.0, 0, NaN ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 1, 5.5 ); +const y = logpmf( 2.0, 1, 5.5 ); // returns NaN ``` If provided `a > b`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 3, 2 ); +const y = logpmf( 2.0, 3, 2 ); // returns NaN ``` @@ -100,8 +100,8 @@ var y = logpmf( 2.0, 3, 2 ); Returns a `function` for evaluating the [PMF][pmf] for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myLogPMF = logpmf.factory( 6, 7 ); -var y = myLogPMF( 7.0 ); +const myLogPMF = logpmf.factory( 6, 7 ); +let y = myLogPMF( 7.0 ); // returns ~-0.693 y = myLogPMF( 5.0 ); @@ -119,22 +119,17 @@ y = myLogPMF( 5.0 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var logpmf = require( '@stdlib/stats/base/dists/discrete-uniform/logpmf' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - a = randa(); - x = randb( a, a+randa() ); - b = randb( a, a+randa() ); - y = logpmf( x, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const logpmf = require( '@stdlib/stats/base/dists/discrete-uniform/logpmf' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 25; i++ ) { + const a = randa(); + const x = randb( a, a+randa() ); + const b = randb( a, a+randa() ); + const y = logpmf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(P(X=x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mean/README.md index fed1633787de..ac25fbaf1e28 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mean/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/discrete-uniform/mean' ); +const mean = require( '@stdlib/stats/base/dists/discrete-uniform/mean' ); ``` #### mean( a, b ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/discrete-uniform/mean' ); Returns the [expected value][expected-value] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = mean( 0, 1 ); +let v = mean( 0, 1 ); // returns 0.5 v = mean( 4, 12 ); @@ -75,7 +75,7 @@ v = mean( 2, 8 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = mean( 0.1, 2 ); +let v = mean( 0.1, 2 ); // returns NaN v = mean( 0, 2.2 ); @@ -91,7 +91,7 @@ v = mean( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var y = mean( 3, 2 ); +let y = mean( 3, 2 ); // returns NaN y = mean( -1, -2 ); @@ -119,19 +119,14 @@ y = mean( -1, -2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/discrete-uniform/mean' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = round( randu()*10.0 ); - b = round( ( randu()*10.0 ) + a ); - v = mean( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/discrete-uniform/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const a = round( randu()*10.0 ); + const b = round( ( randu()*10.0 ) + a ); + const v = mean( a, b ); console.log( 'a: %d, b: %d, E(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/median/README.md index 60ef0b1888c3..60bc8d8b00bd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/median/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/discrete-uniform/median' ); +const median = require( '@stdlib/stats/base/dists/discrete-uniform/median' ); ``` #### median( a, b ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/discrete-uniform/median' ); Returns the [median][median] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = median( 0, 1 ); +let v = median( 0, 1 ); // returns 0.5 v = median( 4, 12 ); @@ -75,7 +75,7 @@ v = median( 2, 8 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = median( 0.1, 2 ); +let v = median( 0.1, 2 ); // returns NaN v = median( 0, 2.2 ); @@ -91,7 +91,7 @@ v = median( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var y = median( 3, 2 ); +let y = median( 3, 2 ); // returns NaN y = median( -1, -2 ); @@ -119,19 +119,14 @@ y = median( -1, -2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/discrete-uniform/median' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = round( randu()*10.0 ); - b = round( ( randu()*10.0 ) + a ); - v = median( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/discrete-uniform/median' ); + +for ( let i = 0; i < 10; i++ ) { + const a = round( randu()*10.0 ); + const b = round( ( randu()*10.0 ) + a ); + const v = median( a, b ); console.log( 'a: %d, b: %d, Median(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mgf/README.md index 3de8821c519d..7445fafd4c58 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/mgf/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/discrete-uniform/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/discrete-uniform/mgf' ); ``` #### mgf( t, a, b ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/discrete-uniform/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = mgf( 2.0, 0, 4 ); +let y = mgf( 2.0, 0, 4 ); // returns ~689.475 y = mgf( -0.2, 0, 4 ); @@ -75,21 +75,21 @@ y = mgf( 2.0, 0, 1 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 1, 5.5 ); +const y = mgf( 0.2, 1, 5.5 ); // returns NaN ``` If provided `a > b`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, 3, 2); +const y = mgf( 0.5, 3, 2); // returns NaN ``` If provided `NaN` for any parameter, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0, 1 ); +let y = mgf( NaN, 0, 1 ); // returns NaN y = mgf( 0.0, NaN, 1 ); @@ -104,8 +104,8 @@ y = mgf( 0.0, 0, NaN ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mymgf = mgf.factory( 6, 7 ); -var y = mymgf( 0.1 ); +const mymgf = mgf.factory( 6, 7 ); +let y = mymgf( 0.1 ); // returns ~1.918 y = mymgf( 1.1 ); @@ -133,23 +133,18 @@ y = mymgf( 1.1 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/discrete-uniform/mgf' ); - -var randa = randint.factory( 0, 5 ); -var randb = randint.factory(); -var a; -var b; -var t; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - a = randa(); - b = randb( a, a+randa() ); - v = mgf( t, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/discrete-uniform/mgf' ); + +const randa = randint.factory( 0, 5 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const a = randa(); + const b = randb( a, a+randa() ); + const v = mgf( t, a, b ); console.log( 't: %d, a: %d, b: %d, M_X(t;a,b): %d', t.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/pmf/README.md index 6edb6079ac93..55b0bdae40bf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/pmf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/discrete-uniform/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/discrete-uniform/pmf' ); ``` #### pmf( x, a, b ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/discrete-uniform/pmf' ); Evaluates the [probability mass function][pmf] (PMF) for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = pmf( 2.0, 0, 4 ); +let y = pmf( 2.0, 0, 4 ); // returns ~0.2 y = pmf( 5.0, 0, 4 ); @@ -71,7 +71,7 @@ y = pmf( 3, -4, 4 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, -2, 2 ); +let y = pmf( NaN, -2, 2 ); // returns NaN y = pmf( 1.0, NaN, 4 ); @@ -84,14 +84,14 @@ y = pmf( 2.0, 0, NaN ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 1, 5.5 ); +const y = pmf( 2.0, 1, 5.5 ); // returns NaN ``` If provided `a > b`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 3, 2 ); +const y = pmf( 2.0, 3, 2 ); // returns NaN ``` @@ -100,8 +100,8 @@ var y = pmf( 2.0, 3, 2 ); Returns a `function` for evaluating the [PMF][pmf] for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myPDF = pmf.factory( 6, 7 ); -var y = myPDF( 7.0 ); +const myPDF = pmf.factory( 6, 7 ); +let y = myPDF( 7.0 ); // returns 0.5 y = myPDF( 5.0 ); @@ -119,22 +119,17 @@ y = myPDF( 5.0 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var pmf = require( '@stdlib/stats/base/dists/discrete-uniform/pmf' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - a = randa(); - x = randb( a, a+randa() ); - b = randb( a, a+randa() ); - y = pmf( x, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const pmf = require( '@stdlib/stats/base/dists/discrete-uniform/pmf' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 25; i++ ) { + const a = randa(); + const x = randb( a, a+randa() ); + const b = randb( a, a+randa() ); + const y = pmf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, P(X=x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/quantile/README.md index 1f494f74af1b..76b5ced4e162 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `a` is the minimum support and `b` is the maximum suppo ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/discrete-uniform/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/discrete-uniform/quantile' ); ``` #### quantile( p, a, b ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/discrete-uniform/quantile' ); Evaluates the [quantile function][quantile-function] for a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = quantile( 0.8, 0, 1 ); +let y = quantile( 0.8, 0, 1 ); // returns 1 y = quantile( 0.5, 0, 10 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 0, 10 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0, 2 ); +let y = quantile( 1.9, 0, 2 ); // returns NaN y = quantile( -0.1, 0, 2 ); @@ -78,21 +78,21 @@ y = quantile( -0.1, 0, 2 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var y = quantile( 0.2, 1, 5.5 ); +const y = quantile( 0.2, 1, 5.5 ); // returns NaN ``` If provided `a > b`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 2, 1 ); +const y = quantile( 0.4, 2, 1 ); // returns NaN ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -107,8 +107,8 @@ y = quantile( 0.0, 0.0, NaN ); Returns a function for evaluating the quantile function of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myquantile = quantile.factory( 0, 4 ); -var y = myquantile( 0.8 ); +const myquantile = quantile.factory( 0, 4 ); +let y = myquantile( 0.8 ); // returns 4 y = myquantile( 0.3 ); @@ -126,23 +126,18 @@ y = myquantile( 0.3 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/discrete-uniform/quantile' ); - -var randa = randint.factory( 0, 5 ); -var randb = randint.factory(); -var a; -var b; -var p; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - a = randa(); - b = randb( a, a+randa() ); - v = quantile( p, a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/discrete-uniform/quantile' ); + +const randa = randint.factory( 0, 5 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const a = randa(); + const b = randb( a, a+randa() ); + const v = quantile( p, a, b ); console.log( 'p: %d, a: %d, b: %d, Q(p;a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/skewness/README.md index 1eefe6d4df60..d06ff41db4be 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [discrete uniform][discrete-uniform-distribution] ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/discrete-uniform/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/discrete-uniform/skewness' ); ``` #### skewness( a, b ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/discrete-uniform/skewness' ); Returns the [skewness][skewness] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = skewness( 0, 1 ); +let v = skewness( 0, 1 ); // returns 0.0 v = skewness( 4, 12 ); @@ -73,7 +73,7 @@ v = skewness( 2, 8 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = skewness( 0.1, 2 ); +let v = skewness( 0.1, 2 ); // returns NaN v = skewness( 0, 2.2 ); @@ -89,7 +89,7 @@ v = skewness( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var y = skewness( 3, 2 ); +let y = skewness( 3, 2 ); // returns NaN y = skewness( -1, -2 ); @@ -117,20 +117,16 @@ y = skewness( -1, -2 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var skewness = require( '@stdlib/stats/base/dists/discrete-uniform/skewness' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randa(); - b = randb( a, a+randa() ); - v = skewness( a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const skewness = require( '@stdlib/stats/base/dists/discrete-uniform/skewness' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const a = randa(); + const b = randb( a, a+randa() ); + const v = skewness( a, b ); console.log( 'a: %d, b: %d, skew(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/stdev/README.md index 6e0c1c7a11e2..a128deb4324b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/stdev/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/discrete-uniform/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/discrete-uniform/stdev' ); ``` #### stdev( a, b ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/discrete-uniform/stdev' ); Returns the [standard deviation][standard-deviation] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = stdev( 0, 1 ); +let v = stdev( 0, 1 ); // returns ~0.5 v = stdev( 4, 12 ); @@ -75,7 +75,7 @@ v = stdev( -4, 4 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = stdev( 0.1, 2 ); +let v = stdev( 0.1, 2 ); // returns NaN v = stdev( 0, 2.2 ); @@ -91,7 +91,7 @@ v = stdev( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var v = stdev( 3, 2 ); +let v = stdev( 3, 2 ); // returns NaN v = stdev( -1, -2 ); @@ -119,20 +119,16 @@ v = stdev( -1, -2 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var stdev = require( '@stdlib/stats/base/dists/discrete-uniform/stdev' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randa(); - b = randb( a, a+randa() ); - v = stdev( a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const stdev = require( '@stdlib/stats/base/dists/discrete-uniform/stdev' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const a = randa(); + const b = randb( a, a+randa() ); + const v = stdev( a, b ); console.log( 'a: %d, b: %d, SD(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/variance/README.md index 2a29cb6ace89..50b84dedc541 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/variance/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/discrete-uniform/variance' ); +const variance = require( '@stdlib/stats/base/dists/discrete-uniform/variance' ); ``` #### variance( a, b ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/discrete-uniform/variance' ); Returns the [variance][variance] of a [discrete uniform][discrete-uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = variance( 0, 1 ); +let v = variance( 0, 1 ); // returns ~0.25 v = variance( 4, 12 ); @@ -75,7 +75,7 @@ v = variance( -4, 4 ); If `a` or `b` is not an integer value, the function returns `NaN`. ```javascript -var v = variance( 0.1, 2 ); +let v = variance( 0.1, 2 ); // returns NaN v = variance( 0, 2.2 ); @@ -91,7 +91,7 @@ v = variance( 2, NaN ); If provided `a > b`, the function returns `NaN`. ```javascript -var v = variance( 3, 2 ); +let v = variance( 3, 2 ); // returns NaN v = variance( -1, -2 ); @@ -119,20 +119,16 @@ v = variance( -1, -2 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var variance = require( '@stdlib/stats/base/dists/discrete-uniform/variance' ); - -var randa = randint.factory( 0, 10 ); -var randb = randint.factory(); -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randa(); - b = randb( a, a+randa() ); - v = variance( a, b ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const variance = require( '@stdlib/stats/base/dists/discrete-uniform/variance' ); + +const randa = randint.factory( 0, 10 ); +const randb = randint.factory(); + +for ( let i = 0; i < 10; i++ ) { + const a = randa(); + const b = randb( a, a+randa() ); + const v = variance( a, b ); console.log( 'a: %d, b: %d, Var(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/README.md index 8158985ec460..303c976a8637 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var erlang = require( '@stdlib/stats/base/dists/erlang' ); +const erlang = require( '@stdlib/stats/base/dists/erlang' ); ``` #### erlang @@ -35,7 +35,7 @@ var erlang = require( '@stdlib/stats/base/dists/erlang' ); Erlang distribution. ```javascript -var dist = erlang; +const dist = erlang; // returns {...} ``` @@ -86,11 +86,11 @@ The namespace contains a constructor function for creating an [Erlang][erlang-di ```javascript -var Erlang = require( '@stdlib/stats/base/dists/erlang' ).Erlang; +const Erlang = require( '@stdlib/stats/base/dists/erlang' ).Erlang; -var dist = new Erlang( 2, 4.0 ); +const dist = new Erlang( 2, 4.0 ); -var y = dist.logpdf( 0.8 ); +const y = dist.logpdf( 0.8 ); // returns ~-0.65 ``` @@ -107,8 +107,8 @@ var y = dist.logpdf( 0.8 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var erlang = require( '@stdlib/stats/base/dists/erlang' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const erlang = require( '@stdlib/stats/base/dists/erlang' ); console.log( objectKeys( erlang ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/cdf/README.md index 8feb83f862cc..9cc33ed6c779 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/cdf/README.md @@ -50,7 +50,7 @@ where `k` is the shape parameter and `lambda` is the rate parameter. The [Erlang ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/erlang/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/erlang/cdf' ); ``` #### cdf( x, k, lambda ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/erlang/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var y = cdf( 2.0, 1, 1.0 ); +let y = cdf( 2.0, 1, 1.0 ); // returns ~0.865 y = cdf( 2.0, 3, 1.0 ); @@ -77,7 +77,7 @@ y = cdf( +Infinity, 4, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1, 1.0 ); +let y = cdf( NaN, 1, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -90,7 +90,7 @@ y = cdf( 0.0, 1, NaN ); If not provided a nonnegative integer for `k`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -2, 0.5 ); +let y = cdf( 2.0, -2, 0.5 ); // returns NaN y = cdf( 2.0, 0.5, 0.5 ); @@ -100,7 +100,7 @@ y = cdf( 2.0, 0.5, 0.5 ); If provided `k = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( 2.0, 0.0, 2.0 ); +let y = cdf( 2.0, 0.0, 2.0 ); // returns 1.0 y = cdf( -2.0, 0.0, 2.0 ); @@ -113,7 +113,7 @@ y = cdf( 0.0, 0.0, 2.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 1, 0.0 ); +let y = cdf( 2.0, 1, 0.0 ); // returns NaN y = cdf( 2.0, 1, -5.0 ); @@ -125,9 +125,9 @@ y = cdf( 2.0, 1, -5.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var mycdf = cdf.factory( 2, 0.5 ); +const mycdf = cdf.factory( 2, 0.5 ); -var y = mycdf( 6.0 ); +let y = mycdf( 6.0 ); // returns ~0.801 y = mycdf( 2.0 ); @@ -145,21 +145,15 @@ y = mycdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/erlang/cdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = round( randu() * 10.0 ); - lambda = randu() * 5.0; - y = cdf( x, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/erlang/cdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = round( randu() * 10.0 ); + const lambda = randu() * 5.0; + const y = cdf( x, k, lambda ); console.log( 'x: %d, k: %d, λ: %d, F(x;k,λ): %d', x.toFixed( 4 ), k, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/ctor/README.md index 9804b525eee1..b98366f1f961 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Erlang = require( '@stdlib/stats/base/dists/erlang/ctor' ); +const Erlang = require( '@stdlib/stats/base/dists/erlang/ctor' ); ``` #### Erlang( \[k, lambda] ) @@ -45,18 +45,18 @@ var Erlang = require( '@stdlib/stats/base/dists/erlang/ctor' ); Returns an [Erlang][erlang-distribution] distribution object. ```javascript -var erlang = new Erlang(); +const erlang = new Erlang(); -var mode = erlang.mode; +const mode = erlang.mode; // returns 0.0 ``` By default, `k = 1.0` and `lambda = 1.0`. To create a distribution having a different `k` (shape parameter) and `lambda` (rate parameter), provide the corresponding arguments. ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var mode = erlang.mode; +const mode = erlang.mode; // returns 0.25 ``` @@ -73,9 +73,9 @@ An [Erlang][erlang-distribution] distribution object has the following propertie Shape parameter of the distribution. `k` **must** be a positive integer. ```javascript -var erlang = new Erlang(); +const erlang = new Erlang(); -var k = erlang.k; +let k = erlang.k; // returns 1.0 erlang.k = 3.0; @@ -89,9 +89,9 @@ k = erlang.k; Rate parameter of the distribution. `lambda` **must** be a positive number. ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var lambda = erlang.lambda; +let lambda = erlang.lambda; // returns 4.0 erlang.lambda = 3.0; @@ -109,9 +109,9 @@ lambda = erlang.lambda; Returns the [differential entropy][entropy]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var entropy = erlang.entropy; +const entropy = erlang.entropy; // returns ~-0.462 ``` @@ -120,9 +120,9 @@ var entropy = erlang.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var kurtosis = erlang.kurtosis; +const kurtosis = erlang.kurtosis; // returns 1.5 ``` @@ -131,9 +131,9 @@ var kurtosis = erlang.kurtosis; Returns the [expected value][expected-value]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var mu = erlang.mean; +const mu = erlang.mean; // returns ~0.333 ``` @@ -142,9 +142,9 @@ var mu = erlang.mean; Returns the [mode][mode]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var mode = erlang.mode; +const mode = erlang.mode; // returns 0.25 ``` @@ -153,9 +153,9 @@ var mode = erlang.mode; Returns the [skewness][skewness]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var skewness = erlang.skewness; +const skewness = erlang.skewness; // returns 1.0 ``` @@ -164,9 +164,9 @@ var skewness = erlang.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var s = erlang.stdev; +const s = erlang.stdev; // returns ~0.167 ``` @@ -175,9 +175,9 @@ var s = erlang.stdev; Returns the [variance][variance]. ```javascript -var erlang = new Erlang( 4, 12.0 ); +const erlang = new Erlang( 4, 12.0 ); -var s2 = erlang.variance; +const s2 = erlang.variance; // returns ~0.028 ``` @@ -190,9 +190,9 @@ var s2 = erlang.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var y = erlang.cdf( 0.5 ); +const y = erlang.cdf( 0.5 ); // returns ~0.594 ``` @@ -201,9 +201,9 @@ var y = erlang.cdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var y = erlang.logpdf( 0.8 ); +const y = erlang.logpdf( 0.8 ); // returns ~-0.65 ``` @@ -212,9 +212,9 @@ var y = erlang.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var y = erlang.mgf( 0.5 ); +const y = erlang.mgf( 0.5 ); // returns ~1.306 ``` @@ -223,9 +223,9 @@ var y = erlang.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var y = erlang.pdf( 0.8 ); +const y = erlang.pdf( 0.8 ); // returns ~0.522 ``` @@ -234,9 +234,9 @@ var y = erlang.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var y = erlang.quantile( 0.5 ); +let y = erlang.quantile( 0.5 ); // returns ~0.42 y = erlang.quantile( 1.9 ); @@ -266,20 +266,20 @@ y = erlang.quantile( 1.9 ); ```javascript -var Erlang = require( '@stdlib/stats/base/dists/erlang/ctor' ); +const Erlang = require( '@stdlib/stats/base/dists/erlang/ctor' ); -var erlang = new Erlang( 2, 4.0 ); +const erlang = new Erlang( 2, 4.0 ); -var mu = erlang.mean; +const mu = erlang.mean; // returns 0.5 -var mode = erlang.mode; +const mode = erlang.mode; // returns 0.25 -var s2 = erlang.variance; +const s2 = erlang.variance; // returns 0.125 -var y = erlang.cdf( 0.8 ); +const y = erlang.cdf( 0.8 ); // returns ~0.829 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/entropy/README.md index 103ed54ade2c..49bf915201d9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/entropy/README.md @@ -54,7 +54,7 @@ where `Γ` and `Ψ` denote the [gamma][gamma-function] and [digamma][digamma] fu ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/erlang/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/erlang/entropy' ); ``` #### entropy( k, lambda ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/erlang/entropy' ); Returns the [differential entropy][entropy] of an [Erlang][erlang-distribution] distribution with parameters shape `k` and rate `lambda` (in [nats][nats]). ```javascript -var v = entropy( 1, 1.0 ); +let v = entropy( 1, 1.0 ); // returns 1.0 v = entropy( 4, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = entropy( 1.8, 1.0 ); +let v = entropy( 1.8, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 2, 0.0 ); +let v = entropy( 2, 0.0 ); // returns NaN v = entropy( 2, -1.0 ); @@ -123,20 +123,15 @@ v = entropy( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/erlang/entropy' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = entropy( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/erlang/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = entropy( k, lambda ); console.log( 'k: %d, λ: %d, h(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/README.md index eba35207fc33..2dda24d55144 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for an [Erlang][erlang-distribution] random vari ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/erlang/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/erlang/kurtosis' ); ``` #### kurtosis( k, lambda ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/erlang/kurtosis' ); Returns the [excess kurtosis][kurtosis] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = kurtosis( 1, 1.0 ); +let v = kurtosis( 1, 1.0 ); // returns 6.0 v = kurtosis( 4, 12.0 ); @@ -73,7 +73,7 @@ v = kurtosis( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -83,7 +83,7 @@ v = kurtosis( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.8, 1.0 ); +let v = kurtosis( 1.8, 1.0 ); // returns NaN v = kurtosis( -1.0, 1.0 ); @@ -93,7 +93,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 2, 0.0 ); +let v = kurtosis( 2, 0.0 ); // returns NaN v = kurtosis( 2, -1.0 ); @@ -121,20 +121,15 @@ v = kurtosis( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/erlang/kurtosis' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = kurtosis( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/erlang/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = kurtosis( k, lambda ); console.log( 'k: %d, λ: %d, Kurt(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/logpdf/README.md index 57e01f7973af..66f47b7cc9df 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/logpdf/README.md @@ -50,7 +50,7 @@ where `k` is the shape parameter and `lambda` is the rate parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/erlang/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/erlang/logpdf' ); ``` #### logpdf( x, k, lambda ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/erlang/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var y = logpdf( 0.1, 1, 1.0 ); +let y = logpdf( 0.1, 1, 1.0 ); // returns ~-0.1 y = logpdf( 0.5, 2, 2.5 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 4, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1, 1.0 ); +let y = logpdf( NaN, 1, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 1, NaN ); If not provided a nonnegative integer for `k`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -2, 0.5 ); +let y = logpdf( 2.0, -2, 0.5 ); // returns NaN y = logpdf( 2.0, 0.5, 0.5 ); @@ -94,7 +94,7 @@ y = logpdf( 2.0, 0.5, 0.5 ); If provided `k = 0`, the function evaluates the logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logpdf( 2.0, 0.0, 2.0 ); +let y = logpdf( 2.0, 0.0, 2.0 ); // returns -Infinity y = logpdf( 0.0, 0.0, 2.0 ); @@ -104,7 +104,7 @@ y = logpdf( 0.0, 0.0, 2.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 1, 0.0 ); +let y = logpdf( 2.0, 1, 0.0 ); // returns NaN y = logpdf( 2.0, 1, -1.0 ); @@ -116,9 +116,9 @@ y = logpdf( 2.0, 1, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var mylogpdf = logpdf.factory( 3, 1.5 ); +const mylogpdf = logpdf.factory( 3, 1.5 ); -var y = mylogpdf( 1.0 ); +let y = mylogpdf( 1.0 ); // returns ~-0.977 y = mylogpdf( 4.0 ); @@ -136,21 +136,15 @@ y = mylogpdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpdf = require( '@stdlib/stats/base/dists/erlang/logpdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = round( randu() * 10.0 ); - lambda = randu() * 5.0; - y = logpdf( x, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpdf = require( '@stdlib/stats/base/dists/erlang/logpdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = round( randu() * 10.0 ); + const lambda = randu() * 5.0; + const y = logpdf( x, k, lambda ); console.log( 'x: %d, k: %d, λ: %d, ln(f(x;k,λ)): %d', x.toFixed( 4 ), k, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/mean/README.md index fcc4859255f1..3e0c3db2dbd0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/mean/README.md @@ -54,7 +54,7 @@ where `k` is the shape parameter and `λ` is the rate parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/erlang/mean' ); +const mean = require( '@stdlib/stats/base/dists/erlang/mean' ); ``` #### mean( k, lambda ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/erlang/mean' ); Returns the [expected value][expected-value] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = mean( 1, 1.0 ); +let v = mean( 1, 1.0 ); // returns 1.0 v = mean( 4, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = mean( 1.8, 1.0 ); +let v = mean( 1.8, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mean( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = mean( 2, 0.0 ); +let v = mean( 2, 0.0 ); // returns NaN v = mean( 2, -1.0 ); @@ -123,20 +123,15 @@ v = mean( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/erlang/mean' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = mean( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/erlang/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = mean( k, lambda ); console.log( 'k: %d, λ: %d, E(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/mgf/README.md index f89e0dca8782..f3ba64d94899 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/mgf/README.md @@ -54,7 +54,7 @@ for `t < lambda`, where the nonnegative integer `k` is the shape parameter and ` ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/erlang/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/erlang/mgf' ); ``` #### mgf( t, k, lambda ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/erlang/mgf' ); Evaluates the [moment-generating function][mgf] (mgf) for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var y = mgf( 0.3, 1, 1.0 ); +let y = mgf( 0.3, 1, 1.0 ); // returns ~1.429 y = mgf( 2.0, 2, 3.0 ); @@ -75,7 +75,7 @@ y = mgf( -1.0, 2, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1, 1.0 ); +let y = mgf( NaN, 1, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,7 +88,7 @@ y = mgf( 0.0, 1, NaN ); If not provided a nonnegative integer for `k`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, -2, 0.5 ); +let y = mgf( 0.2, -2, 0.5 ); // returns NaN y = mgf( 0.2, 0.5, 0.5 ); @@ -98,7 +98,7 @@ y = mgf( 0.2, 0.5, 0.5 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 1, 0.0 ); +let y = mgf( 0.2, 1, 0.0 ); // returns NaN y = mgf( 0.2, 1, -5.0 ); @@ -110,9 +110,9 @@ y = mgf( 0.2, 1, -5.0 ); Returns a function for evaluating the [moment-generating function][mgf] for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var myMGF = mgf.factory( 2, 0.5 ); +const myMGF = mgf.factory( 2, 0.5 ); -var y = myMGF( 0.2 ); +let y = myMGF( 0.2 ); // returns ~2.778 y = myMGF( -0.5 ); @@ -140,21 +140,15 @@ y = myMGF( -0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mgf = require( '@stdlib/stats/base/dists/erlang/mgf' ); - -var lambda; -var k; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu() * 10.0 ); - lambda = randu() * 10.0; - t = randu() * lambda; - y = mgf( t, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mgf = require( '@stdlib/stats/base/dists/erlang/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu() * 10.0 ); + const lambda = randu() * 10.0; + const t = randu() * lambda; + const y = mgf( t, k, lambda ); console.log( 't: %d, k: %d, λ: %d, M_X(t;k,λ): %d', t.toFixed( 4 ), k, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/mode/README.md index 5b70c7fbf6fd..e737569b58aa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/mode/README.md @@ -54,7 +54,7 @@ where `k` is the shape parameter and `λ` is the rate parameter. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/erlang/mode' ); +const mode = require( '@stdlib/stats/base/dists/erlang/mode' ); ``` #### mode( k, lambda ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/erlang/mode' ); Returns the [mode][mode] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = mode( 1, 1.0 ); +let v = mode( 1, 1.0 ); // returns 0.0 v = mode( 4, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = mode( 1.8, 1.0 ); +let v = mode( 1.8, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = mode( 2, 0.0 ); +let v = mode( 2, 0.0 ); // returns NaN v = mode( 2, -1.0 ); @@ -123,20 +123,15 @@ v = mode( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/erlang/mode' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = mode( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/erlang/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = mode( k, lambda ); console.log( 'k: %d, λ: %d, mode(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/pdf/README.md index aa9428c1512d..0d490ee1d8ba 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/pdf/README.md @@ -50,7 +50,7 @@ where `k` is the shape parameter and `lambda` is the rate parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/erlang/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/erlang/pdf' ); ``` #### pdf( x, k, lambda ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/erlang/pdf' ); Evaluates the [probability density function][pdf] (PDF) for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var y = pdf( 0.1, 1, 1.0 ); +let y = pdf( 0.1, 1, 1.0 ); // returns ~0.905 y = pdf( 0.5, 2, 2.5 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1, 1.0 ); +let y = pdf( NaN, 1, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 1, NaN ); If not provided a nonnegative integer for `k`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -2, 0.5 ); +let y = pdf( 2.0, -2, 0.5 ); // returns NaN y = pdf( 2.0, 0.5, 0.5 ); @@ -94,7 +94,7 @@ y = pdf( 2.0, 0.5, 0.5 ); If provided `k = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = pdf( 2.0, 0.0, 2.0 ); +let y = pdf( 2.0, 0.0, 2.0 ); // returns 0.0 y = pdf( 0.0, 0.0, 2.0 ); @@ -104,7 +104,7 @@ y = pdf( 0.0, 0.0, 2.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1, 0.0 ); +let y = pdf( 2.0, 1, 0.0 ); // returns NaN y = pdf( 2.0, 1, -1.0 ); @@ -116,9 +116,9 @@ y = pdf( 2.0, 1, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var mypdf = pdf.factory( 3, 1.5 ); +const mypdf = pdf.factory( 3, 1.5 ); -var y = mypdf( 1.0 ); +let y = mypdf( 1.0 ); // returns ~0.377 y = mypdf( 4.0 ); @@ -136,21 +136,15 @@ y = mypdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pdf = require( '@stdlib/stats/base/dists/erlang/pdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - x = randu() * 10.0; - k = round( randu() * 10.0 ); - lambda = randu() * 5.0; - y = pdf( x, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pdf = require( '@stdlib/stats/base/dists/erlang/pdf' ); + +for ( let i = 0; i < 20; i++ ) { + const x = randu() * 10.0; + const k = round( randu() * 10.0 ); + const lambda = randu() * 5.0; + const y = pdf( x, k, lambda ); console.log( 'x: %d, k: %d, λ: %d, f(x;k,λ): %d', x.toFixed( 4 ), k, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/quantile/README.md index 0f0cf713b43a..d3e88cce4f41 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `k` is the shape parameter and `lambda` is the rate para ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/erlang/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/erlang/quantile' ); ``` #### quantile( p, k, lambda ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/erlang/quantile' ); Evaluates the [quantile function][quantile-function] for an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var y = quantile( 0.8, 2, 1.0 ); +let y = quantile( 0.8, 2, 1.0 ); // returns ~2.994 y = quantile( 0.5, 4, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1, 1.0 ); +let y = quantile( 1.9, 1, 1.0 ); // returns NaN y = quantile( -0.1, 1, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1, 1.0 ); +let y = quantile( NaN, 1, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 1, NaN ); If provided a `k` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1, 1.0 ); +let y = quantile( 0.4, -1, 1.0 ); // returns NaN y = quantile( 0.4, 2.5, 1.0 ); @@ -101,7 +101,7 @@ y = quantile( 0.4, 2.5, 1.0 ); If provided `k = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = quantile( 0.3, 0, 2.0 ); +let y = quantile( 0.3, 0, 2.0 ); // returns 0.0 y = quantile( 0.9, 0, 2.0 ); @@ -111,7 +111,7 @@ y = quantile( 0.9, 0, 2.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1, -1.0 ); +const y = quantile( 0.4, 1, -1.0 ); // returns NaN ``` @@ -120,8 +120,8 @@ var y = quantile( 0.4, 1, -1.0 ); Returns a function for evaluating the [quantile function][quantile-function] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var myquantile = quantile.factory( 2, 2.0 ); -var y = myquantile( 0.8 ); +const myquantile = quantile.factory( 2, 2.0 ); +let y = myquantile( 0.8 ); // returns ~1.497 y = myquantile( 0.4 ); @@ -139,21 +139,15 @@ y = myquantile( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var quantile = require( '@stdlib/stats/base/dists/erlang/quantile' ); - -var lambda; -var k; -var p; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - p = randu(); - k = round( randu() * 10.0 ); - lambda = randu() * 5.0; - y = quantile( p, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const quantile = require( '@stdlib/stats/base/dists/erlang/quantile' ); + +for ( let i = 0; i < 20; i++ ) { + const p = randu(); + const k = round( randu() * 10.0 ); + const lambda = randu() * 5.0; + const y = quantile( p, k, lambda ); console.log( 'p: %d, k: %d, λ: %d, Q(p;k,λ): %d', p.toFixed( 4 ), k, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/README.md index 8bfb7018c901..de8de1e2d4c4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for an [Erlang][erlang-distribution] random variable wi ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/erlang/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/erlang/skewness' ); ``` #### skewness( k, lambda ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/erlang/skewness' ); Returns the [skewness][skewness] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = skewness( 1, 1.0 ); +let v = skewness( 1, 1.0 ); // returns 2.0 v = skewness( 4, 12.0 ); @@ -73,7 +73,7 @@ v = skewness( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -83,7 +83,7 @@ v = skewness( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = skewness( 1.8, 1.0 ); +let v = skewness( 1.8, 1.0 ); // returns NaN v = skewness( -1.0, 1.0 ); @@ -93,7 +93,7 @@ v = skewness( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 2, 0.0 ); +let v = skewness( 2, 0.0 ); // returns NaN v = skewness( 2, -1.0 ); @@ -121,20 +121,15 @@ v = skewness( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/erlang/skewness' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = skewness( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/erlang/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = skewness( k, lambda ); console.log( 'k: %d, λ: %d, skew(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/stdev/README.md index eb577dada4bb..a3ff57dc073f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/stdev/README.md @@ -54,7 +54,7 @@ where `k` is the shape parameter and `λ` is the rate parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/erlang/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/erlang/stdev' ); ``` #### stdev( k, lambda ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/erlang/stdev' ); Returns the [standard deviation][standard-deviation] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = stdev( 1, 1.0 ); +let v = stdev( 1, 1.0 ); // returns 1.0 v = stdev( 4, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = stdev( 1.8, 1.0 ); +let v = stdev( 1.8, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 2, 0.0 ); +let v = stdev( 2, 0.0 ); // returns NaN v = stdev( 2, -1.0 ); @@ -123,20 +123,15 @@ v = stdev( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/erlang/stdev' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = stdev( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/erlang/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = stdev( k, lambda ); console.log( 'k: %d, λ: %d, SD(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/erlang/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/erlang/variance/README.md index 9d46bbf5c726..a520ec43c288 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/erlang/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/erlang/variance/README.md @@ -54,7 +54,7 @@ where `k` is the shape parameter and `λ` is the rate parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/erlang/variance' ); +const variance = require( '@stdlib/stats/base/dists/erlang/variance' ); ``` #### variance( k, lambda ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/erlang/variance' ); Returns the [variance][variance] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter). ```javascript -var v = variance( 1, 1.0 ); +let v = variance( 1, 1.0 ); // returns 1.0 v = variance( 4, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If not provided a positive integer for `k`, the function returns `NaN`. ```javascript -var v = variance( 1.8, 1.0 ); +let v = variance( 1.8, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = variance( 2, 0.0 ); +let v = variance( 2, 0.0 ); // returns NaN v = variance( 2, -1.0 ); @@ -123,20 +123,15 @@ v = variance( 2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/erlang/variance' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = round( randu()*10.0 ); - lambda = ( randu()*10.0 ) + EPS; - v = variance( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/erlang/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const k = round( randu()*10.0 ); + const lambda = ( randu()*10.0 ) + EPS; + const v = variance( k, lambda ); console.log( 'k: %d, λ: %d, Var(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/README.md index 5161e75cbd40..e080ec4605b4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var exponential = require( '@stdlib/stats/base/dists/exponential' ); +const exponential = require( '@stdlib/stats/base/dists/exponential' ); ``` #### exponential @@ -35,7 +35,7 @@ var exponential = require( '@stdlib/stats/base/dists/exponential' ); Exponential distribution. ```javascript -var dist = exponential; +const dist = exponential; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating an [exponential][expo ```javascript -var Exponential = require( '@stdlib/stats/base/dists/exponential' ).Exponential; +const Exponential = require( '@stdlib/stats/base/dists/exponential' ).Exponential; -var dist = new Exponential( 2.0 ); +const dist = new Exponential( 2.0 ); -var y = dist.logpdf( 0.8 ); +const y = dist.logpdf( 0.8 ); // returns ~-0.907 ``` @@ -109,17 +109,17 @@ var y = dist.logpdf( 0.8 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var randomExponential = require( '@stdlib/random/array/exponential' ); -var dcusum = require( '@stdlib/blas/ext/base/dcusum' ); -var exponential = require( '@stdlib/stats/base/dists/exponential' ); +const Float64Array = require( '@stdlib/array/float64' ); +const randomExponential = require( '@stdlib/random/array/exponential' ); +const dcusum = require( '@stdlib/blas/ext/base/dcusum' ); +const exponential = require( '@stdlib/stats/base/dists/exponential' ); // Simulate interarrival times of customers entering a store: -var lambda = 0.5; // Average rate (customers per minute) -var numCustomers = 10; +const lambda = 0.5; // Average rate (customers per minute) +const numCustomers = 10; // Generate interarrival times using the exponential distribution: -var interarrivalTimes = randomExponential( numCustomers, lambda, { +const interarrivalTimes = randomExponential( numCustomers, lambda, { 'dtype': 'float64' }); @@ -127,28 +127,28 @@ console.log( 'Simulated interarrival times for ' + numCustomers + ' customers: ' console.log( interarrivalTimes ); // Calculate cumulative arrival times by computing the cumulative sum of interarrival times: -var arrivalTimes = new Float64Array( interarrivalTimes.length ); +const arrivalTimes = new Float64Array( interarrivalTimes.length ); dcusum( interarrivalTimes.length, 0.0, interarrivalTimes, 1, arrivalTimes, 1 ); console.log( '\nCustomer arrival times: ' ); console.log( arrivalTimes ); // Probability that a customer arrives within two minutes: -var x = 2.0; -var prob = exponential.cdf( x, lambda ); +const x = 2.0; +const prob = exponential.cdf( x, lambda ); console.log( '\nProbability that a customer arrives within ' + x + ' minutes: ' + prob.toFixed(4) ); // Expected time until the next customer arrives: -var mean = exponential.mean( lambda ); +const mean = exponential.mean( lambda ); console.log( 'Expected interarrival time: ' + mean + ' minutes' ); -var dist = new exponential.Exponential( lambda ); +const dist = new exponential.Exponential( lambda ); -var median = dist.median; +const median = dist.median; console.log( 'Median interarrival time: ' + median + ' minutes' ); // Evaluate the PDF at x = 1.0: -var out = dist.pdf( 1.0 ); +let out = dist.pdf( 1.0 ); console.log( 'PDF at x = 1: ' + out.toFixed(4) ); // Evaluate the MGF at t = 0.1: diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/cdf/README.md index 64820db1a458..8e516750b296 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/cdf/README.md @@ -50,7 +50,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/exponential/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/exponential/cdf' ); ``` #### cdf( x, lambda ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/exponential/cdf' ); Evaluates the [cumulative distribution function][cdf] for an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var y = cdf( 2.0, 0.3 ); +let y = cdf( 2.0, 0.3 ); // returns ~0.451 y = cdf( 10.0, 0.3 ); @@ -68,7 +68,7 @@ y = cdf( 10.0, 0.3 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0 ); +let y = cdf( NaN, 0.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = cdf( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +const y = cdf( 2.0, -1.0 ); // returns NaN ``` @@ -87,9 +87,9 @@ var y = cdf( 2.0, -1.0 ); Returns a function for evaluating the [cumulative distribution function (CDF)][cdf] for an exponential distribution with rate parameter `lambda`. ```javascript -var mycdf = cdf.factory( 0.1 ); +const mycdf = cdf.factory( 0.1 ); -var y = mycdf( 8.0 ); +let y = mycdf( 8.0 ); // returns ~0.551 y = mycdf( 2.0 ); @@ -110,18 +110,13 @@ y = mycdf( 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/exponential/cdf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - y = cdf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/exponential/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const y = cdf( x, lambda ); console.log( 'x: %d, λ: %d, F(x;λ): %d', x, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/ctor/README.md index fdacdcf621c1..57339af2f372 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Exponential = require( '@stdlib/stats/base/dists/exponential/ctor' ); +const Exponential = require( '@stdlib/stats/base/dists/exponential/ctor' ); ``` #### Exponential( \[lambda] ) @@ -45,18 +45,18 @@ var Exponential = require( '@stdlib/stats/base/dists/exponential/ctor' ); Returns an [exponential][exponential-distribution] distribution object. ```javascript -var exponential = new Exponential(); +const exponential = new Exponential(); -var mu = exponential.mean; +const mu = exponential.mean; // returns 1.0 ``` By default, `lambda = 1.0`. To create a distribution having a different rate parameter `lambda`, provide a parameter value. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var mu = exponential.mean; +const mu = exponential.mean; // returns 0.25 ``` @@ -73,9 +73,9 @@ An [exponential][exponential-distribution] distribution object has the following Rate parameter of the distribution. `lambda` **must** be a positive number. ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var lambda = exponential.lambda; +let lambda = exponential.lambda; // returns 2.0 exponential.lambda = 3.0; @@ -93,9 +93,9 @@ lambda = exponential.lambda; Returns the [differential entropy][entropy]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var entropy = exponential.entropy; +const entropy = exponential.entropy; // returns ~-0.386 ``` @@ -104,9 +104,9 @@ var entropy = exponential.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var kurtosis = exponential.kurtosis; +const kurtosis = exponential.kurtosis; // returns 6.0 ``` @@ -115,9 +115,9 @@ var kurtosis = exponential.kurtosis; Returns the [expected value][expected-value]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var mu = exponential.mean; +const mu = exponential.mean; // returns 0.25 ``` @@ -126,9 +126,9 @@ var mu = exponential.mean; Returns the [median][median]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var median = exponential.median; +const median = exponential.median; // returns ~0.173 ``` @@ -137,9 +137,9 @@ var median = exponential.median; Returns the [mode][mode]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var mode = exponential.mode; +const mode = exponential.mode; // returns 0.0 ``` @@ -148,9 +148,9 @@ var mode = exponential.mode; Returns the [skewness][skewness]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var skewness = exponential.skewness; +const skewness = exponential.skewness; // returns 2.0 ``` @@ -159,9 +159,9 @@ var skewness = exponential.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var s = exponential.stdev; +const s = exponential.stdev; // returns 0.25 ``` @@ -170,9 +170,9 @@ var s = exponential.stdev; Returns the [variance][variance]. ```javascript -var exponential = new Exponential( 4.0 ); +const exponential = new Exponential( 4.0 ); -var s2 = exponential.variance; +const s2 = exponential.variance; // returns ~0.063 ``` @@ -185,9 +185,9 @@ var s2 = exponential.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.cdf( 0.5 ); +const y = exponential.cdf( 0.5 ); // returns ~0.632 ``` @@ -196,9 +196,9 @@ var y = exponential.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.logcdf( 0.5 ); +const y = exponential.logcdf( 0.5 ); // returns ~-0.459 ``` @@ -207,9 +207,9 @@ var y = exponential.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.logpdf( 0.8 ); +const y = exponential.logpdf( 0.8 ); // returns ~-0.907 ``` @@ -218,9 +218,9 @@ var y = exponential.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.mgf( 0.5 ); +const y = exponential.mgf( 0.5 ); // returns ~1.333 ``` @@ -229,9 +229,9 @@ var y = exponential.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.pdf( 0.8 ); +const y = exponential.pdf( 0.8 ); // returns ~0.404 ``` @@ -240,9 +240,9 @@ var y = exponential.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var y = exponential.quantile( 0.5 ); +let y = exponential.quantile( 0.5 ); // returns ~0.347 y = exponential.quantile( 1.9 ); @@ -272,20 +272,20 @@ y = exponential.quantile( 1.9 ); ```javascript -var Exponential = require( '@stdlib/stats/base/dists/exponential/ctor' ); +const Exponential = require( '@stdlib/stats/base/dists/exponential/ctor' ); -var exponential = new Exponential( 2.0 ); +const exponential = new Exponential( 2.0 ); -var mu = exponential.mean; +const mu = exponential.mean; // returns 0.5 -var mode = exponential.mode; +const mode = exponential.mode; // returns 0.0 -var s2 = exponential.variance; +const s2 = exponential.variance; // returns 0.25 -var y = exponential.cdf( 0.8 ); +const y = exponential.cdf( 0.8 ); // returns ~0.798 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/entropy/README.md index 082d6a1f255b..d10be837437b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/entropy/README.md @@ -54,7 +54,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/exponential/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/exponential/entropy' ); ``` #### entropy( lambda ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/exponential/entropy' ); Returns the [differential entropy][entropy] of an [exponential][exponential-distribution] distribution with rate parameter `lambda` (in [nats][nats]). ```javascript -var v = entropy( 9.0 ); +let v = entropy( 9.0 ); // returns ~-1.197 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = entropy( -1.0 ); +const v = entropy( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/exponential/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/exponential/entropy' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = entropy( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = entropy( lambda ); console.log( 'λ: %d, h(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/kurtosis/README.md index 919bcecd3bee..b4ff77e6ff44 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for an [exponential][exponential-distribution] r ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/exponential/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/exponential/kurtosis' ); ``` #### kurtosis( lambda ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/exponential/kurtosis' ); Returns the [excess kurtosis][kurtosis] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = kurtosis( 9.0 ); +let v = kurtosis( 9.0 ); // returns 6.0 v = kurtosis( 0.5 ); @@ -70,7 +70,7 @@ v = kurtosis( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = kurtosis( -1.0 ); +const v = kurtosis( -1.0 ); // returns NaN ``` @@ -95,17 +95,13 @@ var v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/exponential/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/exponential/kurtosis' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = kurtosis( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = kurtosis( lambda ); console.log( 'λ: %d, Kurt(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md index 30849581d276..e6c9e19de976 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md @@ -50,7 +50,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/exponential/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/exponential/logcdf' ); ``` #### logcdf( x, lambda ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/exponential/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] for an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var y = logcdf( 2.0, 0.3 ); +let y = logcdf( 2.0, 0.3 ); // returns ~-0.796 y = logcdf( 10.0, 0.3 ); @@ -68,7 +68,7 @@ y = logcdf( 10.0, 0.3 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0 ); +let y = logcdf( NaN, 0.0 ); // returns NaN y = logcdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = logcdf( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0 ); +const y = logcdf( 2.0, -1.0 ); // returns NaN ``` @@ -87,9 +87,9 @@ var y = logcdf( 2.0, -1.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function (CDF)][cdf] for an exponential distribution with rate parameter `lambda`. ```javascript -var mylogcdf = logcdf.factory( 0.1 ); +const mylogcdf = logcdf.factory( 0.1 ); -var y = mylogcdf( 8.0 ); +let y = mylogcdf( 8.0 ); // returns ~-0.597 y = mylogcdf( 2.0 ); @@ -120,18 +120,13 @@ y = mylogcdf( 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/exponential/logcdf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - y = logcdf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/exponential/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const y = logcdf( x, lambda ); console.log( 'x: %d, λ: %d, ln(F(x;λ)): %d', x, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/logpdf/README.md index 0c1bd0d6a8ab..a81027e077ef 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/logpdf/README.md @@ -50,7 +50,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/exponential/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/exponential/logpdf' ); ``` #### logpdf( x, lambda ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/exponential/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var y = logpdf( 2.0, 0.3 ); +let y = logpdf( 2.0, 0.3 ); // returns ~-1.804 y = logpdf( 2.0, 1.0 ); @@ -68,7 +68,7 @@ y = logpdf( 2.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0 ); +let y = logpdf( NaN, 0.0 ); // returns NaN y = logpdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = logpdf( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -1.0 ); +const y = logpdf( 2.0, -1.0 ); // returns NaN ``` @@ -87,9 +87,9 @@ var y = logpdf( 2.0, -1.0 ); Returns a function for evaluating the natural logarithm of the probability density function ([PDF][pdf]) for an exponential distribution with rate parameter `lambda`. ```javascript -var mylogpdf = logpdf.factory( 0.1 ); +const mylogpdf = logpdf.factory( 0.1 ); -var y = mylogpdf( 8.0 ); +let y = mylogpdf( 8.0 ); // returns ~-3.103 y = mylogpdf( 5.0 ); @@ -117,18 +117,13 @@ y = mylogpdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/exponential/logpdf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - y = logpdf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/exponential/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const y = logpdf( x, lambda ); console.log( 'x: %d, λ: %d, ln(f(x;λ)): %d', x, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/mean/README.md index 55ca59ddf762..8e004516dffd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/mean/README.md @@ -54,7 +54,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/exponential/mean' ); +const mean = require( '@stdlib/stats/base/dists/exponential/mean' ); ``` #### mean( lambda ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/exponential/mean' ); Returns the [expected value][expected-value] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = mean( 9.0 ); +let v = mean( 9.0 ); // returns ~0.111 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = mean( -1.0 ); +const v = mean( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/exponential/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/exponential/mean' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = mean( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = mean( lambda ); console.log( 'λ: %d, E(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/median/README.md index 461541e5c08b..aed37fc5321d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/median/README.md @@ -54,7 +54,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/exponential/median' ); +const median = require( '@stdlib/stats/base/dists/exponential/median' ); ``` #### median( lambda ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/exponential/median' ); Returns the [median][median] of a [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = median( 9.0 ); +let v = median( 9.0 ); // returns ~0.077 v = median( 0.5 ); @@ -72,7 +72,7 @@ v = median( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = median( -1.0 ); +const v = median( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/exponential/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/exponential/median' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = median( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = median( lambda ); console.log( 'λ: %d, Median(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/mgf/README.md index 2c45a7bbcfc0..4b355333844d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/mgf/README.md @@ -54,7 +54,7 @@ where `lambda > 0` is the rate parameter. For `t >= lambda`, the [MGF][mgf] is u ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/exponential/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/exponential/mgf' ); ``` #### mgf( t, lambda ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/exponential/mgf' ); Evaluates the moment-generating function ([MGF][mgf]) for an [exponential][exponential-distribution] distribution. ```javascript -var y = mgf( 2.0, 3.0 ); +let y = mgf( 2.0, 3.0 ); // returns 3.0 y = mgf( 0.4, 1.2 ); @@ -72,7 +72,7 @@ y = mgf( 0.4, 1.2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0 ); +let y = mgf( NaN, 0.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -82,7 +82,7 @@ y = mgf( 0.0, NaN ); If provided `lambda < 0` or `t >= lambda`, the function returns `NaN`. ```javascript -var y = mgf( -2.0, -1.0 ); +let y = mgf( -2.0, -1.0 ); // returns NaN y = mgf( 3.0, 2.0 ); @@ -94,8 +94,8 @@ y = mgf( 3.0, 2.0 ); Returns a function for evaluating the [moment-generating function][mgf] of an [exponential][exponential-distribution] distribution with parameter `lambda`(rate parameter). ```javascript -var mymgf = mgf.factory( 4.0 ); -var y = mymgf( 3.0 ); +const mymgf = mgf.factory( 4.0 ); +const y = mymgf( 3.0 ); // returns 4.0 ``` @@ -120,18 +120,13 @@ var y = mymgf( 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/exponential/mgf' ); - -var lambda; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 10.0; - lambda = randu() * 10.0; - y = mgf( t, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/exponential/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 10.0; + const lambda = randu() * 10.0; + const y = mgf( t, lambda ); console.log( 'x: %d, λ: %d, M_X(t;λ): %d', t.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/mode/README.md index 3e8572242a74..87cd2d8db9d5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for an [exponential][exponential-distribution] random variable ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/exponential/mode' ); +const mode = require( '@stdlib/stats/base/dists/exponential/mode' ); ``` #### mode( lambda ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/exponential/mode' ); Returns the [mode][mode] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = mode( 9.0 ); +let v = mode( 9.0 ); // returns 0.0 v = mode( 0.5 ); @@ -70,7 +70,7 @@ v = mode( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = mode( -1.0 ); +const v = mode( -1.0 ); // returns NaN ``` @@ -95,17 +95,13 @@ var v = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/exponential/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/exponential/mode' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = mode( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = mode( lambda ); console.log( 'λ: %d, mode(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/pdf/README.md index be2685c9940e..d4d5969847e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/pdf/README.md @@ -50,7 +50,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/exponential/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/exponential/pdf' ); ``` #### pdf( x, lambda ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/exponential/pdf' ); Evaluates the [probability density function][pdf] (PDF) for an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var y = pdf( 2.0, 0.3 ); +let y = pdf( 2.0, 0.3 ); // returns ~0.165 y = pdf( 2.0, 1.0 ); @@ -68,7 +68,7 @@ y = pdf( 2.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0 ); +let y = pdf( NaN, 0.0 ); // returns NaN y = pdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = pdf( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0 ); +const y = pdf( 2.0, -1.0 ); // returns NaN ``` @@ -87,9 +87,9 @@ var y = pdf( 2.0, -1.0 ); Partially applies `lambda` to create a reusable `function` for evaluating the [PDF][pdf]. ```javascript -var mypdf = pdf.factory( 0.1 ); +const mypdf = pdf.factory( 0.1 ); -var y = mypdf( 8.0 ); +let y = mypdf( 8.0 ); // returns ~0.045 y = mypdf( 5.0 ); @@ -107,18 +107,13 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/exponential/pdf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - y = pdf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/exponential/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const y = pdf( x, lambda ); console.log( 'x: %d, λ: %d, f(x;λ): %d', x, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/quantile/README.md index fd5d5647b64f..ebed603068dd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `λ` is the rate parameter. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/exponential/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/exponential/quantile' ); ``` #### quantile( p, lambda ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/exponential/quantile' ); Evaluates the [quantile function][quantile-function] for a [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var y = quantile( 0.5, 0.1 ); +let y = quantile( 0.5, 0.1 ); // returns ~6.931 y = quantile( 0.2, 4.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.2, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0 ); +let y = quantile( 1.9, 1.0 ); // returns NaN y = quantile( -0.1, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN ); @@ -88,7 +88,7 @@ y = quantile( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +const y = quantile( 0.4, -1.0 ); // returns NaN ``` @@ -97,9 +97,9 @@ var y = quantile( 0.4, -1.0 ); Returns a function for evaluating the [quantile function][quantile-function] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var myquantile = quantile.factory( 4.0 ); +const myquantile = quantile.factory( 4.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~0.056 y = myquantile( 0.9 ); @@ -117,18 +117,13 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/exponential/quantile' ); - -var lambda; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - lambda = randu() * 10.0; - y = quantile( p, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/exponential/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const lambda = randu() * 10.0; + const y = quantile( p, lambda ); console.log( 'p: %d, λ: %d, Q(p;λ): %d', p.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/skewness/README.md index e1e2bd4c830b..ce2bed15af77 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for an [exponential][exponential-distribution] random v ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); ``` #### skewness( lambda ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); Returns the [skewness][skewness] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = skewness( 9.0 ); +let v = skewness( 9.0 ); // returns 2.0 v = skewness( 0.5 ); @@ -70,7 +70,7 @@ v = skewness( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = skewness( -1.0 ); +const v = skewness( -1.0 ); // returns NaN ``` @@ -95,17 +95,13 @@ var v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = skewness( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = skewness( lambda ); console.log( 'λ: %d, skew(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/stdev/README.md index 957554c46686..9e3b0ee6cd5a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/stdev/README.md @@ -54,7 +54,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/exponential/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/exponential/stdev' ); ``` #### stdev( lambda ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/exponential/stdev' ); Returns the [standard deviation][standard-deviation] of a [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = stdev( 9.0 ); +let v = stdev( 9.0 ); // returns ~0.11 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = stdev( -1.0 ); +const v = stdev( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/exponential/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/exponential/stdev' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = stdev( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = stdev( lambda ); console.log( 'λ: %d, SD(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/variance/README.md index f80be6ff33a1..6706cdaafbab 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/variance/README.md @@ -54,7 +54,7 @@ where `λ` is the rate parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/exponential/variance' ); +const variance = require( '@stdlib/stats/base/dists/exponential/variance' ); ``` #### variance( lambda ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/exponential/variance' ); Returns the [variance][variance] of a [exponential][exponential-distribution] distribution with rate parameter `lambda`. ```javascript -var v = variance( 9.0 ); +let v = variance( 9.0 ); // returns ~0.012 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = variance( -1.0 ); +const v = variance( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/exponential/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/exponential/variance' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = variance( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = variance( lambda ); console.log( 'λ: %d, Var(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/README.md index d6b788c70192..9b09bfed8576 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var f = require( '@stdlib/stats/base/dists/f' ); +const f = require( '@stdlib/stats/base/dists/f' ); ``` #### f @@ -35,7 +35,7 @@ var f = require( '@stdlib/stats/base/dists/f' ); Fisher's F distribution. ```javascript -var dist = f; +const dist = f; // returns {...} ``` @@ -84,11 +84,11 @@ The namespace contains a constructor function for creating a [Fisher's F][f-dist ```javascript -var F = require( '@stdlib/stats/base/dists/f' ).F; +const F = require( '@stdlib/stats/base/dists/f' ).F; -var dist = new F( 2.0, 4.0 ); +const dist = new F( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.36 ``` @@ -105,8 +105,8 @@ var y = dist.cdf( 0.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var f = require( '@stdlib/stats/base/dists/f' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const f = require( '@stdlib/stats/base/dists/f' ); console.log( objectKeys( f ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md index af2ab00da7f8..432d37de68af 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md @@ -50,7 +50,7 @@ where `d1` is the numerator degrees of freedom, `d2` is the denominator degrees ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/f/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/f/cdf' ); ``` #### cdf( x, d1, d2 ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/f/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var y = cdf( 2.0, 1.0, 1.0 ); +let y = cdf( 2.0, 1.0, 1.0 ); // returns ~0.608 y = cdf( 2.0, 8.0, 4.0 ); @@ -77,7 +77,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -90,7 +90,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +let y = cdf( 2.0, -1.0, 0.5 ); // returns NaN y = cdf( 2.0, 0.0, 0.5 ); @@ -100,7 +100,7 @@ y = cdf( 2.0, 0.0, 0.5 ); If provided `d2 <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -112,9 +112,9 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns ~0.906 y = mycdf( 8.0 ); @@ -132,20 +132,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/f/cdf' ); - -var d1; -var d2; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - d1 = randu() * 10.0; - d2 = randu() * 10.0; - y = cdf( x, d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/f/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const d1 = randu() * 10.0; + const d2 = randu() * 10.0; + const y = cdf( x, d1, d2 ); console.log( 'x: %d, d1: %d, d2: %d, F(x;d1,d2): %d', x.toFixed( 4 ), d1.toFixed( 4 ), d2.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/ctor/README.md index 2b3eb29e3db2..9fe8f8115db1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var F = require( '@stdlib/stats/base/dists/f/ctor' ); +const F = require( '@stdlib/stats/base/dists/f/ctor' ); ``` #### F( \[d1, d2] ) @@ -45,18 +45,18 @@ var F = require( '@stdlib/stats/base/dists/f/ctor' ); Returns a [F][f-distribution] distribution object. ```javascript -var f = new F(); +const f = new F(); -var mu = f.mean; +const mu = f.mean; // returns NaN ``` By default, `d1 = 1.0` and `d2 = 1.0`. To create a distribution having a different `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom), provide the corresponding arguments. ```javascript -var f = new F( 2.0, 4.0 ); +const f = new F( 2.0, 4.0 ); -var mu = f.mean; +const mu = f.mean; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [F][f-distribution] distribution object has the following properties and metho Numerator degrees of freedom of the distribution. `d1` **must** be a positive number. ```javascript -var f = new F(); +const f = new F(); -var d1 = f.d1; +let d1 = f.d1; // returns 1.0 f.d1 = 3.0; @@ -89,9 +89,9 @@ d1 = f.d1; Denominator degrees of freedom of the distribution. `d2` **must** be a positive number. ```javascript -var f = new F( 2.0, 4.0 ); +const f = new F( 2.0, 4.0 ); -var d2 = f.d2; +let d2 = f.d2; // returns 4.0 f.d2 = 3.0; @@ -109,9 +109,9 @@ d2 = f.d2; Returns the [differential entropy][entropy]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var entropy = f.entropy; +const entropy = f.entropy; // returns ~1.12 ``` @@ -120,9 +120,9 @@ var entropy = f.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var kurtosis = f.kurtosis; +const kurtosis = f.kurtosis; // returns ~26.143 ``` @@ -131,9 +131,9 @@ var kurtosis = f.kurtosis; Returns the [expected value][expected-value]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var mu = f.mean; +const mu = f.mean; // returns 1.2 ``` @@ -142,9 +142,9 @@ var mu = f.mean; Returns the [mode][mode]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var mode = f.mode; +const mode = f.mode; // returns ~0.429 ``` @@ -153,9 +153,9 @@ var mode = f.mode; Returns the [skewness][skewness]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var skewness = f.skewness; +const skewness = f.skewness; // returns ~3.207 ``` @@ -164,9 +164,9 @@ var skewness = f.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var s = f.stdev; +const s = f.stdev; // returns ~1.122 ``` @@ -175,9 +175,9 @@ var s = f.stdev; Returns the [variance][variance]. ```javascript -var f = new F( 4.0, 12.0 ); +const f = new F( 4.0, 12.0 ); -var s2 = f.variance; +const s2 = f.variance; // returns 1.26 ``` @@ -190,9 +190,9 @@ var s2 = f.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var f = new F( 2.0, 4.0 ); +const f = new F( 2.0, 4.0 ); -var y = f.cdf( 0.5 ); +const y = f.cdf( 0.5 ); // returns ~0.36 ``` @@ -201,9 +201,9 @@ var y = f.cdf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var f = new F( 2.0, 4.0 ); +const f = new F( 2.0, 4.0 ); -var y = f.pdf( 0.8 ); +const y = f.pdf( 0.8 ); // returns ~0.364 ``` @@ -212,9 +212,9 @@ var y = f.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var f = new F( 2.0, 4.0 ); +const f = new F( 2.0, 4.0 ); -var y = f.quantile( 0.5 ); +let y = f.quantile( 0.5 ); // returns ~0.828 y = f.quantile( 1.9 ); @@ -244,20 +244,20 @@ y = f.quantile( 1.9 ); ```javascript -var F = require( '@stdlib/stats/base/dists/f/ctor' ); +const F = require( '@stdlib/stats/base/dists/f/ctor' ); -var f = new F( 3.0, 5.0 ); +const f = new F( 3.0, 5.0 ); -var mu = f.mean; +const mu = f.mean; // returns ~1.667 -var mode = f.mode; +const mode = f.mode; // returns ~0.238 -var s2 = f.variance; +const s2 = f.variance; // returns ~11.111 -var y = f.cdf( 0.8 ); +const y = f.cdf( 0.8 ); // returns ~0.455 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/entropy/README.md index 67119b8102cf..09efd158034f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/entropy/README.md @@ -54,7 +54,7 @@ where `d1` is the numerator degrees of freedom, `d2` is the denominator degrees ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/f/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/f/entropy' ); ``` #### entropy( d1, d2 ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/f/entropy' ); Returns the [differential entropy][entropy] of a [F][f-distribution] distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2` (in [nats][nats]). ```javascript -var v = entropy( 4.0, 7.0 ); +let v = entropy( 4.0, 7.0 ); // returns ~1.277 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 7.0 ); +let v = entropy( NaN, 7.0 ); // returns NaN v = entropy( 3.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 2.0 ); +let v = entropy( 0.0, 2.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `d2 <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 3.0, 0.0 ); +let v = entropy( 3.0, 0.0 ); // returns NaN v = entropy( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/f/entropy' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*10.0 ) + EPS; - v = entropy( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/f/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*10.0 ) + EPS; + const v = entropy( d1, d2 ); console.log( 'd1: %d, d2: %d, h(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/kurtosis/README.md index 47a2b22be344..19f94c27c518 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/kurtosis/README.md @@ -54,7 +54,7 @@ for `d1 > 0` and `d2 > 8`. Otherwise, the kurtosis is not defined. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/f/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/f/kurtosis' ); ``` #### kurtosis( d1, d2 ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/f/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = kurtosis( 4.0, 9.0 ); +let v = kurtosis( 4.0, 9.0 ); // returns ~114.273 v = kurtosis( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 8.0, 9.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 7.0 ); +let v = kurtosis( NaN, 7.0 ); // returns NaN v = kurtosis( 3.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 9.0 ); +let v = kurtosis( 0.0, 9.0 ); // returns NaN v = kurtosis( -1.0, 9.0 ); @@ -95,7 +95,7 @@ v = kurtosis( -1.0, 9.0 ); If provided `d2 <= 8`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 8.0 ); +let v = kurtosis( 1.0, 8.0 ); // returns NaN v = kurtosis( 2.2, 5.5 ); @@ -126,19 +126,14 @@ v = kurtosis( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/f/kurtosis' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*20.0 ) + EPS; - v = kurtosis( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/f/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*20.0 ) + EPS; + const v = kurtosis( d1, d2 ); console.log( 'd1: %d, d2: %d, skew(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/mean/README.md index a8ccc87e9ecc..efeedf87a8b9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/mean/README.md @@ -52,7 +52,7 @@ The [expected value][expected-value] for a [F][f-distribution] random variable w ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/f/mean' ); +const mean = require( '@stdlib/stats/base/dists/f/mean' ); ``` #### mean( d1, d2 ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/f/mean' ); Returns the [expected value][expected-value] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = mean( 4.0, 5.0 ); +let v = mean( 4.0, 5.0 ); // returns ~1.667 v = mean( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = mean( 8.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 3.0 ); +let v = mean( NaN, 3.0 ); // returns NaN v = mean( 3.0, NaN ); @@ -83,7 +83,7 @@ v = mean( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 3.0 ); +let v = mean( 0.0, 3.0 ); // returns NaN v = mean( -1.0, 3.0 ); @@ -93,7 +93,7 @@ v = mean( -1.0, 3.0 ); If provided `d2 <= 2`, the function returns `NaN`. ```javascript -var v = mean( 2.0, 1.8 ); +let v = mean( 2.0, 1.8 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -121,19 +121,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/f/mean' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*10.0 ) + EPS; - v = mean( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/f/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*10.0 ) + EPS; + const v = mean( d1, d2 ); console.log( 'd1: %d, d2: %d, E(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/mode/README.md index 4ae452e3cef8..156c1501c17c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/mode/README.md @@ -54,7 +54,7 @@ for `d1 > 2` and `d2 > 0`. Otherwise, the mode is not defined. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/f/mode' ); +const mode = require( '@stdlib/stats/base/dists/f/mode' ); ``` #### mode( d1, d2 ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/f/mode' ); Returns the [mode][mode] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = mode( 4.0, 5.0 ); +let v = mode( 4.0, 5.0 ); // returns ~0.357 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 8.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 3.0 ); +let v = mode( NaN, 3.0 ); // returns NaN v = mode( 3.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 3.0, NaN ); If provided `d1 <= 2`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 3.0 ); +let v = mode( 1.0, 3.0 ); // returns NaN v = mode( -1.0, 3.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 3.0 ); If provided `d2 <= 0`, the function returns `NaN`. ```javascript -var v = mode( 3.0, 0.0 ); +let v = mode( 3.0, 0.0 ); // returns NaN v = mode( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = mode( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/f/mode' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*10.0 ) + EPS; - v = mode( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/f/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*10.0 ) + EPS; + const v = mode( d1, d2 ); console.log( 'd1: %d, d2: %d, mode(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md index 75fc41a63ff6..9b4f2b1360e6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md @@ -50,7 +50,7 @@ where `d1` is the numerator degrees of freedom and `d2` is the denominator degre ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/f/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/f/pdf' ); ``` #### pdf( x, d1, d2 ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/f/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var y = pdf( 2.0, 0.5, 1.0 ); +let y = pdf( 2.0, 0.5, 1.0 ); // returns ~0.057 y = pdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns NaN y = pdf( 2.0, -1.0, 1.0 ); @@ -94,7 +94,7 @@ y = pdf( 2.0, -1.0, 1.0 ); If provided `d2 <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1.0, 0.0 ); +let y = pdf( 2.0, 1.0, 0.0 ); // returns NaN y = pdf( 2.0, 1.0, -1.0 ); @@ -106,8 +106,8 @@ y = pdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var mypdf = pdf.factory( 6.0, 7.0 ); -var y = mypdf( 7.0 ); +const mypdf = pdf.factory( 6.0, 7.0 ); +let y = mypdf( 7.0 ); // returns ~0.004 y = mypdf( 2.0 ); @@ -125,20 +125,14 @@ y = mypdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/f/pdf' ); - -var d1; -var d2; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 4.0; - d1 = randu() * 10.0; - d2 = randu() * 10.0; - y = pdf( x, d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/f/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 4.0; + const d1 = randu() * 10.0; + const d2 = randu() * 10.0; + const y = pdf( x, d1, d2 ); console.log( 'x: %d, d1: %d, d2: %d, f(x;d1,d2): %d', x.toFixed( 4 ), d1.toFixed( 4 ), d2.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/quantile/README.md index 6951175a5652..21896a0d7288 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `d1` is the numerator degrees of freedom, `d2` is the de ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/f/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/f/quantile' ); ``` #### quantile( p, d1, d2 ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/f/quantile' ); Evaluates the [quantile function][quantile-function] for a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var y = quantile( 0.5, 1.0, 1.0 ); +let y = quantile( 0.5, 1.0, 1.0 ); // returns 1.0 y = quantile( 0.2, 4.0, 2.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.8, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = quantile( 0.0, 1.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +let y = quantile( 0.4, -1.0, 1.0 ); // returns NaN y = quantile( 0.4, 0.0, 1.0 ); @@ -104,7 +104,7 @@ y = quantile( 0.4, 0.0, 1.0 ); If provided `d2 <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +let y = quantile( 0.4, 1.0, -1.0 ); // returns NaN y = quantile( 0.4, 1.0, 0.0 ); @@ -116,9 +116,9 @@ y = quantile( 0.4, 1.0, 0.0 ); Returns a function for evaluating the quantile function of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var myquantile = quantile.factory( 10.0, 2.0 ); +const myquantile = quantile.factory( 10.0, 2.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~0.527 y = myquantile( 0.8 ); @@ -136,20 +136,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/f/quantile' ); - -var d1; -var d2; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - d1 = randu() * 10.0; - d2 = randu() * 10.0; - y = quantile( p, d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/f/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const d1 = randu() * 10.0; + const d2 = randu() * 10.0; + const y = quantile( p, d1, d2 ); console.log( 'p: %d, d1: %d, d2: %d, Q(p;d1,d2): %d', p.toFixed( 4 ), d1.toFixed( 4 ), d2.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/skewness/README.md index 0e442d0d22b1..e9769687c734 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/skewness/README.md @@ -54,7 +54,7 @@ for `d1 > 0` and `d2 > 6`. Otherwise, the skewness is not defined. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/f/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/f/skewness' ); ``` #### skewness( d1, d2 ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/f/skewness' ); Returns the [skewness][skewness] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = skewness( 4.0, 7.0 ); +let v = skewness( 4.0, 7.0 ); // returns ~10.614 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 8.0, 7.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 7.0 ); +let v = skewness( NaN, 7.0 ); // returns NaN v = skewness( 3.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 0.0, 7.0 ); +let v = skewness( 0.0, 7.0 ); // returns NaN v = skewness( -1.0, 7.0 ); @@ -95,7 +95,7 @@ v = skewness( -1.0, 7.0 ); If provided `d2 <= 6`, the function returns `NaN`. ```javascript -var v = skewness( 3.0, 6.0 ); +let v = skewness( 3.0, 6.0 ); // returns NaN v = skewness( 3.0, 5.5 ); @@ -126,19 +126,14 @@ v = skewness( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/f/skewness' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*20.0 ) + EPS; - v = skewness( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/f/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*20.0 ) + EPS; + const v = skewness( d1, d2 ); console.log( 'd1: %d, d2: %d, skew(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/stdev/README.md index 69768ceda960..8a9172cf1910 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/stdev/README.md @@ -54,7 +54,7 @@ for `d1 > 0` and `d2 > 4`. Otherwise, the standard deviation is not defined. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/f/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/f/stdev' ); ``` #### stdev( d1, d2 ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/f/stdev' ); Returns the [standard deviation][standard-deviation] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = stdev( 4.0, 5.0 ); +let v = stdev( 4.0, 5.0 ); // returns ~3.118 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 5.0 ); +let v = stdev( NaN, 5.0 ); // returns NaN v = stdev( 3.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 5.0 ); +let v = stdev( 0.0, 5.0 ); // returns NaN v = stdev( -1.0, 5.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 5.0 ); If provided `d2 <= 4`, the function returns `NaN`. ```javascript -var v = stdev( 3.0, 4.0 ); +let v = stdev( 3.0, 4.0 ); // returns NaN v = stdev( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = stdev( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/f/stdev' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*20.0 ) + EPS; - v = stdev( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/f/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*20.0 ) + EPS; + const v = stdev( d1, d2 ); console.log( 'd1: %d, d2: %d, SD(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/variance/README.md index 5d4c308a9a84..cba6183c8c8c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/variance/README.md @@ -54,7 +54,7 @@ for `d1 > 0` and `d2 > 4`. Otherwise, the variance is not defined. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/f/variance' ); +const variance = require( '@stdlib/stats/base/dists/f/variance' ); ``` #### variance( d1, d2 ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/f/variance' ); Returns the [variance][variance] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom). ```javascript -var v = variance( 4.0, 5.0 ); +let v = variance( 4.0, 5.0 ); // returns ~9.722 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 5.0 ); +let v = variance( NaN, 5.0 ); // returns NaN v = variance( 3.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 3.0, NaN ); If provided `d1 <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 5.0 ); +let v = variance( 0.0, 5.0 ); // returns NaN v = variance( -1.0, 5.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 5.0 ); If provided `d2 <= 4`, the function returns `NaN`. ```javascript -var v = variance( 3.0, 4.0 ); +let v = variance( 3.0, 4.0 ); // returns NaN v = variance( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = variance( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/f/variance' ); - -var d1; -var d2; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - d1 = ( randu()*10.0 ) + EPS; - d2 = ( randu()*20.0 ) + EPS; - v = variance( d1, d2 ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/f/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const d1 = ( randu()*10.0 ) + EPS; + const d2 = ( randu()*20.0 ) + EPS; + const v = variance( d1, d2 ); console.log( 'd1: %d, d2: %d, Var(X;d1,d2): %d', d1.toFixed( 4 ), d2.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/README.md index c71e928761a3..87632ce21f5d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var frechet = require( '@stdlib/stats/base/dists/frechet' ); +const frechet = require( '@stdlib/stats/base/dists/frechet' ); ``` #### frechet @@ -35,7 +35,7 @@ var frechet = require( '@stdlib/stats/base/dists/frechet' ); Fréchet distribution. ```javascript -var dist = frechet; +const dist = frechet; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [Fréchet][frechet- ```javascript -var Frechet = require( '@stdlib/stats/base/dists/frechet' ).Frechet; +const Frechet = require( '@stdlib/stats/base/dists/frechet' ).Frechet; -var dist = new Frechet( 2.0, 4.0, 3.0 ); +const dist = new Frechet( 2.0, 4.0, 3.0 ); -var y = dist.pdf( 5.5 ); +const y = dist.pdf( 5.5 ); // returns ~0.158 ``` @@ -108,8 +108,8 @@ var y = dist.pdf( 5.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var frechet = require( '@stdlib/stats/base/dists/frechet' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const frechet = require( '@stdlib/stats/base/dists/frechet' ); console.log( objectKeys( frechet ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/cdf/README.md index a69c3ccc2770..abed05f3f35b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/cdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape, `s > 0` the scale, and `m` the location paramete ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/frechet/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/frechet/cdf' ); ``` #### cdf( x, alpha, s, m ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/frechet/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a value `x`. ```javascript -var y = cdf( 10.0, 2.0, 3.0, 5.0 ); +let y = cdf( 10.0, 2.0, 3.0, 5.0 ); // returns ~0.698 y = cdf( -3.0, 1.0, 2.0, -4.0 ); @@ -71,14 +71,14 @@ y = cdf( 0.0, 2.0, 1.0, -1.0 ); If provided `x <= m`, the function returns `0`. ```javascript -var y = cdf( -2.0, 2.0, 1.0, -1.0 ); +const y = cdf( -2.0, 2.0, 1.0, -1.0 ); // returns 0.0 ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0, 0.0 ); +let y = cdf( NaN, 1.0, 1.0, 0.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0, 0.0 ); @@ -94,7 +94,7 @@ y = cdf( 0.0, 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -0.1, 1.0, 1.0 ); +let y = cdf( 2.0, -0.1, 1.0, 1.0 ); // returns NaN y = cdf( 2.0, 0.0, 1.0, 1.0 ); @@ -104,7 +104,7 @@ y = cdf( 2.0, 0.0, 1.0, 1.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 1.0, -1.0, 1.0 ); +let y = cdf( 2.0, 1.0, -1.0, 1.0 ); // returns NaN y = cdf( 2.0, 1.0, 0.0, 1.0 ); @@ -116,9 +116,9 @@ y = cdf( 2.0, 1.0, 0.0, 1.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m`. ```javascript -var mycdf = cdf.factory( 3.0, 3.0, 5.0 ); +const mycdf = cdf.factory( 3.0, 3.0, 5.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns ~0.806 y = mycdf( 7.0 ); @@ -136,22 +136,15 @@ y = mycdf( 7.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/frechet/cdf' ); - -var alpha; -var m; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - alpha = randu() * 10.0; - x = randu() * 10.0; - s = randu() * 10.0; - m = randu() * 10.0; - y = cdf( x, alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/frechet/cdf' ); + +for ( let i = 0; i < 100; i++ ) { + const alpha = randu() * 10.0; + const x = randu() * 10.0; + const s = randu() * 10.0; + const m = randu() * 10.0; + const y = cdf( x, alpha, s, m ); console.log( 'x: %d, α: %d, s: %d, m: %d, F(x;α,s,m): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/ctor/README.md index 926460b5dcbe..73f5bf3b3cbe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Frechet = require( '@stdlib/stats/base/dists/frechet/ctor' ); +const Frechet = require( '@stdlib/stats/base/dists/frechet/ctor' ); ``` #### Frechet( \[alpha, s, m] ) @@ -45,18 +45,18 @@ var Frechet = require( '@stdlib/stats/base/dists/frechet/ctor' ); Returns a [Fréchet][frechet-distribution] distribution object. ```javascript -var frechet = new Frechet(); +const frechet = new Frechet(); -var mu = frechet.mean; +const mu = frechet.mean; // returns Infinity ``` By default, `alpha = 1.0`, `s = 1.0`, and `m = 0.0`. To create a distribution having a different `alpha` (shape), `s` (scale), and `m` (location), provide the corresponding arguments. ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.5 ); +const frechet = new Frechet( 2.0, 4.0, 3.5 ); -var mu = frechet.mean; +const mu = frechet.mean; // returns ~10.59 ``` @@ -73,9 +73,9 @@ An [Fréchet][frechet-distribution] distribution object has the following proper Shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var frechet = new Frechet(); +const frechet = new Frechet(); -var alpha = frechet.alpha; +let alpha = frechet.alpha; // returns 1.0 frechet.alpha = 0.5; @@ -89,9 +89,9 @@ alpha = frechet.alpha; Scale parameter of the distribution. `s` **must** be a positive number. ```javascript -var frechet = new Frechet( 2.0, 4.0, 1.5 ); +const frechet = new Frechet( 2.0, 4.0, 1.5 ); -var s = frechet.s; +let s = frechet.s; // returns 4.0 frechet.s = 3.0; @@ -105,9 +105,9 @@ s = frechet.s; Location parameter of the distribution. ```javascript -var frechet = new Frechet( 2.0, 2.0, 4.0 ); +const frechet = new Frechet( 2.0, 2.0, 4.0 ); -var m = frechet.m; +let m = frechet.m; // returns 4.0 frechet.m = 3.0; @@ -125,9 +125,9 @@ m = frechet.m; Returns the [differential entropy][entropy]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var entropy = frechet.entropy; +const entropy = frechet.entropy; // returns ~2.82 ``` @@ -136,9 +136,9 @@ var entropy = frechet.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var kurtosis = frechet.kurtosis; +const kurtosis = frechet.kurtosis; // returns Infinity ``` @@ -147,9 +147,9 @@ var kurtosis = frechet.kurtosis; Returns the [expected value][expected-value]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var mu = frechet.mean; +const mu = frechet.mean; // returns ~16.705 ``` @@ -158,9 +158,9 @@ var mu = frechet.mean; Returns the [median][median]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var median = frechet.median; +const median = frechet.median; // returns ~15.151 ``` @@ -169,9 +169,9 @@ var median = frechet.median; Returns the [mode][mode]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var mode = frechet.mode; +const mode = frechet.mode; // returns ~13.349 ``` @@ -180,9 +180,9 @@ var mode = frechet.mode; Returns the [skewness][skewness]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var skewness = frechet.skewness; +const skewness = frechet.skewness; // returns ~5.605 ``` @@ -191,9 +191,9 @@ var skewness = frechet.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var s = frechet.stdev; +const s = frechet.stdev; // returns ~6.245 ``` @@ -202,9 +202,9 @@ var s = frechet.stdev; Returns the [variance][variance]. ```javascript -var frechet = new Frechet( 4.0, 12.0, 2.0 ); +const frechet = new Frechet( 4.0, 12.0, 2.0 ); -var s2 = frechet.variance; +const s2 = frechet.variance; // returns ~38.996 ``` @@ -217,9 +217,9 @@ var s2 = frechet.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var y = frechet.cdf( 2.5 ); +const y = frechet.cdf( 2.5 ); // returns 0.0 ``` @@ -228,9 +228,9 @@ var y = frechet.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var y = frechet.logcdf( 2.5 ); +const y = frechet.logcdf( 2.5 ); // returns -Infinity ``` @@ -239,9 +239,9 @@ var y = frechet.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var y = frechet.logpdf( 5.5 ); +const y = frechet.logpdf( 5.5 ); // returns ~-1.843 ``` @@ -250,9 +250,9 @@ var y = frechet.logpdf( 5.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var y = frechet.pdf( 5.5 ); +const y = frechet.pdf( 5.5 ); // returns ~0.158 ``` @@ -261,9 +261,9 @@ var y = frechet.pdf( 5.5 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var y = frechet.quantile( 0.5 ); +let y = frechet.quantile( 0.5 ); // returns ~7.804 y = frechet.quantile( 1.9 ); @@ -293,20 +293,20 @@ y = frechet.quantile( 1.9 ); ```javascript -var Frechet = require( '@stdlib/stats/base/dists/frechet/ctor' ); +const Frechet = require( '@stdlib/stats/base/dists/frechet/ctor' ); -var frechet = new Frechet( 2.0, 4.0, 3.0 ); +const frechet = new Frechet( 2.0, 4.0, 3.0 ); -var mu = frechet.mean; +const mu = frechet.mean; // returns ~10.09 -var median = frechet.median; +const median = frechet.median; // returns ~7.804 -var s2 = frechet.variance; +const s2 = frechet.variance; // returns Infinity -var y = frechet.cdf( 2.5 ); +const y = frechet.cdf( 2.5 ); // returns 0.0 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/entropy/README.md index 767da2f6217f..83f3e43ebb02 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/entropy/README.md @@ -54,7 +54,7 @@ where `γ` is the [Euler–Mascheroni constant][euler-mascheroni]. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/frechet/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/frechet/entropy' ); ``` #### entropy( alpha, s, m ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/frechet/entropy' ); Returns the [differential entropy][entropy] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0, 1.0 ); +let y = entropy( 2.0, 1.0, 1.0 ); // returns ~1.173 y = entropy( 1.0, 1.0, -1.0 ); @@ -75,7 +75,7 @@ y = entropy( 1.0, 1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0, -2.0 ); +let y = entropy( NaN, 1.0, -2.0 ); // returns NaN y = entropy( 1.0, NaN, -2.0 ); @@ -88,7 +88,7 @@ y = entropy( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 3.0, 2.0 ); +let y = entropy( 0.0, 3.0, 2.0 ); // returns NaN y = entropy( 0.0, -1.0, 2.0 ); @@ -98,7 +98,7 @@ y = entropy( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 1.0, 0.0, 2.0 ); +let y = entropy( 1.0, 0.0, 2.0 ); // returns NaN y = entropy( 1.0, -1.0, 2.0 ); @@ -126,21 +126,15 @@ y = entropy( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/frechet/entropy' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = entropy( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/frechet/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = entropy( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, h(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis/README.md index 360f2516210f..59c6da8f8529 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis/README.md @@ -54,7 +54,7 @@ where `Γ` is the [gamma function][gamma-function]. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' ); ``` #### kurtosis( alpha, s, m ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = kurtosis( 5.0, 1.0, 1.0 ); +let y = kurtosis( 5.0, 1.0, 1.0 ); // returns ~45.092 y = kurtosis( 5.0, 10.0, 1.0 ); @@ -75,14 +75,14 @@ y = kurtosis( 5.0, 1.0, 2.0 ); If `0 < alpha <= 4`, the function returns `+Infinity`. ```javascript -var y = kurtosis( 2.5, 1.0, 1.0 ); +const y = kurtosis( 2.5, 1.0, 1.0 ); // returns Infinity ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0, -2.0 ); +let y = kurtosis( NaN, 1.0, -2.0 ); // returns NaN y = kurtosis( 1.0, NaN, -2.0 ); @@ -95,7 +95,7 @@ y = kurtosis( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 3.0, 2.0 ); +let y = kurtosis( 0.0, 3.0, 2.0 ); // returns NaN y = kurtosis( 0.0, -1.0, 2.0 ); @@ -105,7 +105,7 @@ y = kurtosis( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 1.0, 0.0, 2.0 ); +let y = kurtosis( 1.0, 0.0, 2.0 ); // returns NaN y = kurtosis( 1.0, -1.0, 2.0 ); @@ -133,21 +133,15 @@ y = kurtosis( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = kurtosis( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = kurtosis( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, Kurt(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/logcdf/README.md index c5a6669a1523..e3dc418dda16 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/logcdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape, `s > 0` the scale, and `m` the location paramete ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/frechet/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/frechet/logcdf' ); ``` #### logcdf( x, alpha, s, m ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/frechet/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a value `x`. ```javascript -var y = logcdf( 10.0, 2.0, 3.0, 5.0 ); +let y = logcdf( 10.0, 2.0, 3.0, 5.0 ); // returns ~-0.36 y = logcdf( -3.4, 1.0, 2.0, -4.0 ); @@ -78,7 +78,7 @@ y = logcdf( -2.0, 2.0, 1.0, -1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0, 0.0 ); +let y = logcdf( NaN, 1.0, 1.0, 0.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0, 0.0 ); @@ -94,7 +94,7 @@ y = logcdf( 0.0, 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -0.1, 1.0, 1.0 ); +let y = logcdf( 2.0, -0.1, 1.0, 1.0 ); // returns NaN y = logcdf( 2.0, 0.0, 1.0, 1.0 ); @@ -104,7 +104,7 @@ y = logcdf( 2.0, 0.0, 1.0, 1.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 1.0, -1.0, 1.0 ); +let y = logcdf( 2.0, 1.0, -1.0, 1.0 ); // returns NaN y = logcdf( 2.0, 1.0, 0.0, 1.0 ); @@ -116,9 +116,9 @@ y = logcdf( 2.0, 1.0, 0.0, 1.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m`. ```javascript -var mylogcdf = logcdf.factory( 3.0, 3.0, 5.0 ); +const mylogcdf = logcdf.factory( 3.0, 3.0, 5.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.216 y = mylogcdf( 7.0 ); @@ -146,22 +146,15 @@ y = mylogcdf( 7.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/frechet/logcdf' ); - -var alpha; -var m; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - alpha = randu() * 10.0; - x = randu() * 10.0; - s = randu() * 10.0; - m = randu() * 10.0; - y = logcdf( x, alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/frechet/logcdf' ); + +for ( let i = 0; i < 100; i++ ) { + const alpha = randu() * 10.0; + const x = randu() * 10.0; + const s = randu() * 10.0; + const m = randu() * 10.0; + const y = logcdf( x, alpha, s, m ); console.log( 'x: %d, α: %d, s: %d, m: %d, ln(F(x;α,s,m)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md index dd3dacc37727..007c1b13ac27 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md @@ -50,7 +50,7 @@ where `α > 0` is the shape, `s > 0` the scale and `m` the location parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/frechet/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/frechet/logpdf' ); ``` #### logpdf( x, alpha, s, m ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/frechet/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a value `x`. ```javascript -var y = logpdf( 10.0, 2.0, 3.0, 5.0 ); +let y = logpdf( 10.0, 2.0, 3.0, 5.0 ); // returns ~-2.298 y = logpdf( -3.0, 1.0, 2.0, -4.0 ); @@ -78,7 +78,7 @@ y = logpdf( -2.0, 2.0, 1.0, -1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0, 0.0 ); +let y = logpdf( NaN, 1.0, 1.0, 0.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0, 0.0 ); @@ -94,7 +94,7 @@ y = logpdf( 0.0, 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -0.1, 1.0, 1.0 ); +let y = logpdf( 2.0, -0.1, 1.0, 1.0 ); // returns NaN y = logpdf( 2.0, 0.0, 1.0, 1.0 ); @@ -104,7 +104,7 @@ y = logpdf( 2.0, 0.0, 1.0, 1.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 1.0, -1.0, 1.0 ); +let y = logpdf( 2.0, 1.0, -1.0, 1.0 ); // returns NaN y = logpdf( 2.0, 1.0, 0.0, 1.0 ); @@ -116,9 +116,9 @@ y = logpdf( 2.0, 1.0, 0.0, 1.0 ); Returns a function for evaluating the logarithm of the [probability density function][pdf] of a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m`. ```javascript -var mylogpdf = logpdf.factory( 3.0, 3.0, 5.0 ); +const mylogpdf = logpdf.factory( 3.0, 3.0, 5.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-2.259 y = mylogpdf( 7.0 ); @@ -146,22 +146,15 @@ y = mylogpdf( 7.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/frechet/logpdf' ); - -var alpha; -var m; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - alpha = randu() * 10.0; - x = randu() * 10.0; - s = randu() * 10.0; - m = randu() * 10.0; - y = logpdf( x, alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/frechet/logpdf' ); + +for ( let i = 0; i < 100; i++ ) { + const alpha = randu() * 10.0; + const x = randu() * 10.0; + const s = randu() * 10.0; + const m = randu() * 10.0; + const y = logpdf( x, alpha, s, m ); console.log( 'x: %d, α: %d, s: %d, m: %d, ln(f(x;α,s,m)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/mean/README.md index d2eb64a802c6..b1a0e577b841 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/mean/README.md @@ -54,7 +54,7 @@ where `Γ` is the [gamma function][gamma-function]. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/frechet/mean' ); +const mean = require( '@stdlib/stats/base/dists/frechet/mean' ); ``` #### mean( alpha, s, m ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/frechet/mean' ); Returns the [expected value][mean] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = mean( 2.0, 1.0, 1.0 ); +let y = mean( 2.0, 1.0, 1.0 ); // returns ~2.772 y = mean( 4.0, 4.0, -1.0 ); @@ -75,7 +75,7 @@ y = mean( 1.0, 1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0, -2.0 ); +let y = mean( NaN, 1.0, -2.0 ); // returns NaN y = mean( 1.0, NaN, -2.0 ); @@ -88,7 +88,7 @@ y = mean( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 3.0, 2.0 ); +let y = mean( 0.0, 3.0, 2.0 ); // returns NaN y = mean( 0.0, -1.0, 2.0 ); @@ -98,7 +98,7 @@ y = mean( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mean( 1.0, 0.0, 2.0 ); +let y = mean( 1.0, 0.0, 2.0 ); // returns NaN y = mean( 1.0, -1.0, 2.0 ); @@ -126,21 +126,15 @@ y = mean( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/frechet/mean' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = mean( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/frechet/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = mean( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, E(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/median/README.md index f9e3d61c71eb..b5176925a5a3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [Fréchet][frechet-distribution] random variable shap ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/frechet/median' ); +const median = require( '@stdlib/stats/base/dists/frechet/median' ); ``` #### median( alpha, s, m ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/frechet/median' ); Returns the [median][median] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = median( 2.0, 1.0, 1.0 ); +let y = median( 2.0, 1.0, 1.0 ); // returns ~2.201 y = median( 1.0, 2.0, -3.0 ); @@ -73,7 +73,7 @@ y = median( 1.0, 1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0, -2.0 ); +let y = median( NaN, 1.0, -2.0 ); // returns NaN y = median( 1.0, NaN, -2.0 ); @@ -86,7 +86,7 @@ y = median( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 3.0, 2.0 ); +let y = median( 0.0, 3.0, 2.0 ); // returns NaN y = median( 0.0, -1.0, 2.0 ); @@ -96,7 +96,7 @@ y = median( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = median( 1.0, 0.0, 2.0 ); +let y = median( 1.0, 0.0, 2.0 ); // returns NaN y = median( 1.0, -1.0, 2.0 ); @@ -124,21 +124,15 @@ y = median( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var median = require( '@stdlib/stats/base/dists/frechet/median' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = median( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const median = require( '@stdlib/stats/base/dists/frechet/median' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = median( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, Median(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/mode/README.md index 84e55a859785..f89f0db871d3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Fréchet][frechet-distribution] random variable shape ` ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/frechet/mode' ); +const mode = require( '@stdlib/stats/base/dists/frechet/mode' ); ``` #### mode( alpha, s, m ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/frechet/mode' ); Returns the [mode][mode] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = mode( 2.0, 1.0, 1.0 ); +let y = mode( 2.0, 1.0, 1.0 ); // returns ~1.816 y = mode( 1.0, 2.0, -3.0 ); @@ -73,7 +73,7 @@ y = mode( 1.0, 1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0, -2.0 ); +let y = mode( NaN, 1.0, -2.0 ); // returns NaN y = mode( 1.0, NaN, -2.0 ); @@ -86,7 +86,7 @@ y = mode( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 3.0, 2.0 ); +let y = mode( 0.0, 3.0, 2.0 ); // returns NaN y = mode( 0.0, -1.0, 2.0 ); @@ -96,7 +96,7 @@ y = mode( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mode( 1.0, 0.0, 2.0 ); +let y = mode( 1.0, 0.0, 2.0 ); // returns NaN y = mode( 1.0, -1.0, 2.0 ); @@ -124,21 +124,15 @@ y = mode( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/frechet/mode' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = mode( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/frechet/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = mode( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, mode(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/pdf/README.md index 05a0de31d1ff..45d2115bf440 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/pdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape, `s > 0` the scale and `m` the location parameter ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/frechet/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/frechet/pdf' ); ``` #### pdf( x, alpha, s, m ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/frechet/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a value `x`. ```javascript -var y = pdf( 10.0, 2.0, 3.0, 5.0 ); +let y = pdf( 10.0, 2.0, 3.0, 5.0 ); // returns ~0.1 y = pdf( -3.0, 1.0, 2.0, -4.0 ); @@ -78,7 +78,7 @@ y = pdf( -2.0, 2.0, 1.0, -1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0, 0.0 ); +let y = pdf( NaN, 1.0, 1.0, 0.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0, 0.0 ); @@ -94,7 +94,7 @@ y = pdf( 0.0, 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -0.1, 1.0, 1.0 ); +let y = pdf( 2.0, -0.1, 1.0, 1.0 ); // returns NaN y = pdf( 2.0, 0.0, 1.0, 1.0 ); @@ -104,7 +104,7 @@ y = pdf( 2.0, 0.0, 1.0, 1.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1.0, -1.0, 1.0 ); +let y = pdf( 2.0, 1.0, -1.0, 1.0 ); // returns NaN y = pdf( 2.0, 1.0, 0.0, 1.0 ); @@ -116,9 +116,9 @@ y = pdf( 2.0, 1.0, 0.0, 1.0 ); Returns a function for evaluating the [probability density function][pdf] of a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m`. ```javascript -var mypdf = pdf.factory( 3.0, 3.0, 5.0 ); +const mypdf = pdf.factory( 3.0, 3.0, 5.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns ~0.104 y = mypdf( 7.0 ); @@ -136,22 +136,15 @@ y = mypdf( 7.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/frechet/pdf' ); - -var alpha; -var m; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - alpha = randu() * 10.0; - x = randu() * 10.0; - s = randu() * 10.0; - m = randu() * 10.0; - y = pdf( x, alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/frechet/pdf' ); + +for ( let i = 0; i < 100; i++ ) { + const alpha = randu() * 10.0; + const x = randu() * 10.0; + const s = randu() * 10.0; + const m = randu() * 10.0; + const y = pdf( x, alpha, s, m ); console.log( 'x: %d, α: %d, s: %d, m: %d, f(x;α,s,m): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/quantile/README.md index 3742094c8e73..b9c0d1445494 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/quantile/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape, `s > 0` the scale, and `m` the location paramete ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/frechet/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/frechet/quantile' ); ``` #### quantile( p, alpha, s, m ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/frechet/quantile' ); Evaluates the [quantile function][quantile] for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a probability `p`. ```javascript -var y = quantile( 0.8, 2.0, 3.0, 5.0 ); +let y = quantile( 0.8, 2.0, 3.0, 5.0 ); // returns ~11.351 y = quantile( 0.1, 1.0, 2.0, -4.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.3, 2.0, 1.0, -1.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 2.0, 2.0, 0.0 ); +let y = quantile( 1.9, 2.0, 2.0, 0.0 ); // returns NaN y = quantile( -0.1, 2.0, 2.0, 0.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 2.0, 2.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0, 0.0 ); +let y = quantile( NaN, 1.0, 1.0, 0.0 ); // returns NaN y = quantile( 0.9, NaN, 1.0, 0.0 ); @@ -97,7 +97,7 @@ y = quantile( 0.9, 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.1, -0.1, 1.0, 1.0 ); +let y = quantile( 0.1, -0.1, 1.0, 1.0 ); // returns NaN y = quantile( 0.1, 0.0, 1.0, 1.0 ); @@ -107,7 +107,7 @@ y = quantile( 0.1, 0.0, 1.0, 1.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.3, 1.0, -1.0, 1.0 ); +let y = quantile( 0.3, 1.0, -1.0, 1.0 ); // returns NaN y = quantile( 0.3, 1.0, 0.0, 1.0 ); @@ -119,9 +119,9 @@ y = quantile( 0.3, 1.0, 0.0, 1.0 ); Returns a function for evaluating the [quantile function][quantile] of a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m`. ```javascript -var myQuantile = quantile.factory( 3.0, 3.0, 5.0 ); +const myQuantile = quantile.factory( 3.0, 3.0, 5.0 ); -var y = myQuantile( 0.7 ); +let y = myQuantile( 0.7 ); // returns ~9.23 y = myQuantile( 0.2 ); @@ -139,22 +139,15 @@ y = myQuantile( 0.2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/frechet/quantile' ); - -var alpha; -var m; -var s; -var p; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - alpha = randu() * 10.0; - p = randu(); - s = randu() * 10.0; - m = randu() * 10.0; - y = quantile( p, alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/frechet/quantile' ); + +for ( let i = 0; i < 100; i++ ) { + const alpha = randu() * 10.0; + const p = randu(); + const s = randu() * 10.0; + const m = randu() * 10.0; + const y = quantile( p, alpha, s, m ); console.log( 'x: %d, α: %d, s: %d, m: %d, Q(p;α,s,m): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/skewness/README.md index b5bdf1c27a02..6a25eda6a026 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/skewness/README.md @@ -54,7 +54,7 @@ where `Γ` is the [gamma function][gamma-function]. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/frechet/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/frechet/skewness' ); ``` #### skewness( alpha, s, m ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/frechet/skewness' ); Returns the [skewness][skewness] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = skewness( 4.0, 1.0, 1.0 ); +let y = skewness( 4.0, 1.0, 1.0 ); // returns ~5.605 y = skewness( 4.0, 8.0, -3.0 ); @@ -75,14 +75,14 @@ y = skewness( 5.0, 1.0, 2.0 ); If `0 < alpha <= 3`, the function returns `+Infinity`. ```javascript -var y = skewness( 2.5, 1.0, 1.0 ); +const y = skewness( 2.5, 1.0, 1.0 ); // returns Infinity ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0, -2.0 ); +let y = skewness( NaN, 1.0, -2.0 ); // returns NaN y = skewness( 1.0, NaN, -2.0 ); @@ -95,7 +95,7 @@ y = skewness( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 3.0, 2.0 ); +let y = skewness( 0.0, 3.0, 2.0 ); // returns NaN y = skewness( -1.0, 3.0, 2.0 ); @@ -105,7 +105,7 @@ y = skewness( -1.0, 3.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 1.0, 0.0, 2.0 ); +let y = skewness( 1.0, 0.0, 2.0 ); // returns NaN y = skewness( 1.0, -1.0, 2.0 ); @@ -133,21 +133,15 @@ y = skewness( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/frechet/skewness' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = skewness( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/frechet/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = skewness( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, skew(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/stdev/README.md index f315c0425c7e..e1c5336f062d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/stdev/README.md @@ -54,7 +54,7 @@ where `Γ` is the [gamma function][gamma-function]. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/frechet/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/frechet/stdev' ); ``` #### stdev( alpha, s, m ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/frechet/stdev' ); Returns the [standard deviation][standard-deviation] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = stdev( 3.0, 1.0, 1.0 ); +let y = stdev( 3.0, 1.0, 1.0 ); // returns ~0.919 y = stdev( 3.0, 2.0, -3.0 ); @@ -75,14 +75,14 @@ y = stdev( 5.0, 1.0, 2.0 ); If `0 < alpha <= 2.0`, the function returns `+Infinity`. ```javascript -var y = stdev( 1.0, 1.0, 1.0 ); +const y = stdev( 1.0, 1.0, 1.0 ); // returns Infinity ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0, -2.0 ); +let y = stdev( NaN, 1.0, -2.0 ); // returns NaN y = stdev( 1.0, NaN, -2.0 ); @@ -95,7 +95,7 @@ y = stdev( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 3.0, 2.0 ); +let y = stdev( 0.0, 3.0, 2.0 ); // returns NaN y = stdev( 0.0, -1.0, 2.0 ); @@ -105,7 +105,7 @@ y = stdev( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 1.0, 0.0, 2.0 ); +let y = stdev( 1.0, 0.0, 2.0 ); // returns NaN y = stdev( 1.0, -1.0, 2.0 ); @@ -133,21 +133,15 @@ y = stdev( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/frechet/stdev' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = stdev( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/frechet/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = stdev( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, SD(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/variance/README.md index be4cdea51204..635b75c000c1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/variance/README.md @@ -54,7 +54,7 @@ where `Γ` is the [gamma function][gamma-function]. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/frechet/variance' ); +const variance = require( '@stdlib/stats/base/dists/frechet/variance' ); ``` #### variance( alpha, s, m ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/frechet/variance' ); Returns the [variance][variance] for a [Fréchet][frechet-distribution] distribution with shape `alpha > 0`, scale `s > 0`, and location parameter `m`. ```javascript -var y = variance( 3.0, 1.0, 1.0 ); +let y = variance( 3.0, 1.0, 1.0 ); // returns ~0.845 y = variance( 3.0, 2.0, -3.0 ); @@ -75,14 +75,14 @@ y = variance( 5.0, 1.0, 2.0 ); If `0 < alpha <= 2.0`, the function returns `+Infinity`. ```javascript -var y = variance( 1.0, 1.0, 1.0 ); +const y = variance( 1.0, 1.0, 1.0 ); // returns Infinity ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0, -2.0 ); +let y = variance( NaN, 1.0, -2.0 ); // returns NaN y = variance( 1.0, NaN, -2.0 ); @@ -95,7 +95,7 @@ y = variance( 1.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 3.0, 2.0 ); +let y = variance( 0.0, 3.0, 2.0 ); // returns NaN y = variance( 0.0, -1.0, 2.0 ); @@ -105,7 +105,7 @@ y = variance( 0.0, -1.0, 2.0 ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = variance( 1.0, 0.0, 2.0 ); +let y = variance( 1.0, 0.0, 2.0 ); // returns NaN y = variance( 1.0, -1.0, 2.0 ); @@ -133,21 +133,15 @@ y = variance( 1.0, -1.0, 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/frechet/variance' ); - -var alpha; -var m; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*20.0 ) + EPS; - s = ( randu()*20.0 ) + EPS; - m = ( randu()*20.0 ) - 40.0; - y = variance( alpha, s, m ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/frechet/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*20.0 ) + EPS; + const s = ( randu()*20.0 ) + EPS; + const m = ( randu()*20.0 ) - 40.0; + const y = variance( alpha, s, m ); console.log( 'α: %d, s: %d, m: %d, Var(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/README.md index 5c822d0c2b61..dc833534d140 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gamma = require( '@stdlib/stats/base/dists/gamma' ); +const gamma = require( '@stdlib/stats/base/dists/gamma' ); ``` #### gamma @@ -35,7 +35,7 @@ var gamma = require( '@stdlib/stats/base/dists/gamma' ); Gamma distribution. ```javascript -var dist = gamma; +const dist = gamma; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [gamma][gamma-distr ```javascript -var Gamma = require( '@stdlib/stats/base/dists/gamma' ).Gamma; +const Gamma = require( '@stdlib/stats/base/dists/gamma' ).Gamma; -var dist = new Gamma( 2.0, 4.0 ); +const dist = new Gamma( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.594 ``` @@ -108,29 +108,29 @@ var y = dist.cdf( 0.5 ); ```javascript -var gammaRandomFactory = require( '@stdlib/random/base/gamma' ).factory; -var filledarrayby = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variance = require( '@stdlib/stats/base/variance' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var mean = require( '@stdlib/stats/base/mean' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var gamma = require( '@stdlib/stats/base/dists/gamma' ); +const gammaRandomFactory = require( '@stdlib/random/base/gamma' ).factory; +const filledarrayby = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variance = require( '@stdlib/stats/base/variance' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const mean = require( '@stdlib/stats/base/mean' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const gamma = require( '@stdlib/stats/base/dists/gamma' ); // Define the shape and scale parameters: -var alpha = 3.0; // shape parameter (α) -var beta = 2.0; // scale parameter (β) +const alpha = 3.0; // shape parameter (α) +const beta = 2.0; // scale parameter (β) // Generate an array of x values: -var x = linspace( 0.0, 20.0, 100 ); +const x = linspace( 0.0, 20.0, 100 ); // Compute the PDF for each x: -var gammaPDF = gamma.pdf.factory( alpha, beta ); -var pdf = filledarrayby( x.length, 'float64', gammaPDF ); +const gammaPDF = gamma.pdf.factory( alpha, beta ); +const pdf = filledarrayby( x.length, 'float64', gammaPDF ); // Compute the CDF for each x: -var gammaCDF = gamma.cdf.factory( alpha, beta ); -var cdf = filledarrayby( x.length, 'float64', gammaCDF ); +const gammaCDF = gamma.cdf.factory( alpha, beta ); +const cdf = filledarrayby( x.length, 'float64', gammaCDF ); // Output the PDF and CDF values: console.log( 'x values: %s', x ); @@ -138,10 +138,10 @@ console.log( 'PDF values: %s', pdf ); console.log( 'CDF values: %s', cdf ); // Compute statistical properties: -var theoreticalMean = gamma.mean( alpha, beta ); -var theoreticalVariance = gamma.variance( alpha, beta ); -var theoreticalSkewness = gamma.skewness( alpha, beta ); -var theoreticalKurtosis = gamma.kurtosis( alpha, beta ); +const theoreticalMean = gamma.mean( alpha, beta ); +const theoreticalVariance = gamma.variance( alpha, beta ); +const theoreticalSkewness = gamma.skewness( alpha, beta ); +const theoreticalKurtosis = gamma.kurtosis( alpha, beta ); console.log( 'Theoretical Mean: %s', theoreticalMean ); console.log( 'Theoretical Variance: %s', theoreticalVariance ); @@ -149,13 +149,13 @@ console.log( 'Skewness: %s', theoreticalSkewness ); console.log( 'Kurtosis: %s', theoreticalKurtosis ); // Generate random samples from the gamma distribution: -var rgamma = gammaRandomFactory( alpha, beta ); -var n = 300; -var samples = filledarrayby( n, 'float64', rgamma ); +const rgamma = gammaRandomFactory( alpha, beta ); +const n = 300; +const samples = filledarrayby( n, 'float64', rgamma ); // Compute sample mean and variance: -var sampleMean = mean( n, samples, 1 ); -var sampleVariance = variance( n, 1, samples, 1 ); +const sampleMean = mean( n, samples, 1 ); +const sampleVariance = variance( n, 1, samples, 1 ); console.log( 'Sample Mean: %s', sampleMean ); console.log( 'Sample Variance: %s', sampleVariance ); @@ -165,31 +165,28 @@ console.log( 'Difference in Mean: %s', abs( theoreticalMean - sampleMean ) ); console.log( 'Difference in Variance: %s', abs( theoreticalVariance - sampleVariance ) ); // Demonstrate that the sum of `k` gamma variables is a gamma-distributed sum of `k` gamma(α, β) variables with same β is `gamma(k*α, β)`: -var k = 5; -var sumSamples = new Float64Array( n ); - -var sum; -var i; -var j; -for ( i = 0; i < sumSamples.length; i++ ) { - sum = 0.0; - for ( j = 0; j < k; j++ ) { +const k = 5; +const sumSamples = new Float64Array( n ); + +for ( let i = 0; i < sumSamples.length; i++ ) { + let sum = 0.0; + for ( let j = 0; j < k; j++ ) { sum += rgamma(); } sumSamples[ i ] = sum; } // Theoretical parameters for the sum: -var sumAlpha = k * alpha; -var sumMean = gamma.mean( sumAlpha, beta ); -var sumVariance = gamma.variance( sumAlpha, beta ); +const sumAlpha = k * alpha; +const sumMean = gamma.mean( sumAlpha, beta ); +const sumVariance = gamma.variance( sumAlpha, beta ); console.log( 'Sum Theoretical Mean: %s', sumMean ); console.log( 'Sum Theoretical Variance: %s', sumVariance ); // Compute sample mean and variance for the sum: -var sumSampleMean = mean( sumSamples.length, sumSamples, 1 ); -var sumSampleVariance = variance( sumSamples.length, 1, sumSamples, 1 ); +const sumSampleMean = mean( sumSamples.length, sumSamples, 1 ); +const sumSampleVariance = variance( sumSamples.length, 1, sumSamples, 1 ); console.log( 'Sum Sample Mean: %s', sumSampleMean ); console.log( 'Sum Sample Variance: %s', sumSampleVariance ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/cdf/README.md index 451e559295bf..f31fa0a25f17 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/cdf/README.md @@ -50,7 +50,7 @@ where `alpha` is the shape parameter and `beta` is the rate parameter of the dis ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/gamma/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/gamma/cdf' ); ``` #### cdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/gamma/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = cdf( 2.0, 1.0, 1.0 ); +let y = cdf( 2.0, 1.0, 1.0 ); // returns ~0.865 y = cdf( 2.0, 3.0, 1.0 ); @@ -77,7 +77,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -90,14 +90,14 @@ y = cdf( 0.0, 1.0, NaN ); If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +const y = cdf( 2.0, -1.0, 0.5 ); // returns NaN ``` If provided `alpha = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( 2.0, 0.0, 2.0 ); +let y = cdf( 2.0, 0.0, 2.0 ); // returns 1.0 y = cdf( -2.0, 0.0, 2.0 ); @@ -110,7 +110,7 @@ y = cdf( 0.0, 0.0, 2.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +const y = cdf( 2.0, 0.5, -1.0 ); // returns NaN ``` @@ -119,9 +119,9 @@ var y = cdf( 2.0, 0.5, -1.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mycdf = cdf.factory( 0.5, 0.1 ); +const mycdf = cdf.factory( 0.5, 0.1 ); -var y = mycdf( 12.0 ); +let y = mycdf( 12.0 ); // returns ~0.879 y = mycdf( 8.0 ); @@ -139,20 +139,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/gamma/cdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 3.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = cdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/gamma/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 3.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = cdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, F(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/ctor/README.md index 2f92d1651282..c4da52aee8f5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Gamma = require( '@stdlib/stats/base/dists/gamma/ctor' ); +const Gamma = require( '@stdlib/stats/base/dists/gamma/ctor' ); ``` #### Gamma( \[alpha, beta] ) @@ -45,18 +45,18 @@ var Gamma = require( '@stdlib/stats/base/dists/gamma/ctor' ); Returns a [gamma][gamma-distribution] distribution object. ```javascript -var gamma = new Gamma(); +const gamma = new Gamma(); -var mode = gamma.mode; +const mode = gamma.mode; // returns 0.0 ``` By default, `alpha = 1.0` and `beta = 1.0`. To create a distribution having a different `alpha` (shape parameter) and `beta` (rate parameter), provide the corresponding arguments. ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var mu = gamma.mean; +const mu = gamma.mean; // returns 0.5 ``` @@ -73,9 +73,9 @@ A [gamma][gamma-distribution] distribution object has the following properties a Shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var gamma = new Gamma(); +const gamma = new Gamma(); -var alpha = gamma.alpha; +let alpha = gamma.alpha; // returns 1.0 gamma.alpha = 3.0; @@ -89,9 +89,9 @@ alpha = gamma.alpha; Rate parameter of the distribution. `beta` **must** be a positive number. ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var b = gamma.beta; +let b = gamma.beta; // returns 4.0 gamma.beta = 3.0; @@ -109,9 +109,9 @@ b = gamma.beta; Returns the [differential entropy][entropy]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var entropy = gamma.entropy; +const entropy = gamma.entropy; // returns ~-0.462 ``` @@ -120,9 +120,9 @@ var entropy = gamma.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var kurtosis = gamma.kurtosis; +const kurtosis = gamma.kurtosis; // returns 1.5 ``` @@ -131,9 +131,9 @@ var kurtosis = gamma.kurtosis; Returns the [expected value][expected-value]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var mu = gamma.mean; +const mu = gamma.mean; // returns ~0.333 ``` @@ -142,9 +142,9 @@ var mu = gamma.mean; Returns the [mode][mode]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var mode = gamma.mode; +const mode = gamma.mode; // returns 0.25 ``` @@ -153,9 +153,9 @@ var mode = gamma.mode; Returns the [skewness][skewness]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var skewness = gamma.skewness; +const skewness = gamma.skewness; // returns 1.0 ``` @@ -164,9 +164,9 @@ var skewness = gamma.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var s = gamma.stdev; +const s = gamma.stdev; // returns ~0.167 ``` @@ -175,9 +175,9 @@ var s = gamma.stdev; Returns the [variance][variance]. ```javascript -var gamma = new Gamma( 4.0, 12.0 ); +const gamma = new Gamma( 4.0, 12.0 ); -var s2 = gamma.variance; +const s2 = gamma.variance; // returns ~0.028 ``` @@ -190,9 +190,9 @@ var s2 = gamma.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.cdf( 0.5 ); +const y = gamma.cdf( 0.5 ); // returns ~0.594 ``` @@ -201,9 +201,9 @@ var y = gamma.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.logcdf( 0.5 ); +const y = gamma.logcdf( 0.5 ); // returns ~-0.521 ``` @@ -212,9 +212,9 @@ var y = gamma.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.logpdf( 0.8 ); +const y = gamma.logpdf( 0.8 ); // returns ~-0.651 ``` @@ -223,9 +223,9 @@ var y = gamma.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.mgf( 0.5 ); +const y = gamma.mgf( 0.5 ); // returns ~1.306 ``` @@ -234,9 +234,9 @@ var y = gamma.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.pdf( 0.8 ); +const y = gamma.pdf( 0.8 ); // returns ~0.522 ``` @@ -245,9 +245,9 @@ var y = gamma.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var y = gamma.quantile( 0.5 ); +let y = gamma.quantile( 0.5 ); // returns ~0.42 y = gamma.quantile( 1.9 ); @@ -277,20 +277,20 @@ y = gamma.quantile( 1.9 ); ```javascript -var Gamma = require( '@stdlib/stats/base/dists/gamma/ctor' ); +const Gamma = require( '@stdlib/stats/base/dists/gamma/ctor' ); -var gamma = new Gamma( 2.0, 4.0 ); +const gamma = new Gamma( 2.0, 4.0 ); -var mu = gamma.mean; +const mu = gamma.mean; // returns 0.5 -var mode = gamma.mode; +const mode = gamma.mode; // returns 0.25 -var s2 = gamma.variance; +const s2 = gamma.variance; // returns 0.125 -var y = gamma.cdf( 0.8 ); +const y = gamma.cdf( 0.8 ); // returns ~0.829 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/entropy/README.md index 6e507ce84b0d..e3ea9bc431e7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/entropy/README.md @@ -54,7 +54,7 @@ where `Γ` and `Ψ` denote the [gamma][gamma-function] and [digamma][digamma] fu ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/gamma/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/gamma/entropy' ); ``` #### entropy( alpha, beta ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/gamma/entropy' ); Returns the [differential entropy][entropy] of a [gamma][gamma-distribution] distribution with shape parameter `alpha` and rate parameter `beta` (in [nats][nats]). ```javascript -var v = entropy( 1.0, 1.0 ); +let v = entropy( 1.0, 1.0 ); // returns 1.0 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, 0.0 ); +let v = entropy( 1.0, 0.0 ); // returns NaN v = entropy( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/gamma/entropy' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = entropy( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/gamma/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = entropy( alpha, beta ); console.log( 'α: %d, β: %d, h(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/README.md index 48f01d355f51..1f0cef524f9d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [gamma][gamma-distribution] random variabl ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/gamma/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/gamma/kurtosis' ); ``` #### kurtosis( alpha, beta ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/gamma/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = kurtosis( 1.0, 1.0 ); +let v = kurtosis( 1.0, 1.0 ); // returns 6.0 v = kurtosis( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = kurtosis( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -83,7 +83,7 @@ v = kurtosis( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns NaN v = kurtosis( -1.0, 1.0 ); @@ -93,7 +93,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 0.0 ); +let v = kurtosis( 1.0, 0.0 ); // returns NaN v = kurtosis( 1.0, -1.0 ); @@ -121,19 +121,14 @@ v = kurtosis( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/gamma/kurtosis' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = kurtosis( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/gamma/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = kurtosis( alpha, beta ); console.log( 'α: %d, β: %d, Kurt(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/logcdf/README.md index b138964cace6..d259efa980c9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/logcdf/README.md @@ -50,7 +50,7 @@ where `alpha` is the shape parameter and `beta` is the rate parameter of the dis ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/gamma/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/gamma/logcdf' ); ``` #### logcdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/gamma/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = logcdf( 2.0, 0.5, 1.0 ); +let y = logcdf( 2.0, 0.5, 1.0 ); // returns ~-0.047 y = logcdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = logcdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -0.5, 1.0 ); +const y = logcdf( 2.0, -0.5, 1.0 ); // returns NaN ``` If provided `alpha = 0`, the function evaluates the logarithm of the [CDF][cdf] for a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logcdf( 2.0, 0.0, 2.0 ); +let y = logcdf( 2.0, 0.0, 2.0 ); // returns 0.0 y = logcdf( -2.0, 0.0, 2.0 ); @@ -104,7 +104,7 @@ y = logcdf( 0.0, 0.0, 2.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 1.0, 0.0 ); +let y = logcdf( 2.0, 1.0, 0.0 ); // returns NaN y = logcdf( 2.0, 1.0, -1.0 ); @@ -116,9 +116,9 @@ y = logcdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [CDF][cdf] for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mylogcdf = logcdf.factory( 3.0, 1.5 ); +const mylogcdf = logcdf.factory( 3.0, 1.5 ); -var y = mylogcdf( 1.0 ); +let y = mylogcdf( 1.0 ); // returns ~-1.655 y = mylogcdf( 4.0 ); @@ -136,20 +136,14 @@ y = mylogcdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/gamma/logcdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 3.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = logcdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/gamma/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 3.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = logcdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(F(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/README.md index 6f19ff51b1ce..e1721c23af1c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/README.md @@ -50,7 +50,7 @@ where `α > 0` is the shape parameter and `β > 0` is the rate parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/gamma/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/gamma/logpdf' ); ``` #### logpdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/gamma/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = logpdf( 2.0, 0.5, 1.0 ); +let y = logpdf( 2.0, 0.5, 1.0 ); // returns ~-2.919 y = logpdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -0.5, 1.0 ); +const y = logpdf( 2.0, -0.5, 1.0 ); // returns NaN ``` If provided `alpha = 0`, the function evaluates the logarithm of the [PDF][pdf] for a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logpdf( 2.0, 0.0, 2.0 ); +let y = logpdf( 2.0, 0.0, 2.0 ); // returns -Infinity y = logpdf( 0.0, 0.0, 2.0 ); @@ -101,7 +101,7 @@ y = logpdf( 0.0, 0.0, 2.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 1.0, 0.0 ); +let y = logpdf( 2.0, 1.0, 0.0 ); // returns NaN y = logpdf( 2.0, 1.0, -1.0 ); @@ -113,9 +113,9 @@ y = logpdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mylogpdf = logpdf.factory( 3.0, 1.5 ); +const mylogpdf = logpdf.factory( 3.0, 1.5 ); -var y = mylogpdf( 1.0 ); +let y = mylogpdf( 1.0 ); // returns ~-0.977 y = mylogpdf( 4.0 ); @@ -133,20 +133,14 @@ y = mylogpdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/gamma/logpdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 3.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = logpdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/gamma/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 3.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = logpdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(f(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/mean/README.md index b78db5007cf1..aa9b0e2aa0c5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/mean/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter `β > 0` is the rate parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/gamma/mean' ); +const mean = require( '@stdlib/stats/base/dists/gamma/mean' ); ``` #### mean( alpha, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/gamma/mean' ); Returns the [expected value][expected-value] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = mean( 1.0, 1.0 ); +let v = mean( 1.0, 1.0 ); // returns 1.0 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mean( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.0 ); +let v = mean( 1.0, 0.0 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/gamma/mean' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mean( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/gamma/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mean( alpha, beta ); console.log( 'α: %d, β: %d, E(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/mgf/README.md index 1553aa987082..7ca28e8c165b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/mgf/README.md @@ -54,7 +54,7 @@ where `alpha` is the shape parameter and `beta` is the rate parameter. For `t >= ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/gamma/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/gamma/mgf' ); ``` #### mgf( t, alpha, beta ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/gamma/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = mgf( 0.5, 0.5, 1.0 ); +let y = mgf( 0.5, 0.5, 1.0 ); // returns ~1.414 y = mgf( 0.1, 1.0, 1.0 ); @@ -75,7 +75,7 @@ y = mgf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1.0, 1.0 ); +let y = mgf( NaN, 1.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,21 +88,21 @@ y = mgf( 0.0, 1.0, NaN ); If provided `t >= beta`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 4.0, 1.0 ); +const y = mgf( 2.0, 4.0, 1.0 ); // returns NaN ``` If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, -0.5, 1.0 ); +const y = mgf( 2.0, -0.5, 1.0 ); // returns NaN ``` If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 1.0, 0.0 ); +let y = mgf( 2.0, 1.0, 0.0 ); // returns NaN y = mgf( 2.0, 1.0, -1.0 ); @@ -114,9 +114,9 @@ y = mgf( 2.0, 1.0, -1.0 ); Returns a function for evaluating the [MGF][mgf] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mymgf = mgf.factory( 3.0, 1.5 ); +const mymgf = mgf.factory( 3.0, 1.5 ); -var y = mymgf( 1.0 ); +let y = mymgf( 1.0 ); // returns ~27.0 y = mymgf( 0.5 ); @@ -144,20 +144,14 @@ y = mymgf( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/gamma/mgf' ); - -var a; -var b; -var t; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - a = randu() * 5.0; - b = a + (randu() * 5.0); - v = mgf( t, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/gamma/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const a = randu() * 5.0; + const b = a + (randu() * 5.0); + const v = mgf( t, a, b ); console.log( 't: %d, a: %d, b: %d, M_X(t;a,b): %d', t.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/mode/README.md index a2e61aedeb3d..04cd293f5a14 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/mode/README.md @@ -54,7 +54,7 @@ when shape `α >= 1` and rate `β > 0`. For other parameter values, the mode is ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/gamma/mode' ); +const mode = require( '@stdlib/stats/base/dists/gamma/mode' ); ``` #### mode( alpha, beta ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/gamma/mode' ); Returns the [mode][mode] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = mode( 1.0, 1.0 ); +let v = mode( 1.0, 1.0 ); // returns 0.0 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.0 ); +let v = mode( 1.0, 0.0 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/gamma/mode' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mode( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/gamma/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mode( alpha, beta ); console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/pdf/README.md index c7ebf1058867..75f3789e1efc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/pdf/README.md @@ -50,7 +50,7 @@ where `α > 0` is the shape parameter and `β > 0` is the rate parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/gamma/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/gamma/pdf' ); ``` #### pdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/gamma/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = pdf( 2.0, 0.5, 1.0 ); +let y = pdf( 2.0, 0.5, 1.0 ); // returns ~0.054 y = pdf( 0.1, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = pdf( 0.0, 1.0, NaN ); If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -0.5, 1.0 ); +const y = pdf( 2.0, -0.5, 1.0 ); // returns NaN ``` If provided `alpha = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = pdf( 2.0, 0.0, 2.0 ); +let y = pdf( 2.0, 0.0, 2.0 ); // returns 0.0 y = pdf( 0.0, 0.0, 2.0 ); @@ -101,7 +101,7 @@ y = pdf( 0.0, 0.0, 2.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1.0, 0.0 ); +let y = pdf( 2.0, 1.0, 0.0 ); // returns NaN y = pdf( 2.0, 1.0, -1.0 ); @@ -113,9 +113,9 @@ y = pdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mypdf = pdf.factory( 3.0, 1.5 ); +const mypdf = pdf.factory( 3.0, 1.5 ); -var y = mypdf( 1.0 ); +let y = mypdf( 1.0 ); // returns ~0.377 y = mypdf( 4.0 ); @@ -133,20 +133,14 @@ y = mypdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/gamma/pdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 3.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = pdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/gamma/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 3.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = pdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, f(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/quantile/README.md index 1985484f4dda..e5cb32d08080 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/quantile/README.md @@ -46,7 +46,7 @@ for `0 <= p < 1`, where `alpha` is the shape parameter and `beta` is the rate pa ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/gamma/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/gamma/quantile' ); ``` #### quantile( p, alpha, beta ) @@ -54,7 +54,7 @@ var quantile = require( '@stdlib/stats/base/dists/gamma/quantile' ); Evaluates the [quantile function][quantile-function] for a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = quantile( 0.8, 2.0, 1.0 ); +let y = quantile( 0.8, 2.0, 1.0 ); // returns ~2.994 y = quantile( 0.5, 4.0, 2.0 ); @@ -64,7 +64,7 @@ y = quantile( 0.5, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -74,7 +74,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -87,14 +87,14 @@ y = quantile( 0.0, 1.0, NaN ); If provided `alpha < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +const y = quantile( 0.4, -1.0, 1.0 ); // returns NaN ``` If provided `alpha = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = quantile( 0.3, 0.0, 2.0 ); +let y = quantile( 0.3, 0.0, 2.0 ); // returns 0.0 y = quantile( 0.9, 0.0, 2.0 ); @@ -104,7 +104,7 @@ y = quantile( 0.9, 0.0, 2.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +const y = quantile( 0.4, 1.0, -1.0 ); // returns NaN ``` @@ -113,8 +113,8 @@ var y = quantile( 0.4, 1.0, -1.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var myquantile = quantile.factory( 2.0, 2.0 ); -var y = myquantile( 0.8 ); +const myquantile = quantile.factory( 2.0, 2.0 ); +let y = myquantile( 0.8 ); // returns ~1.497 y = myquantile( 0.4 ); @@ -132,20 +132,14 @@ y = myquantile( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/gamma/quantile' ); - -var alpha; -var beta; -var p; -var y; -var i; - -for ( i = 0; i < 20; i++ ) { - p = randu(); - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = quantile( p, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/gamma/quantile' ); + +for ( let i = 0; i < 20; i++ ) { + const p = randu(); + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = quantile( p, alpha, beta ); console.log( 'p: %d, α: %d, β: %d, Q(p;α,β): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/skewness/README.md index 2d62862e5f33..468aa3234137 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [gamma][gamma-distribution] random variable with ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/gamma/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/gamma/skewness' ); ``` #### skewness( alpha, beta ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/gamma/skewness' ); Returns the [skewness][skewness] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = skewness( 1.0, 1.0 ); +let v = skewness( 1.0, 1.0 ); // returns 2.0 v = skewness( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = skewness( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -83,7 +83,7 @@ v = skewness( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 0.0, 1.0 ); +let v = skewness( 0.0, 1.0 ); // returns NaN v = skewness( -1.0, 1.0 ); @@ -93,7 +93,7 @@ v = skewness( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 0.0 ); +let v = skewness( 1.0, 0.0 ); // returns NaN v = skewness( 1.0, -1.0 ); @@ -121,19 +121,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/gamma/skewness' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = skewness( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/gamma/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = skewness( alpha, beta ); console.log( 'α: %d, β: %d, skew(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/stdev/README.md index 264e7efc9b9c..93feca8a973d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/stdev/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter `β > 0` is the rate parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/gamma/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/gamma/stdev' ); ``` #### stdev( alpha, beta ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/gamma/stdev' ); Returns the [standard deviation][standard-deviation] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = stdev( 1.0, 1.0 ); +let v = stdev( 1.0, 1.0 ); // returns 1.0 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 0.0 ); +let v = stdev( 1.0, 0.0 ); // returns NaN v = stdev( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = stdev( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/gamma/stdev' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = stdev( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/gamma/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = stdev( alpha, beta ); console.log( 'α: %d, β: %d, SD(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gamma/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/gamma/variance/README.md index 0d99504ec713..1549351d8ed6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gamma/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gamma/variance/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter `β > 0` is the rate parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/gamma/variance' ); +const variance = require( '@stdlib/stats/base/dists/gamma/variance' ); ``` #### variance( alpha, beta ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/gamma/variance' ); Returns the [variance][variance] of a [gamma][gamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = variance( 1.0, 1.0 ); +let v = variance( 1.0, 1.0 ); // returns 1.0 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 0.0 ); +let v = variance( 1.0, 0.0 ); // returns NaN v = variance( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = variance( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/gamma/variance' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = variance( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/gamma/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = variance( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/README.md index 393445cb54f3..c76b934a6cfb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var geometric = require( '@stdlib/stats/base/dists/geometric' ); +const geometric = require( '@stdlib/stats/base/dists/geometric' ); ``` #### geometric @@ -35,7 +35,7 @@ var geometric = require( '@stdlib/stats/base/dists/geometric' ); Geometric distribution. ```javascript -var dist = geometric; +const dist = geometric; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [geometric][geometr ```javascript -var Geometric = require( '@stdlib/stats/base/dists/geometric' ).Geometric; +const Geometric = require( '@stdlib/stats/base/dists/geometric' ).Geometric; -var dist = new Geometric( 0.2 ); +const dist = new Geometric( 0.2 ); -var y = dist.logpmf( 3.0 ); +let y = dist.logpmf( 3.0 ); // returns ~-2.279 y = dist.logpmf( 2.3 ); @@ -112,28 +112,28 @@ y = dist.logpmf( 2.3 ); ```javascript -var geometricRandomFactory = require( '@stdlib/random/base/geometric' ).factory; -var negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var variance = require( '@stdlib/stats/base/variance' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var mean = require( '@stdlib/stats/base/mean' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var geometric = require( '@stdlib/stats/base/dists/geometric' ); +const geometricRandomFactory = require( '@stdlib/random/base/geometric' ).factory; +const negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const variance = require( '@stdlib/stats/base/variance' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const mean = require( '@stdlib/stats/base/mean' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const geometric = require( '@stdlib/stats/base/dists/geometric' ); // Define the success probability: -var p = 0.3; // Probability of success on each trial +const p = 0.3; // Probability of success on each trial // Generate an array of x values (number of failures before first success): -var x = linspace( 0, 10, 11 ); // Geometric distribution is discrete +const x = linspace( 0, 10, 11 ); // Geometric distribution is discrete // Compute the PMF for each x: -var geometricPMF = geometric.pmf.factory( p ); -var pmf = filledarrayBy( x.length, 'float64', geometricPMF ); +const geometricPMF = geometric.pmf.factory( p ); +const pmf = filledarrayBy( x.length, 'float64', geometricPMF ); // Compute the CDF for each x: -var geometricCDF = geometric.cdf.factory( p ); -var cdf = filledarrayBy( x.length, 'float64', geometricCDF ); +const geometricCDF = geometric.cdf.factory( p ); +const cdf = filledarrayBy( x.length, 'float64', geometricCDF ); // Output the PMF and CDF values: console.log( 'x values: ', x ); @@ -141,10 +141,10 @@ console.log( 'PMF values: ', pmf ); console.log( 'CDF values: ', cdf ); // Compute statistical properties: -var theoreticalMean = geometric.mean( p ); -var theoreticalVariance = geometric.variance( p ); -var theoreticalSkewness = geometric.skewness( p ); -var theoreticalKurtosis = geometric.kurtosis( p ); +const theoreticalMean = geometric.mean( p ); +const theoreticalVariance = geometric.variance( p ); +const theoreticalSkewness = geometric.skewness( p ); +const theoreticalKurtosis = geometric.kurtosis( p ); console.log( 'Theoretical Mean: ', theoreticalMean ); console.log( 'Theoretical Variance: ', theoreticalVariance ); @@ -152,47 +152,46 @@ console.log( 'Skewness: ', theoreticalSkewness ); console.log( 'Kurtosis: ', theoreticalKurtosis ); // Generate random samples from the geometric distribution: -var rgeom = geometricRandomFactory( p ); -var n = 1000; -var samples = filledarrayBy( n, 'float64', rgeom ); +const rgeom = geometricRandomFactory( p ); +const n = 1000; +const samples = filledarrayBy( n, 'float64', rgeom ); // Compute sample mean and variance: -var sampleMean = mean( n, samples, 1 ); -var sampleVariance = variance( n, 1, samples, 1 ); +const sampleMean = mean( n, samples, 1 ); +const sampleVariance = variance( n, 1, samples, 1 ); console.log( 'Sample Mean: ', sampleMean ); console.log( 'Sample Variance: ', sampleVariance ); // Demonstrate the memoryless property: -var s = 2.0; -var t = 3.0; -var prob1 = ( 1.0 - geometric.cdf( s + t - 1.0, p ) ) / +const s = 2.0; +const t = 3.0; +const prob1 = ( 1.0 - geometric.cdf( s + t - 1.0, p ) ) / ( 1.0 - geometric.cdf( s - 1.0, p ) ); -var prob2 = 1.0 - geometric.cdf( t - 1.0, p ); +const prob2 = 1.0 - geometric.cdf( t - 1.0, p ); console.log( 'P(X > s + t | X > s): ', prob1 ); console.log( 'P(X > t): ', prob2 ); console.log( 'Difference: ', abs( prob1 - prob2 ) ); // Demonstrate that the sum of k independent geometric random variables follows a negative binomial distribution: -var k = 5; +const k = 5; function drawSum() { - var sum = 0; - var j; - for ( j = 0; j < k; j++ ) { + let sum = 0; + for ( let j = 0; j < k; j++ ) { sum += rgeom(); } return sum; } -var sumSamples = filledarrayBy( n, 'float64', drawSum ); +const sumSamples = filledarrayBy( n, 'float64', drawSum ); // Compute sample mean and variance for the sum: -var sumSampleMean = mean( n, sumSamples, 1 ); -var sumSampleVariance = variance( n, 1, sumSamples, 1 ); +const sumSampleMean = mean( n, sumSamples, 1 ); +const sumSampleVariance = variance( n, 1, sumSamples, 1 ); // Theoretical mean and variance of Negative Binomial distribution: -var nbMean = negativeBinomial.mean( k, p ); -var nbVariance = negativeBinomial.variance( k, p ); +const nbMean = negativeBinomial.mean( k, p ); +const nbVariance = negativeBinomial.variance( k, p ); console.log( 'Sum Sample Mean: ', sumSampleMean ); console.log( 'Sum Sample Variance: ', sumSampleVariance ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/cdf/README.md index 90fe91b35cdc..d99b39345bee 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/cdf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. `x` denotes the number of _failu ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/geometric/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/geometric/cdf' ); ``` #### cdf( x, p ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/geometric/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var y = cdf( 2.0, 0.5 ); +let y = cdf( 2.0, 0.5 ); // returns 0.875 y = cdf( 2.0, 0.1 ); @@ -68,7 +68,7 @@ y = cdf( 2.0, 0.1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.5 ); +let y = cdf( NaN, 0.5 ); // returns NaN y = cdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = cdf( 0.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +let y = cdf( 2.0, -1.0 ); // returns NaN y = cdf( 2.0, 1.5 ); @@ -90,8 +90,8 @@ y = cdf( 2.0, 1.5 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [geometric][geometric-distribution] distribution with success probability `p` ```javascript -var mycdf = cdf.factory( 0.5 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 0.5 ); +let y = mycdf( 3.0 ); // returns 0.9375 y = mycdf( 1.0 ); @@ -109,18 +109,13 @@ y = mycdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/geometric/cdf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 5.0; - p = randu(); - y = cdf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/geometric/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 5.0; + const p = randu(); + const y = cdf( x, p ); console.log( 'x: %d, p: %d, F(x;p): %d', x.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/ctor/README.md index e4b606ca771a..74757eb60cb6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Geometric = require( '@stdlib/stats/base/dists/geometric/ctor' ); +const Geometric = require( '@stdlib/stats/base/dists/geometric/ctor' ); ``` #### Geometric( \[p] ) @@ -45,18 +45,18 @@ var Geometric = require( '@stdlib/stats/base/dists/geometric/ctor' ); Returns a [geometric][geometric-distribution] distribution object. ```javascript -var geometric = new Geometric(); +const geometric = new Geometric(); -var mean = geometric.mean; +const mean = geometric.mean; // returns 1.0 ``` By default, `p = 0.5`. To create a distribution having a different success probability `p`, provide a parameter value. ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var mean = geometric.mean; +const mean = geometric.mean; // returns 4.0 ``` @@ -73,9 +73,9 @@ A [geometric][geometric-distribution] distribution object has the following prop Success probability of the distribution. `p` **must** be a probability. ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var p = geometric.p; +let p = geometric.p; // returns 0.2 geometric.p = 0.3; @@ -93,9 +93,9 @@ p = geometric.p; Returns the [differential entropy][entropy]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var entropy = geometric.entropy; +const entropy = geometric.entropy; // returns ~1.683 ``` @@ -104,9 +104,9 @@ var entropy = geometric.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var kurtosis = geometric.kurtosis; +const kurtosis = geometric.kurtosis; // returns ~6.267 ``` @@ -115,9 +115,9 @@ var kurtosis = geometric.kurtosis; Returns the [median][expected-value]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var mu = geometric.mean; +const mu = geometric.mean; // returns ~1.5 ``` @@ -126,9 +126,9 @@ var mu = geometric.mean; Returns the [median][median]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var median = geometric.median; +const median = geometric.median; // returns 1.0 ``` @@ -137,9 +137,9 @@ var median = geometric.median; Returns the [mode][mode]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var mode = geometric.mode; +const mode = geometric.mode; // returns 0.0 ``` @@ -148,9 +148,9 @@ var mode = geometric.mode; Returns the [skewness][skewness]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var skewness = geometric.skewness; +const skewness = geometric.skewness; // returns ~2.066 ``` @@ -159,9 +159,9 @@ var skewness = geometric.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var s = geometric.stdev; +const s = geometric.stdev; // returns ~1.936 ``` @@ -170,9 +170,9 @@ var s = geometric.stdev; Returns the [variance][variance]. ```javascript -var geometric = new Geometric( 0.4 ); +const geometric = new Geometric( 0.4 ); -var s2 = geometric.variance; +const s2 = geometric.variance; // returns ~3.75 ``` @@ -185,9 +185,9 @@ var s2 = geometric.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.cdf( 0.5 ); +const y = geometric.cdf( 0.5 ); // returns ~0.2 ``` @@ -196,9 +196,9 @@ var y = geometric.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (logCDF). ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.logcdf( 0.5 ); +const y = geometric.logcdf( 0.5 ); // returns ~-1.609 ``` @@ -207,9 +207,9 @@ var y = geometric.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (logPMF). ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.logpmf( 3.0 ); +let y = geometric.logpmf( 3.0 ); // returns ~-2.279 y = geometric.logpmf( 2.3 ); @@ -221,9 +221,9 @@ y = geometric.logpmf( 2.3 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.mgf( 0.1 ); +const y = geometric.mgf( 0.1 ); // returns ~1.908 ``` @@ -232,9 +232,9 @@ var y = geometric.mgf( 0.1 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.pmf( 3.0 ); +let y = geometric.pmf( 3.0 ); // returns ~0.102 y = geometric.pmf( 2.3 ); @@ -246,9 +246,9 @@ y = geometric.pmf( 2.3 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var geometric = new Geometric( 0.2 ); +const geometric = new Geometric( 0.2 ); -var y = geometric.quantile( 0.5 ); +let y = geometric.quantile( 0.5 ); // returns 3.0 y = geometric.quantile( 1.9 ); @@ -278,20 +278,20 @@ y = geometric.quantile( 1.9 ); ```javascript -var Geometric = require( '@stdlib/stats/base/dists/geometric/ctor' ); +const Geometric = require( '@stdlib/stats/base/dists/geometric/ctor' ); -var geometric = new Geometric( 0.5 ); +const geometric = new Geometric( 0.5 ); -var mu = geometric.mean; +const mu = geometric.mean; // returns 1.0 -var mode = geometric.mode; +const mode = geometric.mode; // returns 0.0 -var s2 = geometric.variance; +const s2 = geometric.variance; // returns 2.0 -var y = geometric.cdf( 2.0 ); +const y = geometric.cdf( 2.0 ); // returns 0.875 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/entropy/README.md index a617a8b9fe14..b92573e4251b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/entropy/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/geometric/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/geometric/entropy' ); ``` #### entropy( p ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/geometric/entropy' ); Returns the [entropy][entropy] of a [geometric][geometric-distribution] distribution with success probability `p` (in [nats][nats]). ```javascript -var v = entropy( 0.1 ); +let v = entropy( 0.1 ); // returns ~3.251 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = entropy( NaN ); +let v = entropy( NaN ); // returns NaN v = entropy( 1.5 ); @@ -103,17 +103,13 @@ v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/geometric/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/geometric/entropy' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = entropy( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = entropy( p ); console.log( 'p: %d, H(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/kurtosis/README.md index 0416b41137fa..02468c92168c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/kurtosis/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/geometric/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/geometric/kurtosis' ); ``` #### kurtosis( p ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/geometric/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = kurtosis( 0.1 ); +let v = kurtosis( 0.1 ); // returns ~6.011 v = kurtosis( 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = kurtosis( NaN ); +let v = kurtosis( NaN ); // returns NaN v = kurtosis( 1.5 ); @@ -103,17 +103,13 @@ v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/geometric/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/geometric/kurtosis' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = kurtosis( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = kurtosis( p ); console.log( 'p: %d, Kurt(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/logcdf/README.md index 2120ab0cbe43..e7da297e3cdd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/logcdf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. `x` denotes the number of _failu ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/geometric/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/geometric/logcdf' ); ``` #### logcdf( x, p ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/geometric/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] for a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var y = logcdf( 2.0, 0.5 ); +let y = logcdf( 2.0, 0.5 ); // returns ~-0.134 y = logcdf( 2.0, 0.1 ); @@ -68,7 +68,7 @@ y = logcdf( 2.0, 0.1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.5 ); +let y = logcdf( NaN, 0.5 ); // returns NaN y = logcdf( 0.0, NaN ); @@ -78,7 +78,7 @@ y = logcdf( 0.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0 ); +let y = logcdf( 2.0, -1.0 ); // returns NaN y = logcdf( 2.0, 1.5 ); @@ -90,8 +90,8 @@ y = logcdf( 2.0, 1.5 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [geometric][geometric-distribution] distribution with success probability `p` ```javascript -var mylogcdf = logcdf.factory( 0.5 ); -var y = mylogcdf( 3.0 ); +const mylogcdf = logcdf.factory( 0.5 ); +let y = mylogcdf( 3.0 ); // returns ~-0.065 y = mylogcdf( 1.0 ); @@ -119,18 +119,13 @@ y = mylogcdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/geometric/logcdf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 5.0; - p = randu(); - y = logcdf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/geometric/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 5.0; + const p = randu(); + const y = logcdf( x, p ); console.log( 'x: %d, p: %d, ln(F(x;p)): %d', x.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/logpmf/README.md index af08bccc2ab7..611fdb3d20d2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/logpmf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. The random variable `X` denotes ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/geometric/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/geometric/logpmf' ); ``` #### logpmf( x, p ) @@ -58,7 +58,7 @@ var logpmf = require( '@stdlib/stats/base/dists/geometric/logpmf' ); Evaluates the logarithm of the [probability mass function][pmf] (PMF) of a [geometric][geometric-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var y = logpmf( 4.0, 0.3 ); +let y = logpmf( 4.0, 0.3 ); // returns ~-2.631 y = logpmf( 2.0, 0.7 ); @@ -71,7 +71,7 @@ y = logpmf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, 0.0 ); +let y = logpmf( NaN, 0.0 ); // returns NaN y = logpmf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = logpmf( 0.0, NaN ); If provided a success probability `p` outside of the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, -1.0 ); +let y = logpmf( 2.0, -1.0 ); // returns NaN y = logpmf( 2.0, 1.5 ); @@ -93,8 +93,8 @@ y = logpmf( 2.0, 1.5 ); Returns a function for evaluating the logarithm of the [probability mass function][pmf] (PMF) of a [geometric][geometric-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var mylogpmf = logpmf.factory( 0.5 ); -var y = mylogpmf( 3.0 ); +const mylogpmf = logpmf.factory( 0.5 ); +let y = mylogpmf( 3.0 ); // returns ~-2.773 y = mylogpmf( 1.0 ); @@ -122,19 +122,14 @@ y = mylogpmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/geometric/logpmf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 5.0 ); - p = randu(); - y = logpmf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/geometric/logpmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 5.0 ); + const p = randu(); + const y = logpmf( x, p ); console.log( 'x: %d, p: %d, ln( P( X = x; p ) ): %d', x, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/mean/README.md index fc6fe630c2bd..d3241e9b3101 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/mean/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/geometric/mean' ); +const mean = require( '@stdlib/stats/base/dists/geometric/mean' ); ``` #### mean( p ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/geometric/mean' ); Returns the [expected value][expected-value] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = mean( 0.1 ); +let v = mean( 0.1 ); // returns 9.0 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mean( NaN ); +let v = mean( NaN ); // returns NaN v = mean( 1.5 ); @@ -103,17 +103,13 @@ v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/geometric/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/geometric/mean' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = mean( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = mean( p ); console.log( 'p: %d, E(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/median/README.md index 2080b6adf45d..cbc72f4f94bb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/median/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/geometric/median' ); +const median = require( '@stdlib/stats/base/dists/geometric/median' ); ``` #### median( p ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/geometric/median' ); Returns the [median][median] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = median( 0.1 ); +let v = median( 0.1 ); // returns 6 v = median( 0.5 ); @@ -72,7 +72,7 @@ v = median( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = median( NaN ); +let v = median( NaN ); // returns NaN v = median( 1.5 ); @@ -103,17 +103,13 @@ v = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/geometric/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/geometric/median' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = median( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = median( p ); console.log( 'p: %d, Median(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/mgf/README.md index 76ba4b6fd13f..c9b782f639ff 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/mgf/README.md @@ -54,7 +54,7 @@ where `0 < p <= 1` is the success probability. For `t >= -ln(1-p)`, the MGF is n ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/geometric/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/geometric/mgf' ); ``` #### mgf( t, p ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/geometric/mgf' ); Evaluates the moment-generating function ([MGF][mgf]) of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var y = mgf( 0.2, 0.5 ); +let y = mgf( 0.2, 0.5 ); // returns ~1.569 y = mgf( 0.4, 0.5 ); @@ -72,7 +72,7 @@ y = mgf( 0.4, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0 ); +let y = mgf( NaN, 0.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -82,7 +82,7 @@ y = mgf( 0.0, NaN ); If provided a success probability `p` outside of the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = mgf( -2.0, -1.0 ); +let y = mgf( -2.0, -1.0 ); // returns NaN y = mgf( 0.2, 2.0 ); @@ -92,7 +92,7 @@ y = mgf( 0.2, 2.0 ); If `t >= -ln(1-p)`, the function returns `NaN`. ```javascript -var y = mgf( 0.8, 0.5 ); +const y = mgf( 0.8, 0.5 ); // returns NaN ``` @@ -101,8 +101,8 @@ var y = mgf( 0.8, 0.5 ); Returns a function for evaluating the [moment-generating function][mgf] of a [geometric][geometric-distribution] distribution with parameter `p` (success probability). ```javascript -var mymgf = mgf.factory( 0.8 ); -var y = mymgf( -0.2 ); +const mymgf = mgf.factory( 0.8 ); +const y = mymgf( -0.2 ); // returns ~0.783 ``` @@ -127,18 +127,13 @@ var y = mymgf( -0.2 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/geometric/mgf' ); - -var p; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - p = randu(); - y = mgf( t, p ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/geometric/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const p = randu(); + const y = mgf( t, p ); console.log( 't: %d, p: %d, M_X(t;p): %d', t, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/mode/README.md index 9f2b09c2f5d1..b4296acd4c67 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [geometric][geometric-distribution] random variable with ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/geometric/mode' ); +const mode = require( '@stdlib/stats/base/dists/geometric/mode' ); ``` #### mode( p ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/geometric/mode' ); Returns the [mode][mode] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = mode( 0.1 ); +let v = mode( 0.1 ); // returns 0 v = mode( 0.5 ); @@ -70,7 +70,7 @@ v = mode( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mode( NaN ); +let v = mode( NaN ); // returns NaN v = mode( 1.5 ); @@ -101,17 +101,13 @@ v = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/geometric/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/geometric/mode' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = mode( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = mode( p ); console.log( 'p: %d, mode(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/pmf/README.md index ede7166fba52..17b39d3a4e8d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/pmf/README.md @@ -50,7 +50,7 @@ where `0 <= p <= 1` is the success probability. The random variable `X` denotes ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/geometric/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/geometric/pmf' ); ``` #### pmf( x, p ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/geometric/pmf' ); Evaluates the [probability mass function][pmf] (PMF) of a [geometric][geometric-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var y = pmf( 4.0, 0.3 ); +let y = pmf( 4.0, 0.3 ); // returns ~0.072 y = pmf( 2.0, 0.7 ); @@ -71,7 +71,7 @@ y = pmf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 0.0 ); +let y = pmf( NaN, 0.0 ); // returns NaN y = pmf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = pmf( 0.0, NaN ); If provided a success probability `p` outside of the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, -1.0 ); +let y = pmf( 2.0, -1.0 ); // returns NaN y = pmf( 2.0, 1.5 ); @@ -93,8 +93,8 @@ y = pmf( 2.0, 1.5 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [geometric][geometric-distribution] distribution with success probability `0 <= p <= 1`. ```javascript -var mypmf = pmf.factory( 0.5 ); -var y = mypmf( 3.0 ); +const mypmf = pmf.factory( 0.5 ); +let y = mypmf( 3.0 ); // returns 0.0625 y = mypmf( 1.0 ); @@ -112,19 +112,14 @@ y = mypmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/geometric/pmf' ); - -var p; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 5.0 ); - p = randu(); - y = pmf( x, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/geometric/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 5.0 ); + const p = randu(); + const y = pmf( x, p ); console.log( 'x: %d, p: %d, P( X = x; p ): %d', x, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/quantile/README.md index 0c279173fb44..fec2cc6f572a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/quantile/README.md @@ -50,7 +50,7 @@ for `0 < r < 1`, where `p` is the success probability. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/geometric/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/geometric/quantile' ); ``` #### quantile( r, p ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/geometric/quantile' ); Evaluates the [quantile function][quantile-function] for a [geometric][geometric-distribution] distribution with success probability `p` at a value `r`. ```javascript -var y = quantile( 0.8, 0.4 ); +let y = quantile( 0.8, 0.4 ); // returns 3 y = quantile( 0.5, 0.4 ); @@ -71,7 +71,7 @@ y = quantile( 0.9, 0.1 ); If provided an input probability `r` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.5 ); +let y = quantile( 1.9, 0.5 ); // returns NaN y = quantile( -0.1, 0.5 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN ); @@ -91,7 +91,7 @@ y = quantile( 0.0, NaN ); If provided a success probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +let y = quantile( 0.4, -1.0 ); // returns NaN y = quantile( 0.4, 1.5 ); @@ -103,8 +103,8 @@ y = quantile( 0.4, 1.5 ); Returns a function for evaluating the [quantile function][quantile-function] for a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var myquantile = quantile.factory( 0.4 ); -var y = myquantile( 0.4 ); +const myquantile = quantile.factory( 0.4 ); +let y = myquantile( 0.4 ); // returns 0 y = myquantile( 0.8 ); @@ -125,18 +125,13 @@ y = myquantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/geometric/quantile' ); - -var p; -var r; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - r = randu(); - p = randu(); - y = quantile( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/geometric/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu(); + const p = randu(); + const y = quantile( r, p ); console.log( 'r: %d, p: %d, Q(r;p): %d', r.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/skewness/README.md index 3d9d73dc36ef..4abd0dba99ef 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/skewness/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/geometric/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/geometric/skewness' ); ``` #### skewness( p ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/geometric/skewness' ); Returns the [skewness][skewness] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = skewness( 0.1 ); +let v = skewness( 0.1 ); // returns ~2.003 v = skewness( 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = skewness( NaN ); +let v = skewness( NaN ); // returns NaN v = skewness( 1.5 ); @@ -103,17 +103,13 @@ v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/geometric/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/geometric/skewness' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = skewness( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = skewness( p ); console.log( 'p: %d, skew(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/stdev/README.md index 56c5e9633008..b08d8df48c22 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/stdev/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/geometric/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/geometric/stdev' ); ``` #### stdev( p ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/geometric/stdev' ); Returns the [standard deviation][standard-deviation] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = stdev( 0.1 ); +let v = stdev( 0.1 ); // returns ~9.487 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = stdev( NaN ); +let v = stdev( NaN ); // returns NaN v = stdev( 1.5 ); @@ -103,17 +103,13 @@ v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/geometric/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/geometric/stdev' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = stdev( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = stdev( p ); console.log( 'p: %d, SD(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/geometric/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/geometric/variance/README.md index 9885da6c0432..957a423d446c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/geometric/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/geometric/variance/README.md @@ -54,7 +54,7 @@ where `p` is the success probability. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/geometric/variance' ); +const variance = require( '@stdlib/stats/base/dists/geometric/variance' ); ``` #### variance( p ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/geometric/variance' ); Returns the [variance][variance] of a [geometric][geometric-distribution] distribution with success probability `p`. ```javascript -var v = variance( 0.1 ); +let v = variance( 0.1 ); // returns ~90.0 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = variance( NaN ); +let v = variance( NaN ); // returns NaN v = variance( 1.5 ); @@ -103,17 +103,13 @@ v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/geometric/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/geometric/variance' ); -var v; -var i; -var p; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = variance( p ); +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = variance( p ); console.log( 'p: %d, Var(X;p): %d', p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/README.md index 6ec8d8c0be09..9263c3f57bf4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var gumbel = require( '@stdlib/stats/base/dists/gumbel' ); +const gumbel = require( '@stdlib/stats/base/dists/gumbel' ); ``` #### gumbel @@ -35,7 +35,7 @@ var gumbel = require( '@stdlib/stats/base/dists/gumbel' ); Gumbel distribution. ```javascript -var dist = gumbel; +const dist = gumbel; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [Gumbel][gumbel-dis ```javascript -var Gumbel = require( '@stdlib/stats/base/dists/gumbel' ).Gumbel; +const Gumbel = require( '@stdlib/stats/base/dists/gumbel' ).Gumbel; -var dist = new Gumbel( 2.0, 4.0 ); +const dist = new Gumbel( 2.0, 4.0 ); -var y = dist.pdf( 2.0 ); +const y = dist.pdf( 2.0 ); // returns ~0.092 ``` @@ -109,32 +109,32 @@ var y = dist.pdf( 2.0 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var mean = require( '@stdlib/stats/base/mean' ); -var variance = require( '@stdlib/stats/base/variance' ); -var stdev = require( '@stdlib/stats/base/stdev' ); -var randGumbel = require( '@stdlib/random/base/gumbel' ).factory; -var gumbel = require( '@stdlib/stats/base/dists/gumbel' ); +const Float64Array = require( '@stdlib/array/float64' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const mean = require( '@stdlib/stats/base/mean' ); +const variance = require( '@stdlib/stats/base/variance' ); +const stdev = require( '@stdlib/stats/base/stdev' ); +const randGumbel = require( '@stdlib/random/base/gumbel' ).factory; +const gumbel = require( '@stdlib/stats/base/dists/gumbel' ); // Set the parameters of the Gumbel distribution: -var mu = 30.0; // Location parameter (e.g., average annual maximum temperature in °C) -var beta = 5.0; // Scale parameter +const mu = 30.0; // Location parameter (e.g., average annual maximum temperature in °C) +const beta = 5.0; // Scale parameter // Simulate annual maximum daily temperatures over 1000 years: -var N = 1000; -var rgumbel = randGumbel( mu, beta ); -var maxTemperatures = filledarrayBy( N, 'float64', rgumbel ); +const N = 1000; +const rgumbel = randGumbel( mu, beta ); +const maxTemperatures = filledarrayBy( N, 'float64', rgumbel ); // Compute theoretical statistics of the Gumbel distribution: -var theoreticalMean = gumbel.mean( mu, beta); -var theoreticalVariance = gumbel.variance( mu, beta ); -var theoreticalStdev = gumbel.stdev( mu, beta ); +const theoreticalMean = gumbel.mean( mu, beta); +const theoreticalVariance = gumbel.variance( mu, beta ); +const theoreticalStdev = gumbel.stdev( mu, beta ); // Compute sample statistics of the simulated data: -var sampleMean = mean( N, maxTemperatures, 1 ); -var sampleVariance = variance( N, 1, maxTemperatures, 1 ); // with Bessel's correction -var sampleStdev = stdev( N, 1, maxTemperatures, 1 ); // with Bessel's correction +const sampleMean = mean( N, maxTemperatures, 1 ); +const sampleVariance = variance( N, 1, maxTemperatures, 1 ); // with Bessel's correction +const sampleStdev = stdev( N, 1, maxTemperatures, 1 ); // with Bessel's correction // Display theoretical and sample statistics: console.log( '--- Statistical Comparison ---\n' ); @@ -149,17 +149,16 @@ console.log( ' Theoretical: %d°C', theoreticalStdev.toFixed(2) ); console.log( ' Sample: %d°C\n', sampleStdev.toFixed(2) ); // Define quantile probabilities: -var p = new Float64Array( [ 0.25, 0.5, 0.75 ] ); -var label = [ 'First Quartile', 'Median', 'Third Quartile' ]; -var theoreticalQuantiles = new Float64Array([ +const p = new Float64Array( [ 0.25, 0.5, 0.75 ] ); +const label = [ 'First Quartile', 'Median', 'Third Quartile' ]; +const theoreticalQuantiles = new Float64Array([ gumbel.quantile( p[0], mu, beta ), gumbel.quantile( p[1], mu, beta ), gumbel.quantile( p[2], mu, beta ) ]); console.log( 'Quantiles:' ); -var i; -for ( i = 0; i < p.length; i++ ) { +for ( let i = 0; i < p.length; i++ ) { console.log( label[i] + ': %d°C', theoreticalQuantiles[i].toFixed(2) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/cdf/README.md index 3473f5d3eb94..bec9f7cb1658 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/cdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/gumbel/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/gumbel/cdf' ); ``` #### cdf( x, mu, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/gumbel/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var y = cdf( 10.0, 0.0, 3.0 ); +let y = cdf( 10.0, 0.0, 3.0 ); // returns ~0.965 y = cdf( -2.0, 0.0, 3.0 ); @@ -71,7 +71,7 @@ y = cdf( 0.0, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +let y = cdf( 2.0, 0.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = cdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var mycdf = cdf.factory( 0.0, 3.0 ); +const mycdf = cdf.factory( 0.0, 3.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns ~0.965 y = mycdf( -2.0 ); @@ -116,20 +116,14 @@ y = mycdf( -2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/gumbel/cdf' ); - -var beta; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - beta = randu() * 10.0; - y = cdf( x, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/gumbel/cdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const beta = randu() * 10.0; + const y = cdf( x, mu, beta ); console.log( 'x: %d, µ: %d, β: %d, F(x;µ,β): %d', x.toFixed( 4 ), mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/ctor/README.md index 35890ade4265..21190bfa071e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Gumbel = require( '@stdlib/stats/base/dists/gumbel/ctor' ); +const Gumbel = require( '@stdlib/stats/base/dists/gumbel/ctor' ); ``` #### Gumbel( \[mu, beta] ) @@ -45,18 +45,18 @@ var Gumbel = require( '@stdlib/stats/base/dists/gumbel/ctor' ); Returns a [Gumbel][gumbel-distribution] distribution object. ```javascript -var gumbel = new Gumbel(); +const gumbel = new Gumbel(); -var mean = gumbel.mean; +const mean = gumbel.mean; // returns ~0.577 ``` By default, `mu = 0.0` and `beta = 1.0`. To create a distribution having a different `mu` (location parameter) and `beta` (scale parameter), provide the corresponding arguments. ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var mean = gumbel.mean; +const mean = gumbel.mean; // returns ~4.309 ``` @@ -73,9 +73,9 @@ A [Gumbel][gumbel-distribution] distribution object has the following properties Location parameter of the distribution. ```javascript -var gumbel = new Gumbel(); +const gumbel = new Gumbel(); -var mu = gumbel.mu; +let mu = gumbel.mu; // returns 0.0 gumbel.mu = 3.0; @@ -89,9 +89,9 @@ mu = gumbel.mu; Scale parameter of the distribution. `beta` **must** be a positive number. ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var beta = gumbel.beta; +let beta = gumbel.beta; // returns 4.0 gumbel.beta = 3.0; @@ -109,9 +109,9 @@ beta = gumbel.beta; Returns the [differential entropy][entropy]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var entropy = gumbel.entropy; +const entropy = gumbel.entropy; // returns ~4.062 ``` @@ -120,9 +120,9 @@ var entropy = gumbel.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var kurtosis = gumbel.kurtosis; +const kurtosis = gumbel.kurtosis; // returns 2.4 ``` @@ -131,9 +131,9 @@ var kurtosis = gumbel.kurtosis; Returns the [expected value][expected-value]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var mu = gumbel.mean; +const mu = gumbel.mean; // returns ~10.927 ``` @@ -142,9 +142,9 @@ var mu = gumbel.mean; Returns the [median][median]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var median = gumbel.median; +const median = gumbel.median; // returns ~8.398 ``` @@ -153,9 +153,9 @@ var median = gumbel.median; Returns the [mode][mode]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var mode = gumbel.mode; +const mode = gumbel.mode; // returns 4.0 ``` @@ -164,9 +164,9 @@ var mode = gumbel.mode; Returns the [skewness][skewness]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var skewness = gumbel.skewness; +const skewness = gumbel.skewness; // returns ~1.14 ``` @@ -175,9 +175,9 @@ var skewness = gumbel.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var s = gumbel.stdev; +const s = gumbel.stdev; // returns ~15.391 ``` @@ -186,9 +186,9 @@ var s = gumbel.stdev; Returns the [variance][variance]. ```javascript -var gumbel = new Gumbel( 4.0, 12.0 ); +const gumbel = new Gumbel( 4.0, 12.0 ); -var s2 = gumbel.variance; +const s2 = gumbel.variance; // returns ~236.871 ``` @@ -201,9 +201,9 @@ var s2 = gumbel.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.cdf( 0.5 ); +const y = gumbel.cdf( 0.5 ); // returns ~0.233 ``` @@ -212,9 +212,9 @@ var y = gumbel.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.logcdf( 2.0 ); +const y = gumbel.logcdf( 2.0 ); // returns -1.0 ``` @@ -223,9 +223,9 @@ var y = gumbel.logcdf( 2.0 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.logpdf( 0.8 ); +const y = gumbel.logpdf( 0.8 ); // returns ~-2.436 ``` @@ -234,9 +234,9 @@ var y = gumbel.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.mgf( 0.1 ); +const y = gumbel.mgf( 0.1 ); // returns ~1.819 ``` @@ -245,9 +245,9 @@ var y = gumbel.mgf( 0.1 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.pdf( 2.0 ); +const y = gumbel.pdf( 2.0 ); // returns ~0.092 ``` @@ -256,9 +256,9 @@ var y = gumbel.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var y = gumbel.quantile( 0.5 ); +let y = gumbel.quantile( 0.5 ); // returns ~3.466 y = gumbel.quantile( 1.9 ); @@ -288,20 +288,20 @@ y = gumbel.quantile( 1.9 ); ```javascript -var Gumbel = require( '@stdlib/stats/base/dists/gumbel/ctor' ); +const Gumbel = require( '@stdlib/stats/base/dists/gumbel/ctor' ); -var gumbel = new Gumbel( 2.0, 4.0 ); +const gumbel = new Gumbel( 2.0, 4.0 ); -var mean = gumbel.mean; +const mean = gumbel.mean; // returns ~4.309 -var median = gumbel.median; +const median = gumbel.median; // returns ~3.466 -var s2 = gumbel.variance; +const s2 = gumbel.variance; // returns ~26.319 -var y = gumbel.cdf( 0.8 ); +const y = gumbel.cdf( 0.8 ); // returns ~0.259 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/entropy/README.md index 4dd9e0babee8..b4a5751aacd0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/entropy/README.md @@ -54,7 +54,7 @@ where `γ` is the [Euler–Mascheroni constant][euler-mascheroni]. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/gumbel/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/gumbel/entropy' ); ``` #### entropy( mu, beta ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/gumbel/entropy' ); Returns the [differential entropy][entropy] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns ~1.577 y = entropy( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = entropy( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -85,7 +85,7 @@ y = entropy( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/gumbel/entropy' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = entropy( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/gumbel/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = entropy( mu, beta ); console.log( 'µ: %d, β: %d, h(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/README.md index 748486fc1e3b..c8528eaf5713 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [Gumbel][gumbel-distribution] random varia ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/gumbel/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/gumbel/kurtosis' ); ``` #### kurtosis( mu, beta ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/gumbel/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns 2.4 y = kurtosis( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -83,7 +83,7 @@ y = kurtosis( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/gumbel/kurtosis' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = kurtosis( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/gumbel/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = kurtosis( mu, beta ); console.log( 'µ: %d, β: %d, Kurt(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/logcdf/README.md index fa695ec13d1d..d89d2caf6b77 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/logcdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/gumbel/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/gumbel/logcdf' ); ``` #### logcdf( x, mu, beta ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/gumbel/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var y = logcdf( 10.0, 0.0, 3.0 ); +let y = logcdf( 10.0, 0.0, 3.0 ); // returns ~-0.036 y = logcdf( -2.0, 0.0, 3.0 ); @@ -71,7 +71,7 @@ y = logcdf( 0.0, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +let y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN y = logcdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = logcdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 0.0, 3.0 ); +const mylogcdf = logcdf.factory( 0.0, 3.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.036 y = mylogcdf( -2.0 ); @@ -126,20 +126,14 @@ y = mylogcdf( -2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/gumbel/logcdf' ); - -var beta; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - beta = randu() * 10.0; - y = logcdf( x, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/gumbel/logcdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const beta = randu() * 10.0; + const y = logcdf( x, mu, beta ); console.log( 'x: %d, µ: %d, β: %d, ln(F(x;µ,β)): %d', x.toFixed( 4 ), mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/logpdf/README.md index 15a3925528cc..40fa36978dc5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/logpdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/gumbel/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/gumbel/logpdf' ); ``` #### logpdf( x, mu, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/gumbel/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta > 0` (scale parameter). ```javascript -var y = logpdf( 0.0, 0.0, 2.0 ); +let y = logpdf( 0.0, 0.0, 2.0 ); // returns ~-1.693 y = logpdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = logpdf( 1.0, 3.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +let y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN y = logpdf( 2.0, 8.0, 0.0 ); @@ -96,7 +96,7 @@ y = logpdf( 2.0, 8.0, 0.0 ); Returns a `function` for evaluating the logarithm of the [PDF][pdf] (PDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta > 0` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); y = mylogpdf( 10.0 ); // returns ~-1.693 @@ -126,20 +126,14 @@ y = mylogpdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/gumbel/logpdf' ); - -var beta; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - beta = randu() * 10.0; - y = logpdf( x, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/gumbel/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const beta = randu() * 10.0; + const y = logpdf( x, mu, beta ); console.log( 'x: %d, µ: %d, β: %d, ln(f(x;µ,β)): %d', x, mu, beta, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mean/README.md index 0a7bb7c1f239..359fec5feb1f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mean/README.md @@ -54,7 +54,7 @@ where `γ` is the [Euler–Mascheroni constant][euler-mascheroni]. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/gumbel/mean' ); +const mean = require( '@stdlib/stats/base/dists/gumbel/mean' ); ``` #### mean( mu, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/gumbel/mean' ); Returns the [expected value][mean] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns ~2.577 y = mean( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -85,7 +85,7 @@ y = mean( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/gumbel/mean' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = mean( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/gumbel/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = mean( mu, beta ); console.log( 'µ: %d, β: %d, h(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/median/README.md index 6f82d803704e..6d59d2e243e9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/median/README.md @@ -54,7 +54,7 @@ where `μ` is the location parameter and `β` is the scale parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/gumbel/median' ); +const median = require( '@stdlib/stats/base/dists/gumbel/median' ); ``` #### median( mu, beta ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/gumbel/median' ); Returns the [median][median] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns ~2.367 y = median( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -85,7 +85,7 @@ y = median( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/gumbel/median' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = median( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/gumbel/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = median( mu, beta ); console.log( 'µ: %d, β: %d, Median(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mgf/README.md index ae2caca2d84b..0704d4284ab8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mgf/README.md @@ -54,7 +54,7 @@ where `mu` is the location parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/gumbel/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/gumbel/mgf' ); ``` #### mgf( t, mu, beta ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/gumbel/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta > 0` (scale parameter). ```javascript -var y = mgf( -1.0, 0.0, 3.0 ); +let y = mgf( -1.0, 0.0, 3.0 ); // returns 6.0 y = mgf( 0.1, 0.0, 3.0 ); @@ -75,7 +75,7 @@ y = mgf( 0.0, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,14 +88,14 @@ y = mgf( 0.0, 0.0, NaN ); If provided `t >= 1/beta`, the function returns `NaN`. ```javascript -var y = mgf( 0.8, 0.0, 2.0 ); +const y = mgf( 0.8, 0.0, 2.0 ); // returns NaN ``` If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, 0.0, -1.0 ); +let y = mgf( 0.5, 0.0, -1.0 ); // returns NaN y = mgf( 0.5, 0.0, 0.0 ); @@ -107,8 +107,8 @@ y = mgf( 0.5, 0.0, 0.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta > 0` (scale parameter). ```javascript -var myMGF = mgf.factory( 0.0, 2.0 ); -var y = myMGF( 0.2 ); +const myMGF = mgf.factory( 0.0, 2.0 ); +let y = myMGF( 0.2 ); // returns ~1.489 y = myMGF( -1.0 ); @@ -136,20 +136,14 @@ y = myMGF( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/gumbel/mgf' ); - -var beta; -var mu; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - mu = (randu() * 10.0) - 5.0; - beta = randu() * 20.0; - y = mgf( t, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/gumbel/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const mu = (randu() * 10.0) - 5.0; + const beta = randu() * 20.0; + const y = mgf( t, mu, beta ); console.log( 't: %d, µ: %d, β: %d, M_X(t;µ,β): %d', t.toFixed( 4 ), mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mode/README.md index a514155818cf..03287649391b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Gumbel][gumbel-distribution] random variable with locati ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/gumbel/mode' ); +const mode = require( '@stdlib/stats/base/dists/gumbel/mode' ); ``` #### mode( mu, beta ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/gumbel/mode' ); Returns the [mode][mode] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns 2.0 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/gumbel/mode' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = mode( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/gumbel/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = mode( mu, beta ); console.log( 'µ: %d, β: %d, mode(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/pdf/README.md index 054e0feef24d..7811ac5ebee6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/pdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/gumbel/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/gumbel/pdf' ); ``` #### pdf( x, mu, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/gumbel/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var y = pdf( 0.0, 0.0, 2.0 ); +let y = pdf( 0.0, 0.0, 2.0 ); // returns ~0.184 y = pdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( 1.0, 3.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +let y = pdf( 2.0, 0.0, -1.0 ); // returns NaN y = pdf( 2.0, 8.0, 0.0 ); @@ -96,7 +96,7 @@ y = pdf( 2.0, 8.0, 0.0 ); Partially applies `mu` and `beta` to create a reusable `function` for evaluating the PDF. ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); y = mypdf( 10.0 ); // returns ~0.184 @@ -116,20 +116,14 @@ y = mypdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/gumbel/pdf' ); - -var beta; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - beta = randu() * 10.0; - y = pdf( x, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/gumbel/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const beta = randu() * 10.0; + const y = pdf( x, mu, beta ); console.log( 'x: %d, µ: %d, β: %d, f(x;µ,β): %d', x, mu, beta, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/quantile/README.md index 68a3b6b3a1ba..51cf3a2cbd14 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `mu` is the location parameter and `beta > 0` is the sca ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/gumbel/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/gumbel/quantile' ); ``` #### quantile( p, mu, beta ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/gumbel/quantile' ); Evaluates the [quantile function][quantile-function] for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter). ```javascript -var y = quantile( 0.8, 0.0, 1.0 ); +let y = quantile( 0.8, 0.0, 1.0 ); // returns ~1.5 y = quantile( 0.5, 4.0, 2.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.5, 4.0, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +let y = quantile( 0.4, 0.0, -1.0 ); // returns NaN y = quantile( 0.4, 0.0, 0.0 ); @@ -106,9 +106,9 @@ y = quantile( 0.4, 0.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Gumbel][gumbel-distribution] distribution with parameters `mu` and `beta`. ```javascript -var myquantile = quantile.factory( 10.0, 2.0 ); +const myquantile = quantile.factory( 10.0, 2.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~9.048 y = myquantile( 0.8 ); @@ -126,20 +126,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/gumbel/quantile' ); - -var beta; -var mu; -var p; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - p = randu(); - mu = randu() * 10.0; - beta = randu() * 10.0; - y = quantile( p, mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/gumbel/quantile' ); + +for ( let i = 0; i < 100; i++ ) { + const p = randu(); + const mu = randu() * 10.0; + const beta = randu() * 10.0; + const y = quantile( p, mu, beta ); console.log( 'p: %d, µ: %d, β: %d, Q(p;µ,β): %d', p.toFixed( 4 ), mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness/README.md index e05a6efc824b..88b3062bebc3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness/README.md @@ -54,7 +54,7 @@ where `ζ` is the [Riemann zeta function][zeta]. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/gumbel/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/gumbel/skewness' ); ``` #### skewness( mu, beta ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/gumbel/skewness' ); Returns the [skewness][skewness] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns ~1.14 y = skewness( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = skewness( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -85,7 +85,7 @@ y = skewness( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/gumbel/skewness' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = skewness( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/gumbel/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = skewness( mu, beta ); console.log( 'µ: %d, β: %d, skew(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/stdev/README.md index 1c6cb47e5179..d50cf08c71d9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][standard-deviation] for a [Gumbel][gumbel-distribution] ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/gumbel/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/gumbel/stdev' ); ``` #### stdev( mu, beta ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/gumbel/stdev' ); Returns the [standard deviation][standard-deviation] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns ~1.283 y = stdev( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -83,7 +83,7 @@ y = stdev( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/gumbel/stdev' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = stdev( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/gumbel/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = stdev( mu, beta ); console.log( 'µ: %d, β: %d, SD(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/gumbel/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/gumbel/variance/README.md index 73c73d162518..98a512a899a4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/gumbel/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/gumbel/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [Gumbel][gumbel-distribution] random variable wit ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/gumbel/variance' ); +const variance = require( '@stdlib/stats/base/dists/gumbel/variance' ); ``` #### variance( mu, beta ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/gumbel/variance' ); Returns the [variance][variance] for a [Gumbel][gumbel-distribution] distribution with location parameter `mu` and scale parameter `beta`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns ~1.645 y = variance( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -83,7 +83,7 @@ y = variance( 0.0, NaN ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/gumbel/variance' ); - -var beta; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - beta = randu() * 20.0; - y = variance( mu, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/gumbel/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const beta = randu() * 20.0; + const y = variance( mu, beta ); console.log( 'µ: %d, β: %d, Var(X;µ,β): %d', mu.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/README.md index 9fae818416e6..82c8ea0e5924 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ); +const hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ); ``` #### hypergeometric @@ -35,7 +35,7 @@ var hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ); Hypergeometric distribution. ```javascript -var dist = hypergeometric; +const dist = hypergeometric; // returns {...} ``` @@ -84,11 +84,11 @@ The namespace contains a constructor function for creating a [hypergeometric][hy ```javascript -var Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ).Hypergeometric; +const Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ).Hypergeometric; -var dist = new Hypergeometric( 8, 2, 4 ); +const dist = new Hypergeometric( 8, 2, 4 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.214 ``` @@ -105,8 +105,8 @@ var y = dist.cdf( 0.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric' ); console.log( objectKeys( hypergeometric ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/README.md index 28d1c91d9632..6d7cd989a0c6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/README.md @@ -48,7 +48,7 @@ F(x;N,K,n) =\sum_{i=0}^{\lfloor x \rfloor} \frac{{K \choose i}{N-K \choose n-i}} ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' ); ``` #### cdf( x, N, K, n ) @@ -56,7 +56,7 @@ var cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var y = cdf( 1.0, 8, 4, 2 ); +let y = cdf( 1.0, 8, 4, 2 ); // returns ~0.786 y = cdf( 1.5, 8, 4, 2 ); @@ -72,7 +72,7 @@ y = cdf( 0.0, 8, 4, 2); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 10, 5, 2 ); +let y = cdf( NaN, 10, 5, 2 ); // returns NaN y = cdf( 0.0, NaN, 5, 2 ); @@ -88,7 +88,7 @@ y = cdf( 0.0, 10, 5, NaN ); If provided a population size `N`, subpopulation size `K` or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 10.5, 5, 2 ); +let y = cdf( 2.0, 10.5, 5, 2 ); // returns NaN y = cdf( 2.0, 10, 1.5, 2 ); @@ -101,7 +101,7 @@ y = cdf( 2.0, 10, 5, -2.0 ); If the number of draws `n` or subpopulation size `K` exceed the population size `N`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 10, 5, 12 ); +let y = cdf( 2.0, 10, 5, 12 ); // returns NaN y = cdf( 2.0, 8, 3, 9 ); @@ -113,8 +113,8 @@ y = cdf( 2.0, 8, 3, 9 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [hypergeometric ][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var mycdf = cdf.factory( 30, 20, 5 ); -var y = mycdf( 4.0 ); +const mycdf = cdf.factory( 30, 20, 5 ); +let y = mycdf( 4.0 ); // returns ~0.891 y = mycdf( 1.0 ); @@ -132,23 +132,16 @@ y = mycdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' ); - -var i; -var N; -var K; -var n; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - x = round( randu() * K ); - y = cdf( x, N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const x = round( randu() * K ); + const y = cdf( x, N, K, n ); console.log( 'x: %d, N: %d, K: %d, n: %d, F(x;N,K,n): %d', x.toFixed( 4 ), N, K, n, y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/ctor/README.md index f46c376bda99..a44590f66715 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric/ctor' ); +const Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric/ctor' ); ``` #### Hypergeometric( N, K, n ) @@ -45,9 +45,9 @@ var Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric/ctor' ); Returns a [hypergeometric][hypergeometric-distribution] distribution object with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var mu = hypergeometric.mean; +const mu = hypergeometric.mean; // returns 3.75 ``` @@ -64,9 +64,9 @@ A [hypergeometric][hypergeometric-distribution] distribution object has the foll Population size of the distribution. `N` **must** be a nonnegative integer that is both larger than or equal to `K` and `n`. ```javascript -var hypergeometric = new Hypergeometric( 100, 50, 20 ); +const hypergeometric = new Hypergeometric( 100, 50, 20 ); -var N = hypergeometric.N; +let N = hypergeometric.N; // returns 100.0 hypergeometric.N = 60; @@ -80,9 +80,9 @@ N = hypergeometric.N; Subpopulation size of the distribution. `K` **must** be a nonnegative integer that is smaller than or equal to `N`. ```javascript -var hypergeometric = new Hypergeometric( 100, 50, 20 ); +const hypergeometric = new Hypergeometric( 100, 50, 20 ); -var K = hypergeometric.K; +let K = hypergeometric.K; // returns 50.0 hypergeometric.K = 30; @@ -98,9 +98,9 @@ K = hypergeometric.K; Number of draws of the distribution. `n` **must** be a nonnegative integer that is smaller than or equal to `N`. ```javascript -var hypergeometric = new Hypergeometric( 100, 50, 20 ); +const hypergeometric = new Hypergeometric( 100, 50, 20 ); -var n = hypergeometric.n; +let n = hypergeometric.n; // returns 20.0 hypergeometric.n = 80; @@ -118,9 +118,9 @@ n = hypergeometric.n; Returns the [excess kurtosis][kurtosis]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var kurtosis = hypergeometric.kurtosis; +const kurtosis = hypergeometric.kurtosis; // returns ~-0.276 ``` @@ -129,9 +129,9 @@ var kurtosis = hypergeometric.kurtosis; Returns the [expected value][expected-value]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var mu = hypergeometric.mean; +const mu = hypergeometric.mean; // returns ~3.75 ``` @@ -140,9 +140,9 @@ var mu = hypergeometric.mean; Returns the [mode][mode]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var mode = hypergeometric.mode; +const mode = hypergeometric.mode; // returns 4.0 ``` @@ -151,9 +151,9 @@ var mode = hypergeometric.mode; Returns the [skewness][skewness]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var skewness = hypergeometric.skewness; +const skewness = hypergeometric.skewness; // returns ~-0.323 ``` @@ -162,9 +162,9 @@ var skewness = hypergeometric.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var s = hypergeometric.stdev; +const s = hypergeometric.stdev; // returns ~0.86 ``` @@ -173,9 +173,9 @@ var s = hypergeometric.stdev; Returns the [variance][variance]. ```javascript -var hypergeometric = new Hypergeometric( 20, 15, 5 ); +const hypergeometric = new Hypergeometric( 20, 15, 5 ); -var s2 = hypergeometric.variance; +const s2 = hypergeometric.variance; // returns ~0.74 ``` @@ -188,9 +188,9 @@ var s2 = hypergeometric.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var hypergeometric = new Hypergeometric( 8, 2, 4 ); +const hypergeometric = new Hypergeometric( 8, 2, 4 ); -var y = hypergeometric.cdf( 0.5 ); +const y = hypergeometric.cdf( 0.5 ); // returns ~0.214 ``` @@ -199,9 +199,9 @@ var y = hypergeometric.cdf( 0.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF). ```javascript -var hypergeometric = new Hypergeometric( 8, 2, 4 ); +const hypergeometric = new Hypergeometric( 8, 2, 4 ); -var y = hypergeometric.logpmf( 2.0 ); +const y = hypergeometric.logpmf( 2.0 ); // returns ~-1.54 ``` @@ -210,9 +210,9 @@ var y = hypergeometric.logpmf( 2.0 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var hypergeometric = new Hypergeometric( 8, 2, 4 ); +const hypergeometric = new Hypergeometric( 8, 2, 4 ); -var y = hypergeometric.pmf( 2.0 ); +const y = hypergeometric.pmf( 2.0 ); // returns ~0.214 ``` @@ -221,9 +221,9 @@ var y = hypergeometric.pmf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var hypergeometric = new Hypergeometric( 8, 2, 4 ); +const hypergeometric = new Hypergeometric( 8, 2, 4 ); -var y = hypergeometric.quantile( 0.8 ); +let y = hypergeometric.quantile( 0.8 ); // returns 2.0 y = hypergeometric.quantile( 1.9 ); @@ -253,20 +253,20 @@ y = hypergeometric.quantile( 1.9 ); ```javascript -var Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric/ctor' ); +const Hypergeometric = require( '@stdlib/stats/base/dists/hypergeometric/ctor' ); -var hypergeometric = new Hypergeometric( 100, 50, 20 ); +const hypergeometric = new Hypergeometric( 100, 50, 20 ); -var mu = hypergeometric.mean; +const mu = hypergeometric.mean; // returns 10.0 -var mode = hypergeometric.mode; +const mode = hypergeometric.mode; // returns 10.0 -var s2 = hypergeometric.variance; +const s2 = hypergeometric.variance; // returns ~4.04 -var y = hypergeometric.cdf( 10.5 ); +const y = hypergeometric.cdf( 10.5 ); // returns ~0.598 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis/README.md index e08cce05a743..a549f62ab1c8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/hypergeometric/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/hypergeometric/kurtosis' ); ``` #### kurtosis( N, K, n ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/hypergeometric/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = kurtosis( 16, 11, 4 ); +let v = kurtosis( 16, 11, 4 ); // returns ~-0.326 v = kurtosis( 4, 2, 2 ); @@ -70,7 +70,7 @@ v = kurtosis( 4, 2, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 10, 4 ); +let v = kurtosis( NaN, 10, 4 ); // returns NaN v = kurtosis( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = kurtosis( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = kurtosis( 10.5, 5, 2 ); +let v = kurtosis( 10.5, 5, 2 ); // returns NaN v = kurtosis( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = kurtosis( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = kurtosis( 10, 5, 12 ); +let v = kurtosis( 10, 5, 12 ); // returns NaN v = kurtosis( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = kurtosis( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/hypergeometric/kurtosis' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = kurtosis( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/hypergeometric/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = kurtosis( N, K, n ); console.log( 'N: %d, K: %d, n: %d, Kurt(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/logpmf/README.md index 5ec8befb6a4a..76e75f237635 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/logpmf/README.md @@ -48,7 +48,7 @@ f(x;N,K,n)=P(X=x;N,K,n)=\begin{cases} {{{K \choose x} {N-K \choose {n-x}}}\over ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/hypergeometric/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/hypergeometric/logpmf' ); ``` #### logpmf( x, N, K, n ) @@ -56,7 +56,7 @@ var logpmf = require( '@stdlib/stats/base/dists/hypergeometric/logpmf' ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF) for a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var y = logpmf( 1.0, 8, 4, 2 ); +let y = logpmf( 1.0, 8, 4, 2 ); // returns ~-0.56 y = logpmf( 2.0, 8, 4, 2 ); @@ -72,7 +72,7 @@ y = logpmf( 1.5, 8, 4, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, 10, 5, 2 ); +let y = logpmf( NaN, 10, 5, 2 ); // returns NaN y = logpmf( 0.0, NaN, 5, 2 ); @@ -88,7 +88,7 @@ y = logpmf( 0.0, 10, 5, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 10.5, 5, 2 ); +let y = logpmf( 2.0, 10.5, 5, 2 ); // returns NaN y = logpmf( 2.0, 10, 1.5, 2 ); @@ -101,7 +101,7 @@ y = logpmf( 2.0, 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 10, 5, 12 ); +let y = logpmf( 2.0, 10, 5, 12 ); // returns NaN y = logpmf( 2.0, 8, 3, 9 ); @@ -113,8 +113,8 @@ y = logpmf( 2.0, 8, 3, 9 ); Returns a function for evaluating the natural logarithm of the [probability mass function][pmf] (PMF) of a [hypergeometric ][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var mylogpmf = logpmf.factory( 30, 20, 5 ); -var y = mylogpmf( 4.0 ); +const mylogpmf = logpmf.factory( 30, 20, 5 ); +let y = mylogpmf( 4.0 ); // returns ~-1.079 y = mylogpmf( 1.0 ); @@ -132,23 +132,16 @@ y = mylogpmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/hypergeometric/logpmf' ); - -var i; -var N; -var K; -var n; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 5.0 ); - N = round( randu() * 20.0 ); - K = round( randu() * N ); - n = round( randu() * N ); - y = logpmf( x, N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/hypergeometric/logpmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 5.0 ); + const N = round( randu() * 20.0 ); + const K = round( randu() * N ); + const n = round( randu() * N ); + const y = logpmf( x, N, K, n ); console.log( 'x: %d, N: %d, K: %d, n: %d, ln(P(X=x;N,K,n)): %d', x, N, K, n, y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/README.md index 949546273f7e..2bf97f2b7180 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' ); +const mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' ); ``` #### mean( N, K, n ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' ); Returns the [expected value][expected-value] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = mean( 16, 11, 4 ); +let v = mean( 16, 11, 4 ); // returns 2.75 v = mean( 2, 1, 1 ); @@ -70,7 +70,7 @@ v = mean( 2, 1, 1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 10, 4 ); +let v = mean( NaN, 10, 4 ); // returns NaN v = mean( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = mean( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = mean( 10.5, 5, 2 ); +let v = mean( 10.5, 5, 2 ); // returns NaN v = mean( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = mean( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = mean( 10, 5, 12 ); +let v = mean( 10, 5, 12 ); // returns NaN v = mean( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = mean( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = mean( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = mean( N, K, n ); console.log( 'N: %d, K: %d, n: %d, E(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mode/README.md index 559840d0d0f4..ffbda0c5d239 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/mode/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/hypergeometric/mode' ); +const mode = require( '@stdlib/stats/base/dists/hypergeometric/mode' ); ``` #### mode( N, K, n ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/hypergeometric/mode' ); Returns the [mode][mode] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = mode( 16, 11, 4 ); +let v = mode( 16, 11, 4 ); // returns 3 v = mode( 2, 1, 1 ); @@ -70,7 +70,7 @@ v = mode( 2, 1, 1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 10, 4 ); +let v = mode( NaN, 10, 4 ); // returns NaN v = mode( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = mode( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = mode( 10.5, 5, 2 ); +let v = mode( 10.5, 5, 2 ); // returns NaN v = mode( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = mode( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = mode( 10, 5, 12 ); +let v = mode( 10, 5, 12 ); // returns NaN v = mode( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = mode( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/hypergeometric/mode' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = mode( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/hypergeometric/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = mode( N, K, n ); console.log( 'N: %d, K: %d, n: %d, mode(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/README.md index 29f90e9aaf98..7aba6efeaa11 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/README.md @@ -48,7 +48,7 @@ f(x;N,K,n)=P(X=x;N,K,n)=\begin{cases} {{{K \choose x} {N-K \choose {n-x}}}\over ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' ); ``` #### pmf( x, N, K, n ) @@ -56,7 +56,7 @@ var pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' ); Evaluates the [probability mass function][pmf] (PMF) for a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var y = pmf( 1.0, 8, 4, 2 ); +let y = pmf( 1.0, 8, 4, 2 ); // returns ~0.571 y = pmf( 2.0, 8, 4, 2 ); @@ -72,7 +72,7 @@ y = pmf( 1.5, 8, 4, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 10, 5, 2 ); +let y = pmf( NaN, 10, 5, 2 ); // returns NaN y = pmf( 0.0, NaN, 5, 2 ); @@ -88,7 +88,7 @@ y = pmf( 0.0, 10, 5, NaN ); If provided a population size `N`, subpopulation size `K` or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 10.5, 5, 2 ); +let y = pmf( 2.0, 10.5, 5, 2 ); // returns NaN y = pmf( 2.0, 10, 1.5, 2 ); @@ -101,7 +101,7 @@ y = pmf( 2.0, 10, 5, -2.0 ); If the number of draws `n` exceeds population size `N`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 10, 5, 12 ); +let y = pmf( 2.0, 10, 5, 12 ); // returns NaN y = pmf( 2.0, 8, 3, 9 ); @@ -113,8 +113,8 @@ y = pmf( 2.0, 8, 3, 9 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [hypergeometric ][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var mypmf = pmf.factory( 30, 20, 5 ); -var y = mypmf( 4.0 ); +const mypmf = pmf.factory( 30, 20, 5 ); +let y = mypmf( 4.0 ); // returns ~0.34 y = mypmf( 1.0 ); @@ -132,23 +132,16 @@ y = mypmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' ); - -var i; -var N; -var K; -var n; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 5.0 ); - N = round( randu() * 20.0 ); - K = round( randu() * N ); - n = round( randu() * N ); - y = pmf( x, N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 5.0 ); + const N = round( randu() * 20.0 ); + const K = round( randu() * N ); + const n = round( randu() * N ); + const y = pmf( x, N, K, n ); console.log( 'x: %d, N: %d, K: %d, n: %d, P(X=x;N,K,n): %d', x, N, K, n, y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/quantile/README.md index 44ee0cb018bc..31f9ed8a4981 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/quantile/README.md @@ -52,7 +52,7 @@ where `F` is the cumulative distribution function (CDF) of a hypergeometric rand ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/hypergeometric/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/hypergeometric/quantile' ); ``` #### quantile( p, N, K, n ) @@ -60,7 +60,7 @@ var quantile = require( '@stdlib/stats/base/dists/hypergeometric/quantile' ); Evaluates the [quantile function][quantile-function] for a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var y = quantile( 0.5, 8, 4, 2 ); +let y = quantile( 0.5, 8, 4, 2 ); // returns 1 y = quantile( 0.9, 120, 80, 20 ); @@ -76,7 +76,7 @@ y = quantile( 0.0, 8, 4, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 10, 5, 2 ); +let y = quantile( NaN, 10, 5, 2 ); // returns NaN y = quantile( 0.4, NaN, 5, 2 ); @@ -92,7 +92,7 @@ y = quantile( 0.4, 10, 5, NaN ); If provided a population size `N`, subpopulation size `K` or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var y = quantile( 0.2, 6.5, 5, 2 ); +let y = quantile( 0.2, 6.5, 5, 2 ); // returns NaN y = quantile( 0.2, 5, 1.5, 2 ); @@ -105,7 +105,7 @@ y = quantile( 0.2, 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var y = quantile( 0.2, 10, 5, 12 ); +let y = quantile( 0.2, 10, 5, 12 ); // returns NaN y = quantile( 0.2, 8, 3, 9 ); @@ -117,8 +117,8 @@ y = quantile( 0.2, 8, 3, 9 ); Returns a function for evaluating the [quantile function][quantile-function] for a [hypergeometric ][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var myquantile = quantile.factory( 100, 20, 10 ); -var y = myquantile( 0.2 ); +const myquantile = quantile.factory( 100, 20, 10 ); +let y = myquantile( 0.2 ); // returns 1 y = myquantile( 0.9 ); @@ -136,23 +136,16 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var quantile = require( '@stdlib/stats/base/dists/hypergeometric/quantile' ); - -var i; -var N; -var K; -var n; -var p; -var y; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - y = quantile( p, N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const quantile = require( '@stdlib/stats/base/dists/hypergeometric/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const y = quantile( p, N, K, n ); console.log( 'p: %d, N: %d, K: %d, n: %d, Q(p;N,K,n): %d', p.toFixed( 4 ), N, K, n, y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/skewness/README.md index a8e2156e839f..b4eafcb4a95f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/skewness/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/hypergeometric/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/hypergeometric/skewness' ); ``` #### skewness( N, K, n ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/hypergeometric/skewness' ); Returns the [skewness][skewness] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = skewness( 16, 11, 4 ); +let v = skewness( 16, 11, 4 ); // returns ~-0.258 v = skewness( 4, 2, 2 ); @@ -70,7 +70,7 @@ v = skewness( 4, 2, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 10, 4 ); +let v = skewness( NaN, 10, 4 ); // returns NaN v = skewness( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = skewness( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = skewness( 10.5, 5, 2 ); +let v = skewness( 10.5, 5, 2 ); // returns NaN v = skewness( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = skewness( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = skewness( 10, 5, 12 ); +let v = skewness( 10, 5, 12 ); // returns NaN v = skewness( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = skewness( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/hypergeometric/skewness' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = skewness( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/hypergeometric/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = skewness( N, K, n ); console.log( 'N: %d, K: %d, n: %d, skew(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/stdev/README.md index 9cf84e3e486d..5d89724841ca 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/stdev/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/hypergeometric/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/hypergeometric/stdev' ); ``` #### stdev( N, K, n ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/hypergeometric/stdev' ); Returns the [standard deviation][standard-deviation] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = stdev( 16, 11, 4 ); +let v = stdev( 16, 11, 4 ); // returns ~0.829 v = stdev( 2, 1, 1 ); @@ -70,7 +70,7 @@ v = stdev( 2, 1, 1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 10, 4 ); +let v = stdev( NaN, 10, 4 ); // returns NaN v = stdev( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = stdev( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = stdev( 10.5, 5, 2 ); +let v = stdev( 10.5, 5, 2 ); // returns NaN v = stdev( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = stdev( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = stdev( 10, 5, 12 ); +let v = stdev( 10, 5, 12 ); // returns NaN v = stdev( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = stdev( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/hypergeometric/stdev' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = stdev( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/hypergeometric/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = stdev( N, K, n ); console.log( 'N: %d, K: %d, n: %d, SD(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/variance/README.md index 411b5410b3e4..6484715617fb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/hypergeometric/variance/README.md @@ -52,7 +52,7 @@ Imagine a scenario with a population of size `N`, of which a subpopulation of si ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/hypergeometric/variance' ); +const variance = require( '@stdlib/stats/base/dists/hypergeometric/variance' ); ``` #### variance( N, K, n ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/hypergeometric/variance' ); Returns the [variance][variance] of a [hypergeometric][hypergeometric-distribution] distribution with parameters `N` (population size), `K` (subpopulation size), and `n` (number of draws). ```javascript -var v = variance( 16, 11, 4 ); +let v = variance( 16, 11, 4 ); // returns ~0.688 v = variance( 2, 1, 1 ); @@ -70,7 +70,7 @@ v = variance( 2, 1, 1 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 10, 4 ); +let v = variance( NaN, 10, 4 ); // returns NaN v = variance( 20, NaN, 4 ); @@ -83,7 +83,7 @@ v = variance( 20, 10, NaN ); If provided a population size `N`, subpopulation size `K`, or draws `n` which is not a nonnegative integer, the function returns `NaN`. ```javascript -var v = variance( 10.5, 5, 2 ); +let v = variance( 10.5, 5, 2 ); // returns NaN v = variance( 10, 1.5, 2 ); @@ -96,7 +96,7 @@ v = variance( 10, 5, -2.0 ); If the number of draws `n` or the subpopulation size `K` exceed population size `N`, the function returns `NaN`. ```javascript -var v = variance( 10, 5, 12 ); +let v = variance( 10, 5, 12 ); // returns NaN v = variance( 10, 12, 5 ); @@ -124,21 +124,15 @@ v = variance( 10, 12, 5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/hypergeometric/variance' ); - -var v; -var i; -var N; -var K; -var n; - -for ( i = 0; i < 10; i++ ) { - N = round( randu() * 20 ); - K = round( randu() * N ); - n = round( randu() * K ); - v = variance( N, K, n ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/hypergeometric/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const N = round( randu() * 20 ); + const K = round( randu() * N ); + const n = round( randu() * K ); + const v = variance( N, K, n ); console.log( 'N: %d, K: %d, n: %d, Var(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/README.md index da77cb94da9d..3c1165fe1a6d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invgamma = require( '@stdlib/stats/base/dists/invgamma' ); +const invgamma = require( '@stdlib/stats/base/dists/invgamma' ); ``` #### invgamma @@ -35,7 +35,7 @@ var invgamma = require( '@stdlib/stats/base/dists/invgamma' ); Inverse gamma distribution. ```javascript -var dist = invgamma; +const dist = invgamma; // returns {...} ``` @@ -85,11 +85,11 @@ The namespace contains a constructor function for creating a [inverse gamma][inv ```javascript -var InvGamma = require( '@stdlib/stats/base/dists/invgamma' ).InvGamma; +const InvGamma = require( '@stdlib/stats/base/dists/invgamma' ).InvGamma; -var dist = new InvGamma( 2.0, 4.0 ); +const dist = new InvGamma( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.003 ``` @@ -104,29 +104,29 @@ var y = dist.cdf( 0.5 ); ```javascript -var invgammaRandomFactory = require( '@stdlib/random/base/invgamma' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var variance = require( '@stdlib/stats/base/variance' ); -var linspace = require( '@stdlib/array/base/linspace' ); -var gamma = require( '@stdlib/stats/base/dists/gamma' ); -var mean = require( '@stdlib/stats/base/mean' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var invgamma = require( '@stdlib/stats/base/dists/invgamma' ); +const invgammaRandomFactory = require( '@stdlib/random/base/invgamma' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const variance = require( '@stdlib/stats/base/variance' ); +const linspace = require( '@stdlib/array/base/linspace' ); +const gamma = require( '@stdlib/stats/base/dists/gamma' ); +const mean = require( '@stdlib/stats/base/mean' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const invgamma = require( '@stdlib/stats/base/dists/invgamma' ); // Define the shape and scale parameters: -var alpha = 5.0; // shape parameter (α) -var beta = 1.0; // scale parameter (β) +const alpha = 5.0; // shape parameter (α) +const beta = 1.0; // scale parameter (β) // Generate an array of x values: -var x = linspace( 0.01, 3.0, 100 ); +const x = linspace( 0.01, 3.0, 100 ); // Compute the PDF for each x: -var invgammaPDF = invgamma.pdf.factory( alpha, beta ); -var pdf = filledarrayBy( x.length, 'float64', invgammaPDF ); +const invgammaPDF = invgamma.pdf.factory( alpha, beta ); +const pdf = filledarrayBy( x.length, 'float64', invgammaPDF ); // Compute the CDF for each x: -var invgammaCDF = invgamma.cdf.factory( alpha, beta ); -var cdf = filledarrayBy( x.length, 'float64', invgammaCDF ); +const invgammaCDF = invgamma.cdf.factory( alpha, beta ); +const cdf = filledarrayBy( x.length, 'float64', invgammaCDF ); // Output the PDF and CDF values: console.log( 'x values: %s', x ); @@ -134,10 +134,10 @@ console.log( 'PDF values: %s', pdf ); console.log( 'CDF values: %s', cdf ); // Compute statistical properties: -var theoreticalMean = invgamma.mean( alpha, beta ); -var theoreticalVariance = invgamma.variance( alpha, beta ); -var theoreticalSkewness = invgamma.skewness( alpha, beta ); -var theoreticalKurtosis = invgamma.kurtosis( alpha, beta ); +const theoreticalMean = invgamma.mean( alpha, beta ); +const theoreticalVariance = invgamma.variance( alpha, beta ); +const theoreticalSkewness = invgamma.skewness( alpha, beta ); +const theoreticalKurtosis = invgamma.kurtosis( alpha, beta ); console.log( 'Theoretical Mean: %s', theoreticalMean ); console.log( 'Theoretical Variance: %s', theoreticalVariance ); @@ -145,13 +145,13 @@ console.log( 'Skewness: %s', theoreticalSkewness ); console.log( 'Kurtosis: %s', theoreticalKurtosis ); // Generate random samples from the inverse gamma distribution: -var rinvGamma = invgammaRandomFactory( alpha, beta ); -var n = 1000; -var samples = filledarrayBy( n, 'float64', rinvGamma ); +const rinvGamma = invgammaRandomFactory( alpha, beta ); +const n = 1000; +const samples = filledarrayBy( n, 'float64', rinvGamma ); // Compute sample mean and variance: -var sampleMean = mean( n, samples, 1 ); -var sampleVariance = variance( n, 1, samples, 1 ); +const sampleMean = mean( n, samples, 1 ); +const sampleVariance = variance( n, 1, samples, 1 ); console.log( 'Sample Mean: %s', sampleMean ); console.log( 'Sample Variance: %s', sampleVariance ); @@ -161,9 +161,9 @@ console.log( 'Difference in Mean: %s', abs( theoreticalMean - sampleMean ) ); console.log( 'Difference in Variance: %s', abs( theoreticalVariance - sampleVariance ) ); // Demonstrate the relationship between inverse gamma and gamma distributions: -var y = 0.5; -var invGammaCDF = invgamma.cdf( y, alpha, beta ); -var gammaCDF = 1.0 - gamma.cdf( 1.0 / y, alpha, 1.0 / beta ); +const y = 0.5; +const invGammaCDF = invgamma.cdf( y, alpha, beta ); +const gammaCDF = 1.0 - gamma.cdf( 1.0 / y, alpha, 1.0 / beta ); console.log( 'Inverse Gamma CDF at y = %s: %s', y, invGammaCDF ); console.log( '1 - Gamma CDF at 1/y = %s: %s', 1 / y, gammaCDF ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/cdf/README.md index 2909f78268a4..4da7c75726ec 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/cdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/invgamma/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/invgamma/cdf' ); ``` #### cdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/invgamma/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = cdf( 2.0, 1.0, 1.0 ); +let y = cdf( 2.0, 1.0, 1.0 ); // returns ~0.607 y = cdf( 2.0, 3.0, 1.0 ); @@ -77,7 +77,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -90,14 +90,14 @@ y = cdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +const y = cdf( 2.0, -1.0, 0.5 ); // returns NaN ``` If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +const y = cdf( 2.0, 0.5, -1.0 ); // returns NaN ``` @@ -106,9 +106,9 @@ var y = cdf( 2.0, 0.5, -1.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mycdf = cdf.factory( 0.5, 0.1 ); +const mycdf = cdf.factory( 0.5, 0.1 ); -var y = mycdf( 12.0 ); +let y = mycdf( 12.0 ); // returns ~0.897 y = mycdf( 8.0 ); @@ -126,20 +126,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/invgamma/cdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 2.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = cdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/invgamma/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 2.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = cdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, F(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/ctor/README.md index c351c381fd34..af251ce01b26 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var InvGamma = require( '@stdlib/stats/base/dists/invgamma/ctor' ); +const InvGamma = require( '@stdlib/stats/base/dists/invgamma/ctor' ); ``` #### InvGamma( \[alpha, beta] ) @@ -45,18 +45,18 @@ var InvGamma = require( '@stdlib/stats/base/dists/invgamma/ctor' ); Returns an [inverse gamma][invgamma-distribution] distribution object. ```javascript -var invgamma = new InvGamma(); +const invgamma = new InvGamma(); -var mode = invgamma.mode; +const mode = invgamma.mode; // returns 0.5 ``` By default, `alpha = 1.0` and `beta = 1.0`. To create a distribution having a different `alpha` (shape parameter) and `beta` (rate parameter), provide the corresponding arguments. ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var mu = invgamma.mean; +const mu = invgamma.mean; // returns 4.0 ``` @@ -73,9 +73,9 @@ An [inverse gamma][invgamma-distribution] distribution object has the following Shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var invgamma = new InvGamma(); +const invgamma = new InvGamma(); -var alpha = invgamma.alpha; +let alpha = invgamma.alpha; // returns 1.0 invgamma.alpha = 3.0; @@ -89,9 +89,9 @@ alpha = invgamma.alpha; Rate parameter of the distribution. `beta` **must** be a positive number. ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var b = invgamma.beta; +let b = invgamma.beta; // returns 4.0 invgamma.beta = 3.0; @@ -109,9 +109,9 @@ b = invgamma.beta; Returns the [excess kurtosis][kurtosis]. ```javascript -var invgamma = new InvGamma( 6.0, 12.0 ); +const invgamma = new InvGamma( 6.0, 12.0 ); -var kurtosis = invgamma.kurtosis; +const kurtosis = invgamma.kurtosis; // returns 19.0 ``` @@ -120,9 +120,9 @@ var kurtosis = invgamma.kurtosis; Returns the [expected value][expected-value]. ```javascript -var invgamma = new InvGamma( 4.0, 12.0 ); +const invgamma = new InvGamma( 4.0, 12.0 ); -var mu = invgamma.mean; +const mu = invgamma.mean; // returns 4.0 ``` @@ -131,9 +131,9 @@ var mu = invgamma.mean; Returns the [mode][mode]. ```javascript -var invgamma = new InvGamma( 4.0, 12.0 ); +const invgamma = new InvGamma( 4.0, 12.0 ); -var mode = invgamma.mode; +const mode = invgamma.mode; // returns 2.4 ``` @@ -142,9 +142,9 @@ var mode = invgamma.mode; Returns the [skewness][skewness]. ```javascript -var invgamma = new InvGamma( 4.0, 12.0 ); +const invgamma = new InvGamma( 4.0, 12.0 ); -var skewness = invgamma.skewness; +const skewness = invgamma.skewness; // returns ~5.657 ``` @@ -153,9 +153,9 @@ var skewness = invgamma.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var invgamma = new InvGamma( 4.0, 12.0 ); +const invgamma = new InvGamma( 4.0, 12.0 ); -var s = invgamma.stdev; +const s = invgamma.stdev; // returns ~2.828 ``` @@ -164,9 +164,9 @@ var s = invgamma.stdev; Returns the [variance][variance]. ```javascript -var invgamma = new InvGamma( 4.0, 12.0 ); +const invgamma = new InvGamma( 4.0, 12.0 ); -var s2 = invgamma.variance; +const s2 = invgamma.variance; // returns 8.0 ``` @@ -179,9 +179,9 @@ var s2 = invgamma.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var y = invgamma.cdf( 0.5 ); +const y = invgamma.cdf( 0.5 ); // returns ~0.003 ``` @@ -190,9 +190,9 @@ var y = invgamma.cdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var y = invgamma.logpdf( 0.8 ); +const y = invgamma.logpdf( 0.8 ); // returns ~-1.558 ``` @@ -201,9 +201,9 @@ var y = invgamma.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var y = invgamma.pdf( 0.8 ); +const y = invgamma.pdf( 0.8 ); // returns ~0.211 ``` @@ -212,9 +212,9 @@ var y = invgamma.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var invgamma = new InvGamma( 2.0, 4.0 ); +const invgamma = new InvGamma( 2.0, 4.0 ); -var y = invgamma.quantile( 0.5 ); +let y = invgamma.quantile( 0.5 ); // returns ~2.383 y = invgamma.quantile( 1.9 ); @@ -244,20 +244,20 @@ y = invgamma.quantile( 1.9 ); ```javascript -var InvGamma = require( '@stdlib/stats/base/dists/invgamma/ctor' ); +const InvGamma = require( '@stdlib/stats/base/dists/invgamma/ctor' ); -var invgamma = new InvGamma( 3.0, 4.0 ); +const invgamma = new InvGamma( 3.0, 4.0 ); -var mu = invgamma.mean; +const mu = invgamma.mean; // returns 2.0 -var mode = invgamma.mode; +const mode = invgamma.mode; // returns 1.0 -var s2 = invgamma.variance; +const s2 = invgamma.variance; // returns 4.0 -var y = invgamma.cdf( 0.8 ); +const y = invgamma.cdf( 0.8 ); // returns ~0.125 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/entropy/README.md index ac4f8df5f1b4..96abd1ddc703 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/entropy/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter, `β > 0` is the rate parameter, `Γ` and ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/invgamma/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/invgamma/entropy' ); ``` #### entropy( alpha, beta ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/invgamma/entropy' ); Returns the [differential entropy][entropy] of an [inverse gamma][invgamma-distribution] distribution with shape parameter `alpha` and rate parameter `beta` (in [nats][nats]). ```javascript -var v = entropy( 1.0, 1.0 ); +let v = entropy( 1.0, 1.0 ); // returns ~2.154 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, 0.0 ); +let v = entropy( 1.0, 0.0 ); // returns NaN v = entropy( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/invgamma/entropy' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = entropy( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/invgamma/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = entropy( alpha, beta ); console.log( 'α: %d, β: %d, h(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/kurtosis/README.md index 7c7a21112c08..c3c509351440 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/kurtosis/README.md @@ -54,7 +54,7 @@ when `α > 4`. Otherwise, the kurtosis is not defined. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/invgamma/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/invgamma/kurtosis' ); ``` #### kurtosis( alpha, beta ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/invgamma/kurtosis' ); Returns the [excess kurtosis][kurtosis] of an [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = kurtosis( 7.0, 5.0 ); +let v = kurtosis( 7.0, 5.0 ); // returns 12.0 v = kurtosis( 6.0, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 5.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 5.0, NaN ); If provided `alpha <= 4`, the function returns `NaN`. ```javascript -var v = kurtosis( 3.0, 1.0 ); +let v = kurtosis( 3.0, 1.0 ); // returns NaN v = kurtosis( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 5.0, 0.0 ); +let v = kurtosis( 5.0, 0.0 ); // returns NaN v = kurtosis( 5.0, -1.0 ); @@ -123,19 +123,14 @@ v = kurtosis( 5.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/invgamma/kurtosis' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = kurtosis( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/invgamma/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = kurtosis( alpha, beta ); console.log( 'α: %d, β: %d, Kurt(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/logpdf/README.md index d33144225025..531ff6ecb129 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/logpdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/invgamma/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/invgamma/logpdf' ); ``` #### logpdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/invgamma/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = logpdf( 2.0, 0.5, 1.0 ); +let y = logpdf( 2.0, 0.5, 1.0 ); // returns ~-2.112 y = logpdf( 0.2, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns NaN y = logpdf( 2.0, -0.5, 1.0 ); @@ -94,7 +94,7 @@ y = logpdf( 2.0, -0.5, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 1.0, 0.0 ); +let y = logpdf( 2.0, 1.0, 0.0 ); // returns NaN y = logpdf( 2.0, 1.0, -1.0 ); @@ -106,9 +106,9 @@ y = logpdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var mylogPDF = logpdf.factory( 6.0, 7.0 ); +const mylogPDF = logpdf.factory( 6.0, 7.0 ); -var y = mylogPDF( 2.0 ); +const y = mylogPDF( 2.0 ); // returns ~-1.464 ``` @@ -123,20 +123,14 @@ var y = mylogPDF( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/invgamma/logpdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 2.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = logpdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/invgamma/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 2.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = logpdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(f(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/mean/README.md index ef7f54557ad0..08248aa85160 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/mean/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the rate parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/invgamma/mean' ); +const mean = require( '@stdlib/stats/base/dists/invgamma/mean' ); ``` #### mean( alpha, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/invgamma/mean' ); Returns the [expected value][expected-value] of an [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = mean( 4.0, 12.0 ); +let v = mean( 4.0, 12.0 ); // returns 4.0 v = mean( 8.0, 2.0 ); @@ -72,7 +72,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -82,7 +82,7 @@ v = mean( 2.0, NaN ); If provided `alpha <= 1`, the function returns `NaN`. ```javascript -var v = mean( 0.5, 1.0 ); +let v = mean( 0.5, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -92,7 +92,7 @@ v = mean( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.0 ); +let v = mean( 1.0, 0.0 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -120,19 +120,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/invgamma/mean' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mean( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/invgamma/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mean( alpha, beta ); console.log( 'α: %d, β: %d, E(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/mode/README.md index fefdc20922c3..257e7ffeb649 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/mode/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the rate parameter. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/invgamma/mode' ); +const mode = require( '@stdlib/stats/base/dists/invgamma/mode' ); ``` #### mode( alpha, beta ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/invgamma/mode' ); Returns the [mode][mode] of an [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = mode( 1.0, 1.0 ); +let v = mode( 1.0, 1.0 ); // returns 0.5 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mode( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mode( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.0 ); +let v = mode( 1.0, 0.0 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/invgamma/mode' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mode( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/invgamma/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mode( alpha, beta ); console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/pdf/README.md index 91842ef79dc3..21144a99c062 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/pdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/invgamma/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/invgamma/pdf' ); ``` #### pdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/invgamma/pdf' ); Evaluates the [probability density function][pdf] (PDF) for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = pdf( 2.0, 0.5, 1.0 ); +let y = pdf( 2.0, 0.5, 1.0 ); // returns ~0.121 y = pdf( 0.2, 1.0, 1.0 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns NaN y = pdf( 2.0, -0.5, 1.0 ); @@ -94,7 +94,7 @@ y = pdf( 2.0, -0.5, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1.0, 0.0 ); +let y = pdf( 2.0, 1.0, 0.0 ); // returns NaN y = pdf( 2.0, 1.0, -1.0 ); @@ -106,9 +106,9 @@ y = pdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] of an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var myPDF = pdf.factory( 6.0, 7.0 ); +const myPDF = pdf.factory( 6.0, 7.0 ); -var y = myPDF( 2.0 ); +const y = myPDF( 2.0 ); // returns ~0.231 ``` @@ -123,20 +123,14 @@ var y = myPDF( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/invgamma/pdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 2.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = pdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/invgamma/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 2.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = pdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, f(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/quantile/README.md index 104ed57e283c..311c6c262e13 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `alpha > 0` is the shape parameter and `beta > 0` is the ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/invgamma/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/invgamma/quantile' ); ``` #### quantile( p, alpha, beta ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/invgamma/quantile' ); Evaluates the [quantile function][quantile-function] for an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var y = quantile( 0.8, 2.0, 1.0 ); +let y = quantile( 0.8, 2.0, 1.0 ); // returns ~1.213 y = quantile( 0.5, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,14 +91,14 @@ y = quantile( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +const y = quantile( 0.4, -1.0, 1.0 ); // returns NaN ``` If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +const y = quantile( 0.4, 1.0, -1.0 ); // returns NaN ``` @@ -107,8 +107,8 @@ var y = quantile( 0.4, 1.0, -1.0 ); Returns a function for evaluating the [quantile function][quantile-function] of an [inverse gamma][inverse-gamma] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var myquantile = quantile.factory( 2.0, 2.0 ); -var y = myquantile( 0.8 ); +const myquantile = quantile.factory( 2.0, 2.0 ); +let y = myquantile( 0.8 ); // returns ~2.426 y = myquantile( 0.4 ); @@ -126,20 +126,14 @@ y = myquantile( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/invgamma/quantile' ); - -var alpha; -var beta; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = quantile( p, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/invgamma/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = quantile( p, alpha, beta ); console.log( 'p: %d, α: %d, β: %d, Q(p;α,β): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/skewness/README.md index d75bc16674c8..eb59ad3360ea 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/skewness/README.md @@ -54,7 +54,7 @@ when `α > 3`. Otherwise, the skewness is not defined. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/invgamma/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/invgamma/skewness' ); ``` #### skewness( alpha, beta ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/invgamma/skewness' ); Returns the [skewness][skewness] of a [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = skewness( 4.0, 12.0 ); +let v = skewness( 4.0, 12.0 ); // returns ~5.657 v = skewness( 8.0, 2.0 ); @@ -72,7 +72,7 @@ v = skewness( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -82,7 +82,7 @@ v = skewness( 2.0, NaN ); If provided `alpha <= 3`, the function returns `NaN`. ```javascript -var v = skewness( 2.0, 1.0 ); +let v = skewness( 2.0, 1.0 ); // returns NaN v = skewness( -1.0, 1.0 ); @@ -92,7 +92,7 @@ v = skewness( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 0.0 ); +let v = skewness( 1.0, 0.0 ); // returns NaN v = skewness( 1.0, -1.0 ); @@ -120,19 +120,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/invgamma/skewness' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = skewness( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/invgamma/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = skewness( alpha, beta ); console.log( 'α: %d, β: %d, skew(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/stdev/README.md index ff1d6aba7179..b64d7b03aa23 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/stdev/README.md @@ -54,7 +54,7 @@ when `α > 2`. Otherwise, the standard deviation is not defined. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/invgamma/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/invgamma/stdev' ); ``` #### stdev( alpha, beta ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/invgamma/stdev' ); Returns the [standard deviation][standard-deviation] of a [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = stdev( 7.0, 7.0 ); +let v = stdev( 7.0, 7.0 ); // returns ~0.522 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `alpha <= 2`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 1.0 ); +let v = stdev( 1.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 3.0, 0.0 ); +let v = stdev( 3.0, 0.0 ); // returns NaN v = stdev( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = stdev( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/invgamma/stdev' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = stdev( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/invgamma/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = stdev( alpha, beta ); console.log( 'α: %d, β: %d, SD(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/invgamma/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/invgamma/variance/README.md index bfd2aa78f49e..29559915e839 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/invgamma/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/invgamma/variance/README.md @@ -54,7 +54,7 @@ when `α > 2`. Otherwise, the variance is not defined. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/invgamma/variance' ); +const variance = require( '@stdlib/stats/base/dists/invgamma/variance' ); ``` #### variance( alpha, beta ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/invgamma/variance' ); Returns the [variance][variance] of a [inverse gamma][invgamma-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter). ```javascript -var v = variance( 7.0, 7.0 ); +let v = variance( 7.0, 7.0 ); // returns ~0.272 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `alpha <= 2`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 1.0 ); +let v = variance( 1.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = variance( 3.0, 0.0 ); +let v = variance( 3.0, 0.0 ); // returns NaN v = variance( 3.0, -1.0 ); @@ -123,19 +123,14 @@ v = variance( 3.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/invgamma/variance' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = variance( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/invgamma/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = variance( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/README.md index aaa18533aeac..2db432b5492f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ); +const kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ); ``` #### kumaraswamy @@ -35,7 +35,7 @@ var kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ); Kumaraswamy's double bounded distribution. ```javascript -var dist = kumaraswamy; +const dist = kumaraswamy; // returns {...} ``` @@ -86,11 +86,11 @@ The namespace contains a constructor function for creating a [Kumaraswamy's doub ```javascript -var Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ).Kumaraswamy; +const Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ).Kumaraswamy; -var dist = new Kumaraswamy( 2.0, 4.0 ); +const dist = new Kumaraswamy( 2.0, 4.0 ); -var y = dist.logpdf( 0.8 ); +const y = dist.logpdf( 0.8 ); // returns ~-1.209 ``` @@ -105,12 +105,12 @@ var y = dist.logpdf( 0.8 ); ```javascript -var kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ); +const kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy' ); // Create a Kumaraswamy distribution object: -var a = 2.0; -var b = 5.0; -var dist = new kumaraswamy.Kumaraswamy( a, b ); +const a = 2.0; +const b = 5.0; +const dist = new kumaraswamy.Kumaraswamy( a, b ); // Calculate basic distribution properties: console.log( 'Mean: %d', dist.mean ); @@ -119,8 +119,8 @@ console.log( 'Mode: %d', dist.mode ); console.log( 'Variance: %d', dist.variance ); // Evaluate the probability density function (PDF): -var x = 0.5; -var y = dist.pdf( x ); +let x = 0.5; +let y = dist.pdf( x ); console.log( 'PDF at x = %d: %d', x, y ); // Evaluate the cumulative distribution function (CDF): @@ -132,7 +132,7 @@ console.log( 'Log PDF at x = %d: %d', x, dist.logpdf( x ) ); console.log( 'Log CDF at x = %d: %d', x, dist.logcdf( x ) ); // Calculate the quantile for a given probability: -var p = 0.75; +const p = 0.75; x = dist.quantile( p ); console.log( 'Quantile at p = %d: %d', p, x ); @@ -154,17 +154,15 @@ console.log( 'Standard Deviation: %d', kumaraswamy.stdev( a, b ) ); // Demonstrate the effect of different shape parameters: console.log( '\nEffect of shape parameters:' ); -var shapes = [ +const shapes = [ [ 0.5, 0.5 ], [ 5.0, 1.0 ], [ 1.0, 5.0 ], [ 2.0, 2.0 ], [ 10.0, 10.0 ] ]; -var params; -var i; -for ( i = 0; i < shapes.length; i++ ) { - params = shapes[i]; +for ( let i = 0; i < shapes.length; i++ ) { + const params = shapes[i]; console.log( '\na = %d, b = %d', params[0], params[1] ); console.log( 'Mean: %d', kumaraswamy.mean( params[0], params[1] ) ); console.log( 'Median: %d', kumaraswamy.median( params[0], params[1] ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md index 3f7be04815db..c539ea216e13 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md @@ -50,7 +50,7 @@ where `a > 0` is the first shape parameter and `b > 0` is the second shape param ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); ``` #### cdf( x, a, b ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var y = cdf( 0.5, 1.0, 1.0 ); +let y = cdf( 0.5, 1.0, 1.0 ); // returns 0.5 y = cdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +let y = cdf( 2.0, -1.0, 0.5 ); // returns NaN y = cdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = cdf( 2.0, 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var mycdf = cdf.factory( 0.5, 0.5 ); +const mycdf = cdf.factory( 0.5, 0.5 ); -var y = mycdf( 0.8 ); +let y = mycdf( 0.8 ); // returns ~0.675 y = mycdf( 0.3 ); @@ -141,21 +141,15 @@ y = mycdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = cdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const a = ( randu()*5.0 ) + EPS; + const b = ( randu()*5.0 ) + EPS; + const y = cdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/ctor/README.md index b7e3d35d0134..e7d93792a012 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy/ctor' ); +const Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy/ctor' ); ``` #### Kumaraswamy( \[a, b] ) @@ -45,18 +45,18 @@ var Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy/ctor' ); Returns a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution object. ```javascript -var kumaraswamy = new Kumaraswamy(); +const kumaraswamy = new Kumaraswamy(); -var mu = kumaraswamy.mean; +const mu = kumaraswamy.mean; // returns 0.5 ``` By default, `a = 1.0` and `b = 1.0`. To create a distribution having a different `a` (first shape parameter) and `b` (second shape parameter), provide the corresponding arguments. ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var mu = kumaraswamy.mean; +const mu = kumaraswamy.mean; // returns ~0.406 ``` @@ -73,9 +73,9 @@ A [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution object h First shape parameter of the distribution. `a` **must** be a positive number. ```javascript -var kumaraswamy = new Kumaraswamy(); +const kumaraswamy = new Kumaraswamy(); -var a = kumaraswamy.a; +let a = kumaraswamy.a; // returns 1.0 kumaraswamy.a = 3.0; @@ -89,9 +89,9 @@ a = kumaraswamy.a; Second shape parameter of the distribution. `b` **must** be a positive number. ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var b = kumaraswamy.b; +let b = kumaraswamy.b; // returns 4.0 kumaraswamy.b = 3.0; @@ -109,9 +109,9 @@ b = kumaraswamy.b; Returns the [excess kurtosis][kurtosis]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var kurtosis = kumaraswamy.kurtosis; +const kurtosis = kumaraswamy.kurtosis; // returns ~2.704 ``` @@ -120,9 +120,9 @@ var kurtosis = kumaraswamy.kurtosis; Returns the [expected value][expected-value]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var mu = kumaraswamy.mean; +const mu = kumaraswamy.mean; // returns ~0.481 ``` @@ -131,9 +131,9 @@ var mu = kumaraswamy.mean; Returns the [mode][mode]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var mode = kumaraswamy.mode; +const mode = kumaraswamy.mode; // returns ~0.503 ``` @@ -142,9 +142,9 @@ var mode = kumaraswamy.mode; Returns the [skewness][skewness]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var skewness = kumaraswamy.skewness; +const skewness = kumaraswamy.skewness; // returns ~-0.201 ``` @@ -153,9 +153,9 @@ var skewness = kumaraswamy.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var s = kumaraswamy.stdev; +const s = kumaraswamy.stdev; // returns ~0.13 ``` @@ -164,9 +164,9 @@ var s = kumaraswamy.stdev; Returns the [variance][variance]. ```javascript -var kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); +const kumaraswamy = new Kumaraswamy( 4.0, 12.0 ); -var s2 = kumaraswamy.variance; +const s2 = kumaraswamy.variance; // returns ~0.017 ``` @@ -179,9 +179,9 @@ var s2 = kumaraswamy.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var y = kumaraswamy.cdf( 0.5 ); +const y = kumaraswamy.cdf( 0.5 ); // returns ~0.684 ``` @@ -190,9 +190,9 @@ var y = kumaraswamy.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var y = kumaraswamy.logcdf( 0.5 ); +const y = kumaraswamy.logcdf( 0.5 ); // returns ~-0.38 ``` @@ -201,9 +201,9 @@ var y = kumaraswamy.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var y = kumaraswamy.logpdf( 0.8 ); +const y = kumaraswamy.logpdf( 0.8 ); // returns ~-1.209 ``` @@ -212,9 +212,9 @@ var y = kumaraswamy.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var y = kumaraswamy.pdf( 0.8 ); +const y = kumaraswamy.pdf( 0.8 ); // returns ~0.299 ``` @@ -223,9 +223,9 @@ var y = kumaraswamy.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var y = kumaraswamy.quantile( 0.5 ); +let y = kumaraswamy.quantile( 0.5 ); // returns ~0.399 y = kumaraswamy.quantile( 1.9 ); @@ -255,20 +255,20 @@ y = kumaraswamy.quantile( 1.9 ); ```javascript -var Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy/ctor' ); +const Kumaraswamy = require( '@stdlib/stats/base/dists/kumaraswamy/ctor' ); -var kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); +const kumaraswamy = new Kumaraswamy( 2.0, 4.0 ); -var mu = kumaraswamy.mean; +const mu = kumaraswamy.mean; // returns ~0.406 -var mode = kumaraswamy.mode; +const mode = kumaraswamy.mode; // returns ~0.378 -var s2 = kumaraswamy.variance; +const s2 = kumaraswamy.variance; // returns ~0.035 -var y = kumaraswamy.cdf( 0.8 ); +const y = kumaraswamy.cdf( 0.8 ); // returns ~0.983 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/kurtosis/README.md index d2a8eab0439b..8c3fba998375 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/kurtosis/README.md @@ -69,7 +69,7 @@ with `B` denoting the [beta function][beta-function]. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/kumaraswamy/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/kumaraswamy/kurtosis' ); ``` #### kurtosis( a, b ) @@ -77,7 +77,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/kumaraswamy/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = kurtosis( 1.0, 1.0 ); +let v = kurtosis( 1.0, 1.0 ); // returns ~1.8 v = kurtosis( 4.0, 12.0 ); @@ -90,7 +90,7 @@ v = kurtosis( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -100,7 +100,7 @@ v = kurtosis( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( -1.0, 0.5 ); +let y = kurtosis( -1.0, 0.5 ); // returns NaN y = kurtosis( 0.0, 0.5 ); @@ -110,7 +110,7 @@ y = kurtosis( 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.5, -1.0 ); +let y = kurtosis( 0.5, -1.0 ); // returns NaN y = kurtosis( 0.5, 0.0 ); @@ -138,18 +138,13 @@ y = kurtosis( 0.5, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/kumaraswamy/kurtosis' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = kurtosis( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/kumaraswamy/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = kurtosis( a, b ); console.log( 'a: %d, b: %d, Kurt(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logcdf/README.md index cb8b8db1f754..8fcc16873ef0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logcdf/README.md @@ -50,7 +50,7 @@ where `a > 0` is the first shape parameter and `b > 0` is the second shape param ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/kumaraswamy/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/kumaraswamy/logcdf' ); ``` #### logcdf( x, a, b ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/kumaraswamy/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var y = logcdf( 0.5, 1.0, 1.0 ); +let y = logcdf( 0.5, 1.0, 1.0 ); // returns ~-0.693 y = logcdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = logcdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0, 0.5 ); +let y = logcdf( 2.0, -1.0, 0.5 ); // returns NaN y = logcdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = logcdf( 2.0, 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.5, -1.0 ); +let y = logcdf( 2.0, 0.5, -1.0 ); // returns NaN y = logcdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = logcdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var mylogcdf = logcdf.factory( 0.5, 0.5 ); +const mylogcdf = logcdf.factory( 0.5, 0.5 ); -var y = mylogcdf( 0.8 ); +let y = mylogcdf( 0.8 ); // returns ~-0.393 y = mylogcdf( 0.3 ); @@ -151,21 +151,15 @@ y = mylogcdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logcdf = require( '@stdlib/stats/base/dists/kumaraswamy/logcdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = logcdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logcdf = require( '@stdlib/stats/base/dists/kumaraswamy/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const a = ( randu()*5.0 ) + EPS; + const b = ( randu()*5.0 ) + EPS; + const y = logcdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(F(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logpdf/README.md index b1a43d18ec8f..bac9d7347b7a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logpdf/README.md @@ -50,7 +50,7 @@ where `a > 0` is the first shape parameter and `b > 0` is the second shape param ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/kumaraswamy/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/kumaraswamy/logpdf' ); ``` #### logpdf( x, a, b ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/kumaraswamy/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var y = logpdf( 0.5, 1.0, 1.0 ); +let y = logpdf( 0.5, 1.0, 1.0 ); // returns 0.0 y = logpdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = logpdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -1.0, 0.5 ); +let y = logpdf( 2.0, -1.0, 0.5 ); // returns NaN y = logpdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = logpdf( 2.0, 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.5, -1.0 ); +let y = logpdf( 2.0, 0.5, -1.0 ); // returns NaN y = logpdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = logpdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [probability density function][pdf] (PDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var mylogpdf = logpdf.factory( 0.5, 0.5 ); +const mylogpdf = logpdf.factory( 0.5, 0.5 ); -var y = mylogpdf( 0.8 ); +let y = mylogpdf( 0.8 ); // returns ~-0.151 y = mylogpdf( 0.3 ); @@ -151,21 +151,15 @@ y = mylogpdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logpdf = require( '@stdlib/stats/base/dists/kumaraswamy/logpdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = logpdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logpdf = require( '@stdlib/stats/base/dists/kumaraswamy/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const a = ( randu()*5.0 ) + EPS; + const b = ( randu()*5.0 ) + EPS; + const y = logpdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(f(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mean/README.md index 3a0bcff5f688..00c771e0f5e5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mean/README.md @@ -54,7 +54,7 @@ where `a` is the first shape parameter, `b` the second shape parameter, and `Γ` ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/kumaraswamy/mean' ); +const mean = require( '@stdlib/stats/base/dists/kumaraswamy/mean' ); ``` #### mean( a, b ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/kumaraswamy/mean' ); Returns the [expected value][mean] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = mean( 1.5, 1.5 ); +let v = mean( 1.5, 1.5 ); // returns ~0.512 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = mean( -1.0, 2.0 ); +let y = mean( -1.0, 2.0 ); // returns NaN y = mean( 0.0, 2.0 ); @@ -95,7 +95,7 @@ y = mean( 0.0, 2.0 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = mean( 2.0, -1.0 ); +let y = mean( 2.0, -1.0 ); // returns NaN y = mean( 2.0, 0.0 ); @@ -123,18 +123,13 @@ y = mean( 2.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/kumaraswamy/mean' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = mean( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/kumaraswamy/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = mean( a, b ); console.log( 'a: %d, b: %d, E(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/README.md index 4ed44b2de696..e5b135a962c4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/README.md @@ -54,7 +54,7 @@ where `a` is the first shape parameter and `b` the second shape parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/kumaraswamy/median' ); +const median = require( '@stdlib/stats/base/dists/kumaraswamy/median' ); ``` #### median( a, b ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/kumaraswamy/median' ); Returns the [median][median] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = median( 1.0, 1.0 ); +let v = median( 1.0, 1.0 ); // returns 0.5 v = median( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = median( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -85,7 +85,7 @@ v = median( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = median( -1.0, 0.5 ); +let y = median( -1.0, 0.5 ); // returns NaN y = median( 0.0, 0.5 ); @@ -95,7 +95,7 @@ y = median( 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.5, -1.0 ); +let y = median( 0.5, -1.0 ); // returns NaN y = median( 0.5, 0.0 ); @@ -123,18 +123,13 @@ y = median( 0.5, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/kumaraswamy/median' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = median( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/kumaraswamy/median' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = median( a, b ); console.log( 'a: %d, b: %d, Median(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mode/README.md index e9ba77c585cf..5b9bfc3cbdd4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/mode/README.md @@ -54,7 +54,7 @@ for `a >= 1`, `b >=1` and not `a = b = 1`. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/kumaraswamy/mode' ); +const mode = require( '@stdlib/stats/base/dists/kumaraswamy/mode' ); ``` #### mode( a, b ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/kumaraswamy/mode' ); Returns the [mode][mode] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = mode( 1.5, 1.5 ); +let v = mode( 1.5, 1.5 ); // returns ~0.543 v = mode( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mode( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -85,14 +85,14 @@ v = mode( 2.0, NaN ); If provided `a = 1` and `b = 1`, the function returns `NaN`. ```javascript -var y = mode( 1.0, 1.0 ); +const y = mode( 1.0, 1.0 ); // returns NaN ``` If provided `a < 1`, the function returns `NaN`. ```javascript -var y = mode( -1.0, 2.0 ); +let y = mode( -1.0, 2.0 ); // returns NaN y = mode( 0.0, 2.0 ); @@ -102,7 +102,7 @@ y = mode( 0.0, 2.0 ); If provided `b < 1`, the function returns `NaN`. ```javascript -var y = mode( 2.0, -1.0 ); +let y = mode( 2.0, -1.0 ); // returns NaN y = mode( 2.0, 0.0 ); @@ -130,18 +130,13 @@ y = mode( 2.0, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/kumaraswamy/mode' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = mode( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/kumaraswamy/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = mode( a, b ); console.log( 'a: %d, b: %d, mode(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/pdf/README.md index f83bf4c4280e..27c760802a27 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/pdf/README.md @@ -50,7 +50,7 @@ where `a > 0` is the first shape parameter and `b > 0` is the second shape param ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/kumaraswamy/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/kumaraswamy/pdf' ); ``` #### pdf( x, a, b ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/kumaraswamy/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var y = pdf( 0.5, 1.0, 1.0 ); +let y = pdf( 0.5, 1.0, 1.0 ); // returns 1.0 y = pdf( 0.5, 2.0, 4.0 ); @@ -86,7 +86,7 @@ y = pdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -99,7 +99,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0, 0.5 ); +let y = pdf( 2.0, -1.0, 0.5 ); // returns NaN y = pdf( 2.0, 0.0, 0.5 ); @@ -109,7 +109,7 @@ y = pdf( 2.0, 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.5, -1.0 ); +let y = pdf( 2.0, 0.5, -1.0 ); // returns NaN y = pdf( 2.0, 0.5, 0.0 ); @@ -121,9 +121,9 @@ y = pdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var mypdf = pdf.factory( 0.5, 0.5 ); +const mypdf = pdf.factory( 0.5, 0.5 ); -var y = mypdf( 0.8 ); +let y = mypdf( 0.8 ); // returns ~0.86 y = mypdf( 0.3 ); @@ -141,21 +141,15 @@ y = mypdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var pdf = require( '@stdlib/stats/base/dists/kumaraswamy/pdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = pdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const pdf = require( '@stdlib/stats/base/dists/kumaraswamy/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu(); + const a = ( randu()*5.0 ) + EPS; + const b = ( randu()*5.0 ) + EPS; + const y = pdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, f(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/quantile/README.md index 70cc0a76d47f..49218e6eab84 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `a > 0` is the first shape parameter and `b > 0` is the ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/kumaraswamy/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/kumaraswamy/quantile' ); ``` #### quantile( p, a, b ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/kumaraswamy/quantile' ); Evaluates the [quantile function][quantile] for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var y = quantile( 0.5, 1.0, 1.0 ); +let y = quantile( 0.5, 1.0, 1.0 ); // returns 0.5 y = quantile( 0.5, 2.0, 4.0 ); @@ -74,7 +74,7 @@ y = quantile( 0.8, 4.0, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( -0.5, 4.0, 2.0 ); +let y = quantile( -0.5, 4.0, 2.0 ); // returns NaN y = quantile( 1.5, 4.0, 2.0 ); @@ -84,7 +84,7 @@ y = quantile( 1.5, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.2, NaN, 1.0 ); @@ -97,7 +97,7 @@ y = quantile( 0.2, 1.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.2, -1.0, 0.5 ); +let y = quantile( 0.2, -1.0, 0.5 ); // returns NaN y = quantile( 0.2, 0.0, 0.5 ); @@ -107,7 +107,7 @@ y = quantile( 0.2, 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.2, 0.5, -1.0 ); +let y = quantile( 0.2, 0.5, -1.0 ); // returns NaN y = quantile( 0.2, 0.5, 0.0 ); @@ -119,9 +119,9 @@ y = quantile( 0.2, 0.5, 0.0 ); Returns a function for evaluating the [quantile function][quantile] for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). ```javascript -var myQuantile = quantile.factory( 0.5, 0.5 ); +const myQuantile = quantile.factory( 0.5, 0.5 ); -var y = myQuantile( 0.8 ); +let y = myQuantile( 0.8 ); // returns ~0.922 y = myQuantile( 0.3 ); @@ -139,21 +139,15 @@ y = myQuantile( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var quantile = require( '@stdlib/stats/base/dists/kumaraswamy/quantile' ); - -var a; -var b; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = quantile( p, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const quantile = require( '@stdlib/stats/base/dists/kumaraswamy/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const a = ( randu()*5.0 ) + EPS; + const b = ( randu()*5.0 ) + EPS; + const y = quantile( p, a, b ); console.log( 'p: %d, a: %d, b: %d, Q(p;a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/skewness/README.md index 05a8d8b21b6a..3c808f18cb1e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/skewness/README.md @@ -69,7 +69,7 @@ with `B` denoting the [beta function][beta-function]. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/kumaraswamy/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/kumaraswamy/skewness' ); ``` #### skewness( a, b ) @@ -77,7 +77,7 @@ var skewness = require( '@stdlib/stats/base/dists/kumaraswamy/skewness' ); Returns the [skewness][skewness] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = skewness( 1.0, 1.0 ); +let v = skewness( 1.0, 1.0 ); // returns ~0.0 v = skewness( 4.0, 12.0 ); @@ -90,7 +90,7 @@ v = skewness( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -100,7 +100,7 @@ v = skewness( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = skewness( -1.0, 0.5 ); +let y = skewness( -1.0, 0.5 ); // returns NaN y = skewness( 0.0, 0.5 ); @@ -110,7 +110,7 @@ y = skewness( 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.5, -1.0 ); +let y = skewness( 0.5, -1.0 ); // returns NaN y = skewness( 0.5, 0.0 ); @@ -138,18 +138,13 @@ y = skewness( 0.5, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/kumaraswamy/skewness' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = skewness( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/kumaraswamy/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = skewness( a, b ); console.log( 'a: %d, b: %d, skew(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/stdev/README.md index c4de31024d91..7b9a708e49d0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/stdev/README.md @@ -69,7 +69,7 @@ with `B` denoting the [beta function][beta-function]. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/kumaraswamy/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/kumaraswamy/stdev' ); ``` #### stdev( a, b ) @@ -77,7 +77,7 @@ var stdev = require( '@stdlib/stats/base/dists/kumaraswamy/stdev' ); Returns the [standard deviation][standard-deviation] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = stdev( 1.0, 1.0 ); +let v = stdev( 1.0, 1.0 ); // returns ~0.289 v = stdev( 4.0, 12.0 ); @@ -90,7 +90,7 @@ v = stdev( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -100,7 +100,7 @@ v = stdev( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = stdev( -1.0, 0.5 ); +let y = stdev( -1.0, 0.5 ); // returns NaN y = stdev( 0.0, 0.5 ); @@ -110,7 +110,7 @@ y = stdev( 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.5, -1.0 ); +let y = stdev( 0.5, -1.0 ); // returns NaN y = stdev( 0.5, 0.0 ); @@ -138,18 +138,13 @@ y = stdev( 0.5, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/kumaraswamy/stdev' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = stdev( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/kumaraswamy/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = stdev( a, b ); console.log( 'a: %d, b: %d, SD(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/variance/README.md index 6ad9ab74efe2..9756051938dd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/variance/README.md @@ -69,7 +69,7 @@ with `B` denoting the [beta function][beta-function]. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/kumaraswamy/variance' ); +const variance = require( '@stdlib/stats/base/dists/kumaraswamy/variance' ); ``` #### variance( a, b ) @@ -77,7 +77,7 @@ var variance = require( '@stdlib/stats/base/dists/kumaraswamy/variance' ); Returns the [variance][variance] of a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with first shape parameter `a` and second shape parameter `b`. ```javascript -var v = variance( 1.0, 1.0 ); +let v = variance( 1.0, 1.0 ); // returns ~0.083 v = variance( 4.0, 12.0 ); @@ -90,7 +90,7 @@ v = variance( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -100,7 +100,7 @@ v = variance( 2.0, NaN ); If provided `a <= 0`, the function returns `NaN`. ```javascript -var y = variance( -1.0, 0.5 ); +let y = variance( -1.0, 0.5 ); // returns NaN y = variance( 0.0, 0.5 ); @@ -110,7 +110,7 @@ y = variance( 0.0, 0.5 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.5, -1.0 ); +let y = variance( 0.5, -1.0 ); // returns NaN y = variance( 0.5, 0.0 ); @@ -138,18 +138,13 @@ y = variance( 0.5, 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/kumaraswamy/variance' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = randu() * 10.0; - b = randu() * 10.0; - v = variance( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/kumaraswamy/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const a = randu() * 10.0; + const b = randu() * 10.0; + const v = variance( a, b ); console.log( 'a: %d, b: %d, Var(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/README.md index 9907caefab13..0e5f74f9b75b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var laplace = require( '@stdlib/stats/base/dists/laplace' ); +const laplace = require( '@stdlib/stats/base/dists/laplace' ); ``` #### laplace @@ -35,7 +35,7 @@ var laplace = require( '@stdlib/stats/base/dists/laplace' ); Laplace distribution. ```javascript -var dist = laplace; +const dist = laplace; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [Laplace][laplace-d ```javascript -var Laplace = require( '@stdlib/stats/base/dists/laplace' ).Laplace; +const Laplace = require( '@stdlib/stats/base/dists/laplace' ).Laplace; -var dist = new Laplace( 2.0, 4.0 ); +const dist = new Laplace( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.344 ``` @@ -109,9 +109,9 @@ var y = dist.cdf( 0.5 ); ```javascript -var laplace = require( '@stdlib/stats/base/dists/laplace' ); +const laplace = require( '@stdlib/stats/base/dists/laplace' ); -var dist = new laplace.Laplace( 4.0, 2.0 ); +const dist = new laplace.Laplace( 4.0, 2.0 ); console.log( dist.mu ); // => 4.0 @@ -137,8 +137,8 @@ console.log( dist.median ); console.log( dist.variance ); // => 18.0 -var mu = 4.0; -var b = 2.0; +let mu = 4.0; +let b = 2.0; console.log( laplace.pdf( 2.0, mu, b ) ); // => ~0.092 @@ -170,7 +170,7 @@ console.log( laplace.variance( mu, b ) ); console.log( laplace.skewness( mu, b ) ); // => 0.0 -var myquantile = laplace.quantile.factory( 10.0, 2.0 ); +const myquantile = laplace.quantile.factory( 10.0, 2.0 ); console.log( myquantile( 0.2 ) ); // => ~8.167 @@ -178,7 +178,7 @@ console.log( myquantile( 0.2 ) ); console.log( myquantile( 0.8 ) ); // => ~11.833 -var mylogpdf = laplace.logpdf.factory( 10.0, 2.0 ); +const mylogpdf = laplace.logpdf.factory( 10.0, 2.0 ); console.log( mylogpdf( 10.0) ); // => ~-1.386 diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/cdf/README.md index c17a1521104b..0d25093f201a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/cdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/laplace/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/laplace/cdf' ); ``` #### cdf( x, mu, b ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/laplace/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var y = cdf( 2.0, 0.0, 1.0 ); +let y = cdf( 2.0, 0.0, 1.0 ); // returns ~0.932 y = cdf( 5.0, 10.0, 3.0 ); @@ -68,7 +68,7 @@ y = cdf( 5.0, 10.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +let y = cdf( 2.0, 0.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0, 0.0 ); @@ -93,9 +93,9 @@ y = cdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var mycdf = cdf.factory( 3.0, 1.5 ); +const mycdf = cdf.factory( 3.0, 1.5 ); -var y = mycdf( 1.0 ); +let y = mycdf( 1.0 ); // returns ~0.132 y = mycdf( 4.0 ); @@ -113,20 +113,14 @@ y = mycdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/laplace/cdf' ); - -var mu; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - b = randu() * 10.0; - y = cdf( x, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/laplace/cdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const b = randu() * 10.0; + const y = cdf( x, mu, b ); console.log( 'x: %d, µ: %d, b: %d, F(x;µ,b): %d', x.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/ctor/README.md index 3551e33d6563..70443d438a5d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Laplace = require( '@stdlib/stats/base/dists/laplace/ctor' ); +const Laplace = require( '@stdlib/stats/base/dists/laplace/ctor' ); ``` #### Laplace( \[mu, b] ) @@ -45,18 +45,18 @@ var Laplace = require( '@stdlib/stats/base/dists/laplace/ctor' ); Returns a [Laplace][laplace-distribution] distribution object. ```javascript -var laplace = new Laplace(); +const laplace = new Laplace(); -var mu = laplace.mean; +const mu = laplace.mean; // returns 0.0 ``` By default, `mu = 0.0` and `b = 1.0`. To create a distribution having a different `mu` (location parameter) and `b` (scale parameter), provide the corresponding arguments. ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var mu = laplace.mean; +const mu = laplace.mean; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [Laplace][laplace-distribution] distribution object has the following properti Location parameter of the distribution. ```javascript -var laplace = new Laplace(); +const laplace = new Laplace(); -var mu = laplace.mu; +let mu = laplace.mu; // returns 0.0 laplace.mu = 3.0; @@ -89,9 +89,9 @@ mu = laplace.mu; Scale parameter of the distribution. `b` **must** be a positive number. ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var b = laplace.b; +let b = laplace.b; // returns 4.0 laplace.b = 3.0; @@ -109,9 +109,9 @@ b = laplace.b; Returns the [differential entropy][entropy]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var entropy = laplace.entropy; +const entropy = laplace.entropy; // returns ~4.178 ``` @@ -120,9 +120,9 @@ var entropy = laplace.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var kurtosis = laplace.kurtosis; +const kurtosis = laplace.kurtosis; // returns 3.0 ``` @@ -131,9 +131,9 @@ var kurtosis = laplace.kurtosis; Returns the [expected value][expected-value]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var mu = laplace.mean; +const mu = laplace.mean; // returns 4.0 ``` @@ -142,9 +142,9 @@ var mu = laplace.mean; Returns the [median][median]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var median = laplace.median; +const median = laplace.median; // returns 4.0 ``` @@ -153,9 +153,9 @@ var median = laplace.median; Returns the [mode][mode]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var mode = laplace.mode; +const mode = laplace.mode; // returns 4.0 ``` @@ -164,9 +164,9 @@ var mode = laplace.mode; Returns the [skewness][skewness]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var skewness = laplace.skewness; +const skewness = laplace.skewness; // returns 0.0 ``` @@ -175,9 +175,9 @@ var skewness = laplace.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var s = laplace.stdev; +const s = laplace.stdev; // returns ~16.971 ``` @@ -186,9 +186,9 @@ var s = laplace.stdev; Returns the [variance][variance]. ```javascript -var laplace = new Laplace( 4.0, 12.0 ); +const laplace = new Laplace( 4.0, 12.0 ); -var s2 = laplace.variance; +const s2 = laplace.variance; // returns 288.0 ``` @@ -201,9 +201,9 @@ var s2 = laplace.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.cdf( 0.5 ); +const y = laplace.cdf( 0.5 ); // returns ~0.344 ``` @@ -212,9 +212,9 @@ var y = laplace.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.logcdf( 2.0 ); +const y = laplace.logcdf( 2.0 ); // returns ~-0.693 ``` @@ -223,9 +223,9 @@ var y = laplace.logcdf( 2.0 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.logpdf( 0.8 ); +const y = laplace.logpdf( 0.8 ); // returns ~-2.379 ``` @@ -234,9 +234,9 @@ var y = laplace.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.mgf( 0.2 ); +const y = laplace.mgf( 0.2 ); // returns ~4.144 ``` @@ -245,9 +245,9 @@ var y = laplace.mgf( 0.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.pdf( 2.0 ); +const y = laplace.pdf( 2.0 ); // returns 0.125 ``` @@ -256,9 +256,9 @@ var y = laplace.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var y = laplace.quantile( 0.5 ); +let y = laplace.quantile( 0.5 ); // returns 2.0 y = laplace.quantile( 1.9 ); @@ -288,20 +288,20 @@ y = laplace.quantile( 1.9 ); ```javascript -var Laplace = require( '@stdlib/stats/base/dists/laplace/ctor' ); +const Laplace = require( '@stdlib/stats/base/dists/laplace/ctor' ); -var laplace = new Laplace( 2.0, 4.0 ); +const laplace = new Laplace( 2.0, 4.0 ); -var mean = laplace.mean; +const mean = laplace.mean; // returns 2.0 -var median = laplace.median; +const median = laplace.median; // returns 2.0 -var s2 = laplace.variance; +const s2 = laplace.variance; // returns 32.0 -var y = laplace.cdf( 0.8 ); +const y = laplace.cdf( 0.8 ); // returns ~0.37 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/entropy/README.md index 766a7eb6aed0..59230f1f0e6d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/entropy/README.md @@ -54,7 +54,7 @@ where `e` is [Euler's number][e]. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/laplace/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/laplace/entropy' ); ``` #### entropy( mu, b ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/laplace/entropy' ); Returns the [differential entropy][entropy] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns ~1.693 y = entropy( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = entropy( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -85,7 +85,7 @@ y = entropy( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/laplace/entropy' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = entropy( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/laplace/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = entropy( mu, b ); console.log( 'µ: %d, b: %d, h(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/kurtosis/README.md index 7855cd1d7ab6..86ef52013470 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [Laplace][laplace-distribution] random var ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/laplace/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/laplace/kurtosis' ); ``` #### kurtosis( mu, b ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/laplace/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns 3.0 y = kurtosis( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -83,7 +83,7 @@ y = kurtosis( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/laplace/kurtosis' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = kurtosis( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/laplace/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = kurtosis( mu, b ); console.log( 'µ: %d, b: %d, Kurt(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/logcdf/README.md index adbd1edf0311..016b875b3f81 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/logcdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/laplace/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/laplace/logcdf' ); ``` #### logcdf( x, mu, b ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/laplace/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var y = logcdf( 2.0, 0.0, 1.0 ); +let y = logcdf( 2.0, 0.0, 1.0 ); // returns ~-0.07 y = logcdf( 5.0, 10.0, 3.0 ); @@ -68,7 +68,7 @@ y = logcdf( 5.0, 10.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +let y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN y = logcdf( 2.0, 0.0, 0.0 ); @@ -93,9 +93,9 @@ y = logcdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 3.0, 1.5 ); +const mylogcdf = logcdf.factory( 3.0, 1.5 ); -var y = mylogcdf( 1.0 ); +let y = mylogcdf( 1.0 ); // returns ~-2.026 y = mylogcdf( 4.0 ); @@ -123,20 +123,14 @@ y = mylogcdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/laplace/logcdf' ); - -var mu; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - b = randu() * 10.0; - y = logcdf( x, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/laplace/logcdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const b = randu() * 10.0; + const y = logcdf( x, mu, b ); console.log( 'x: %d, µ: %d, b: %d, ln(F(x;µ,b)): %d', x.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/logpdf/README.md index 5f37ebdb158c..126a586e4a73 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/logpdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter (also ca ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/laplace/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/laplace/logpdf' ); ``` #### logpdf( x, mu, b ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/laplace/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns ~-2.693 y = logpdf( -1.0, 2.0, 3.0 ); @@ -71,7 +71,7 @@ y = logpdf( 2.5, 2.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +let y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN y = logpdf( 2.0, 8.0, 0.0 ); @@ -96,9 +96,9 @@ y = logpdf( 2.0, 8.0, 0.0 ); Returns a `function` for evaluating the logarithm of the [PDF][pdf] for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-1.386 y = mylogpdf( 5.0 ); @@ -129,20 +129,14 @@ y = mylogpdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/laplace/logpdf' ); - -var mu; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - b = randu() * 10.0; - y = logpdf( x, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/laplace/logpdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const b = randu() * 10.0; + const y = logpdf( x, mu, b ); console.log( 'x: %d, µ: %d, b: %d, ln(f(x;µ,b)): %d', x.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/mean/README.md index fa4b051917e7..fdf2c28ec6c7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/mean/README.md @@ -52,7 +52,7 @@ The [expected value][mean] for a [Laplace][laplace-distribution] random variable ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/laplace/mean' ); +const mean = require( '@stdlib/stats/base/dists/laplace/mean' ); ``` #### mean( mu, b ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/laplace/mean' ); Returns the [expected value][mean] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns 2.0 y = mean( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mean( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/laplace/mean' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = mean( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/laplace/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = mean( mu, b ); console.log( 'µ: %d, b: %d, E(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/median/README.md index 3e6ea5434bf2..4afffb741ca6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [Laplace][laplace-distribution] random variable with ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/laplace/median' ); +const median = require( '@stdlib/stats/base/dists/laplace/median' ); ``` #### median( mu, b ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/laplace/median' ); Returns the [median][median] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns 2.0 y = median( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -83,7 +83,7 @@ y = median( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/laplace/median' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = median( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/laplace/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = median( mu, b ); console.log( 'µ: %d, b: %d, Median(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/mgf/README.md index 6b7275bc84ab..d432cc0b50aa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/mgf/README.md @@ -54,7 +54,7 @@ where `mu` is the location parameter and `b` is the scale parameter. For `|t| >= ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/laplace/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/laplace/mgf' ); ``` #### mgf( t, mu, b ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/laplace/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [Laplace][laplace-distribution] (double exponential) distribution with parameters `mu` (location) and `b` (scale). ```javascript -var y = mgf( 0.5, 0.0, 1.0 ); +let y = mgf( 0.5, 0.0, 1.0 ); // returns ~1.333 y = mgf( 0.0, 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = mgf( -1.0, 4.0, 0.2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,7 +88,7 @@ y = mgf( 0.0, 0.0, NaN ); If `t` is not inside the interval `(-1/b, 1/b)`, the function returns `NaN`. ```javascript -var y = mgf( 1.0, 0.0, 2.0 ); +let y = mgf( 1.0, 0.0, 2.0 ); // returns NaN y = mgf( -0.5, 0.0, 4.0 ); @@ -98,7 +98,7 @@ y = mgf( -0.5, 0.0, 4.0 ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 0.0, 0.0 ); +let y = mgf( 2.0, 0.0, 0.0 ); // returns NaN y = mgf( 2.0, 0.0, -1.0 ); @@ -110,9 +110,9 @@ y = mgf( 2.0, 0.0, -1.0 ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) of a [Laplace][laplace-distribution] (double exponential) distribution with parameters `mu` and `b`. ```javascript -var mymgf = mgf.factory( 4.0, 2.0 ); +const mymgf = mgf.factory( 4.0, 2.0 ); -var y = mymgf( 0.2 ); +let y = mymgf( 0.2 ); // returns ~2.649 y = mymgf( 0.4 ); @@ -140,20 +140,14 @@ y = mymgf( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/laplace/mgf' ); - -var mu; -var b; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - mu = (randu() * 10.0) - 5.0; - b = randu() * 20.0; - y = mgf( t, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/laplace/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const mu = (randu() * 10.0) - 5.0; + const b = randu() * 20.0; + const y = mgf( t, mu, b ); console.log( 't: %d, µ: %d, b: %d, M_X(t;µ,b): %d', t.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/mode/README.md index 5ecc55d76cc9..13da273f0b12 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Laplace][laplace-distribution] random variable with loca ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/laplace/mode' ); +const mode = require( '@stdlib/stats/base/dists/laplace/mode' ); ``` #### mode( mu, b ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/laplace/mode' ); Returns the [mode][mode] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns 2.0 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/laplace/mode' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = mode( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/laplace/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = mode( mu, b ); console.log( 'µ: %d, b: %d, mode(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/pdf/README.md index 9ea49b0e069b..34da8da51ccd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/pdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter (also ca ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/laplace/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/laplace/pdf' ); ``` #### pdf( x, mu, b ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/laplace/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns ~0.068 y = pdf( -1.0, 2.0, 3.0 ); @@ -71,7 +71,7 @@ y = pdf( 2.5, 2.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +let y = pdf( 2.0, 0.0, -1.0 ); // returns NaN y = pdf( 2.0, 8.0, 0.0 ); @@ -96,9 +96,9 @@ y = pdf( 2.0, 8.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns 0.25 y = mypdf( 5.0 ); @@ -119,20 +119,14 @@ y = mypdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/laplace/pdf' ); - -var mu; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - b = randu() * 10.0; - y = pdf( x, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/laplace/pdf' ); + +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const b = randu() * 10.0; + const y = pdf( x, mu, b ); console.log( 'x: %d, µ: %d, b: %d, f(x;µ,b): %d', x.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/quantile/README.md index 3b6cbad2f058..9adf38c21eed 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `mu` is the location parameter and `b > 0` is the scale ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/laplace/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/laplace/quantile' ); ``` #### quantile( p, mu, b ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/laplace/quantile' ); Evaluates the [quantile function][quantile-function] for a [Laplace][laplace-distribution] distribution with parameters `mu` (location parameter) and `b > 0` (scale parameter). ```javascript -var y = quantile( 0.8, 0.0, 1.0 ); +let y = quantile( 0.8, 0.0, 1.0 ); // returns ~0.916 y = quantile( 0.5, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +let y = quantile( 0.4, 0.0, -1.0 ); // returns NaN y = quantile( 0.4, 0.0, 0.0 ); @@ -103,9 +103,9 @@ y = quantile( 0.4, 0.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Laplace][laplace-distribution] distribution with parameters `mu` and `b > 0`. ```javascript -var myquantile = quantile.factory( 10.0, 2.0 ); +const myquantile = quantile.factory( 10.0, 2.0 ); -var y = myquantile( 0.5 ); +let y = myquantile( 0.5 ); // returns 10.0 y = myquantile( 0.8 ); @@ -123,20 +123,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/laplace/quantile' ); - -var mu; -var b; -var p; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - p = randu(); - mu = randu() * 10.0; - b = randu() * 10.0; - y = quantile( p, mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/laplace/quantile' ); + +for ( let i = 0; i < 100; i++ ) { + const p = randu(); + const mu = randu() * 10.0; + const b = randu() * 10.0; + const y = quantile( p, mu, b ); console.log( 'p: %d, µ: %d, b: %d, Q(p;µ,b): %d', p.toFixed( 4 ), mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/skewness/README.md index d7089ccd708d..81c575b1a57c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [Laplace][laplace-distribution] random variable w ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/laplace/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/laplace/skewness' ); ``` #### skewness( mu, b ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/laplace/skewness' ); Returns the [skewness][skewness] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns 0.0 y = skewness( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = skewness( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -83,7 +83,7 @@ y = skewness( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/laplace/skewness' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = skewness( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/laplace/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = skewness( mu, b ); console.log( 'µ: %d, b: %d, skew(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/stdev/README.md index d5ff6e50187b..c53c7670f049 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][standard-deviation] for a [Laplace][laplace-distributio ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/laplace/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/laplace/stdev' ); ``` #### stdev( mu, b ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/laplace/stdev' ); Returns the [standard deviation][standard-deviation] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns ~1.414 y = stdev( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -83,7 +83,7 @@ y = stdev( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/laplace/stdev' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = stdev( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/laplace/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = stdev( mu, b ); console.log( 'µ: %d, b: %d, SD(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/laplace/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/laplace/variance/README.md index e0b9e94c2ea9..3638de3ff06a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/laplace/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/laplace/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [Laplace][laplace-distribution] random variable w ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/laplace/variance' ); +const variance = require( '@stdlib/stats/base/dists/laplace/variance' ); ``` #### variance( mu, b ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/laplace/variance' ); Returns the [variance][variance] for a [Laplace][laplace-distribution] distribution with location parameter `mu` and scale parameter `b`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns 2.0 y = variance( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -83,7 +83,7 @@ y = variance( 0.0, NaN ); If provided `b <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/laplace/variance' ); - -var mu; -var b; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - b = randu() * 20.0; - y = variance( mu, b ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/laplace/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const b = randu() * 20.0; + const y = variance( mu, b ); console.log( 'µ: %d, b: %d, Var(X;µ,b): %d', mu.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/README.md index 5c990334de64..832a1e35b7dd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var levy = require( '@stdlib/stats/base/dists/levy' ); +const levy = require( '@stdlib/stats/base/dists/levy' ); ``` #### levy @@ -35,7 +35,7 @@ var levy = require( '@stdlib/stats/base/dists/levy' ); Lévy distribution. ```javascript -var dist = levy; +const dist = levy; // returns {...} ``` @@ -85,11 +85,11 @@ The namespace contains a constructor function for creating a [Lévy][levy-distri ```javascript -var Levy = require( '@stdlib/stats/base/dists/levy' ).Levy; +const Levy = require( '@stdlib/stats/base/dists/levy' ).Levy; -var dist = new Levy( 2.0, 4.0 ); +const dist = new Levy( 2.0, 4.0 ); -var y = dist.pdf( 2.5 ); +const y = dist.pdf( 2.5 ); // returns ~0.041 ``` @@ -106,8 +106,8 @@ var y = dist.pdf( 2.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var levy = require( '@stdlib/stats/base/dists/levy' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const levy = require( '@stdlib/stats/base/dists/levy' ); console.log( objectKeys( levy ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/cdf/README.md index 1807a0c949b7..22b97ba01e9d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/cdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/levy/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/levy/cdf' ); ``` #### cdf( x, mu, c ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/levy/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c > 0` (scale parameter). ```javascript -var y = cdf( 2.0, 0.0, 1.0 ); +let y = cdf( 2.0, 0.0, 1.0 ); // returns ~0.48 y = cdf( 12.0, 10.0, 3.0 ); @@ -71,7 +71,7 @@ y = cdf( 9.0, 10.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +let y = cdf( 2.0, 0.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = cdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c > 0` (scale parameter). ```javascript -var mycdf = cdf.factory( 3.0, 1.5 ); +const mycdf = cdf.factory( 3.0, 1.5 ); -var y = mycdf( 4.0 ); +let y = mycdf( 4.0 ); // returns ~0.22 y = mycdf( 2.0 ); @@ -116,21 +116,15 @@ y = mycdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var cdf = require( '@stdlib/stats/base/dists/levy/cdf' ); - -var mu; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - mu = randu() * 10.0; - x = ( randu()*10.0 ) + mu; - c = ( randu()*10.0 ) + EPS; - y = cdf( x, mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const cdf = require( '@stdlib/stats/base/dists/levy/cdf' ); + +for ( let i = 0; i < 100; i++ ) { + const mu = randu() * 10.0; + const x = ( randu()*10.0 ) + mu; + const c = ( randu()*10.0 ) + EPS; + const y = cdf( x, mu, c ); console.log( 'x: %d, µ: %d, c: %d, F(x;µ,c): %d', x.toFixed( 4 ), mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/ctor/README.md index 56869e6181f0..af19fcc94572 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Levy = require( '@stdlib/stats/base/dists/levy/ctor' ); +const Levy = require( '@stdlib/stats/base/dists/levy/ctor' ); ``` #### Levy( \[mu, c] ) @@ -45,18 +45,18 @@ var Levy = require( '@stdlib/stats/base/dists/levy/ctor' ); Returns a [Lévy][levy-distribution] distribution object. ```javascript -var levy = new Levy(); +const levy = new Levy(); -var median = levy.median; +const median = levy.median; // returns ~2.198 ``` By default, `mu = 0.0` and `c = 1.0`. To create a distribution having a different `mu` (location parameter) and `c` (scale parameter), provide the corresponding arguments. ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var median = levy.median; +const median = levy.median; // returns ~10.792 ``` @@ -73,9 +73,9 @@ A [Lévy][levy-distribution] distribution object has the following properties an Location parameter of the distribution. ```javascript -var levy = new Levy(); +const levy = new Levy(); -var mu = levy.mu; +let mu = levy.mu; // returns 0.0 levy.mu = 3.0; @@ -89,9 +89,9 @@ mu = levy.mu; Scale parameter of the distribution. `c` **must** be a positive number. ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var c = levy.c; +let c = levy.c; // returns 4.0 levy.c = 3.0; @@ -109,9 +109,9 @@ c = levy.c; Returns the [differential entropy][entropy]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var entropy = levy.entropy; +const entropy = levy.entropy; // returns ~5.809 ``` @@ -120,9 +120,9 @@ var entropy = levy.entropy; Returns the [expected value][expected-value]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var mu = levy.mean; +const mu = levy.mean; // returns Infinity ``` @@ -131,9 +131,9 @@ var mu = levy.mean; Returns the [median][median]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var median = levy.median; +const median = levy.median; // returns ~30.377 ``` @@ -142,9 +142,9 @@ var median = levy.median; Returns the [mode][mode]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var mode = levy.mode; +const mode = levy.mode; // returns 8.0 ``` @@ -153,9 +153,9 @@ var mode = levy.mode; Returns the [standard deviation][standard-deviation]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var s = levy.stdev; +const s = levy.stdev; // returns Infinity ``` @@ -164,9 +164,9 @@ var s = levy.stdev; Returns the [variance][variance]. ```javascript -var levy = new Levy( 4.0, 12.0 ); +const levy = new Levy( 4.0, 12.0 ); -var s2 = levy.variance; +const s2 = levy.variance; // returns Infinity ``` @@ -179,9 +179,9 @@ var s2 = levy.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var y = levy.cdf( 2.5 ); +const y = levy.cdf( 2.5 ); // returns ~0.005 ``` @@ -190,9 +190,9 @@ var y = levy.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var y = levy.logcdf( 2.5 ); +const y = levy.logcdf( 2.5 ); // returns ~-5.365 ``` @@ -201,9 +201,9 @@ var y = levy.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var y = levy.logpdf( 2.2 ); +const y = levy.logpdf( 2.2 ); // returns ~-7.812 ``` @@ -212,9 +212,9 @@ var y = levy.logpdf( 2.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var y = levy.pdf( 2.5 ); +const y = levy.pdf( 2.5 ); // returns ~0.041 ``` @@ -223,9 +223,9 @@ var y = levy.pdf( 2.5 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var y = levy.quantile( 0.5 ); +let y = levy.quantile( 0.5 ); // returns ~10.792 y = levy.quantile( 1.9 ); @@ -255,20 +255,20 @@ y = levy.quantile( 1.9 ); ```javascript -var Levy = require( '@stdlib/stats/base/dists/levy/ctor' ); +const Levy = require( '@stdlib/stats/base/dists/levy/ctor' ); -var levy = new Levy( 2.0, 4.0 ); +const levy = new Levy( 2.0, 4.0 ); -var mean = levy.mean; +const mean = levy.mean; // returns Infinity -var median = levy.median; +const median = levy.median; // returns ~10.792 -var s2 = levy.variance; +const s2 = levy.variance; // returns Infinity -var y = levy.cdf( 20.0 ); +const y = levy.cdf( 20.0 ); // returns ~0.637 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/entropy/README.md index 39c1847c7a82..9ed5905428af 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/entropy/README.md @@ -54,7 +54,7 @@ where `γ` is the [Euler-Mascheroni constants][euler-mascheroni]. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/levy/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/levy/entropy' ); ``` #### entropy( mu, c ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/levy/entropy' ); Returns the [differential entropy][entropy] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns ~3.324 y = entropy( 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = entropy( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -85,7 +85,7 @@ y = entropy( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -113,18 +113,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/levy/entropy' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = entropy( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/levy/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = entropy( mu, c ); console.log( 'µ: %d, c: %d, h(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/README.md index 9b6183123a6f..27641f26c7cb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `b > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/levy/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/levy/logcdf' ); ``` #### logcdf( x, mu, c ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/levy/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c > 0` (scale parameter). ```javascript -var y = logcdf( 2.0, 0.0, 1.0 ); +let y = logcdf( 2.0, 0.0, 1.0 ); // returns ~-0.735 y = logcdf( 12.0, 10.0, 3.0 ); @@ -71,7 +71,7 @@ y = logcdf( 9.0, 10.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +let y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN y = logcdf( 2.0, 0.0, 0.0 ); @@ -96,9 +96,9 @@ y = logcdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c > 0` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 3.0, 1.5 ); +const mylogcdf = logcdf.factory( 3.0, 1.5 ); -var y = mylogcdf( 4.0 ); +let y = mylogcdf( 4.0 ); // returns ~-1.511 y = mylogcdf( 2.0 ); @@ -126,21 +126,15 @@ y = mylogcdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logcdf = require( '@stdlib/stats/base/dists/levy/logcdf' ); - -var mu; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 100; i++ ) { - mu = randu() * 10.0; - x = ( randu()*10.0 ) + mu; - c = ( randu()*10.0 ) + EPS; - y = logcdf( x, mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logcdf = require( '@stdlib/stats/base/dists/levy/logcdf' ); + +for ( let i = 0; i < 100; i++ ) { + const mu = randu() * 10.0; + const x = ( randu()*10.0 ) + mu; + const c = ( randu()*10.0 ) + EPS; + const y = logcdf( x, mu, c ); console.log( 'x: %d, µ: %d, c: %d, ln(F(x;µ,c)): %d', x.toFixed( 4 ), mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/README.md index c6d5f1fefc5e..26a5d9738831 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `c > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/levy/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/levy/logpdf' ); ``` #### logpdf( x, mu, c ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/levy/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns ~-2.209 y = logpdf( -1.0, 4.0, 4.0 ); @@ -68,7 +68,7 @@ y = logpdf( -1.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +let y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN y = logpdf( 2.0, 0.0, 0.0 ); @@ -93,9 +93,9 @@ y = logpdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the logarithm of the [probability density function][pdf] (PDF) of a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 11.0 ); +let y = mylogpdf( 11.0 ); // returns ~-1.572 y = mylogpdf( 20.0 ); @@ -123,21 +123,15 @@ y = mylogpdf( 20.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var logpdf = require( '@stdlib/stats/base/dists/levy/logpdf' ); - -var mu; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu() * 10.0; - x = ( randu()*10.0 ) + mu; - c = ( randu()*10.0 ) + EPS; - y = logpdf( x, mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const logpdf = require( '@stdlib/stats/base/dists/levy/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = randu() * 10.0; + const x = ( randu()*10.0 ) + mu; + const c = ( randu()*10.0 ) + EPS; + const y = logpdf( x, mu, c ); console.log( 'x: %d, µ: %d, c: %d, ln(f(x;µ,c)): %d', x, mu, c, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/mean/README.md index 947ec3c5c57d..f45754115400 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/mean/README.md @@ -52,7 +52,7 @@ The [expected value][mean] for a [Lévy][levy-distribution] random variable with ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/levy/mean' ); +const mean = require( '@stdlib/stats/base/dists/levy/mean' ); ``` #### mean( mu, c ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/levy/mean' ); Returns the [expected value][mean] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns Infinity y = mean( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mean( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/levy/mean' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = mean( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/levy/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = mean( mu, c ); console.log( 'µ: %d, c: %d, E(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/median/README.md index 962717a9ae59..7ffe417ff16b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [Lévy][levy-distribution] random variable with locat ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/levy/median' ); +const median = require( '@stdlib/stats/base/dists/levy/median' ); ``` #### median( mu, c ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/levy/median' ); Returns the [median][median] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns ~4.198 y = median( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = median( -2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -83,7 +83,7 @@ y = median( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/levy/median' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = median( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/levy/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = median( mu, c ); console.log( 'µ: %d, c: %d, Median(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/mode/README.md index 96dfe5f0ee18..49607f9a096f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Lévy][levy-distribution] random variable with location ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/levy/mode' ); +const mode = require( '@stdlib/stats/base/dists/levy/mode' ); ``` #### mode( mu, c ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/levy/mode' ); Returns the [mode][mode] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns ~2.333 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/levy/mode' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = mode( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/levy/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = mode( mu, c ); console.log( 'µ: %d, c: %d, mode(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/pdf/README.md index 9b623c8b0d95..f334af0b70c4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/pdf/README.md @@ -50,7 +50,7 @@ where `μ` is the location parameter and `c > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/levy/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/levy/pdf' ); ``` #### pdf( x, mu, c ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/levy/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns ~0.11 y = pdf( -1.0, 4.0, 4.0 ); @@ -68,7 +68,7 @@ y = pdf( -1.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +let y = pdf( 2.0, 0.0, -1.0 ); // returns NaN y = pdf( 2.0, 0.0, 0.0 ); @@ -93,9 +93,9 @@ y = pdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); -var y = mypdf( 11.0 ); +let y = mypdf( 11.0 ); // returns ~0.208 y = mypdf( 20.0 ); @@ -113,21 +113,15 @@ y = mypdf( 20.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var pdf = require( '@stdlib/stats/base/dists/levy/pdf' ); - -var mu; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = randu() * 10.0; - x = ( randu()*10.0 ) + mu; - c = ( randu()*10.0 ) + EPS; - y = pdf( x, mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const pdf = require( '@stdlib/stats/base/dists/levy/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = randu() * 10.0; + const x = ( randu()*10.0 ) + mu; + const c = ( randu()*10.0 ) + EPS; + const y = pdf( x, mu, c ); console.log( 'x: %d, µ: %d, c: %d, f(x;µ,c): %d', x, mu, c, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/quantile/README.md index 2b74fe4bd622..b370e4a1a9c0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `µ` is the location parameter and `c > 0` is the scale ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/levy/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/levy/quantile' ); ``` #### quantile( p, mu, c ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/levy/quantile' ); Evaluates the [quantile function][quantile-function] for a [Lévy][levy-distribution] distribution with parameters `mu` (location parameter) and `c` (scale parameter). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns ~2.198 y = quantile( 0.2, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.2, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +let y = quantile( 0.4, 0.0, -1.0 ); // returns NaN y = quantile( 0.4, 0.0, 0.0 ); @@ -103,9 +103,9 @@ y = quantile( 0.4, 0.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Lévy][levy-distribution] distribution with parameters `mu` and `c`. ```javascript -var myQuantile = quantile.factory( 10.0, 2.0 ); +const myQuantile = quantile.factory( 10.0, 2.0 ); -var y = myQuantile( 0.2 ); +let y = myQuantile( 0.2 ); // returns ~11.218 y = myQuantile( 0.8 ); @@ -123,20 +123,14 @@ y = myQuantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/levy/quantile' ); - -var mu; -var c; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = randu() * 10.0; - c = randu() * 10.0; - y = quantile( p, mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/levy/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = randu() * 10.0; + const c = randu() * 10.0; + const y = quantile( p, mu, c ); console.log( 'p: %d, µ: %d, c: %d, Q(p;µ,c): %d', p, mu, c, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/stdev/README.md index 6cceb944df46..8186dcad40c4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][standard-deviation] for a [Lévy][levy-distribution] ra ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/levy/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/levy/stdev' ); ``` #### stdev( mu, c ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/levy/stdev' ); Returns the [standard deviation][standard-deviation] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns Infinity y = stdev( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -83,7 +83,7 @@ y = stdev( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/levy/stdev' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = stdev( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/levy/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = stdev( mu, c ); console.log( 'µ: %d, c: %d, SD(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/levy/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/levy/variance/README.md index 624b524088e9..13ddf8fcd612 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/levy/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/levy/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [Lévy][levy-distribution] random variable with l ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/levy/variance' ); +const variance = require( '@stdlib/stats/base/dists/levy/variance' ); ``` #### variance( mu, c ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/levy/variance' ); Returns the [variance][variance] for a [Lévy][levy-distribution] distribution with location parameter `mu` and scale parameter `c`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns Infinity y = variance( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -83,7 +83,7 @@ y = variance( 0.0, NaN ); If provided `c <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/levy/variance' ); - -var mu; -var c; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - c = randu() * 20.0; - y = variance( mu, c ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/levy/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const c = randu() * 20.0; + const y = variance( mu, c ); console.log( 'µ: %d, c: %d, Var(X;µ,c): %d', mu.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/README.md index e5b4d023409d..fd06e0f90554 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var logistic = require( '@stdlib/stats/base/dists/logistic' ); +const logistic = require( '@stdlib/stats/base/dists/logistic' ); ``` #### logistic @@ -35,7 +35,7 @@ var logistic = require( '@stdlib/stats/base/dists/logistic' ); Logistic distribution. ```javascript -var dist = logistic; +const dist = logistic; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [logistic][logistic ```javascript -var Logistic = require( '@stdlib/stats/base/dists/logistic' ).Logistic; +const Logistic = require( '@stdlib/stats/base/dists/logistic' ).Logistic; -var dist = new Logistic( 2.0, 4.0 ); +const dist = new Logistic( 2.0, 4.0 ); -var y = dist.pdf( 2.0 ); +const y = dist.pdf( 2.0 ); // returns 0.0625 ``` @@ -109,8 +109,8 @@ var y = dist.pdf( 2.0 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var logistic = require( '@stdlib/stats/base/dists/logistic' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const logistic = require( '@stdlib/stats/base/dists/logistic' ); console.log( objectKeys( logistic ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/README.md index 4f84d3dc31b2..b472f2c94f1a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/logistic/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/logistic/cdf' ); ``` #### cdf( x, mu, s ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/logistic/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = cdf( 2.0, 0.0, 1.0 ); +let y = cdf( 2.0, 0.0, 1.0 ); // returns ~0.881 y = cdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = cdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +const y = cdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = cdf( 2.0, 8.0, 0.0 ); +let y = cdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = cdf( 8.0, 8.0, 0.0 ); @@ -106,9 +106,9 @@ y = cdf( 10.0, 8.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns 0.5 y = mycdf( 8.0 ); @@ -126,20 +126,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/logistic/cdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = cdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/logistic/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = cdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, F(x;µ,s): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/ctor/README.md index 1732795f0c96..3e61b30978ff 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Logistic = require( '@stdlib/stats/base/dists/logistic/ctor' ); +const Logistic = require( '@stdlib/stats/base/dists/logistic/ctor' ); ``` #### Logistic( \[mu, s] ) @@ -45,18 +45,18 @@ var Logistic = require( '@stdlib/stats/base/dists/logistic/ctor' ); Returns a [logistic][logistic-distribution] distribution object. ```javascript -var logistic = new Logistic(); +const logistic = new Logistic(); -var mu = logistic.mean; +const mu = logistic.mean; // returns 0.0 ``` By default, `mu = 0.0` and `s = 1.0`. To create a distribution having a different `mu` (location parameter) and `s` (scale parameter), provide the corresponding arguments. ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var mu = logistic.mean; +const mu = logistic.mean; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [logistic][logistic-distribution] distribution object has the following proper Location parameter of the distribution. ```javascript -var logistic = new Logistic(); +const logistic = new Logistic(); -var mu = logistic.mu; +let mu = logistic.mu; // returns 0.0 logistic.mu = 3.0; @@ -89,9 +89,9 @@ mu = logistic.mu; Scale parameter of the distribution. `s` **must** be a positive number. ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var s = logistic.s; +let s = logistic.s; // returns 4.0 logistic.s = 3.0; @@ -109,9 +109,9 @@ s = logistic.s; Returns the [differential entropy][entropy]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var entropy = logistic.entropy; +const entropy = logistic.entropy; // returns ~4.485 ``` @@ -120,9 +120,9 @@ var entropy = logistic.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var kurtosis = logistic.kurtosis; +const kurtosis = logistic.kurtosis; // returns 1.2 ``` @@ -131,9 +131,9 @@ var kurtosis = logistic.kurtosis; Returns the [expected value][expected-value]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var mu = logistic.mean; +const mu = logistic.mean; // returns 4.0 ``` @@ -142,9 +142,9 @@ var mu = logistic.mean; Returns the [median][median]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var median = logistic.median; +const median = logistic.median; // returns 4.0 ``` @@ -153,9 +153,9 @@ var median = logistic.median; Returns the [mode][mode]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var mode = logistic.mode; +const mode = logistic.mode; // returns 4.0 ``` @@ -164,9 +164,9 @@ var mode = logistic.mode; Returns the [skewness][skewness]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var skewness = logistic.skewness; +const skewness = logistic.skewness; // returns 0.0 ``` @@ -175,9 +175,9 @@ var skewness = logistic.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var s = logistic.stdev; +const s = logistic.stdev; // returns ~21.766 ``` @@ -186,9 +186,9 @@ var s = logistic.stdev; Returns the [variance][variance]. ```javascript -var logistic = new Logistic( 4.0, 12.0 ); +const logistic = new Logistic( 4.0, 12.0 ); -var s2 = logistic.variance; +const s2 = logistic.variance; // returns ~473.741 ``` @@ -201,9 +201,9 @@ var s2 = logistic.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.cdf( 0.5 ); +const y = logistic.cdf( 0.5 ); // returns ~0.407 ``` @@ -212,9 +212,9 @@ var y = logistic.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.logcdf( 2.0 ); +const y = logistic.logcdf( 2.0 ); // returns ~-0.693 ``` @@ -223,9 +223,9 @@ var y = logistic.logcdf( 2.0 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.logpdf( 0.8 ); +const y = logistic.logpdf( 0.8 ); // returns ~-2.795 ``` @@ -234,9 +234,9 @@ var y = logistic.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.mgf( 0.2 ); +const y = logistic.mgf( 0.2 ); // returns ~6.379 ``` @@ -245,9 +245,9 @@ var y = logistic.mgf( 0.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.pdf( 2.0 ); +const y = logistic.pdf( 2.0 ); // returns 0.0625 ``` @@ -256,9 +256,9 @@ var y = logistic.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var y = logistic.quantile( 0.5 ); +let y = logistic.quantile( 0.5 ); // returns 2.0 y = logistic.quantile( 1.9 ); @@ -288,20 +288,20 @@ y = logistic.quantile( 1.9 ); ```javascript -var Logistic = require( '@stdlib/stats/base/dists/logistic/ctor' ); +const Logistic = require( '@stdlib/stats/base/dists/logistic/ctor' ); -var logistic = new Logistic( 2.0, 4.0 ); +const logistic = new Logistic( 2.0, 4.0 ); -var mean = logistic.mean; +const mean = logistic.mean; // returns 2.0 -var median = logistic.median; +const median = logistic.median; // returns 2.0 -var s2 = logistic.variance; +const s2 = logistic.variance; // returns ~52.638 -var y = logistic.cdf( 0.8 ); +const y = logistic.cdf( 0.8 ); // returns ~0.426 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/README.md index 0c378ae512d3..748df87e8a52 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/README.md @@ -52,7 +52,7 @@ h\left( X \right) = \ln( s ) + 2s ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/logistic/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/logistic/entropy' ); ``` #### entropy( mu, s ) @@ -60,7 +60,7 @@ var entropy = require( '@stdlib/stats/base/dists/logistic/entropy' ); Returns the [differential entropy][entropy] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns 2.0 y = entropy( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = entropy( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -83,7 +83,7 @@ y = entropy( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/logistic/entropy' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = entropy( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/logistic/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = entropy( mu, s ); console.log( 'µ: %d, s: %d, h(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/kurtosis/README.md index 1af169055855..58e153d13b8d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [logistic][logistic-distribution] random v ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/logistic/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/logistic/kurtosis' ); ``` #### kurtosis( mu, s ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/logistic/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns 1.2 y = kurtosis( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -83,7 +83,7 @@ y = kurtosis( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/logistic/kurtosis' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = kurtosis( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/logistic/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = kurtosis( mu, s ); console.log( 'µ: %d, s: %d, Kurt(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/logcdf/README.md index b06d9ad9f552..6e072604b652 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/logcdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `s > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/logistic/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/logistic/logcdf' ); ``` #### logcdf( x, mu, s ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/logistic/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = logcdf( 2.0, 0.0, 1.0 ); +let y = logcdf( 2.0, 0.0, 1.0 ); // returns ~-0.127 y = logcdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = logcdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +const y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the logarithm of the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logcdf( 2.0, 8.0, 0.0 ); +let y = logcdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logcdf( 8.0, 8.0, 0.0 ); @@ -106,9 +106,9 @@ y = logcdf( 10.0, 8.0, 0.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.693 y = mylogcdf( 8.0 ); @@ -136,20 +136,14 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/logistic/logcdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = logcdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/logistic/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = logcdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, ln(F(x;µ,s)): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/README.md index 4ca0f4f13c24..ceac2c1ca9c0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `s` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/logistic/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/logistic/logpdf' ); ``` #### logpdf( x, mu, s ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/logistic/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns ~-2.254 y = logpdf( -1.0, 4.0, 4.0 ); @@ -68,7 +68,7 @@ y = logpdf( -1.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +const y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logpdf( 2.0, 8.0, 0.0 ); +let y = logpdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logpdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = logpdf( 8.0, 8.0, 0.0 ); Returns a function for evaluating the logarithm of the [probability density function][pdf] (PDF) of a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-2.079 y = mylogpdf( 5.0 ); @@ -130,20 +130,14 @@ y = mylogpdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/logistic/logpdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = logpdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/logistic/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = logpdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, ln(f(x;µ,s)): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/mean/README.md index 1900c68741de..8b8e8125702b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/mean/README.md @@ -52,7 +52,7 @@ The [expected value][mean] for a [logistic][logistic-distribution] random variab ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/logistic/mean' ); +const mean = require( '@stdlib/stats/base/dists/logistic/mean' ); ``` #### mean( mu, s ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/logistic/mean' ); Returns the [expected value][mean] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns 2.0 y = mean( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mean( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/logistic/mean' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = mean( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/logistic/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = mean( mu, s ); console.log( 'µ: %d, s: %d, E(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/median/README.md index fbbe1e0ebfc4..b6d075619f52 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [logistic][logistic-distribution] random variable wit ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/logistic/median' ); +const median = require( '@stdlib/stats/base/dists/logistic/median' ); ``` #### median( mu, s ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/logistic/median' ); Returns the [median][median] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns 2.0 y = median( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -83,7 +83,7 @@ y = median( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/logistic/median' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = median( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/logistic/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = median( mu, s ); console.log( 'µ: %d, s: %d, Median(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/mgf/README.md index 39298daf94b7..8c7331a55874 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/mgf/README.md @@ -54,7 +54,7 @@ for `st ∈ (-1,1)`, where `mu` is the location parameter and `s` is the scale p ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/logistic/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/logistic/mgf' ); ``` #### mgf( t, mu, s ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/logistic/mgf' ); Evaluates the logarithm of the [moment-generating function][mgf] (MGF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = mgf( 0.9, 0.0, 1.0 ); +let y = mgf( 0.9, 0.0, 1.0 ); // returns ~9.15 y = mgf( 0.1, 4.0, 4.0 ); @@ -75,7 +75,7 @@ y = mgf( -0.2, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,7 +88,7 @@ y = mgf( 0.0, 0.0, NaN ); If provided `s < 0` or `abs( s * t ) > 1`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, 0.0, -1.0 ); +let y = mgf( 0.5, 0.0, -1.0 ); // returns NaN y = mgf( 0.5, 0.0, 4.0 ); @@ -100,9 +100,9 @@ y = mgf( 0.5, 0.0, 4.0 ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) of a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mymgf = mgf.factory( 10.0, 0.5 ); +const mymgf = mgf.factory( 10.0, 0.5 ); -var y = mymgf( 0.5 ); +let y = mymgf( 0.5 ); // returns ~164.846 y = mymgf( 2.0 ); @@ -130,20 +130,14 @@ y = mymgf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/logistic/mgf' ); - -var mu; -var s; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - mu = (randu() * 10.0) - 5.0; - s = randu() * 2.0; - y = mgf( t, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/logistic/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const mu = (randu() * 10.0) - 5.0; + const s = randu() * 2.0; + const y = mgf( t, mu, s ); console.log( 't: %d, µ: %d, s: %d, M_X(t;µ,s): %d', t.toFixed( 4 ), mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/mode/README.md index 3306a94ad639..bf53fb4610cb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [logistic][logistic-distribution] random variable with lo ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/logistic/mode' ); +const mode = require( '@stdlib/stats/base/dists/logistic/mode' ); ``` #### mode( mu, s ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/logistic/mode' ); Returns the [mode][mode] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns 2.0 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/logistic/mode' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = mode( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/logistic/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = mode( mu, s ); console.log( 'µ: %d, s: %d, mode(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/pdf/README.md index 8564fac68f7e..dc039817c14d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/pdf/README.md @@ -50,7 +50,7 @@ where `mu` is the location parameter and `s` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/logistic/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/logistic/pdf' ); ``` #### pdf( x, mu, s ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/logistic/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns ~0.105 y = pdf( -1.0, 4.0, 4.0 ); @@ -68,7 +68,7 @@ y = pdf( -1.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = pdf( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +const y = pdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = pdf( 2.0, 8.0, 0.0 ); +let y = pdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = pdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = pdf( 8.0, 8.0, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns 0.125 y = mypdf( 5.0 ); @@ -120,20 +120,14 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/logistic/pdf' ); - -var mu; -var s; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = randu() * 10.0; - s = randu() * 10.0; - y = pdf( x, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/logistic/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = pdf( x, mu, s ); console.log( 'x: %d, µ: %d, s: %d, f(x;µ,s): %d', x, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/quantile/README.md index 9e02846fa14c..f00664b4b016 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `µ` is the location parameter and `s > 0` is the scale ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/logistic/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/logistic/quantile' ); ``` #### quantile( p, mu, s ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/logistic/quantile' ); Evaluates the [quantile function][quantile-function] for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns 0.0 y = quantile( 0.2, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.2, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,14 +91,14 @@ y = quantile( 0.0, 0.0, NaN ); If provided `s < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +const y = quantile( 0.4, 0.0, -1.0 ); // returns NaN ``` If provided `s = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = quantile( 0.3, 8.0, 0.0 ); +let y = quantile( 0.3, 8.0, 0.0 ); // returns 8.0 y = quantile( 0.9, 8.0, 0.0 ); @@ -110,9 +110,9 @@ y = quantile( 0.9, 8.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [logistic][logistic-distribution] distribution with parameters `mu` and `s`. ```javascript -var myQuantile = quantile.factory( 10.0, 2.0 ); +const myQuantile = quantile.factory( 10.0, 2.0 ); -var y = myQuantile( 0.2 ); +let y = myQuantile( 0.2 ); // returns ~7.227 y = myQuantile( 0.8 ); @@ -130,20 +130,14 @@ y = myQuantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/logistic/quantile' ); - -var mu; -var s; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = randu() * 10.0; - s = randu() * 10.0; - y = quantile( p, mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/logistic/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = randu() * 10.0; + const s = randu() * 10.0; + const y = quantile( p, mu, s ); console.log( 'p: %d, µ: %d, s: %d, Q(p;µ,s): %d', p, mu, s, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/README.md index 3bd7e22033a7..e675fd878746 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [logistic][logistic-distribution] random variable ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/logistic/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/logistic/skewness' ); ``` #### skewness( mu, s ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/logistic/skewness' ); Returns the [skewness][skewness] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns 0.0 y = skewness( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = skewness( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -83,7 +83,7 @@ y = skewness( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/logistic/skewness' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = skewness( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/logistic/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = skewness( mu, s ); console.log( 'µ: %d, s: %d, skew(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/README.md index f0ac7fc5fec5..0dd6465d30c8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/README.md @@ -52,7 +52,7 @@ The [standard deviation][standard-deviation] for a [logistic][logistic-distribut ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/logistic/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/logistic/stdev' ); ``` #### stdev( mu, s ) @@ -60,7 +60,7 @@ var stdev = require( '@stdlib/stats/base/dists/logistic/stdev' ); Returns the [standard deviation][standard-deviation] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns ~1.814 y = stdev( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -83,7 +83,7 @@ y = stdev( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/logistic/stdev' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = stdev( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/logistic/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = stdev( mu, s ); console.log( 'µ: %d, s: %d, SD(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/logistic/variance/README.md index 38d5ded7fae6..3d4e4b93da6c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [logistic][logistic-distribution] random variable ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/logistic/variance' ); +const variance = require( '@stdlib/stats/base/dists/logistic/variance' ); ``` #### variance( mu, s ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/logistic/variance' ); Returns the [variance][variance] for a [logistic][logistic-distribution] distribution with location parameter `mu` and scale parameter `s`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns ~3.29 y = variance( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -83,7 +83,7 @@ y = variance( 0.0, NaN ); If provided `s <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/logistic/variance' ); - -var mu; -var s; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - s = randu() * 20.0; - y = variance( mu, s ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/logistic/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const s = randu() * 20.0; + const y = variance( mu, s ); console.log( 'µ: %d, s: %d, Var(X;µ,s): %d', mu.toFixed( 4 ), s.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/README.md index 666139c87a59..abb896e0f087 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lognormal = require( '@stdlib/stats/base/dists/lognormal' ); +const lognormal = require( '@stdlib/stats/base/dists/lognormal' ); ``` #### lognormal @@ -35,7 +35,7 @@ var lognormal = require( '@stdlib/stats/base/dists/lognormal' ); Lognormal distribution. ```javascript -var dist = lognormal; +const dist = lognormal; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [lognormal][lognorm ```javascript -var LogNormal = require( '@stdlib/stats/base/dists/lognormal' ).LogNormal; +const LogNormal = require( '@stdlib/stats/base/dists/lognormal' ).LogNormal; -var dist = new LogNormal( 2.0, 4.0 ); +const dist = new LogNormal( 2.0, 4.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.25 ``` @@ -108,8 +108,8 @@ var y = dist.cdf( 0.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var lognormal = require( '@stdlib/stats/base/dists/lognormal' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const lognormal = require( '@stdlib/stats/base/dists/lognormal' ); console.log( objectKeys( lognormal ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/cdf/README.md index d3364f5e128a..35d38883d1c9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/cdf/README.md @@ -51,7 +51,7 @@ where `mu` is the location parameter and `sigma > 0` is the scale parameter. Acc ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/lognormal/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/lognormal/cdf' ); ``` #### cdf( x, mu, sigma ) @@ -59,7 +59,7 @@ var cdf = require( '@stdlib/stats/base/dists/lognormal/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var y = cdf( 2.0, 0.0, 1.0 ); +let y = cdf( 2.0, 0.0, 1.0 ); // returns ~0.756 y = cdf( 5.0, 10.0, 3.0 ); @@ -69,7 +69,7 @@ y = cdf( 5.0, 10.0, 3.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -82,7 +82,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +let y = cdf( 2.0, 0.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0, 0.0 ); @@ -94,9 +94,9 @@ y = cdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var mycdf = cdf.factory( 3.0, 1.5 ); +const mycdf = cdf.factory( 3.0, 1.5 ); -var y = mycdf( 1.0 ); +let y = mycdf( 1.0 ); // returns ~0.023 y = mycdf( 4.0 ); @@ -114,20 +114,14 @@ y = mycdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/lognormal/cdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = cdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/lognormal/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = cdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, F(x;µ,σ): %d', x.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/ctor/README.md index 6e21253d57bc..ea538e560f64 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var LogNormal = require( '@stdlib/stats/base/dists/lognormal/ctor' ); +const LogNormal = require( '@stdlib/stats/base/dists/lognormal/ctor' ); ``` #### LogNormal( \[mu, sigma] ) @@ -45,18 +45,18 @@ var LogNormal = require( '@stdlib/stats/base/dists/lognormal/ctor' ); Returns a [lognormal][lognormal-distribution] distribution object. ```javascript -var lognormal = new LogNormal(); +const lognormal = new LogNormal(); -var mean = lognormal.mean; +const mean = lognormal.mean; // returns ~1.649 ``` By default, `mu = 0.0` and `sigma = 1.0`. To create a distribution having a different `mu` (location parameter) and `sigma` (scale parameter), provide the corresponding arguments. ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var mu = lognormal.mean; +const mu = lognormal.mean; // returns ~22026.466 ``` @@ -73,9 +73,9 @@ A [lognormal][lognormal-distribution] distribution object has the following prop Location parameter of the distribution. ```javascript -var lognormal = new LogNormal(); +const lognormal = new LogNormal(); -var mu = lognormal.mu; +let mu = lognormal.mu; // returns 0.0 lognormal.mu = 3.0; @@ -89,9 +89,9 @@ mu = lognormal.mu; Scale parameter of the distribution. `sigma` **must** be a positive number. ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var sigma = lognormal.sigma; +let sigma = lognormal.sigma; // returns 4.0 lognormal.sigma = 3.0; @@ -109,9 +109,9 @@ sigma = lognormal.sigma; Returns the [differential entropy][entropy]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var entropy = lognormal.entropy; +const entropy = lognormal.entropy; // returns ~7.904 ``` @@ -120,9 +120,9 @@ var entropy = lognormal.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var kurtosis = lognormal.kurtosis; +const kurtosis = lognormal.kurtosis; // returns 1.4243659274306933e+250 ``` @@ -131,9 +131,9 @@ var kurtosis = lognormal.kurtosis; Returns the [expected value][expected-value]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var mu = lognormal.mean; +const mu = lognormal.mean; // returns 1.0148003881138887e+33 ``` @@ -142,9 +142,9 @@ var mu = lognormal.mean; Returns the [median][median]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var median = lognormal.median; +const median = lognormal.median; // returns ~54.598 ``` @@ -153,9 +153,9 @@ var median = lognormal.median; Returns the [mode][mode]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var mode = lognormal.mode; +const mode = lognormal.mode; // returns 1.580420060273613e-61 ``` @@ -164,9 +164,9 @@ var mode = lognormal.mode; Returns the [skewness][skewness]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var skewness = lognormal.skewness; +const skewness = lognormal.skewness; // returns 6.421080152185613e+93 ``` @@ -175,9 +175,9 @@ var skewness = lognormal.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var s = lognormal.stdev; +const s = lognormal.stdev; // returns 1.886180808490652e+64 ``` @@ -186,9 +186,9 @@ var s = lognormal.stdev; Returns the [variance][variance]. ```javascript -var lognormal = new LogNormal( 4.0, 12.0 ); +const lognormal = new LogNormal( 4.0, 12.0 ); -var s2 = lognormal.variance; +const s2 = lognormal.variance; // returns 3.55767804231845e+128 ``` @@ -201,9 +201,9 @@ var s2 = lognormal.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var y = lognormal.cdf( 0.5 ); +const y = lognormal.cdf( 0.5 ); // returns ~0.25 ``` @@ -212,9 +212,9 @@ var y = lognormal.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var lognormal = new LogNormal( 0.0, 1.0 ); +const lognormal = new LogNormal( 0.0, 1.0 ); -var y = lognormal.logcdf( 2.0 ); +const y = lognormal.logcdf( 2.0 ); // returns ~-0.2799 ``` @@ -223,9 +223,9 @@ var y = lognormal.logcdf( 2.0 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var y = lognormal.logpdf( 2.0 ); +const y = lognormal.logpdf( 2.0 ); // returns ~-3.052 ``` @@ -234,9 +234,9 @@ var y = lognormal.logpdf( 2.0 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var y = lognormal.pdf( 2.0 ); +const y = lognormal.pdf( 2.0 ); // returns ~0.047 ``` @@ -245,9 +245,9 @@ var y = lognormal.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var lognormal = new LogNormal( 2.0, 4.0 ); +const lognormal = new LogNormal( 2.0, 4.0 ); -var y = lognormal.quantile( 0.5 ); +let y = lognormal.quantile( 0.5 ); // returns ~7.389 y = lognormal.quantile( 1.9 ); @@ -277,20 +277,20 @@ y = lognormal.quantile( 1.9 ); ```javascript -var LogNormal = require( '@stdlib/stats/base/dists/lognormal/ctor' ); +const LogNormal = require( '@stdlib/stats/base/dists/lognormal/ctor' ); -var lognormal = new LogNormal( 2.0, 1.0 ); +const lognormal = new LogNormal( 2.0, 1.0 ); -var mean = lognormal.mean; +const mean = lognormal.mean; // returns ~12.182 -var median = lognormal.median; +const median = lognormal.median; // returns ~7.389 -var s2 = lognormal.variance; +const s2 = lognormal.variance; // returns ~255.016 -var y = lognormal.cdf( 0.8 ); +const y = lognormal.cdf( 0.8 ); // returns ~0.013 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/entropy/README.md index 5f47210b7f5e..91a8e38cc4b9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/entropy/README.md @@ -55,7 +55,7 @@ where `μ` is the location parameter and `σ > 0` is the scale parameter. Accord ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/lognormal/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/lognormal/entropy' ); ``` #### entropy( mu, sigma ) @@ -63,7 +63,7 @@ var entropy = require( '@stdlib/stats/base/dists/lognormal/entropy' ); Returns the [differential entropy][entropy] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns ~3.419 y = entropy( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = entropy( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -86,7 +86,7 @@ y = entropy( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/lognormal/entropy' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = entropy( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/lognormal/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = entropy( mu, sigma ); console.log( 'µ: %d, σ: %d, h(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/kurtosis/README.md index 7f7e479afd0b..d5e8ce5aa6d1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/kurtosis/README.md @@ -55,7 +55,7 @@ According to the definition, the _natural logarithm_ of a random variable from a ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/lognormal/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/lognormal/kurtosis' ); ``` #### kurtosis( mu, sigma ) @@ -63,7 +63,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/lognormal/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns ~110.936 y = kurtosis( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -86,7 +86,7 @@ y = kurtosis( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/lognormal/kurtosis' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = kurtosis( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/lognormal/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = kurtosis( mu, sigma ); console.log( 'µ: %d, σ: %d, Kurt(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md index 15178fbfeda8..ff3b540a66a3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/lognormal/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/lognormal/logcdf' ); ``` #### logcdf( x, mu, sigma ) @@ -41,7 +41,7 @@ var logcdf = require( '@stdlib/stats/base/dists/lognormal/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [lognormal][lognormal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = logcdf( 2.0, 0.0, 1.0 ); +let y = logcdf( 2.0, 0.0, 1.0 ); // returns ~-0.2799 y = logcdf( 13.0, 4.0, 2.0 ); @@ -51,7 +51,7 @@ y = logcdf( 13.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -64,14 +64,14 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +const y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the natural logarithm of the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logcdf( 2.0, 8.0, 0.0 ); +let y = logcdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logcdf( 8.0, 8.0, 0.0 ); @@ -86,9 +86,9 @@ y = logcdf( 10.0, 8.0, 0.0 ); Returns a `function` for evaluating the [cumulative distribution function][cdf] (CDF) of a [lognormal][lognormal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-9.732 y = mylogcdf( 5.0 ); @@ -106,20 +106,14 @@ y = mylogcdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/lognormal/logcdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = logcdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/lognormal/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = logcdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, ln(F(x;µ,σ)): %d', x, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logpdf/README.md index c99e737b669c..2b8e0a98a6b2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logpdf/README.md @@ -51,7 +51,7 @@ where `mu` is the location parameter and `sigma > 0` is the scale parameter. Acc ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/lognormal/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/lognormal/logpdf' ); ``` #### logpdf( x, mu, sigma ) @@ -59,7 +59,7 @@ var logpdf = require( '@stdlib/stats/base/dists/lognormal/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns ~-1.852 y = logpdf( 1.0, 0.0, 1.0 ); @@ -72,7 +72,7 @@ y = logpdf( 1.0, 3.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -85,7 +85,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +let y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN y = logpdf( 2.0, 0.0, 0.0 ); @@ -97,8 +97,8 @@ y = logpdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the natural logarithm of the [probability density function][pdf] (PDF) of a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 4.0, 2.0 ); -var y = mylogpdf( 10.0 ); +const mylogpdf = logpdf.factory( 4.0, 2.0 ); +let y = mylogpdf( 10.0 ); // returns ~-4.275 y = mylogpdf( 2.0 ); @@ -116,20 +116,14 @@ y = mylogpdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/lognormal/logpdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = logpdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/lognormal/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = logpdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, ln(f(x;µ,σ)): %d', x.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/mean/README.md index 43accf96dbe6..c46ef084ef7e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/mean/README.md @@ -55,7 +55,7 @@ where `μ` is the location parameter and `σ > 0` is the scale parameter. Accord ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/lognormal/mean' ); +const mean = require( '@stdlib/stats/base/dists/lognormal/mean' ); ``` #### mean( mu, sigma ) @@ -63,7 +63,7 @@ var mean = require( '@stdlib/stats/base/dists/lognormal/mean' ); Returns the [expected value][mean] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns ~12.182 y = mean( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -86,7 +86,7 @@ y = mean( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/lognormal/mean' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = mean( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/lognormal/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = mean( mu, sigma ); console.log( 'µ: %d, σ: %d, E(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/median/README.md index 7387249851bb..394ab6db4b5f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/median/README.md @@ -55,7 +55,7 @@ According to the definition, the _natural logarithm_ of a random variable from a ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/lognormal/median' ); +const median = require( '@stdlib/stats/base/dists/lognormal/median' ); ``` #### median( mu, sigma ) @@ -63,7 +63,7 @@ var median = require( '@stdlib/stats/base/dists/lognormal/median' ); Returns the [median][median] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns ~7.389 y = median( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -86,7 +86,7 @@ y = median( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/lognormal/median' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = median( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/lognormal/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = median( mu, sigma ); console.log( 'µ: %d, σ: %d, Median(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/mode/README.md index a01b95c3d74b..bced7324cb81 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/mode/README.md @@ -55,7 +55,7 @@ where `μ` is the location parameter and `σ > 0` is the scale parameter. Accord ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/lognormal/mode' ); +const mode = require( '@stdlib/stats/base/dists/lognormal/mode' ); ``` #### mode( mu, sigma ) @@ -63,7 +63,7 @@ var mode = require( '@stdlib/stats/base/dists/lognormal/mode' ); Returns the [mode][mode] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns ~2.718 y = mode( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -86,7 +86,7 @@ y = mode( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/lognormal/mode' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = mode( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/lognormal/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = mode( mu, sigma ); console.log( 'µ: %d, σ: %d, mode(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/README.md index f701be2d345d..b1e98d5fffb1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/README.md @@ -51,7 +51,7 @@ where `mu` is the location parameter and `sigma > 0` is the scale parameter. Acc ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/lognormal/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/lognormal/pdf' ); ``` #### pdf( x, mu, sigma ) @@ -59,7 +59,7 @@ var pdf = require( '@stdlib/stats/base/dists/lognormal/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns ~0.157 y = pdf( 1.0, 0.0, 1.0 ); @@ -72,7 +72,7 @@ y = pdf( 1.0, 3.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -85,7 +85,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +let y = pdf( 2.0, 0.0, -1.0 ); // returns NaN y = pdf( 2.0, 0.0, 0.0 ); @@ -97,8 +97,8 @@ y = pdf( 2.0, 0.0, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var mypdf = pdf.factory( 4.0, 2.0 ); -var y = mypdf( 10.0 ); +const mypdf = pdf.factory( 4.0, 2.0 ); +let y = mypdf( 10.0 ); // returns ~0.014 y = mypdf( 2.0 ); @@ -116,20 +116,14 @@ y = mypdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/lognormal/pdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = pdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/lognormal/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = pdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, f(x;µ,σ): %d', x.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/quantile/README.md index 0f6598f9c023..f92ab3bbc915 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `mu` is the location parameter and `sigma > 0` is the sc ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/lognormal/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/lognormal/quantile' ); ``` #### quantile( p, mu, sigma ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/lognormal/quantile' ); Evaluates the [quantile function][quantile-function] for a [lognormal][lognormal-distribution] distribution with parameters `mu` (location parameter) and `sigma` (scale parameter). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns 1.0 y = quantile( 0.5, 4.0, 1.0 ); @@ -74,7 +74,7 @@ y = quantile( 0.8, 4.0, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -84,7 +84,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -97,7 +97,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +let y = quantile( 0.4, 0.0, -1.0 ); // returns NaN y = quantile( 0.4, 0.0, 0.0 ); @@ -109,9 +109,9 @@ y = quantile( 0.4, 0.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [lognormal][lognormal-distribution] distribution with parameters `mu` and `sigma`. ```javascript -var myquantile = quantile.factory( 4.0, 2.0 ); +const myquantile = quantile.factory( 4.0, 2.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~10.143 y = myquantile( 0.8 ); @@ -129,20 +129,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/lognormal/quantile' ); - -var sigma; -var mu; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = quantile( p, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/lognormal/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = quantile( p, mu, sigma ); console.log( 'p: %d, µ: %d, σ: %d, Q(p;µ,σ): %d', p.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/skewness/README.md index 45209b63b95a..b1caa773035f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/skewness/README.md @@ -55,7 +55,7 @@ According to the definition, the _natural logarithm_ of a random variable from a ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/lognormal/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/lognormal/skewness' ); ``` #### skewness( mu, sigma ) @@ -63,7 +63,7 @@ var skewness = require( '@stdlib/stats/base/dists/lognormal/skewness' ); Returns the [skewness][skewness] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns ~6.185 y = skewness( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = skewness( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -86,7 +86,7 @@ y = skewness( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/lognormal/skewness' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = skewness( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/lognormal/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = skewness( mu, sigma ); console.log( 'µ: %d, σ: %d, skew(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/stdev/README.md index b3483b74fa97..7f84d1a8c904 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/stdev/README.md @@ -55,7 +55,7 @@ where `μ` is the location parameter and `σ > 0` is the scale parameter. Accord ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/lognormal/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/lognormal/stdev' ); ``` #### stdev( mu, sigma ) @@ -63,7 +63,7 @@ var stdev = require( '@stdlib/stats/base/dists/lognormal/stdev' ); Returns the [standard deviation][standard-deviation] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns ~15.969 y = stdev( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = stdev( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -86,7 +86,7 @@ y = stdev( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/lognormal/stdev' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = stdev( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/lognormal/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = stdev( mu, sigma ); console.log( 'µ: %d, σ: %d, SD(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/variance/README.md index 347dd9a4cb56..306c8808f323 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/variance/README.md @@ -55,7 +55,7 @@ where `μ` is the location parameter and `σ > 0` is the scale parameter. Accord ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/lognormal/variance' ); +const variance = require( '@stdlib/stats/base/dists/lognormal/variance' ); ``` #### variance( mu, sigma ) @@ -63,7 +63,7 @@ var variance = require( '@stdlib/stats/base/dists/lognormal/variance' ); Returns the [variance][variance] for a [lognormal][lognormal-distribution] distribution with location `mu` and scale `sigma`. ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns ~255.016 y = variance( 0.0, 1.0 ); @@ -76,7 +76,7 @@ y = variance( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -86,7 +86,7 @@ y = variance( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -114,18 +114,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/lognormal/variance' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = variance( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/lognormal/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = variance( mu, sigma ); console.log( 'µ: %d, σ: %d, Var(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/README.md index cb6a3b486c3f..b72819dffba9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); +const negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); ``` #### negativeBinomial @@ -35,7 +35,7 @@ var negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); Negative binomial distribution. ```javascript -var dist = negativeBinomial; +const dist = negativeBinomial; // returns {...} ``` @@ -85,11 +85,11 @@ The namespace contains a constructor function for creating a [negative binomial] ```javascript -var NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ).NegativeBinomial; +const NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ).NegativeBinomial; -var dist = new NegativeBinomial( 4.0, 0.2 ); +const dist = new NegativeBinomial( 4.0, 0.2 ); -var y = dist.pmf( 4.0 ); +const y = dist.pmf( 4.0 ); // returns ~0.023 ``` @@ -106,15 +106,15 @@ var y = dist.pmf( 4.0 ); ```javascript -var negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); +const negativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial' ); /* * Let's take an example of flipping a biased coin until getting 5 heads. * This situation can be modeled using a Negative Binomial distribution with r = 5 and p = 1/2. */ -var r = 5.0; -var p = 1/2; +const r = 5.0; +const p = 1/2; // Mean can be used to calculate the average number of trials needed to get 5 heads: console.log( negativeBinomial.mean( r, p ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/cdf/README.md index 503a0c8aa8ca..22d607c172e0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/cdf/README.md @@ -50,7 +50,7 @@ where `r` is the number of successes until experiment is stopped, `p` is the suc ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/negative-binomial/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/negative-binomial/cdf' ); ``` #### cdf( x, r, p ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/negative-binomial/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var y = cdf( 5.0, 20.0, 0.8 ); +let y = cdf( 5.0, 20.0, 0.8 ); // returns ~0.617 y = cdf( 21.0, 20.0, 0.5 ); @@ -74,7 +74,7 @@ y = cdf( 0.0, 10.0, 0.9 ); While `r` can be interpreted as the number of successes until the experiment is stopped, the [negative binomial][negative-binomial-distribution] distribution is also defined for non-integers `r`. In this case, `r` denotes shape parameter of the [gamma mixing distribution][negative-binomial-mixture-representation]. ```javascript -var y = cdf( 21.0, 15.5, 0.5 ); +let y = cdf( 21.0, 15.5, 0.5 ); // returns ~0.859 y = cdf( 5.0, 7.4, 0.4 ); @@ -84,7 +84,7 @@ y = cdf( 5.0, 7.4, 0.4 ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, 0.5 ); +let y = cdf( 2.0, 0.0, 0.5 ); // returns NaN y = cdf( 2.0, -2.0, 0.5 ); @@ -94,7 +94,7 @@ y = cdf( 2.0, -2.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 20.0, 0.5 ); +let y = cdf( NaN, 20.0, 0.5 ); // returns NaN y = cdf( 0.0, NaN, 0.5 ); @@ -107,7 +107,7 @@ y = cdf( 0.0, 20.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 20, -1.0 ); +let y = cdf( 2.0, 20, -1.0 ); // returns NaN y = cdf( 2.0, 20, 1.5 ); @@ -119,8 +119,8 @@ y = cdf( 2.0, 20, 1.5 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var mycdf = cdf.factory( 10, 0.5 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 10, 0.5 ); +let y = mycdf( 3.0 ); // returns ~0.046 y = mycdf( 11.0 ); @@ -138,20 +138,14 @@ y = mycdf( 11.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/negative-binomial/cdf' ); - -var i; -var r; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 50; - r = randu() * 50; - p = randu(); - y = cdf( x, r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/negative-binomial/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 50; + const r = randu() * 50; + const p = randu(); + const y = cdf( x, r, p ); console.log( 'x: %d, r: %d, p: %d, F(x;r,p): %d', x.toFixed( 4 ), r.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/ctor/README.md index 39cceeb992d3..49934a8c5bae 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial/ctor' ); +const NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial/ctor' ); ``` #### NegativeBinomial( \[r, p] ) @@ -45,18 +45,18 @@ var NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial/ctor Returns a [negative binomial][negative-binomial-distribution] distribution object. ```javascript -var nbinomial = new NegativeBinomial(); +const nbinomial = new NegativeBinomial(); -var mu = nbinomial.mean; +const mu = nbinomial.mean; // returns 1.0 ``` By default, `r = 1.0` and `p = 0.5`. To create a distribution having a different `r` (number of trials until experiment is stopped) and `p` (success probability), provide the corresponding arguments. ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var mu = nbinomial.mean; +const mu = nbinomial.mean; // returns 16.0 ``` @@ -73,9 +73,9 @@ A [negative binomial][negative-binomial-distribution] distribution object has th Number of trials of the distribution. `r` **must** be a positive number. ```javascript -var nbinomial = new NegativeBinomial(); +const nbinomial = new NegativeBinomial(); -var r = nbinomial.r; +let r = nbinomial.r; // returns 1.0 nbinomial.r = 4.5; @@ -89,9 +89,9 @@ r = nbinomial.r; Success probability of the distribution. `p` **must** be a number between 0 and 1. ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var p = nbinomial.p; +let p = nbinomial.p; // returns 0.2 nbinomial.p = 0.7; @@ -109,9 +109,9 @@ p = nbinomial.p; Returns the [excess kurtosis][kurtosis]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var kurtosis = nbinomial.kurtosis; +const kurtosis = nbinomial.kurtosis; // returns ~0.522 ``` @@ -120,9 +120,9 @@ var kurtosis = nbinomial.kurtosis; Returns the [expected value][expected-value]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var mu = nbinomial.mean; +const mu = nbinomial.mean; // returns ~18.0 ``` @@ -131,9 +131,9 @@ var mu = nbinomial.mean; Returns the [mode][mode]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var mode = nbinomial.mode; +const mode = nbinomial.mode; // returns 16.0 ``` @@ -142,9 +142,9 @@ var mode = nbinomial.mode; Returns the [skewness][skewness]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var skewness = nbinomial.skewness; +const skewness = nbinomial.skewness; // returns ~0.596 ``` @@ -153,9 +153,9 @@ var skewness = nbinomial.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var s = nbinomial.stdev; +const s = nbinomial.stdev; // returns ~6.708 ``` @@ -164,9 +164,9 @@ var s = nbinomial.stdev; Returns the [variance][variance]. ```javascript -var nbinomial = new NegativeBinomial( 12.0, 0.4 ); +const nbinomial = new NegativeBinomial( 12.0, 0.4 ); -var s2 = nbinomial.variance; +const s2 = nbinomial.variance; // returns ~45.0 ``` @@ -179,9 +179,9 @@ var s2 = nbinomial.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var y = nbinomial.cdf( 3.5 ); +const y = nbinomial.cdf( 3.5 ); // returns ~0.033 ``` @@ -190,9 +190,9 @@ var y = nbinomial.cdf( 3.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF). ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var y = nbinomial.logpmf( 4.0 ); +const y = nbinomial.logpmf( 4.0 ); // returns ~-3.775 ``` @@ -201,9 +201,9 @@ var y = nbinomial.logpmf( 4.0 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var y = nbinomial.mgf( 0.1 ); +const y = nbinomial.mgf( 0.1 ); // returns ~1.66 ``` @@ -212,9 +212,9 @@ var y = nbinomial.mgf( 0.1 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var y = nbinomial.pmf( 4.0 ); +const y = nbinomial.pmf( 4.0 ); // returns ~0.023 ``` @@ -223,9 +223,9 @@ var y = nbinomial.pmf( 4.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var nbinomial = new NegativeBinomial( 4.0, 0.2 ); +const nbinomial = new NegativeBinomial( 4.0, 0.2 ); -var y = nbinomial.quantile( 0.5 ); +let y = nbinomial.quantile( 0.5 ); // returns 15.0 y = nbinomial.quantile( 1.9 ); @@ -255,20 +255,20 @@ y = nbinomial.quantile( 1.9 ); ```javascript -var NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial/ctor' ); +const NegativeBinomial = require( '@stdlib/stats/base/dists/negative-binomial/ctor' ); -var nbinomial = new NegativeBinomial( 10.0, 0.4 ); +const nbinomial = new NegativeBinomial( 10.0, 0.4 ); -var mu = nbinomial.mean; +const mu = nbinomial.mean; // returns 15.0 -var mode = nbinomial.mode; +const mode = nbinomial.mode; // returns 13.0 -var s2 = nbinomial.variance; +const s2 = nbinomial.variance; // returns ~37.5 -var y = nbinomial.cdf( 8.0 ); +const y = nbinomial.cdf( 8.0 ); // returns ~0.135 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/kurtosis/README.md index 7cc0483a4b45..71d07febb7a2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/kurtosis/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/negative-binomial/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/negative-binomial/kurtosis' ); ``` #### kurtosis( r, p ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/negative-binomial/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = kurtosis( 100, 0.2 ); +let v = kurtosis( 100, 0.2 ); // returns ~0.061 v = kurtosis( 50, 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 0.5 ); +let v = kurtosis( NaN, 0.5 ); // returns NaN v = kurtosis( 20, NaN ); @@ -82,14 +82,14 @@ v = kurtosis( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = kurtosis( -2.0, 0.5 ); +const v = kurtosis( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = kurtosis( 20, -1.0 ); +let v = kurtosis( 20, -1.0 ); // returns NaN v = kurtosis( 20, 1.5 ); @@ -117,18 +117,13 @@ v = kurtosis( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/negative-binomial/kurtosis' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = kurtosis( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/negative-binomial/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = kurtosis( r, p ); console.log( 'r: %d, p: %d, Kurt(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/logpmf/README.md index 45127d43e58f..83148263ed35 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/logpmf/README.md @@ -50,7 +50,7 @@ where `r > 0` is the number of successes until experiment is stopped and `0 < p ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/negative-binomial/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/negative-binomial/logpmf' ); ``` #### logpmf( x, r, p ) @@ -58,7 +58,7 @@ var logpmf = require( '@stdlib/stats/base/dists/negative-binomial/logpmf' ); Evaluates the natural logarithm of the [probability mass function][pmf] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var y = logpmf( 5.0, 20.0, 0.8 ); +let y = logpmf( 5.0, 20.0, 0.8 ); // returns ~-1.853 y = logpmf( 21.0, 20.0, 0.5 ); @@ -74,7 +74,7 @@ y = logpmf( 0.0, 10.0, 0.9 ); While `r` can be interpreted as the number of successes until the experiment is stopped, the [negative binomial][negative-binomial-distribution] distribution is also defined for non-integers `r`. In this case, `r` denotes shape parameter of the [gamma mixing distribution][negative-binomial-mixture-representation]. ```javascript -var y = logpmf( 21.0, 15.5, 0.5 ); +let y = logpmf( 21.0, 15.5, 0.5 ); // returns ~-3.292 y = logpmf( 5.0, 7.4, 0.4 ); @@ -84,7 +84,7 @@ y = logpmf( 5.0, 7.4, 0.4 ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 0.0, 0.5 ); +let y = logpmf( 2.0, 0.0, 0.5 ); // returns NaN y = logpmf( 2.0, -2.0, 0.5 ); @@ -94,7 +94,7 @@ y = logpmf( 2.0, -2.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, 20.0, 0.5 ); +let y = logpmf( NaN, 20.0, 0.5 ); // returns NaN y = logpmf( 0.0, NaN, 0.5 ); @@ -107,7 +107,7 @@ y = logpmf( 0.0, 20.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, 20, -1.0 ); +let y = logpmf( 2.0, 20, -1.0 ); // returns NaN y = logpmf( 2.0, 20, 1.5 ); @@ -119,8 +119,8 @@ y = logpmf( 2.0, 20, 1.5 ); Returns a function for evaluating the natural logarithm of the [probability mass function][pmf] (PMF) of a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var mylogpmf = logpmf.factory( 10, 0.5 ); -var y = mylogpmf( 3.0 ); +const mylogpmf = logpmf.factory( 10, 0.5 ); +let y = mylogpmf( 3.0 ); // returns ~-3.617 y = mylogpmf( 10.0 ); @@ -138,21 +138,15 @@ y = mylogpmf( 10.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/negative-binomial/logpmf' ); - -var i; -var r; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 30.0 ); - r = randu() * 50.0; - p = randu(); - y = logpmf( x, r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/negative-binomial/logpmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 30.0 ); + const r = randu() * 50.0; + const p = randu(); + const y = logpmf( x, r, p ); console.log( 'x: %d, r: %d, p: %d, ln(P(X=x;r,p)): %d', x, r, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/README.md index 3e0690dc7744..a8d39cea89f5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/negative-binomial/mean' ); +const mean = require( '@stdlib/stats/base/dists/negative-binomial/mean' ); ``` #### mean( r, p ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/negative-binomial/mean' ); Returns the [expected value][expected-value] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = mean( 100, 0.2 ); +let v = mean( 100, 0.2 ); // returns 400 v = mean( 50, 0.5 ); @@ -72,7 +72,7 @@ v = mean( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 0.5 ); +let v = mean( NaN, 0.5 ); // returns NaN v = mean( 20, NaN ); @@ -82,14 +82,14 @@ v = mean( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = mean( -2.0, 0.5 ); +const v = mean( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mean( 20, -1.0 ); +let v = mean( 20, -1.0 ); // returns NaN v = mean( 20, 1.5 ); @@ -117,18 +117,13 @@ v = mean( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/negative-binomial/mean' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = mean( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/negative-binomial/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = mean( r, p ); console.log( 'r: %d, p: %d, E(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mgf/README.md index 3c51012ef75e..e095260193c8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mgf/README.md @@ -54,7 +54,7 @@ where `r > 0` is the number of failures until the experiment is stopped and `0 < ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/negative-binomial/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/negative-binomial/mgf' ); ``` #### mgf( t, r, p ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/negative-binomial/mgf' ); Evaluates the [moment-generating function][mgf] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var y = mgf( 0.05, 20.0, 0.8 ); +let y = mgf( 0.05, 20.0, 0.8 ); // returns ~267.839 y = mgf( 0.1, 20.0, 0.1 ); @@ -72,7 +72,7 @@ y = mgf( 0.1, 20.0, 0.1 ); While `r` can be interpreted as the number of successes until the experiment is stopped, the [negative binomial][negative-binomial-distribution] distribution is also defined for non-integers `r`. In this case, `r` denotes shape parameter of the [gamma mixing distribution][negative-binomial-mixture-representation]. ```javascript -var y = mgf( 0.1, 15.5, 0.5 ); +let y = mgf( 0.1, 15.5, 0.5 ); // returns ~26.375 y = mgf( 0.5, 7.4, 0.4 ); @@ -82,14 +82,14 @@ y = mgf( 0.5, 7.4, 0.4 ); If `t >= -ln( p )`, the function returns `NaN`. ```javascript -var y = mgf( 0.7, 15.5, 0.5 ); // -ln( p ) = ~0.693 +const y = mgf( 0.7, 15.5, 0.5 ); // -ln( p ) = ~0.693 // returns NaN ``` If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 0.0, 0.5 ); +let y = mgf( 0.2, 0.0, 0.5 ); // returns NaN y = mgf( 0.2, -2.0, 0.5 ); @@ -99,7 +99,7 @@ y = mgf( 0.2, -2.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 20.0, 0.5 ); +let y = mgf( NaN, 20.0, 0.5 ); // returns NaN y = mgf( 0.0, NaN, 0.5 ); @@ -112,7 +112,7 @@ y = mgf( 0.0, 20.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 20, -1.0 ); +let y = mgf( 0.2, 20, -1.0 ); // returns NaN y = mgf( 0.2, 20, 1.5 ); @@ -124,8 +124,8 @@ y = mgf( 0.2, 20, 1.5 ); Returns a function for evaluating the [moment-generating function][mgf] of a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var myMGF = mgf.factory( 4.3, 0.4 ); -var y = myMGF( 0.2 ); +const myMGF = mgf.factory( 4.3, 0.4 ); +let y = myMGF( 0.2 ); // returns ~4.696 y = myMGF( 0.4 ); @@ -153,21 +153,15 @@ y = myMGF( 0.4 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mgf = require( '@stdlib/stats/base/dists/negative-binomial/mgf' ); - -var p; -var r; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = (randu() * 1.0) - 0.5; - r = randu() * 50; - p = randu(); - y = mgf( t, r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mgf = require( '@stdlib/stats/base/dists/negative-binomial/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = (randu() * 1.0) - 0.5; + const r = randu() * 50; + const p = randu(); + const y = mgf( t, r, p ); console.log( 't: %d, r: %d, p: %d, M_X(t;r,p): %d', t, r.toFixed( 4 ), p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mode/README.md index 64cdf6363a30..3f7c1f75b046 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mode/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/negative-binomial/mode' ); +const mode = require( '@stdlib/stats/base/dists/negative-binomial/mode' ); ``` #### mode( r, p ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/negative-binomial/mode' ); Returns the [mode][mode] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = mode( 100, 0.2 ); +let v = mode( 100, 0.2 ); // returns 396 v = mode( 50, 0.5 ); @@ -72,7 +72,7 @@ v = mode( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 0.5 ); +let v = mode( NaN, 0.5 ); // returns NaN v = mode( 20, NaN ); @@ -82,14 +82,14 @@ v = mode( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = mode( -2.0, 0.5 ); +const v = mode( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = mode( 20, -1.0 ); +let v = mode( 20, -1.0 ); // returns NaN v = mode( 20, 1.5 ); @@ -117,18 +117,13 @@ v = mode( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/negative-binomial/mode' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = mode( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/negative-binomial/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = mode( r, p ); console.log( 'r: %d, p: %d, mode(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/pmf/README.md index ab5f10daeeca..ab4c16f3f9ae 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/pmf/README.md @@ -50,7 +50,7 @@ where `r > 0` is the number of successes until experiment is stopped and `0 < p ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/negative-binomial/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/negative-binomial/pmf' ); ``` #### pmf( x, r, p ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/negative-binomial/pmf' ); Evaluates the [probability mass function][pmf] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var y = pmf( 5.0, 20.0, 0.8 ); +let y = pmf( 5.0, 20.0, 0.8 ); // returns ~0.157 y = pmf( 21.0, 20.0, 0.5 ); @@ -74,7 +74,7 @@ y = pmf( 0.0, 10.0, 0.9 ); While `r` can be interpreted as the number of successes until the experiment is stopped, the [negative binomial][negative-binomial-distribution] distribution is also defined for non-integers `r`. In this case, `r` denotes shape parameter of the [gamma mixing distribution][negative-binomial-mixture-representation]. ```javascript -var y = pmf( 21.0, 15.5, 0.5 ); +let y = pmf( 21.0, 15.5, 0.5 ); // returns ~0.037 y = pmf( 5.0, 7.4, 0.4 ); @@ -84,7 +84,7 @@ y = pmf( 5.0, 7.4, 0.4 ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 0.0, 0.5 ); +let y = pmf( 2.0, 0.0, 0.5 ); // returns NaN y = pmf( 2.0, -2.0, 0.5 ); @@ -94,7 +94,7 @@ y = pmf( 2.0, -2.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 20.0, 0.5 ); +let y = pmf( NaN, 20.0, 0.5 ); // returns NaN y = pmf( 0.0, NaN, 0.5 ); @@ -107,7 +107,7 @@ y = pmf( 0.0, 20.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, 20, -1.0 ); +let y = pmf( 2.0, 20, -1.0 ); // returns NaN y = pmf( 2.0, 20, 1.5 ); @@ -119,8 +119,8 @@ y = pmf( 2.0, 20, 1.5 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var mypmf = pmf.factory( 10, 0.5 ); -var y = mypmf( 3.0 ); +const mypmf = pmf.factory( 10, 0.5 ); +let y = mypmf( 3.0 ); // returns ~0.03 y = mypmf( 10.0 ); @@ -138,21 +138,15 @@ y = mypmf( 10.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/negative-binomial/pmf' ); - -var i; -var r; -var p; -var x; -var y; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 30 ); - r = randu() * 50; - p = randu(); - y = pmf( x, r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/negative-binomial/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 30 ); + const r = randu() * 50; + const p = randu(); + const y = pmf( x, r, p ); console.log( 'x: %d, r: %d, p: %d, P(X=x;r,p): %d', x, r, p.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/quantile/README.md index 500bf72b190a..a5993e7fde6b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/quantile/README.md @@ -50,7 +50,7 @@ holds, where `F` is the cumulative distribution function (CDF) of a negative bin ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/negative-binomial/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/negative-binomial/quantile' ); ``` #### quantile( k, r, p ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/negative-binomial/quantile' ); Evaluates the [quantile function][quantile-function] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var y = quantile( 0.9, 20.0, 0.2 ); +let y = quantile( 0.9, 20.0, 0.2 ); // returns 106 y = quantile( 0.9, 20.0, 0.8 ); @@ -74,7 +74,7 @@ y = quantile( 0.0, 10.0, 0.9 ); If provided an input value `k` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.1, 20.0, 0.5 ); +let y = quantile( 1.1, 20.0, 0.5 ); // returns NaN y = quantile( -0.1, 20.0, 0.5 ); @@ -84,7 +84,7 @@ y = quantile( -0.1, 20.0, 0.5 ); While `r` can be interpreted as the number of successes until the experiment is stopped, the [negative binomial][negative-binomial-distribution] distribution is also defined for non-integers `r`. In this case, `r` denotes shape parameter of the [gamma mixing distribution][negative-binomial-mixture-representation]. ```javascript -var y = quantile( 0.5, 15.5, 0.5 ); +let y = quantile( 0.5, 15.5, 0.5 ); // returns 15 y = quantile( 0.3, 7.4, 0.4 ); @@ -94,7 +94,7 @@ y = quantile( 0.3, 7.4, 0.4 ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var y = quantile( 0.5, 0.0, 0.5 ); +let y = quantile( 0.5, 0.0, 0.5 ); // returns NaN y = quantile( 0.5, -2.0, 0.5 ); @@ -104,7 +104,7 @@ y = quantile( 0.5, -2.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 20.0, 0.5 ); +let y = quantile( NaN, 20.0, 0.5 ); // returns NaN y = quantile( 0.3, NaN, 0.5 ); @@ -117,7 +117,7 @@ y = quantile( 0.3, 20.0, NaN ); If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 0.3, 20.0, -1.0 ); +let y = quantile( 0.3, 20.0, -1.0 ); // returns NaN y = quantile( 0.3, 20.0, 1.5 ); @@ -129,8 +129,8 @@ y = quantile( 0.3, 20.0, 1.5 ); Returns a function for evaluating the [quantile function][quantile-function] for a [negative binomial][negative-binomial-distribution] distribution with number of successes until experiment is stopped `r` and success probability `p`. ```javascript -var myquantile = quantile.factory( 10.0, 0.5 ); -var y = myquantile( 0.1 ); +const myquantile = quantile.factory( 10.0, 0.5 ); +let y = myquantile( 0.1 ); // returns 5 y = myquantile( 0.9 ); @@ -148,20 +148,14 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/negative-binomial/quantile' ); - -var i; -var k; -var r; -var p; -var y; - -for ( i = 0; i < 10; i++ ) { - k = randu(); - r = randu() * 100; - p = randu(); - y = quantile( k, r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/negative-binomial/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const k = randu(); + const r = randu() * 100; + const p = randu(); + const y = quantile( k, r, p ); console.log( 'k: %d, r: %d, p: %d, Q(k;r,p): %d', k.toFixed( 4 ), r.toFixed( 4 ), p.toFixed( 4 ), y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/skewness/README.md index 85b2ac9a5892..7153dd9ab949 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/skewness/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/negative-binomial/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/negative-binomial/skewness' ); ``` #### skewness( r, p ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/negative-binomial/skewness' ); Returns the [skewness][skewness] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = skewness( 100, 0.2 ); +let v = skewness( 100, 0.2 ); // returns ~0.201 v = skewness( 50, 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 0.5 ); +let v = skewness( NaN, 0.5 ); // returns NaN v = skewness( 20, NaN ); @@ -82,14 +82,14 @@ v = skewness( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = skewness( -2.0, 0.5 ); +const v = skewness( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = skewness( 20, -1.0 ); +let v = skewness( 20, -1.0 ); // returns NaN v = skewness( 20, 1.5 ); @@ -117,18 +117,13 @@ v = skewness( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/negative-binomial/skewness' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = skewness( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/negative-binomial/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = skewness( r, p ); console.log( 'r: %d, p: %d, skew(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/stdev/README.md index 8616a35d0ce4..3d1084218728 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/stdev/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/negative-binomial/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/negative-binomial/stdev' ); ``` #### stdev( r, p ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/negative-binomial/stdev' ); Returns the [standard deviation][standard-deviation] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = stdev( 100, 0.2 ); +let v = stdev( 100, 0.2 ); // returns ~44.721 v = stdev( 50, 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 0.5 ); +let v = stdev( NaN, 0.5 ); // returns NaN v = stdev( 20, NaN ); @@ -82,14 +82,14 @@ v = stdev( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = stdev( -2.0, 0.5 ); +const v = stdev( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = stdev( 20, -1.0 ); +let v = stdev( 20, -1.0 ); // returns NaN v = stdev( 20, 1.5 ); @@ -117,18 +117,13 @@ v = stdev( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/negative-binomial/stdev' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = stdev( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/negative-binomial/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = stdev( r, p ); console.log( 'r: %d, p: %d, SD(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/variance/README.md index 409f103c1ef8..88ddf7a7926a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/negative-binomial/variance/README.md @@ -54,7 +54,7 @@ where `r` is the number of successes until experiment is stopped and `p` is the ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/negative-binomial/variance' ); +const variance = require( '@stdlib/stats/base/dists/negative-binomial/variance' ); ``` #### variance( r, p ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/negative-binomial/variance' ); Returns the [variance][variance] of a [negative binomial][negative-binomial-distribution] distribution with parameters `r` (number of successes until experiment is stopped) and `p` (success probability). ```javascript -var v = variance( 100, 0.2 ); +let v = variance( 100, 0.2 ); // returns ~2000.0 v = variance( 50, 0.5 ); @@ -72,7 +72,7 @@ v = variance( 50, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 0.5 ); +let v = variance( NaN, 0.5 ); // returns NaN v = variance( 20, NaN ); @@ -82,14 +82,14 @@ v = variance( 20, NaN ); If provided a `r` which is not a positive number, the function returns `NaN`. ```javascript -var v = variance( -2.0, 0.5 ); +const v = variance( -2.0, 0.5 ); // returns NaN ``` If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. ```javascript -var v = variance( 20, -1.0 ); +let v = variance( 20, -1.0 ); // returns NaN v = variance( 20, 1.5 ); @@ -117,18 +117,13 @@ v = variance( 20, 1.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/negative-binomial/variance' ); - -var v; -var i; -var r; -var p; - -for ( i = 0; i < 10; i++ ) { - r = randu() * 100; - p = randu(); - v = variance( r, p ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/negative-binomial/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const r = randu() * 100; + const p = randu(); + const v = variance( r, p ); console.log( 'r: %d, p: %d, Var(X;r,p): %d', r, p.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/README.md index 3726fab2c7cc..366dfe42d9bd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var normal = require( '@stdlib/stats/base/dists/normal' ); +const normal = require( '@stdlib/stats/base/dists/normal' ); ``` #### normal @@ -35,7 +35,7 @@ var normal = require( '@stdlib/stats/base/dists/normal' ); Normal distribution. ```javascript -var dist = normal; +const dist = normal; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [normal][normal-dis ```javascript -var Normal = require( '@stdlib/stats/base/dists/normal' ).Normal; +const Normal = require( '@stdlib/stats/base/dists/normal' ).Normal; -var dist = new Normal( 2.0, 4.0 ); +const dist = new Normal( 2.0, 4.0 ); -var y = dist.pdf( 2.0 ); +const y = dist.pdf( 2.0 ); // returns ~0.1 ``` @@ -109,7 +109,7 @@ var y = dist.pdf( 2.0 ); ```javascript -var normal = require( '@stdlib/stats/base/dists/normal' ); +const normal = require( '@stdlib/stats/base/dists/normal' ); /* A bakery is analyzing cake baking times to ensure consistency and better schedule their baking processes. @@ -124,10 +124,10 @@ Assuming each record represents the average baking time per batch and the bakery We can model the average bake times using a normal distribution with μ (mu) = 20.0 minutes and σ = 3.0 minutes. */ -var mu = 20.0; -var sigma = 3.0; +const mu = 20.0; +const sigma = 3.0; -var normalDist = new normal.Normal( mu, sigma ); +const normalDist = new normal.Normal( mu, sigma ); // Output the standard deviation of the baking times: console.log( normalDist.sigma ); @@ -192,7 +192,7 @@ console.log( normal.variance( mu, sigma ) ); console.log( normal.skewness( mu, sigma ) ); // => 0.0 -var myquantile = normal.quantile.factory( 20.0, 3.0 ); +const myquantile = normal.quantile.factory( 20.0, 3.0 ); // 20th percentile (value below which 20% baking times fall): console.log( myquantile( 0.2 ) ); @@ -202,7 +202,7 @@ console.log( myquantile( 0.2 ) ); console.log( myquantile( 0.8 ) ); // => ~22.525 -var mylogpdf = normal.logpdf.factory( 20.0, 3.0 ); +const mylogpdf = normal.logpdf.factory( 20.0, 3.0 ); // Logarithm of the probability density function at the mean: console.log( mylogpdf( 20.0 ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/README.md index 1da8c09549cd..68ca99b2f7cb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/README.md @@ -50,7 +50,7 @@ where `µ` is the mean and `σ` is the standard deviation. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/normal/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/normal/cdf' ); ``` #### cdf( x, mu, sigma ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/normal/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = cdf( 2.0, 0.0, 1.0 ); +let y = cdf( 2.0, 0.0, 1.0 ); // returns ~0.977 y = cdf( 0.0, 0.0, 1.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -84,14 +84,14 @@ y = cdf( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.0, -1.0 ); +const y = cdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = cdf( 2.0, 8.0, 0.0 ); +let y = cdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = cdf( 8.0, 8.0, 0.0 ); @@ -106,9 +106,9 @@ y = cdf( 10.0, 8.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a normal distribution with parameters `mu` and `sigma`. ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns 0.5 y = mycdf( 8.0 ); @@ -126,20 +126,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/normal/cdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = cdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/normal/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = cdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, F(x;µ,σ): %d', x, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/ctor/README.md index dc23934aa9fb..bfffd6faf887 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Normal = require( '@stdlib/stats/base/dists/normal/ctor' ); +const Normal = require( '@stdlib/stats/base/dists/normal/ctor' ); ``` #### Normal( \[mu, sigma] ) @@ -45,18 +45,18 @@ var Normal = require( '@stdlib/stats/base/dists/normal/ctor' ); Returns a [normal][normal-distribution] distribution object. ```javascript -var normal = new Normal(); +const normal = new Normal(); -var mu = normal.mean; +const mu = normal.mean; // returns 0.0 ``` By default, `mu = 0.0` and `sigma = 1.0`. To create a distribution having a different `mu` (mean parameter) and `sigma` (standard deviation), provide the corresponding arguments. ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var mu = normal.mean; +const mu = normal.mean; // returns 2.0 ``` @@ -73,9 +73,9 @@ A [normal][normal-distribution] distribution object has the following properties Mean parameter of the distribution. ```javascript -var normal = new Normal(); +const normal = new Normal(); -var mu = normal.mu; +let mu = normal.mu; // returns 0.0 normal.mu = 3.0; @@ -89,9 +89,9 @@ mu = normal.mu; Standard deviation of the distribution. `sigma` **must** be a positive number. ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var sigma = normal.sigma; +let sigma = normal.sigma; // returns 4.0 normal.sigma = 3.0; @@ -109,9 +109,9 @@ sigma = normal.sigma; Returns the [differential entropy][entropy]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var entropy = normal.entropy; +const entropy = normal.entropy; // returns ~3.904 ``` @@ -120,9 +120,9 @@ var entropy = normal.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var kurtosis = normal.kurtosis; +const kurtosis = normal.kurtosis; // returns 0.0 ``` @@ -131,9 +131,9 @@ var kurtosis = normal.kurtosis; Returns the [expected value][expected-value]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var mu = normal.mean; +const mu = normal.mean; // returns 4.0 ``` @@ -142,9 +142,9 @@ var mu = normal.mean; Returns the [median][median]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var median = normal.median; +const median = normal.median; // returns 4.0 ``` @@ -153,9 +153,9 @@ var median = normal.median; Returns the [mode][mode]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var mode = normal.mode; +const mode = normal.mode; // returns 4.0 ``` @@ -164,9 +164,9 @@ var mode = normal.mode; Returns the [skewness][skewness]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var skewness = normal.skewness; +const skewness = normal.skewness; // returns 0.0 ``` @@ -175,9 +175,9 @@ var skewness = normal.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var s = normal.stdev; +const s = normal.stdev; // returns 12.0 ``` @@ -186,9 +186,9 @@ var s = normal.stdev; Returns the [variance][variance]. ```javascript -var normal = new Normal( 4.0, 12.0 ); +const normal = new Normal( 4.0, 12.0 ); -var s2 = normal.variance; +const s2 = normal.variance; // returns 144.0 ``` @@ -201,9 +201,9 @@ var s2 = normal.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.cdf( 0.5 ); +const y = normal.cdf( 0.5 ); // returns ~0.354 ``` @@ -212,9 +212,9 @@ var y = normal.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.logcdf( 0.5 ); +const y = normal.logcdf( 0.5 ); // returns ~-1.039 ``` @@ -223,9 +223,9 @@ var y = normal.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.logpdf( 2.0 ); +const y = normal.logpdf( 2.0 ); // returns ~-2.305 ``` @@ -234,9 +234,9 @@ var y = normal.logpdf( 2.0 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.mgf( 0.2 ); +const y = normal.mgf( 0.2 ); // returns ~2.054 ``` @@ -245,9 +245,9 @@ var y = normal.mgf( 0.2 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.pdf( 2.0 ); +const y = normal.pdf( 2.0 ); // returns ~0.1 ``` @@ -256,9 +256,9 @@ var y = normal.pdf( 2.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var y = normal.quantile( 0.5 ); +let y = normal.quantile( 0.5 ); // returns 2.0 y = normal.quantile( 1.9 ); @@ -288,20 +288,20 @@ y = normal.quantile( 1.9 ); ```javascript -var Normal = require( '@stdlib/stats/base/dists/normal/ctor' ); +const Normal = require( '@stdlib/stats/base/dists/normal/ctor' ); -var normal = new Normal( 2.0, 4.0 ); +const normal = new Normal( 2.0, 4.0 ); -var mean = normal.mean; +const mean = normal.mean; // returns 2.0 -var median = normal.median; +const median = normal.median; // returns 2.0 -var s2 = normal.variance; +const s2 = normal.variance; // returns 16.0 -var y = normal.cdf( 0.8 ); +const y = normal.cdf( 0.8 ); // returns ~0.382 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/entropy/README.md index ac91292fd8e7..4e86376e45f4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/entropy/README.md @@ -52,7 +52,7 @@ h\left( X \right) = \tfrac{1}{2}\ln(2\pi \,e\,\sigma ^{2}) ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/normal/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/normal/entropy' ); ``` #### entropy( mu, sigma ) @@ -60,7 +60,7 @@ var entropy = require( '@stdlib/stats/base/dists/normal/entropy' ); Returns the [differential entropy][entropy] for a [normal][normal-distribution] distribution with mean `mu` and standard deviation `sigma` (in [nats][nats]). ```javascript -var y = entropy( 2.0, 1.0 ); +let y = entropy( 2.0, 1.0 ); // returns ~1.419 y = entropy( -1.0, 4.0 ); @@ -70,7 +70,7 @@ y = entropy( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = entropy( NaN, 1.0 ); +let y = entropy( NaN, 1.0 ); // returns NaN y = entropy( 0.0, NaN ); @@ -80,7 +80,7 @@ y = entropy( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = entropy( 0.0, 0.0 ); +let y = entropy( 0.0, 0.0 ); // returns NaN y = entropy( 0.0, -1.0 ); @@ -108,18 +108,13 @@ y = entropy( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/normal/entropy' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = entropy( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/normal/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = entropy( mu, sigma ); console.log( 'µ: %d, σ: %d, h(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/kurtosis/README.md index 5b2e7ddddc77..7e13f65b02e0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [normal][normal-distribution] random varia ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' ); ``` #### kurtosis( mu, sigma ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' ); Returns the [excess kurtosis][kurtosis] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = kurtosis( 2.0, 1.0 ); +let y = kurtosis( 2.0, 1.0 ); // returns 0.0 y = kurtosis( -1.0, 4.0 ); @@ -70,7 +70,7 @@ y = kurtosis( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = kurtosis( NaN, 1.0 ); +let y = kurtosis( NaN, 1.0 ); // returns NaN y = kurtosis( 0.0, NaN ); @@ -80,7 +80,7 @@ y = kurtosis( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = kurtosis( 0.0, 0.0 ); +let y = kurtosis( 0.0, 0.0 ); // returns NaN y = kurtosis( 0.0, -1.0 ); @@ -108,18 +108,13 @@ y = kurtosis( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = kurtosis( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = kurtosis( mu, sigma ); console.log( 'µ: %d, σ: %d, Kurt(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md index 52d505ed7363..2524b0676222 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' ); ``` #### logcdf( x, mu, sigma ) @@ -41,7 +41,7 @@ var logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = logcdf( 2.0, 0.0, 1.0 ); +let y = logcdf( 2.0, 0.0, 1.0 ); // returns ~-0.023 y = logcdf( -1.0, 4.0, 2.0 ); @@ -51,7 +51,7 @@ y = logcdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -64,14 +64,14 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.0, -1.0 ); +const y = logcdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the natural logarithm of the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logcdf( 2.0, 8.0, 0.0 ); +let y = logcdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logcdf( 8.0, 8.0, 0.0 ); @@ -86,9 +86,9 @@ y = logcdf( 10.0, 8.0, 0.0 ); Returns a `function` for evaluating the [cumulative distribution function][cdf] (CDF) of a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.693 y = mylogcdf( 5.0 ); @@ -106,20 +106,14 @@ y = mylogcdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = logcdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = logcdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, ln(F(x;µ,σ)): %d', x, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/README.md index 00a0042004dc..f1f72aa0914a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/README.md @@ -50,7 +50,7 @@ where `µ` is the mean and `σ` is the standard deviation. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/normal/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/normal/logpdf' ); ``` #### logpdf( x, mu, sigma ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/normal/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns ~-2.919 y = logpdf( -1.0, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = logpdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, -1.0 ); +const y = logpdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the natural logarithm of the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = logpdf( 2.0, 8.0, 0.0 ); +let y = logpdf( 2.0, 8.0, 0.0 ); // returns -Infinity y = logpdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = logpdf( 8.0, 8.0, 0.0 ); Returns a `function` for evaluating the [probability density function][pdf] (PDF) of a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var mylogpdf = logpdf.factory( 10.0, 2.0 ); +const mylogpdf = logpdf.factory( 10.0, 2.0 ); -var y = mylogpdf( 10.0 ); +let y = mylogpdf( 10.0 ); // returns ~-1.612 y = mylogpdf( 5.0 ); @@ -120,20 +120,14 @@ y = mylogpdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/normal/logpdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = logpdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/normal/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = logpdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, ln(f(x;µ,σ)): %d', x, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/mean/README.md index e578af161645..954b6f36ce94 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/mean/README.md @@ -52,7 +52,7 @@ The [expected value][mean] for a [normal][normal-distribution] random variable w ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/normal/mean' ); +const mean = require( '@stdlib/stats/base/dists/normal/mean' ); ``` #### mean( mu, sigma ) @@ -60,7 +60,7 @@ var mean = require( '@stdlib/stats/base/dists/normal/mean' ); Returns the [expected value][mean] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = mean( 2.0, 1.0 ); +let y = mean( 2.0, 1.0 ); // returns 2.0 y = mean( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mean( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mean( NaN, 1.0 ); +let y = mean( NaN, 1.0 ); // returns NaN y = mean( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mean( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = mean( 0.0, 0.0 ); +let y = mean( 0.0, 0.0 ); // returns NaN y = mean( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mean( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/normal/mean' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = mean( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/normal/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = mean( mu, sigma ); console.log( 'µ: %d, σ: %d, E(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/median/README.md index d2b347293ea7..a71190bb7652 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [normal][normal-distribution] random variable with me ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/normal/median' ); +const median = require( '@stdlib/stats/base/dists/normal/median' ); ``` #### median( mu, sigma ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/normal/median' ); Returns the [median][median] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = median( 2.0, 1.0 ); +let y = median( 2.0, 1.0 ); // returns 2.0 y = median( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = median( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = median( NaN, 1.0 ); +let y = median( NaN, 1.0 ); // returns NaN y = median( 0.0, NaN ); @@ -83,7 +83,7 @@ y = median( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = median( 0.0, 0.0 ); +let y = median( 0.0, 0.0 ); // returns NaN y = median( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = median( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/normal/median' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = median( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/normal/median' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = median( mu, sigma ); console.log( 'µ: %d, σ: %d, Median(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/mgf/README.md index 93ace14dfcc8..77df4f345192 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/mgf/README.md @@ -54,7 +54,7 @@ where `mu` is the mean and `sigma > 0` is the standard deviation. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/normal/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/normal/mgf' ); ``` #### mgf( t, mu, sigma ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/normal/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = mgf( 2.0, 0.0, 1.0 ); +let y = mgf( 2.0, 0.0, 1.0 ); // returns ~7.389 y = mgf( 0.0, 0.0, 1.0 ); @@ -75,7 +75,7 @@ y = mgf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,7 +88,7 @@ y = mgf( 0.0, 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 0.0, 0.0 ); +let y = mgf( 2.0, 0.0, 0.0 ); // returns NaN y = mgf( 2.0, 0.0, -1.0 ); @@ -100,9 +100,9 @@ y = mgf( 2.0, 0.0, -1.0 ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) of a [normal][normal-distribution] distribution with parameters `mu` and `sigma`. ```javascript -var mymgf = mgf.factory( 4.0, 2.0 ); +const mymgf = mgf.factory( 4.0, 2.0 ); -var y = mymgf( 1.0 ); +let y = mymgf( 1.0 ); // returns ~403.429 y = mymgf( 0.5 ); @@ -130,20 +130,14 @@ y = mymgf( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/normal/mgf' ); - -var sigma; -var mu; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = mgf( t, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/normal/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = mgf( t, mu, sigma ); console.log( 't: %d, µ: %d, σ: %d, M_X(t;µ,σ): %d', t.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/mode/README.md index e68c98bf08a9..f49269a4bb2b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [normal][normal-distribution] random variable with mean ` ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/normal/mode' ); +const mode = require( '@stdlib/stats/base/dists/normal/mode' ); ``` #### mode( mu, sigma ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/normal/mode' ); Returns the [mode][mode] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = mode( 2.0, 1.0 ); +let y = mode( 2.0, 1.0 ); // returns 2.0 y = mode( 0.0, 1.0 ); @@ -73,7 +73,7 @@ y = mode( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mode( NaN, 1.0 ); +let y = mode( NaN, 1.0 ); // returns NaN y = mode( 0.0, NaN ); @@ -83,7 +83,7 @@ y = mode( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = mode( 0.0, 0.0 ); +let y = mode( 0.0, 0.0 ); // returns NaN y = mode( 0.0, -1.0 ); @@ -111,18 +111,13 @@ y = mode( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/normal/mode' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = mode( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/normal/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = mode( mu, sigma ); console.log( 'µ: %d, σ: %d, mode(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/pdf/README.md index b548d577444b..3d79968024fa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/pdf/README.md @@ -50,7 +50,7 @@ where `µ` is the mean and `σ` is the standard deviation. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/normal/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/normal/pdf' ); ``` #### pdf( x, mu, sigma ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/normal/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns ~0.054 y = pdf( -1.0, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = pdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -81,14 +81,14 @@ y = pdf( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, -1.0 ); +const y = pdf( 2.0, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = pdf( 2.0, 8.0, 0.0 ); +let y = pdf( 2.0, 8.0, 0.0 ); // returns 0.0 y = pdf( 8.0, 8.0, 0.0 ); @@ -100,9 +100,9 @@ y = pdf( 8.0, 8.0, 0.0 ); Partially applies `mu` and `sigma` to create a reusable `function` for evaluating the PDF. ```javascript -var mypdf = pdf.factory( 10.0, 2.0 ); +const mypdf = pdf.factory( 10.0, 2.0 ); -var y = mypdf( 10.0 ); +let y = mypdf( 10.0 ); // returns ~0.199 y = mypdf( 5.0 ); @@ -120,20 +120,14 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/normal/pdf' ); - -var sigma; -var mu; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = pdf( x, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/normal/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = pdf( x, mu, sigma ); console.log( 'x: %d, µ: %d, σ: %d, f(x;µ,σ): %d', x, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md index c007c064502e..4442bcf1f137 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `µ` is the mean and `σ` is the standard deviation. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/normal/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/normal/quantile' ); ``` #### quantile( p, mu, sigma ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/normal/quantile' ); Evaluates the [quantile function][quantile-function] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = quantile( 0.5, 0.0, 1.0 ); +let y = quantile( 0.5, 0.0, 1.0 ); // returns 0.0 y = quantile( 0.2, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.2, 4.0, 2.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,14 +91,14 @@ y = quantile( 0.0, 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 0.0, -1.0 ); +const y = quantile( 0.4, 0.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `mu`. ```javascript -var y = quantile( 0.3, 8.0, 0.0 ); +let y = quantile( 0.3, 8.0, 0.0 ); // returns 8.0 y = quantile( 0.9, 8.0, 0.0 ); @@ -110,9 +110,9 @@ y = quantile( 0.9, 8.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [normal][normal-distribution] distribution with parameters `mu` and `sigma`. ```javascript -var myquantile = quantile.factory( 10.0, 2.0 ); +const myquantile = quantile.factory( 10.0, 2.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~8.317 y = myquantile( 0.8 ); @@ -130,20 +130,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/normal/quantile' ); - -var sigma; -var mu; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - mu = (randu() * 10.0) - 5.0; - sigma = randu() * 20.0; - y = quantile( p, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/normal/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const mu = (randu() * 10.0) - 5.0; + const sigma = randu() * 20.0; + const y = quantile( p, mu, sigma ); console.log( 'p: %d, µ: %d, σ: %d, Q(p;µ,σ): %d', p, mu, sigma, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/skewness/README.md index 72091642056b..6d6cb57f04e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/skewness/README.md @@ -52,7 +52,7 @@ The [skewness][skewness] for a [normal][normal-distribution] random variable wit ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/normal/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/normal/skewness' ); ``` #### skewness( mu, sigma ) @@ -60,7 +60,7 @@ var skewness = require( '@stdlib/stats/base/dists/normal/skewness' ); Returns the [skewness][skewness] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = skewness( 2.0, 1.0 ); +let y = skewness( 2.0, 1.0 ); // returns 0.0 y = skewness( -1.0, 4.0 ); @@ -70,7 +70,7 @@ y = skewness( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = skewness( NaN, 1.0 ); +let y = skewness( NaN, 1.0 ); // returns NaN y = skewness( 0.0, NaN ); @@ -80,7 +80,7 @@ y = skewness( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = skewness( 0.0, 0.0 ); +let y = skewness( 0.0, 0.0 ); // returns NaN y = skewness( 0.0, -1.0 ); @@ -108,18 +108,13 @@ y = skewness( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/normal/skewness' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = skewness( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/normal/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = skewness( mu, sigma ); console.log( 'µ: %d, σ: %d, skew(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/stdev/README.md index 37b6a92e45cb..81d6fba5a776 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/stdev/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/normal/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/normal/stdev' ); ``` #### stdev( mu, sigma ) @@ -37,7 +37,7 @@ var stdev = require( '@stdlib/stats/base/dists/normal/stdev' ); Returns the [standard deviation][standard-deviation] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = stdev( 2.0, 1.0 ); +let y = stdev( 2.0, 1.0 ); // returns 1.0 y = stdev( -1.0, 4.0 ); @@ -47,7 +47,7 @@ y = stdev( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = stdev( NaN, 1.0 ); +let y = stdev( NaN, 1.0 ); // returns NaN y = stdev( 0.0, NaN ); @@ -57,7 +57,7 @@ y = stdev( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = stdev( 0.0, 0.0 ); +let y = stdev( 0.0, 0.0 ); // returns NaN y = stdev( 0.0, -1.0 ); @@ -85,18 +85,13 @@ y = stdev( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/normal/stdev' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = stdev( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/normal/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = stdev( mu, sigma ); console.log( 'µ: %d, σ: %d, Var(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/variance/README.md index f4ce478e15c6..e8f4ab4d5c86 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/variance/README.md @@ -52,7 +52,7 @@ The [variance][variance] for a [normal][normal-distribution] random variable wit ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/normal/variance' ); +const variance = require( '@stdlib/stats/base/dists/normal/variance' ); ``` #### variance( mu, sigma ) @@ -60,7 +60,7 @@ var variance = require( '@stdlib/stats/base/dists/normal/variance' ); Returns the [variance][variance] for a [normal][normal-distribution] distribution with parameters `mu` (mean) and `sigma` (standard deviation). ```javascript -var y = variance( 2.0, 1.0 ); +let y = variance( 2.0, 1.0 ); // returns 1.0 y = variance( -1.0, 4.0 ); @@ -70,7 +70,7 @@ y = variance( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = variance( NaN, 1.0 ); +let y = variance( NaN, 1.0 ); // returns NaN y = variance( 0.0, NaN ); @@ -80,7 +80,7 @@ y = variance( 0.0, NaN ); If provided `sigma <= 0`, the function returns `NaN`. ```javascript -var y = variance( 0.0, 0.0 ); +let y = variance( 0.0, 0.0 ); // returns NaN y = variance( 0.0, -1.0 ); @@ -108,18 +108,13 @@ y = variance( 0.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/normal/variance' ); - -var sigma; -var mu; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - mu = ( randu()*10.0 ) - 5.0; - sigma = randu() * 20.0; - y = variance( mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/normal/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const mu = ( randu()*10.0 ) - 5.0; + const sigma = randu() * 20.0; + const y = variance( mu, sigma ); console.log( 'µ: %d, σ: %d, Var(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/README.md index cf1e143331bb..8083339f0a55 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ); +const pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ); ``` #### pareto1 @@ -35,7 +35,7 @@ var pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ); Pareto (Type I) distribution. ```javascript -var dist = pareto1; +const dist = pareto1; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [Pareto (Type I)][p ```javascript -var Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ).Pareto1; +const Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ).Pareto1; -var dist = new Pareto1( 2.0, 4.0 ); +const dist = new Pareto1( 2.0, 4.0 ); -var y = dist.cdf( 3.5 ); +const y = dist.cdf( 3.5 ); // returns 0.0 ``` @@ -108,8 +108,8 @@ var y = dist.cdf( 3.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const pareto1 = require( '@stdlib/stats/base/dists/pareto-type1' ); console.log( objectKeys( pareto1 ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/cdf/README.md index 45a25b2c13f9..5ec1993f746b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/cdf/README.md @@ -50,7 +50,7 @@ and zero otherwise. In the equation, `alpha > 0` is the shape parameter and `bet ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/pareto-type1/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/pareto-type1/cdf' ); ``` #### cdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/pareto-type1/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var y = cdf( 2.0, 1.0, 1.0 ); +let y = cdf( 2.0, 1.0, 1.0 ); // returns 0.5 y = cdf( 5.0, 2.0, 4.0 ); @@ -77,7 +77,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -90,7 +90,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 0.5 ); +let y = cdf( 2.0, -1.0, 0.5 ); // returns NaN y = cdf( 2.0, 0.0, 0.5 ); @@ -100,7 +100,7 @@ y = cdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -112,8 +112,8 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] (CDF) of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var mycdf = cdf.factory( 10.0, 2.0 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 10.0, 2.0 ); +let y = mycdf( 3.0 ); // returns ~0.983 y = mycdf( 2.5 ); @@ -131,20 +131,14 @@ y = mycdf( 2.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/pareto-type1/cdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 8.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = cdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/pareto-type1/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 8.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = cdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, F(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/ctor/README.md index 0ec43142368e..94c7f77b5806 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1/ctor' ); +const Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1/ctor' ); ``` #### Pareto1( \[alpha, beta] ) @@ -45,18 +45,18 @@ var Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1/ctor' ); Returns a [Pareto (Type I)][pareto-distribution] distribution object. ```javascript -var pareto1 = new Pareto1(); +const pareto1 = new Pareto1(); -var mu = pareto1.mean; +const mu = pareto1.mean; // returns Infinity ``` By default, `alpha = 1.0` and `beta = 1.0`. To create a distribution having a different `alpha` (shape parameter) and `beta` (scale parameter), provide the corresponding arguments. ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var mu = pareto1.mean; +const mu = pareto1.mean; // returns 8.0 ``` @@ -73,9 +73,9 @@ A [Pareto (Type I)][pareto-distribution] distribution object has the following p Shape parameter of the distribution. `alpha` **must** be a positive number. ```javascript -var pareto1 = new Pareto1(); +const pareto1 = new Pareto1(); -var alpha = pareto1.alpha; +let alpha = pareto1.alpha; // returns 1.0 pareto1.alpha = 3.0; @@ -89,9 +89,9 @@ alpha = pareto1.alpha; Scale parameter of the distribution. `beta` **must** be a positive number. ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var beta = pareto1.beta; +let beta = pareto1.beta; // returns 4.0 pareto1.beta = 3.0; @@ -109,9 +109,9 @@ beta = pareto1.beta; Returns the [differential entropy][entropy]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var entropy = pareto1.entropy; +const entropy = pareto1.entropy; // returns ~2.349 ``` @@ -120,9 +120,9 @@ var entropy = pareto1.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var pareto1 = new Pareto1( 6.0, 12.0 ); +const pareto1 = new Pareto1( 6.0, 12.0 ); -var kurtosis = pareto1.kurtosis; +const kurtosis = pareto1.kurtosis; // returns ~35.667 ``` @@ -131,9 +131,9 @@ var kurtosis = pareto1.kurtosis; Returns the [expected value][expected-value]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var mu = pareto1.mean; +const mu = pareto1.mean; // returns 16.0 ``` @@ -142,9 +142,9 @@ var mu = pareto1.mean; Returns the [median][median]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var median = pareto1.median; +const median = pareto1.median; // returns ~14.27 ``` @@ -153,9 +153,9 @@ var median = pareto1.median; Returns the [mode][mode]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var mode = pareto1.mode; +const mode = pareto1.mode; // returns 12.0 ``` @@ -164,9 +164,9 @@ var mode = pareto1.mode; Returns the [skewness][skewness]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var skewness = pareto1.skewness; +const skewness = pareto1.skewness; // returns ~7.071 ``` @@ -175,9 +175,9 @@ var skewness = pareto1.skewness; Returns the [variance][variance]. ```javascript -var pareto1 = new Pareto1( 4.0, 12.0 ); +const pareto1 = new Pareto1( 4.0, 12.0 ); -var s2 = pareto1.variance; +const s2 = pareto1.variance; // returns 32.0 ``` @@ -190,9 +190,9 @@ var s2 = pareto1.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var y = pareto1.cdf( 3.5 ); +const y = pareto1.cdf( 3.5 ); // returns 0.0 ``` @@ -201,9 +201,9 @@ var y = pareto1.cdf( 3.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var y = pareto1.logcdf( 3.5 ); +const y = pareto1.logcdf( 3.5 ); // returns -Infinity ``` @@ -212,9 +212,9 @@ var y = pareto1.logcdf( 3.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var y = pareto1.logpdf( 5.0 ); +const y = pareto1.logpdf( 5.0 ); // returns ~-1.363 ``` @@ -223,9 +223,9 @@ var y = pareto1.logpdf( 5.0 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var y = pareto1.pdf( 5.0 ); +const y = pareto1.pdf( 5.0 ); // returns ~0.256 ``` @@ -234,9 +234,9 @@ var y = pareto1.pdf( 5.0 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var y = pareto1.quantile( 0.5 ); +let y = pareto1.quantile( 0.5 ); // returns ~5.657 y = pareto1.quantile( 1.9 ); @@ -266,20 +266,20 @@ y = pareto1.quantile( 1.9 ); ```javascript -var Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1/ctor' ); +const Pareto1 = require( '@stdlib/stats/base/dists/pareto-type1/ctor' ); -var pareto1 = new Pareto1( 2.0, 4.0 ); +const pareto1 = new Pareto1( 2.0, 4.0 ); -var mu = pareto1.mean; +const mu = pareto1.mean; // returns 8.0 -var median = pareto1.median; +const median = pareto1.median; // returns ~5.657 -var s2 = pareto1.variance; +const s2 = pareto1.variance; // returns Infinity -var y = pareto1.cdf( 2.0 ); +const y = pareto1.cdf( 2.0 ); // returns 0.0 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/entropy/README.md index 0998b7aaa565..50ddd9cb8ad9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/entropy/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the scale parameter. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/pareto-type1/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/pareto-type1/entropy' ); ``` #### entropy( alpha, beta ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/pareto-type1/entropy' ); Returns the [differential entropy][entropy] of a [Pareto (Type I)][pareto-distribution] distribution with parameters shape parameter `alpha` and scale parameter `beta` (in [nats][nats]). ```javascript -var v = entropy( 2.0, 1.0 ); +let v = entropy( 2.0, 1.0 ); // returns ~0.807 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, 0.0 ); +let v = entropy( 1.0, 0.0 ); // returns NaN v = entropy( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/pareto-type1/entropy' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = entropy( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/pareto-type1/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = entropy( alpha, beta ); console.log( 'α: %d, β: %d, h(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/kurtosis/README.md index 3ac4242d1029..50a6af51da33 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/kurtosis/README.md @@ -54,7 +54,7 @@ for `α > 4` and `β > 0`. Otherwise, the kurtosis is not defined. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/pareto-type1/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/pareto-type1/kurtosis' ); ``` #### kurtosis( alpha, beta ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/pareto-type1/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = kurtosis( 5.0, 1.0 ); +let v = kurtosis( 5.0, 1.0 ); // returns ~70.8 v = kurtosis( 4.5, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 2.0, NaN ); If provided `alpha <= 4`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns NaN v = kurtosis( 3.0, 1.0 ); @@ -101,7 +101,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 0.0 ); +let v = kurtosis( 1.0, 0.0 ); // returns NaN v = kurtosis( 1.0, -1.0 ); @@ -129,19 +129,14 @@ v = kurtosis( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/pareto-type1/kurtosis' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + 4.0 + EPS; - beta = ( randu()*10.0 ) + EPS; - v = kurtosis( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/pareto-type1/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + 4.0 + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = kurtosis( alpha, beta ); console.log( 'α: %d, β: %d, Kurt(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/README.md index 9fdca76e6a56..7cf7ad56af90 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/README.md @@ -50,7 +50,7 @@ and zero otherwise. In the equation, `alpha > 0` is the shape parameter and `bet ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/pareto-type1/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/pareto-type1/logcdf' ); ``` #### logcdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/pareto-type1/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var y = logcdf( 2.0, 1.0, 1.0 ); +let y = logcdf( 2.0, 1.0, 1.0 ); // returns ~-0.693 y = logcdf( 5.0, 2.0, 4.0 ); @@ -77,7 +77,7 @@ y = logcdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -90,7 +90,7 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0, 0.5 ); +let y = logcdf( 2.0, -1.0, 0.5 ); // returns NaN y = logcdf( 2.0, 0.0, 0.5 ); @@ -100,7 +100,7 @@ y = logcdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.5, -1.0 ); +let y = logcdf( 2.0, 0.5, -1.0 ); // returns NaN y = logcdf( 2.0, 0.5, 0.0 ); @@ -112,8 +112,8 @@ y = logcdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] (CDF) of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var mylogcdf = logcdf.factory( 10.0, 2.0 ); -var y = mylogcdf( 3.0 ); +const mylogcdf = logcdf.factory( 10.0, 2.0 ); +let y = mylogcdf( 3.0 ); // returns ~-0.017 y = mylogcdf( 2.5 ); @@ -141,20 +141,14 @@ y = mylogcdf( 2.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/pareto-type1/logcdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 8.0; - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = logcdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/pareto-type1/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 8.0; + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = logcdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(F(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md index b2be828ad786..c5797870780d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/pareto-type1/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/pareto-type1/logpdf' ); ``` #### logpdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/pareto-type1/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var y = logpdf( 4.0, 1.0, 1.0 ); +let y = logpdf( 4.0, 1.0, 1.0 ); // returns ~-2.773 y = logpdf( 20.0, 1.0, 10.0 ); @@ -80,7 +80,7 @@ y = logpdf( 1.5, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -93,7 +93,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -1.0, 0.5 ); +let y = logpdf( 2.0, -1.0, 0.5 ); // returns NaN y = logpdf( 2.0, 0.0, 0.5 ); @@ -103,7 +103,7 @@ y = logpdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.5, -1.0 ); +let y = logpdf( 2.0, 0.5, -1.0 ); // returns NaN y = logpdf( 2.0, 0.5, 0.0 ); @@ -115,8 +115,8 @@ y = logpdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the natural logarithm of the [probability density function][pdf] (PDF) (CDF) of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 0.5, 0.5 ); -var y = mylogpdf( 0.8 ); +const mylogpdf = logpdf.factory( 0.5, 0.5 ); +let y = mylogpdf( 0.8 ); // returns ~-0.705 y = mylogpdf( 2.0 ); @@ -144,20 +144,14 @@ y = mylogpdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/pareto-type1/logpdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 8.0; - alpha = randu() * 4.0; - beta = randu() * 4.0; - y = logpdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/pareto-type1/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 8.0; + const alpha = randu() * 4.0; + const beta = randu() * 4.0; + const y = logpdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, ln(f(x;α,β)): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mean/README.md index bf22b8aaca85..2e29a26d9f05 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mean/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the scale parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/pareto-type1/mean' ); +const mean = require( '@stdlib/stats/base/dists/pareto-type1/mean' ); ``` #### mean( alpha, beta ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/pareto-type1/mean' ); Returns the [expected value][expected-value] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = mean( 2.0, 1.0 ); +let v = mean( 2.0, 1.0 ); // returns 2.0 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,14 +85,14 @@ v = mean( 2.0, NaN ); If provided `0 < alpha <= 1`, the function returns `+Infinity`. ```javascript -var v = mean( 0.8, 1.0 ); +const v = mean( 0.8, 1.0 ); // returns Infinity ``` If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -102,7 +102,7 @@ v = mean( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.0 ); +let v = mean( 1.0, 0.0 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -130,19 +130,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/pareto-type1/mean' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mean( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/pareto-type1/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mean( alpha, beta ); console.log( 'α: %d, β: %d, E(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/median/README.md index 9bdd89abf8de..f747f3a68d7b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/median/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the scale parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/pareto-type1/median' ); +const median = require( '@stdlib/stats/base/dists/pareto-type1/median' ); ``` #### median( alpha, beta ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/pareto-type1/median' ); Returns the [median][median] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = median( 2.0, 1.0 ); +let v = median( 2.0, 1.0 ); // returns ~1.414 v = median( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = median( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -85,7 +85,7 @@ v = median( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = median( 0.0, 1.0 ); +let v = median( 0.0, 1.0 ); // returns NaN v = median( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = median( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = median( 1.0, 0.0 ); +let v = median( 1.0, 0.0 ); // returns NaN v = median( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = median( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var median = require( '@stdlib/stats/base/dists/pareto-type1/median' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = median( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const median = require( '@stdlib/stats/base/dists/pareto-type1/median' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = median( alpha, beta ); console.log( 'α: %d, β: %d, Median(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mode/README.md index 105712ca0bd3..e6f4800fb5e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Pareto (Type I)][pareto-distribution] random variable wi ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/pareto-type1/mode' ); +const mode = require( '@stdlib/stats/base/dists/pareto-type1/mode' ); ``` #### mode( alpha, beta ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/pareto-type1/mode' ); Returns the [mode][mode] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = mode( 2.0, 1.0 ); +let v = mode( 2.0, 1.0 ); // returns 1.0 v = mode( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = mode( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -83,7 +83,7 @@ v = mode( 2.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -93,7 +93,7 @@ v = mode( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.0 ); +let v = mode( 1.0, 0.0 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -121,19 +121,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/pareto-type1/mode' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = mode( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/pareto-type1/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = mode( alpha, beta ); console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/pdf/README.md index f14188fc1fc5..04d0113958ff 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/pdf/README.md @@ -50,7 +50,7 @@ where `alpha > 0` is the shape parameter and `beta > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/pareto-type1/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/pareto-type1/pdf' ); ``` #### pdf( x, alpha, beta ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/pareto-type1/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var y = pdf( 4.0, 1.0, 1.0 ); +let y = pdf( 4.0, 1.0, 1.0 ); // returns ~0.063 y = pdf( 20.0, 1.0, 10.0 ); @@ -80,7 +80,7 @@ y = pdf( 1.5, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0, 1.0 ); +let y = pdf( NaN, 1.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -93,7 +93,7 @@ y = pdf( 0.0, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0, 0.5 ); +let y = pdf( 2.0, -1.0, 0.5 ); // returns NaN y = pdf( 2.0, 0.0, 0.5 ); @@ -103,7 +103,7 @@ y = pdf( 2.0, 0.0, 0.5 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.5, -1.0 ); +let y = pdf( 2.0, 0.5, -1.0 ); // returns NaN y = pdf( 2.0, 0.5, 0.0 ); @@ -115,8 +115,8 @@ y = pdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) (CDF) of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var mypdf = pdf.factory( 0.5, 0.5 ); -var y = mypdf( 0.8 ); +const mypdf = pdf.factory( 0.5, 0.5 ); +let y = mypdf( 0.8 ); // returns ~0.494 y = mypdf( 2.0 ); @@ -134,20 +134,14 @@ y = mypdf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/pareto-type1/pdf' ); - -var alpha; -var beta; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 8.0; - alpha = randu() * 4.0; - beta = randu() * 4.0; - y = pdf( x, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/pareto-type1/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 8.0; + const alpha = randu() * 4.0; + const beta = randu() * 4.0; + const y = pdf( x, alpha, beta ); console.log( 'x: %d, α: %d, β: %d, f(x;α,β): %d', x.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md index 99cc5d125829..59406c389394 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `alpha` is the shape parameter and `beta` is the scale p ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); ``` #### quantile( p, alpha, beta ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); Evaluates the [quantile function][quantile-function] for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` ( scale parameter). ```javascript -var y = quantile( 0.8, 2.0, 1.0 ); +let y = quantile( 0.8, 2.0, 1.0 ); // returns ~2.236 y = quantile( 0.8, 1.0, 10.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.1, 1.0, 10.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.5, NaN, 1.0 ); @@ -94,7 +94,7 @@ y = quantile( 0.5, 1.0, NaN ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +let y = quantile( 0.4, -1.0, 1.0 ); // returns NaN y = quantile( 0.4, 0.0, 1.0 ); @@ -104,7 +104,7 @@ y = quantile( 0.4, 0.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +let y = quantile( 0.4, 1.0, -1.0 ); // returns NaN y = quantile( 0.4, 1.0, 0.0 ); @@ -116,8 +116,8 @@ y = quantile( 0.4, 1.0, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` ( scale parameter). ```javascript -var myquantile = quantile.factory( 2.5, 0.5 ); -var y = myquantile( 0.5 ); +const myquantile = quantile.factory( 2.5, 0.5 ); +let y = myquantile( 0.5 ); // returns ~0.66 y = myquantile( 0.8 ); @@ -135,20 +135,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); - -var alpha; -var beta; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - alpha = randu() * 5.0; - beta = randu() * 5.0; - y = quantile( p, alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const alpha = randu() * 5.0; + const beta = randu() * 5.0; + const y = quantile( p, alpha, beta ); console.log( 'p: %d, α: %d, β: %d, Q(p;α,β): %d', p.toFixed( 4 ), alpha.toFixed( 4 ), beta.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/skewness/README.md index 93e23bf55e9c..f4c851762375 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/skewness/README.md @@ -54,7 +54,7 @@ for `α > 3` and `β > 0`. Otherwise, the skewness is not defined. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/pareto-type1/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/pareto-type1/skewness' ); ``` #### skewness( alpha, beta ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/pareto-type1/skewness' ); Returns the [skewness][skewness] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = skewness( 3.5, 1.0 ); +let v = skewness( 3.5, 1.0 ); // returns ~11.784 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 2.0, NaN ); If provided `alpha <= 3`, the function returns `NaN`. ```javascript -var v = skewness( 3.0, 1.0 ); +let v = skewness( 3.0, 1.0 ); // returns NaN v = skewness( 1.0, 3.0 ); @@ -101,7 +101,7 @@ v = skewness( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 0.0 ); +let v = skewness( 1.0, 0.0 ); // returns NaN v = skewness( 1.0, -1.0 ); @@ -129,19 +129,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/pareto-type1/skewness' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = skewness( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/pareto-type1/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = skewness( alpha, beta ); console.log( 'α: %d, β: %d, skew(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/stdev/README.md index bf2b07feddb3..656d80a795cc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/stdev/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the scale parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/pareto-type1/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/pareto-type1/stdev' ); ``` #### stdev( alpha, beta ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/pareto-type1/stdev' ); Returns the [standard deviation][standard-deviation] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = stdev( 2.5, 1.0 ); +let v = stdev( 2.5, 1.0 ); // returns ~1.491 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `0 < alpha <= 2`, the function returns `+Infinity`. ```javascript -var v = stdev( 0.5, 2.0 ); +let v = stdev( 0.5, 2.0 ); // returns Infinity v = stdev( 1.5, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( 1.5, 1.0 ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -105,7 +105,7 @@ v = stdev( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 0.0 ); +let v = stdev( 1.0, 0.0 ); // returns NaN v = stdev( 1.0, -1.0 ); @@ -133,19 +133,14 @@ v = stdev( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/pareto-type1/stdev' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = stdev( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/pareto-type1/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = stdev( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/variance/README.md index 0104e8dffa0c..dcc88c25c66c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/variance/README.md @@ -54,7 +54,7 @@ where `α > 0` is the shape parameter and `β > 0` is the scale parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/pareto-type1/variance' ); +const variance = require( '@stdlib/stats/base/dists/pareto-type1/variance' ); ``` #### variance( alpha, beta ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/pareto-type1/variance' ); Returns the [variance][variance] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript -var v = variance( 2.5, 1.0 ); +let v = variance( 2.5, 1.0 ); // returns ~2.222 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `0 < alpha <= 2`, the function returns `+Infinity`. ```javascript -var v = variance( 0.5, 2.0 ); +let v = variance( 0.5, 2.0 ); // returns Infinity v = variance( 1.5, 1.0 ); @@ -95,7 +95,7 @@ v = variance( 1.5, 1.0 ); If provided `alpha <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -105,7 +105,7 @@ v = variance( -1.0, 1.0 ); If provided `beta <= 0`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 0.0 ); +let v = variance( 1.0, 0.0 ); // returns NaN v = variance( 1.0, -1.0 ); @@ -133,19 +133,14 @@ v = variance( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/pareto-type1/variance' ); - -var alpha; -var beta; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - alpha = ( randu()*10.0 ) + EPS; - beta = ( randu()*10.0 ) + EPS; - v = variance( alpha, beta ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/pareto-type1/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const alpha = ( randu()*10.0 ) + EPS; + const beta = ( randu()*10.0 ) + EPS; + const v = variance( alpha, beta ); console.log( 'α: %d, β: %d, Var(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/README.md index 5b1dd2870c10..7c13d9a916bc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var poisson = require( '@stdlib/stats/base/dists/poisson' ); +const poisson = require( '@stdlib/stats/base/dists/poisson' ); ``` #### poisson @@ -35,7 +35,7 @@ var poisson = require( '@stdlib/stats/base/dists/poisson' ); Poisson distribution. ```javascript -var dist = poisson; +const dist = poisson; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [Poisson][poisson-d ```javascript -var Poisson = require( '@stdlib/stats/base/dists/poisson' ).Poisson; +const Poisson = require( '@stdlib/stats/base/dists/poisson' ).Poisson; -var dist = new Poisson( 2.0 ); +const dist = new Poisson( 2.0 ); -var y = dist.pmf( 3.0 ); +let y = dist.pmf( 3.0 ); // returns ~0.18 y = dist.pmf( 2.3 ); @@ -111,14 +111,14 @@ y = dist.pmf( 2.3 ); ```javascript -var poisson = require( '@stdlib/stats/base/dists/poisson' ); +const poisson = require( '@stdlib/stats/base/dists/poisson' ); /* * Let's take a customer service center example: average rate of customer inquiries is 3 per hour. * This situation can be modeled using a Poisson distribution with λ = 3 */ -var lambda = 3; +const lambda = 3; // Mean can be used to calculate the average number of inquiries per hour: console.log( poisson.mean( lambda ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/cdf/README.md index 11c1fa3661ab..9dde057bdc5a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/cdf/README.md @@ -50,7 +50,7 @@ where `lambda` is the mean parameter. Internally, the module evaluates the CDF b ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/poisson/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/poisson/cdf' ); ``` #### cdf( x, lambda ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/poisson/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var y = cdf( 2.0, 0.5 ); +let y = cdf( 2.0, 0.5 ); // returns ~0.986 y = cdf( 2.0, 10.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0 ); +let y = cdf( NaN, 1.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = cdf( 0.0, NaN ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +const y = cdf( 2.0, -1.0 ); // returns NaN ``` If provided `lambda = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( -2.0, 0.0 ); +let y = cdf( -2.0, 0.0 ); // returns 0.0 y = cdf( 0.0, 0.0 ); @@ -103,8 +103,8 @@ y = cdf( 10.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var mycdf = cdf.factory( 5.0 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 5.0 ); +let y = mycdf( 3.0 ); // returns ~0.265 y = mycdf( 8.0 ); @@ -122,18 +122,13 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/poisson/cdf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - y = cdf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/poisson/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const y = cdf( x, lambda ); console.log( 'x: %d, λ: %d, F(x;λ): %d', x.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/ctor/README.md index f2acab776c6a..5d9945cd7c81 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Poisson = require( '@stdlib/stats/base/dists/poisson/ctor' ); +const Poisson = require( '@stdlib/stats/base/dists/poisson/ctor' ); ``` #### Poisson( \[lambda] ) @@ -45,18 +45,18 @@ var Poisson = require( '@stdlib/stats/base/dists/poisson/ctor' ); Returns an [Poisson][poisson-distribution] distribution object. ```javascript -var poisson = new Poisson(); +const poisson = new Poisson(); -var lambda = poisson.mean; +const lambda = poisson.mean; // returns 1.0 ``` By default, `lambda = 1.0`. To create a distribution having a different mean parameter `lambda`, provide a parameter value. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var lambda = poisson.mean; +const lambda = poisson.mean; // returns 4.0 ``` @@ -73,9 +73,9 @@ A [Poisson][poisson-distribution] distribution object has the following properti Mean parameter of the distribution. `lambda` **must** be a positive number. ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var lambda = poisson.lambda; +let lambda = poisson.lambda; // returns 2.0 poisson.lambda = 3.0; @@ -93,9 +93,9 @@ lambda = poisson.lambda; Returns the [differential entropy][entropy]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var entropy = poisson.entropy; +const entropy = poisson.entropy; // returns ~2.087 ``` @@ -104,9 +104,9 @@ var entropy = poisson.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var kurtosis = poisson.kurtosis; +const kurtosis = poisson.kurtosis; // returns 0.25 ``` @@ -115,9 +115,9 @@ var kurtosis = poisson.kurtosis; Returns the [median][expected-value]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var mu = poisson.mean; +const mu = poisson.mean; // returns 4.0 ``` @@ -126,9 +126,9 @@ var mu = poisson.mean; Returns the [median][median]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var median = poisson.median; +const median = poisson.median; // returns 4.0 ``` @@ -137,9 +137,9 @@ var median = poisson.median; Returns the [mode][mode]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var mode = poisson.mode; +const mode = poisson.mode; // returns 4.0 ``` @@ -148,9 +148,9 @@ var mode = poisson.mode; Returns the [skewness][skewness]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var skewness = poisson.skewness; +const skewness = poisson.skewness; // returns 0.5 ``` @@ -159,9 +159,9 @@ var skewness = poisson.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var s = poisson.stdev; +const s = poisson.stdev; // returns 2.0 ``` @@ -170,9 +170,9 @@ var s = poisson.stdev; Returns the [variance][variance]. ```javascript -var poisson = new Poisson( 4.0 ); +const poisson = new Poisson( 4.0 ); -var s2 = poisson.variance; +const s2 = poisson.variance; // returns 4.0 ``` @@ -185,9 +185,9 @@ var s2 = poisson.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var y = poisson.cdf( 0.5 ); +const y = poisson.cdf( 0.5 ); // returns ~0.135 ``` @@ -196,9 +196,9 @@ var y = poisson.cdf( 0.5 ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF). ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var y = poisson.logpmf( 3.0 ); +let y = poisson.logpmf( 3.0 ); // returns ~-1.712 y = poisson.logpmf( 2.3 ); @@ -210,9 +210,9 @@ y = poisson.logpmf( 2.3 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var y = poisson.mgf( 0.5 ); +const y = poisson.mgf( 0.5 ); // returns ~3.66 ``` @@ -221,9 +221,9 @@ var y = poisson.mgf( 0.5 ); Evaluates the [probability mass function][pmf] (PMF). ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var y = poisson.pmf( 3.0 ); +let y = poisson.pmf( 3.0 ); // returns ~0.18 y = poisson.pmf( 2.3 ); @@ -235,9 +235,9 @@ y = poisson.pmf( 2.3 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var y = poisson.quantile( 0.5 ); +let y = poisson.quantile( 0.5 ); // returns 2.0 y = poisson.quantile( 1.9 ); @@ -267,20 +267,20 @@ y = poisson.quantile( 1.9 ); ```javascript -var Poisson = require( '@stdlib/stats/base/dists/poisson/ctor' ); +const Poisson = require( '@stdlib/stats/base/dists/poisson/ctor' ); -var poisson = new Poisson( 2.0 ); +const poisson = new Poisson( 2.0 ); -var mu = poisson.mean; +const mu = poisson.mean; // returns 2.0 -var mode = poisson.mode; +const mode = poisson.mode; // returns 2.0 -var s2 = poisson.variance; +const s2 = poisson.variance; // returns 2.0 -var y = poisson.cdf( 0.8 ); +const y = poisson.cdf( 0.8 ); // returns ~0.135 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/entropy/README.md index 291dd34eea14..1fa3cf1711eb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/entropy/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/poisson/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/poisson/entropy' ); ``` #### entropy( lambda ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/poisson/entropy' ); Returns the [entropy][entropy] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda` (in [nats][nats]). ```javascript -var v = entropy( 9.0 ); +let v = entropy( 9.0 ); // returns ~2.508 v = entropy( 0.5 ); @@ -72,7 +72,7 @@ v = entropy( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = entropy( -1.0 ); +const v = entropy( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/poisson/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/poisson/entropy' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = entropy( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = entropy( lambda ); console.log( 'λ: %d, H(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/kurtosis/README.md index d0d1534d95ae..3ef80cb04922 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/kurtosis/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/poisson/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/poisson/kurtosis' ); ``` #### kurtosis( lambda ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/poisson/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = kurtosis( 9.0 ); +let v = kurtosis( 9.0 ); // returns ~0.111 v = kurtosis( 0.5 ); @@ -72,7 +72,7 @@ v = kurtosis( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = kurtosis( -1.0 ); +const v = kurtosis( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/poisson/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/poisson/kurtosis' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = kurtosis( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = kurtosis( lambda ); console.log( 'λ: %d, Kurt(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/README.md index e8cb1e0f0695..264a9f935e45 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` is the mean parameter. ## Usage ```javascript -var logpmf = require( '@stdlib/stats/base/dists/poisson/logpmf' ); +const logpmf = require( '@stdlib/stats/base/dists/poisson/logpmf' ); ``` #### logpmf( x, lambda ) @@ -58,7 +58,7 @@ var logpmf = require( '@stdlib/stats/base/dists/poisson/logpmf' ); Evaluates the natural logarithm of the [probability mass function][pmf] (PMF) for a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var y = logpmf( 4.0, 3.0 ); +let y = logpmf( 4.0, 3.0 ); // returns ~-1.784 y = logpmf( 1.0, 3.0 ); @@ -71,7 +71,7 @@ y = logpmf( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpmf( NaN, 2.0 ); +let y = logpmf( NaN, 2.0 ); // returns NaN y = logpmf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = logpmf( 0.0, NaN ); If provided a negative mean parameter `lambda`, the function returns `NaN`. ```javascript -var y = logpmf( 2.0, -1.0 ); +let y = logpmf( 2.0, -1.0 ); // returns NaN y = logpmf( 4.0, -2.0 ); @@ -91,7 +91,7 @@ y = logpmf( 4.0, -2.0 ); If provided `lambda = 0`, the function evaluates the natural logarithm of the [PMF][pmf] of a [degenerate distribution][degenerate-distribution] centered at `0.0`. ```javascript -var y = logpmf( 2.0, 0.0 ); +let y = logpmf( 2.0, 0.0 ); // returns -Infinity y = logpmf( 0.0, 0.0 ); @@ -103,8 +103,8 @@ y = logpmf( 0.0, 0.0 ); Returns a function for evaluating the natural logarithm of the [probability mass function][pmf] (PMF) for a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var mylogpmf = logpmf.factory( 1.0 ); -var y = mylogpmf( 3.0 ); +const mylogpmf = logpmf.factory( 1.0 ); +let y = mylogpmf( 3.0 ); // returns ~-2.792 y = mylogpmf( 1.0 ); @@ -122,19 +122,14 @@ y = mylogpmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var logpmf = require( '@stdlib/stats/base/dists/poisson/logpmf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 10.0 ); - lambda = randu() * 10.0; - y = logpmf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const logpmf = require( '@stdlib/stats/base/dists/poisson/logpmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 10.0 ); + const lambda = randu() * 10.0; + const y = logpmf( x, lambda ); console.log( 'x: %d, λ: %d, ln(P(X=x;λ)): %d', x, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/mean/README.md index 513f1d484eb0..445d3152fb32 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/mean/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/poisson/mean' ); +const mean = require( '@stdlib/stats/base/dists/poisson/mean' ); ``` #### mean( lambda ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/poisson/mean' ); Returns the [expected value][expected-value] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = mean( 9.0 ); +let v = mean( 9.0 ); // returns 9.0 v = mean( 0.5 ); @@ -72,7 +72,7 @@ v = mean( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = mean( -1.0 ); +const v = mean( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mean( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/poisson/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/poisson/mean' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = mean( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = mean( lambda ); console.log( 'λ: %d, E(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/median/README.md index b4f9f8f90807..ad07b9837889 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/median/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/poisson/median' ); +const median = require( '@stdlib/stats/base/dists/poisson/median' ); ``` #### median( lambda ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/poisson/median' ); Returns the [median][median] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = median( 9.0 ); +let v = median( 9.0 ); // returns 9 v = median( 0.5 ); @@ -72,7 +72,7 @@ v = median( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = median( -1.0 ); +const v = median( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/poisson/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/poisson/median' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = median( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = median( lambda ); console.log( 'λ: %d, Median(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/README.md index 116534d1bba7..34f470acc8eb 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/README.md @@ -54,7 +54,7 @@ where `lambda > 0` is the mean parameter. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/poisson/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/poisson/mgf' ); ``` #### mgf( t, lambda ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/poisson/mgf' ); Evaluates the moment-generating function ([MGF][mgf]) for a [Poisson][poisson-distribution] distribution with parameter `lambda` (mean). ```javascript -var y = mgf( 1.0, 1.5 ); +let y = mgf( 1.0, 1.5 ); // returns ~13.163 y = mgf( 0.5, 0.5 ); @@ -72,7 +72,7 @@ y = mgf( 0.5, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.5 ); +let y = mgf( NaN, 0.5 ); // returns NaN y = mgf( 0.0, NaN ); @@ -82,7 +82,7 @@ y = mgf( 0.0, NaN ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = mgf( -2.0, -1.0 ); +let y = mgf( -2.0, -1.0 ); // returns NaN y = mgf( 0.1, 0.0 ); @@ -94,8 +94,8 @@ y = mgf( 0.1, 0.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [Poisson][poisson-distribution] distribution with parameter `lambda` (mean). ```javascript -var mymgf = mgf.factory( 2.0 ); -var y = mymgf( 0.1 ); +const mymgf = mgf.factory( 2.0 ); +const y = mymgf( 0.1 ); // returns ~1.234 ``` @@ -120,18 +120,13 @@ var y = mymgf( 0.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/poisson/mgf' ); - -var lambda; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 5.0; - lambda = randu() * 5.0; - y = mgf( t, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/poisson/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 5.0; + const lambda = randu() * 5.0; + const y = mgf( t, lambda ); console.log( 'x: %d, λ: %d, M_X(t;λ): %d', t.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/mode/README.md index 242d440a11b7..9a4feced42cf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/mode/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/poisson/mode' ); +const mode = require( '@stdlib/stats/base/dists/poisson/mode' ); ``` #### mode( lambda ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/poisson/mode' ); Returns the [mode][mode] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = mode( 9.0 ); +let v = mode( 9.0 ); // returns 9 v = mode( 0.5 ); @@ -72,7 +72,7 @@ v = mode( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = mode( -1.0 ); +const v = mode( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/poisson/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/poisson/mode' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = mode( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = mode( lambda ); console.log( 'λ: %d, mode(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/pmf/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/pmf/README.md index 78b9905b2073..a3100fc97dfa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/pmf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/pmf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` is the mean parameter. ## Usage ```javascript -var pmf = require( '@stdlib/stats/base/dists/poisson/pmf' ); +const pmf = require( '@stdlib/stats/base/dists/poisson/pmf' ); ``` #### pmf( x, lambda ) @@ -58,7 +58,7 @@ var pmf = require( '@stdlib/stats/base/dists/poisson/pmf' ); Evaluates the [probability mass function][pmf] (PMF) of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var y = pmf( 4.0, 3.0 ); +let y = pmf( 4.0, 3.0 ); // returns ~0.168 y = pmf( 1.0, 3.0 ); @@ -71,7 +71,7 @@ y = pmf( -1.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pmf( NaN, 2.0 ); +let y = pmf( NaN, 2.0 ); // returns NaN y = pmf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = pmf( 0.0, NaN ); If provided a negative mean parameter `lambda`, the function returns `NaN`. ```javascript -var y = pmf( 2.0, -1.0 ); +let y = pmf( 2.0, -1.0 ); // returns NaN y = pmf( 4.0, -2.0 ); @@ -91,7 +91,7 @@ y = pmf( 4.0, -2.0 ); If provided `lambda = 0`, the function evaluates the [PMF][pmf] of a [degenerate distribution][degenerate-distribution] centered at `0.0`. ```javascript -var y = pmf( 2.0, 0.0 ); +let y = pmf( 2.0, 0.0 ); // returns 0.0 y = pmf( 0.0, 0.0 ); @@ -103,8 +103,8 @@ y = pmf( 0.0, 0.0 ); Returns a function for evaluating the [probability mass function][pmf] (PMF) of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var mypmf = pmf.factory( 1.0 ); -var y = mypmf( 3.0 ); +const mypmf = pmf.factory( 1.0 ); +let y = mypmf( 3.0 ); // returns ~0.061 y = mypmf( 1.0 ); @@ -122,19 +122,14 @@ y = mypmf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pmf = require( '@stdlib/stats/base/dists/poisson/pmf' ); - -var lambda; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = round( randu() * 10.0 ); - lambda = randu() * 10.0; - y = pmf( x, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pmf = require( '@stdlib/stats/base/dists/poisson/pmf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = round( randu() * 10.0 ); + const lambda = randu() * 10.0; + const y = pmf( x, lambda ); console.log( 'x: %d, λ: %d, P(X=x;λ): %d', x, lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/quantile/README.md index 7db86cf2b8ee..0e123178e950 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/quantile/README.md @@ -50,7 +50,7 @@ where `F` is the cumulative distribution function (CDF) of a Poisson distributio ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/poisson/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/poisson/quantile' ); ``` #### quantile( p, lambda ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/poisson/quantile' ); Evaluates the [quantile function][quantile-function] for a [Poisson][poisson-distribution] distribution with mean parameter `lambda` at a probability `p`. ```javascript -var y = quantile( 0.5, 2.0 ); +let y = quantile( 0.5, 2.0 ); // returns 2 y = quantile( 0.9, 4.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.1, 200.0 ); If provided an input probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.5 ); +let y = quantile( 1.9, 0.5 ); // returns NaN y = quantile( -0.1, 0.5 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN ); @@ -91,14 +91,14 @@ y = quantile( 0.0, NaN ); If provided a negative `lambda`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +const y = quantile( 0.4, -1.0 ); // returns NaN ``` If provided `lambda = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0.0`. ```javascript -var y = quantile( 0.1, 0.0 ); +let y = quantile( 0.1, 0.0 ); // returns 0.0 y = quantile( 0.9, 0.0 ); @@ -110,8 +110,8 @@ y = quantile( 0.9, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var myquantile = quantile.factory( 5.0 ); -var y = myquantile( 0.4 ); +const myquantile = quantile.factory( 5.0 ); +let y = myquantile( 0.4 ); // returns 4 y = myquantile( 0.8 ); @@ -132,18 +132,13 @@ y = myquantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/poisson/quantile' ); - -var lambda; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - lambda = randu() * 10.0; - y = quantile( p, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/poisson/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const lambda = randu() * 10.0; + const y = quantile( p, lambda ); console.log( 'p: %d, λ: %d, Q(p;λ): %d', p.toFixed( 4 ), lambda.toFixed( 4 ), y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/skewness/README.md index 0170ca56ff8f..94c4c843b9b6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/skewness/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/poisson/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/poisson/skewness' ); ``` #### skewness( lambda ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/poisson/skewness' ); Returns the [skewness][skewness] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = skewness( 9.0 ); +let v = skewness( 9.0 ); // returns ~0.333 v = skewness( 0.5 ); @@ -72,7 +72,7 @@ v = skewness( 0.5 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = skewness( -1.0 ); +const v = skewness( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/poisson/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/poisson/skewness' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = skewness( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = skewness( lambda ); console.log( 'λ: %d, skew(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/stdev/README.md index ff55d8e8a197..048676babfd9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/stdev/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/poisson/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/poisson/stdev' ); ``` #### stdev( lambda ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/poisson/stdev' ); Returns the [standard deviation][standard-deviation] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = stdev( 9.0 ); +let v = stdev( 9.0 ); // returns 3.0 v = stdev( 0.5 ); @@ -72,7 +72,7 @@ v = stdev( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = stdev( -1.0 ); +const v = stdev( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/poisson/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/poisson/stdev' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = stdev( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = stdev( lambda ); console.log( 'λ: %d, SD(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/poisson/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/poisson/variance/README.md index 6d3d87bb667e..7dd973e18184 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/poisson/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/poisson/variance/README.md @@ -54,7 +54,7 @@ where `λ` is the mean parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/poisson/variance' ); +const variance = require( '@stdlib/stats/base/dists/poisson/variance' ); ``` #### variance( lambda ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/poisson/variance' ); Returns the [variance][variance] of a [Poisson][poisson-distribution] distribution with mean parameter `lambda`. ```javascript -var v = variance( 9.0 ); +let v = variance( 9.0 ); // returns 9.0 v = variance( 0.5 ); @@ -72,7 +72,7 @@ v = variance( 0.5 ); If provided `lambda < 0`, the function returns `NaN`. ```javascript -var v = variance( -1.0 ); +const v = variance( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var v = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/poisson/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/poisson/variance' ); -var lambda; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - lambda = randu() * 20.0; - v = variance( lambda ); +for ( let i = 0; i < 10; i++ ) { + const lambda = randu() * 20.0; + const v = variance( lambda ); console.log( 'λ: %d, Var(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/README.md index 5a601a6e8e78..5e4b9d924ca2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); +const rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); ``` #### rayleigh @@ -35,7 +35,7 @@ var rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); Rayleigh distribution. ```javascript -var dist = rayleigh; +const dist = rayleigh; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [Rayleigh][rayleigh ```javascript -var Rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ).Rayleigh; +const Rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ).Rayleigh; -var dist = new Rayleigh( 2.0 ); +const dist = new Rayleigh( 2.0 ); -var y = dist.pdf( 0.8 ); +const y = dist.pdf( 0.8 ); // returns ~0.185 ``` @@ -109,7 +109,7 @@ var y = dist.pdf( 0.8 ); ```javascript -var rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); +const rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); /* * The Rayleigh distribution can be used to model wind speeds. @@ -117,7 +117,7 @@ var rayleigh = require( '@stdlib/stats/base/dists/rayleigh' ); */ // Set the Rayleigh distribution parameter (scale parameter): -var s = 10.0; +const s = 10.0; // Calculate mean, variance, and standard deviation of the Rayleigh distribution: console.log( rayleigh.mean( s ) ); @@ -130,21 +130,21 @@ console.log( rayleigh.stdev( s ) ); // => ~6.551 // Evaluate the Probability Density Function (PDF) for a specific wind speed: -var w = 15.0; +const w = 15.0; console.log( rayleigh.pdf( w, s ) ); // => ~0.049 // Determine Cumulative Distribution Function (CDF) for wind speeds up to a certain value: -var t = 15.0; +const t = 15.0; console.log( rayleigh.cdf( t, s ) ); // => ~0.675 // Calculate the probability of wind speeds exceeding the threshold: -var p = 1.0 - rayleigh.cdf( t, s ); +const p = 1.0 - rayleigh.cdf( t, s ); console.log( 'Probability of wind speeds exceeding ' + t + ' m/s:', p ); // Find the wind speed at which there's a 70% chance it won't exceed using the Quantile function: -var c = 0.7; +const c = 0.7; console.log( rayleigh.quantile( c, s ) ); // => ~15.518 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/cdf/README.md index 83a32847137c..e8c43014a8c3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/cdf/README.md @@ -50,7 +50,7 @@ where `sigma > 0` is the scale parameter. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/rayleigh/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/rayleigh/cdf' ); ``` #### cdf( x, sigma ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/rayleigh/cdf' ); Evaluates the [cumulative distribution function][cdf] for a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = cdf( 2.0, 3.0 ); +let y = cdf( 2.0, 3.0 ); // returns ~0.199 y = cdf( 1.0, 2.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0 ); +let y = cdf( NaN, 1.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = cdf( 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +const y = cdf( 2.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = cdf( -2.0, 0.0 ); +let y = cdf( -2.0, 0.0 ); // returns 0.0 y = cdf( 0.0, 0.0 ); @@ -103,7 +103,7 @@ y = cdf( 2.0, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var myCDF = cdf.factory( 0.5 ); +const myCDF = cdf.factory( 0.5 ); y = myCDF( 1.0 ); // returns ~0.865 @@ -122,18 +122,13 @@ y = myCDF( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/rayleigh/cdf' ); - -var sigma; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - sigma = randu() * 10.0; - y = cdf( x, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/rayleigh/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const sigma = randu() * 10.0; + const y = cdf( x, sigma ); console.log( 'x: %d, σ: %d, F(x;σ): %d', x.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/ctor/README.md index 253a2bcfec38..ad4fe0664f34 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Rayleigh = require( '@stdlib/stats/base/dists/rayleigh/ctor' ); +const Rayleigh = require( '@stdlib/stats/base/dists/rayleigh/ctor' ); ``` #### Rayleigh( \[sigma] ) @@ -45,18 +45,18 @@ var Rayleigh = require( '@stdlib/stats/base/dists/rayleigh/ctor' ); Returns an [Rayleigh][rayleigh-distribution] distribution object. ```javascript -var rayleigh = new Rayleigh(); +const rayleigh = new Rayleigh(); -var mu = rayleigh.mean; +const mu = rayleigh.mean; // returns ~1.253 ``` By default, `sigma = 1.0`. To create a distribution having a different scale parameter `sigma`, provide a parameter value. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var mu = rayleigh.mean; +const mu = rayleigh.mean; // returns ~5.013 ``` @@ -73,9 +73,9 @@ A [Rayleigh][rayleigh-distribution] distribution object has the following proper Scale parameter of the distribution. `sigma` **must** be a positive number. ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var sigma = rayleigh.sigma; +let sigma = rayleigh.sigma; // returns 2.0 rayleigh.sigma = 3.0; @@ -93,9 +93,9 @@ sigma = rayleigh.sigma; Returns the [differential entropy][entropy]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var entropy = rayleigh.entropy; +const entropy = rayleigh.entropy; // returns ~2.328 ``` @@ -104,9 +104,9 @@ var entropy = rayleigh.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var kurtosis = rayleigh.kurtosis; +const kurtosis = rayleigh.kurtosis; // returns ~0.245 ``` @@ -115,9 +115,9 @@ var kurtosis = rayleigh.kurtosis; Returns the [median][expected-value]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var mu = rayleigh.mean; +const mu = rayleigh.mean; // returns ~5.013 ``` @@ -126,9 +126,9 @@ var mu = rayleigh.mean; Returns the [median][median]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var median = rayleigh.median; +const median = rayleigh.median; // returns ~4.71 ``` @@ -137,9 +137,9 @@ var median = rayleigh.median; Returns the [mode][mode]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var mode = rayleigh.mode; +const mode = rayleigh.mode; // returns 4.0 ``` @@ -148,9 +148,9 @@ var mode = rayleigh.mode; Returns the [skewness][skewness]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var skewness = rayleigh.skewness; +const skewness = rayleigh.skewness; // returns ~0.631 ``` @@ -159,9 +159,9 @@ var skewness = rayleigh.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var s = rayleigh.stdev; +const s = rayleigh.stdev; // returns ~2.62 ``` @@ -170,9 +170,9 @@ var s = rayleigh.stdev; Returns the [variance][variance]. ```javascript -var rayleigh = new Rayleigh( 4.0 ); +const rayleigh = new Rayleigh( 4.0 ); -var s2 = rayleigh.variance; +const s2 = rayleigh.variance; // returns ~6.867 ``` @@ -185,9 +185,9 @@ var s2 = rayleigh.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.cdf( 1.5 ); +const y = rayleigh.cdf( 1.5 ); // returns ~0.245 ``` @@ -196,9 +196,9 @@ var y = rayleigh.cdf( 1.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.logcdf( 1.5 ); +const y = rayleigh.logcdf( 1.5 ); // returns ~-1.406 ``` @@ -207,9 +207,9 @@ var y = rayleigh.logcdf( 1.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.logpdf( 0.8 ); +const y = rayleigh.logpdf( 0.8 ); // returns ~-1.689 ``` @@ -218,9 +218,9 @@ var y = rayleigh.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.mgf( 0.5 ); +const y = rayleigh.mgf( 0.5 ); // returns ~5.586 ``` @@ -229,9 +229,9 @@ var y = rayleigh.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.pdf( 0.8 ); +const y = rayleigh.pdf( 0.8 ); // returns ~0.185 ``` @@ -240,9 +240,9 @@ var y = rayleigh.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var rayleigh = new Rayleigh( 2.0 ); +const rayleigh = new Rayleigh( 2.0 ); -var y = rayleigh.quantile( 0.5 ); +let y = rayleigh.quantile( 0.5 ); // returns ~2.355 y = rayleigh.quantile( 1.9 ); @@ -272,20 +272,20 @@ y = rayleigh.quantile( 1.9 ); ```javascript -var Rayleigh = require( '@stdlib/stats/base/dists/rayleigh/ctor' ); +const Rayleigh = require( '@stdlib/stats/base/dists/rayleigh/ctor' ); -var rayleigh = new Rayleigh( 2.0, 4.0 ); +const rayleigh = new Rayleigh( 2.0, 4.0 ); -var mu = rayleigh.mean; +const mu = rayleigh.mean; // returns ~2.507 -var mode = rayleigh.mode; +const mode = rayleigh.mode; // returns 2.0 -var s2 = rayleigh.variance; +const s2 = rayleigh.variance; // returns ~1.717 -var y = rayleigh.cdf( 0.8 ); +const y = rayleigh.cdf( 0.8 ); // returns ~0.077 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/entropy/README.md index f5227849fe7c..7951d82ae048 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/entropy/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/rayleigh/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/rayleigh/entropy' ); ``` #### entropy( sigma ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/rayleigh/entropy' ); Returns the [differential entropy][entropy] of a [Rayleigh][rayleigh-distribution] distribution with scale `sigma` (in [nats][nats]). ```javascript -var y = entropy( 9.0 ); +let y = entropy( 9.0 ); // returns ~3.139 y = entropy( 3.5 ); @@ -72,7 +72,7 @@ y = entropy( 3.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = entropy( -1.0 ); +const y = entropy( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = entropy( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/rayleigh/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/rayleigh/entropy' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = entropy( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = entropy( sigma ); console.log( 'sigma: %d, h(X,v): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/kurtosis/README.md index 0ec490d12824..7146bb1971b7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/kurtosis/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/rayleigh/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/rayleigh/kurtosis' ); ``` #### kurtosis( sigma ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/rayleigh/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = kurtosis( 9.0 ); +let y = kurtosis( 9.0 ); // returns ~0.245 y = kurtosis( 4.5 ); @@ -72,7 +72,7 @@ y = kurtosis( 4.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = kurtosis( -1.0 ); +const y = kurtosis( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = kurtosis( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/rayleigh/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/rayleigh/kurtosis' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = kurtosis( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = kurtosis( sigma ); console.log( 'σ: %d, Kurt(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logcdf/README.md index 80894517f49d..a34869b6d8f5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logcdf/README.md @@ -50,7 +50,7 @@ where `sigma > 0` is the scale parameter. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/rayleigh/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/rayleigh/logcdf' ); ``` #### logcdf( x, sigma ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/rayleigh/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] for a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = logcdf( 2.0, 3.0 ); +let y = logcdf( 2.0, 3.0 ); // returns ~-1.613 y = logcdf( 1.0, 2.0 ); @@ -71,7 +71,7 @@ y = logcdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0 ); +let y = logcdf( NaN, 1.0 ); // returns NaN y = logcdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = logcdf( 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0 ); +const y = logcdf( 2.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the logarithm of the [CDF][cdf] for a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logcdf( -2.0, 0.0 ); +let y = logcdf( -2.0, 0.0 ); // returns -Infinity y = logcdf( 0.0, 0.0 ); @@ -103,7 +103,7 @@ y = logcdf( 2.0, 0.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var mylogCDF = logcdf.factory( 0.5 ); +const mylogCDF = logcdf.factory( 0.5 ); y = mylogCDF( 1.0 ); // returns ~-0.145 @@ -132,18 +132,13 @@ y = mylogCDF( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/rayleigh/logcdf' ); - -var sigma; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - sigma = randu() * 10.0; - y = logcdf( x, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/rayleigh/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const sigma = randu() * 10.0; + const y = logcdf( x, sigma ); console.log( 'x: %d, σ: %d, log(F(x;σ)): %d', x.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logpdf/README.md index ead9028b0838..3db5d9480b17 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/logpdf/README.md @@ -50,7 +50,7 @@ where `sigma > 0` is the scale parameter. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/rayleigh/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/rayleigh/logpdf' ); ``` #### logpdf( x, sigma ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/rayleigh/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] for a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = logpdf( 0.3, 1.0 ); +let y = logpdf( 0.3, 1.0 ); // returns ~-1.249 y = logpdf( 2.0, 0.8 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0 ); +let y = logpdf( NaN, 1.0 ); // returns NaN y = logpdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = logpdf( 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -1.0 ); +const y = logpdf( 2.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = logpdf( -2.0, 0.0 ); +let y = logpdf( -2.0, 0.0 ); // returns -Infinity y = logpdf( 0.0, 0.0 ); @@ -103,9 +103,9 @@ y = logpdf( 2.0, 0.0 ); Returns a function for evaluating the logarithm of the [probability density function][pdf] (PDF) of a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var mylogpdf = logpdf.factory( 4.0 ); +const mylogpdf = logpdf.factory( 4.0 ); -var y = mylogpdf( 6.0 ); +let y = mylogpdf( 6.0 ); // returns ~-2.106 y = mylogpdf( 4.0 ); @@ -133,18 +133,13 @@ y = mylogpdf( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/rayleigh/logpdf' ); - -var sigma; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - sigma = randu() * 10.0; - y = logpdf( x, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/rayleigh/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const sigma = randu() * 10.0; + const y = logpdf( x, sigma ); console.log( 'x: %d, σ: %d, f(x;σ): %d', x.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mean/README.md index f5c429e3c6f2..d029b5b6b0d2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mean/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/rayleigh/mean' ); +const mean = require( '@stdlib/stats/base/dists/rayleigh/mean' ); ``` #### mean( sigma ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/rayleigh/mean' ); Returns the [expected value][expected-value] of a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = mean( 9.0 ); +let y = mean( 9.0 ); // returns ~11.28 y = mean( 1.5 ); @@ -72,7 +72,7 @@ y = mean( 1.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = mean( -1.0 ); +let y = mean( -1.0 ); // returns NaN y = mean( -0.1 ); @@ -100,17 +100,13 @@ y = mean( -0.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/rayleigh/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/rayleigh/mean' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = mean( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = mean( sigma ); console.log( 'σ: %d, E(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/median/README.md index 07db6a790b4a..d7a2c932405a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/median/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/rayleigh/median' ); +const median = require( '@stdlib/stats/base/dists/rayleigh/median' ); ``` #### median( sigma ) @@ -63,7 +63,7 @@ Returns the [median][median] of a [Rayleigh][rayleigh-distribution] distribution parameter `sigma`. ```javascript -var y = median( 9.0 ); +let y = median( 9.0 ); // returns ~10.597 y = median( 1.5 ); @@ -73,7 +73,7 @@ y = median( 1.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = median( -1.0 ); +const y = median( -1.0 ); // returns NaN ``` @@ -100,17 +100,13 @@ var y = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/rayleigh/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/rayleigh/median' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = median( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = median( sigma ); console.log( 'σ: %d, Median(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mgf/README.md index 359c6249d107..039bf81a5ea7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mgf/README.md @@ -54,7 +54,7 @@ where `sigma > 0` is the scale parameter. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/rayleigh/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/rayleigh/mgf' ); ``` #### mgf( t, sigma ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/rayleigh/mgf' ); Evaluates the [moment-generating function][mgf] for a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = mgf( 1.0, 3.0 ); +let y = mgf( 1.0, 3.0 ); // returns ~678.508 y = mgf( 1.0, 2.0 ); @@ -75,7 +75,7 @@ y = mgf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1.0 ); +let y = mgf( NaN, 1.0 ); // returns NaN y = mgf( 0.0, NaN ); @@ -85,7 +85,7 @@ y = mgf( 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, -1.0 ); +const y = mgf( 0.5, -1.0 ); // returns NaN ``` @@ -94,8 +94,8 @@ var y = mgf( 0.5, -1.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var myMGF = mgf.factory( 0.5 ); -var y = myMGF( 1.0 ); +const myMGF = mgf.factory( 0.5 ); +let y = myMGF( 1.0 ); // returns ~2.715 y = myMGF( 0.5 ); @@ -123,18 +123,13 @@ y = myMGF( 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/rayleigh/mgf' ); - -var sigma; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - sigma = randu() * 5.0; - y = mgf( t, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/rayleigh/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const sigma = randu() * 5.0; + const y = mgf( t, sigma ); console.log( 't: %d, σ: %d, M_X(t;σ): %d', t.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mode/README.md index 844460260f57..f3ece7ca5951 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/mode/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/rayleigh/mode' ); +const mode = require( '@stdlib/stats/base/dists/rayleigh/mode' ); ``` #### mode( sigma ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/rayleigh/mode' ); Returns the [mode][mode] of a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = mode( 9.0 ); +let y = mode( 9.0 ); // returns 9.0 y = mode( 1.5 ); @@ -72,7 +72,7 @@ y = mode( 1.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = mode( -1.0 ); +const y = mode( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/rayleigh/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/rayleigh/mode' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = mode( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = mode( sigma ); console.log( 'σ: %d, mode(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/pdf/README.md index 5c60971ddb0b..b00631b123b5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/pdf/README.md @@ -50,7 +50,7 @@ where `sigma > 0` is the scale parameter. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/rayleigh/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/rayleigh/pdf' ); ``` #### pdf( x, sigma ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/rayleigh/pdf' ); Evaluates the [probability density function][pdf] for a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = pdf( 0.3, 1.0 ); +let y = pdf( 0.3, 1.0 ); // returns ~0.287 y = pdf( 2.0, 0.8 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0 ); +let y = pdf( NaN, 1.0 ); // returns NaN y = pdf( 0.0, NaN ); @@ -81,14 +81,14 @@ y = pdf( 0.0, NaN ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0 ); +const y = pdf( 2.0, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = pdf( -2.0, 0.0 ); +let y = pdf( -2.0, 0.0 ); // returns 0.0 y = pdf( 0.0, 0.0 ); @@ -103,9 +103,9 @@ y = pdf( 2.0, 0.0 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var myPDF = pdf.factory( 4.0 ); +const myPDF = pdf.factory( 4.0 ); -var y = myPDF( 6.0 ); +let y = myPDF( 6.0 ); // returns ~0.122 y = myPDF( 4.0 ); @@ -123,18 +123,13 @@ y = myPDF( 4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/rayleigh/pdf' ); - -var sigma; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - sigma = randu() * 10.0; - y = pdf( x, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/rayleigh/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const sigma = randu() * 10.0; + const y = pdf( x, sigma ); console.log( 'x: %d, σ: %d, f(x;σ): %d', x.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/README.md index 947647cd9cea..45191cf5357a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `sigma > 0` is the scale parameter. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/rayleigh/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/rayleigh/quantile' ); ``` #### quantile( p, sigma ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/rayleigh/quantile' ); Evaluates the [quantile function][quantile-function] for a [Rayleigh][rayleigh-distribution] distribution with parameter `sigma` (scale parameter). ```javascript -var y = quantile( 0.8, 1.0 ); +let y = quantile( 0.8, 1.0 ); // returns ~1.794 y = quantile( 0.5, 4.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0 ); +let y = quantile( 1.9, 1.0 ); // returns NaN y = quantile( -0.1, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN); @@ -88,14 +88,14 @@ y = quantile( 0.0, NaN); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +const y = quantile( 0.4, -1.0 ); // returns NaN ``` If provided `sigma = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. ```javascript -var y = quantile( 0.3, 0.0 ); +let y = quantile( 0.3, 0.0 ); // returns 0.0 y = quantile( 0.9, 0.0 ); @@ -107,7 +107,7 @@ y = quantile( 0.9, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var myQuantile = quantile.factory( 0.4 ); +const myQuantile = quantile.factory( 0.4 ); y = myQuantile( 0.4 ); // returns ~0.404 @@ -127,18 +127,13 @@ y = myQuantile( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/rayleigh/quantile' ); - -var sigma; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - sigma = randu() * 10.0; - y = quantile( p, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/rayleigh/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const sigma = randu() * 10.0; + const y = quantile( p, sigma ); console.log( 'p: %d, σ: %d, Q(p;σ): %d', p.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/skewness/README.md index 7eb11e710dd9..b3fb43dca642 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/skewness/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/rayleigh/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/rayleigh/skewness' ); ``` #### skewness( sigma ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/rayleigh/skewness' ); Returns the [skewness][skewness] of a [Rayleigh][rayleigh-distribution] distribution with scale parameter `sigma`. ```javascript -var y = skewness( 9.0 ); +let y = skewness( 9.0 ); // returns ~0.631 y = skewness( 3.5 ); @@ -72,7 +72,7 @@ y = skewness( 3.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = skewness( -1.0 ); +const y = skewness( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = skewness( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/rayleigh/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/rayleigh/skewness' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = skewness( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = skewness( sigma ); console.log( 'σ: %d, skew(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/stdev/README.md index 3d70d584d0fa..b81a6f27ea15 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/stdev/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/rayleigh/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/rayleigh/stdev' ); ``` #### stdev( sigma ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/rayleigh/stdev' ); Returns the [standard deviation][standard-deviation] of a [Rayleigh][rayleigh-distribution] distribution with scale `sigma`. ```javascript -var y = stdev( 9.0 ); +let y = stdev( 9.0 ); // returns ~5.896 y = stdev( 3.5 ); @@ -72,7 +72,7 @@ y = stdev( 3.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = stdev( -1.0 ); +const y = stdev( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = stdev( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/rayleigh/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/rayleigh/stdev' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = stdev( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = stdev( sigma ); console.log( 'σ: %d, SD(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/variance/README.md index d534e16bd08b..3656f1eb200d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/rayleigh/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/rayleigh/variance/README.md @@ -54,7 +54,7 @@ where `σ > 0` is the scale parameter. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/rayleigh/variance' ); +const variance = require( '@stdlib/stats/base/dists/rayleigh/variance' ); ``` #### variance( sigma ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/rayleigh/variance' ); Returns the [variance][variance] of a [Rayleigh][rayleigh-distribution] distribution with scale `sigma`. ```javascript -var y = variance( 9.0 ); +let y = variance( 9.0 ); // returns ~34.765 y = variance( 3.5 ); @@ -72,7 +72,7 @@ y = variance( 3.5 ); If provided `sigma < 0`, the function returns `NaN`. ```javascript -var y = variance( -1.0 ); +const y = variance( -1.0 ); // returns NaN ``` @@ -97,17 +97,13 @@ var y = variance( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/rayleigh/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/rayleigh/variance' ); -var sigma; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - sigma = randu() * 20.0; - y = variance( sigma ); +for ( let i = 0; i < 10; i++ ) { + const sigma = randu() * 20.0; + const y = variance( sigma ); console.log( 'σ: %d, Var(X,σ): %d', sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md index 4889aee9fb5c..f12454bba9b1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var signrank = require( '@stdlib/stats/base/dists/signrank' ); +const signrank = require( '@stdlib/stats/base/dists/signrank' ); ``` #### signrank @@ -35,7 +35,7 @@ var signrank = require( '@stdlib/stats/base/dists/signrank' ); Distribution of the Wilcoxon signed rank test statistic. ```javascript -var dist = signrank; +const dist = signrank; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following distribution functions: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var signrank = require( '@stdlib/stats/base/dists/signrank' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const signrank = require( '@stdlib/stats/base/dists/signrank' ); console.log( objectKeys( signrank ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/cdf/README.md index b51d123b9a75..0b3d4f61cfea 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/cdf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); ``` #### cdf( x, n ) @@ -41,7 +41,7 @@ var cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); Evaluates the [cumulative distribution function][cdf] of the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var y = cdf( 7.0, 9 ); +let y = cdf( 7.0, 9 ); // returns ~0.037 y = cdf( 7.0, 6 ); @@ -54,7 +54,7 @@ y = cdf( -1.0, 40 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 8 ); +let y = cdf( NaN, 8 ); // returns NaN y = cdf( 0.0, NaN ); @@ -64,14 +64,14 @@ y = cdf( 0.0, NaN ); If provided `x < 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +const y = cdf( 2.0, -1.0 ); // returns NaN ``` If not provided a positive integer for `n`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0 ); +let y = cdf( 2.0, 0 ); // returns NaN y = cdf( 2.0, -2 ); @@ -86,8 +86,8 @@ y = cdf( 2.0, 8.9 ); Returns a function for evaluating the [cumulative distribution function][cdf] of the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var mycdf = cdf.factory( 8 ); -var y = mycdf( 3.9 ); +const mycdf = cdf.factory( 8 ); +let y = mycdf( 3.9 ); // returns ~0.027 y = mycdf( 17.0 ); @@ -105,19 +105,14 @@ y = mycdf( 17.0 ); ```javascript -var ceil = require( '@stdlib/math/base/special/ceil' ); -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); - -var n; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 30.0; - n = ceil( randu() * 30.0 ); - y = cdf( x, n ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 30.0; + const n = ceil( randu() * 30.0 ); + const y = cdf( x, n ); console.log( 'x: %d, n: %d, F(x;n): %d', x.toFixed( 4 ), n.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/README.md index 5e4328476e9b..d50943f5d755 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); ``` #### pdf( x, n ) @@ -41,7 +41,7 @@ var pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); Evaluates the [probability density function][pdf] of the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var y = pdf( 7.0, 9 ); +let y = pdf( 7.0, 9 ); // returns ~0.0098 y = pdf( 7.0, 6 ); @@ -54,7 +54,7 @@ y = pdf( -1.0, 40 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 8 ); +let y = pdf( NaN, 8 ); // returns NaN y = pdf( 0.0, NaN ); @@ -64,14 +64,14 @@ y = pdf( 0.0, NaN ); If provided `x < 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0 ); +const y = pdf( 2.0, -1.0 ); // returns NaN ``` If not provided a positive integer for `n`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0 ); +let y = pdf( 2.0, 0 ); // returns NaN y = pdf( 2.0, -2 ); @@ -86,8 +86,8 @@ y = pdf( 2.0, 8.9 ); Returns a function for evaluating the [probability density function][pdf] of the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var mypdf = pdf.factory( 8 ); -var y = mypdf( 4.0 ); +const mypdf = pdf.factory( 8 ); +let y = mypdf( 4.0 ); // returns ~0.008 y = mypdf( 17.0 ); @@ -105,19 +105,14 @@ y = mypdf( 17.0 ); ```javascript -var ceil = require( '@stdlib/math/base/special/ceil' ); -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); - -var n; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 30.0; - n = ceil( randu() * 30.0 ); - y = pdf( x, n ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 30.0; + const n = ceil( randu() * 30.0 ); + const y = pdf( x, n ); console.log( 'x: %d, n: %d, F(x;n): %d', x.toFixed( 4 ), n.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/quantile/README.md index 2912286f3869..6be7ff83106d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/quantile/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); ``` #### quantile( p, n ) @@ -41,7 +41,7 @@ var quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); Evaluates the [quantile function][quantile-function] for the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var y = quantile( 0.8, 5 ); +let y = quantile( 0.8, 5 ); // returns 11 y = quantile( 0.5, 3 ); @@ -51,7 +51,7 @@ y = quantile( 0.5, 3 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 5 ); +let y = quantile( 1.9, 5 ); // returns NaN y = quantile( -0.1, 5 ); @@ -61,7 +61,7 @@ y = quantile( -0.1, 5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 5 ); +let y = quantile( NaN, 5 ); // returns NaN y = quantile( 0.0, NaN); @@ -71,7 +71,7 @@ y = quantile( 0.0, NaN); If not provided a positive integer for `n`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +let y = quantile( 0.4, -1.0 ); // returns NaN y = quantile( 0.4, 3.7 ); @@ -83,9 +83,9 @@ y = quantile( 0.4, 3.7 ); Returns a function for evaluating the [quantile function][quantile-function] of the Wilcoxon signed rank test statistic with `n` observations. ```javascript -var myQuantile = quantile.factory( 8 ); +const myQuantile = quantile.factory( 8 ); -var y = myQuantile( 0.4 ); +let y = myQuantile( 0.4 ); // returns 16 y = myQuantile( 1.0 ); @@ -103,19 +103,14 @@ y = myQuantile( 1.0 ); ```javascript -var randint = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); - -var n; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - n = randint( 1, 20 ); - y = quantile( p, n ); +const randint = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const n = randint( 1, 20 ); + const y = quantile( p, n ); console.log( 'p: %d, n: %d, Q(p;n): %d', p.toFixed( 4 ), n, y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/README.md b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/README.md index a632ea432e9f..94d325fd6593 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tukey = require( '@stdlib/stats/base/dists/studentized-range' ); +const tukey = require( '@stdlib/stats/base/dists/studentized-range' ); ``` #### tukey @@ -35,7 +35,7 @@ var tukey = require( '@stdlib/stats/base/dists/studentized-range' ); [Studentized range][studentized-range] distribution. ```javascript -var dist = tukey; +const dist = tukey; // returns {...} ``` @@ -65,7 +65,7 @@ The namespace contains the following distribution functions: ```javascript -var tukey = require( '@stdlib/stats/base/dists/studentized-range' ); +const tukey = require( '@stdlib/stats/base/dists/studentized-range' ); /* * Let's consider an example where we are analyzing the test scores of students in a class. @@ -73,12 +73,12 @@ var tukey = require( '@stdlib/stats/base/dists/studentized-range' ); * The distribution has parameters: r (number of means), v (degrees of freedom), and n (number of ranges). */ -var r = 5.0; -var v = 20.0; -var n = 3.0; +const r = 5.0; +const v = 20.0; +const n = 3.0; // CDF can be used to calculate the cumulative distribution function at a specific value: -var out = tukey.cdf( 2.0, r, v, n ); +let out = tukey.cdf( 2.0, r, v, n ); // returns ~0.074 // Quantile can also be used to calculate the quantile function at a specific probability: diff --git a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/cdf/README.md index 57ce560e7f58..e78027a502cf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/cdf/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/studentized-range/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/studentized-range/cdf' ); ``` #### cdf( x, r, v\[, nranges=1] ) @@ -41,7 +41,7 @@ var cdf = require( '@stdlib/stats/base/dists/studentized-range/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [studentized range][studentized-range] distribution with sample size `r` and `v` degrees of freedom. Optionally, the number of groups whose maximum range is considered can be specified via the `nranges` parameter. ```javascript -var y = cdf( 0.5, 3.0, 2.0 ); +let y = cdf( 0.5, 3.0, 2.0 ); // returns ~0.0644 y = cdf( 12.1, 17.0, 2.0 ); @@ -54,7 +54,7 @@ y = cdf( 0.5, 3.0, 2.0, 2 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 2.0, 2.0 ); +let y = cdf( NaN, 2.0, 2.0 ); // returns NaN y = cdf( 1.5, NaN, 2.0 ); @@ -64,7 +64,7 @@ y = cdf( 1.5, NaN, 2.0 ); If provided `v < 2` or `r < 2`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0, 3.0 ); +let y = cdf( 2.0, -1.0, 3.0 ); // returns NaN y = cdf( 2.0, 3.0, 1.5 ); @@ -76,8 +76,8 @@ y = cdf( 2.0, 3.0, 1.5 ); Returns a `function` for evaluating the [cdf][cdf] of a [studentized range][studentized-range] distribution with sample size `r` and `v` degrees of freedom. Optionally. Optionally, the number of groups whose maximum range is considered can be specified via the `nranges` parameter. ```javascript -var mycdf = cdf.factory( 3.0, 2.0 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 3.0, 2.0 ); +let y = mycdf( 3.0 ); // returns ~0.712 y = mycdf( 1.0 ); @@ -95,20 +95,14 @@ y = mycdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/studentized-range/cdf' ); - -var v; -var q; -var r; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - q = randu() * 12.0; - r = ( randu() * 20.0 ) + 2.0; - v = ( randu() * 10.0 ) + 2.0; - y = cdf( q, r, v ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/studentized-range/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const q = randu() * 12.0; + const r = ( randu() * 20.0 ) + 2.0; + const v = ( randu() * 10.0 ) + 2.0; + const y = cdf( q, r, v ); console.log( 'q: %d, r: %d, v: %d, F(x;v): %d', q.toFixed( 4 ), r.toFixed( 4 ), v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/quantile/README.md index 7d5dd0491907..6c18daafa6f0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/studentized-range/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/studentized-range/quantile/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/studentized-range/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/studentized-range/quantile' ); ``` #### quantile( p, r, v\[, nranges=1] ) @@ -41,7 +41,7 @@ var quantile = require( '@stdlib/stats/base/dists/studentized-range/quantile' ); Evaluates the [quantile function][quantile-function] for a [studentized range][studentized-range] distribution with sample size `r` and `v` degrees of freedom. Optionally. Optionally, the number of groups whose maximum range is considered can be specified via the `nranges` parameter. ```javascript -var y = quantile( 0.5, 3.0, 2.0 ); +let y = quantile( 0.5, 3.0, 2.0 ); // returns ~0.0644 y = quantile( 0.9, 17.0, 2.0 ); @@ -54,7 +54,7 @@ y = quantile( 0.5, 3.0, 2.0, 2 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 3.0, 2.0 ); +let y = quantile( 1.9, 3.0, 2.0 ); // returns NaN y = quantile( -0.1, 3.0, 2.0 ); @@ -64,7 +64,7 @@ y = quantile( -0.1, 3.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 2.0, 2.0 ); +let y = quantile( NaN, 2.0, 2.0 ); // returns NaN y = quantile( 0.0, NaN, 2.0 ); @@ -74,7 +74,7 @@ y = quantile( 0.0, NaN, 2.0 ); If provided `v < 2` or `r < 2`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 3.0 ); +let y = quantile( 0.4, -1.0, 3.0 ); // returns NaN y = quantile( 0.4, 3.0, 1.5 ); @@ -86,9 +86,9 @@ y = quantile( 0.4, 3.0, 1.5 ); Returns a function for evaluating the [quantile function][quantile-function] of an [studentized range][studentized-range] distribution with sample size `r` and `v` degrees of freedom. Optionally, the number of groups whose maximum range is considered can be specified via the `nranges` parameter. ```javascript -var myquantile = quantile.factory( 4.0 ); +const myquantile = quantile.factory( 4.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~-0.941 y = myquantile( 0.9 ); @@ -106,20 +106,14 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/studentized-range/quantile' ); - -var v; -var r; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - r = ( randu() * 20.0 ) + 2.0; - v = ( randu() * 20.0 ) + 2.0; - y = quantile( p, r, v ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/studentized-range/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const r = ( randu() * 20.0 ) + 2.0; + const v = ( randu() * 20.0 ) + 2.0; + const y = quantile( p, r, v ); console.log( 'p: %d, r: %d, v: %d, Q(p;r,v): %d', p.toFixed( 4 ), r.toFixed( 4 ), v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/README.md index 6296626ef11f..c8d5b4a54ec5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var t = require( '@stdlib/stats/base/dists/t' ); +const t = require( '@stdlib/stats/base/dists/t' ); ``` #### t @@ -35,7 +35,7 @@ var t = require( '@stdlib/stats/base/dists/t' ); Student's t distribution. ```javascript -var dist = t; +const dist = t; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [Student's t][t-dis ```javascript -var T = require( '@stdlib/stats/base/dists/t' ).T; +const T = require( '@stdlib/stats/base/dists/t' ).T; -var dist = new T( 2.0 ); +const dist = new T( 2.0 ); -var y = dist.cdf( 0.5 ); +const y = dist.cdf( 0.5 ); // returns ~0.667 ``` @@ -108,13 +108,13 @@ var y = dist.cdf( 0.5 ); ```javascript -var t = require( '@stdlib/stats/base/dists/t' ); +const t = require( '@stdlib/stats/base/dists/t' ); -var dof = 3; -var x = 1.5; +const dof = 3; +const x = 1.5; // Evaluate the probability density function (PDF) at a specific value: -var res = t.pdf( x, dof ); +let res = t.pdf( x, dof ); console.log( 'PDF at x = ' + x + ': ' + res ); // Evaluate the cumulative distribution function (CDF) at a specific value: @@ -122,8 +122,8 @@ res = t.cdf( x, dof ); console.log( 'CDF at x = ' + x + ': ' + res ); // Get the mean and variance of the t distribution: -var mu = t.mean( dof ); -var v = t.variance( dof ); +const mu = t.mean( dof ); +const v = t.variance( dof ); console.log( 'Mean: ' + mu + ', Variance: ' + v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/cdf/README.md index 97fe6f1a50ab..c5d8c08cb65f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/cdf/README.md @@ -50,7 +50,7 @@ where `v > 0` is the degrees of freedom. In the definition, `Beta( x; a, b )` de ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/t/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/t/cdf' ); ``` #### cdf( x, v ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/t/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = cdf( 2.0, 0.1 ); +let y = cdf( 2.0, 0.1 ); // returns ~0.611 y = cdf( 1.0, 2.0 ); @@ -71,7 +71,7 @@ y = cdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0 ); +let y = cdf( NaN, 1.0 ); // returns NaN y = cdf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = cdf( 0.0, NaN ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, -1.0 ); +let y = cdf( 2.0, -1.0 ); // returns NaN y = cdf( 2.0, 0.0 ); @@ -93,8 +93,8 @@ y = cdf( 2.0, 0.0 ); Returns a `function` for evaluating the [cdf][cdf] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var mycdf = cdf.factory( 0.5 ); -var y = mycdf( 3.0 ); +const mycdf = cdf.factory( 0.5 ); +let y = mycdf( 3.0 ); // returns ~0.816 y = mycdf( 1.0 ); @@ -112,18 +112,13 @@ y = mycdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/t/cdf' ); - -var v; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu() * 6.0) - 3.0; - v = randu() * 10.0; - y = cdf( x, v ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/t/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = (randu() * 6.0) - 3.0; + const v = randu() * 10.0; + const y = cdf( x, v ); console.log( 'x: %d, v: %d, F(x;v): %d', x.toFixed( 4 ), v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/ctor/README.md index 2898362800f1..b0617fa34ffa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var T = require( '@stdlib/stats/base/dists/t/ctor' ); +const T = require( '@stdlib/stats/base/dists/t/ctor' ); ``` #### T( \[v] ) @@ -45,18 +45,18 @@ var T = require( '@stdlib/stats/base/dists/t/ctor' ); Returns a [Student's t][t-distribution] distribution object. ```javascript -var t = new T(); +const t = new T(); -var mu = t.mean; +const mu = t.mean; // returns NaN ``` By default, `v = 1.0`. To create a distribution having a different degrees of freedom `v`, provide a parameter value. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var mu = t.mean; +const mu = t.mean; // returns 0.0 ``` @@ -73,9 +73,9 @@ A [Student's t][t-distribution] distribution object has the following properties Degrees of freedom of the distribution. `v` **must** be a positive number. ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var v = t.v; +let v = t.v; // returns 2.0 t.v = 3.0; @@ -93,9 +93,9 @@ v = t.v; Returns the [differential entropy][entropy]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var entropy = t.entropy; +const entropy = t.entropy; // returns ~1.682 ``` @@ -104,9 +104,9 @@ var entropy = t.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var kurtosis = t.kurtosis; +const kurtosis = t.kurtosis; // returns Infinity ``` @@ -115,9 +115,9 @@ var kurtosis = t.kurtosis; Returns the [expected value][expected-value]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var mu = t.mean; +const mu = t.mean; // returns 0.0 ``` @@ -126,9 +126,9 @@ var mu = t.mean; Returns the [median][median]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var median = t.median; +const median = t.median; // returns 0.0 ``` @@ -137,9 +137,9 @@ var median = t.median; Returns the [mode][mode]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var mode = t.mode; +const mode = t.mode; // returns 0.0 ``` @@ -148,9 +148,9 @@ var mode = t.mode; Returns the [skewness][skewness]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var skewness = t.skewness; +const skewness = t.skewness; // returns 0.0 ``` @@ -159,9 +159,9 @@ var skewness = t.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var s = t.stdev; +const s = t.stdev; // returns ~1.414 ``` @@ -170,9 +170,9 @@ var s = t.stdev; Returns the [variance][variance]. ```javascript -var t = new T( 4.0 ); +const t = new T( 4.0 ); -var s2 = t.variance; +const s2 = t.variance; // returns 2.0 ``` @@ -185,9 +185,9 @@ var s2 = t.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var y = t.cdf( 0.5 ); +const y = t.cdf( 0.5 ); // returns ~0.667 ``` @@ -196,9 +196,9 @@ var y = t.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var y = t.logcdf( 0.5 ); +const y = t.logcdf( 0.5 ); // returns ~-0.405 ``` @@ -207,9 +207,9 @@ var y = t.logcdf( 0.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var y = t.logpdf( 0.8 ); +const y = t.logpdf( 0.8 ); // returns ~-1.456 ``` @@ -218,9 +218,9 @@ var y = t.logpdf( 0.8 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var y = t.pdf( 0.8 ); +const y = t.pdf( 0.8 ); // returns ~0.233 ``` @@ -229,9 +229,9 @@ var y = t.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var y = t.quantile( 0.5 ); +let y = t.quantile( 0.5 ); // returns 0.0 y = t.quantile( 1.9 ); @@ -261,20 +261,20 @@ y = t.quantile( 1.9 ); ```javascript -var T = require( '@stdlib/stats/base/dists/t/ctor' ); +const T = require( '@stdlib/stats/base/dists/t/ctor' ); -var t = new T( 2.0 ); +const t = new T( 2.0 ); -var mu = t.mean; +const mu = t.mean; // returns 0.0 -var mode = t.mode; +const mode = t.mode; // returns 0.0 -var s2 = t.variance; +const s2 = t.variance; // returns Infinity -var y = t.cdf( 0.8 ); +const y = t.cdf( 0.8 ); // returns ~0.746 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/entropy/README.md index 64485f0defd7..0a8b1b898702 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/entropy/README.md @@ -54,7 +54,7 @@ where `Β` and `ψ` denote the [beta][beta-function] and [digamma][digamma] func ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/t/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/t/entropy' ); ``` #### entropy( v ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/t/entropy' ); Returns the [differential entropy][entropy] of a [Student's t][t-distribution] distribution with degrees of freedom `v` (in [nats][nats]). ```javascript -var y = entropy( 9.0 ); +let y = entropy( 9.0 ); // returns ~1.533 y = entropy( 3.5 ); @@ -72,7 +72,7 @@ y = entropy( 3.5 ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = entropy( -1.0 ); +let y = entropy( -1.0 ); // returns NaN y = entropy( 0.0 ); @@ -100,17 +100,13 @@ y = entropy( 0.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var entropy = require( '@stdlib/stats/base/dists/t/entropy' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const entropy = require( '@stdlib/stats/base/dists/t/entropy' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = entropy( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = entropy( v ); console.log( 'v: %d, h(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/kurtosis/README.md index 8c23282c2e29..4b0851f0fae6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/kurtosis/README.md @@ -54,7 +54,7 @@ For `ν` smaller than two, the kurtosis is not defined. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); ``` #### kurtosis( v ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = kurtosis( 9.0 ); +let y = kurtosis( 9.0 ); // returns 1.2 y = kurtosis( 4.5 ); @@ -72,7 +72,7 @@ y = kurtosis( 4.5 ); If provided `2 < v <= 4`, the function returns `infinity`. ```javascript -var y = kurtosis( 3.5 ); +let y = kurtosis( 3.5 ); // returns Infinity y = kurtosis( 2.9 ); @@ -85,7 +85,7 @@ y = kurtosis( 4.0 ); If provided `v <= 2`, the function returns `NaN`. ```javascript -var y = kurtosis( -1.0 ); +let y = kurtosis( -1.0 ); // returns NaN y = kurtosis( 0.8 ); @@ -116,17 +116,13 @@ y = kurtosis( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = kurtosis( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = kurtosis( v ); console.log( 'v: %d, Kurt(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md index 9dec94fe6804..69eb2e8fc6aa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md @@ -50,7 +50,7 @@ where `v > 0` is the degrees of freedom. In the definition, `Beta( x; a, b )` de ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); ``` #### logcdf( x, v ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = logcdf( 2.0, 0.1 ); +let y = logcdf( 2.0, 0.1 ); // returns ~-0.493 y = logcdf( 1.0, 2.0 ); @@ -71,7 +71,7 @@ y = logcdf( -1.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0 ); +let y = logcdf( NaN, 1.0 ); // returns NaN y = logcdf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = logcdf( 0.0, NaN ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0 ); +let y = logcdf( 2.0, -1.0 ); // returns NaN y = logcdf( 2.0, 0.0 ); @@ -93,8 +93,8 @@ y = logcdf( 2.0, 0.0 ); Returns a `function` for evaluating the natural logarithm of the [CDF][cdf] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var mylogcdf = logcdf.factory( 0.5 ); -var y = mylogcdf( 3.0 ); +const mylogcdf = logcdf.factory( 0.5 ); +let y = mylogcdf( 3.0 ); // returns ~-0.203 y = mylogcdf( 1.0 ); @@ -122,18 +122,13 @@ y = mylogcdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); - -var v; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu() * 6.0) - 3.0; - v = randu() * 10.0; - y = logcdf( x, v ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = (randu() * 6.0) - 3.0; + const v = randu() * 10.0; + const y = logcdf( x, v ); console.log( 'x: %d, v: %d, ln(F(x;v)): %d', x.toFixed( 4 ), v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/logpdf/README.md index 897ea554bfe8..f11fa31f2549 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/logpdf/README.md @@ -50,7 +50,7 @@ where `v > 0` is the degrees of freedom. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/t/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/t/logpdf' ); ``` #### logpdf( x, v ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/t/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = logpdf( 0.3, 4.0 ); +let y = logpdf( 0.3, 4.0 ); // returns ~-1.036 y = logpdf( 2.0, 0.7 ); @@ -71,7 +71,7 @@ y = logpdf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0 ); +let y = logpdf( NaN, 1.0 ); // returns NaN y = logpdf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = logpdf( 0.0, NaN ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, -1.0 ); +let y = logpdf( 2.0, -1.0 ); // returns NaN y = logpdf( 2.0, 0.0 ); @@ -93,8 +93,8 @@ y = logpdf( 2.0, 0.0 ); Returns a `function` for evaluating the natural logarithm of the [PDF][pdf] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var mylogpdf = logpdf.factory( 1.0 ); -var y = mylogpdf( 3.0 ); +const mylogpdf = logpdf.factory( 1.0 ); +let y = mylogpdf( 3.0 ); // returns ~-3.447 y = mylogpdf( 1.0 ); @@ -122,18 +122,13 @@ y = mylogpdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/t/logpdf' ); - -var v; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu() * 6.0) - 3.0; - v = randu() * 10.0; - y = logpdf( x, v ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/t/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = (randu() * 6.0) - 3.0; + const v = randu() * 10.0; + const y = logpdf( x, v ); console.log( 'x: %d, v: %d, ln(f(x;v)): %d', x, v, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/mean/README.md index aa9948917cd6..2f0fbb3b4fef 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/mean/README.md @@ -54,7 +54,7 @@ for degrees of freedom `v` greater than one. For `v <= 1`, the mean is not defin ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/t/mean' ); +const mean = require( '@stdlib/stats/base/dists/t/mean' ); ``` #### mean( v ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/t/mean' ); Returns the [expected value][expected-value] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = mean( 9.0 ); +let y = mean( 9.0 ); // returns 0.0 y = mean( 1.5 ); @@ -72,7 +72,7 @@ y = mean( 1.5 ); If provided `v <= 1`, the function returns `NaN`. ```javascript -var y = mean( -1.0 ); +let y = mean( -1.0 ); // returns NaN y = mean( 0.8 ); @@ -100,17 +100,13 @@ y = mean( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mean = require( '@stdlib/stats/base/dists/t/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mean = require( '@stdlib/stats/base/dists/t/mean' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = mean( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = mean( v ); console.log( 'v: %d, E(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/median/README.md index 5ef4d0ada20b..c5be9b1f2f2b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/median/README.md @@ -52,7 +52,7 @@ The [median][median] for a [Student's t][t-distribution] random variable with de ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/t/median' ); +const median = require( '@stdlib/stats/base/dists/t/median' ); ``` #### median( v ) @@ -60,7 +60,7 @@ var median = require( '@stdlib/stats/base/dists/t/median' ); Returns the [median][median] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = median( 9.0 ); +let y = median( 9.0 ); // returns 0.0 y = median( 1.5 ); @@ -70,7 +70,7 @@ y = median( 1.5 ); If provided `v < 0`, the function returns `NaN`. ```javascript -var y = median( -1.0 ); +const y = median( -1.0 ); // returns NaN ``` @@ -95,17 +95,13 @@ var y = median( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var median = require( '@stdlib/stats/base/dists/t/median' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const median = require( '@stdlib/stats/base/dists/t/median' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = median( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = median( v ); console.log( 'v: %d, Median(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/mode/README.md index 9ed11279665d..791593240f5f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [Student's t][t-distribution] random variable with degree ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/t/mode' ); +const mode = require( '@stdlib/stats/base/dists/t/mode' ); ``` #### mode( v ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/t/mode' ); Returns the [mode][mode] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = mode( 9.0 ); +let y = mode( 9.0 ); // returns 0.0 y = mode( 1.5 ); @@ -70,7 +70,7 @@ y = mode( 1.5 ); If provided `v < 0`, the function returns `NaN`. ```javascript -var y = mode( -1.0 ); +const y = mode( -1.0 ); // returns NaN ``` @@ -95,17 +95,13 @@ var y = mode( -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var mode = require( '@stdlib/stats/base/dists/t/mode' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const mode = require( '@stdlib/stats/base/dists/t/mode' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = mode( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = mode( v ); console.log( 'v: %d, mode(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/pdf/README.md index 11934002a59d..1906c2a4ef63 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/pdf/README.md @@ -50,7 +50,7 @@ where `v > 0` is the degrees of freedom. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/t/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/t/pdf' ); ``` #### pdf( x, v ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/t/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = pdf( 0.3, 4.0 ); +let y = pdf( 0.3, 4.0 ); // returns ~0.355 y = pdf( 2.0, 0.7 ); @@ -71,7 +71,7 @@ y = pdf( -1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 1.0 ); +let y = pdf( NaN, 1.0 ); // returns NaN y = pdf( 0.0, NaN ); @@ -81,7 +81,7 @@ y = pdf( 0.0, NaN ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, -1.0 ); +let y = pdf( 2.0, -1.0 ); // returns NaN y = pdf( 2.0, 0.0 ); @@ -93,8 +93,8 @@ y = pdf( 2.0, 0.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var mypdf = pdf.factory( 1.0 ); -var y = mypdf( 3.0 ); +const mypdf = pdf.factory( 1.0 ); +let y = mypdf( 3.0 ); // returns ~0.032 y = mypdf( 1.0 ); @@ -112,18 +112,13 @@ y = mypdf( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/t/pdf' ); - -var v; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = (randu() * 6.0) - 3.0; - v = randu() * 10.0; - y = pdf( x, v ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/t/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = (randu() * 6.0) - 3.0; + const v = randu() * 10.0; + const y = pdf( x, v ); console.log( 'x: %d, v: %d, f(x;v): %d', x, v, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/quantile/README.md index c3c3ef441379..a163c6ab1d88 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `v > 0` is the degrees of freedom. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/t/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/t/quantile' ); ``` #### quantile( p, v ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/t/quantile' ); Evaluates the [quantile function][quantile-function] for a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = quantile( 0.8, 1.0 ); +let y = quantile( 0.8, 1.0 ); // returns ~1.376 y = quantile( 0.1, 1.0 ); @@ -71,7 +71,7 @@ y = quantile( 0.5, 0.1 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0 ); +let y = quantile( 1.9, 1.0 ); // returns NaN y = quantile( -0.1, 1.0 ); @@ -81,7 +81,7 @@ y = quantile( -0.1, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0 ); +let y = quantile( NaN, 1.0 ); // returns NaN y = quantile( 0.0, NaN ); @@ -91,7 +91,7 @@ y = quantile( 0.0, NaN ); If provided `v <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0 ); +let y = quantile( 0.4, -1.0 ); // returns NaN y = quantile( 0.4, 0.0 ); @@ -103,9 +103,9 @@ y = quantile( 0.4, 0.0 ); Returns a function for evaluating the [quantile function][quantile-function] of an [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var myquantile = quantile.factory( 4.0 ); +const myquantile = quantile.factory( 4.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~-0.941 y = myquantile( 0.9 ); @@ -123,18 +123,13 @@ y = myquantile( 0.9 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/t/quantile' ); - -var v; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - v = randu() * 10.0; - y = quantile( p, v ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/t/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const v = randu() * 10.0; + const y = quantile( p, v ); console.log( 'p: %d, v: %d, Q(p;v): %d', p.toFixed( 4 ), v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/skewness/README.md index 00cae5f824e8..7dad82d540e5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/skewness/README.md @@ -54,7 +54,7 @@ when `ν > 3`. Otherwise, the skewness is not defined. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/t/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/t/skewness' ); ``` #### skewness( v ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/t/skewness' ); Returns the [skewness][skewness] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = skewness( 9.0 ); +let y = skewness( 9.0 ); // returns 0.0 y = skewness( 3.5 ); @@ -72,7 +72,7 @@ y = skewness( 3.5 ); If provided `v <= 3`, the function returns `NaN`. ```javascript -var y = skewness( -1.0 ); +let y = skewness( -1.0 ); // returns NaN y = skewness( 0.8 ); @@ -103,17 +103,13 @@ y = skewness( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var skewness = require( '@stdlib/stats/base/dists/t/skewness' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const skewness = require( '@stdlib/stats/base/dists/t/skewness' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = skewness( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = skewness( v ); console.log( 'v: %d, skew(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/stdev/README.md index 27dee0b7553b..e14f4cf34dc5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/stdev/README.md @@ -54,7 +54,7 @@ For `ν` smaller than one, the standard deviation is not defined. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/t/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/t/stdev' ); ``` #### stdev( v ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/t/stdev' ); Returns the [standard deviation][standard-deviation] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = stdev( 9.0 ); +let y = stdev( 9.0 ); // returns ~1.134 y = stdev( 3.5 ); @@ -72,7 +72,7 @@ y = stdev( 3.5 ); If provided `1 < v <= 2`, the function returns `infinity`. ```javascript -var y = stdev( 1.5 ); +let y = stdev( 1.5 ); // returns Infinity y = stdev( 2.0 ); @@ -82,7 +82,7 @@ y = stdev( 2.0 ); If provided `v <= 1`, the function returns `NaN`. ```javascript -var y = stdev( -1.0 ); +let y = stdev( -1.0 ); // returns NaN y = stdev( 0.8 ); @@ -110,17 +110,13 @@ y = stdev( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var stdev = require( '@stdlib/stats/base/dists/t/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const stdev = require( '@stdlib/stats/base/dists/t/stdev' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = stdev( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = stdev( v ); console.log( 'v: %d, SD(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/variance/README.md index b3366dc6a022..04bd9995ae18 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/variance/README.md @@ -54,7 +54,7 @@ For `ν` smaller than one, the variance is not defined. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/t/variance' ); +const variance = require( '@stdlib/stats/base/dists/t/variance' ); ``` #### variance( v ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/t/variance' ); Returns the [variance][variance] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. ```javascript -var y = variance( 9.0 ); +let y = variance( 9.0 ); // returns ~1.286 y = variance( 3.5 ); @@ -72,7 +72,7 @@ y = variance( 3.5 ); If provided `1 < v <= 2`, the function returns `infinity`. ```javascript -var y = variance( 1.5 ); +let y = variance( 1.5 ); // returns Infinity y = variance( 2.0 ); @@ -82,7 +82,7 @@ y = variance( 2.0 ); If provided `v <= 1`, the function returns `NaN`. ```javascript -var y = variance( -1.0 ); +let y = variance( -1.0 ); // returns NaN y = variance( 0.8 ); @@ -110,17 +110,13 @@ y = variance( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var variance = require( '@stdlib/stats/base/dists/t/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const variance = require( '@stdlib/stats/base/dists/t/variance' ); -var v; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - v = randu() * 20.0; - y = variance( v ); +for ( let i = 0; i < 10; i++ ) { + const v = randu() * 20.0; + const y = variance( v ); console.log( 'v: %d, Var(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/README.md index ae6ba01ba8b3..61b7b70c36b2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var triangular = require( '@stdlib/stats/base/dists/triangular' ); +const triangular = require( '@stdlib/stats/base/dists/triangular' ); ``` #### triangular @@ -35,7 +35,7 @@ var triangular = require( '@stdlib/stats/base/dists/triangular' ); Triangular distribution. ```javascript -var dist = triangular; +const dist = triangular; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [triangular][triang ```javascript -var Triangular = require( '@stdlib/stats/base/dists/triangular' ).Triangular; +const Triangular = require( '@stdlib/stats/base/dists/triangular' ).Triangular; -var dist = new Triangular( 2.0, 4.0, 3.0 ); +const dist = new Triangular( 2.0, 4.0, 3.0 ); -var y = dist.quantile( 0.5 ); +let y = dist.quantile( 0.5 ); // returns 3.0 y = dist.quantile( 1.9 ); @@ -110,46 +110,46 @@ y = dist.quantile( 1.9 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var triangular = require( '@stdlib/stats/base/dists/triangular' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const triangular = require( '@stdlib/stats/base/dists/triangular' ); // Scenario: Modeling completion time for a software development task // Define the distribution parameters (in hours): -var a = 1.5; // Minimum time (best-case scenario) -var b = 4.5; // Maximum time (worst-case scenario) -var c = discreteUniform( 2, 4 ); // Most likely time (mode) +const a = 1.5; // Minimum time (best-case scenario) +const b = 4.5; // Maximum time (worst-case scenario) +const c = discreteUniform( 2, 4 ); // Most likely time (mode) console.log( 'a: %d, b: %d, c: %d', a, b, c ); // Expected (mean) completion time: -var mean = triangular.mean( a, b, c ); +const mean = triangular.mean( a, b, c ); console.log( '\nExpected completion time: %d hours', mean ); // Median completion time: -var median = triangular.median( a, b, c ); +const median = triangular.median( a, b, c ); console.log( 'Median completion time: %d hours', median ); // Variance in completion time: -var variance = triangular.variance( a, b, c ); +const variance = triangular.variance( a, b, c ); console.log( 'Variance in completion time: %d hours^2', variance ); // Probability of completing the task within 3 hours: -var x = 3.0; -var prob = triangular.cdf( x, a, b, c ); +let x = 3.0; +const prob = triangular.cdf( x, a, b, c ); console.log( '\nProbability of completing within %d hours: %d', x, prob ); // 90th percentile of completion time: -var p = 0.9; -var percentile = triangular.quantile( p, a, b, c ); +const p = 0.9; +const percentile = triangular.quantile( p, a, b, c ); console.log( '90% of tasks will be completed within %d hours', percentile ); // Relative likelihood of completing the task in exactly 2.5 hours: x = 2.5; -var likelihood = triangular.pdf( x, a, b, c ); +const likelihood = triangular.pdf( x, a, b, c ); console.log( '\nRelative likelihood of completing in exactly %d hours: %d', x, likelihood ); // Skewness to understand the distribution's shape: -var skewness = triangular.skewness( a, b, c ); +const skewness = triangular.skewness( a, b, c ); console.log( '\nSkewness of completion times: %d', skewness ); if ( skewness > 0 ) { console.log( 'The distribution is right-skewed, suggesting occasional longer completion times.' ); @@ -160,7 +160,7 @@ if ( skewness > 0 ) { } // Entropy as a measure of uncertainty in the estimate: -var entropy = triangular.entropy( a, b, c ); +const entropy = triangular.entropy( a, b, c ); console.log( '\nEntropy of the distribution: %d nats', entropy ); console.log( 'Higher entropy indicates more uncertainty in completion times.' ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/cdf/README.md index fe38bb803eda..d67638a54b12 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/cdf/README.md @@ -50,7 +50,7 @@ where `a` is the lower limit, `b` is the upper limit, and `c` is the mode. ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/triangular/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/triangular/cdf' ); ``` #### cdf( x, a, b, c ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/triangular/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var y = cdf( 0.5, -1.0, 1.0, 0.0 ); +let y = cdf( 0.5, -1.0, 1.0, 0.0 ); // returns 0.875 y = cdf( 0.5, -1.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = cdf( -2.0, -1.0, 1.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0, 0.5 ); +let y = cdf( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = cdf( 0.0, NaN, 1.0, 0.5 ); @@ -90,7 +90,7 @@ y = cdf( 2.0, 1.0, 0.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 1.0, 0.0, 1.5 ); +let y = cdf( 2.0, 1.0, 0.0, 1.5 ); // returns NaN y = cdf( 2.0, 1.0, 0.0, -1.0 ); @@ -105,8 +105,8 @@ y = cdf( 2.0, 0.0, -1.0, 0.5 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var mycdf = cdf.factory( 0.0, 10.0, 2.0 ); -var y = mycdf( 0.5 ); +const mycdf = cdf.factory( 0.0, 10.0, 2.0 ); +let y = mycdf( 0.5 ); // returns 0.0125 y = mycdf( 8.0 ); @@ -124,22 +124,15 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/triangular/cdf' ); - -var a; -var b; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = randu() * 30.0; - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + ((b-a) * randu()); - y = cdf( x, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/triangular/cdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = randu() * 30.0; + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + ((b-a) * randu()); + const y = cdf( x, a, b, c ); console.log( 'x: %d, a: %d, b: %d, c: %d, F(x;a,b,c): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/ctor/README.md index 671e734d73a9..8fced641549a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Triangular = require( '@stdlib/stats/base/dists/triangular/ctor' ); +const Triangular = require( '@stdlib/stats/base/dists/triangular/ctor' ); ``` #### Triangular( \[a, b, c] ) @@ -45,18 +45,18 @@ var Triangular = require( '@stdlib/stats/base/dists/triangular/ctor' ); Returns a [triangular][triangular-distribution] distribution object. ```javascript -var triangular = new Triangular(); +const triangular = new Triangular(); -var mu = triangular.mean; +const mu = triangular.mean; // returns 0.5 ``` By default, `a = 0.0`, `b = 1.0`, and `c = 0.5`. To create a distribution having a different `a` (minimum support), `b` (maximum support), and `c` (mode), provide the corresponding arguments. ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.5 ); +const triangular = new Triangular( 2.0, 4.0, 3.5 ); -var mu = triangular.mean; +const mu = triangular.mean; // returns ~3.167 ``` @@ -73,9 +73,9 @@ An [triangular][triangular-distribution] distribution object has the following p Minimum support of the distribution. `a` **must** be a number smaller than or equal to `b` and `c`. ```javascript -var triangular = new Triangular(); +const triangular = new Triangular(); -var a = triangular.a; +let a = triangular.a; // returns 0.0 triangular.a = 0.5; @@ -89,9 +89,9 @@ a = triangular.a; Maximum support of the distribution. `b` **must** be a number larger than or equal to `a` and `c`. ```javascript -var triangular = new Triangular( 2.0, 4.0, 2.5 ); +const triangular = new Triangular( 2.0, 4.0, 2.5 ); -var b = triangular.b; +let b = triangular.b; // returns 4.0 triangular.b = 3.0; @@ -105,9 +105,9 @@ b = triangular.b; Mode of the distribution. `c` **must** be a number larger than or equal to `a` and smaller than or equal to `b`. ```javascript -var triangular = new Triangular( 2.0, 5.0, 4.0 ); +const triangular = new Triangular( 2.0, 5.0, 4.0 ); -var c = triangular.c; +let c = triangular.c; // returns 4.0 triangular.c = 3.0; @@ -125,9 +125,9 @@ c = triangular.c; Returns the [differential entropy][entropy]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var entropy = triangular.entropy; +const entropy = triangular.entropy; // returns ~1.886 ``` @@ -136,9 +136,9 @@ var entropy = triangular.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var kurtosis = triangular.kurtosis; +const kurtosis = triangular.kurtosis; // returns -0.6 ``` @@ -147,9 +147,9 @@ var kurtosis = triangular.kurtosis; Returns the [expected value][expected-value]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var mu = triangular.mean; +const mu = triangular.mean; // returns ~8.667 ``` @@ -158,9 +158,9 @@ var mu = triangular.mean; Returns the [median][median]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var median = triangular.median; +const median = triangular.median; // returns ~8.899 ``` @@ -169,9 +169,9 @@ var median = triangular.median; Returns the [mode][mode]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var mode = triangular.mode; +const mode = triangular.mode; // returns 10.0 ``` @@ -180,9 +180,9 @@ var mode = triangular.mode; Returns the [skewness][skewness]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var skewness = triangular.skewness; +const skewness = triangular.skewness; // returns ~-0.422 ``` @@ -191,9 +191,9 @@ var skewness = triangular.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var s = triangular.stdev; +const s = triangular.stdev; // returns ~1.7 ``` @@ -202,9 +202,9 @@ var s = triangular.stdev; Returns the [variance][variance]. ```javascript -var triangular = new Triangular( 4.0, 12.0, 10.0 ); +const triangular = new Triangular( 4.0, 12.0, 10.0 ); -var s2 = triangular.variance; +const s2 = triangular.variance; // returns ~2.889 ``` @@ -217,9 +217,9 @@ var s2 = triangular.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var y = triangular.cdf( 2.5 ); +const y = triangular.cdf( 2.5 ); // returns 0.125 ``` @@ -228,9 +228,9 @@ var y = triangular.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var y = triangular.logcdf( 2.5 ); +const y = triangular.logcdf( 2.5 ); // returns ~-2.079 ``` @@ -239,9 +239,9 @@ var y = triangular.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var y = triangular.logpdf( 2.5 ); +const y = triangular.logpdf( 2.5 ); // returns ~-0.693 ``` @@ -250,9 +250,9 @@ var y = triangular.logpdf( 2.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var y = triangular.pdf( 2.5 ); +const y = triangular.pdf( 2.5 ); // returns 0.5 ``` @@ -261,9 +261,9 @@ var y = triangular.pdf( 2.5 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var y = triangular.quantile( 0.5 ); +let y = triangular.quantile( 0.5 ); // returns 3.0 y = triangular.quantile( 1.9 ); @@ -293,20 +293,20 @@ y = triangular.quantile( 1.9 ); ```javascript -var Triangular = require( '@stdlib/stats/base/dists/triangular/ctor' ); +const Triangular = require( '@stdlib/stats/base/dists/triangular/ctor' ); -var triangular = new Triangular( 2.0, 4.0, 3.0 ); +const triangular = new Triangular( 2.0, 4.0, 3.0 ); -var mu = triangular.mean; +const mu = triangular.mean; // returns 3.0 -var median = triangular.median; +const median = triangular.median; // returns 3.0 -var s2 = triangular.variance; +const s2 = triangular.variance; // returns ~0.167 -var y = triangular.cdf( 2.5 ); +const y = triangular.cdf( 2.5 ); // returns 0.125 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/entropy/README.md index da453bdf1349..86191475de70 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/entropy/README.md @@ -52,7 +52,7 @@ h\left( X \right) = \frac{1}{2} + \ln \left({\frac{b-a}{2}}\right) ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/triangular/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/triangular/entropy' ); ``` #### entropy( a, b, c ) @@ -60,7 +60,7 @@ var entropy = require( '@stdlib/stats/base/dists/triangular/entropy' ); Returns the [differential entropy][entropy] of a [triangular][triangular-distribution] distribution with minimum support `a`, maximum support`b`, and mode `c` (in [nats][nats]). ```javascript -var v = entropy( 0.0, 1.0, 0.8 ); +let v = entropy( 0.0, 1.0, 0.8 ); // returns ~-0.193 v = entropy( 4.0, 12.0, 5.0 ); @@ -73,7 +73,7 @@ v = entropy( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 4.0, 2.0 ); +let v = entropy( NaN, 4.0, 2.0 ); // returns NaN v = entropy( 0.0, NaN, 2.0 ); @@ -86,7 +86,7 @@ v = entropy( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = entropy( 1.0, 0.0, 1.5 ); +let y = entropy( 1.0, 0.0, 1.5 ); // returns NaN y = entropy( 0.0, 1.0, -1.0 ); @@ -117,20 +117,14 @@ y = entropy( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/triangular/entropy' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = entropy( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/triangular/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = entropy( a, b, c ); console.log( 'a: %d, b: %d, c: %d, h(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/kurtosis/README.md index e5b39d17b29f..2ce019818f42 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [triangular][triangular-distribution] rand ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/triangular/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/triangular/kurtosis' ); ``` #### kurtosis( a, b, c ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/triangular/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [triangular][triangular-distribution] distribution with minimum support `a`, maximum support`b`, and mode `c`. ```javascript -var v = kurtosis( 0.0, 1.0, 0.8 ); +let v = kurtosis( 0.0, 1.0, 0.8 ); // returns -0.6 v = kurtosis( 4.0, 12.0, 5.0 ); @@ -73,7 +73,7 @@ v = kurtosis( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 4.0, 2.0 ); +let v = kurtosis( NaN, 4.0, 2.0 ); // returns NaN v = kurtosis( 0.0, NaN, 2.0 ); @@ -86,7 +86,7 @@ v = kurtosis( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = kurtosis( 1.0, 0.0, 1.5 ); +let y = kurtosis( 1.0, 0.0, 1.5 ); // returns NaN y = kurtosis( 0.0, 1.0, -1.0 ); @@ -117,20 +117,14 @@ y = kurtosis( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/triangular/kurtosis' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = kurtosis( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/triangular/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = kurtosis( a, b, c ); console.log( 'a: %d, b: %d, c: %d, Kurt(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/README.md index 2712eaf1d427..500d4f50a6d1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/README.md @@ -50,7 +50,7 @@ where `a` is the lower limit, `b` is the upper limit, and `c` is the mode. ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/triangular/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/triangular/logcdf' ); ``` #### logcdf( x, a, b, c ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/triangular/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var y = logcdf( 0.5, -1.0, 1.0, 0.0 ); +let y = logcdf( 0.5, -1.0, 1.0, 0.0 ); // returns ~-0.134 y = logcdf( 0.5, -1.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = logcdf( -2.0, -1.0, 1.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0, 0.5 ); +let y = logcdf( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = logcdf( 0.0, NaN, 1.0, 0.5 ); @@ -90,7 +90,7 @@ y = logcdf( 2.0, 1.0, 0.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 1.0, 0.0, 1.5 ); +let y = logcdf( 2.0, 1.0, 0.0, 1.5 ); // returns NaN y = logcdf( 2.0, 1.0, 0.0, -1.0 ); @@ -105,8 +105,8 @@ y = logcdf( 2.0, 0.0, -1.0, 0.5 ); Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var mylogcdf = logcdf.factory( 0.0, 10.0, 2.0 ); -var y = mylogcdf( 0.5 ); +const mylogcdf = logcdf.factory( 0.0, 10.0, 2.0 ); +let y = mylogcdf( 0.5 ); // returns ~-4.382 y = mylogcdf( 8.0 ); @@ -134,22 +134,15 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/triangular/logcdf' ); - -var a; -var b; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = randu() * 30.0; - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + ((b-a) * randu()); - y = logcdf( x, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/triangular/logcdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = randu() * 30.0; + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + ((b-a) * randu()); + const y = logcdf( x, a, b, c ); console.log( 'x: %d, a: %d, b: %d, c: %d, ln(F(x;a,b,c)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/logpdf/README.md index 24706c185e2f..6468bbcff489 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/logpdf/README.md @@ -50,7 +50,7 @@ where `a` is the lower limit and `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/triangular/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/triangular/logpdf' ); ``` #### logpdf( x, a, b, c ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/triangular/logpdf' ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var y = logpdf( 0.5, -1.0, 1.0, 0.0 ); +let y = logpdf( 0.5, -1.0, 1.0, 0.0 ); // returns ~-0.693 y = logpdf( 0.5, -1.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = logpdf( -2.0, -1.0, 1.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0, 0.5 ); +let y = logpdf( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = logpdf( 0.0, NaN, 1.0, 0.5 ); @@ -90,7 +90,7 @@ y = logpdf( 2.0, 1.0, 0.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = logpdf( 1.0, 1.0, 0.0, 1.5 ); +let y = logpdf( 1.0, 1.0, 0.0, 1.5 ); // returns NaN y = logpdf( 1.0, 1.0, 0.0, -1.0 ); @@ -105,8 +105,8 @@ y = logpdf( 1.0, 0.0, -1.0, 0.5 ); Returns a function for evaluating the natural logarithm of the [probability density function][pdf] (PDF) of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var mylogpdf = logpdf.factory( 0.0, 10.0, 5.0 ); -var y = mylogpdf( 2.0 ); +const mylogpdf = logpdf.factory( 0.0, 10.0, 5.0 ); +let y = mylogpdf( 2.0 ); // returns ~-2.526 y = mylogpdf( 12.0 ); @@ -134,22 +134,15 @@ y = mylogpdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/triangular/logpdf' ); - -var a; -var b; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = randu() * 30.0; - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + ((b-a) * randu()); - y = logpdf( x, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/triangular/logpdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = randu() * 30.0; + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + ((b-a) * randu()); + const y = logpdf( x, a, b, c ); console.log( 'x: %d, a: %d, b: %d, c: %d, ln(f(x;a,b,c)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/mean/README.md index b5a3fdcb4da4..744c9c73c709 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/mean/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/triangular/mean' ); +const mean = require( '@stdlib/stats/base/dists/triangular/mean' ); ``` #### mean( a, b, c ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/triangular/mean' ); Returns the [expected value][expected-value] of a [triangular][triangular-distribution] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var v = mean( 0.0, 1.0, 0.8 ); +let v = mean( 0.0, 1.0, 0.8 ); // returns ~0.6 v = mean( 4.0, 12.0, 5.0 ); @@ -75,7 +75,7 @@ v = mean( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 4.0, 2.0 ); +let v = mean( NaN, 4.0, 2.0 ); // returns NaN v = mean( 0.0, NaN, 2.0 ); @@ -88,7 +88,7 @@ v = mean( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = mean( 1.0, 0.0, 1.5 ); +let y = mean( 1.0, 0.0, 1.5 ); // returns NaN y = mean( 0.0, 1.0, -1.0 ); @@ -119,20 +119,14 @@ y = mean( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/triangular/mean' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = mean( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/triangular/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = mean( a, b, c ); console.log( 'a: %d, b: %d, c: %d, E(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/median/README.md index 3f7212ad5e10..324f7cbe4432 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/median/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/triangular/median' ); +const median = require( '@stdlib/stats/base/dists/triangular/median' ); ``` #### median( a, b, c ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/triangular/median' ); Returns the [median][median] of a [triangular][triangular-distribution] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var v = median( 0.0, 1.0, 0.8 ); +let v = median( 0.0, 1.0, 0.8 ); // returns ~0.632 v = median( 4.0, 12.0, 5.0 ); @@ -75,7 +75,7 @@ v = median( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 4.0, 2.0 ); +let v = median( NaN, 4.0, 2.0 ); // returns NaN v = median( 0.0, NaN, 2.0 ); @@ -88,7 +88,7 @@ v = median( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = median( 1.0, 0.0, 1.5 ); +let y = median( 1.0, 0.0, 1.5 ); // returns NaN y = median( 0.0, 1.0, -1.0 ); @@ -119,20 +119,14 @@ y = median( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/triangular/median' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = median( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/triangular/median' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = median( a, b, c ); console.log( 'a: %d, b: %d, c: %d, Median(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/README.md index 4e5695ae33b9..f64f5a21a9cd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit, and `c` is the mode of the ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/triangular/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/triangular/mgf' ); ``` #### mgf( t, a, b, c ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/triangular/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode). ```javascript -var y = mgf( 0.5, -1.0, 1.0, 0.0 ); +let y = mgf( 0.5, -1.0, 1.0, 0.0 ); // returns ~1.021 y = mgf( 0.5, -1.0, 1.0, 0.5 ); @@ -78,7 +78,7 @@ y = mgf( -2.0, -1.0, 1.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0, 0.5 ); +let y = mgf( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = mgf( 0.0, NaN, 1.0, 0.5 ); @@ -94,7 +94,7 @@ y = mgf( 2.0, 1.0, 0.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = mgf( 2.0, 1.0, 0.0, 1.5 ); +let y = mgf( 2.0, 1.0, 0.0, 1.5 ); // returns NaN y = mgf( 2.0, 1.0, 0.0, -1.0 ); @@ -109,9 +109,9 @@ y = mgf( 2.0, 0.0, -1.0, 0.5 ); Returns a function for evaluating the [moment-generating function][mgf] of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode). ```javascript -var mymgf = mgf.factory( 0.0, 2.0, 1.0 ); +const mymgf = mgf.factory( 0.0, 2.0, 1.0 ); -var y = mymgf( -1.0 ); +let y = mymgf( -1.0 ); // returns ~0.3996 y = mymgf( 2.0 ); @@ -139,22 +139,15 @@ y = mymgf( 2.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/triangular/mgf' ); - -var a; -var b; -var c; -var t; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 5.0; - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + (( b - a ) * randu()); - v = mgf( t, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/triangular/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 5.0; + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + (( b - a ) * randu()); + const v = mgf( t, a, b, c ); console.log( 't: %d, a: %d, b: %d, c: %d, M_X(t;a,b,c): %d', t.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/mode/README.md index 2cf3a2146afc..3462a8c7e3a2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/mode/README.md @@ -52,7 +52,7 @@ The [mode][mode] for a [triangular][triangular-distribution] random variable wit ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/triangular/mode' ); +const mode = require( '@stdlib/stats/base/dists/triangular/mode' ); ``` #### mode( a, b, c ) @@ -60,7 +60,7 @@ var mode = require( '@stdlib/stats/base/dists/triangular/mode' ); Returns the [mode][mode] of a [triangular][triangular-distribution] distribution with parameters `a` (minimum support), `b` (maximum support), and `c` (mode). ```javascript -var v = mode( 0.0, 1.0, 0.8 ); +let v = mode( 0.0, 1.0, 0.8 ); // returns 0.8 v = mode( 4.0, 12.0, 5.0 ); @@ -73,7 +73,7 @@ v = mode( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 4.0, 2.0 ); +let v = mode( NaN, 4.0, 2.0 ); // returns NaN v = mode( 0.0, NaN, 2.0 ); @@ -86,7 +86,7 @@ v = mode( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = mode( 1.0, 0.0, 1.5 ); +let y = mode( 1.0, 0.0, 1.5 ); // returns NaN y = mode( 0.0, 1.0, -1.0 ); @@ -117,20 +117,14 @@ y = mode( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mode = require( '@stdlib/stats/base/dists/triangular/mode' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = mode( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const mode = require( '@stdlib/stats/base/dists/triangular/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = mode( a, b, c ); console.log( 'a: %d, b: %d, c: %d, mode(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/pdf/README.md index bb5659703e59..39d1db605143 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/pdf/README.md @@ -50,7 +50,7 @@ where `a` is the lower limit and `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/triangular/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/triangular/pdf' ); ``` #### pdf( x, a, b, c ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/triangular/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var y = pdf( 0.5, -1.0, 1.0, 0.0 ); +let y = pdf( 0.5, -1.0, 1.0, 0.0 ); // returns 0.5 y = pdf( 0.5, -1.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = pdf( -2.0, -1.0, 1.0, 0.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0, 0.5 ); +let y = pdf( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = pdf( 0.0, NaN, 1.0, 0.5 ); @@ -90,7 +90,7 @@ y = pdf( 2.0, 1.0, 0.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = pdf( 1.0, 1.0, 0.0, 1.5 ); +let y = pdf( 1.0, 1.0, 0.0, 1.5 ); // returns NaN y = pdf( 1.0, 1.0, 0.0, -1.0 ); @@ -105,8 +105,8 @@ y = pdf( 1.0, 0.0, -1.0, 0.5 ); Returns a function for evaluating the [probability density function][pdf] (PDF) of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var mypdf = pdf.factory( 0.0, 10.0, 5.0 ); -var y = mypdf( 2.0 ); +const mypdf = pdf.factory( 0.0, 10.0, 5.0 ); +let y = mypdf( 2.0 ); // returns 0.08 y = mypdf( 12.0 ); @@ -124,22 +124,15 @@ y = mypdf( 12.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/triangular/pdf' ); - -var a; -var b; -var c; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = randu() * 30.0; - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + ((b-a) * randu()); - y = pdf( x, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/triangular/pdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = randu() * 30.0; + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + ((b-a) * randu()); + const y = pdf( x, a, b, c ); console.log( 'x: %d, a: %d, b: %d, c: %d, f(x;a,b,c): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/quantile/README.md index ec2684a0c76d..e8d26901fbb9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/quantile/README.md @@ -50,7 +50,7 @@ where `a` is the lower limit, `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/triangular/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/triangular/quantile' ); ``` #### quantile( p, a, b, c ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/triangular/quantile' ); Evaluates the [quantile function][quantile-function] for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var y = quantile( 0.9, -1.0, 1.0, 0.0 ); +let y = quantile( 0.9, -1.0, 1.0, 0.0 ); // returns ~0.553 y = quantile( 0.1, -1.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = quantile( 0.8, 0.0, 20.0, 0.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0, 0.5 ); +let y = quantile( 1.9, 0.0, 1.0, 0.5 ); // returns NaN y = quantile( -0.1, 0.0, 1.0, 0.5 ); @@ -84,7 +84,7 @@ y = quantile( -0.1, 0.0, 1.0, 0.5 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0, 0.5 ); +let y = quantile( NaN, 0.0, 1.0, 0.5 ); // returns NaN y = quantile( 0.1, NaN, 1.0, 0.5 ); @@ -100,7 +100,7 @@ y = quantile( 0.1, 0.0, 1.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = quantile( 0.1, 1.0, 0.0, 1.5 ); +let y = quantile( 0.1, 1.0, 0.0, 1.5 ); // returns NaN y = quantile( 0.1, 1.0, 0.0, -1.0 ); @@ -115,8 +115,8 @@ y = quantile( 0.1, 0.0, -1.0, 0.5 ); Returns a function for evaluating the [quantile function][quantile-function] of a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode). ```javascript -var myquantile = quantile.factory( 2.0, 4.0, 2.5 ); -var y = myquantile( 0.4 ); +const myquantile = quantile.factory( 2.0, 4.0, 2.5 ); +let y = myquantile( 0.4 ); // returns ~2.658 y = myquantile( 0.8 ); @@ -134,22 +134,15 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/triangular/quantile' ); - -var a; -var b; -var c; -var p; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - p = randu(); - a = randu() * 10.0; - b = a + (randu() * 40.0); - c = a + ((b-a) * randu()); - y = quantile( p, a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/triangular/quantile' ); + +for ( let i = 0; i < 25; i++ ) { + const p = randu(); + const a = randu() * 10.0; + const b = a + (randu() * 40.0); + const c = a + ((b-a) * randu()); + const y = quantile( p, a, b, c ); console.log( 'p: %d, a: %d, b: %d, c: %d, Q(p;a,b,c): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/skewness/README.md index 4ef32b773014..6c5dbe0f5ec3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/skewness/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/triangular/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/triangular/skewness' ); ``` #### skewness( a, b, c ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/triangular/skewness' ); Returns the [skewness][skewness] of a [triangular][triangular-distribution] distribution with minimum support `a`, maximum support`b`, and mode `c`. ```javascript -var v = skewness( 0.0, 1.0, 0.8 ); +let v = skewness( 0.0, 1.0, 0.8 ); // returns ~-0.476 v = skewness( 4.0, 12.0, 5.0 ); @@ -75,7 +75,7 @@ v = skewness( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 4.0, 2.0 ); +let v = skewness( NaN, 4.0, 2.0 ); // returns NaN v = skewness( 0.0, NaN, 2.0 ); @@ -88,7 +88,7 @@ v = skewness( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = skewness( 1.0, 0.0, 1.5 ); +let y = skewness( 1.0, 0.0, 1.5 ); // returns NaN y = skewness( 0.0, 1.0, -1.0 ); @@ -119,20 +119,14 @@ y = skewness( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/triangular/skewness' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = skewness( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/triangular/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = skewness( a, b, c ); console.log( 'a: %d, b: %d, c: %d, skew(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/stdev/README.md index bf8389a93698..ea3ac4942396 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/stdev/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit, and `c` is the mode. ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/triangular/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/triangular/stdev' ); ``` #### stdev( a, b, c ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/triangular/stdev' ); Returns the [standard deviation][standard-deviation] of a [triangular][triangular-distribution] distribution with minimum support `a`, maximum support`b`, and mode `c`. ```javascript -var v = stdev( 0.0, 1.0, 0.8 ); +let v = stdev( 0.0, 1.0, 0.8 ); // returns ~0.216 v = stdev( 4.0, 12.0, 5.0 ); @@ -75,7 +75,7 @@ v = stdev( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 4.0, 2.0 ); +let v = stdev( NaN, 4.0, 2.0 ); // returns NaN v = stdev( 0.0, NaN, 2.0 ); @@ -88,7 +88,7 @@ v = stdev( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = stdev( 1.0, 0.0, 1.5 ); +let y = stdev( 1.0, 0.0, 1.5 ); // returns NaN y = stdev( 0.0, 1.0, -1.0 ); @@ -119,20 +119,14 @@ y = stdev( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/triangular/stdev' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = stdev( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/triangular/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = stdev( a, b, c ); console.log( 'a: %d, b: %d, c: %d, SD(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/triangular/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/triangular/variance/README.md index c802a1d9e5c4..ff09f31c76aa 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/triangular/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/triangular/variance/README.md @@ -54,7 +54,7 @@ where `a` is the lower limit, `b` is the upper limit and `c` is the mode. ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/triangular/variance' ); +const variance = require( '@stdlib/stats/base/dists/triangular/variance' ); ``` #### variance( a, b, c ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/triangular/variance' ); Returns the [variance][variance] of a [triangular][triangular-distribution] distribution with minimum support `a`, maximum support`b`, and mode `c`. ```javascript -var v = variance( 0.0, 1.0, 0.8 ); +let v = variance( 0.0, 1.0, 0.8 ); // returns ~0.047 v = variance( 4.0, 12.0, 5.0 ); @@ -75,7 +75,7 @@ v = variance( 2.0, 8.0, 5.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 4.0, 2.0 ); +let v = variance( NaN, 4.0, 2.0 ); // returns NaN v = variance( 0.0, NaN, 2.0 ); @@ -88,7 +88,7 @@ v = variance( 0.0, 4.0, NaN ); If provided parameters not satisfying `a <= c <= b`, the function returns `NaN`. ```javascript -var y = variance( 1.0, 0.0, 1.5 ); +let y = variance( 1.0, 0.0, 1.5 ); // returns NaN y = variance( 0.0, 1.0, -1.0 ); @@ -119,20 +119,14 @@ y = variance( 0.0, -1.0, 0.5 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/triangular/variance' ); - -var a; -var b; -var c; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - c = ( randu()*( b-a ) ) + a; - v = variance( a, b, c ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/triangular/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const c = ( randu()*( b-a ) ) + a; + const v = variance( a, b, c ); console.log( 'a: %d, b: %d, c: %d, Var(X;a,b,c): %d', a.toFixed( 4 ), b.toFixed( 4 ), c.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/README.md b/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/README.md index fba953437732..fcb0155ee81f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); +const truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); ``` #### truncatedNormal @@ -35,7 +35,7 @@ var truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); Truncated normal distribution. ```javascript -var dist = truncatedNormal; +const dist = truncatedNormal; // returns {...} ``` @@ -76,7 +76,7 @@ The namespace contains a constructor function for creating a [truncated normal][ ```javascript -var truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); +const truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); /* * Let's consider an example where we're modeling the heights of astronauts. @@ -85,10 +85,10 @@ var truncatedNormal = require( '@stdlib/stats/base/dists/truncated-normal' ); * In this example, we'll assume a = 150 (minimum height), b = 200 (maximum height), mu = 175 (location parameter), and sigma = 10 (scale parameter). */ -var a = 150.0; -var b = 200.0; -var mu = 175.0; -var sigma = 10.0; +const a = 150.0; +const b = 200.0; +const mu = 175.0; +const sigma = 10.0; // Calculate the probability density function (PDF) for a height of 180 cm: console.log( truncatedNormal.pdf( 180, a, b, mu, sigma ) ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/pdf/README.md index 26232640a149..c06e3a131cda 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/truncated-normal/pdf/README.md @@ -51,7 +51,7 @@ where `Phi` and `phi` denote the [cumulative distribution function][cdf] and [de ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/truncated-normal/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/truncated-normal/pdf' ); ``` #### pdf( x, a, b, mu, sigma ) @@ -59,7 +59,7 @@ var pdf = require( '@stdlib/stats/base/dists/truncated-normal/pdf' ); Evaluates the probability density function (PDF) for a [truncated normal][truncated-normal-distribution] distribution with lower limit `a`, upper limit `b`, location parameter `mu`, and scale parameter `sigma`. ```javascript -var y = pdf( 0.9, 0.0, 1.0, 0.0, 1.0 ); +let y = pdf( 0.9, 0.0, 1.0, 0.0, 1.0 ); // returns ~0.7795 y = pdf( 0.9, 0.0, 1.0, 0.5, 1.0 ); @@ -78,7 +78,7 @@ y = pdf( -0.9, 0.0, 1.0, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0, 0.5, 2.0 ); +let y = pdf( NaN, 0.0, 1.0, 0.5, 2.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0, 0.5, 2.0 ); @@ -99,8 +99,8 @@ y = pdf( 0.6, 0.0, 1.0, 0.5, NaN ); Returns a function for evaluating the [probability density function][pdf] (PDF) for a [truncated normal][truncated-normal-distribution] distribution. ```javascript -var myPDF = pdf.factory( 0.0, 1.0, 0.0, 1.0 ); -var y = myPDF( 0.8 ); +let myPDF = pdf.factory( 0.0, 1.0, 0.0, 1.0 ); +let y = myPDF( 0.8 ); // returns ~0.849 myPDF = pdf.factory( 0.0, 1.0, 0.5, 1.0 ); @@ -119,24 +119,16 @@ y = myPDF( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/truncated-normal/pdf' ); - -var sigma; -var mu; -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - a = ( randu() * 80.0 ) - 40.0; - b = a + ( randu() * 80.0 ); - x = ( randu() * 40.0 ) + a; - mu = ( randu() * 20.0 ) - 10.0; - sigma = ( randu() * 10.0 ) + 2.0; - y = pdf( x, a, b, mu, sigma ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/truncated-normal/pdf' ); + +for ( let i = 0; i < 25; i++ ) { + const a = ( randu() * 80.0 ) - 40.0; + const b = a + ( randu() * 80.0 ); + const x = ( randu() * 40.0 ) + a; + const mu = ( randu() * 20.0 ) - 10.0; + const sigma = ( randu() * 10.0 ) + 2.0; + const y = pdf( x, a, b, mu, sigma ); console.log( 'x: %d, a: %d, b: %d, mu: %d, sigma: %d, f(x;a,b,mu,sigma): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/README.md index d6fdbaba42ef..dfc11469b820 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uniform = require( '@stdlib/stats/base/dists/uniform' ); +const uniform = require( '@stdlib/stats/base/dists/uniform' ); ``` #### uniform @@ -35,7 +35,7 @@ var uniform = require( '@stdlib/stats/base/dists/uniform' ); Continuous uniform distribution. ```javascript -var dist = uniform; +const dist = uniform; // returns {...} ``` @@ -87,11 +87,11 @@ The namespace contains a constructor function for creating a [continuous uniform ```javascript -var Uniform = require( '@stdlib/stats/base/dists/uniform' ).Uniform; +const Uniform = require( '@stdlib/stats/base/dists/uniform' ).Uniform; -var dist = new Uniform( 2.0, 4.0 ); +const dist = new Uniform( 2.0, 4.0 ); -var y = dist.cdf( 2.5 ); +const y = dist.cdf( 2.5 ); // returns 0.25 ``` @@ -108,7 +108,7 @@ var y = dist.cdf( 2.5 ); ```javascript -var uniform = require( '@stdlib/stats/base/dists/uniform' ); +const uniform = require( '@stdlib/stats/base/dists/uniform' ); /* Let's consider an example where we are modeling the arrival times of guests @@ -118,27 +118,27 @@ continuous uniform distribution with a minimum value of 0 (6:00 PM) and a maximum value of 120 (8:00 PM). */ -var min = 0.0; // 6:00 PM is 0 minutes after 6:00 PM. -var max = 120.0; // 8:00 PM is 120 minutes after 6:00 PM. +const min = 0.0; // 6:00 PM is 0 minutes after 6:00 PM. +const max = 120.0; // 8:00 PM is 120 minutes after 6:00 PM. -var mean = uniform.mean( min, max ); +const mean = uniform.mean( min, max ); // returns 60.0 -var variance = uniform.variance( min, max ); +const variance = uniform.variance( min, max ); // returns 1200.0 -var stdDev = uniform.stdev( min, max ); +const stdDev = uniform.stdev( min, max ); // returns ~34.641 -var entropy = uniform.entropy( min, max ); +const entropy = uniform.entropy( min, max ); // returns ~4.787 // Probability of arrival within 30 minutes after 6:00 PM: -var p = uniform.cdf( 30, min, max ); +const p = uniform.cdf( 30, min, max ); // returns 0.25 // Evaluate the PDF at 30 minutes after 6:00 PM: -var pdf = uniform.pdf( 30, min, max ); +const pdf = uniform.pdf( 30, min, max ); // returns ~0.0083 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/cdf/README.md index 62334f5c3761..45a949765d31 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/cdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/uniform/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/uniform/cdf' ); ``` #### cdf( x, a, b ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/uniform/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = cdf( 9.0, 0.0, 10.0 ); +let y = cdf( 9.0, 0.0, 10.0 ); // returns 0.9 y = cdf( 0.5, 0.0, 2.0 ); @@ -74,7 +74,7 @@ y = cdf( +Infinity, 2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 0.0, 1.0 ); +let y = cdf( NaN, 0.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = cdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = cdf( 1.0, 2.5, 2.0 ); +const y = cdf( 1.0, 2.5, 2.0 ); // returns NaN ``` @@ -96,8 +96,8 @@ var y = cdf( 1.0, 2.5, 2.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mycdf = cdf.factory( 0.0, 10.0 ); -var y = mycdf( 0.5 ); +const mycdf = cdf.factory( 0.0, 10.0 ); +let y = mycdf( 0.5 ); // returns 0.05 y = mycdf( 8.0 ); @@ -115,20 +115,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/uniform/cdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = (randu() * 20.0) - 10.0; - a = (randu() * 20.0) - 20.0; - b = a + (randu() * 40.0); - y = cdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/uniform/cdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = (randu() * 20.0) - 10.0; + const a = (randu() * 20.0) - 20.0; + const b = a + (randu() * 40.0); + const y = cdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/ctor/README.md index 1be56f34b145..ea3f78809ec8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Uniform = require( '@stdlib/stats/base/dists/uniform/ctor' ); +const Uniform = require( '@stdlib/stats/base/dists/uniform/ctor' ); ``` #### Uniform( \[a, b] ) @@ -45,18 +45,18 @@ var Uniform = require( '@stdlib/stats/base/dists/uniform/ctor' ); Returns an [uniform][uniform-distribution] distribution object. ```javascript -var uniform = new Uniform(); +const uniform = new Uniform(); -var mu = uniform.mean; +const mu = uniform.mean; // returns 0.5 ``` By default, `a = 0.0` and `b = 1.0`. To create a distribution having a different `a` (minimum support) and `b` (maximum support), provide the corresponding arguments. ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var mu = uniform.mean; +const mu = uniform.mean; // returns 3.0 ``` @@ -73,9 +73,9 @@ An [uniform][uniform-distribution] distribution object has the following propert Minimum support of the distribution. `a` **must** be a number smaller than `b`. ```javascript -var uniform = new Uniform(); +const uniform = new Uniform(); -var a = uniform.a; +let a = uniform.a; // returns 0.0 uniform.a = 0.5; @@ -89,9 +89,9 @@ a = uniform.a; Maximum support of the distribution. `b` **must** be a number larger than `a`. ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var b = uniform.b; +let b = uniform.b; // returns 4.0 uniform.b = 3.0; @@ -109,9 +109,9 @@ b = uniform.b; Returns the [differential entropy][entropy]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var entropy = uniform.entropy; +const entropy = uniform.entropy; // returns ~2.079 ``` @@ -120,9 +120,9 @@ var entropy = uniform.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var kurtosis = uniform.kurtosis; +const kurtosis = uniform.kurtosis; // returns -1.2 ``` @@ -131,9 +131,9 @@ var kurtosis = uniform.kurtosis; Returns the [expected value][expected-value]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var mu = uniform.mean; +const mu = uniform.mean; // returns 8.0 ``` @@ -142,9 +142,9 @@ var mu = uniform.mean; Returns the [median][median]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var median = uniform.median; +const median = uniform.median; // returns 8.0 ``` @@ -153,9 +153,9 @@ var median = uniform.median; Returns the [skewness][skewness]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var skewness = uniform.skewness; +const skewness = uniform.skewness; // returns 0.0 ``` @@ -164,9 +164,9 @@ var skewness = uniform.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var s = uniform.stdev; +const s = uniform.stdev; // returns ~2.309 ``` @@ -175,9 +175,9 @@ var s = uniform.stdev; Returns the [variance][variance]. ```javascript -var uniform = new Uniform( 4.0, 12.0 ); +const uniform = new Uniform( 4.0, 12.0 ); -var s2 = uniform.variance; +const s2 = uniform.variance; // returns ~5.333 ``` @@ -190,9 +190,9 @@ var s2 = uniform.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var y = uniform.cdf( 2.5 ); +const y = uniform.cdf( 2.5 ); // returns 0.25 ``` @@ -201,9 +201,9 @@ var y = uniform.cdf( 2.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF). ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var y = uniform.logcdf( 2.5 ); +const y = uniform.logcdf( 2.5 ); // returns ~-1.386 ``` @@ -212,9 +212,9 @@ var y = uniform.logcdf( 2.5 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var y = uniform.logpdf( 2.5 ); +const y = uniform.logpdf( 2.5 ); // returns ~-0.693 ``` @@ -223,9 +223,9 @@ var y = uniform.logpdf( 2.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var y = uniform.pdf( 2.5 ); +const y = uniform.pdf( 2.5 ); // returns 0.5 ``` @@ -234,9 +234,9 @@ var y = uniform.pdf( 2.5 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var y = uniform.quantile( 0.5 ); +let y = uniform.quantile( 0.5 ); // returns 3.0 y = uniform.quantile( 1.9 ); @@ -266,20 +266,20 @@ y = uniform.quantile( 1.9 ); ```javascript -var Uniform = require( '@stdlib/stats/base/dists/uniform/ctor' ); +const Uniform = require( '@stdlib/stats/base/dists/uniform/ctor' ); -var uniform = new Uniform( 2.0, 4.0 ); +const uniform = new Uniform( 2.0, 4.0 ); -var mu = uniform.mean; +const mu = uniform.mean; // returns 3.0 -var median = uniform.median; +const median = uniform.median; // returns 3.0 -var s2 = uniform.variance; +const s2 = uniform.variance; // returns ~0.333 -var y = uniform.cdf( 2.5 ); +const y = uniform.cdf( 2.5 ); // returns 0.25 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/entropy/README.md index 6c9dec8cd0a7..a8dbc7f315e5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/entropy/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/uniform/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/uniform/entropy' ); ``` #### entropy( a, b ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/uniform/entropy' ); Returns the [differential entropy][entropy] of a [uniform][uniform-distribution] distribution with minimum support `a` and maximum support `b` (in [nats][nats]). ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns 0.0 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = entropy( 3.0, 2.0 ); +let y = entropy( 3.0, 2.0 ); // returns NaN y = entropy( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = entropy( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var entropy = require( '@stdlib/stats/base/dists/uniform/entropy' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = entropy( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const entropy = require( '@stdlib/stats/base/dists/uniform/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = entropy( a, b ); console.log( 'a: %d, b: %d, h(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/kurtosis/README.md index 66d6bfda449a..df62c1b43dc8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/kurtosis/README.md @@ -52,7 +52,7 @@ The [excess kurtosis][kurtosis] for a [uniform][uniform-distribution] random var ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/uniform/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/uniform/kurtosis' ); ``` #### kurtosis( a, b ) @@ -60,7 +60,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/uniform/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns -1.2 v = kurtosis( 4.0, 12.0 ); @@ -73,7 +73,7 @@ v = kurtosis( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -83,7 +83,7 @@ v = kurtosis( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = kurtosis( 3.0, 2.0 ); +let y = kurtosis( 3.0, 2.0 ); // returns NaN y = kurtosis( 3.0, 3.0 ); @@ -111,18 +111,13 @@ y = kurtosis( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var kurtosis = require( '@stdlib/stats/base/dists/uniform/kurtosis' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = kurtosis( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const kurtosis = require( '@stdlib/stats/base/dists/uniform/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = kurtosis( a, b ); console.log( 'a: %d, b: %d, Kurt(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md index d2fc53a00424..7ca63a5e351e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/uniform/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/uniform/logcdf' ); ``` #### logcdf( x, a, b ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/uniform/logcdf' ); Evaluates the logarithm of the [cumulative distribution function][cdf] (CDF) for a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logcdf( 9.0, 0.0, 10.0 ); +let y = logcdf( 9.0, 0.0, 10.0 ); // returns ~-0.105 y = logcdf( 0.5, 0.0, 2.0 ); @@ -74,7 +74,7 @@ y = logcdf( +Infinity, 2.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 0.0, 1.0 ); +let y = logcdf( NaN, 0.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = logcdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = logcdf( 1.0, 2.5, 2.0 ); +const y = logcdf( 1.0, 2.5, 2.0 ); // returns NaN ``` @@ -96,8 +96,8 @@ var y = logcdf( 1.0, 2.5, 2.0 ); Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mylogcdf = logcdf.factory( 0.0, 10.0 ); -var y = mylogcdf( 0.5 ); +const mylogcdf = logcdf.factory( 0.0, 10.0 ); +let y = mylogcdf( 0.5 ); // returns ~-2.996 y = mylogcdf( 8.0 ); @@ -125,20 +125,14 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/uniform/logcdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = (randu() * 20.0) - 10.0; - a = (randu() * 20.0) - 20.0; - b = a + (randu() * 40.0); - y = logcdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/uniform/logcdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = (randu() * 20.0) - 10.0; + const a = (randu() * 20.0) - 20.0; + const b = a + (randu() * 40.0); + const y = logcdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(F(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/logpdf/README.md index 6382d067238c..56dc38900e16 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/logpdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/uniform/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/uniform/logpdf' ); ``` #### logpdf( x, a, b ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/uniform/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = logpdf( 2.0, 0.0, 4.0 ); +let y = logpdf( 2.0, 0.0, 4.0 ); // returns ~-1.386 y = logpdf( 5.0, 0.0, 4.0 ); @@ -71,7 +71,7 @@ y = logpdf( 0.25, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 0.0, 1.0 ); +let y = logpdf( NaN, 0.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = logpdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = logpdf( 2.5, 3.0, 2.0 ); +let y = logpdf( 2.5, 3.0, 2.0 ); // returns NaN y = logpdf( 2.5, 3.0, 3.0 ); @@ -96,8 +96,8 @@ y = logpdf( 2.5, 3.0, 3.0 ); Returns a `function` for evaluating the logarithm of the [PDF][pdf] of a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mylogPDF = logpdf.factory( 6.0, 7.0 ); -var y = mylogPDF( 7.0 ); +const mylogPDF = logpdf.factory( 6.0, 7.0 ); +let y = mylogPDF( 7.0 ); // returns 0.0 y = mylogPDF( 5.0 ); @@ -125,20 +125,14 @@ y = mylogPDF( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/uniform/logpdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = (randu() * 20.0) - 10.0; - a = (randu() * 20.0) - 20.0; - b = a + (randu() * 40.0); - y = logpdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/uniform/logpdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = (randu() * 20.0) - 10.0; + const a = (randu() * 20.0) - 20.0; + const b = a + (randu() * 40.0); + const y = logpdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, ln(f(x;a,b)): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/mean/README.md index 6d151d6a3108..a21b96716294 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/mean/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/uniform/mean' ); +const mean = require( '@stdlib/stats/base/dists/uniform/mean' ); ``` #### mean( a, b ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/uniform/mean' ); Returns the [expected value][expected-value] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns 0.5 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = mean( 3.0, 2.0 ); +let y = mean( 3.0, 2.0 ); // returns NaN y = mean( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = mean( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mean = require( '@stdlib/stats/base/dists/uniform/mean' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = mean( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mean = require( '@stdlib/stats/base/dists/uniform/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = mean( a, b ); console.log( 'a: %d, b: %d, E(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/median/README.md index 3c8648c51458..5abf769b9e9e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/median/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/uniform/median' ); +const median = require( '@stdlib/stats/base/dists/uniform/median' ); ``` #### median( a, b ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/uniform/median' ); Returns the [median][median] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = median( 0.0, 1.0 ); +let v = median( 0.0, 1.0 ); // returns 0.5 v = median( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = median( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -85,7 +85,7 @@ v = median( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = median( 3.0, 2.0 ); +let y = median( 3.0, 2.0 ); // returns NaN y = median( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = median( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var median = require( '@stdlib/stats/base/dists/uniform/median' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = median( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const median = require( '@stdlib/stats/base/dists/uniform/median' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = median( a, b ); console.log( 'a: %d, b: %d, Median(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/mgf/README.md index 3d2779eb0954..61fcda360c23 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/mgf/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` is the maximum support. The parameters ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/uniform/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/uniform/mgf' ); ``` #### mgf( t, a, b ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/uniform/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = mgf( 2.0, 0.0, 4.0 ); +let y = mgf( 2.0, 0.0, 4.0 ); // returns ~372.495 y = mgf( -0.2, 0.0, 4.0 ); @@ -75,7 +75,7 @@ y = mgf( 2.0, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 0.0, 1.0 ); +let y = mgf( NaN, 0.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -88,7 +88,7 @@ y = mgf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = mgf( 0.5, 3.0, 2.0 ); +let y = mgf( 0.5, 3.0, 2.0 ); // returns NaN y = mgf( 0.5, 3.0, 3.0 ); @@ -100,8 +100,8 @@ y = mgf( 0.5, 3.0, 3.0 ); Returns a function for evaluating the [moment-generating function][mgf] (MGF) of a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var mymgf = mgf.factory( 6.0, 7.0 ); -var y = mymgf( 0.1 ); +const mymgf = mgf.factory( 6.0, 7.0 ); +let y = mymgf( 0.1 ); // returns ~1.916 y = mymgf( 1.1 ); @@ -129,20 +129,14 @@ y = mymgf( 1.1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mgf = require( '@stdlib/stats/base/dists/uniform/mgf' ); - -var a; -var b; -var t; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu(); - a = randu() * 5.0; - b = a + (randu() * 5.0); - v = mgf( t, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const mgf = require( '@stdlib/stats/base/dists/uniform/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu(); + const a = randu() * 5.0; + const b = a + (randu() * 5.0); + const v = mgf( t, a, b ); console.log( 't: %d, a: %d, b: %d, M_X(t;a,b): %d', t.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/pdf/README.md index 611f951be7c0..32c2fa8d2316 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/pdf/README.md @@ -50,7 +50,7 @@ where `a` is the minimum support and `b` is the maximum support of the distribut ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/uniform/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/uniform/pdf' ); ``` #### pdf( x, a, b ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/uniform/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = pdf( 2.0, 0.0, 4.0 ); +let y = pdf( 2.0, 0.0, 4.0 ); // returns 0.25 y = pdf( 5.0, 0.0, 4.0 ); @@ -71,7 +71,7 @@ y = pdf( 0.25, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -84,7 +84,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = pdf( 2.5, 3.0, 2.0 ); +let y = pdf( 2.5, 3.0, 2.0 ); // returns NaN y = pdf( 2.5, 3.0, 3.0 ); @@ -96,8 +96,8 @@ y = pdf( 2.5, 3.0, 3.0 ); Returns a `function` for evaluating the [PDF][pdf] of a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myPDF = pdf.factory( 6.0, 7.0 ); -var y = myPDF( 7.0 ); +const myPDF = pdf.factory( 6.0, 7.0 ); +let y = myPDF( 7.0 ); // returns 1.0 y = myPDF( 5.0 ); @@ -115,20 +115,14 @@ y = myPDF( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/uniform/pdf' ); - -var a; -var b; -var x; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - x = (randu() * 20.0) - 10.0; - a = (randu() * 20.0) - 20.0; - b = a + (randu() * 40.0); - y = pdf( x, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/uniform/pdf' ); + +for ( let i = 0; i < 25; i++ ) { + const x = (randu() * 20.0) - 10.0; + const a = (randu() * 20.0) - 20.0; + const b = a + (randu() * 40.0); + const y = pdf( x, a, b ); console.log( 'x: %d, a: %d, b: %d, f(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/quantile/README.md index 72bbf832092a..c3301ca445f0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p <= 1`, where `a` is the minimum support and `b` is the maximum suppo ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/uniform/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/uniform/quantile' ); ``` #### quantile( p, a, b ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/uniform/quantile' ); Evaluates the [quantile function][quantile-function] for a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var y = quantile( 0.8, 0.0, 1.0 ); +let y = quantile( 0.8, 0.0, 1.0 ); // returns 0.8 y = quantile( 0.5, 0.0, 10.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.5, 0.0, 10.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 0.0, 1.0 ); +let y = quantile( 1.9, 0.0, 1.0 ); // returns NaN y = quantile( -0.1, 0.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 0.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 0.0, 1.0 ); +let y = quantile( NaN, 0.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 0.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 2.0, 1.0 ); +const y = quantile( 0.4, 2.0, 1.0 ); // returns NaN ``` @@ -100,7 +100,7 @@ var y = quantile( 0.4, 2.0, 1.0 ); Returns a function for evaluating the quantile function of a [continuous uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var myquantile = quantile.factory( 0.0, 4.0 ); +const myquantile = quantile.factory( 0.0, 4.0 ); y = myquantile( 0.8 ); // returns 3.2 ``` @@ -116,20 +116,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/uniform/quantile' ); - -var a; -var b; -var p; -var y; -var i; - -for ( i = 0; i < 25; i++ ) { - p = randu(); - a = (randu() * 20.0) - 20.0; - b = a + (randu() * 40.0); - y = quantile( p, a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/uniform/quantile' ); + +for ( let i = 0; i < 25; i++ ) { + const p = randu(); + const a = (randu() * 20.0) - 20.0; + const b = a + (randu() * 40.0); + const y = quantile( p, a, b ); console.log( 'p: %d, a: %d, b: %d, Q(p;a,b): %d', p.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/skewness/README.md index 50f0cedad6a8..be3694220d12 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/skewness/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/uniform/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/uniform/skewness' ); ``` #### skewness( a, b ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/uniform/skewness' ); Returns the [skewness][skewness] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = skewness( 0.0, 1.0 ); +let v = skewness( 0.0, 1.0 ); // returns 0.0 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = skewness( 3.0, 2.0 ); +let y = skewness( 3.0, 2.0 ); // returns NaN y = skewness( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = skewness( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var skewness = require( '@stdlib/stats/base/dists/uniform/skewness' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = skewness( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const skewness = require( '@stdlib/stats/base/dists/uniform/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = skewness( a, b ); console.log( 'a: %d, b: %d, skew(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/stdev/README.md index f2088c2443c7..29286eb66e17 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/stdev/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/uniform/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/uniform/stdev' ); ``` #### stdev( a, b ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/uniform/stdev' ); Returns the [standard deviation][standard-deviation] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns ~0.289 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = stdev( 3.0, 2.0 ); +let y = stdev( 3.0, 2.0 ); // returns NaN y = stdev( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = stdev( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var stdev = require( '@stdlib/stats/base/dists/uniform/stdev' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = stdev( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const stdev = require( '@stdlib/stats/base/dists/uniform/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = stdev( a, b ); console.log( 'a: %d, b: %d, SD(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/variance/README.md index 9b9c47806a0e..ae0af6157b8c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/variance/README.md @@ -54,7 +54,7 @@ where `a` is the minimum support and `b` the maximum support of the distribution ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/uniform/variance' ); +const variance = require( '@stdlib/stats/base/dists/uniform/variance' ); ``` #### variance( a, b ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/uniform/variance' ); Returns the [variance][variance] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns ~0.083 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 2.0, 8.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `a >= b`, the function returns `NaN`. ```javascript -var y = variance( 3.0, 2.0 ); +let y = variance( 3.0, 2.0 ); // returns NaN y = variance( 3.0, 3.0 ); @@ -113,18 +113,13 @@ y = variance( 3.0, 3.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var variance = require( '@stdlib/stats/base/dists/uniform/variance' ); - -var a; -var b; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - a = ( randu()*10.0 ); - b = ( randu()*10.0 ) + a; - v = variance( a, b ); +const randu = require( '@stdlib/random/base/randu' ); +const variance = require( '@stdlib/stats/base/dists/uniform/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const a = (randu() * 10.0); + const b = ( randu()*10.0 ) + a; + const v = variance( a, b ); console.log( 'a: %d, b: %d, Var(X;a,b): %d', a.toFixed( 4 ), b.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/README.md index 896b2a82a67b..f65de771bf90 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var weibull = require( '@stdlib/stats/base/dists/weibull' ); +const weibull = require( '@stdlib/stats/base/dists/weibull' ); ``` #### weibull @@ -35,7 +35,7 @@ var weibull = require( '@stdlib/stats/base/dists/weibull' ); Weibull distribution. ```javascript -var dist = weibull; +const dist = weibull; // returns {...} ``` @@ -88,11 +88,11 @@ The namespace contains a constructor function for creating a [Weibull][weibull-d ```javascript -var Weibull = require( '@stdlib/stats/base/dists/weibull' ).Weibull; +const Weibull = require( '@stdlib/stats/base/dists/weibull' ).Weibull; -var dist = new Weibull( 2.0, 4.0 ); +const dist = new Weibull( 2.0, 4.0 ); -var y = dist.pdf( 0.8 ); +const y = dist.pdf( 0.8 ); // returns ~0.096 ``` @@ -109,8 +109,8 @@ var y = dist.pdf( 0.8 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var weibull = require( '@stdlib/stats/base/dists/weibull' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const weibull = require( '@stdlib/stats/base/dists/weibull' ); console.log( objectKeys( weibull ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/cdf/README.md index 87efe0d45b4d..09b86f2d4c4a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/cdf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` is the [shape parameter][shape] and `k > 0` is the [scale par ## Usage ```javascript -var cdf = require( '@stdlib/stats/base/dists/weibull/cdf' ); +const cdf = require( '@stdlib/stats/base/dists/weibull/cdf' ); ``` #### cdf( x, k, lambda ) @@ -58,7 +58,7 @@ var cdf = require( '@stdlib/stats/base/dists/weibull/cdf' ); Evaluates the [cumulative distribution function][cdf] (CDF) for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = cdf( 2.0, 1.0, 0.5 ); +let y = cdf( 2.0, 1.0, 0.5 ); // returns ~0.982 y = cdf( 0.0, 1.0, 0.5 ); @@ -74,7 +74,7 @@ y = cdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = cdf( NaN, 1.0, 1.0 ); +let y = cdf( NaN, 1.0, 1.0 ); // returns NaN y = cdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = cdf( 0.0, 1.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -97,7 +97,7 @@ y = cdf( 2.0, 0.5, 0.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = cdf( 2.0, 0.5, -1.0 ); +let y = cdf( 2.0, 0.5, -1.0 ); // returns NaN y = cdf( 2.0, 0.5, 0.0 ); @@ -109,9 +109,9 @@ y = cdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var mycdf = cdf.factory( 2.0, 10.0 ); +const mycdf = cdf.factory( 2.0, 10.0 ); -var y = mycdf( 10.0 ); +let y = mycdf( 10.0 ); // returns ~0.632 y = mycdf( 8.0 ); @@ -129,20 +129,14 @@ y = mycdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var cdf = require( '@stdlib/stats/base/dists/weibull/cdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - k = randu() * 10.0; - y = cdf( x, lambda, k ); +const randu = require( '@stdlib/random/base/randu' ); +const cdf = require( '@stdlib/stats/base/dists/weibull/cdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const k = randu() * 10.0; + const y = cdf( x, lambda, k ); console.log( 'x: %d, k: %d, λ: %d, F(x;k,λ): %d', x, k, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/README.md index f67227fe3711..839cd8d30924 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Weibull = require( '@stdlib/stats/base/dists/weibull/ctor' ); +const Weibull = require( '@stdlib/stats/base/dists/weibull/ctor' ); ``` #### Weibull( \[k, lambda] ) @@ -45,18 +45,18 @@ var Weibull = require( '@stdlib/stats/base/dists/weibull/ctor' ); Returns a [Weibull][weibull-distribution] distribution object. ```javascript -var weibull = new Weibull(); +const weibull = new Weibull(); -var mode = weibull.mode; +const mode = weibull.mode; // returns 0.0 ``` By default, `k = 1.0` and `lambda = 1.0`. To create a distribution having a different `k` (shape parameter) and `lambda` (scale parameter), provide the corresponding arguments. ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var mode = weibull.mode; +const mode = weibull.mode; // returns ~2.828 ``` @@ -73,9 +73,9 @@ A [Weibull][weibull-distribution] distribution object has the following properti Shape parameter of the distribution. `k` **must** be a positive number. ```javascript -var weibull = new Weibull(); +const weibull = new Weibull(); -var k = weibull.k; +let k = weibull.k; // returns 1.0 weibull.k = 3.0; @@ -89,9 +89,9 @@ k = weibull.k; Scale parameter of the distribution. `lambda` **must** be a positive number. ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var lambda = weibull.lambda; +let lambda = weibull.lambda; // returns 4.0 weibull.lambda = 3.0; @@ -109,9 +109,9 @@ lambda = weibull.lambda; Returns the [differential entropy][entropy]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var entropy = weibull.entropy; +const entropy = weibull.entropy; // returns ~2.532 ``` @@ -120,9 +120,9 @@ var entropy = weibull.entropy; Returns the [excess kurtosis][kurtosis]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var kurtosis = weibull.kurtosis; +const kurtosis = weibull.kurtosis; // returns ~-0.252 ``` @@ -131,9 +131,9 @@ var kurtosis = weibull.kurtosis; Returns the [expected value][expected-value]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var mu = weibull.mean; +const mu = weibull.mean; // returns ~10.877 ``` @@ -142,9 +142,9 @@ var mu = weibull.mean; Returns the [mode][mode]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var mode = weibull.mode; +const mode = weibull.mode; // returns ~11.167 ``` @@ -153,9 +153,9 @@ var mode = weibull.mode; Returns the [skewness][skewness]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var skewness = weibull.skewness; +const skewness = weibull.skewness; // returns ~-0.087 ``` @@ -164,9 +164,9 @@ var skewness = weibull.skewness; Returns the [standard deviation][standard-deviation]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var s = weibull.stdev; +const s = weibull.stdev; // returns ~3.051 ``` @@ -175,9 +175,9 @@ var s = weibull.stdev; Returns the [variance][variance]. ```javascript -var weibull = new Weibull( 4.0, 12.0 ); +const weibull = new Weibull( 4.0, 12.0 ); -var s2 = weibull.variance; +const s2 = weibull.variance; // returns ~9.311 ``` @@ -190,9 +190,9 @@ var s2 = weibull.variance; Evaluates the [cumulative distribution function][cdf] (CDF). ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.cdf( 0.5 ); +const y = weibull.cdf( 0.5 ); // returns ~0.016 ``` @@ -201,9 +201,9 @@ var y = weibull.cdf( 0.5 ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (logCDF). ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.logcdf( 0.8 ); +const y = weibull.logcdf( 0.8 ); // returns ~-3.239 ``` @@ -212,9 +212,9 @@ var y = weibull.logcdf( 0.8 ); Evaluates the natural logarithm of the [probability density function][pdf] (PDF). ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.logpdf( 0.8 ); +const y = weibull.logpdf( 0.8 ); // returns ~-2.343 ``` @@ -223,9 +223,9 @@ var y = weibull.logpdf( 0.8 ); Evaluates the [moment-generating function][mgf] (MGF). ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.mgf( 0.5 ); +const y = weibull.mgf( 0.5 ); // returns ~9.878 ``` @@ -234,9 +234,9 @@ var y = weibull.mgf( 0.5 ); Evaluates the [probability density function][pdf] (PDF). ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.pdf( 0.8 ); +const y = weibull.pdf( 0.8 ); // returns ~0.096 ``` @@ -245,9 +245,9 @@ var y = weibull.pdf( 0.8 ); Evaluates the [quantile function][quantile-function] at probability `p`. ```javascript -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var y = weibull.quantile( 0.5 ); +let y = weibull.quantile( 0.5 ); // returns ~3.33 y = weibull.quantile( 1.9 ); @@ -277,20 +277,20 @@ y = weibull.quantile( 1.9 ); ```javascript -var Weibull = require( '@stdlib/stats/base/dists/weibull/ctor' ); +const Weibull = require( '@stdlib/stats/base/dists/weibull/ctor' ); -var weibull = new Weibull( 2.0, 4.0 ); +const weibull = new Weibull( 2.0, 4.0 ); -var mu = weibull.mean; +const mu = weibull.mean; // returns ~3.545 -var mode = weibull.mode; +const mode = weibull.mode; // returns ~2.828 -var s2 = weibull.variance; +const s2 = weibull.variance; // returns ~3.434 -var y = weibull.cdf( 0.8 ); +const y = weibull.cdf( 0.8 ); // returns ~0.039 ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/README.md index fa405a8df35a..1bbc10dedc55 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/README.md @@ -54,7 +54,7 @@ where `λ > 0` is the [shape parameter][shape], `k > 0` is the [scale parameter] ## Usage ```javascript -var entropy = require( '@stdlib/stats/base/dists/weibull/entropy' ); +const entropy = require( '@stdlib/stats/base/dists/weibull/entropy' ); ``` #### entropy( k, lambda ) @@ -62,7 +62,7 @@ var entropy = require( '@stdlib/stats/base/dists/weibull/entropy' ); Returns the [differential entropy][entropy] of a [Weibull][weibull-distribution] distribution with shape parameter `k` and scale parameter `lambda` (in [nats][nats]). ```javascript -var v = entropy( 1.0, 1.0 ); +let v = entropy( 1.0, 1.0 ); // returns 1.0 v = entropy( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = entropy( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = entropy( NaN, 2.0 ); +let v = entropy( NaN, 2.0 ); // returns NaN v = entropy( 2.0, NaN ); @@ -85,7 +85,7 @@ v = entropy( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 0.0, 1.0 ); +let v = entropy( 0.0, 1.0 ); // returns NaN v = entropy( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = entropy( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = entropy( 1.0, 0.0 ); +let v = entropy( 1.0, 0.0 ); // returns NaN v = entropy( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = entropy( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var entropy = require( '@stdlib/stats/base/dists/weibull/entropy' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = entropy( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const entropy = require( '@stdlib/stats/base/dists/weibull/entropy' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = entropy( k, lambda ); console.log( 'k: %d, λ: %d, h(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/kurtosis/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/kurtosis/README.md index f90bbc8408e9..de6644737fe3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/kurtosis/README.md @@ -54,7 +54,7 @@ where `Γ_i = Γ( 1 + i / k )`. ## Usage ```javascript -var kurtosis = require( '@stdlib/stats/base/dists/weibull/kurtosis' ); +const kurtosis = require( '@stdlib/stats/base/dists/weibull/kurtosis' ); ``` #### kurtosis( k, lambda ) @@ -62,7 +62,7 @@ var kurtosis = require( '@stdlib/stats/base/dists/weibull/kurtosis' ); Returns the [excess kurtosis][kurtosis] of a [Weibull][weibull-distribution] distribution with shape parameter `k` and scale parameter `lambda`. ```javascript -var v = kurtosis( 1.0, 1.0 ); +let v = kurtosis( 1.0, 1.0 ); // returns 6.0 v = kurtosis( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = kurtosis( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = kurtosis( NaN, 2.0 ); +let v = kurtosis( NaN, 2.0 ); // returns NaN v = kurtosis( 2.0, NaN ); @@ -85,7 +85,7 @@ v = kurtosis( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 0.0, 1.0 ); +let v = kurtosis( 0.0, 1.0 ); // returns NaN v = kurtosis( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = kurtosis( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = kurtosis( 1.0, 0.0 ); +let v = kurtosis( 1.0, 0.0 ); // returns NaN v = kurtosis( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = kurtosis( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var kurtosis = require( '@stdlib/stats/base/dists/weibull/kurtosis' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = kurtosis( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const kurtosis = require( '@stdlib/stats/base/dists/weibull/kurtosis' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = kurtosis( k, lambda ); console.log( 'k: %d, λ: %d, Kurt(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/logcdf/README.md index a40efd5cbaa7..d45bdbae8eb7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/logcdf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` is the [shape parameter][shape] and `k > 0` is the [scale par ## Usage ```javascript -var logcdf = require( '@stdlib/stats/base/dists/weibull/logcdf' ); +const logcdf = require( '@stdlib/stats/base/dists/weibull/logcdf' ); ``` #### logcdf( x, k, lambda ) @@ -58,7 +58,7 @@ var logcdf = require( '@stdlib/stats/base/dists/weibull/logcdf' ); Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = logcdf( 2.0, 1.0, 0.5 ); +let y = logcdf( 2.0, 1.0, 0.5 ); // returns ~-0.018 y = logcdf( 0.0, 0.5, 1.0 ); @@ -74,7 +74,7 @@ y = logcdf( +Infinity, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logcdf( NaN, 1.0, 1.0 ); +let y = logcdf( NaN, 1.0, 1.0 ); // returns NaN y = logcdf( 0.0, NaN, 1.0 ); @@ -87,7 +87,7 @@ y = logcdf( 0.0, 1.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, -1.0, 0.5 ); +let y = logcdf( 2.0, -1.0, 0.5 ); // returns NaN y = logcdf( 2.0, 0.0, 0.5 ); @@ -97,7 +97,7 @@ y = logcdf( 2.0, 0.0, 0.5 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = logcdf( 2.0, 0.5, -1.0 ); +let y = logcdf( 2.0, 0.5, -1.0 ); // returns NaN y = logcdf( 2.0, 0.5, 0.0 ); @@ -109,9 +109,9 @@ y = logcdf( 2.0, 0.5, 0.0 ); Returns a function for evaluating the [cumulative distribution function][cdf] of a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var mylogcdf = logcdf.factory( 2.0, 10.0 ); +const mylogcdf = logcdf.factory( 2.0, 10.0 ); -var y = mylogcdf( 10.0 ); +let y = mylogcdf( 10.0 ); // returns ~-0.459 y = mylogcdf( 8.0 ); @@ -139,20 +139,14 @@ y = mylogcdf( 8.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logcdf = require( '@stdlib/stats/base/dists/weibull/logcdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - k = randu() * 10.0; - y = logcdf( x, lambda, k ); +const randu = require( '@stdlib/random/base/randu' ); +const logcdf = require( '@stdlib/stats/base/dists/weibull/logcdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const k = randu() * 10.0; + const y = logcdf( x, lambda, k ); console.log( 'x: %d, k: %d, λ: %d, ln(F(x;k,λ)): %d', x, k, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/logpdf/README.md index a0dfb3f9d3f5..11a2fe10cfa7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/logpdf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` and `k > 0` are the respective [scale][scale] and [shape][sha ## Usage ```javascript -var logpdf = require( '@stdlib/stats/base/dists/weibull/logpdf' ); +const logpdf = require( '@stdlib/stats/base/dists/weibull/logpdf' ); ``` #### logpdf( x, k, lambda ) @@ -58,7 +58,7 @@ var logpdf = require( '@stdlib/stats/base/dists/weibull/logpdf' ); Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = logpdf( 2.0, 1.0, 0.5 ); +let y = logpdf( 2.0, 1.0, 0.5 ); // returns ~-3.307 y = logpdf( -1.0, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = logpdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = logpdf( NaN, 1.0, 1.0 ); +let y = logpdf( NaN, 1.0, 1.0 ); // returns NaN y = logpdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = logpdf( 0.0, 1.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 0.0, 1.0 ); +let y = logpdf( 2.0, 0.0, 1.0 ); // returns NaN y = logpdf( 2.0, -1.0, 1.0 ); @@ -91,7 +91,7 @@ y = logpdf( 2.0, -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = logpdf( 2.0, 1.0, 0.0 ); +let y = logpdf( 2.0, 1.0, 0.0 ); // returns NaN y = logpdf( 2.0, 1.0, -1.0 ); @@ -103,9 +103,9 @@ y = logpdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the logarithm of the [PDF][pdf] for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var mylogpdf = logpdf.factory( 2.0, 10.0 ); +const mylogpdf = logpdf.factory( 2.0, 10.0 ); -var y = mylogpdf( 12.0 ); +let y = mylogpdf( 12.0 ); // returns ~-2.867 y = mylogpdf( 5.0 ); @@ -133,20 +133,14 @@ y = mylogpdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var logpdf = require( '@stdlib/stats/base/dists/weibull/logpdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - k = randu() * 10.0; - y = logpdf( x, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const logpdf = require( '@stdlib/stats/base/dists/weibull/logpdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const k = randu() * 10.0; + const y = logpdf( x, k, lambda ); console.log( 'x: %d, k: %d, λ: %d, ln(f(x;k,λ)): %d', x.toFixed( 4 ), k.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/mean/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/mean/README.md index f93aa2ca81fb..8a22117977b8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/mean/README.md @@ -54,7 +54,7 @@ where `k > 0` is the shape parameter `λ > 0` is the scale parameter. ## Usage ```javascript -var mean = require( '@stdlib/stats/base/dists/weibull/mean' ); +const mean = require( '@stdlib/stats/base/dists/weibull/mean' ); ``` #### mean( k, lambda ) @@ -62,7 +62,7 @@ var mean = require( '@stdlib/stats/base/dists/weibull/mean' ); Returns the [expected value][expected-value] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = mean( 1.0, 1.0 ); +let v = mean( 1.0, 1.0 ); // returns 1.0 v = mean( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = mean( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mean( NaN, 2.0 ); +let v = mean( NaN, 2.0 ); // returns NaN v = mean( 2.0, NaN ); @@ -85,7 +85,7 @@ v = mean( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = mean( 0.0, 1.0 ); +let v = mean( 0.0, 1.0 ); // returns NaN v = mean( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = mean( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = mean( 1.0, 0.0 ); +let v = mean( 1.0, 0.0 ); // returns NaN v = mean( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = mean( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mean = require( '@stdlib/stats/base/dists/weibull/mean' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = mean( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mean = require( '@stdlib/stats/base/dists/weibull/mean' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = mean( k, lambda ); console.log( 'k: %d, λ: %d, E(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/median/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/median/README.md index 1fbfe3297e54..118542822d73 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/median/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/median/README.md @@ -54,7 +54,7 @@ where `lambda > 0` is the [shape parameter][shape] and `k > 0` is the [scale par ## Usage ```javascript -var median = require( '@stdlib/stats/base/dists/weibull/median' ); +const median = require( '@stdlib/stats/base/dists/weibull/median' ); ``` #### median( k, lambda ) @@ -62,7 +62,7 @@ var median = require( '@stdlib/stats/base/dists/weibull/median' ); Returns the [median][median] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = median( 1.0, 1.0 ); +let v = median( 1.0, 1.0 ); // returns ~0.693 v = median( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = median( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = median( NaN, 2.0 ); +let v = median( NaN, 2.0 ); // returns NaN v = median( 2.0, NaN ); @@ -85,7 +85,7 @@ v = median( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = median( 0.0, 1.0 ); +let v = median( 0.0, 1.0 ); // returns NaN v = median( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = median( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = median( 1.0, 0.0 ); +let v = median( 1.0, 0.0 ); // returns NaN v = median( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = median( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var median = require( '@stdlib/stats/base/dists/weibull/median' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = median( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const median = require( '@stdlib/stats/base/dists/weibull/median' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = median( k, lambda ); console.log( 'k: %d, λ: %d, Median(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/README.md index 1bf1ce14079b..a157bd75e50d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/README.md @@ -54,7 +54,7 @@ where `lambda > 0` is the scale paramater and `k > 0` is the shape parameter. ## Usage ```javascript -var mgf = require( '@stdlib/stats/base/dists/weibull/mgf' ); +const mgf = require( '@stdlib/stats/base/dists/weibull/mgf' ); ``` #### mgf( t, k, lambda ) @@ -62,7 +62,7 @@ var mgf = require( '@stdlib/stats/base/dists/weibull/mgf' ); Evaluates the [moment-generating function][mgf] (MGF) for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = mgf( 1.0, 1.0, 0.5); +let y = mgf( 1.0, 1.0, 0.5); // returns ~2.0 y = mgf( -1.0, 4.0, 4.0 ); @@ -72,7 +72,7 @@ y = mgf( -1.0, 4.0, 4.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = mgf( NaN, 1.0, 1.0 ); +let y = mgf( NaN, 1.0, 1.0 ); // returns NaN y = mgf( 0.0, NaN, 1.0 ); @@ -85,7 +85,7 @@ y = mgf( 0.0, 1.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, -1.0, 0.5 ); +let y = mgf( 0.2, -1.0, 0.5 ); // returns NaN y = mgf( 0.2, 0.0, 0.5 ); @@ -95,7 +95,7 @@ y = mgf( 0.2, 0.0, 0.5 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = mgf( 0.2, 0.5, -1.0 ); +let y = mgf( 0.2, 0.5, -1.0 ); // returns NaN y = mgf( 0.2, 0.5, 0.0 ); @@ -107,9 +107,9 @@ y = mgf( 0.2, 0.5, 0.0 ); Returns a function for evaluating the [moment-generating function][mgf] of a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var myMGF = mgf.factory( 8.0, 10.0 ); +const myMGF = mgf.factory( 8.0, 10.0 ); -var y = myMGF( 0.8 ); +let y = myMGF( 0.8 ); // returns ~3150.149 y = myMGF( 0.08 ); @@ -137,21 +137,15 @@ y = myMGF( 0.08 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mgf = require( '@stdlib/stats/base/dists/weibull/mgf' ); - -var lambda; -var k; -var t; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - t = randu() * 5.0; - lambda = ( randu() * 10.0 ) + EPS; - k = ( randu() * 10.0 ) + EPS; - y = mgf( t, lambda, k ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mgf = require( '@stdlib/stats/base/dists/weibull/mgf' ); + +for ( let i = 0; i < 10; i++ ) { + const t = randu() * 5.0; + const lambda = ( randu() * 10.0 ) + EPS; + const k = ( randu() * 10.0 ) + EPS; + const y = mgf( t, lambda, k ); console.log( 'x: %d, k: %d, λ: %d, M_X(t;k,λ): %d', t.toFixed( 4 ), k.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/mode/README.md index cbccb3c5ef08..b5ef787b56b8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/mode/README.md @@ -54,7 +54,7 @@ where `λ > 0` is the [shape parameter][shape] and `k > 0` is the [scale paramet ## Usage ```javascript -var mode = require( '@stdlib/stats/base/dists/weibull/mode' ); +const mode = require( '@stdlib/stats/base/dists/weibull/mode' ); ``` #### mode( k, lambda ) @@ -62,7 +62,7 @@ var mode = require( '@stdlib/stats/base/dists/weibull/mode' ); Returns the [mode][mode] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = mode( 4.0, 12.0 ); +let v = mode( 4.0, 12.0 ); // returns ~11.167 v = mode( 8.0, 2.0 ); @@ -72,14 +72,14 @@ v = mode( 8.0, 2.0 ); If provided `0 < k <= 1`, the function returns `0.0`. ```javascript -var v = mode( 1.0, 1.0 ); +const v = mode( 1.0, 1.0 ); // returns 0.0 ``` If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = mode( NaN, 2.0 ); +let v = mode( NaN, 2.0 ); // returns NaN v = mode( 2.0, NaN ); @@ -89,7 +89,7 @@ v = mode( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = mode( 0.0, 1.0 ); +let v = mode( 0.0, 1.0 ); // returns NaN v = mode( -1.0, 1.0 ); @@ -99,7 +99,7 @@ v = mode( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = mode( 1.0, 0.0 ); +let v = mode( 1.0, 0.0 ); // returns NaN v = mode( 1.0, -1.0 ); @@ -127,19 +127,14 @@ v = mode( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var mode = require( '@stdlib/stats/base/dists/weibull/mode' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = mode( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const mode = require( '@stdlib/stats/base/dists/weibull/mode' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = mode( k, lambda ); console.log( 'k: %d, λ: %d, mode(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/pdf/README.md index bf56f41bb475..469781ce3161 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/pdf/README.md @@ -50,7 +50,7 @@ where `lambda > 0` and `k > 0` are the respective [scale][scale] and [shape][sha ## Usage ```javascript -var pdf = require( '@stdlib/stats/base/dists/weibull/pdf' ); +const pdf = require( '@stdlib/stats/base/dists/weibull/pdf' ); ``` #### pdf( x, k, lambda ) @@ -58,7 +58,7 @@ var pdf = require( '@stdlib/stats/base/dists/weibull/pdf' ); Evaluates the [probability density function][pdf] (PDF) for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = pdf( 2.0, 1.0, 0.5 ); +let y = pdf( 2.0, 1.0, 0.5 ); // returns ~0.037 y = pdf( -1.0, 4.0, 2.0 ); @@ -68,7 +68,7 @@ y = pdf( -1.0, 4.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = pdf( NaN, 0.0, 1.0 ); +let y = pdf( NaN, 0.0, 1.0 ); // returns NaN y = pdf( 0.0, NaN, 1.0 ); @@ -81,7 +81,7 @@ y = pdf( 0.0, 0.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 0.0, 1.0 ); +let y = pdf( 2.0, 0.0, 1.0 ); // returns NaN y = pdf( 2.0, -1.0, 1.0 ); @@ -91,7 +91,7 @@ y = pdf( 2.0, -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = pdf( 2.0, 1.0, 0.0 ); +let y = pdf( 2.0, 1.0, 0.0 ); // returns NaN y = pdf( 2.0, 1.0, -1.0 ); @@ -103,9 +103,9 @@ y = pdf( 2.0, 1.0, -1.0 ); Returns a `function` for evaluating the [PDF][pdf] for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var mypdf = pdf.factory( 2.0, 10.0 ); +const mypdf = pdf.factory( 2.0, 10.0 ); -var y = mypdf( 12.0 ); +let y = mypdf( 12.0 ); // returns ~0.057 y = mypdf( 5.0 ); @@ -123,20 +123,14 @@ y = mypdf( 5.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var pdf = require( '@stdlib/stats/base/dists/weibull/pdf' ); - -var lambda; -var k; -var x; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - x = randu() * 10.0; - lambda = randu() * 10.0; - k = randu() * 10.0; - y = pdf( x, lambda, k ); +const randu = require( '@stdlib/random/base/randu' ); +const pdf = require( '@stdlib/stats/base/dists/weibull/pdf' ); + +for ( let i = 0; i < 10; i++ ) { + const x = randu() * 10.0; + const lambda = randu() * 10.0; + const k = randu() * 10.0; + const y = pdf( x, lambda, k ); console.log( 'x: %d, k: %d, λ: %d, f(x;k,λ): %d', x.toFixed( 4 ), k.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/README.md index 6c63ee8fd4ea..e0789dc5846a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/README.md @@ -50,7 +50,7 @@ for `0 <= p < 1`, where `lambda > 0` is the [shape parameter][shape] and `k > 0` ## Usage ```javascript -var quantile = require( '@stdlib/stats/base/dists/weibull/quantile' ); +const quantile = require( '@stdlib/stats/base/dists/weibull/quantile' ); ``` #### quantile( p, k, lambda ) @@ -58,7 +58,7 @@ var quantile = require( '@stdlib/stats/base/dists/weibull/quantile' ); Evaluates the [quantile function][quantile-function] for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var y = quantile( 0.5, 1.0, 1.0 ); +let y = quantile( 0.5, 1.0, 1.0 ); // returns ~0.693 y = quantile( 0.2, 2.0, 4.0 ); @@ -68,7 +68,7 @@ y = quantile( 0.2, 2.0, 4.0 ); If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. ```javascript -var y = quantile( 1.9, 1.0, 1.0 ); +let y = quantile( 1.9, 1.0, 1.0 ); // returns NaN y = quantile( -0.1, 1.0, 1.0 ); @@ -78,7 +78,7 @@ y = quantile( -0.1, 1.0, 1.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var y = quantile( NaN, 1.0, 1.0 ); +let y = quantile( NaN, 1.0, 1.0 ); // returns NaN y = quantile( 0.0, NaN, 1.0 ); @@ -91,7 +91,7 @@ y = quantile( 0.0, 1.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, -1.0, 1.0 ); +let y = quantile( 0.4, -1.0, 1.0 ); // returns NaN y = quantile( 0.4, 0.0, 1.0 ); @@ -101,7 +101,7 @@ y = quantile( 0.4, 0.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var y = quantile( 0.4, 1.0, -1.0 ); +let y = quantile( 0.4, 1.0, -1.0 ); // returns NaN y = quantile( 0.4, 1.0, 0.0 ); @@ -113,9 +113,9 @@ y = quantile( 0.4, 1.0, 0.0 ); Returns a function for evaluating the quantile function of a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`. ```javascript -var myquantile = quantile.factory( 2.0, 10.0 ); +const myquantile = quantile.factory( 2.0, 10.0 ); -var y = myquantile( 0.2 ); +let y = myquantile( 0.2 ); // returns ~4.724 y = myquantile( 0.8 ); @@ -133,20 +133,14 @@ y = myquantile( 0.8 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var quantile = require( '@stdlib/stats/base/dists/weibull/quantile' ); - -var lambda; -var k; -var p; -var y; -var i; - -for ( i = 0; i < 10; i++ ) { - p = randu(); - lambda = randu() * 10.0; - k = randu() * 10.0; - y = quantile( p, k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const quantile = require( '@stdlib/stats/base/dists/weibull/quantile' ); + +for ( let i = 0; i < 10; i++ ) { + const p = randu(); + const lambda = randu() * 10.0; + const k = randu() * 10.0; + const y = quantile( p, k, lambda ); console.log( 'p: %d, k: %d, λ: %d, Q(p;k,λ): %d', p, k, lambda, y ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/README.md index 4796b41902ab..8472532f7e37 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/README.md @@ -54,7 +54,7 @@ where `Γ` is the gamma function, `μ` denotes the mean of the distribution, and ## Usage ```javascript -var skewness = require( '@stdlib/stats/base/dists/weibull/skewness' ); +const skewness = require( '@stdlib/stats/base/dists/weibull/skewness' ); ``` #### skewness( k, lambda ) @@ -62,7 +62,7 @@ var skewness = require( '@stdlib/stats/base/dists/weibull/skewness' ); Returns the [skewness][skewness] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = skewness( 1.0, 1.0 ); +let v = skewness( 1.0, 1.0 ); // returns 2.0 v = skewness( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = skewness( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = skewness( NaN, 2.0 ); +let v = skewness( NaN, 2.0 ); // returns NaN v = skewness( 2.0, NaN ); @@ -85,7 +85,7 @@ v = skewness( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 0.0, 1.0 ); +let v = skewness( 0.0, 1.0 ); // returns NaN v = skewness( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = skewness( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = skewness( 1.0, 0.0 ); +let v = skewness( 1.0, 0.0 ); // returns NaN v = skewness( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = skewness( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var skewness = require( '@stdlib/stats/base/dists/weibull/skewness' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = skewness( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const skewness = require( '@stdlib/stats/base/dists/weibull/skewness' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = skewness( k, lambda ); console.log( 'k: %d, λ: %d, skew(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/stdev/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/stdev/README.md index 8092ca0099d8..121daa34f353 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/stdev/README.md @@ -54,7 +54,7 @@ where `λ > 0` is the [shape parameter][shape], `k > 0` is the [scale parameter] ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/dists/weibull/stdev' ); +const stdev = require( '@stdlib/stats/base/dists/weibull/stdev' ); ``` #### stdev( k, lambda ) @@ -62,7 +62,7 @@ var stdev = require( '@stdlib/stats/base/dists/weibull/stdev' ); Returns the [standard deviation][standard-deviation] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = stdev( 1.0, 1.0 ); +let v = stdev( 1.0, 1.0 ); // returns 1.0 v = stdev( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = stdev( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = stdev( NaN, 2.0 ); +let v = stdev( NaN, 2.0 ); // returns NaN v = stdev( 2.0, NaN ); @@ -85,7 +85,7 @@ v = stdev( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 0.0, 1.0 ); +let v = stdev( 0.0, 1.0 ); // returns NaN v = stdev( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = stdev( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = stdev( 1.0, 0.0 ); +let v = stdev( 1.0, 0.0 ); // returns NaN v = stdev( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = stdev( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var stdev = require( '@stdlib/stats/base/dists/weibull/stdev' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = stdev( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const stdev = require( '@stdlib/stats/base/dists/weibull/stdev' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = stdev( k, lambda ); console.log( 'k: %d, λ: %d, SD(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/weibull/variance/README.md b/lib/node_modules/@stdlib/stats/base/dists/weibull/variance/README.md index 8845c4c38498..3a4b006c239c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/weibull/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/weibull/variance/README.md @@ -54,7 +54,7 @@ where `λ > 0` is the [shape parameter][shape], `k > 0` is the [scale parameter] ## Usage ```javascript -var variance = require( '@stdlib/stats/base/dists/weibull/variance' ); +const variance = require( '@stdlib/stats/base/dists/weibull/variance' ); ``` #### variance( k, lambda ) @@ -62,7 +62,7 @@ var variance = require( '@stdlib/stats/base/dists/weibull/variance' ); Returns the [variance][variance] of a [Weibull][weibull-distribution] distribution with parameters `k` (shape parameter) and `lambda` (scale parameter). ```javascript -var v = variance( 1.0, 1.0 ); +let v = variance( 1.0, 1.0 ); // returns 1.0 v = variance( 4.0, 12.0 ); @@ -75,7 +75,7 @@ v = variance( 8.0, 2.0 ); If provided `NaN` as any argument, the function returns `NaN`. ```javascript -var v = variance( NaN, 2.0 ); +let v = variance( NaN, 2.0 ); // returns NaN v = variance( 2.0, NaN ); @@ -85,7 +85,7 @@ v = variance( 2.0, NaN ); If provided `k <= 0`, the function returns `NaN`. ```javascript -var v = variance( 0.0, 1.0 ); +let v = variance( 0.0, 1.0 ); // returns NaN v = variance( -1.0, 1.0 ); @@ -95,7 +95,7 @@ v = variance( -1.0, 1.0 ); If provided `lambda <= 0`, the function returns `NaN`. ```javascript -var v = variance( 1.0, 0.0 ); +let v = variance( 1.0, 0.0 ); // returns NaN v = variance( 1.0, -1.0 ); @@ -123,19 +123,14 @@ v = variance( 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var variance = require( '@stdlib/stats/base/dists/weibull/variance' ); - -var lambda; -var k; -var v; -var i; - -for ( i = 0; i < 10; i++ ) { - k = ( randu()*10.0 ) + EPS; - lambda = ( randu()*10.0 ) + EPS; - v = variance( k, lambda ); +const randu = require( '@stdlib/random/base/randu' ); +const EPS = require( '@stdlib/constants/float64/eps' ); +const variance = require( '@stdlib/stats/base/dists/weibull/variance' ); + +for ( let i = 0; i < 10; i++ ) { + const k = ( randu()*10.0 ) + EPS; + const lambda = ( randu()*10.0 ) + EPS; + const v = variance( k, lambda ); console.log( 'k: %d, λ: %d, Var(X;k,λ): %d', k.toFixed( 4 ), lambda.toFixed( 4 ), v.toFixed( 4 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmax/README.md b/lib/node_modules/@stdlib/stats/base/dmax/README.md index 9fd6cb5d77b4..e91d843c3c71 100644 --- a/lib/node_modules/@stdlib/stats/base/dmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmax = require( '@stdlib/stats/base/dmax' ); +const dmax = require( '@stdlib/stats/base/dmax' ); ``` #### dmax( N, x, stride ) @@ -41,12 +41,12 @@ var dmax = require( '@stdlib/stats/base/dmax' ); Computes the maximum value of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmax( N, x, 1 ); +const v = dmax( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmax( N, x, 2 ); +const v = dmax( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmax( N, x1, 2 ); +const v = dmax( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = dmax( N, x1, 2 ); Computes the maximum value of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmax.ndarray( N, x, 1, 0 ); +const v = dmax.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmax.ndarray( N, x, 2, 1 ); +const v = dmax.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,21 +138,18 @@ var v = dmax.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmax = require( '@stdlib/stats/base/dmax' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmax = require( '@stdlib/stats/base/dmax' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmax( x.length, x, 1 ); +const v = dmax( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmaxabs/README.md b/lib/node_modules/@stdlib/stats/base/dmaxabs/README.md index b55840090549..1f6f3bac0418 100644 --- a/lib/node_modules/@stdlib/stats/base/dmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmaxabs = require( '@stdlib/stats/base/dmaxabs' ); +const dmaxabs = require( '@stdlib/stats/base/dmaxabs' ); ``` #### dmaxabs( N, x, stride ) @@ -41,12 +41,12 @@ var dmaxabs = require( '@stdlib/stats/base/dmaxabs' ); Computes the maximum absolute value of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmaxabs( N, x, 1 ); +const v = dmaxabs( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxabs( N, x, 2 ); +const v = dmaxabs( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmaxabs( N, x1, 2 ); +const v = dmaxabs( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = dmaxabs( N, x1, 2 ); Computes the maximum absolute value of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmaxabs.ndarray( N, x, 1, 0 ); +const v = dmaxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxabs.ndarray( N, x, 2, 1 ); +const v = dmaxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,21 +138,18 @@ var v = dmaxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmaxabs = require( '@stdlib/stats/base/dmaxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmaxabs = require( '@stdlib/stats/base/dmaxabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmaxabs( x.length, x, 1 ); +const v = dmaxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmaxabssorted/README.md b/lib/node_modules/@stdlib/stats/base/dmaxabssorted/README.md index e636b54a135d..dd459d2ed48d 100644 --- a/lib/node_modules/@stdlib/stats/base/dmaxabssorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmaxabssorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmaxabssorted = require( '@stdlib/stats/base/dmaxabssorted' ); +const dmaxabssorted = require( '@stdlib/stats/base/dmaxabssorted' ); ``` #### dmaxabssorted( N, x, stride ) @@ -41,10 +41,10 @@ var dmaxabssorted = require( '@stdlib/stats/base/dmaxabssorted' ); Computes the maximum absolute value of a sorted double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); -var v = dmaxabssorted( x.length, x, 1 ); +let x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); +let v = dmaxabssorted( x.length, x, 1 ); // returns 3.0 x = new Float64Array( [ -3.0, -2.0, -1.0 ] ); @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxabssorted( N, x, 2 ); +const v = dmaxabssorted( N, x, 2 ); // returns 4.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmaxabssorted( N, x1, 2 ); +const v = dmaxabssorted( N, x1, 2 ); // returns 4.0 ``` @@ -93,10 +93,10 @@ var v = dmaxabssorted( N, x1, 2 ); Computes the maximum absolute value of a sorted double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); -var v = dmaxabssorted.ndarray( x.length, x, 1, 0 ); +const x = new Float64Array( [ -1.0, -2.0, -3.0 ] ); +const v = dmaxabssorted.ndarray( x.length, x, 1, 0 ); // returns 3.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxabssorted.ndarray( N, x, 2, 1 ); +const v = dmaxabssorted.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -139,19 +139,16 @@ var v = dmaxabssorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dmaxabssorted = require( '@stdlib/stats/base/dmaxabssorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmaxabssorted = require( '@stdlib/stats/base/dmaxabssorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = dmaxabssorted( x.length, x, 1 ); +const v = dmaxabssorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmaxsorted/README.md b/lib/node_modules/@stdlib/stats/base/dmaxsorted/README.md index 749f8a8b95cf..f253970e585a 100644 --- a/lib/node_modules/@stdlib/stats/base/dmaxsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmaxsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmaxsorted = require( '@stdlib/stats/base/dmaxsorted' ); +const dmaxsorted = require( '@stdlib/stats/base/dmaxsorted' ); ``` #### dmaxsorted( N, x, stride ) @@ -41,12 +41,12 @@ var dmaxsorted = require( '@stdlib/stats/base/dmaxsorted' ); Computes the maximum value of a sorted double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let N = x.length; -var v = dmaxsorted( N, x, 1 ); +let v = dmaxsorted( N, x, 1 ); // returns 3.0 x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); @@ -65,13 +65,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxsorted( N, x, 2 ); +const v = dmaxsorted( N, x, 2 ); // returns 4.0 ``` @@ -80,15 +80,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmaxsorted( N, x1, 2 ); +const v = dmaxsorted( N, x1, 2 ); // returns 4.0 ``` @@ -97,12 +97,12 @@ var v = dmaxsorted( N, x1, 2 ); Computes the maximum value of a sorted double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = dmaxsorted.ndarray( N, x, 1, 0 ); +const v = dmaxsorted.ndarray( N, x, 1, 0 ); // returns 3.0 ``` @@ -113,13 +113,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmaxsorted.ndarray( N, x, 2, 1 ); +const v = dmaxsorted.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -145,19 +145,16 @@ var v = dmaxsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dmaxsorted = require( '@stdlib/stats/base/dmaxsorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmaxsorted = require( '@stdlib/stats/base/dmaxsorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = dmaxsorted( x.length, x, 1 ); +const v = dmaxsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmean/README.md b/lib/node_modules/@stdlib/stats/base/dmean/README.md index 52a771ce16a3..d4947883dfb9 100644 --- a/lib/node_modules/@stdlib/stats/base/dmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmean = require( '@stdlib/stats/base/dmean' ); +const dmean = require( '@stdlib/stats/base/dmean' ); ``` #### dmean( N, x, stride ) @@ -56,12 +56,12 @@ var dmean = require( '@stdlib/stats/base/dmean' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmean( N, x, 1 ); +const v = dmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmean( N, x, 2 ); +const v = dmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmean( N, x1, 2 ); +const v = dmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmean.ndarray( N, x, 1, 0 ); +const v = dmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmean.ndarray( N, x, 2, 1 ); +const v = dmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = dmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmean = require( '@stdlib/stats/base/dmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmean = require( '@stdlib/stats/base/dmean' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmean( x.length, x, 1 ); +const v = dmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeankbn/README.md b/lib/node_modules/@stdlib/stats/base/dmeankbn/README.md index bfd03ff5c837..fae50cb82d64 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeankbn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeankbn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeankbn = require( '@stdlib/stats/base/dmeankbn' ); +const dmeankbn = require( '@stdlib/stats/base/dmeankbn' ); ``` #### dmeankbn( N, x, stride ) @@ -56,12 +56,12 @@ var dmeankbn = require( '@stdlib/stats/base/dmeankbn' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using an improved Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeankbn( N, x, 1 ); +const v = dmeankbn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeankbn( N, x, 2 ); +const v = dmeankbn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeankbn( N, x1, 2 ); +const v = dmeankbn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeankbn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeankbn.ndarray( N, x, 1, 0 ); +const v = dmeankbn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeankbn.ndarray( N, x, 2, 1 ); +const v = dmeankbn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = dmeankbn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeankbn = require( '@stdlib/stats/base/dmeankbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeankbn = require( '@stdlib/stats/base/dmeankbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeankbn( x.length, x, 1 ); +const v = dmeankbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeankbn2/README.md b/lib/node_modules/@stdlib/stats/base/dmeankbn2/README.md index 79ba581a937c..aad4b81c38ee 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeankbn2/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeankbn2/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeankbn2 = require( '@stdlib/stats/base/dmeankbn2' ); +const dmeankbn2 = require( '@stdlib/stats/base/dmeankbn2' ); ``` #### dmeankbn2( N, x, stride ) @@ -56,12 +56,12 @@ var dmeankbn2 = require( '@stdlib/stats/base/dmeankbn2' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeankbn2( N, x, 1 ); +const v = dmeankbn2( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeankbn2( N, x, 2 ); +const v = dmeankbn2( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeankbn2( N, x1, 2 ); +const v = dmeankbn2( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeankbn2( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeankbn2.ndarray( N, x, 1, 0 ); +const v = dmeankbn2.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeankbn2.ndarray( N, x, 2, 1 ); +const v = dmeankbn2.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = dmeankbn2.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeankbn2 = require( '@stdlib/stats/base/dmeankbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeankbn2 = require( '@stdlib/stats/base/dmeankbn2' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeankbn2( x.length, x, 1 ); +const v = dmeankbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanli/README.md b/lib/node_modules/@stdlib/stats/base/dmeanli/README.md index e27e0cf2fec3..fff97e73f5ec 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanli/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanli/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanli = require( '@stdlib/stats/base/dmeanli' ); +const dmeanli = require( '@stdlib/stats/base/dmeanli' ); ``` #### dmeanli( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanli = require( '@stdlib/stats/base/dmeanli' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanli( N, x, 1 ); +const v = dmeanli( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanli( N, x, 2 ); +const v = dmeanli( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanli( N, x1, 2 ); +const v = dmeanli( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanli( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanli.ndarray( N, x, 1, 0 ); +const v = dmeanli.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanli.ndarray( N, x, 2, 1 ); +const v = dmeanli.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dmeanli.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanli = require( '@stdlib/stats/base/dmeanli' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanli = require( '@stdlib/stats/base/dmeanli' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanli( x.length, x, 1 ); +const v = dmeanli( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanlipw/README.md b/lib/node_modules/@stdlib/stats/base/dmeanlipw/README.md index c2f21a70aff2..c69f88941a23 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanlipw/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanlipw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanlipw = require( '@stdlib/stats/base/dmeanlipw' ); +const dmeanlipw = require( '@stdlib/stats/base/dmeanlipw' ); ``` #### dmeanlipw( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanlipw = require( '@stdlib/stats/base/dmeanlipw' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using a one-pass trial mean algorithm with pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanlipw( N, x, 1 ); +const v = dmeanlipw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanlipw( N, x, 2 ); +const v = dmeanlipw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanlipw( N, x1, 2 ); +const v = dmeanlipw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanlipw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a one-pass trial mean algorithm with pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanlipw.ndarray( N, x, 1, 0 ); +const v = dmeanlipw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanlipw.ndarray( N, x, 2, 1 ); +const v = dmeanlipw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dmeanlipw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanlipw = require( '@stdlib/stats/base/dmeanlipw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanlipw = require( '@stdlib/stats/base/dmeanlipw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanlipw( x.length, x, 1 ); +const v = dmeanlipw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanors/README.md b/lib/node_modules/@stdlib/stats/base/dmeanors/README.md index ef5b9edb6552..a055cbde854a 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanors = require( '@stdlib/stats/base/dmeanors' ); +const dmeanors = require( '@stdlib/stats/base/dmeanors' ); ``` #### dmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanors = require( '@stdlib/stats/base/dmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanors( N, x, 1 ); +const v = dmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanors( N, x, 2 ); +const v = dmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanors( N, x1, 2 ); +const v = dmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanors.ndarray( N, x, 1, 0 ); +const v = dmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanors.ndarray( N, x, 2, 1 ); +const v = dmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanors = require( '@stdlib/stats/base/dmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanors = require( '@stdlib/stats/base/dmeanors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanors( x.length, x, 1 ); +const v = dmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/dmeanpn/README.md index 73eda8656b1c..79033b135e77 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanpn = require( '@stdlib/stats/base/dmeanpn' ); +const dmeanpn = require( '@stdlib/stats/base/dmeanpn' ); ``` #### dmeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanpn = require( '@stdlib/stats/base/dmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using a two-pass error correction algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanpn( N, x, 1 ); +const v = dmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanpn( N, x, 2 ); +const v = dmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanpn( N, x1, 2 ); +const v = dmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanpn.ndarray( N, x, 1, 0 ); +const v = dmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanpn.ndarray( N, x, 2, 1 ); +const v = dmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = dmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanpn = require( '@stdlib/stats/base/dmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanpn = require( '@stdlib/stats/base/dmeanpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanpn( x.length, x, 1 ); +const v = dmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanpw/README.md b/lib/node_modules/@stdlib/stats/base/dmeanpw/README.md index 42648a1c1c87..b11416c7e36d 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanpw/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanpw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanpw = require( '@stdlib/stats/base/dmeanpw' ); +const dmeanpw = require( '@stdlib/stats/base/dmeanpw' ); ``` #### dmeanpw( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanpw = require( '@stdlib/stats/base/dmeanpw' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanpw( N, x, 1 ); +const v = dmeanpw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanpw( N, x, 2 ); +const v = dmeanpw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanpw( N, x1, 2 ); +const v = dmeanpw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanpw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanpw.ndarray( N, x, 1, 0 ); +const v = dmeanpw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanpw.ndarray( N, x, 2, 1 ); +const v = dmeanpw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dmeanpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanpw = require( '@stdlib/stats/base/dmeanpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanpw = require( '@stdlib/stats/base/dmeanpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanpw( x.length, x, 1 ); +const v = dmeanpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanstdev/README.md b/lib/node_modules/@stdlib/stats/base/dmeanstdev/README.md index f6dd03f07602..3d861cdb5b3c 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanstdev/README.md @@ -97,7 +97,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dmeanstdev = require( '@stdlib/stats/base/dmeanstdev' ); +const dmeanstdev = require( '@stdlib/stats/base/dmeanstdev' ); ``` #### dmeanstdev( N, correction, x, strideX, out, strideOut ) @@ -105,15 +105,15 @@ var dmeanstdev = require( '@stdlib/stats/base/dmeanstdev' ); Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanstdev( x.length, 1, x, 1, out, 1 ); +const v = dmeanstdev( x.length, 1, x, 1, out, 1 ); // returns [ ~0.3333, ~2.0817 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -129,14 +129,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); +const N = floor( x.length / 2 ); -var v = dmeanstdev( N, 1, x, 2, out, 1 ); +const v = dmeanstdev( N, 1, x, 2, out, 1 ); // returns [ 1.25, 2.5 ] ``` @@ -145,18 +145,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanstdev( N, 1, x1, 2, out1, 1 ); +const v = dmeanstdev( N, 1, x1, 2, out1, 1 ); // returns [ 1.25, 2.5 ] ``` @@ -165,12 +165,12 @@ var v = dmeanstdev( N, 1, x1, 2, out1, 1 ); Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanstdev.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); +const v = dmeanstdev.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); // returns [ ~0.3333, ~2.0817 ] ``` @@ -182,14 +182,14 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameters support indexing semantics based on a starting index. For example, to calculate the [mean][arithmetic-mean] and [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); +const N = floor( x.length / 2 ); -var v = dmeanstdev.ndarray( N, 1, x, 2, 1, out, 2, 1 ); +const v = dmeanstdev.ndarray( N, 1, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 1.25, 0.0, 2.5 ] ``` @@ -215,22 +215,18 @@ var v = dmeanstdev.ndarray( N, 1, x, 2, 1, out, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanstdev = require( '@stdlib/stats/base/dmeanstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanstdev = require( '@stdlib/stats/base/dmeanstdev' ); -var out; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dmeanstdev( x.length, 1, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/dmeanstdevpn/README.md index 091296125973..dffa6a7caadd 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanstdevpn/README.md @@ -97,7 +97,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dmeanstdevpn = require( '@stdlib/stats/base/dmeanstdevpn' ); +const dmeanstdevpn = require( '@stdlib/stats/base/dmeanstdevpn' ); ``` #### dmeanstdevpn( N, correction, x, strideX, out, strideOut ) @@ -105,15 +105,15 @@ var dmeanstdevpn = require( '@stdlib/stats/base/dmeanstdevpn' ); Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanstdevpn( x.length, 1, x, 1, out, 1 ); +const v = dmeanstdevpn( x.length, 1, x, 1, out, 1 ); // returns [ ~0.3333, ~2.0817 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -129,14 +129,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); +const N = floor( x.length / 2 ); -var v = dmeanstdevpn( N, 1, x, 2, out, 1 ); +const v = dmeanstdevpn( N, 1, x, 2, out, 1 ); // returns [ 1.25, 2.5 ] ``` @@ -145,18 +145,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanstdevpn( N, 1, x1, 2, out1, 1 ); +const v = dmeanstdevpn( N, 1, x1, 2, out1, 1 ); // returns [ 1.25, 2.5 ] ``` @@ -165,12 +165,12 @@ var v = dmeanstdevpn( N, 1, x1, 2, out1, 1 ); Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanstdevpn.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); +const v = dmeanstdevpn.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); // returns [ ~0.3333, ~2.0817 ] ``` @@ -182,14 +182,14 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameters support indexing semantics based on a starting index. For example, to calculate the [mean][arithmetic-mean] and [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); +const N = floor( x.length / 2 ); -var v = dmeanstdevpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); +const v = dmeanstdevpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 1.25, 0.0, 2.5 ] ``` @@ -215,22 +215,18 @@ var v = dmeanstdevpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanstdevpn = require( '@stdlib/stats/base/dmeanstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanstdevpn = require( '@stdlib/stats/base/dmeanstdevpn' ); -var out; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dmeanstdevpn( x.length, 1, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanvar/README.md b/lib/node_modules/@stdlib/stats/base/dmeanvar/README.md index fd61fc07abbd..ba1897118fe2 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanvar/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanvar/README.md @@ -97,7 +97,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dmeanvar = require( '@stdlib/stats/base/dmeanvar' ); +const dmeanvar = require( '@stdlib/stats/base/dmeanvar' ); ``` #### dmeanvar( N, correction, x, strideX, out, strideOut ) @@ -105,15 +105,15 @@ var dmeanvar = require( '@stdlib/stats/base/dmeanvar' ); Computes the [mean][arithmetic-mean] and [variance][variance] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanvar( x.length, 1, x, 1, out, 1 ); +const v = dmeanvar( x.length, 1, x, 1, out, 1 ); // returns [ ~0.3333, ~4.3333 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -129,14 +129,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); +const N = floor( x.length / 2 ); -var v = dmeanvar( N, 1, x, 2, out, 1 ); +const v = dmeanvar( N, 1, x, 2, out, 1 ); // returns [ 1.25, 6.25 ] ``` @@ -145,18 +145,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanvar( N, 1, x1, 2, out1, 1 ); +const v = dmeanvar( N, 1, x1, 2, out1, 1 ); // returns [ 1.25, 6.25 ] ``` @@ -165,12 +165,12 @@ var v = dmeanvar( N, 1, x1, 2, out1, 1 ); Computes the [mean][arithmetic-mean] and [variance][variance] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanvar.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); +const v = dmeanvar.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); // returns [ ~0.3333, ~4.3333 ] ``` @@ -182,14 +182,14 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameters support indexing semantics based on a starting index. For example, to calculate the [mean][arithmetic-mean] and [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); +const N = floor( x.length / 2 ); -var v = dmeanvar.ndarray( N, 1, x, 2, 1, out, 2, 1 ); +const v = dmeanvar.ndarray( N, 1, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 1.25, 0.0, 6.25 ] ``` @@ -215,22 +215,18 @@ var v = dmeanvar.ndarray( N, 1, x, 2, 1, out, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanvar = require( '@stdlib/stats/base/dmeanvar' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanvar = require( '@stdlib/stats/base/dmeanvar' ); -var out; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dmeanvar( x.length, 1, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanvarpn/README.md b/lib/node_modules/@stdlib/stats/base/dmeanvarpn/README.md index 60abf2661988..43dc84c4f448 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanvarpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanvarpn/README.md @@ -97,7 +97,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dmeanvarpn = require( '@stdlib/stats/base/dmeanvarpn' ); +const dmeanvarpn = require( '@stdlib/stats/base/dmeanvarpn' ); ``` #### dmeanvarpn( N, correction, x, strideX, out, strideOut ) @@ -105,15 +105,15 @@ var dmeanvarpn = require( '@stdlib/stats/base/dmeanvarpn' ); Computes the [mean][arithmetic-mean] and [variance][variance] of a double-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanvarpn( x.length, 1, x, 1, out, 1 ); +const v = dmeanvarpn( x.length, 1, x, 1, out, 1 ); // returns [ ~0.3333, ~4.3333 ] -var bool = ( v === out ); +const bool = ( v === out ); // returns true ``` @@ -129,14 +129,14 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var out = new Float64Array( 2 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const out = new Float64Array( 2 ); +const N = floor( x.length / 2 ); -var v = dmeanvarpn( N, 1, x, 2, out, 1 ); +const v = dmeanvarpn( N, 1, x, 2, out, 1 ); // returns [ 1.25, 6.25 ] ``` @@ -145,18 +145,18 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out0 = new Float64Array( 4 ); -var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const out0 = new Float64Array( 4 ); +const out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanvarpn( N, 1, x1, 2, out1, 1 ); +const v = dmeanvarpn( N, 1, x1, 2, out1, 1 ); // returns [ 1.25, 6.25 ] ``` @@ -165,12 +165,12 @@ var v = dmeanvarpn( N, 1, x1, 2, out1, 1 ); Computes the [mean][arithmetic-mean] and [variance][variance] of a double-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var out = new Float64Array( 2 ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const out = new Float64Array( 2 ); -var v = dmeanvarpn.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); +const v = dmeanvarpn.ndarray( x.length, 1, x, 1, 0, out, 1, 0 ); // returns [ ~0.3333, ~4.3333 ] ``` @@ -182,14 +182,14 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameters support indexing semantics based on a starting index. For example, to calculate the [mean][arithmetic-mean] and [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var out = new Float64Array( 4 ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const out = new Float64Array( 4 ); +const N = floor( x.length / 2 ); -var v = dmeanvarpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); +const v = dmeanvarpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); // returns [ 0.0, 1.25, 0.0, 6.25 ] ``` @@ -215,22 +215,18 @@ var v = dmeanvarpn.ndarray( N, 1, x, 2, 1, out, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanvarpn = require( '@stdlib/stats/base/dmeanvarpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanvarpn = require( '@stdlib/stats/base/dmeanvarpn' ); -var out; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -out = new Float64Array( 2 ); +const out = new Float64Array( 2 ); dmeanvarpn( x.length, 1, x, 1, out, 1 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/dmeanwd/README.md index 323b3a45fcdb..504fc6cea440 100644 --- a/lib/node_modules/@stdlib/stats/base/dmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dmeanwd = require( '@stdlib/stats/base/dmeanwd' ); +const dmeanwd = require( '@stdlib/stats/base/dmeanwd' ); ``` #### dmeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var dmeanwd = require( '@stdlib/stats/base/dmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanwd( N, x, 1 ); +const v = dmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanwd( N, x, 2 ); +const v = dmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmeanwd( N, x1, 2 ); +const v = dmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmeanwd.ndarray( N, x, 1, 0 ); +const v = dmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmeanwd.ndarray( N, x, 2, 1 ); +const v = dmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = dmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmeanwd = require( '@stdlib/stats/base/dmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmeanwd = require( '@stdlib/stats/base/dmeanwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmeanwd( x.length, x, 1 ); +const v = dmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmediansorted/README.md b/lib/node_modules/@stdlib/stats/base/dmediansorted/README.md index a86ace776024..8cd16f10b824 100644 --- a/lib/node_modules/@stdlib/stats/base/dmediansorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmediansorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmediansorted = require( '@stdlib/stats/base/dmediansorted' ); +const dmediansorted = require( '@stdlib/stats/base/dmediansorted' ); ``` #### dmediansorted( N, x, stride ) @@ -41,10 +41,10 @@ var dmediansorted = require( '@stdlib/stats/base/dmediansorted' ); Computes the median value of a sorted double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var v = dmediansorted( x.length, x, 1 ); +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let v = dmediansorted( x.length, x, 1 ); // returns 2.0 x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the median value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmediansorted( N, x, 2 ); +const v = dmediansorted( N, x, 2 ); // returns 2.5 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmediansorted( N, x1, 2 ); +const v = dmediansorted( N, x1, 2 ); // returns 2.0 ``` @@ -93,12 +93,12 @@ var v = dmediansorted( N, x1, 2 ); Computes the median value of a sorted double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = dmediansorted.ndarray( N, x, 1, 0 ); +const v = dmediansorted.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the median value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmediansorted.ndarray( N, x, 2, 1 ); +const v = dmediansorted.ndarray( N, x, 2, 1 ); // returns 2.0 ``` @@ -141,19 +141,16 @@ var v = dmediansorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dmediansorted = require( '@stdlib/stats/base/dmediansorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmediansorted = require( '@stdlib/stats/base/dmediansorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = dmediansorted( x.length, x, 1 ); +const v = dmediansorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmidrange/README.md b/lib/node_modules/@stdlib/stats/base/dmidrange/README.md index f7dc4d6295ad..5585d665fbaf 100644 --- a/lib/node_modules/@stdlib/stats/base/dmidrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmidrange/README.md @@ -35,7 +35,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of th ## Usage ```javascript -var dmidrange = require( '@stdlib/stats/base/dmidrange' ); +const dmidrange = require( '@stdlib/stats/base/dmidrange' ); ``` #### dmidrange( N, x, stride ) @@ -43,11 +43,11 @@ var dmidrange = require( '@stdlib/stats/base/dmidrange' ); Computes the [mid-range][mid-range] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dmidrange( x.length, x, 1 ); +const v = dmidrange( x.length, x, 1 ); // returns 0.0 ``` @@ -60,13 +60,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [mid-range][mid-range] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmidrange( N, x, 2 ); +const v = dmidrange( N, x, 2 ); // returns 1.0 ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmidrange( N, x1, 2 ); +const v = dmidrange( N, x1, 2 ); // returns 1.0 ``` @@ -92,11 +92,11 @@ var v = dmidrange( N, x1, 2 ); Computes the [mid-range][mid-range] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dmidrange.ndarray( x.length, x, 1, 0 ); +const v = dmidrange.ndarray( x.length, x, 1, 0 ); // returns 0.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [mid-range][mid-range] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmidrange.ndarray( N, x, 2, 1 ); +const v = dmidrange.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,21 +138,18 @@ var v = dmidrange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmidrange = require( '@stdlib/stats/base/dmidrange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmidrange = require( '@stdlib/stats/base/dmidrange' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmidrange( x.length, x, 1 ); +const v = dmidrange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmin/README.md b/lib/node_modules/@stdlib/stats/base/dmin/README.md index f1d1f8859b24..bb2a62739229 100644 --- a/lib/node_modules/@stdlib/stats/base/dmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmin = require( '@stdlib/stats/base/dmin' ); +const dmin = require( '@stdlib/stats/base/dmin' ); ``` #### dmin( N, x, stride ) @@ -41,12 +41,12 @@ var dmin = require( '@stdlib/stats/base/dmin' ); Computes the minimum value of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmin( N, x, 1 ); +const v = dmin( N, x, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dmin( N, x, 2 ); +const v = dmin( N, x, 2 ); // returns -2.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmin( N, x1, 2 ); +const v = dmin( N, x1, 2 ); // returns -2.0 ``` @@ -91,12 +91,12 @@ var v = dmin( N, x1, 2 ); Computes the minimum value of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dmin.ndarray( N, x, 1, 0 ); +const v = dmin.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dmin.ndarray( N, x, 2, 1 ); +const v = dmin.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -138,21 +138,18 @@ var v = dmin.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmin = require( '@stdlib/stats/base/dmin' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmin = require( '@stdlib/stats/base/dmin' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dmin( x.length, x, 1 ); +const v = dmin( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dminabs/README.md b/lib/node_modules/@stdlib/stats/base/dminabs/README.md index 76963f336ead..c0305c5e62af 100644 --- a/lib/node_modules/@stdlib/stats/base/dminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dminabs = require( '@stdlib/stats/base/dminabs' ); +const dminabs = require( '@stdlib/stats/base/dminabs' ); ``` #### dminabs( N, x, stride ) @@ -41,12 +41,12 @@ var dminabs = require( '@stdlib/stats/base/dminabs' ); Computes the minimum absolute value of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dminabs( N, x, 1 ); +const v = dminabs( N, x, 1 ); // returns 1.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dminabs( N, x, 2 ); +const v = dminabs( N, x, 2 ); // returns 1.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dminabs( N, x1, 2 ); +const v = dminabs( N, x1, 2 ); // returns 1.0 ``` @@ -91,12 +91,12 @@ var v = dminabs( N, x1, 2 ); Computes the minimum absolute value of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dminabs.ndarray( N, x, 1, 0 ); +const v = dminabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dminabs.ndarray( N, x, 2, 1 ); +const v = dminabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,21 +138,18 @@ var v = dminabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dminabs = require( '@stdlib/stats/base/dminabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dminabs = require( '@stdlib/stats/base/dminabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dminabs( x.length, x, 1 ); +const v = dminabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dminsorted/README.md b/lib/node_modules/@stdlib/stats/base/dminsorted/README.md index dd2101aa24ec..7801a23829fe 100644 --- a/lib/node_modules/@stdlib/stats/base/dminsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/dminsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dminsorted = require( '@stdlib/stats/base/dminsorted' ); +const dminsorted = require( '@stdlib/stats/base/dminsorted' ); ``` #### dminsorted( N, x, stride ) @@ -41,12 +41,12 @@ var dminsorted = require( '@stdlib/stats/base/dminsorted' ); Computes the minimum value of a sorted double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let N = x.length; -var v = dminsorted( N, x, 1 ); +let v = dminsorted( N, x, 1 ); // returns 1.0 x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); @@ -65,13 +65,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dminsorted( N, x, 2 ); +const v = dminsorted( N, x, 2 ); // returns 1.0 ``` @@ -80,15 +80,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dminsorted( N, x1, 2 ); +const v = dminsorted( N, x1, 2 ); // returns 1.0 ``` @@ -97,12 +97,12 @@ var v = dminsorted( N, x1, 2 ); Computes the minimum value of a sorted double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = dminsorted.ndarray( N, x, 1, 0 ); +const v = dminsorted.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -113,13 +113,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dminsorted.ndarray( N, x, 2, 1 ); +const v = dminsorted.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -145,19 +145,16 @@ var v = dminsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dminsorted = require( '@stdlib/stats/base/dminsorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dminsorted = require( '@stdlib/stats/base/dminsorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = dminsorted( x.length, x, 1 ); +const v = dminsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmskmax/README.md b/lib/node_modules/@stdlib/stats/base/dmskmax/README.md index c9adb5ed4497..2e78edbb2b35 100644 --- a/lib/node_modules/@stdlib/stats/base/dmskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskmax = require( '@stdlib/stats/base/dmskmax' ); +const dmskmax = require( '@stdlib/stats/base/dmskmax' ); ``` #### dmskmax( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var dmskmax = require( '@stdlib/stats/base/dmskmax' ); Computes the maximum value of a double-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskmax( x.length, x, 1, mask, 1 ); +const v = dmskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskmax( N, x, 2, mask, 2 ); +const v = dmskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmskmax( N, x1, 2, mask1, 2 ); +const v = dmskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -100,13 +100,13 @@ var v = dmskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a double-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -151,19 +151,15 @@ var v = dmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskmax = require( '@stdlib/stats/base/dmskmax' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskmax = require( '@stdlib/stats/base/dmskmax' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -174,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dmskmax( x.length, x, 1, mask, 1 ); +const v = dmskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmskmin/README.md b/lib/node_modules/@stdlib/stats/base/dmskmin/README.md index 7f15599fe02c..863eba63ddd9 100644 --- a/lib/node_modules/@stdlib/stats/base/dmskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmskmin = require( '@stdlib/stats/base/dmskmin' ); +const dmskmin = require( '@stdlib/stats/base/dmskmin' ); ``` #### dmskmin( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var dmskmin = require( '@stdlib/stats/base/dmskmin' ); Computes the minimum value of a double-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskmin( x.length, x, 1, mask, 1 ); +const v = dmskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskmin( N, x, 2, mask, 2 ); +const v = dmskmin( N, x, 2, mask, 2 ); // returns -4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmskmin( N, x1, 2, mask1, 2 ); +const v = dmskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -100,13 +100,13 @@ var v = dmskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a double-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -151,19 +151,15 @@ var v = dmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskmin = require( '@stdlib/stats/base/dmskmin' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskmin = require( '@stdlib/stats/base/dmskmin' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -174,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dmskmin( x.length, x, 1, mask, 1 ); +const v = dmskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dmskrange/README.md b/lib/node_modules/@stdlib/stats/base/dmskrange/README.md index 4c88592858d8..f825d123ad73 100644 --- a/lib/node_modules/@stdlib/stats/base/dmskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/dmskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var dmskrange = require( '@stdlib/stats/base/dmskrange' ); +const dmskrange = require( '@stdlib/stats/base/dmskrange' ); ``` #### dmskrange( N, x, strideX, mask, strideMask ) @@ -43,13 +43,13 @@ var dmskrange = require( '@stdlib/stats/base/dmskrange' ); Computes the [range][range] of a double-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskrange( x.length, x, 1, mask, 1 ); +const v = dmskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -64,15 +64,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskrange( N, x, 2, mask, 2 ); +const v = dmskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -81,19 +81,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dmskrange( N, x1, 2, mask1, 2 ); +const v = dmskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -102,13 +102,13 @@ var v = dmskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a double-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = dmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -120,15 +120,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -153,19 +153,15 @@ var v = dmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskrange = require( '@stdlib/stats/base/dmskrange' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskrange = require( '@stdlib/stats/base/dmskrange' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -176,7 +172,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dmskrange( x.length, x, 1, mask, 1 ); +const v = dmskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmax/README.md b/lib/node_modules/@stdlib/stats/base/dnanmax/README.md index e381f8efb37e..68fe5c2c832f 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanmax = require( '@stdlib/stats/base/dnanmax' ); +const dnanmax = require( '@stdlib/stats/base/dnanmax' ); ``` #### dnanmax( N, x, stride ) @@ -41,12 +41,12 @@ var dnanmax = require( '@stdlib/stats/base/dnanmax' ); Computes the maximum value of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmax( N, x, 1 ); +const v = dnanmax( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmax( N, x, 2 ); +const v = dnanmax( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmax( N, x1, 2 ); +const v = dnanmax( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = dnanmax( N, x1, 2 ); Computes the maximum value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmax.ndarray( N, x, 1, 0 ); +const v = dnanmax.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmax.ndarray( N, x, 2, 1 ); +const v = dnanmax.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,16 +138,13 @@ var v = dnanmax.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmax = require( '@stdlib/stats/base/dnanmax' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmax = require( '@stdlib/stats/base/dnanmax' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmax( x.length, x, 1 ); +const v = dnanmax( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmaxabs/README.md b/lib/node_modules/@stdlib/stats/base/dnanmaxabs/README.md index 7d891dc1e842..2aff00db3032 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanmaxabs = require( '@stdlib/stats/base/dnanmaxabs' ); +const dnanmaxabs = require( '@stdlib/stats/base/dnanmaxabs' ); ``` #### dnanmaxabs( N, x, stride ) @@ -41,12 +41,12 @@ var dnanmaxabs = require( '@stdlib/stats/base/dnanmaxabs' ); Computes the maximum absolute value of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmaxabs( N, x, 1 ); +const v = dnanmaxabs( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmaxabs( N, x, 2 ); +const v = dnanmaxabs( N, x, 2 ); // returns 7.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmaxabs( N, x1, 2 ); +const v = dnanmaxabs( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = dnanmaxabs( N, x1, 2 ); Computes the maximum absolute value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmaxabs.ndarray( N, x, 1, 0 ); +const v = dnanmaxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmaxabs.ndarray( N, x, 2, 1 ); +const v = dnanmaxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,16 +138,13 @@ var v = dnanmaxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmaxabs = require( '@stdlib/stats/base/dnanmaxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmaxabs = require( '@stdlib/stats/base/dnanmaxabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmaxabs( x.length, x, 1 ); +const v = dnanmaxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmean/README.md b/lib/node_modules/@stdlib/stats/base/dnanmean/README.md index 17ce4a303f3a..7f84b9864598 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dnanmean = require( '@stdlib/stats/base/dnanmean' ); +const dnanmean = require( '@stdlib/stats/base/dnanmean' ); ``` #### dnanmean( N, x, stride ) @@ -56,12 +56,12 @@ var dnanmean = require( '@stdlib/stats/base/dnanmean' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmean( N, x, 1 ); +const v = dnanmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmean( N, x, 2 ); +const v = dnanmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmean( N, x1, 2 ); +const v = dnanmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dnanmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmean.ndarray( N, x, 1, 0 ); +const v = dnanmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmean.ndarray( N, x, 2, 1 ); +const v = dnanmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = dnanmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmean = require( '@stdlib/stats/base/dnanmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmean = require( '@stdlib/stats/base/dnanmean' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmean( x.length, x, 1 ); +const v = dnanmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmeanors/README.md b/lib/node_modules/@stdlib/stats/base/dnanmeanors/README.md index 18124db12981..6c61ed89b060 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dnanmeanors = require( '@stdlib/stats/base/dnanmeanors' ); +const dnanmeanors = require( '@stdlib/stats/base/dnanmeanors' ); ``` #### dnanmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var dnanmeanors = require( '@stdlib/stats/base/dnanmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanors( N, x, 1 ); +const v = dnanmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanors( N, x, 2 ); +const v = dnanmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmeanors( N, x1, 2 ); +const v = dnanmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dnanmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanors.ndarray( N, x, 1, 0 ); +const v = dnanmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanors.ndarray( N, x, 2, 1 ); +const v = dnanmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = dnanmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmeanors = require( '@stdlib/stats/base/dnanmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmeanors = require( '@stdlib/stats/base/dnanmeanors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmeanors( x.length, x, 1 ); +const v = dnanmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/dnanmeanpn/README.md index 9a9a2344a962..2db362d2e081 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dnanmeanpn = require( '@stdlib/stats/base/dnanmeanpn' ); +const dnanmeanpn = require( '@stdlib/stats/base/dnanmeanpn' ); ``` #### dnanmeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var dnanmeanpn = require( '@stdlib/stats/base/dnanmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, ignoring `NaN` values and using a two-pass error correction algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanpn( N, x, 1 ); +const v = dnanmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanpn( N, x, 2 ); +const v = dnanmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmeanpn( N, x1, 2 ); +const v = dnanmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dnanmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanpn.ndarray( N, x, 1, 0 ); +const v = dnanmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanpn.ndarray( N, x, 2, 1 ); +const v = dnanmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = dnanmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmeanpn = require( '@stdlib/stats/base/dnanmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmeanpn = require( '@stdlib/stats/base/dnanmeanpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmeanpn( x.length, x, 1 ); +const v = dnanmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmeanpw/README.md b/lib/node_modules/@stdlib/stats/base/dnanmeanpw/README.md index 64b1e5cc791c..4feb21c0543b 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmeanpw/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmeanpw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dnanmeanpw = require( '@stdlib/stats/base/dnanmeanpw' ); +const dnanmeanpw = require( '@stdlib/stats/base/dnanmeanpw' ); ``` #### dnanmeanpw( N, x, stride ) @@ -56,12 +56,12 @@ var dnanmeanpw = require( '@stdlib/stats/base/dnanmeanpw' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, ignoring `NaN` values and using pairwise summation. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanpw( N, x, 1 ); +const v = dnanmeanpw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanpw( N, x, 2 ); +const v = dnanmeanpw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmeanpw( N, x1, 2 ); +const v = dnanmeanpw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dnanmeanpw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using pairwise summation and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanpw.ndarray( N, x, 1, 0 ); +const v = dnanmeanpw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanpw.ndarray( N, x, 2, 1 ); +const v = dnanmeanpw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = dnanmeanpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmeanpw = require( '@stdlib/stats/base/dnanmeanpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmeanpw = require( '@stdlib/stats/base/dnanmeanpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmeanpw( x.length, x, 1 ); +const v = dnanmeanpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/dnanmeanwd/README.md index 8392e1999459..50b85c442eeb 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dnanmeanwd = require( '@stdlib/stats/base/dnanmeanwd' ); +const dnanmeanwd = require( '@stdlib/stats/base/dnanmeanwd' ); ``` #### dnanmeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var dnanmeanwd = require( '@stdlib/stats/base/dnanmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, using Welford's algorithm and ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanwd( N, x, 1 ); +const v = dnanmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanwd( N, x, 2 ); +const v = dnanmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmeanwd( N, x1, 2 ); +const v = dnanmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dnanmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmeanwd.ndarray( N, x, 1, 0 ); +const v = dnanmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmeanwd.ndarray( N, x, 2, 1 ); +const v = dnanmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = dnanmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmeanwd = require( '@stdlib/stats/base/dnanmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmeanwd = require( '@stdlib/stats/base/dnanmeanwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmeanwd( x.length, x, 1 ); +const v = dnanmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmin/README.md b/lib/node_modules/@stdlib/stats/base/dnanmin/README.md index 4afe8a956f08..d1c9e41097dd 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanmin = require( '@stdlib/stats/base/dnanmin' ); +const dnanmin = require( '@stdlib/stats/base/dnanmin' ); ``` #### dnanmin( N, x, stride ) @@ -41,12 +41,12 @@ var dnanmin = require( '@stdlib/stats/base/dnanmin' ); Computes the minimum value of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmin( N, x, 1 ); +const v = dnanmin( N, x, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmin( N, x, 2 ); +const v = dnanmin( N, x, 2 ); // returns -7.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmin( N, x1, 2 ); +const v = dnanmin( N, x1, 2 ); // returns -2.0 ``` @@ -91,12 +91,12 @@ var v = dnanmin( N, x1, 2 ); Computes the minimum value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanmin.ndarray( N, x, 1, 0 ); +const v = dnanmin.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanmin.ndarray( N, x, 2, 1 ); +const v = dnanmin.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -138,16 +138,13 @@ var v = dnanmin.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanmin = require( '@stdlib/stats/base/dnanmin' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanmin = require( '@stdlib/stats/base/dnanmin' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanmin( x.length, x, 1 ); +const v = dnanmin( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanminabs/README.md b/lib/node_modules/@stdlib/stats/base/dnanminabs/README.md index 99fa73451128..5648d6ceedb8 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanminabs = require( '@stdlib/stats/base/dnanminabs' ); +const dnanminabs = require( '@stdlib/stats/base/dnanminabs' ); ``` #### dnanminabs( N, x, stride ) @@ -41,12 +41,12 @@ var dnanminabs = require( '@stdlib/stats/base/dnanminabs' ); Computes the minimum absolute value of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanminabs( N, x, 1 ); +const v = dnanminabs( N, x, 1 ); // returns 1.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanminabs( N, x, 2 ); +const v = dnanminabs( N, x, 2 ); // returns 1.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanminabs( N, x1, 2 ); +const v = dnanminabs( N, x1, 2 ); // returns 1.0 ``` @@ -91,12 +91,12 @@ var v = dnanminabs( N, x1, 2 ); Computes the minimum absolute value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanminabs.ndarray( N, x, 1, 0 ); +const v = dnanminabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanminabs.ndarray( N, x, 2, 1 ); +const v = dnanminabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,16 +138,13 @@ var v = dnanminabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanminabs = require( '@stdlib/stats/base/dnanminabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanminabs = require( '@stdlib/stats/base/dnanminabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanminabs( x.length, x, 1 ); +const v = dnanminabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmskmax/README.md b/lib/node_modules/@stdlib/stats/base/dnanmskmax/README.md index bb21608961f2..4c4d41dc53bb 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanmskmax = require( '@stdlib/stats/base/dnanmskmax' ); +const dnanmskmax = require( '@stdlib/stats/base/dnanmskmax' ); ``` #### dnanmskmax( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var dnanmskmax = require( '@stdlib/stats/base/dnanmskmax' ); Computes the maximum value of a double-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskmax( x.length, x, 1, mask, 1 ); +const v = dnanmskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskmax( N, x, 2, mask, 2 ); +const v = dnanmskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmskmax( N, x1, 2, mask1, 2 ); +const v = dnanmskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -100,13 +100,13 @@ var v = dnanmskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a double-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dnanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dnanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -151,19 +151,15 @@ var v = dnanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dnanmskmax = require( '@stdlib/stats/base/dnanmskmax' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dnanmskmax = require( '@stdlib/stats/base/dnanmskmax' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -178,7 +174,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dnanmskmax( x.length, x, 1, mask, 1 ); +const v = dnanmskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmskmin/README.md b/lib/node_modules/@stdlib/stats/base/dnanmskmin/README.md index df38a8571a98..fb7258c7a6e1 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dnanmskmin = require( '@stdlib/stats/base/dnanmskmin' ); +const dnanmskmin = require( '@stdlib/stats/base/dnanmskmin' ); ``` #### dnanmskmin( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var dnanmskmin = require( '@stdlib/stats/base/dnanmskmin' ); Computes the minimum value of a double-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskmin( x.length, x, 1, mask, 1 ); +const v = dnanmskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskmin( N, x, 2, mask, 2 ); +const v = dnanmskmin( N, x, 2, mask, 2 ); // returns -4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmskmin( N, x1, 2, mask1, 2 ); +const v = dnanmskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -100,13 +100,13 @@ var v = dnanmskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a double-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dnanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dnanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -151,19 +151,15 @@ var v = dnanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dnanmskmin = require( '@stdlib/stats/base/dnanmskmin' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dnanmskmin = require( '@stdlib/stats/base/dnanmskmin' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -178,7 +174,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dnanmskmin( x.length, x, 1, mask, 1 ); +const v = dnanmskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanmskrange/README.md b/lib/node_modules/@stdlib/stats/base/dnanmskrange/README.md index 8fd47395c497..f1af96141a27 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanmskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanmskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var dnanmskrange = require( '@stdlib/stats/base/dnanmskrange' ); +const dnanmskrange = require( '@stdlib/stats/base/dnanmskrange' ); ``` #### dnanmskrange( N, x, strideX, mask, strideMask ) @@ -43,13 +43,13 @@ var dnanmskrange = require( '@stdlib/stats/base/dnanmskrange' ); Computes the [range][range] of a double-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskrange( x.length, x, 1, mask, 1 ); +const v = dnanmskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -64,15 +64,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskrange( N, x, 2, mask, 2 ); +const v = dnanmskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -81,19 +81,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanmskrange( N, x1, 2, mask1, 2 ); +const v = dnanmskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -102,13 +102,13 @@ var v = dnanmskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a double-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = dnanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = dnanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -120,15 +120,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = dnanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = dnanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -153,19 +153,15 @@ var v = dnanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dnanmskrange = require( '@stdlib/stats/base/dnanmskrange' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dnanmskrange = require( '@stdlib/stats/base/dnanmskrange' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -180,7 +176,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = dnanmskrange( x.length, x, 1, mask, 1 ); +const v = dnanmskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/README.md b/lib/node_modules/@stdlib/stats/base/dnanrange/README.md index 5440fd8631e8..d0363f578b15 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var dnanrange = require( '@stdlib/stats/base/dnanrange' ); +const dnanrange = require( '@stdlib/stats/base/dnanrange' ); ``` #### dnanrange( N, x, stride ) @@ -43,12 +43,12 @@ var dnanrange = require( '@stdlib/stats/base/dnanrange' ); Computes the [range][range] of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanrange( N, x, 1 ); +const v = dnanrange( N, x, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanrange( N, x, 2 ); +const v = dnanrange( N, x, 2 ); // returns 11.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanrange( N, x1, 2 ); +const v = dnanrange( N, x1, 2 ); // returns 6.0 ``` @@ -93,12 +93,12 @@ var v = dnanrange( N, x1, 2 ); Computes the [range][range] of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dnanrange.ndarray( N, x, 1, 0 ); +const v = dnanrange.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanrange.ndarray( N, x, 2, 1 ); +const v = dnanrange.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -140,16 +140,13 @@ var v = dnanrange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanrange = require( '@stdlib/stats/base/dnanrange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanrange = require( '@stdlib/stats/base/dnanrange' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -158,7 +155,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dnanrange( x.length, x, 1 ); +const v = dnanrange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdev/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdev/README.md index 71b7adbac231..e60bdc4de2ac 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdev = require( '@stdlib/stats/base/dnanstdev' ); +const dnanstdev = require( '@stdlib/stats/base/dnanstdev' ); ``` #### dnanstdev( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdev = require( '@stdlib/stats/base/dnanstdev' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdev( x.length, 1, x, 1 ); +const v = dnanstdev( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdev( N, 1, x, 2 ); +const v = dnanstdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdev( N, 1, x1, 2 ); +const v = dnanstdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdev.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdev.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdev.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = dnanstdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdev = require( '@stdlib/stats/base/dnanstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdev = require( '@stdlib/stats/base/dnanstdev' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdev( x.length, 1, x, 1 ); +const v = dnanstdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdevch/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdevch/README.md index 485302bdc7cc..e1e72a28f7b0 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdevch = require( '@stdlib/stats/base/dnanstdevch' ); +const dnanstdevch = require( '@stdlib/stats/base/dnanstdevch' ); ``` #### dnanstdevch( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdevch = require( '@stdlib/stats/base/dnanstdevch' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevch( x.length, 1, x, 1 ); +const v = dnanstdevch( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevch( N, 1, x, 2 ); +const v = dnanstdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdevch( N, 1, x1, 2 ); +const v = dnanstdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevch.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdevch.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevch.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -201,21 +201,18 @@ var v = dnanstdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdevch = require( '@stdlib/stats/base/dnanstdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdevch = require( '@stdlib/stats/base/dnanstdevch' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdevch( x.length, 1, x, 1 ); +const v = dnanstdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdevpn/README.md index be1b74321aff..ec07d77d3fb5 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdevpn = require( '@stdlib/stats/base/dnanstdevpn' ); +const dnanstdevpn = require( '@stdlib/stats/base/dnanstdevpn' ); ``` #### dnanstdevpn( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdevpn = require( '@stdlib/stats/base/dnanstdevpn' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevpn( x.length, 1, x, 1 ); +const v = dnanstdevpn( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevpn( N, 1, x, 2 ); +const v = dnanstdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdevpn( N, 1, x1, 2 ); +const v = dnanstdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevpn.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdevpn.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevpn.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = dnanstdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdevpn = require( '@stdlib/stats/base/dnanstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdevpn = require( '@stdlib/stats/base/dnanstdevpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdevpn( x.length, 1, x, 1 ); +const v = dnanstdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdevtk/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdevtk/README.md index 677899ab93e4..7f237da671c6 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdevtk = require( '@stdlib/stats/base/dnanstdevtk' ); +const dnanstdevtk = require( '@stdlib/stats/base/dnanstdevtk' ); ``` #### dnanstdevtk( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdevtk = require( '@stdlib/stats/base/dnanstdevtk' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevtk( x.length, 1, x, 1 ); +const v = dnanstdevtk( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevtk( N, 1, x, 2 ); +const v = dnanstdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdevtk( N, 1, x1, 2 ); +const v = dnanstdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevtk.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdevtk.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevtk.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -201,21 +201,18 @@ var v = dnanstdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdevtk = require( '@stdlib/stats/base/dnanstdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdevtk = require( '@stdlib/stats/base/dnanstdevtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdevtk( x.length, 1, x, 1 ); +const v = dnanstdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdevwd/README.md index 7a2d1b8b66eb..6c08929e74ae 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdevwd = require( '@stdlib/stats/base/dnanstdevwd' ); +const dnanstdevwd = require( '@stdlib/stats/base/dnanstdevwd' ); ``` #### dnanstdevwd( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdevwd = require( '@stdlib/stats/base/dnanstdevwd' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevwd( x.length, 1, x, 1 ); +const v = dnanstdevwd( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevwd( N, 1, x, 2 ); +const v = dnanstdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdevwd( N, 1, x1, 2 ); +const v = dnanstdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevwd.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdevwd.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevwd.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = dnanstdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdevwd = require( '@stdlib/stats/base/dnanstdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdevwd = require( '@stdlib/stats/base/dnanstdevwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdevwd( x.length, 1, x, 1 ); +const v = dnanstdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanstdevyc/README.md b/lib/node_modules/@stdlib/stats/base/dnanstdevyc/README.md index 566b1f30d7af..1bc8ebd7c88d 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanstdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanstdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanstdevyc = require( '@stdlib/stats/base/dnanstdevyc' ); +const dnanstdevyc = require( '@stdlib/stats/base/dnanstdevyc' ); ``` #### dnanstdevyc( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanstdevyc = require( '@stdlib/stats/base/dnanstdevyc' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevyc( x.length, 1, x, 1 ); +const v = dnanstdevyc( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevyc( N, 1, x, 2 ); +const v = dnanstdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanstdevyc( N, 1, x1, 2 ); +const v = dnanstdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = dnanstdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanstdevyc.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanstdevyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanstdevyc.ndarray( N, 1, x, 2, 1 ); +const v = dnanstdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = dnanstdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanstdevyc = require( '@stdlib/stats/base/dnanstdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanstdevyc = require( '@stdlib/stats/base/dnanstdevyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanstdevyc( x.length, 1, x, 1 ); +const v = dnanstdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvariance/README.md b/lib/node_modules/@stdlib/stats/base/dnanvariance/README.md index 9b125e03d9c2..aa782d5cc5e9 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvariance = require( '@stdlib/stats/base/dnanvariance' ); +const dnanvariance = require( '@stdlib/stats/base/dnanvariance' ); ``` #### dnanvariance( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvariance = require( '@stdlib/stats/base/dnanvariance' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariance( x.length, 1, x, 1 ); +const v = dnanvariance( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvariance( N, 1, x, 2 ); +const v = dnanvariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvariance( N, 1, x1, 2 ); +const v = dnanvariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvariance( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariance.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvariance.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvariance.ndarray( N, 1, x, 2, 1 ); +const v = dnanvariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = dnanvariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvariance = require( '@stdlib/stats/base/dnanvariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvariance = require( '@stdlib/stats/base/dnanvariance' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvariance( x.length, 1, x, 1 ); +const v = dnanvariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvariancech/README.md b/lib/node_modules/@stdlib/stats/base/dnanvariancech/README.md index 0deb506a3836..f068e45dd318 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvariancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvariancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvariancech = require( '@stdlib/stats/base/dnanvariancech' ); +const dnanvariancech = require( '@stdlib/stats/base/dnanvariancech' ); ``` #### dnanvariancech( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvariancech = require( '@stdlib/stats/base/dnanvariancech' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancech( x.length, 1, x, 1 ); +const v = dnanvariancech( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancech( N, 1, x, 2 ); +const v = dnanvariancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvariancech( N, 1, x1, 2 ); +const v = dnanvariancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvariancech( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancech.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvariancech.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancech.ndarray( N, 1, x, 2, 1 ); +const v = dnanvariancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = dnanvariancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvariancech = require( '@stdlib/stats/base/dnanvariancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvariancech = require( '@stdlib/stats/base/dnanvariancech' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvariancech( x.length, 1, x, 1 ); +const v = dnanvariancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvariancepn/README.md b/lib/node_modules/@stdlib/stats/base/dnanvariancepn/README.md index a096d2bcc40d..e8ceb69c0e6f 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvariancepn = require( '@stdlib/stats/base/dnanvariancepn' ); +const dnanvariancepn = require( '@stdlib/stats/base/dnanvariancepn' ); ``` #### dnanvariancepn( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvariancepn = require( '@stdlib/stats/base/dnanvariancepn' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancepn( x.length, 1, x, 1 ); +const v = dnanvariancepn( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancepn( N, 1, x, 2 ); +const v = dnanvariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvariancepn( N, 1, x1, 2 ); +const v = dnanvariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancepn.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvariancepn.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancepn.ndarray( N, 1, x, 2, 1 ); +const v = dnanvariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = dnanvariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvariancepn = require( '@stdlib/stats/base/dnanvariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvariancepn = require( '@stdlib/stats/base/dnanvariancepn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvariancepn( x.length, 1, x, 1 ); +const v = dnanvariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvariancetk/README.md b/lib/node_modules/@stdlib/stats/base/dnanvariancetk/README.md index a180fcd4b753..a29498619b45 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvariancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvariancetk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' ); +const dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' ); ``` #### dnanvariancetk( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancetk( x.length, 1, x, 1 ); +const v = dnanvariancetk( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancetk( N, 1, x, 2 ); +const v = dnanvariancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvariancetk( N, 1, x1, 2 ); +const v = dnanvariancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvariancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancetk.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvariancetk.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancetk.ndarray( N, 1, x, 2, 1 ); +const v = dnanvariancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = dnanvariancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvariancetk( x.length, 1, x, 1 ); +const v = dnanvariancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvariancewd/README.md b/lib/node_modules/@stdlib/stats/base/dnanvariancewd/README.md index 71a7c2eb6f25..304981a72a28 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvariancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvariancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvariancewd = require( '@stdlib/stats/base/dnanvariancewd' ); +const dnanvariancewd = require( '@stdlib/stats/base/dnanvariancewd' ); ``` #### dnanvariancewd( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvariancewd = require( '@stdlib/stats/base/dnanvariancewd' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancewd( x.length, 1, x, 1 ); +const v = dnanvariancewd( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancewd( N, 1, x, 2 ); +const v = dnanvariancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvariancewd( N, 1, x1, 2 ); +const v = dnanvariancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvariancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvariancewd.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvariancewd.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvariancewd.ndarray( N, 1, x, 2, 1 ); +const v = dnanvariancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = dnanvariancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvariancewd = require( '@stdlib/stats/base/dnanvariancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvariancewd = require( '@stdlib/stats/base/dnanvariancewd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvariancewd( x.length, 1, x, 1 ); +const v = dnanvariancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dnanvarianceyc/README.md b/lib/node_modules/@stdlib/stats/base/dnanvarianceyc/README.md index 48d27c59b488..01658074e967 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanvarianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanvarianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dnanvarianceyc = require( '@stdlib/stats/base/dnanvarianceyc' ); +const dnanvarianceyc = require( '@stdlib/stats/base/dnanvarianceyc' ); ``` #### dnanvarianceyc( N, correction, x, stride ) @@ -103,11 +103,11 @@ var dnanvarianceyc = require( '@stdlib/stats/base/dnanvarianceyc' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvarianceyc( x.length, 1, x, 1 ); +const v = dnanvarianceyc( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dnanvarianceyc( N, 1, x, 2 ); +const v = dnanvarianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dnanvarianceyc( N, 1, x1, 2 ); +const v = dnanvarianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = dnanvarianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); +const v = dnanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dnanvarianceyc.ndarray( N, 1, x, 2, 1 ); +const v = dnanvarianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = dnanvarianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dnanvarianceyc = require( '@stdlib/stats/base/dnanvarianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dnanvarianceyc = require( '@stdlib/stats/base/dnanvarianceyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dnanvarianceyc( x.length, 1, x, 1 ); +const v = dnanvarianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/drange/README.md b/lib/node_modules/@stdlib/stats/base/drange/README.md index 79339de76b39..ab2378a06ba1 100644 --- a/lib/node_modules/@stdlib/stats/base/drange/README.md +++ b/lib/node_modules/@stdlib/stats/base/drange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var drange = require( '@stdlib/stats/base/drange' ); +const drange = require( '@stdlib/stats/base/drange' ); ``` #### drange( N, x, stride ) @@ -43,12 +43,12 @@ var drange = require( '@stdlib/stats/base/drange' ); Computes the [range][range] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = drange( N, x, 1 ); +const v = drange( N, x, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = drange( N, x, 2 ); +const v = drange( N, x, 2 ); // returns 6.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = drange( N, x1, 2 ); +const v = drange( N, x1, 2 ); // returns 6.0 ``` @@ -93,12 +93,12 @@ var v = drange( N, x1, 2 ); Computes the [range][range] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = drange.ndarray( N, x, 1, 0 ); +const v = drange.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = drange.ndarray( N, x, 2, 1 ); +const v = drange.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -140,21 +140,18 @@ var v = drange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var drange = require( '@stdlib/stats/base/drange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const drange = require( '@stdlib/stats/base/drange' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = drange( x.length, x, 1 ); +const v = drange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsem/README.md b/lib/node_modules/@stdlib/stats/base/dsem/README.md index 129b5d6e40b7..3c14b35cedca 100644 --- a/lib/node_modules/@stdlib/stats/base/dsem/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsem/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsem = require( '@stdlib/stats/base/dsem' ); +const dsem = require( '@stdlib/stats/base/dsem' ); ``` #### dsem( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsem = require( '@stdlib/stats/base/dsem' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsem( N, 1, x, 1 ); +const v = dsem( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsem( N, 1, x, 2 ); +const v = dsem( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsem( N, 1, x1, 2 ); +const v = dsem( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsem( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsem.ndarray( N, 1, x, 1, 0 ); +const v = dsem.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsem.ndarray( N, 1, x, 2, 1 ); +const v = dsem.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -174,21 +174,18 @@ var v = dsem.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsem = require( '@stdlib/stats/base/dsem' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsem = require( '@stdlib/stats/base/dsem' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsem( x.length, 1, x, 1 ); +const v = dsem( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsemch/README.md b/lib/node_modules/@stdlib/stats/base/dsemch/README.md index 041f4cca147b..f36ba939d9e9 100644 --- a/lib/node_modules/@stdlib/stats/base/dsemch/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsemch/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsemch = require( '@stdlib/stats/base/dsemch' ); +const dsemch = require( '@stdlib/stats/base/dsemch' ); ``` #### dsemch( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsemch = require( '@stdlib/stats/base/dsemch' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemch( N, 1, x, 1 ); +const v = dsemch( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemch( N, 1, x, 2 ); +const v = dsemch( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsemch( N, 1, x1, 2 ); +const v = dsemch( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsemch( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemch.ndarray( N, 1, x, 1, 0 ); +const v = dsemch.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemch.ndarray( N, 1, x, 2, 1 ); +const v = dsemch.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -175,21 +175,18 @@ var v = dsemch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsemch = require( '@stdlib/stats/base/dsemch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsemch = require( '@stdlib/stats/base/dsemch' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsemch( x.length, 1, x, 1 ); +const v = dsemch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsempn/README.md b/lib/node_modules/@stdlib/stats/base/dsempn/README.md index 28c17d007b31..7a1bdcfda9a5 100644 --- a/lib/node_modules/@stdlib/stats/base/dsempn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsempn/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsempn = require( '@stdlib/stats/base/dsempn' ); +const dsempn = require( '@stdlib/stats/base/dsempn' ); ``` #### dsempn( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsempn = require( '@stdlib/stats/base/dsempn' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsempn( N, 1, x, 1 ); +const v = dsempn( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsempn( N, 1, x, 2 ); +const v = dsempn( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsempn( N, 1, x1, 2 ); +const v = dsempn( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsempn( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsempn.ndarray( N, 1, x, 1, 0 ); +const v = dsempn.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsempn.ndarray( N, 1, x, 2, 1 ); +const v = dsempn.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -174,21 +174,18 @@ var v = dsempn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsempn = require( '@stdlib/stats/base/dsempn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsempn = require( '@stdlib/stats/base/dsempn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsempn( x.length, 1, x, 1 ); +const v = dsempn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsemtk/README.md b/lib/node_modules/@stdlib/stats/base/dsemtk/README.md index ab6c894ee1e7..bedabdbab1a3 100644 --- a/lib/node_modules/@stdlib/stats/base/dsemtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsemtk/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsemtk = require( '@stdlib/stats/base/dsemtk' ); +const dsemtk = require( '@stdlib/stats/base/dsemtk' ); ``` #### dsemtk( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsemtk = require( '@stdlib/stats/base/dsemtk' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x` using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemtk( N, 1, x, 1 ); +const v = dsemtk( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemtk( N, 1, x, 2 ); +const v = dsemtk( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsemtk( N, 1, x1, 2 ); +const v = dsemtk( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsemtk( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemtk.ndarray( N, 1, x, 1, 0 ); +const v = dsemtk.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemtk.ndarray( N, 1, x, 2, 1 ); +const v = dsemtk.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -175,21 +175,18 @@ var v = dsemtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsemtk = require( '@stdlib/stats/base/dsemtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsemtk = require( '@stdlib/stats/base/dsemtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsemtk( x.length, 1, x, 1 ); +const v = dsemtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsemwd/README.md b/lib/node_modules/@stdlib/stats/base/dsemwd/README.md index ea94c1ec11a2..7d9dec5ede8f 100644 --- a/lib/node_modules/@stdlib/stats/base/dsemwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsemwd/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsemwd = require( '@stdlib/stats/base/dsemwd' ); +const dsemwd = require( '@stdlib/stats/base/dsemwd' ); ``` #### dsemwd( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsemwd = require( '@stdlib/stats/base/dsemwd' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemwd( N, 1, x, 1 ); +const v = dsemwd( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemwd( N, 1, x, 2 ); +const v = dsemwd( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsemwd( N, 1, x1, 2 ); +const v = dsemwd( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsemwd( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemwd.ndarray( N, 1, x, 1, 0 ); +const v = dsemwd.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemwd.ndarray( N, 1, x, 2, 1 ); +const v = dsemwd.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -174,21 +174,18 @@ var v = dsemwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsemwd = require( '@stdlib/stats/base/dsemwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsemwd = require( '@stdlib/stats/base/dsemwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsemwd( x.length, 1, x, 1 ); +const v = dsemwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsemyc/README.md b/lib/node_modules/@stdlib/stats/base/dsemyc/README.md index c9cdcc5014b0..168732b58b3c 100644 --- a/lib/node_modules/@stdlib/stats/base/dsemyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsemyc/README.md @@ -67,7 +67,7 @@ where `s` is the sample [standard deviation][standard-deviation]. ## Usage ```javascript -var dsemyc = require( '@stdlib/stats/base/dsemyc' ); +const dsemyc = require( '@stdlib/stats/base/dsemyc' ); ``` #### dsemyc( N, correction, x, stride ) @@ -75,12 +75,12 @@ var dsemyc = require( '@stdlib/stats/base/dsemyc' ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemyc( N, 1, x, 1 ); +const v = dsemyc( N, 1, x, 1 ); // returns ~1.20185 ``` @@ -94,13 +94,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemyc( N, 1, x, 2 ); +const v = dsemyc( N, 1, x, 2 ); // returns 1.25 ``` @@ -109,15 +109,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsemyc( N, 1, x1, 2 ); +const v = dsemyc( N, 1, x1, 2 ); // returns 1.25 ``` @@ -126,12 +126,12 @@ var v = dsemyc( N, 1, x1, 2 ); Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsemyc.ndarray( N, 1, x, 1, 0 ); +const v = dsemyc.ndarray( N, 1, x, 1, 0 ); // returns ~1.20185 ``` @@ -142,13 +142,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsemyc.ndarray( N, 1, x, 2, 1 ); +const v = dsemyc.ndarray( N, 1, x, 2, 1 ); // returns 1.25 ``` @@ -174,21 +174,18 @@ var v = dsemyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsemyc = require( '@stdlib/stats/base/dsemyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dsemyc = require( '@stdlib/stats/base/dsemyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsemyc( x.length, 1, x, 1 ); +const v = dsemyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsmean/README.md b/lib/node_modules/@stdlib/stats/base/dsmean/README.md index 8343c4b95c04..2a90b2f36a10 100644 --- a/lib/node_modules/@stdlib/stats/base/dsmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsmean = require( '@stdlib/stats/base/dsmean' ); +const dsmean = require( '@stdlib/stats/base/dsmean' ); ``` #### dsmean( N, x, stride ) @@ -56,12 +56,12 @@ var dsmean = require( '@stdlib/stats/base/dsmean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmean( N, x, 1 ); +const v = dsmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmean( N, x, 2 ); +const v = dsmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsmean( N, x1, 2 ); +const v = dsmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmean.ndarray( N, x, 1, 0 ); +const v = dsmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmean.ndarray( N, x, 2, 1 ); +const v = dsmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dsmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsmean = require( '@stdlib/stats/base/dsmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsmean = require( '@stdlib/stats/base/dsmean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsmean( x.length, x, 1 ); +const v = dsmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsmeanors/README.md b/lib/node_modules/@stdlib/stats/base/dsmeanors/README.md index 47c4ca5ee399..669e56ba4e9c 100644 --- a/lib/node_modules/@stdlib/stats/base/dsmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsmeanors = require( '@stdlib/stats/base/dsmeanors' ); +const dsmeanors = require( '@stdlib/stats/base/dsmeanors' ); ``` #### dsmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var dsmeanors = require( '@stdlib/stats/base/dsmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using ordinary recursive summation with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanors( N, x, 1 ); +const v = dsmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanors( N, x, 2 ); +const v = dsmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsmeanors( N, x1, 2 ); +const v = dsmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using ordinary recursive summation with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanors.ndarray( N, x, 1, 0 ); +const v = dsmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanors.ndarray( N, x, 2, 1 ); +const v = dsmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,21 +155,18 @@ var v = dsmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsmeanors = require( '@stdlib/stats/base/dsmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsmeanors = require( '@stdlib/stats/base/dsmeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsmeanors( x.length, x, 1 ); +const v = dsmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/dsmeanpn/README.md index 53fd8f36ebde..0c3f73aaedb4 100644 --- a/lib/node_modules/@stdlib/stats/base/dsmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsmeanpn = require( '@stdlib/stats/base/dsmeanpn' ); +const dsmeanpn = require( '@stdlib/stats/base/dsmeanpn' ); ``` #### dsmeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var dsmeanpn = require( '@stdlib/stats/base/dsmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using a two-pass error correction algorithm with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanpn( N, x, 1 ); +const v = dsmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanpn( N, x, 2 ); +const v = dsmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsmeanpn( N, x1, 2 ); +const v = dsmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a two-pass error correction algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanpn.ndarray( N, x, 1, 0 ); +const v = dsmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanpn.ndarray( N, x, 2, 1 ); +const v = dsmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dsmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsmeanpn = require( '@stdlib/stats/base/dsmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsmeanpn = require( '@stdlib/stats/base/dsmeanpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsmeanpn( x.length, x, 1 ); +const v = dsmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsmeanpw/README.md b/lib/node_modules/@stdlib/stats/base/dsmeanpw/README.md index 08cb8e5b71c2..1f70c44eaf34 100644 --- a/lib/node_modules/@stdlib/stats/base/dsmeanpw/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsmeanpw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsmeanpw = require( '@stdlib/stats/base/dsmeanpw' ); +const dsmeanpw = require( '@stdlib/stats/base/dsmeanpw' ); ``` #### dsmeanpw( N, x, stride ) @@ -56,12 +56,12 @@ var dsmeanpw = require( '@stdlib/stats/base/dsmeanpw' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using pairwise summation with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanpw( N, x, 1 ); +const v = dsmeanpw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanpw( N, x, 2 ); +const v = dsmeanpw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsmeanpw( N, x1, 2 ); +const v = dsmeanpw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsmeanpw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanpw.ndarray( N, x, 1, 0 ); +const v = dsmeanpw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanpw.ndarray( N, x, 2, 1 ); +const v = dsmeanpw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,21 +155,18 @@ var v = dsmeanpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsmeanpw = require( '@stdlib/stats/base/dsmeanpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsmeanpw = require( '@stdlib/stats/base/dsmeanpw' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsmeanpw( x.length, x, 1 ); +const v = dsmeanpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/dsmeanwd/README.md index 977729836d8f..f501f443acee 100644 --- a/lib/node_modules/@stdlib/stats/base/dsmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsmeanwd = require( '@stdlib/stats/base/dsmeanwd' ); +const dsmeanwd = require( '@stdlib/stats/base/dsmeanwd' ); ``` #### dsmeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var dsmeanwd = require( '@stdlib/stats/base/dsmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using Welford's algorithm with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanwd( N, x, 1 ); +const v = dsmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanwd( N, x, 2 ); +const v = dsmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsmeanwd( N, x1, 2 ); +const v = dsmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using Welford's algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsmeanwd.ndarray( N, x, 1, 0 ); +const v = dsmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsmeanwd.ndarray( N, x, 2, 1 ); +const v = dsmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = dsmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsmeanwd = require( '@stdlib/stats/base/dsmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsmeanwd = require( '@stdlib/stats/base/dsmeanwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsmeanwd( x.length, x, 1 ); +const v = dsmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsnanmean/README.md b/lib/node_modules/@stdlib/stats/base/dsnanmean/README.md index 43b8daaa1671..f73f13699dca 100644 --- a/lib/node_modules/@stdlib/stats/base/dsnanmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsnanmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsnanmean = require( '@stdlib/stats/base/dsnanmean' ); +const dsnanmean = require( '@stdlib/stats/base/dsnanmean' ); ``` #### dsnanmean( N, x, stride ) @@ -56,12 +56,12 @@ var dsnanmean = require( '@stdlib/stats/base/dsnanmean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmean( N, x, 1 ); +const v = dsnanmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmean( N, x, 2 ); +const v = dsnanmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsnanmean( N, x1, 2 ); +const v = dsnanmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsnanmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmean.ndarray( N, x, 1, 0 ); +const v = dsnanmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmean.ndarray( N, x, 2, 1 ); +const v = dsnanmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = dsnanmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsnanmean = require( '@stdlib/stats/base/dsnanmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsnanmean = require( '@stdlib/stats/base/dsnanmean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dsnanmean( x.length, x, 1 ); +const v = dsnanmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsnanmeanors/README.md b/lib/node_modules/@stdlib/stats/base/dsnanmeanors/README.md index 2075fa4df919..7a0ed94f415b 100644 --- a/lib/node_modules/@stdlib/stats/base/dsnanmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsnanmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsnanmeanors = require( '@stdlib/stats/base/dsnanmeanors' ); +const dsnanmeanors = require( '@stdlib/stats/base/dsnanmeanors' ); ``` #### dsnanmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var dsnanmeanors = require( '@stdlib/stats/base/dsnanmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanors( N, x, 1 ); +const v = dsnanmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanors( N, x, 2 ); +const v = dsnanmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsnanmeanors( N, x1, 2 ); +const v = dsnanmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsnanmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanors.ndarray( N, x, 1, 0 ); +const v = dsnanmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanors.ndarray( N, x, 2, 1 ); +const v = dsnanmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -156,16 +156,13 @@ var v = dsnanmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsnanmeanors = require( '@stdlib/stats/base/dsnanmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsnanmeanors = require( '@stdlib/stats/base/dsnanmeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -174,7 +171,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dsnanmeanors( x.length, x, 1 ); +const v = dsnanmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsnanmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/dsnanmeanpn/README.md index 34331e207e4d..157b7183a899 100644 --- a/lib/node_modules/@stdlib/stats/base/dsnanmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsnanmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsnanmeanpn = require( '@stdlib/stats/base/dsnanmeanpn' ); +const dsnanmeanpn = require( '@stdlib/stats/base/dsnanmeanpn' ); ``` #### dsnanmeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var dsnanmeanpn = require( '@stdlib/stats/base/dsnanmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using a two-pass error correction algorithm with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanpn( N, x, 1 ); +const v = dsnanmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanpn( N, x, 2 ); +const v = dsnanmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsnanmeanpn( N, x1, 2 ); +const v = dsnanmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsnanmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using a two-pass error correction algorithm with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanpn.ndarray( N, x, 1, 0 ); +const v = dsnanmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanpn.ndarray( N, x, 2, 1 ); +const v = dsnanmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = dsnanmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsnanmeanpn = require( '@stdlib/stats/base/dsnanmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsnanmeanpn = require( '@stdlib/stats/base/dsnanmeanpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dsnanmeanpn( x.length, x, 1 ); +const v = dsnanmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsnanmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/dsnanmeanwd/README.md index 93d13d5a9f6e..586a537096e0 100644 --- a/lib/node_modules/@stdlib/stats/base/dsnanmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsnanmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var dsnanmeanwd = require( '@stdlib/stats/base/dsnanmeanwd' ); +const dsnanmeanwd = require( '@stdlib/stats/base/dsnanmeanwd' ); ``` #### dsnanmeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var dsnanmeanwd = require( '@stdlib/stats/base/dsnanmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using Welford's algorithm with extended accumulation, and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanwd( N, x, 1 ); +const v = dsnanmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanwd( N, x, 2 ); +const v = dsnanmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsnanmeanwd( N, x1, 2 ); +const v = dsnanmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = dsnanmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using Welford's algorithm with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = dsnanmeanwd.ndarray( N, x, 1, 0 ); +const v = dsnanmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = dsnanmeanwd.ndarray( N, x, 2, 1 ); +const v = dsnanmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = dsnanmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsnanmeanwd = require( '@stdlib/stats/base/dsnanmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsnanmeanwd = require( '@stdlib/stats/base/dsnanmeanwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = dsnanmeanwd( x.length, x, 1 ); +const v = dsnanmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdev/README.md b/lib/node_modules/@stdlib/stats/base/dstdev/README.md index e0bf39b41633..2dd04086e151 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdev = require( '@stdlib/stats/base/dstdev' ); +const dstdev = require( '@stdlib/stats/base/dstdev' ); ``` #### dstdev( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdev = require( '@stdlib/stats/base/dstdev' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdev( N, 1, x, 1 ); +const v = dstdev( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdev( N, 1, x, 2 ); +const v = dstdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdev( N, 1, x1, 2 ); +const v = dstdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdev.ndarray( N, 1, x, 1, 0 ); +const v = dstdev.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdev.ndarray( N, 1, x, 2, 1 ); +const v = dstdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = dstdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdev = require( '@stdlib/stats/base/dstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdev = require( '@stdlib/stats/base/dstdev' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdev( x.length, 1, x, 1 ); +const v = dstdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdevch/README.md b/lib/node_modules/@stdlib/stats/base/dstdevch/README.md index 0e57659268a2..d749db62313c 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdevch = require( '@stdlib/stats/base/dstdevch' ); +const dstdevch = require( '@stdlib/stats/base/dstdevch' ); ``` #### dstdevch( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdevch = require( '@stdlib/stats/base/dstdevch' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevch( N, 1, x, 1 ); +const v = dstdevch( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevch( N, 1, x, 2 ); +const v = dstdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdevch( N, 1, x1, 2 ); +const v = dstdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevch.ndarray( N, 1, x, 1, 0 ); +const v = dstdevch.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevch.ndarray( N, 1, x, 2, 1 ); +const v = dstdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -203,21 +203,18 @@ var v = dstdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdevch = require( '@stdlib/stats/base/dstdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdevch = require( '@stdlib/stats/base/dstdevch' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdevch( x.length, 1, x, 1 ); +const v = dstdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/dstdevpn/README.md index fc9b1260667a..03f6d56cea36 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdevpn = require( '@stdlib/stats/base/dstdevpn' ); +const dstdevpn = require( '@stdlib/stats/base/dstdevpn' ); ``` #### dstdevpn( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdevpn = require( '@stdlib/stats/base/dstdevpn' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevpn( N, 1, x, 1 ); +const v = dstdevpn( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevpn( N, 1, x, 2 ); +const v = dstdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdevpn( N, 1, x1, 2 ); +const v = dstdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevpn.ndarray( N, 1, x, 1, 0 ); +const v = dstdevpn.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevpn.ndarray( N, 1, x, 2, 1 ); +const v = dstdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = dstdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdevpn = require( '@stdlib/stats/base/dstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdevpn = require( '@stdlib/stats/base/dstdevpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdevpn( x.length, 1, x, 1 ); +const v = dstdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdevtk/README.md b/lib/node_modules/@stdlib/stats/base/dstdevtk/README.md index bdaf224d6b67..ff3298993fb9 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdevtk = require( '@stdlib/stats/base/dstdevtk' ); +const dstdevtk = require( '@stdlib/stats/base/dstdevtk' ); ``` #### dstdevtk( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdevtk = require( '@stdlib/stats/base/dstdevtk' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevtk( N, 1, x, 1 ); +const v = dstdevtk( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevtk( N, 1, x, 2 ); +const v = dstdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdevtk( N, 1, x1, 2 ); +const v = dstdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevtk.ndarray( N, 1, x, 1, 0 ); +const v = dstdevtk.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevtk.ndarray( N, 1, x, 2, 1 ); +const v = dstdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -203,21 +203,18 @@ var v = dstdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdevtk = require( '@stdlib/stats/base/dstdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdevtk = require( '@stdlib/stats/base/dstdevtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdevtk( x.length, 1, x, 1 ); +const v = dstdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/dstdevwd/README.md index 6c59790179e0..cbe9bcba9488 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdevwd = require( '@stdlib/stats/base/dstdevwd' ); +const dstdevwd = require( '@stdlib/stats/base/dstdevwd' ); ``` #### dstdevwd( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdevwd = require( '@stdlib/stats/base/dstdevwd' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevwd( N, 1, x, 1 ); +const v = dstdevwd( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevwd( N, 1, x, 2 ); +const v = dstdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdevwd( N, 1, x1, 2 ); +const v = dstdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevwd.ndarray( N, 1, x, 1, 0 ); +const v = dstdevwd.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevwd.ndarray( N, 1, x, 2, 1 ); +const v = dstdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = dstdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdevwd = require( '@stdlib/stats/base/dstdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdevwd = require( '@stdlib/stats/base/dstdevwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdevwd( x.length, 1, x, 1 ); +const v = dstdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dstdevyc/README.md b/lib/node_modules/@stdlib/stats/base/dstdevyc/README.md index 768af0905646..20ec561a8854 100644 --- a/lib/node_modules/@stdlib/stats/base/dstdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/dstdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dstdevyc = require( '@stdlib/stats/base/dstdevyc' ); +const dstdevyc = require( '@stdlib/stats/base/dstdevyc' ); ``` #### dstdevyc( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dstdevyc = require( '@stdlib/stats/base/dstdevyc' ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevyc( N, 1, x, 1 ); +const v = dstdevyc( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevyc( N, 1, x, 2 ); +const v = dstdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dstdevyc( N, 1, x1, 2 ); +const v = dstdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = dstdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a double-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dstdevyc.ndarray( N, 1, x, 1, 0 ); +const v = dstdevyc.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dstdevyc.ndarray( N, 1, x, 2, 1 ); +const v = dstdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = dstdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dstdevyc = require( '@stdlib/stats/base/dstdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dstdevyc = require( '@stdlib/stats/base/dstdevyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dstdevyc( x.length, 1, x, 1 ); +const v = dstdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsvariance/README.md b/lib/node_modules/@stdlib/stats/base/dsvariance/README.md index d57fb40a07e6..da61f982c91f 100644 --- a/lib/node_modules/@stdlib/stats/base/dsvariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsvariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dsvariance = require( '@stdlib/stats/base/dsvariance' ); +const dsvariance = require( '@stdlib/stats/base/dsvariance' ); ``` #### dsvariance( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dsvariance = require( '@stdlib/stats/base/dsvariance' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsvariance( N, 1, x, 1 ); +const v = dsvariance( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsvariance( N, 1, x, 2 ); +const v = dsvariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsvariance( N, 1, x1, 2 ); +const v = dsvariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dsvariance( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsvariance.ndarray( N, 1, x, 1, 0 ); +const v = dsvariance.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsvariance.ndarray( N, 1, x, 2, 1 ); +const v = dsvariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -203,21 +203,18 @@ var v = dsvariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsvariance = require( '@stdlib/stats/base/dsvariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsvariance = require( '@stdlib/stats/base/dsvariance' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsvariance( x.length, 1, x, 1 ); +const v = dsvariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dsvariancepn/README.md b/lib/node_modules/@stdlib/stats/base/dsvariancepn/README.md index 4757d2c3b39b..a5bdf2b65aca 100644 --- a/lib/node_modules/@stdlib/stats/base/dsvariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dsvariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dsvariancepn = require( '@stdlib/stats/base/dsvariancepn' ); +const dsvariancepn = require( '@stdlib/stats/base/dsvariancepn' ); ``` #### dsvariancepn( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dsvariancepn = require( '@stdlib/stats/base/dsvariancepn' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using a two-pass algorithm with extended accumulation and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsvariancepn( N, 1, x, 1 ); +const v = dsvariancepn( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dsvariancepn( N, 1, x, 2 ); +const v = dsvariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dsvariancepn( N, 1, x1, 2 ); +const v = dsvariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dsvariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using a two-pass algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dsvariancepn.ndarray( N, 1, x, 1, 0 ); +const v = dsvariancepn.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dsvariancepn.ndarray( N, 1, x, 2, 1 ); +const v = dsvariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -203,21 +203,18 @@ var v = dsvariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var dsvariancepn = require( '@stdlib/stats/base/dsvariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const dsvariancepn = require( '@stdlib/stats/base/dsvariancepn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dsvariancepn( x.length, 1, x, 1 ); +const v = dsvariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvariance/README.md b/lib/node_modules/@stdlib/stats/base/dvariance/README.md index 44fe52bc6680..96e4070d4e68 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvariance = require( '@stdlib/stats/base/dvariance' ); +const dvariance = require( '@stdlib/stats/base/dvariance' ); ``` #### dvariance( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dvariance = require( '@stdlib/stats/base/dvariance' ); Computes the [variance][variance] of a double-precision floating-point strided array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariance( N, 1, x, 1 ); +const v = dvariance( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariance( N, 1, x, 2 ); +const v = dvariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvariance( N, 1, x1, 2 ); +const v = dvariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dvariance( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariance.ndarray( N, 1, x, 1, 0 ); +const v = dvariance.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariance.ndarray( N, 1, x, 2, 1 ); +const v = dvariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = dvariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvariance = require( '@stdlib/stats/base/dvariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvariance = require( '@stdlib/stats/base/dvariance' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvariance( x.length, 1, x, 1 ); +const v = dvariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvariancech/README.md b/lib/node_modules/@stdlib/stats/base/dvariancech/README.md index 8de7fb0ffa42..a7333e398e22 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvariancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvariancech = require( '@stdlib/stats/base/dvariancech' ); +const dvariancech = require( '@stdlib/stats/base/dvariancech' ); ``` #### dvariancech( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dvariancech = require( '@stdlib/stats/base/dvariancech' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancech( N, 1, x, 1 ); +const v = dvariancech( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancech( N, 1, x, 2 ); +const v = dvariancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvariancech( N, 1, x1, 2 ); +const v = dvariancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dvariancech( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancech.ndarray( N, 1, x, 1, 0 ); +const v = dvariancech.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancech.ndarray( N, 1, x, 2, 1 ); +const v = dvariancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -203,21 +203,18 @@ var v = dvariancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvariancech = require( '@stdlib/stats/base/dvariancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvariancech = require( '@stdlib/stats/base/dvariancech' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvariancech( x.length, 1, x, 1 ); +const v = dvariancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvariancepn/README.md b/lib/node_modules/@stdlib/stats/base/dvariancepn/README.md index a2c83064d151..45fcd6920046 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvariancepn = require( '@stdlib/stats/base/dvariancepn' ); +const dvariancepn = require( '@stdlib/stats/base/dvariancepn' ); ``` #### dvariancepn( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dvariancepn = require( '@stdlib/stats/base/dvariancepn' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancepn( N, 1, x, 1 ); +const v = dvariancepn( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancepn( N, 1, x, 2 ); +const v = dvariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvariancepn( N, 1, x1, 2 ); +const v = dvariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dvariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancepn.ndarray( N, 1, x, 1, 0 ); +const v = dvariancepn.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancepn.ndarray( N, 1, x, 2, 1 ); +const v = dvariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = dvariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvariancepn = require( '@stdlib/stats/base/dvariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvariancepn = require( '@stdlib/stats/base/dvariancepn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvariancepn( x.length, 1, x, 1 ); +const v = dvariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvariancetk/README.md b/lib/node_modules/@stdlib/stats/base/dvariancetk/README.md index 548089be3223..994568122e47 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvariancetk/README.md @@ -125,7 +125,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvariancetk = require( '@stdlib/stats/base/dvariancetk' ); +const dvariancetk = require( '@stdlib/stats/base/dvariancetk' ); ``` #### dvariancetk( N, correction, x, stride ) @@ -133,12 +133,12 @@ var dvariancetk = require( '@stdlib/stats/base/dvariancetk' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancetk( N, 1, x, 1 ); +const v = dvariancetk( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -152,13 +152,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancetk( N, 1, x, 2 ); +const v = dvariancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -167,15 +167,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvariancetk( N, 1, x1, 2 ); +const v = dvariancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -184,12 +184,12 @@ var v = dvariancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancetk.ndarray( N, 1, x, 1, 0 ); +const v = dvariancetk.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -200,13 +200,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancetk.ndarray( N, 1, x, 2, 1 ); +const v = dvariancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -233,21 +233,18 @@ var v = dvariancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvariancetk = require( '@stdlib/stats/base/dvariancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvariancetk = require( '@stdlib/stats/base/dvariancetk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvariancetk( x.length, 1, x, 1 ); +const v = dvariancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvariancewd/README.md b/lib/node_modules/@stdlib/stats/base/dvariancewd/README.md index 9e11e1a8c15f..8c470cc9c927 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvariancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvariancewd = require( '@stdlib/stats/base/dvariancewd' ); +const dvariancewd = require( '@stdlib/stats/base/dvariancewd' ); ``` #### dvariancewd( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dvariancewd = require( '@stdlib/stats/base/dvariancewd' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancewd( N, 1, x, 1 ); +const v = dvariancewd( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancewd( N, 1, x, 2 ); +const v = dvariancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvariancewd( N, 1, x1, 2 ); +const v = dvariancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dvariancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvariancewd.ndarray( N, 1, x, 1, 0 ); +const v = dvariancewd.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvariancewd.ndarray( N, 1, x, 2, 1 ); +const v = dvariancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = dvariancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvariancewd = require( '@stdlib/stats/base/dvariancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvariancewd = require( '@stdlib/stats/base/dvariancewd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvariancewd( x.length, 1, x, 1 ); +const v = dvariancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvarianceyc/README.md b/lib/node_modules/@stdlib/stats/base/dvarianceyc/README.md index ba7635b8d142..a89a92b6a91c 100644 --- a/lib/node_modules/@stdlib/stats/base/dvarianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvarianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' ); +const dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' ); ``` #### dvarianceyc( N, correction, x, stride ) @@ -103,12 +103,12 @@ var dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvarianceyc( N, 1, x, 1 ); +const v = dvarianceyc( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarianceyc( N, 1, x, 2 ); +const v = dvarianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvarianceyc( N, 1, x1, 2 ); +const v = dvarianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = dvarianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = dvarianceyc.ndarray( N, 1, x, 1, 0 ); +const v = dvarianceyc.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarianceyc.ndarray( N, 1, x, 2, 1 ); +const v = dvarianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = dvarianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvarianceyc( x.length, 1, x, 1 ); +const v = dvarianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvarm/README.md b/lib/node_modules/@stdlib/stats/base/dvarm/README.md index b0a5e8fbe696..93e85ca3c3fc 100644 --- a/lib/node_modules/@stdlib/stats/base/dvarm/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvarm/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvarm = require( '@stdlib/stats/base/dvarm' ); +const dvarm = require( '@stdlib/stats/base/dvarm' ); ``` #### dvarm( N, mean, correction, x, stride ) @@ -103,11 +103,11 @@ var dvarm = require( '@stdlib/stats/base/dvarm' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` provided a known `mean`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarm( x.length, 1.0/3.0, 1, x, 1 ); +const v = dvarm( x.length, 1.0/3.0, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarm( N, 1.25, 1, x, 2 ); +const v = dvarm( N, 1.25, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvarm( N, 1.25, 1, x1, 2 ); +const v = dvarm( N, 1.25, 1, x1, 2 ); // returns 6.25 ``` @@ -154,11 +154,11 @@ var v = dvarm( N, 1.25, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array provided a known `mean` and using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarm.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); +const v = dvarm.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -169,13 +169,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarm.ndarray( N, 1.25, 1, x, 2, 1 ); +const v = dvarm.ndarray( N, 1.25, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = dvarm.ndarray( N, 1.25, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvarm = require( '@stdlib/stats/base/dvarm' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvarm = require( '@stdlib/stats/base/dvarm' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvarm( x.length, 0.0, 1, x, 1 ); +const v = dvarm( x.length, 0.0, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvarmpn/README.md b/lib/node_modules/@stdlib/stats/base/dvarmpn/README.md index 0095e5a671d0..8e402670dc80 100644 --- a/lib/node_modules/@stdlib/stats/base/dvarmpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvarmpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvarmpn = require( '@stdlib/stats/base/dvarmpn' ); +const dvarmpn = require( '@stdlib/stats/base/dvarmpn' ); ``` #### dvarmpn( N, mean, correction, x, stride ) @@ -103,11 +103,11 @@ var dvarmpn = require( '@stdlib/stats/base/dvarmpn' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` provided a known `mean` and using Neely's correction algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarmpn( x.length, 1.0/3.0, 1, x, 1 ); +const v = dvarmpn( x.length, 1.0/3.0, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarmpn( N, 1.25, 1, x, 2 ); +const v = dvarmpn( N, 1.25, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvarmpn( N, 1.25, 1, x1, 2 ); +const v = dvarmpn( N, 1.25, 1, x1, 2 ); // returns 6.25 ``` @@ -154,11 +154,11 @@ var v = dvarmpn( N, 1.25, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array provided a known `mean` and using Neely's correction algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarmpn.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); +const v = dvarmpn.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -169,13 +169,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarmpn.ndarray( N, 1.25, 1, x, 2, 1 ); +const v = dvarmpn.ndarray( N, 1.25, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = dvarmpn.ndarray( N, 1.25, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvarmpn = require( '@stdlib/stats/base/dvarmpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvarmpn = require( '@stdlib/stats/base/dvarmpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvarmpn( x.length, 0.0, 1, x, 1 ); +const v = dvarmpn( x.length, 0.0, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dvarmtk/README.md b/lib/node_modules/@stdlib/stats/base/dvarmtk/README.md index 0e5c661833ee..ecb19249d681 100644 --- a/lib/node_modules/@stdlib/stats/base/dvarmtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/dvarmtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var dvarmtk = require( '@stdlib/stats/base/dvarmtk' ); +const dvarmtk = require( '@stdlib/stats/base/dvarmtk' ); ``` #### dvarmtk( N, mean, correction, x, stride ) @@ -103,11 +103,11 @@ var dvarmtk = require( '@stdlib/stats/base/dvarmtk' ); Computes the [variance][variance] of a double-precision floating-point strided array `x` provided a known `mean` and using a one-pass textbook algorithm. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarmtk( x.length, 1.0/3.0, 1, x, 1 ); +const v = dvarmtk( x.length, 1.0/3.0, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarmtk( N, 1.25, 1, x, 2 ); +const v = dvarmtk( N, 1.25, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = dvarmtk( N, 1.25, 1, x1, 2 ); +const v = dvarmtk( N, 1.25, 1, x1, 2 ); // returns 6.25 ``` @@ -154,11 +154,11 @@ var v = dvarmtk( N, 1.25, 1, x1, 2 ); Computes the [variance][variance] of a double-precision floating-point strided array provided a known `mean` and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); -var v = dvarmtk.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); +const v = dvarmtk.ndarray( x.length, 1.0/3.0, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -169,13 +169,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = dvarmtk.ndarray( N, 1.25, 1, x, 2, 1 ); +const v = dvarmtk.ndarray( N, 1.25, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = dvarmtk.ndarray( N, 1.25, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dvarmtk = require( '@stdlib/stats/base/dvarmtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dvarmtk = require( '@stdlib/stats/base/dvarmtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = dvarmtk( x.length, 0.0, 1, x, 1 ); +const v = dvarmtk( x.length, 0.0, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/max-by/README.md b/lib/node_modules/@stdlib/stats/base/max-by/README.md index 0cfd4a68734b..531c6fb9d6d0 100644 --- a/lib/node_modules/@stdlib/stats/base/max-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/max-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var maxBy = require( '@stdlib/stats/base/max-by' ); +const maxBy = require( '@stdlib/stats/base/max-by' ); ``` #### maxBy( N, x, stride, clbk\[, thisArg] ) @@ -39,9 +39,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = maxBy( x.length, x, 1, accessor ); +const v = maxBy( x.length, x, 1, accessor ); // returns 8.0 ``` @@ -68,54 +68,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var context = { +const context = { 'count': 0 }; -var v = maxBy( x.length, x, 1, accessor, context ); +const v = maxBy( x.length, x, 1, accessor, context ); // returns 8.0 -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); -var v = maxBy( N, x, 2, accessor ); +const v = maxBy( N, x, 2, accessor ); // returns 8.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = maxBy( N, x1, 2, accessor ); +const v = maxBy( N, x1, 2, accessor ); // returns -4.0 ``` @@ -128,9 +128,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = maxBy.ndarray( x.length, x, 1, 0, accessor ); +const v = maxBy.ndarray( x.length, x, 1, 0, accessor ); // returns 8.0 ``` @@ -145,9 +145,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = maxBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = maxBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns 10.0 ``` @@ -175,18 +175,18 @@ var v = maxBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var maxBy = require( '@stdlib/stats/base/max-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const maxBy = require( '@stdlib/stats/base/max-by' ); function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); console.log( x ); -var v = maxBy( x.length, x, 1, accessor ); +const v = maxBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/max/README.md b/lib/node_modules/@stdlib/stats/base/max/README.md index 363dbdf9372a..4de232c95d3a 100644 --- a/lib/node_modules/@stdlib/stats/base/max/README.md +++ b/lib/node_modules/@stdlib/stats/base/max/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var max = require( '@stdlib/stats/base/max' ); +const max = require( '@stdlib/stats/base/max' ); ``` #### max( N, x, stride ) @@ -41,10 +41,10 @@ var max = require( '@stdlib/stats/base/max' ); Computes the maximum value of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = max( N, x, 1 ); +const v = max( N, x, 1 ); // returns 2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = max( N, x, 2 ); +const v = max( N, x, 2 ); // returns 4.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = max( N, x1, 2 ); +const v = max( N, x1, 2 ); // returns 4.0 ``` @@ -88,10 +88,10 @@ var v = max( N, x1, 2 ); Computes the maximum value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = max.ndarray( N, x, 1, 0 ); +const v = max.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = max.ndarray( N, x, 2, 1 ); +const v = max.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -133,21 +133,18 @@ var v = max.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var max = require( '@stdlib/stats/base/max' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const max = require( '@stdlib/stats/base/max' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = max( x.length, x, 1 ); +const v = max( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/maxabs/README.md b/lib/node_modules/@stdlib/stats/base/maxabs/README.md index a891de7fd7e3..f6f5186faf5e 100644 --- a/lib/node_modules/@stdlib/stats/base/maxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/maxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var maxabs = require( '@stdlib/stats/base/maxabs' ); +const maxabs = require( '@stdlib/stats/base/maxabs' ); ``` #### maxabs( N, x, stride ) @@ -41,10 +41,10 @@ var maxabs = require( '@stdlib/stats/base/maxabs' ); Computes the maximum absolute value of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = maxabs( N, x, 1 ); +const v = maxabs( N, x, 1 ); // returns 2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = maxabs( N, x, 2 ); +const v = maxabs( N, x, 2 ); // returns 4.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = maxabs( N, x1, 2 ); +const v = maxabs( N, x1, 2 ); // returns 4.0 ``` @@ -88,10 +88,10 @@ var v = maxabs( N, x1, 2 ); Computes the maximum absolute value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = maxabs.ndarray( N, x, 1, 0 ); +const v = maxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = maxabs.ndarray( N, x, 2, 1 ); +const v = maxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -133,21 +133,18 @@ var v = maxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var maxabs = require( '@stdlib/stats/base/maxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const maxabs = require( '@stdlib/stats/base/maxabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = maxabs( x.length, x, 1 ); +const v = maxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/maxsorted/README.md b/lib/node_modules/@stdlib/stats/base/maxsorted/README.md index 7c17ea32f827..230ea00de086 100644 --- a/lib/node_modules/@stdlib/stats/base/maxsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/maxsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var maxsorted = require( '@stdlib/stats/base/maxsorted' ); +const maxsorted = require( '@stdlib/stats/base/maxsorted' ); ``` #### maxsorted( N, x, stride ) @@ -41,10 +41,10 @@ var maxsorted = require( '@stdlib/stats/base/maxsorted' ); Computes the maximum value of a sorted strided array `x`. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; -var N = x.length; +let x = [ 1.0, 2.0, 3.0 ]; +let N = x.length; -var v = maxsorted( N, x, 1 ); +let v = maxsorted( N, x, 1 ); // returns 3.0 x = [ 3.0, 2.0, 1.0 ]; @@ -63,12 +63,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = maxsorted( N, x, 2 ); +const v = maxsorted( N, x, 2 ); // returns 4.0 ``` @@ -77,15 +77,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = maxsorted( N, x1, 2 ); +const v = maxsorted( N, x1, 2 ); // returns 4.0 ``` @@ -94,10 +94,10 @@ var v = maxsorted( N, x1, 2 ); Computes the maximum value of a sorted strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; -var N = x.length; +const x = [ 1.0, 2.0, 3.0 ]; +const N = x.length; -var v = maxsorted.ndarray( N, x, 1, 0 ); +const v = maxsorted.ndarray( N, x, 1, 0 ); // returns 3.0 ``` @@ -108,12 +108,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = maxsorted.ndarray( N, x, 2, 1 ); +const v = maxsorted.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -139,19 +139,16 @@ var v = maxsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var maxsorted = require( '@stdlib/stats/base/maxsorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const maxsorted = require( '@stdlib/stats/base/maxsorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = maxsorted( x.length, x, 1 ); +const v = maxsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/mean/README.md b/lib/node_modules/@stdlib/stats/base/mean/README.md index 2b887ff25993..990e5374187d 100644 --- a/lib/node_modules/@stdlib/stats/base/mean/README.md +++ b/lib/node_modules/@stdlib/stats/base/mean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var mean = require( '@stdlib/stats/base/mean' ); +const mean = require( '@stdlib/stats/base/mean' ); ``` #### mean( N, x, stride ) @@ -56,10 +56,10 @@ var mean = require( '@stdlib/stats/base/mean' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = mean( N, x, 1 ); +const v = mean( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = mean( N, x, 2 ); +const v = mean( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = mean( N, x1, 2 ); +const v = mean( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = mean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = mean.ndarray( N, x, 1, 0 ); +const v = mean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = mean.ndarray( N, x, 2, 1 ); +const v = mean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -148,21 +148,18 @@ var v = mean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var mean = require( '@stdlib/stats/base/mean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const mean = require( '@stdlib/stats/base/mean' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = mean( x.length, x, 1 ); +const v = mean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meankbn/README.md b/lib/node_modules/@stdlib/stats/base/meankbn/README.md index ef4eeed9e605..70bb2a5ec010 100644 --- a/lib/node_modules/@stdlib/stats/base/meankbn/README.md +++ b/lib/node_modules/@stdlib/stats/base/meankbn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meankbn = require( '@stdlib/stats/base/meankbn' ); +const meankbn = require( '@stdlib/stats/base/meankbn' ); ``` #### meankbn( N, x, stride ) @@ -56,10 +56,10 @@ var meankbn = require( '@stdlib/stats/base/meankbn' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using an improved Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meankbn( N, x, 1 ); +const v = meankbn( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meankbn( N, x, 2 ); +const v = meankbn( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meankbn( N, x1, 2 ); +const v = meankbn( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meankbn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meankbn.ndarray( N, x, 1, 0 ); +const v = meankbn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meankbn.ndarray( N, x, 2, 1 ); +const v = meankbn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -148,21 +148,18 @@ var v = meankbn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meankbn = require( '@stdlib/stats/base/meankbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meankbn = require( '@stdlib/stats/base/meankbn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meankbn( x.length, x, 1 ); +const v = meankbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meankbn2/README.md b/lib/node_modules/@stdlib/stats/base/meankbn2/README.md index 52ca1aa12dda..090f90d9caa8 100644 --- a/lib/node_modules/@stdlib/stats/base/meankbn2/README.md +++ b/lib/node_modules/@stdlib/stats/base/meankbn2/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meankbn2 = require( '@stdlib/stats/base/meankbn2' ); +const meankbn2 = require( '@stdlib/stats/base/meankbn2' ); ``` #### meankbn2( N, x, stride ) @@ -56,10 +56,10 @@ var meankbn2 = require( '@stdlib/stats/base/meankbn2' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using a second-order iterative Kahan–Babuška algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meankbn2( N, x, 1 ); +const v = meankbn2( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meankbn2( N, x, 2 ); +const v = meankbn2( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meankbn2( N, x1, 2 ); +const v = meankbn2( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meankbn2( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meankbn2.ndarray( N, x, 1, 0 ); +const v = meankbn2.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meankbn2.ndarray( N, x, 2, 1 ); +const v = meankbn2.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -148,21 +148,18 @@ var v = meankbn2.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meankbn2 = require( '@stdlib/stats/base/meankbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meankbn2 = require( '@stdlib/stats/base/meankbn2' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meankbn2( x.length, x, 1 ); +const v = meankbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meanors/README.md b/lib/node_modules/@stdlib/stats/base/meanors/README.md index 26406d5cea17..a2f537a51105 100644 --- a/lib/node_modules/@stdlib/stats/base/meanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/meanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meanors = require( '@stdlib/stats/base/meanors' ); +const meanors = require( '@stdlib/stats/base/meanors' ); ``` #### meanors( N, x, stride ) @@ -56,10 +56,10 @@ var meanors = require( '@stdlib/stats/base/meanors' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanors( N, x, 1 ); +const v = meanors( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meanors( N, x, 2 ); +const v = meanors( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meanors( N, x1, 2 ); +const v = meanors( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanors.ndarray( N, x, 1, 0 ); +const v = meanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meanors.ndarray( N, x, 2, 1 ); +const v = meanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -149,21 +149,18 @@ var v = meanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meanors = require( '@stdlib/stats/base/meanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meanors = require( '@stdlib/stats/base/meanors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meanors( x.length, x, 1 ); +const v = meanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meanpn/README.md b/lib/node_modules/@stdlib/stats/base/meanpn/README.md index 2d6091bd86d7..4c174d975ec0 100644 --- a/lib/node_modules/@stdlib/stats/base/meanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/meanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meanpn = require( '@stdlib/stats/base/meanpn' ); +const meanpn = require( '@stdlib/stats/base/meanpn' ); ``` #### meanpn( N, x, stride ) @@ -56,10 +56,10 @@ var meanpn = require( '@stdlib/stats/base/meanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using a two-pass error correction algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanpn( N, x, 1 ); +const v = meanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meanpn( N, x, 2 ); +const v = meanpn( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meanpn( N, x1, 2 ); +const v = meanpn( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanpn.ndarray( N, x, 1, 0 ); +const v = meanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meanpn.ndarray( N, x, 2, 1 ); +const v = meanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -148,21 +148,18 @@ var v = meanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meanpn = require( '@stdlib/stats/base/meanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meanpn = require( '@stdlib/stats/base/meanpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meanpn( x.length, x, 1 ); +const v = meanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meanpw/README.md b/lib/node_modules/@stdlib/stats/base/meanpw/README.md index 25e62e162631..da1287d701c7 100644 --- a/lib/node_modules/@stdlib/stats/base/meanpw/README.md +++ b/lib/node_modules/@stdlib/stats/base/meanpw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meanpw = require( '@stdlib/stats/base/meanpw' ); +const meanpw = require( '@stdlib/stats/base/meanpw' ); ``` #### meanpw( N, x, stride ) @@ -56,10 +56,10 @@ var meanpw = require( '@stdlib/stats/base/meanpw' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using pairwise summation. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanpw( N, x, 1 ); +const v = meanpw( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meanpw( N, x, 2 ); +const v = meanpw( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meanpw( N, x1, 2 ); +const v = meanpw( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meanpw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using pairwise summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanpw.ndarray( N, x, 1, 0 ); +const v = meanpw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meanpw.ndarray( N, x, 2, 1 ); +const v = meanpw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -149,21 +149,18 @@ var v = meanpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meanpw = require( '@stdlib/stats/base/meanpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meanpw = require( '@stdlib/stats/base/meanpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meanpw( x.length, x, 1 ); +const v = meanpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/meanwd/README.md b/lib/node_modules/@stdlib/stats/base/meanwd/README.md index 80008c4df7dd..d2a7a63c3491 100644 --- a/lib/node_modules/@stdlib/stats/base/meanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/meanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var meanwd = require( '@stdlib/stats/base/meanwd' ); +const meanwd = require( '@stdlib/stats/base/meanwd' ); ``` #### meanwd( N, x, stride ) @@ -56,10 +56,10 @@ var meanwd = require( '@stdlib/stats/base/meanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x` using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanwd( N, x, 1 ); +const v = meanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = meanwd( N, x, 2 ); +const v = meanwd( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = meanwd( N, x1, 2 ); +const v = meanwd( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = meanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = meanwd.ndarray( N, x, 1, 0 ); +const v = meanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = meanwd.ndarray( N, x, 2, 1 ); +const v = meanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -148,21 +148,18 @@ var v = meanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var meanwd = require( '@stdlib/stats/base/meanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const meanwd = require( '@stdlib/stats/base/meanwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = meanwd( x.length, x, 1 ); +const v = meanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/mediansorted/README.md b/lib/node_modules/@stdlib/stats/base/mediansorted/README.md index 5e341a8c019c..d31a55e1333f 100644 --- a/lib/node_modules/@stdlib/stats/base/mediansorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/mediansorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mediansorted = require( '@stdlib/stats/base/mediansorted' ); +const mediansorted = require( '@stdlib/stats/base/mediansorted' ); ``` #### mediansorted( N, x, stride ) @@ -41,8 +41,8 @@ var mediansorted = require( '@stdlib/stats/base/mediansorted' ); Computes the median value of a sorted strided array `x`. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; -var v = mediansorted( x.length, x, 1 ); +let x = [ 1.0, 2.0, 3.0 ]; +let v = mediansorted( x.length, x, 1 ); // returns 2.0 x = [ 3.0, 2.0, 1.0 ]; @@ -59,12 +59,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the median value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = mediansorted( N, x, 2 ); +const v = mediansorted( N, x, 2 ); // returns 2.5 ``` @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = mediansorted( N, x1, 2 ); +const v = mediansorted( N, x1, 2 ); // returns 2.0 ``` @@ -90,9 +90,9 @@ var v = mediansorted( N, x1, 2 ); Computes the median value of a sorted strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; +const x = [ 1.0, 2.0, 3.0 ]; -var v = mediansorted.ndarray( x.length, x, 1, 0 ); +const v = mediansorted.ndarray( x.length, x, 1, 0 ); // returns 2.0 ``` @@ -103,12 +103,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the median value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = mediansorted.ndarray( N, x, 2, 1 ); +const v = mediansorted.ndarray( N, x, 2, 1 ); // returns 2.0 ``` @@ -134,19 +134,16 @@ var v = mediansorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var mediansorted = require( '@stdlib/stats/base/mediansorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const mediansorted = require( '@stdlib/stats/base/mediansorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = mediansorted( x.length, x, 1 ); +const v = mediansorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/min-by/README.md b/lib/node_modules/@stdlib/stats/base/min-by/README.md index c4aa40212ae2..27cdb75cb33a 100644 --- a/lib/node_modules/@stdlib/stats/base/min-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/min-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minBy = require( '@stdlib/stats/base/min-by' ); +const minBy = require( '@stdlib/stats/base/min-by' ); ``` #### minBy( N, x, stride, clbk\[, thisArg] ) @@ -39,9 +39,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = minBy( x.length, x, 1, accessor ); +const v = minBy( x.length, x, 1, accessor ); // returns -10.0 ``` @@ -68,54 +68,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var context = { +const context = { 'count': 0 }; -var v = minBy( x.length, x, 1, accessor, context ); +const v = minBy( x.length, x, 1, accessor, context ); // returns -10.0 -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); -var v = minBy( N, x, 2, accessor ); +const v = minBy( N, x, 2, accessor ); // returns -4.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = minBy( N, x1, 2, accessor ); +const v = minBy( N, x1, 2, accessor ); // returns -12.0 ``` @@ -128,9 +128,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = minBy.ndarray( x.length, x, 1, 0, accessor ); +const v = minBy.ndarray( x.length, x, 1, 0, accessor ); // returns -10.0 ``` @@ -145,9 +145,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = minBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = minBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns -12.0 ``` @@ -175,18 +175,18 @@ var v = minBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var minBy = require( '@stdlib/stats/base/min-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const minBy = require( '@stdlib/stats/base/min-by' ); function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); console.log( x ); -var v = minBy( x.length, x, 1, accessor ); +const v = minBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/min/README.md b/lib/node_modules/@stdlib/stats/base/min/README.md index c2ec19b4bbb5..d71452547faa 100644 --- a/lib/node_modules/@stdlib/stats/base/min/README.md +++ b/lib/node_modules/@stdlib/stats/base/min/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var min = require( '@stdlib/stats/base/min' ); +const min = require( '@stdlib/stats/base/min' ); ``` #### min( N, x, stride ) @@ -41,10 +41,10 @@ var min = require( '@stdlib/stats/base/min' ); Computes the minimum value of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = min( N, x, 1 ); +const v = min( N, x, 1 ); // returns -2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = min( N, x, 2 ); +const v = min( N, x, 2 ); // returns -2.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = min( N, x1, 2 ); +const v = min( N, x1, 2 ); // returns -2.0 ``` @@ -88,10 +88,10 @@ var v = min( N, x1, 2 ); Computes the minimum value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = min.ndarray( N, x, 1, 0 ); +const v = min.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = min.ndarray( N, x, 2, 1 ); +const v = min.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -133,21 +133,18 @@ var v = min.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var min = require( '@stdlib/stats/base/min' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const min = require( '@stdlib/stats/base/min' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = min( x.length, x, 1 ); +const v = min( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/minabs/README.md b/lib/node_modules/@stdlib/stats/base/minabs/README.md index a9a79fd743eb..5c3c0d35337c 100644 --- a/lib/node_modules/@stdlib/stats/base/minabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/minabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var minabs = require( '@stdlib/stats/base/minabs' ); +const minabs = require( '@stdlib/stats/base/minabs' ); ``` #### minabs( N, x, stride ) @@ -41,10 +41,10 @@ var minabs = require( '@stdlib/stats/base/minabs' ); Computes the minimum absolute value of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = minabs( N, x, 1 ); +const v = minabs( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = minabs( N, x, 2 ); +const v = minabs( N, x, 2 ); // returns 1.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = minabs( N, x1, 2 ); +const v = minabs( N, x1, 2 ); // returns 1.0 ``` @@ -88,10 +88,10 @@ var v = minabs( N, x1, 2 ); Computes the minimum absolute value of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = minabs.ndarray( N, x, 1, 0 ); +const v = minabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = minabs.ndarray( N, x, 2, 1 ); +const v = minabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -133,21 +133,18 @@ var v = minabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var minabs = require( '@stdlib/stats/base/minabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minabs = require( '@stdlib/stats/base/minabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = minabs( x.length, x, 1 ); +const v = minabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/minsorted/README.md b/lib/node_modules/@stdlib/stats/base/minsorted/README.md index b9955871237d..9afab67aef8a 100644 --- a/lib/node_modules/@stdlib/stats/base/minsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/minsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var minsorted = require( '@stdlib/stats/base/minsorted' ); +const minsorted = require( '@stdlib/stats/base/minsorted' ); ``` #### minsorted( N, x, stride ) @@ -41,10 +41,10 @@ var minsorted = require( '@stdlib/stats/base/minsorted' ); Computes the minimum value of a sorted strided array `x`. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; -var N = x.length; +let x = [ 1.0, 2.0, 3.0 ]; +let N = x.length; -var v = minsorted( N, x, 1 ); +let v = minsorted( N, x, 1 ); // returns 1.0 x = [ 3.0, 2.0, 1.0 ]; @@ -63,12 +63,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = minsorted( N, x, 2 ); +const v = minsorted( N, x, 2 ); // returns 1.0 ``` @@ -77,15 +77,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = minsorted( N, x1, 2 ); +const v = minsorted( N, x1, 2 ); // returns 1.0 ``` @@ -94,10 +94,10 @@ var v = minsorted( N, x1, 2 ); Computes the minimum value of a sorted strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, 2.0, 3.0 ]; -var N = x.length; +const x = [ 1.0, 2.0, 3.0 ]; +const N = x.length; -var v = minsorted.ndarray( N, x, 1, 0 ); +const v = minsorted.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -108,12 +108,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = minsorted.ndarray( N, x, 2, 1 ); +const v = minsorted.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -139,19 +139,16 @@ var v = minsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var minsorted = require( '@stdlib/stats/base/minsorted' ); +const Float64Array = require( '@stdlib/array/float64' ); +const minsorted = require( '@stdlib/stats/base/minsorted' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = minsorted( x.length, x, 1 ); +const v = minsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/mskmax/README.md b/lib/node_modules/@stdlib/stats/base/mskmax/README.md index 4cd8d8b245cf..29a5a56c948b 100644 --- a/lib/node_modules/@stdlib/stats/base/mskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/mskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskmax = require( '@stdlib/stats/base/mskmax' ); +const mskmax = require( '@stdlib/stats/base/mskmax' ); ``` #### mskmax( N, x, strideX, mask, strideMask ) @@ -41,10 +41,10 @@ var mskmax = require( '@stdlib/stats/base/mskmax' ); Computes the maximum value of a strided array `x` according to a `mask`. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskmax( x.length, x, 1, mask, 1 ); +const v = mskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskmax( N, x, 2, mask, 2 ); +const v = mskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -74,19 +74,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = mskmax( N, x1, 2, mask1, 2 ); +const v = mskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -95,10 +95,10 @@ var v = mskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a strided array according to a `mask` and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = mskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -110,13 +110,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = mskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -142,19 +142,15 @@ var v = mskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var mskmax = require( '@stdlib/stats/base/mskmax' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const mskmax = require( '@stdlib/stats/base/mskmax' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -165,7 +161,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = mskmax( x.length, x, 1, mask, 1 ); +const v = mskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/mskmin/README.md b/lib/node_modules/@stdlib/stats/base/mskmin/README.md index 6b8f097017e9..cbb28a949d21 100644 --- a/lib/node_modules/@stdlib/stats/base/mskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/mskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskmin = require( '@stdlib/stats/base/mskmin' ); +const mskmin = require( '@stdlib/stats/base/mskmin' ); ``` #### mskmin( N, x, strideX, mask, strideMask ) @@ -41,10 +41,10 @@ var mskmin = require( '@stdlib/stats/base/mskmin' ); Computes the minimum value of a strided array `x` according to a `mask`. ```javascript -var x = [ 1.0, -2.0, -4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, -4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskmin( x.length, x, 1, mask, 1 ); +const v = mskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, -5.0, -6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, -5.0, -6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskmin( N, x, 2, mask, 2 ); +const v = mskmin( N, x, 2, mask, 2 ); // returns -7.0 ``` @@ -74,19 +74,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = mskmin( N, x1, 2, mask1, 2 ); +const v = mskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -95,10 +95,10 @@ var v = mskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a strided array according to a `mask` and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, -4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, -4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = mskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -110,13 +110,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = mskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -142,19 +142,15 @@ var v = mskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var mskmin = require( '@stdlib/stats/base/mskmin' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const mskmin = require( '@stdlib/stats/base/mskmin' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -165,7 +161,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = mskmin( x.length, x, 1, mask, 1 ); +const v = mskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/mskrange/README.md b/lib/node_modules/@stdlib/stats/base/mskrange/README.md index 5b4b2aa806cf..24219a5b2481 100644 --- a/lib/node_modules/@stdlib/stats/base/mskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/mskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var mskrange = require( '@stdlib/stats/base/mskrange' ); +const mskrange = require( '@stdlib/stats/base/mskrange' ); ``` #### mskrange( N, x, strideX, mask, strideMask ) @@ -43,10 +43,10 @@ var mskrange = require( '@stdlib/stats/base/mskrange' ); Computes the [range][range] of a strided array `x` according to a `mask`. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskrange( x.length, x, 1, mask, 1 ); +const v = mskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskrange( N, x, 2, mask, 2 ); +const v = mskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -76,19 +76,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = mskrange( N, x1, 2, mask1, 2 ); +const v = mskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -97,10 +97,10 @@ var v = mskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a strided array according to a `mask` and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0 ]; -var mask = [ 0, 0, 1, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0 ]; +const mask = [ 0, 0, 1, 0 ]; -var v = mskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = mskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -112,13 +112,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = mskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = mskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -144,19 +144,15 @@ var v = mskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var mskrange = require( '@stdlib/stats/base/mskrange' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const mskrange = require( '@stdlib/stats/base/mskrange' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -167,7 +163,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = mskrange( x.length, x, 1, mask, 1 ); +const v = mskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmax-by/README.md b/lib/node_modules/@stdlib/stats/base/nanmax-by/README.md index 35068d2d1c10..dd276af845b4 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmax-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmax-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nanmaxBy = require( '@stdlib/stats/base/nanmax-by' ); +const nanmaxBy = require( '@stdlib/stats/base/nanmax-by' ); ``` #### nanmaxBy( N, x, stride, clbk\[, thisArg] ) @@ -39,9 +39,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanmaxBy( x.length, x, 1, accessor ); +const v = nanmaxBy( x.length, x, 1, accessor ); // returns 8.0 ``` @@ -68,54 +68,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var context = { +const context = { 'count': 0 }; -var v = nanmaxBy( x.length, x, 1, accessor, context ); +const v = nanmaxBy( x.length, x, 1, accessor, context ); // returns 8.0 -var cnt = context.count; +const cnt = context.count; // returns 10 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmaxBy( N, x, 2, accessor ); +const v = nanmaxBy( N, x, 2, accessor ); // returns 8.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = nanmaxBy( N, x1, 2, accessor ); +const v = nanmaxBy( N, x1, 2, accessor ); // returns -4.0 ``` @@ -128,9 +128,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanmaxBy.ndarray( x.length, x, 1, 0, accessor ); +const v = nanmaxBy.ndarray( x.length, x, 1, 0, accessor ); // returns 8.0 ``` @@ -145,9 +145,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = nanmaxBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = nanmaxBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns 10.0 ``` @@ -176,10 +176,10 @@ var v = nanmaxBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var nanmaxBy = require( '@stdlib/stats/base/nanmax-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const nanmaxBy = require( '@stdlib/stats/base/nanmax-by' ); function fill() { if ( randu() < 0.2 ) { @@ -192,10 +192,10 @@ function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); console.log( x ); -var v = nanmaxBy( x.length, x, 1, accessor ); +const v = nanmaxBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmax/README.md b/lib/node_modules/@stdlib/stats/base/nanmax/README.md index eb9cbf305b1f..e2d0b08f4e0e 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanmax = require( '@stdlib/stats/base/nanmax' ); +const nanmax = require( '@stdlib/stats/base/nanmax' ); ``` #### nanmax( N, x, stride ) @@ -41,10 +41,10 @@ var nanmax = require( '@stdlib/stats/base/nanmax' ); Computes the maximum value of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmax( N, x, 1 ); +const v = nanmax( N, x, 1 ); // returns 2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmax( N, x, 2 ); +const v = nanmax( N, x, 2 ); // returns 4.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmax( N, x1, 2 ); +const v = nanmax( N, x1, 2 ); // returns 4.0 ``` @@ -88,10 +88,10 @@ var v = nanmax( N, x1, 2 ); Computes the maximum value of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmax.ndarray( N, x, 1, 0 ); +const v = nanmax.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanmax.ndarray( N, x, 2, 1 ); +const v = nanmax.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -133,16 +133,13 @@ var v = nanmax.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmax = require( '@stdlib/stats/base/nanmax' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmax = require( '@stdlib/stats/base/nanmax' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmax( x.length, x, 1 ); +const v = nanmax( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmaxabs/README.md b/lib/node_modules/@stdlib/stats/base/nanmaxabs/README.md index c172bdb108fb..85a5a0c05702 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanmaxabs = require( '@stdlib/stats/base/nanmaxabs' ); +const nanmaxabs = require( '@stdlib/stats/base/nanmaxabs' ); ``` #### nanmaxabs( N, x, stride ) @@ -41,10 +41,10 @@ var nanmaxabs = require( '@stdlib/stats/base/nanmaxabs' ); Computes the maximum absolute value of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmaxabs( N, x, 1 ); +const v = nanmaxabs( N, x, 1 ); // returns 2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmaxabs( N, x, 2 ); +const v = nanmaxabs( N, x, 2 ); // returns 4.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmaxabs( N, x1, 2 ); +const v = nanmaxabs( N, x1, 2 ); // returns 4.0 ``` @@ -88,10 +88,10 @@ var v = nanmaxabs( N, x1, 2 ); Computes the maximum absolute value of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmaxabs.ndarray( N, x, 1, 0 ); +const v = nanmaxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanmaxabs.ndarray( N, x, 2, 1 ); +const v = nanmaxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -133,16 +133,13 @@ var v = nanmaxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmaxabs = require( '@stdlib/stats/base/nanmaxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmaxabs = require( '@stdlib/stats/base/nanmaxabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmaxabs( x.length, x, 1 ); +const v = nanmaxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmean/README.md b/lib/node_modules/@stdlib/stats/base/nanmean/README.md index a13ed07dd001..0ee404028f69 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var nanmean = require( '@stdlib/stats/base/nanmean' ); +const nanmean = require( '@stdlib/stats/base/nanmean' ); ``` #### nanmean( N, x, stride ) @@ -56,10 +56,10 @@ var nanmean = require( '@stdlib/stats/base/nanmean' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmean( N, x, 1 ); +const v = nanmean( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmean( N, x, 2 ); +const v = nanmean( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmean( N, x1, 2 ); +const v = nanmean( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = nanmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmean.ndarray( N, x, 1, 0 ); +const v = nanmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmean.ndarray( N, x, 2, 1 ); +const v = nanmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -149,16 +149,13 @@ var v = nanmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmean = require( '@stdlib/stats/base/nanmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmean = require( '@stdlib/stats/base/nanmean' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -167,7 +164,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmean( x.length, x, 1 ); +const v = nanmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmeanors/README.md b/lib/node_modules/@stdlib/stats/base/nanmeanors/README.md index 505e77d0369d..bd76ccca72ad 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var nanmeanors = require( '@stdlib/stats/base/nanmeanors' ); +const nanmeanors = require( '@stdlib/stats/base/nanmeanors' ); ``` #### nanmeanors( N, x, stride ) @@ -56,10 +56,10 @@ var nanmeanors = require( '@stdlib/stats/base/nanmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanors( N, x, 1 ); +const v = nanmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanors( N, x, 2 ); +const v = nanmeanors( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmeanors( N, x1, 2 ); +const v = nanmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = nanmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanors.ndarray( N, x, 1, 0 ); +const v = nanmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanors.ndarray( N, x, 2, 1 ); +const v = nanmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -150,16 +150,13 @@ var v = nanmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmeanors = require( '@stdlib/stats/base/nanmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmeanors = require( '@stdlib/stats/base/nanmeanors' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -168,7 +165,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmeanors( x.length, x, 1 ); +const v = nanmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/nanmeanpn/README.md index 4a48a17f883d..8afa1fa34d3a 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var nanmeanpn = require( '@stdlib/stats/base/nanmeanpn' ); +const nanmeanpn = require( '@stdlib/stats/base/nanmeanpn' ); ``` #### nanmeanpn( N, x, stride ) @@ -56,10 +56,10 @@ var nanmeanpn = require( '@stdlib/stats/base/nanmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`, ignoring `NaN` values and using a two-pass error correction algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanpn( N, x, 1 ); +const v = nanmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanpn( N, x, 2 ); +const v = nanmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmeanpn( N, x1, 2 ); +const v = nanmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = nanmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `NaN` values and using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanpn.ndarray( N, x, 1, 0 ); +const v = nanmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanpn.ndarray( N, x, 2, 1 ); +const v = nanmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -149,16 +149,13 @@ var v = nanmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmeanpn = require( '@stdlib/stats/base/nanmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmeanpn = require( '@stdlib/stats/base/nanmeanpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -167,7 +164,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmeanpn( x.length, x, 1 ); +const v = nanmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md index e9002dab41f0..ea2de3f41fa1 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' ); +const nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' ); ``` #### nanmeanwd( N, x, stride ) @@ -56,10 +56,10 @@ var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`, ignoring `NaN` values and using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanwd( N, x, 1 ); +const v = nanmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -72,12 +72,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanwd( N, x, 2 ); +const v = nanmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -86,15 +86,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmeanwd( N, x1, 2 ); +const v = nanmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -103,10 +103,10 @@ var v = nanmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmeanwd.ndarray( N, x, 1, 0 ); +const v = nanmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -117,12 +117,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmeanwd.ndarray( N, x, 2, 1 ); +const v = nanmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -149,16 +149,13 @@ var v = nanmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -167,7 +164,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmeanwd( x.length, x, 1 ); +const v = nanmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmin-by/README.md b/lib/node_modules/@stdlib/stats/base/nanmin-by/README.md index 623546fd12d4..b1186edfa7db 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmin-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmin-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nanminBy = require( '@stdlib/stats/base/nanmin-by' ); +const nanminBy = require( '@stdlib/stats/base/nanmin-by' ); ``` #### nanminBy( N, x, stride, clbk\[, thisArg] ) @@ -39,9 +39,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanminBy( x.length, x, 1, accessor ); +const v = nanminBy( x.length, x, 1, accessor ); // returns -10.0 ``` @@ -68,54 +68,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var context = { +const context = { 'count': 0 }; -var v = nanminBy( x.length, x, 1, accessor, context ); +const v = nanminBy( x.length, x, 1, accessor, context ); // returns -10.0 -var cnt = context.count; +const cnt = context.count; // returns 10 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanminBy( N, x, 2, accessor ); +const v = nanminBy( N, x, 2, accessor ); // returns -4.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = nanminBy( N, x1, 2, accessor ); +const v = nanminBy( N, x1, 2, accessor ); // returns -12.0 ``` @@ -128,9 +128,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanminBy.ndarray( x.length, x, 1, 0, accessor ); +const v = nanminBy.ndarray( x.length, x, 1, 0, accessor ); // returns -10.0 ``` @@ -145,9 +145,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = nanminBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = nanminBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns -12.0 ``` @@ -176,10 +176,10 @@ var v = nanminBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var nanminBy = require( '@stdlib/stats/base/nanmin-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const nanminBy = require( '@stdlib/stats/base/nanmin-by' ); function fill() { if ( randu() < 0.2 ) { @@ -192,10 +192,10 @@ function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); console.log( x ); -var v = nanminBy( x.length, x, 1, accessor ); +const v = nanminBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmin/README.md b/lib/node_modules/@stdlib/stats/base/nanmin/README.md index 40c8f35285e1..e1f5d7a0c802 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanmin = require( '@stdlib/stats/base/nanmin' ); +const nanmin = require( '@stdlib/stats/base/nanmin' ); ``` #### nanmin( N, x, stride ) @@ -41,10 +41,10 @@ var nanmin = require( '@stdlib/stats/base/nanmin' ); Computes the minimum value of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmin( N, x, 1 ); +const v = nanmin( N, x, 1 ); // returns -2.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanmin( N, x, 2 ); +const v = nanmin( N, x, 2 ); // returns -2.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmin( N, x1, 2 ); +const v = nanmin( N, x1, 2 ); // returns -2.0 ``` @@ -88,10 +88,10 @@ var v = nanmin( N, x1, 2 ); Computes the minimum value of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanmin.ndarray( N, x, 1, 0 ); +const v = nanmin.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanmin.ndarray( N, x, 2, 1 ); +const v = nanmin.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -133,16 +133,13 @@ var v = nanmin.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanmin = require( '@stdlib/stats/base/nanmin' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanmin = require( '@stdlib/stats/base/nanmin' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanmin( x.length, x, 1 ); +const v = nanmin( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanminabs/README.md b/lib/node_modules/@stdlib/stats/base/nanminabs/README.md index cdced0c3fcde..39a38e0a7508 100644 --- a/lib/node_modules/@stdlib/stats/base/nanminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanminabs = require( '@stdlib/stats/base/nanminabs' ); +const nanminabs = require( '@stdlib/stats/base/nanminabs' ); ``` #### nanminabs( N, x, stride ) @@ -41,10 +41,10 @@ var nanminabs = require( '@stdlib/stats/base/nanminabs' ); Computes the minimum absolute value of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanminabs( N, x, 1 ); +const v = nanminabs( N, x, 1 ); // returns 1.0 ``` @@ -57,12 +57,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanminabs( N, x, 2 ); +const v = nanminabs( N, x, 2 ); // returns 1.0 ``` @@ -71,15 +71,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanminabs( N, x1, 2 ); +const v = nanminabs( N, x1, 2 ); // returns 1.0 ``` @@ -88,10 +88,10 @@ var v = nanminabs( N, x1, 2 ); Computes the minimum absolute value of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanminabs.ndarray( N, x, 1, 0 ); +const v = nanminabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -102,12 +102,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanminabs.ndarray( N, x, 2, 1 ); +const v = nanminabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -133,16 +133,13 @@ var v = nanminabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanminabs = require( '@stdlib/stats/base/nanminabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanminabs = require( '@stdlib/stats/base/nanminabs' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -151,7 +148,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanminabs( x.length, x, 1 ); +const v = nanminabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmskmax/README.md b/lib/node_modules/@stdlib/stats/base/nanmskmax/README.md index 80f9a8825e57..3463a8724eef 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanmskmax = require( '@stdlib/stats/base/nanmskmax' ); +const nanmskmax = require( '@stdlib/stats/base/nanmskmax' ); ``` #### nanmskmax( N, x, strideX, mask, strideMask ) @@ -41,10 +41,10 @@ var nanmskmax = require( '@stdlib/stats/base/nanmskmax' ); Computes the maximum value of a strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskmax( x.length, x, 1, mask, 1 ); +const v = nanmskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskmax( N, x, 2, mask, 2 ); +const v = nanmskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -74,19 +74,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmskmax( N, x1, 2, mask1, 2 ); +const v = nanmskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -95,10 +95,10 @@ var v = nanmskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = nanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -110,13 +110,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = nanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -142,19 +142,15 @@ var v = nanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var nanmskmax = require( '@stdlib/stats/base/nanmskmax' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const nanmskmax = require( '@stdlib/stats/base/nanmskmax' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -169,7 +165,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = nanmskmax( x.length, x, 1, mask, 1 ); +const v = nanmskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmskmin/README.md b/lib/node_modules/@stdlib/stats/base/nanmskmin/README.md index e1d63bb6afc5..45fcd907d216 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nanmskmin = require( '@stdlib/stats/base/nanmskmin' ); +const nanmskmin = require( '@stdlib/stats/base/nanmskmin' ); ``` #### nanmskmin( N, x, strideX, mask, strideMask ) @@ -41,10 +41,10 @@ var nanmskmin = require( '@stdlib/stats/base/nanmskmin' ); Computes the minimum value of a strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, -4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, -4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskmin( x.length, x, 1, mask, 1 ); +const v = nanmskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, -5.0, -6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, -5.0, -6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskmin( N, x, 2, mask, 2 ); +const v = nanmskmin( N, x, 2, mask, 2 ); // returns -7.0 ``` @@ -74,19 +74,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmskmin( N, x1, 2, mask1, 2 ); +const v = nanmskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -95,10 +95,10 @@ var v = nanmskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, -4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, -4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = nanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -110,13 +110,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -142,19 +142,15 @@ var v = nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var nanmskmin = require( '@stdlib/stats/base/nanmskmin' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const nanmskmin = require( '@stdlib/stats/base/nanmskmin' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -169,7 +165,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = nanmskmin( x.length, x, 1, mask, 1 ); +const v = nanmskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanmskrange/README.md b/lib/node_modules/@stdlib/stats/base/nanmskrange/README.md index 005d1797c443..b378a1b4ddbc 100644 --- a/lib/node_modules/@stdlib/stats/base/nanmskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanmskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var nanmskrange = require( '@stdlib/stats/base/nanmskrange' ); +const nanmskrange = require( '@stdlib/stats/base/nanmskrange' ); ``` #### nanmskrange( N, x, strideX, mask, strideMask ) @@ -43,10 +43,10 @@ var nanmskrange = require( '@stdlib/stats/base/nanmskrange' ); Computes the [range][range] of a strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskrange( x.length, x, 1, mask, 1 ); +const v = nanmskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskrange( N, x, 2, mask, 2 ); +const v = nanmskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -76,19 +76,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanmskrange( N, x1, 2, mask1, 2 ); +const v = nanmskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -97,10 +97,10 @@ var v = nanmskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; -var mask = [ 0, 0, 1, 0, 0 ]; +const x = [ 1.0, -2.0, 4.0, 2.0, NaN ]; +const mask = [ 0, 0, 1, 0, 0 ]; -var v = nanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = nanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -112,13 +112,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; -var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ]; +const mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ]; +const N = floor( x.length / 2 ); -var v = nanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = nanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -144,19 +144,15 @@ var v = nanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var nanmskrange = require( '@stdlib/stats/base/nanmskrange' ); - -var mask; -var x; -var i; - -x = new Float64Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const nanmskrange = require( '@stdlib/stats/base/nanmskrange' ); + +const x = new Float64Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -171,7 +167,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = nanmskrange( x.length, x, 1, mask, 1 ); +const v = nanmskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanrange-by/README.md b/lib/node_modules/@stdlib/stats/base/nanrange-by/README.md index 7b0aa8cbc599..315950052fa5 100644 --- a/lib/node_modules/@stdlib/stats/base/nanrange-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanrange-by/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var nanrangeBy = require( '@stdlib/stats/base/nanrange-by' ); +const nanrangeBy = require( '@stdlib/stats/base/nanrange-by' ); ``` #### nanrangeBy( N, x, stride, clbk\[, thisArg] ) @@ -47,9 +47,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanrangeBy( x.length, x, 1, accessor ); +const v = nanrangeBy( x.length, x, 1, accessor ); // returns 18.0 ``` @@ -76,54 +76,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var context = { +const context = { 'count': 0 }; -var v = nanrangeBy( x.length, x, 1, accessor, context ); +const v = nanrangeBy( x.length, x, 1, accessor, context ); // returns 18.0 -var cnt = context.count; +const cnt = context.count; // returns 10 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanrangeBy( N, x, 2, accessor ); +const v = nanrangeBy( N, x, 2, accessor ); // returns 12.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = nanrangeBy( N, x1, 2, accessor ); +const v = nanrangeBy( N, x1, 2, accessor ); // returns 8.0 ``` @@ -136,9 +136,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, 0.0, -1.0, -3.0, NaN ]; -var v = nanrangeBy.ndarray( x.length, x, 1, 0, accessor ); +const v = nanrangeBy.ndarray( x.length, x, 1, 0, accessor ); // returns 18.0 ``` @@ -153,9 +153,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = nanrangeBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = nanrangeBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns 22.0 ``` @@ -184,10 +184,10 @@ var v = nanrangeBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var randu = require( '@stdlib/random/base/randu' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var nanrangeBy = require( '@stdlib/stats/base/nanrange-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const randu = require( '@stdlib/random/base/randu' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const nanrangeBy = require( '@stdlib/stats/base/nanrange-by' ); function fill() { if ( randu() < 0.2 ) { @@ -200,10 +200,10 @@ function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); console.log( x ); -var v = nanrangeBy( x.length, x, 1, accessor ); +const v = nanrangeBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanrange/README.md b/lib/node_modules/@stdlib/stats/base/nanrange/README.md index c469cec47e9c..455c0c8d4df5 100644 --- a/lib/node_modules/@stdlib/stats/base/nanrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var nanrange = require( '@stdlib/stats/base/nanrange' ); +const nanrange = require( '@stdlib/stats/base/nanrange' ); ``` #### nanrange( N, x, stride ) @@ -43,10 +43,10 @@ var nanrange = require( '@stdlib/stats/base/nanrange' ); Computes the [range][range] of a strided array `x`, ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanrange( N, x, 1 ); +const v = nanrange( N, x, 1 ); // returns 4.0 ``` @@ -59,12 +59,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ]; +const N = floor( x.length / 2 ); -var v = nanrange( N, x, 2 ); +const v = nanrange( N, x, 2 ); // returns 6.0 ``` @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanrange( N, x1, 2 ); +const v = nanrange( N, x1, 2 ); // returns 6.0 ``` @@ -90,10 +90,10 @@ var v = nanrange( N, x1, 2 ); Computes the [range][range] of a strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, NaN, 2.0 ]; +const N = x.length; -var v = nanrange.ndarray( N, x, 1, 0 ); +const v = nanrange.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -104,12 +104,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanrange.ndarray( N, x, 2, 1 ); +const v = nanrange.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -135,16 +135,13 @@ var v = nanrange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanrange = require( '@stdlib/stats/base/nanrange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanrange = require( '@stdlib/stats/base/nanrange' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -153,7 +150,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = nanrange( x.length, x, 1 ); +const v = nanrange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdev/README.md b/lib/node_modules/@stdlib/stats/base/nanstdev/README.md index cd869ae063b8..115f1ad5a695 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdev = require( '@stdlib/stats/base/nanstdev' ); +const nanstdev = require( '@stdlib/stats/base/nanstdev' ); ``` #### nanstdev( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdev = require( '@stdlib/stats/base/nanstdev' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdev( x.length, 1, x, 1 ); +const v = nanstdev( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdev( N, 1, x, 2 ); +const v = nanstdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdev( N, 1, x1, 2 ); +const v = nanstdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdev.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdev.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdev.ndarray( N, 1, x, 2, 1 ); +const v = nanstdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = nanstdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdev = require( '@stdlib/stats/base/nanstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdev = require( '@stdlib/stats/base/nanstdev' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdev( x.length, 1, x, 1 ); +const v = nanstdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevch/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevch/README.md index aa8abc3a0653..54abd1e625e1 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdevch = require( '@stdlib/stats/base/nanstdevch' ); +const nanstdevch = require( '@stdlib/stats/base/nanstdevch' ); ``` #### nanstdevch( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdevch = require( '@stdlib/stats/base/nanstdevch' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevch( x.length, 1, x, 1 ); +const v = nanstdevch( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdevch( N, 1, x, 2 ); +const v = nanstdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdevch( N, 1, x1, 2 ); +const v = nanstdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevch.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdevch.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdevch.ndarray( N, 1, x, 2, 1 ); +const v = nanstdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -196,21 +196,18 @@ var v = nanstdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdevch = require( '@stdlib/stats/base/nanstdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdevch = require( '@stdlib/stats/base/nanstdevch' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdevch( x.length, 1, x, 1 ); +const v = nanstdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevpn/README.md index d4d071c1e6b7..0a9c9d7f3f26 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdevpn = require( '@stdlib/stats/base/nanstdevpn' ); +const nanstdevpn = require( '@stdlib/stats/base/nanstdevpn' ); ``` #### nanstdevpn( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdevpn = require( '@stdlib/stats/base/nanstdevpn' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevpn( x.length, 1, x, 1 ); +const v = nanstdevpn( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdevpn( N, 1, x, 2 ); +const v = nanstdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdevpn( N, 1, x1, 2 ); +const v = nanstdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevpn.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdevpn.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdevpn.ndarray( N, 1, x, 2, 1 ); +const v = nanstdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = nanstdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdevpn = require( '@stdlib/stats/base/nanstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdevpn = require( '@stdlib/stats/base/nanstdevpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdevpn( x.length, 1, x, 1 ); +const v = nanstdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevtk/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevtk/README.md index 7c4d7a997f7f..d146fd76e00d 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdevtk = require( '@stdlib/stats/base/nanstdevtk' ); +const nanstdevtk = require( '@stdlib/stats/base/nanstdevtk' ); ``` #### nanstdevtk( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdevtk = require( '@stdlib/stats/base/nanstdevtk' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevtk( x.length, 1, x, 1 ); +const v = nanstdevtk( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdevtk( N, 1, x, 2 ); +const v = nanstdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdevtk( N, 1, x1, 2 ); +const v = nanstdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevtk.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdevtk.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdevtk.ndarray( N, 1, x, 2, 1 ); +const v = nanstdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -196,21 +196,18 @@ var v = nanstdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdevtk = require( '@stdlib/stats/base/nanstdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdevtk = require( '@stdlib/stats/base/nanstdevtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdevtk( x.length, 1, x, 1 ); +const v = nanstdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md index 2c091fd267b7..f3199e1bc6b6 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' ); +const nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' ); ``` #### nanstdevwd( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevwd( x.length, 1, x, 1 ); +const v = nanstdevwd( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdevwd( N, 1, x, 2 ); +const v = nanstdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdevwd( N, 1, x1, 2 ); +const v = nanstdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevwd.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdevwd.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdevwd.ndarray( N, 1, x, 2, 1 ); +const v = nanstdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = nanstdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdevwd( x.length, 1, x, 1 ); +const v = nanstdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevyc/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevyc/README.md index 035d8a165c74..3c150946bf7b 100644 --- a/lib/node_modules/@stdlib/stats/base/nanstdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanstdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanstdevyc = require( '@stdlib/stats/base/nanstdevyc' ); +const nanstdevyc = require( '@stdlib/stats/base/nanstdevyc' ); ``` #### nanstdevyc( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanstdevyc = require( '@stdlib/stats/base/nanstdevyc' ); Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevyc( x.length, 1, x, 1 ); +const v = nanstdevyc( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanstdevyc( N, 1, x, 2 ); +const v = nanstdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanstdevyc( N, 1, x1, 2 ); +const v = nanstdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = nanstdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanstdevyc.ndarray( x.length, 1, x, 1, 0 ); +const v = nanstdevyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanstdevyc.ndarray( N, 1, x, 2, 1 ); +const v = nanstdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = nanstdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanstdevyc = require( '@stdlib/stats/base/nanstdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanstdevyc = require( '@stdlib/stats/base/nanstdevyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanstdevyc( x.length, 1, x, 1 ); +const v = nanstdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvariance/README.md b/lib/node_modules/@stdlib/stats/base/nanvariance/README.md index 1cf829ea218a..62d7fe4c59fd 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvariance = require( '@stdlib/stats/base/nanvariance' ); +const nanvariance = require( '@stdlib/stats/base/nanvariance' ); ``` #### nanvariance( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvariance = require( '@stdlib/stats/base/nanvariance' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariance( x.length, 1, x, 1 ); +const v = nanvariance( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvariance( N, 1, x, 2 ); +const v = nanvariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvariance( N, 1, x1, 2 ); +const v = nanvariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvariance( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariance.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvariance.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvariance.ndarray( N, 1, x, 2, 1 ); +const v = nanvariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = nanvariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvariance = require( '@stdlib/stats/base/nanvariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvariance = require( '@stdlib/stats/base/nanvariance' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvariance( x.length, 1, x, 1 ); +const v = nanvariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvariancech/README.md b/lib/node_modules/@stdlib/stats/base/nanvariancech/README.md index 479cf68094bd..9deb48ca4706 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvariancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvariancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); +const nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); ``` #### nanvariancech( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancech( x.length, 1, x, 1 ); +const v = nanvariancech( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvariancech( N, 1, x, 2 ); +const v = nanvariancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvariancech( N, 1, x1, 2 ); +const v = nanvariancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvariancech( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancech.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvariancech.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvariancech.ndarray( N, 1, x, 2, 1 ); +const v = nanvariancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -196,21 +196,18 @@ var v = nanvariancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvariancech( x.length, 1, x, 1 ); +const v = nanvariancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvariancepn/README.md b/lib/node_modules/@stdlib/stats/base/nanvariancepn/README.md index fbefab955fef..04f37d8fb65c 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvariancepn = require( '@stdlib/stats/base/nanvariancepn' ); +const nanvariancepn = require( '@stdlib/stats/base/nanvariancepn' ); ``` #### nanvariancepn( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvariancepn = require( '@stdlib/stats/base/nanvariancepn' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancepn( x.length, 1, x, 1 ); +const v = nanvariancepn( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvariancepn( N, 1, x, 2 ); +const v = nanvariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvariancepn( N, 1, x1, 2 ); +const v = nanvariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancepn.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvariancepn.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvariancepn.ndarray( N, 1, x, 2, 1 ); +const v = nanvariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = nanvariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvariancepn = require( '@stdlib/stats/base/nanvariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvariancepn = require( '@stdlib/stats/base/nanvariancepn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvariancepn( x.length, 1, x, 1 ); +const v = nanvariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvariancetk/README.md b/lib/node_modules/@stdlib/stats/base/nanvariancetk/README.md index 48ef01f74076..a3cb6c721861 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvariancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvariancetk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvariancetk = require( '@stdlib/stats/base/nanvariancetk' ); +const nanvariancetk = require( '@stdlib/stats/base/nanvariancetk' ); ``` #### nanvariancetk( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvariancetk = require( '@stdlib/stats/base/nanvariancetk' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancetk( x.length, 1, x, 1 ); +const v = nanvariancetk( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvariancetk( N, 1, x, 2 ); +const v = nanvariancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvariancetk( N, 1, x1, 2 ); +const v = nanvariancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvariancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancetk.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvariancetk.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvariancetk.ndarray( N, 1, x, 2, 1 ); +const v = nanvariancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -196,21 +196,18 @@ var v = nanvariancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvariancetk = require( '@stdlib/stats/base/nanvariancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvariancetk = require( '@stdlib/stats/base/nanvariancetk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvariancetk( x.length, 1, x, 1 ); +const v = nanvariancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvariancewd/README.md b/lib/node_modules/@stdlib/stats/base/nanvariancewd/README.md index 35df01d49a2b..6cd1f0776058 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvariancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvariancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' ); +const nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' ); ``` #### nanvariancewd( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancewd( x.length, 1, x, 1 ); +const v = nanvariancewd( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvariancewd( N, 1, x, 2 ); +const v = nanvariancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvariancewd( N, 1, x1, 2 ); +const v = nanvariancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvariancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvariancewd.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvariancewd.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvariancewd.ndarray( N, 1, x, 2, 1 ); +const v = nanvariancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = nanvariancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvariancewd( x.length, 1, x, 1 ); +const v = nanvariancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/nanvarianceyc/README.md b/lib/node_modules/@stdlib/stats/base/nanvarianceyc/README.md index f49d0ef84510..5f150205d3f3 100644 --- a/lib/node_modules/@stdlib/stats/base/nanvarianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/nanvarianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var nanvarianceyc = require( '@stdlib/stats/base/nanvarianceyc' ); +const nanvarianceyc = require( '@stdlib/stats/base/nanvarianceyc' ); ``` #### nanvarianceyc( N, correction, x, stride ) @@ -103,9 +103,9 @@ var nanvarianceyc = require( '@stdlib/stats/base/nanvarianceyc' ); Computes the [variance][variance] of a strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvarianceyc( x.length, 1, x, 1 ); +const v = nanvarianceyc( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ]; +const N = floor( x.length / 2 ); -var v = nanvarianceyc( N, 1, x, 2 ); +const v = nanvarianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = nanvarianceyc( N, 1, x1, 2 ); +const v = nanvarianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = nanvarianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, NaN, 2.0 ]; +const x = [ 1.0, -2.0, NaN, 2.0 ]; -var v = nanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); +const v = nanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = nanvarianceyc.ndarray( N, 1, x, 2, 1 ); +const v = nanvarianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = nanvarianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var nanvarianceyc = require( '@stdlib/stats/base/nanvarianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const nanvarianceyc = require( '@stdlib/stats/base/nanvarianceyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = nanvarianceyc( x.length, 1, x, 1 ); +const v = nanvarianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/range-by/README.md b/lib/node_modules/@stdlib/stats/base/range-by/README.md index 6201414d727a..6f5e28781e5c 100644 --- a/lib/node_modules/@stdlib/stats/base/range-by/README.md +++ b/lib/node_modules/@stdlib/stats/base/range-by/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var rangeBy = require( '@stdlib/stats/base/range-by' ); +const rangeBy = require( '@stdlib/stats/base/range-by' ); ``` #### rangeBy( N, x, stride, clbk\[, thisArg] ) @@ -47,9 +47,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = rangeBy( x.length, x, 1, accessor ); +const v = rangeBy( x.length, x, 1, accessor ); // returns 18.0 ``` @@ -76,54 +76,54 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var context = { +const context = { 'count': 0 }; -var v = rangeBy( x.length, x, 1, accessor, context ); +const v = rangeBy( x.length, x, 1, accessor, context ); // returns 18.0 -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to access every other element ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var N = floor( x.length / 2 ); +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const N = floor( x.length / 2 ); -var v = rangeBy( N, x, 2, accessor ); +const v = rangeBy( N, x, 2, accessor ); // returns 12.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); function accessor( v ) { return v * 2.0; } // Initial array... -var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +const x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const N = floor( x0.length/2 ); // Access every other element... -var v = rangeBy( N, x1, 2, accessor ); +const v = rangeBy( N, x1, 2, accessor ); // returns 8.0 ``` @@ -136,9 +136,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var v = rangeBy.ndarray( x.length, x, 1, 0, accessor ); +const v = rangeBy.ndarray( x.length, x, 1, 0, accessor ); // returns 18.0 ``` @@ -153,9 +153,9 @@ function accessor( v ) { return v * 2.0; } -var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; +const x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ]; -var v = rangeBy.ndarray( 3, x, 1, x.length-3, accessor ); +const v = rangeBy.ndarray( 3, x, 1, x.length-3, accessor ); // returns 22.0 ``` @@ -183,18 +183,18 @@ var v = rangeBy.ndarray( 3, x, 1, x.length-3, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var rangeBy = require( '@stdlib/stats/base/range-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const rangeBy = require( '@stdlib/stats/base/range-by' ); function accessor( v ) { return v * 2.0; } -var x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( -50, 50 ) ); console.log( x ); -var v = rangeBy( x.length, x, 1, accessor ); +const v = rangeBy( x.length, x, 1, accessor ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/range/README.md b/lib/node_modules/@stdlib/stats/base/range/README.md index 9134551ef621..62b71529e9b7 100644 --- a/lib/node_modules/@stdlib/stats/base/range/README.md +++ b/lib/node_modules/@stdlib/stats/base/range/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var range = require( '@stdlib/stats/base/range' ); +const range = require( '@stdlib/stats/base/range' ); ``` #### range( N, x, stride ) @@ -43,10 +43,10 @@ var range = require( '@stdlib/stats/base/range' ); Computes the [range][range] of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = range( N, x, 1 ); +const v = range( N, x, 1 ); // returns 4.0 ``` @@ -59,12 +59,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = range( N, x, 2 ); +const v = range( N, x, 2 ); // returns 6.0 ``` @@ -73,15 +73,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = range( N, x1, 2 ); +const v = range( N, x1, 2 ); // returns 6.0 ``` @@ -90,10 +90,10 @@ var v = range( N, x1, 2 ); Computes the [range][range] of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = range.ndarray( N, x, 1, 0 ); +const v = range.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -104,12 +104,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = range.ndarray( N, x, 2, 1 ); +const v = range.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -135,21 +135,18 @@ var v = range.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var range = require( '@stdlib/stats/base/range' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const range = require( '@stdlib/stats/base/range' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = range( x.length, x, 1 ); +const v = range( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/scumax/README.md b/lib/node_modules/@stdlib/stats/base/scumax/README.md index 6ee8a15f8a2e..1bb95e132155 100644 --- a/lib/node_modules/@stdlib/stats/base/scumax/README.md +++ b/lib/node_modules/@stdlib/stats/base/scumax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scumax = require( '@stdlib/stats/base/scumax' ); +const scumax = require( '@stdlib/stats/base/scumax' ); ``` #### scumax( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scumax = require( '@stdlib/stats/base/scumax' ); Computes the cumulative maximum of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumax( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scumax( 4, x, 2, y, 1 ); +const v = scumax( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scumax( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -94,10 +94,10 @@ scumax( 4, x1, -2, y1, 1 ); Computes the cumulative maximum of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumax.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 1.0, 1.0 ] @@ -141,18 +141,14 @@ scumax.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scumax = require( '@stdlib/stats/base/scumax' ); - -var y; -var x; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scumax = require( '@stdlib/stats/base/scumax' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md b/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md index 7ade5f2c90e2..68cc66702c1b 100644 --- a/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scumaxabs = require( '@stdlib/stats/base/scumaxabs' ); +const scumaxabs = require( '@stdlib/stats/base/scumaxabs' ); ``` #### scumaxabs( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scumaxabs = require( '@stdlib/stats/base/scumaxabs' ); Computes the cumulative maximum absolute value of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumaxabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 2.0, 2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scumaxabs( 4, x, 2, y, 1 ); +const v = scumaxabs( 4, x, 2, y, 1 ); // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scumaxabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ] @@ -94,10 +94,10 @@ scumaxabs( 4, x1, -2, y1, 1 ); Computes the cumulative maximum absolute value of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumaxabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 2.0, 2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0 ] @@ -141,18 +141,14 @@ scumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scumaxabs = require( '@stdlib/stats/base/scumaxabs' ); - -var y; -var x; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scumaxabs = require( '@stdlib/stats/base/scumaxabs' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/scumin/README.md b/lib/node_modules/@stdlib/stats/base/scumin/README.md index fa46b155be22..cfdbb9343198 100644 --- a/lib/node_modules/@stdlib/stats/base/scumin/README.md +++ b/lib/node_modules/@stdlib/stats/base/scumin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scumin = require( '@stdlib/stats/base/scumin' ); +const scumin = require( '@stdlib/stats/base/scumin' ); ``` #### scumin( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scumin = require( '@stdlib/stats/base/scumin' ); Computes the cumulative minimum of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumin( x.length, x, 1, y, 1 ); // y => [ 1.0, -2.0, -2.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scumin( 4, x, 2, y, 1 ); +const v = scumin( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scumin( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, -2.0, -2.0, 0.0 ] @@ -94,10 +94,10 @@ scumin( 4, x1, -2, y1, 1 ); Computes the cumulative minimum of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scumin.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, -2.0, -2.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, -2.0, -2.0, -2.0, 1.0 ] @@ -141,18 +141,14 @@ scumin.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scumin = require( '@stdlib/stats/base/scumin' ); - -var y; -var x; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scumin = require( '@stdlib/stats/base/scumin' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( randu()*100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/scuminabs/README.md b/lib/node_modules/@stdlib/stats/base/scuminabs/README.md index 6c08a6d35ca9..6f6b119b0966 100644 --- a/lib/node_modules/@stdlib/stats/base/scuminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/scuminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var scuminabs = require( '@stdlib/stats/base/scuminabs' ); +const scuminabs = require( '@stdlib/stats/base/scuminabs' ); ``` #### scuminabs( N, x, strideX, y, strideY ) @@ -41,10 +41,10 @@ var scuminabs = require( '@stdlib/stats/base/scuminabs' ); Computes the cumulative minimum absolute value of single-precision floating-point strided array elements. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scuminabs( x.length, x, 1, y, 1 ); // y => [ 1.0, 1.0, 1.0 ] @@ -61,12 +61,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative minimum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const y = new Float32Array( x.length ); -var v = scuminabs( 4, x, 2, y, 1 ); +const v = scuminabs( 4, x, 2, y, 1 ); // y => [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y0 = new Float32Array( x0.length ); +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y0 = new Float32Array( x0.length ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element scuminabs( 4, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0, 0.0 ] @@ -94,10 +94,10 @@ scuminabs( 4, x1, -2, y1, 1 ); Computes the cumulative minimum absolute value of single-precision floating-point strided array elements using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const y = new Float32Array( x.length ); scuminabs.ndarray( x.length, x, 1, 0, y, 1, 0 ); // y => [ 1.0, 1.0, 1.0 ] @@ -111,10 +111,10 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative minimum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var y = new Float32Array( x.length ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const y = new Float32Array( x.length ); scuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] @@ -141,18 +141,14 @@ scuminabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scuminabs = require( '@stdlib/stats/base/scuminabs' ); - -var y; -var x; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const scuminabs = require( '@stdlib/stats/base/scuminabs' ); + +const x = new Float32Array( 10 ); +const y = new Float32Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/stats/base/sdsmean/README.md b/lib/node_modules/@stdlib/stats/base/sdsmean/README.md index c7a74022dd77..d665160b6c46 100644 --- a/lib/node_modules/@stdlib/stats/base/sdsmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/sdsmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var sdsmean = require( '@stdlib/stats/base/sdsmean' ); +const sdsmean = require( '@stdlib/stats/base/sdsmean' ); ``` #### sdsmean( N, x, stride ) @@ -56,12 +56,12 @@ var sdsmean = require( '@stdlib/stats/base/sdsmean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdsmean( N, x, 1 ); +const v = sdsmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sdsmean( N, x, 2 ); +const v = sdsmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sdsmean( N, x1, 2 ); +const v = sdsmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = sdsmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdsmean.ndarray( N, x, 1, 0 ); +const v = sdsmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sdsmean.ndarray( N, x, 2, 1 ); +const v = sdsmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = sdsmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sdsmean = require( '@stdlib/stats/base/sdsmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sdsmean = require( '@stdlib/stats/base/sdsmean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sdsmean( x.length, x, 1 ); +const v = sdsmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sdsmeanors/README.md b/lib/node_modules/@stdlib/stats/base/sdsmeanors/README.md index b6735cf153ed..0fd50e9e69e6 100644 --- a/lib/node_modules/@stdlib/stats/base/sdsmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/sdsmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var sdsmeanors = require( '@stdlib/stats/base/sdsmeanors' ); +const sdsmeanors = require( '@stdlib/stats/base/sdsmeanors' ); ``` #### sdsmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var sdsmeanors = require( '@stdlib/stats/base/sdsmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using ordinary recursive summation with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdsmeanors( N, x, 1 ); +const v = sdsmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sdsmeanors( N, x, 2 ); +const v = sdsmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sdsmeanors( N, x1, 2 ); +const v = sdsmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = sdsmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using ordinary recursive summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sdsmeanors.ndarray( N, x, 1, 0 ); +const v = sdsmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sdsmeanors.ndarray( N, x, 2, 1 ); +const v = sdsmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = sdsmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sdsmeanors = require( '@stdlib/stats/base/sdsmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sdsmeanors = require( '@stdlib/stats/base/sdsmeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sdsmeanors( x.length, x, 1 ); +const v = sdsmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sdsnanmean/README.md b/lib/node_modules/@stdlib/stats/base/sdsnanmean/README.md index cc496e85f3da..a37e97cb4bb1 100644 --- a/lib/node_modules/@stdlib/stats/base/sdsnanmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/sdsnanmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var sdsnanmean = require( '@stdlib/stats/base/sdsnanmean' ); +const sdsnanmean = require( '@stdlib/stats/base/sdsnanmean' ); ``` #### sdsnanmean( N, x, stride ) @@ -56,12 +56,12 @@ var sdsnanmean = require( '@stdlib/stats/base/sdsnanmean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnanmean( N, x, 1 ); +const v = sdsnanmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = sdsnanmean( N, x, 2 ); +const v = sdsnanmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sdsnanmean( N, x1, 2 ); +const v = sdsnanmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = sdsnanmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnanmean.ndarray( N, x, 1, 0 ); +const v = sdsnanmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = sdsnanmean.ndarray( N, x, 2, 1 ); +const v = sdsnanmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = sdsnanmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sdsnanmean = require( '@stdlib/stats/base/sdsnanmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sdsnanmean = require( '@stdlib/stats/base/sdsnanmean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = sdsnanmean( x.length, x, 1 ); +const v = sdsnanmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sdsnanmeanors/README.md b/lib/node_modules/@stdlib/stats/base/sdsnanmeanors/README.md index 4e3b564c181a..9cc94f85553c 100644 --- a/lib/node_modules/@stdlib/stats/base/sdsnanmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/sdsnanmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var sdsnanmeanors = require( '@stdlib/stats/base/sdsnanmeanors' ); +const sdsnanmeanors = require( '@stdlib/stats/base/sdsnanmeanors' ); ``` #### sdsnanmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var sdsnanmeanors = require( '@stdlib/stats/base/sdsnanmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using ordinary recursive summation with extended accumulation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnanmeanors( N, x, 1 ); +const v = sdsnanmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = sdsnanmeanors( N, x, 2 ); +const v = sdsnanmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sdsnanmeanors( N, x1, 2 ); +const v = sdsnanmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = sdsnanmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = sdsnanmeanors.ndarray( N, x, 1, 0 ); +const v = sdsnanmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = sdsnanmeanors.ndarray( N, x, 2, 1 ); +const v = sdsnanmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = sdsnanmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sdsnanmeanors = require( '@stdlib/stats/base/sdsnanmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sdsnanmeanors = require( '@stdlib/stats/base/sdsnanmeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = sdsnanmeanors( x.length, x, 1 ); +const v = sdsnanmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smax/README.md b/lib/node_modules/@stdlib/stats/base/smax/README.md index 616ae496f72b..1767fa3ccdf3 100644 --- a/lib/node_modules/@stdlib/stats/base/smax/README.md +++ b/lib/node_modules/@stdlib/stats/base/smax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smax = require( '@stdlib/stats/base/smax' ); +const smax = require( '@stdlib/stats/base/smax' ); ``` #### smax( N, x, stride ) @@ -41,12 +41,12 @@ var smax = require( '@stdlib/stats/base/smax' ); Computes the maximum value of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smax( N, x, 1 ); +const v = smax( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smax( N, x, 2 ); +const v = smax( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smax( N, x1, 2 ); +const v = smax( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = smax( N, x1, 2 ); Computes the maximum value of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smax.ndarray( N, x, 1, 0 ); +const v = smax.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smax.ndarray( N, x, 2, 1 ); +const v = smax.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,21 +138,18 @@ var v = smax.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smax = require( '@stdlib/stats/base/smax' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smax = require( '@stdlib/stats/base/smax' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smax( x.length, x, 1 ); +const v = smax( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smaxabs/README.md b/lib/node_modules/@stdlib/stats/base/smaxabs/README.md index 903d45390af7..7cefa5dd4c8e 100644 --- a/lib/node_modules/@stdlib/stats/base/smaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/smaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smaxabs = require( '@stdlib/stats/base/smaxabs' ); +const smaxabs = require( '@stdlib/stats/base/smaxabs' ); ``` #### smaxabs( N, x, stride ) @@ -41,12 +41,12 @@ var smaxabs = require( '@stdlib/stats/base/smaxabs' ); Computes the maximum absolute value of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smaxabs( N, x, 1 ); +const v = smaxabs( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxabs( N, x, 2 ); +const v = smaxabs( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smaxabs( N, x1, 2 ); +const v = smaxabs( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = smaxabs( N, x1, 2 ); Computes the maximum absolute value of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smaxabs.ndarray( N, x, 1, 0 ); +const v = smaxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxabs.ndarray( N, x, 2, 1 ); +const v = smaxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,21 +138,18 @@ var v = smaxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smaxabs = require( '@stdlib/stats/base/smaxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smaxabs = require( '@stdlib/stats/base/smaxabs' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smaxabs( x.length, x, 1 ); +const v = smaxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smaxabssorted/README.md b/lib/node_modules/@stdlib/stats/base/smaxabssorted/README.md index 2d3b6fa7e7b6..be95681e7a06 100644 --- a/lib/node_modules/@stdlib/stats/base/smaxabssorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/smaxabssorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smaxabssorted = require( '@stdlib/stats/base/smaxabssorted' ); +const smaxabssorted = require( '@stdlib/stats/base/smaxabssorted' ); ``` #### smaxabssorted( N, x, stride ) @@ -41,10 +41,10 @@ var smaxabssorted = require( '@stdlib/stats/base/smaxabssorted' ); Computes the maximum absolute value of a sorted single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0 ] ); -var v = smaxabssorted( x.length, x, 1 ); +let x = new Float32Array( [ -1.0, -2.0, -3.0 ] ); +let v = smaxabssorted( x.length, x, 1 ); // returns 3.0 x = new Float32Array( [ -3.0, -2.0, -1.0 ] ); @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxabssorted( N, x, 2 ); +const v = smaxabssorted( N, x, 2 ); // returns 4.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smaxabssorted( N, x1, 2 ); +const v = smaxabssorted( N, x1, 2 ); // returns 4.0 ``` @@ -93,10 +93,10 @@ var v = smaxabssorted( N, x1, 2 ); Computes the maximum absolute value of a sorted single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0 ] ); -var v = smaxabssorted.ndarray( x.length, x, 1, 0 ); +const x = new Float32Array( [ -1.0, -2.0, -3.0 ] ); +const v = smaxabssorted.ndarray( x.length, x, 1, 0 ); // returns 3.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxabssorted.ndarray( N, x, 2, 1 ); +const v = smaxabssorted.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -139,19 +139,16 @@ var v = smaxabssorted.ndarray( N, x, 2, 1 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var smaxabssorted = require( '@stdlib/stats/base/smaxabssorted' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smaxabssorted = require( '@stdlib/stats/base/smaxabssorted' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = smaxabssorted( x.length, x, 1 ); +const v = smaxabssorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smaxsorted/README.md b/lib/node_modules/@stdlib/stats/base/smaxsorted/README.md index de8c418d00a0..13db084c0ec9 100644 --- a/lib/node_modules/@stdlib/stats/base/smaxsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/smaxsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smaxsorted = require( '@stdlib/stats/base/smaxsorted' ); +const smaxsorted = require( '@stdlib/stats/base/smaxsorted' ); ``` #### smaxsorted( N, x, stride ) @@ -41,12 +41,12 @@ var smaxsorted = require( '@stdlib/stats/base/smaxsorted' ); Computes the maximum value of a sorted single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +let x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +let N = x.length; -var v = smaxsorted( N, x, 1 ); +let v = smaxsorted( N, x, 1 ); // returns 3.0 x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); @@ -65,13 +65,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxsorted( N, x, 2 ); +const v = smaxsorted( N, x, 2 ); // returns 4.0 ``` @@ -80,15 +80,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smaxsorted( N, x1, 2 ); +const v = smaxsorted( N, x1, 2 ); // returns 4.0 ``` @@ -97,12 +97,12 @@ var v = smaxsorted( N, x1, 2 ); Computes the maximum value of a sorted single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = smaxsorted.ndarray( N, x, 1, 0 ); +const v = smaxsorted.ndarray( N, x, 1, 0 ); // returns 3.0 ``` @@ -113,13 +113,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smaxsorted.ndarray( N, x, 2, 1 ); +const v = smaxsorted.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -145,19 +145,16 @@ var v = smaxsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var smaxsorted = require( '@stdlib/stats/base/smaxsorted' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smaxsorted = require( '@stdlib/stats/base/smaxsorted' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = smaxsorted( x.length, x, 1 ); +const v = smaxsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smean/README.md b/lib/node_modules/@stdlib/stats/base/smean/README.md index bc851c0b90ee..a34f6c7ea800 100644 --- a/lib/node_modules/@stdlib/stats/base/smean/README.md +++ b/lib/node_modules/@stdlib/stats/base/smean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smean = require( '@stdlib/stats/base/smean' ); +const smean = require( '@stdlib/stats/base/smean' ); ``` #### smean( N, x, stride ) @@ -56,12 +56,12 @@ var smean = require( '@stdlib/stats/base/smean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smean( N, x, 1 ); +const v = smean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smean( N, x, 2 ); +const v = smean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smean( N, x1, 2 ); +const v = smean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smean.ndarray( N, x, 1, 0 ); +const v = smean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smean.ndarray( N, x, 2, 1 ); +const v = smean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = smean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smean = require( '@stdlib/stats/base/smean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smean = require( '@stdlib/stats/base/smean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smean( x.length, x, 1 ); +const v = smean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeankbn/README.md b/lib/node_modules/@stdlib/stats/base/smeankbn/README.md index dabfac1a840d..595ca911b8ed 100644 --- a/lib/node_modules/@stdlib/stats/base/smeankbn/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeankbn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeankbn = require( '@stdlib/stats/base/smeankbn' ); +const smeankbn = require( '@stdlib/stats/base/smeankbn' ); ``` #### smeankbn( N, x, stride ) @@ -56,12 +56,12 @@ var smeankbn = require( '@stdlib/stats/base/smeankbn' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using an improved Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeankbn( N, x, 1 ); +const v = smeankbn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeankbn( N, x, 2 ); +const v = smeankbn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeankbn( N, x1, 2 ); +const v = smeankbn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeankbn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using an improved Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeankbn.ndarray( N, x, 1, 0 ); +const v = smeankbn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeankbn.ndarray( N, x, 2, 1 ); +const v = smeankbn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = smeankbn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeankbn = require( '@stdlib/stats/base/smeankbn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeankbn = require( '@stdlib/stats/base/smeankbn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeankbn( x.length, x, 1 ); +const v = smeankbn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeankbn2/README.md b/lib/node_modules/@stdlib/stats/base/smeankbn2/README.md index 4dda1cd483d5..99846e831665 100644 --- a/lib/node_modules/@stdlib/stats/base/smeankbn2/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeankbn2/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeankbn2 = require( '@stdlib/stats/base/smeankbn2' ); +const smeankbn2 = require( '@stdlib/stats/base/smeankbn2' ); ``` #### smeankbn2( N, x, stride ) @@ -56,12 +56,12 @@ var smeankbn2 = require( '@stdlib/stats/base/smeankbn2' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using a second-order iterative Kahan–Babuška algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeankbn2( N, x, 1 ); +const v = smeankbn2( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeankbn2( N, x, 2 ); +const v = smeankbn2( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeankbn2( N, x1, 2 ); +const v = smeankbn2( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeankbn2( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeankbn2.ndarray( N, x, 1, 0 ); +const v = smeankbn2.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeankbn2.ndarray( N, x, 2, 1 ); +const v = smeankbn2.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = smeankbn2.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeankbn2 = require( '@stdlib/stats/base/smeankbn2' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeankbn2 = require( '@stdlib/stats/base/smeankbn2' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeankbn2( x.length, x, 1 ); +const v = smeankbn2( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanli/README.md b/lib/node_modules/@stdlib/stats/base/smeanli/README.md index a784871351ac..d7c05ff1cd3f 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanli/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanli/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanli = require( '@stdlib/stats/base/smeanli' ); +const smeanli = require( '@stdlib/stats/base/smeanli' ); ``` #### smeanli( N, x, stride ) @@ -56,12 +56,12 @@ var smeanli = require( '@stdlib/stats/base/smeanli' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanli( N, x, 1 ); +const v = smeanli( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanli( N, x, 2 ); +const v = smeanli( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanli( N, x1, 2 ); +const v = smeanli( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanli( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanli.ndarray( N, x, 1, 0 ); +const v = smeanli.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanli.ndarray( N, x, 2, 1 ); +const v = smeanli.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = smeanli.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanli = require( '@stdlib/stats/base/smeanli' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanli = require( '@stdlib/stats/base/smeanli' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanli( x.length, x, 1 ); +const v = smeanli( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanlipw/README.md b/lib/node_modules/@stdlib/stats/base/smeanlipw/README.md index 57a3fe2d765b..3f4b21307a23 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanlipw/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanlipw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanlipw = require( '@stdlib/stats/base/smeanlipw' ); +const smeanlipw = require( '@stdlib/stats/base/smeanlipw' ); ``` #### smeanlipw( N, x, stride ) @@ -56,12 +56,12 @@ var smeanlipw = require( '@stdlib/stats/base/smeanlipw' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using a one-pass trial mean algorithm with pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanlipw( N, x, 1 ); +const v = smeanlipw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanlipw( N, x, 2 ); +const v = smeanlipw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanlipw( N, x1, 2 ); +const v = smeanlipw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanlipw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm with pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanlipw.ndarray( N, x, 1, 0 ); +const v = smeanlipw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanlipw.ndarray( N, x, 2, 1 ); +const v = smeanlipw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = smeanlipw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanlipw = require( '@stdlib/stats/base/smeanlipw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanlipw = require( '@stdlib/stats/base/smeanlipw' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanlipw( x.length, x, 1 ); +const v = smeanlipw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanors/README.md b/lib/node_modules/@stdlib/stats/base/smeanors/README.md index 562c8b729a38..ec85bedd8ac5 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanors = require( '@stdlib/stats/base/smeanors' ); +const smeanors = require( '@stdlib/stats/base/smeanors' ); ``` #### smeanors( N, x, stride ) @@ -56,12 +56,12 @@ var smeanors = require( '@stdlib/stats/base/smeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanors( N, x, 1 ); +const v = smeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanors( N, x, 2 ); +const v = smeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanors( N, x1, 2 ); +const v = smeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanors.ndarray( N, x, 1, 0 ); +const v = smeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanors.ndarray( N, x, 2, 1 ); +const v = smeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = smeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanors = require( '@stdlib/stats/base/smeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanors = require( '@stdlib/stats/base/smeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanors( x.length, x, 1 ); +const v = smeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanpn/README.md b/lib/node_modules/@stdlib/stats/base/smeanpn/README.md index fff97c6bbfc4..f98a1233330b 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanpn = require( '@stdlib/stats/base/smeanpn' ); +const smeanpn = require( '@stdlib/stats/base/smeanpn' ); ``` #### smeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var smeanpn = require( '@stdlib/stats/base/smeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using a two-pass error correction algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanpn( N, x, 1 ); +const v = smeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanpn( N, x, 2 ); +const v = smeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanpn( N, x1, 2 ); +const v = smeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanpn.ndarray( N, x, 1, 0 ); +const v = smeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanpn.ndarray( N, x, 2, 1 ); +const v = smeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = smeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanpn = require( '@stdlib/stats/base/smeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanpn = require( '@stdlib/stats/base/smeanpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanpn( x.length, x, 1 ); +const v = smeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanpw/README.md b/lib/node_modules/@stdlib/stats/base/smeanpw/README.md index 299dbd72be49..a4f5ee741801 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanpw/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanpw/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanpw = require( '@stdlib/stats/base/smeanpw' ); +const smeanpw = require( '@stdlib/stats/base/smeanpw' ); ``` #### smeanpw( N, x, stride ) @@ -56,12 +56,12 @@ var smeanpw = require( '@stdlib/stats/base/smeanpw' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using pairwise summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanpw( N, x, 1 ); +const v = smeanpw( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanpw( N, x, 2 ); +const v = smeanpw( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanpw( N, x1, 2 ); +const v = smeanpw( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanpw( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using pairwise summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanpw.ndarray( N, x, 1, 0 ); +const v = smeanpw.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanpw.ndarray( N, x, 2, 1 ); +const v = smeanpw.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,21 +154,18 @@ var v = smeanpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanpw = require( '@stdlib/stats/base/smeanpw' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanpw = require( '@stdlib/stats/base/smeanpw' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanpw( x.length, x, 1 ); +const v = smeanpw( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smeanwd/README.md b/lib/node_modules/@stdlib/stats/base/smeanwd/README.md index a66534f117e4..b372dee92889 100644 --- a/lib/node_modules/@stdlib/stats/base/smeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/smeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var smeanwd = require( '@stdlib/stats/base/smeanwd' ); +const smeanwd = require( '@stdlib/stats/base/smeanwd' ); ``` #### smeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var smeanwd = require( '@stdlib/stats/base/smeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanwd( N, x, 1 ); +const v = smeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanwd( N, x, 2 ); +const v = smeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smeanwd( N, x1, 2 ); +const v = smeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = smeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smeanwd.ndarray( N, x, 1, 0 ); +const v = smeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smeanwd.ndarray( N, x, 2, 1 ); +const v = smeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -153,21 +153,18 @@ var v = smeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smeanwd = require( '@stdlib/stats/base/smeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smeanwd = require( '@stdlib/stats/base/smeanwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smeanwd( x.length, x, 1 ); +const v = smeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smediansorted/README.md b/lib/node_modules/@stdlib/stats/base/smediansorted/README.md index a1445f4a465a..e2edfb0bb82b 100644 --- a/lib/node_modules/@stdlib/stats/base/smediansorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/smediansorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smediansorted = require( '@stdlib/stats/base/smediansorted' ); +const smediansorted = require( '@stdlib/stats/base/smediansorted' ); ``` #### smediansorted( N, x, stride ) @@ -41,10 +41,10 @@ var smediansorted = require( '@stdlib/stats/base/smediansorted' ); Computes the median value of a sorted single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var v = smediansorted( x.length, x, 1 ); +let x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +let v = smediansorted( x.length, x, 1 ); // returns 2.0 x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the median value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smediansorted( N, x, 2 ); +const v = smediansorted( N, x, 2 ); // returns 2.5 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smediansorted( N, x1, 2 ); +const v = smediansorted( N, x1, 2 ); // returns 2.0 ``` @@ -93,12 +93,12 @@ var v = smediansorted( N, x1, 2 ); Computes the median value of a sorted single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = smediansorted.ndarray( N, x, 1, 0 ); +const v = smediansorted.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the median value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smediansorted.ndarray( N, x, 2, 1 ); +const v = smediansorted.ndarray( N, x, 2, 1 ); // returns 2.0 ``` @@ -141,19 +141,16 @@ var v = smediansorted.ndarray( N, x, 2, 1 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var smediansorted = require( '@stdlib/stats/base/smediansorted' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smediansorted = require( '@stdlib/stats/base/smediansorted' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = smediansorted( x.length, x, 1 ); +const v = smediansorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smidrange/README.md b/lib/node_modules/@stdlib/stats/base/smidrange/README.md index 43592a06547f..17e03e1303a2 100644 --- a/lib/node_modules/@stdlib/stats/base/smidrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/smidrange/README.md @@ -35,7 +35,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of th ## Usage ```javascript -var smidrange = require( '@stdlib/stats/base/smidrange' ); +const smidrange = require( '@stdlib/stats/base/smidrange' ); ``` #### smidrange( N, x, stride ) @@ -43,11 +43,11 @@ var smidrange = require( '@stdlib/stats/base/smidrange' ); Computes the [mid-range][mid-range] of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = smidrange( x.length, x, 1 ); +const v = smidrange( x.length, x, 1 ); // returns 0.0 ``` @@ -60,13 +60,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [mid-range][mid-range] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smidrange( N, x, 2 ); +const v = smidrange( N, x, 2 ); // returns 1.0 ``` @@ -75,15 +75,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smidrange( N, x1, 2 ); +const v = smidrange( N, x1, 2 ); // returns 1.0 ``` @@ -92,11 +92,11 @@ var v = smidrange( N, x1, 2 ); Computes the [mid-range][mid-range] of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var v = smidrange.ndarray( x.length, x, 1, 0 ); +const v = smidrange.ndarray( x.length, x, 1, 0 ); // returns 0.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [mid-range][mid-range] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smidrange.ndarray( N, x, 2, 1 ); +const v = smidrange.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,21 +138,18 @@ var v = smidrange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smidrange = require( '@stdlib/stats/base/smidrange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smidrange = require( '@stdlib/stats/base/smidrange' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smidrange( x.length, x, 1 ); +const v = smidrange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smin/README.md b/lib/node_modules/@stdlib/stats/base/smin/README.md index 7a0a791cf434..3b80cf479b79 100644 --- a/lib/node_modules/@stdlib/stats/base/smin/README.md +++ b/lib/node_modules/@stdlib/stats/base/smin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smin = require( '@stdlib/stats/base/smin' ); +const smin = require( '@stdlib/stats/base/smin' ); ``` #### smin( N, x, stride ) @@ -41,12 +41,12 @@ var smin = require( '@stdlib/stats/base/smin' ); Computes the minimum value of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smin( N, x, 1 ); +const v = smin( N, x, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = smin( N, x, 2 ); +const v = smin( N, x, 2 ); // returns -2.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smin( N, x1, 2 ); +const v = smin( N, x1, 2 ); // returns -2.0 ``` @@ -91,12 +91,12 @@ var v = smin( N, x1, 2 ); Computes the minimum value of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = smin.ndarray( N, x, 1, 0 ); +const v = smin.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = smin.ndarray( N, x, 2, 1 ); +const v = smin.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -138,21 +138,18 @@ var v = smin.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smin = require( '@stdlib/stats/base/smin' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smin = require( '@stdlib/stats/base/smin' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = smin( x.length, x, 1 ); +const v = smin( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sminabs/README.md b/lib/node_modules/@stdlib/stats/base/sminabs/README.md index ea1dc8151882..20ddcc581130 100644 --- a/lib/node_modules/@stdlib/stats/base/sminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/sminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sminabs = require( '@stdlib/stats/base/sminabs' ); +const sminabs = require( '@stdlib/stats/base/sminabs' ); ``` #### sminabs( N, x, stride ) @@ -41,12 +41,12 @@ var sminabs = require( '@stdlib/stats/base/sminabs' ); Computes the minimum absolute value of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sminabs( N, x, 1 ); +const v = sminabs( N, x, 1 ); // returns 1.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sminabs( N, x, 2 ); +const v = sminabs( N, x, 2 ); // returns 1.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sminabs( N, x1, 2 ); +const v = sminabs( N, x1, 2 ); // returns 1.0 ``` @@ -91,12 +91,12 @@ var v = sminabs( N, x1, 2 ); Computes the minimum absolute value of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sminabs.ndarray( N, x, 1, 0 ); +const v = sminabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sminabs.ndarray( N, x, 2, 1 ); +const v = sminabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,21 +138,18 @@ var v = sminabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sminabs = require( '@stdlib/stats/base/sminabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sminabs = require( '@stdlib/stats/base/sminabs' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sminabs( x.length, x, 1 ); +const v = sminabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sminsorted/README.md b/lib/node_modules/@stdlib/stats/base/sminsorted/README.md index 2d988bb3a57e..e1c6f1899987 100644 --- a/lib/node_modules/@stdlib/stats/base/sminsorted/README.md +++ b/lib/node_modules/@stdlib/stats/base/sminsorted/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var sminsorted = require( '@stdlib/stats/base/sminsorted' ); +const sminsorted = require( '@stdlib/stats/base/sminsorted' ); ``` #### sminsorted( N, x, stride ) @@ -41,12 +41,12 @@ var sminsorted = require( '@stdlib/stats/base/sminsorted' ); Computes the minimum value of a sorted single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +let x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +let N = x.length; -var v = sminsorted( N, x, 1 ); +let v = sminsorted( N, x, 1 ); // returns 1.0 x = new Float32Array( [ 3.0, 2.0, 1.0 ] ); @@ -65,13 +65,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, 3.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sminsorted( N, x, 2 ); +const v = sminsorted( N, x, 2 ); // returns 1.0 ``` @@ -80,15 +80,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sminsorted( N, x1, 2 ); +const v = sminsorted( N, x1, 2 ); // returns 1.0 ``` @@ -97,12 +97,12 @@ var v = sminsorted( N, x1, 2 ); Computes the minimum value of a sorted single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +const N = x.length; -var v = sminsorted.ndarray( N, x, 1, 0 ); +const v = sminsorted.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -113,13 +113,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, 2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sminsorted.ndarray( N, x, 2, 1 ); +const v = sminsorted.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -145,19 +145,16 @@ var v = sminsorted.ndarray( N, x, 2, 1 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var sminsorted = require( '@stdlib/stats/base/sminsorted' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sminsorted = require( '@stdlib/stats/base/sminsorted' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i - 5.0; } console.log( x ); -var v = sminsorted( x.length, x, 1 ); +const v = sminsorted( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smskmax/README.md b/lib/node_modules/@stdlib/stats/base/smskmax/README.md index e2ad2ab9bbfa..43c1998b175b 100644 --- a/lib/node_modules/@stdlib/stats/base/smskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/smskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskmax = require( '@stdlib/stats/base/smskmax' ); +const smskmax = require( '@stdlib/stats/base/smskmax' ); ``` #### smskmax( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var smskmax = require( '@stdlib/stats/base/smskmax' ); Computes the maximum value of a single-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskmax( x.length, x, 1, mask, 1 ); +const v = smskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskmax( N, x, 2, mask, 2 ); +const v = smskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smskmax( N, x1, 2, mask1, 2 ); +const v = smskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -100,13 +100,13 @@ var v = smskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a single-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = smskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = smskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -151,19 +151,15 @@ var v = smskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskmax = require( '@stdlib/stats/base/smskmax' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskmax = require( '@stdlib/stats/base/smskmax' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -174,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = smskmax( x.length, x, 1, mask, 1 ); +const v = smskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smskmin/README.md b/lib/node_modules/@stdlib/stats/base/smskmin/README.md index 438ef08759dd..eb63689d8b96 100644 --- a/lib/node_modules/@stdlib/stats/base/smskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/smskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smskmin = require( '@stdlib/stats/base/smskmin' ); +const smskmin = require( '@stdlib/stats/base/smskmin' ); ``` #### smskmin( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var smskmin = require( '@stdlib/stats/base/smskmin' ); Computes the minimum value of a single-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskmin( x.length, x, 1, mask, 1 ); +const v = smskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskmin( N, x, 2, mask, 2 ); +const v = smskmin( N, x, 2, mask, 2 ); // returns -4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smskmin( N, x1, 2, mask1, 2 ); +const v = smskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -100,13 +100,13 @@ var v = smskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a single-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = smskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = smskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -151,19 +151,15 @@ var v = smskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskmin = require( '@stdlib/stats/base/smskmin' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskmin = require( '@stdlib/stats/base/smskmin' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -174,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = smskmin( x.length, x, 1, mask, 1 ); +const v = smskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/smskrange/README.md b/lib/node_modules/@stdlib/stats/base/smskrange/README.md index b2816e520d9c..3de7482f1f68 100644 --- a/lib/node_modules/@stdlib/stats/base/smskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/smskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var smskrange = require( '@stdlib/stats/base/smskrange' ); +const smskrange = require( '@stdlib/stats/base/smskrange' ); ``` #### smskrange( N, x, strideX, mask, strideMask ) @@ -43,13 +43,13 @@ var smskrange = require( '@stdlib/stats/base/smskrange' ); Computes the [range][range] of a single-precision floating-point strided array `x` according to a `mask`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskrange( x.length, x, 1, mask, 1 ); +const v = smskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -64,15 +64,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskrange( N, x, 2, mask, 2 ); +const v = smskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -81,19 +81,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = smskrange( N, x1, 2, mask1, 2 ); +const v = smskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -102,13 +102,13 @@ var v = smskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a single-precision floating-point strided array according to a `mask` and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0 ] ); -var v = smskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = smskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -120,15 +120,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = smskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = smskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -153,19 +153,15 @@ var v = smskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskrange = require( '@stdlib/stats/base/smskrange' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskrange = require( '@stdlib/stats/base/smskrange' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -176,7 +172,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = smskrange( x.length, x, 1, mask, 1 ); +const v = smskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmax/README.md b/lib/node_modules/@stdlib/stats/base/snanmax/README.md index 4ed4c34a9261..393101652a72 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanmax = require( '@stdlib/stats/base/snanmax' ); +const snanmax = require( '@stdlib/stats/base/snanmax' ); ``` #### snanmax( N, x, stride ) @@ -41,12 +41,12 @@ var snanmax = require( '@stdlib/stats/base/snanmax' ); Computes the maximum value of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmax( N, x, 1 ); +const v = snanmax( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmax( N, x, 2 ); +const v = snanmax( N, x, 2 ); // returns 4.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmax( N, x1, 2 ); +const v = snanmax( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = snanmax( N, x1, 2 ); Computes the maximum value of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmax.ndarray( N, x, 1, 0 ); +const v = snanmax.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmax.ndarray( N, x, 2, 1 ); +const v = snanmax.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,16 +138,13 @@ var v = snanmax.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmax = require( '@stdlib/stats/base/snanmax' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmax = require( '@stdlib/stats/base/snanmax' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmax( x.length, x, 1 ); +const v = snanmax( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmaxabs/README.md b/lib/node_modules/@stdlib/stats/base/snanmaxabs/README.md index e8603c5fca80..fb6d142febd4 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmaxabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanmaxabs = require( '@stdlib/stats/base/snanmaxabs' ); +const snanmaxabs = require( '@stdlib/stats/base/snanmaxabs' ); ``` #### snanmaxabs( N, x, stride ) @@ -41,12 +41,12 @@ var snanmaxabs = require( '@stdlib/stats/base/snanmaxabs' ); Computes the maximum absolute value of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmaxabs( N, x, 1 ); +const v = snanmaxabs( N, x, 1 ); // returns 2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the maximum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmaxabs( N, x, 2 ); +const v = snanmaxabs( N, x, 2 ); // returns 7.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmaxabs( N, x1, 2 ); +const v = snanmaxabs( N, x1, 2 ); // returns 4.0 ``` @@ -91,12 +91,12 @@ var v = snanmaxabs( N, x1, 2 ); Computes the maximum absolute value of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmaxabs.ndarray( N, x, 1, 0 ); +const v = snanmaxabs.ndarray( N, x, 1, 0 ); // returns 2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum absolute value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmaxabs.ndarray( N, x, 2, 1 ); +const v = snanmaxabs.ndarray( N, x, 2, 1 ); // returns 4.0 ``` @@ -138,16 +138,13 @@ var v = snanmaxabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmaxabs = require( '@stdlib/stats/base/snanmaxabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmaxabs = require( '@stdlib/stats/base/snanmaxabs' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmaxabs( x.length, x, 1 ); +const v = snanmaxabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmean/README.md b/lib/node_modules/@stdlib/stats/base/snanmean/README.md index bcff56d4ee58..5317616b6826 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmean/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var snanmean = require( '@stdlib/stats/base/snanmean' ); +const snanmean = require( '@stdlib/stats/base/snanmean' ); ``` #### snanmean( N, x, stride ) @@ -56,12 +56,12 @@ var snanmean = require( '@stdlib/stats/base/snanmean' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmean( N, x, 1 ); +const v = snanmean( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmean( N, x, 2 ); +const v = snanmean( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmean( N, x1, 2 ); +const v = snanmean( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = snanmean( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmean.ndarray( N, x, 1, 0 ); +const v = snanmean.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmean.ndarray( N, x, 2, 1 ); +const v = snanmean.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = snanmean.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmean = require( '@stdlib/stats/base/snanmean' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmean = require( '@stdlib/stats/base/snanmean' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmean( x.length, x, 1 ); +const v = snanmean( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmeanors/README.md b/lib/node_modules/@stdlib/stats/base/snanmeanors/README.md index fcb3edbeca24..eb90e49a9be3 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmeanors/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmeanors/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var snanmeanors = require( '@stdlib/stats/base/snanmeanors' ); +const snanmeanors = require( '@stdlib/stats/base/snanmeanors' ); ``` #### snanmeanors( N, x, stride ) @@ -56,12 +56,12 @@ var snanmeanors = require( '@stdlib/stats/base/snanmeanors' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using ordinary recursive summation. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanors( N, x, 1 ); +const v = snanmeanors( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanors( N, x, 2 ); +const v = snanmeanors( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmeanors( N, x1, 2 ); +const v = snanmeanors( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = snanmeanors( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanors.ndarray( N, x, 1, 0 ); +const v = snanmeanors.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanors.ndarray( N, x, 2, 1 ); +const v = snanmeanors.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -155,16 +155,13 @@ var v = snanmeanors.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmeanors = require( '@stdlib/stats/base/snanmeanors' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmeanors = require( '@stdlib/stats/base/snanmeanors' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -173,7 +170,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmeanors( x.length, x, 1 ); +const v = snanmeanors( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmeanpn/README.md b/lib/node_modules/@stdlib/stats/base/snanmeanpn/README.md index a99794c0331f..15db12c84422 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmeanpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmeanpn/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' ); +const snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' ); ``` #### snanmeanpn( N, x, stride ) @@ -56,12 +56,12 @@ var snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using a two-pass error correction algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanpn( N, x, 1 ); +const v = snanmeanpn( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanpn( N, x, 2 ); +const v = snanmeanpn( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmeanpn( N, x1, 2 ); +const v = snanmeanpn( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = snanmeanpn( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using a two-pass error correction algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanpn.ndarray( N, x, 1, 0 ); +const v = snanmeanpn.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanpn.ndarray( N, x, 2, 1 ); +const v = snanmeanpn.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = snanmeanpn.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmeanpn = require( '@stdlib/stats/base/snanmeanpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmeanpn( x.length, x, 1 ); +const v = snanmeanpn( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmeanwd/README.md b/lib/node_modules/@stdlib/stats/base/snanmeanwd/README.md index 0ba6cc043fab..c32ac0f9a200 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmeanwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmeanwd/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' ); +const snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' ); ``` #### snanmeanwd( N, x, stride ) @@ -56,12 +56,12 @@ var snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanwd( N, x, 1 ); +const v = snanmeanwd( N, x, 1 ); // returns ~0.3333 ``` @@ -74,13 +74,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanwd( N, x, 2 ); +const v = snanmeanwd( N, x, 2 ); // returns 1.25 ``` @@ -89,15 +89,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmeanwd( N, x1, 2 ); +const v = snanmeanwd( N, x1, 2 ); // returns 1.25 ``` @@ -106,12 +106,12 @@ var v = snanmeanwd( N, x1, 2 ); Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmeanwd.ndarray( N, x, 1, 0 ); +const v = snanmeanwd.ndarray( N, x, 1, 0 ); // returns ~0.33333 ``` @@ -122,13 +122,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmeanwd.ndarray( N, x, 2, 1 ); +const v = snanmeanwd.ndarray( N, x, 2, 1 ); // returns 1.25 ``` @@ -154,16 +154,13 @@ var v = snanmeanwd.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -172,7 +169,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmeanwd( x.length, x, 1 ); +const v = snanmeanwd( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmin/README.md b/lib/node_modules/@stdlib/stats/base/snanmin/README.md index f131ddc5f25b..b97f14bc7890 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanmin = require( '@stdlib/stats/base/snanmin' ); +const snanmin = require( '@stdlib/stats/base/snanmin' ); ``` #### snanmin( N, x, stride ) @@ -41,12 +41,12 @@ var snanmin = require( '@stdlib/stats/base/snanmin' ); Computes the minimum value of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmin( N, x, 1 ); +const v = snanmin( N, x, 1 ); // returns -2.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmin( N, x, 2 ); +const v = snanmin( N, x, 2 ); // returns -7.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmin( N, x1, 2 ); +const v = snanmin( N, x1, 2 ); // returns -2.0 ``` @@ -91,12 +91,12 @@ var v = snanmin( N, x1, 2 ); Computes the minimum value of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanmin.ndarray( N, x, 1, 0 ); +const v = snanmin.ndarray( N, x, 1, 0 ); // returns -2.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanmin.ndarray( N, x, 2, 1 ); +const v = snanmin.ndarray( N, x, 2, 1 ); // returns -2.0 ``` @@ -138,16 +138,13 @@ var v = snanmin.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanmin = require( '@stdlib/stats/base/snanmin' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanmin = require( '@stdlib/stats/base/snanmin' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanmin( x.length, x, 1 ); +const v = snanmin( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanminabs/README.md b/lib/node_modules/@stdlib/stats/base/snanminabs/README.md index ffff7026c2fe..0e0444bd100e 100644 --- a/lib/node_modules/@stdlib/stats/base/snanminabs/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanminabs/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanminabs = require( '@stdlib/stats/base/snanminabs' ); +const snanminabs = require( '@stdlib/stats/base/snanminabs' ); ``` #### snanminabs( N, x, stride ) @@ -41,12 +41,12 @@ var snanminabs = require( '@stdlib/stats/base/snanminabs' ); Computes the minimum absolute value of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanminabs( N, x, 1 ); +const v = snanminabs( N, x, 1 ); // returns 1.0 ``` @@ -59,13 +59,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanminabs( N, x, 2 ); +const v = snanminabs( N, x, 2 ); // returns 1.0 ``` @@ -74,15 +74,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanminabs( N, x1, 2 ); +const v = snanminabs( N, x1, 2 ); // returns 1.0 ``` @@ -91,12 +91,12 @@ var v = snanminabs( N, x1, 2 ); Computes the minimum absolute value of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanminabs.ndarray( N, x, 1, 0 ); +const v = snanminabs.ndarray( N, x, 1, 0 ); // returns 1.0 ``` @@ -107,13 +107,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanminabs.ndarray( N, x, 2, 1 ); +const v = snanminabs.ndarray( N, x, 2, 1 ); // returns 1.0 ``` @@ -138,16 +138,13 @@ var v = snanminabs.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanminabs = require( '@stdlib/stats/base/snanminabs' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanminabs = require( '@stdlib/stats/base/snanminabs' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -156,7 +153,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanminabs( x.length, x, 1 ); +const v = snanminabs( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmskmax/README.md b/lib/node_modules/@stdlib/stats/base/snanmskmax/README.md index a087f6ae1a82..834cc5d93661 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmskmax/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmskmax/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanmskmax = require( '@stdlib/stats/base/snanmskmax' ); +const snanmskmax = require( '@stdlib/stats/base/snanmskmax' ); ``` #### snanmskmax( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var snanmskmax = require( '@stdlib/stats/base/snanmskmax' ); Computes the maximum value of a single-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskmax( x.length, x, 1, mask, 1 ); +const v = snanmskmax( x.length, x, 1, mask, 1 ); // returns 2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the maximum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskmax( N, x, 2, mask, 2 ); +const v = snanmskmax( N, x, 2, mask, 2 ); // returns 4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmskmax( N, x1, 2, mask1, 2 ); +const v = snanmskmax( N, x1, 2, mask1, 2 ); // returns 4.0 ``` @@ -100,13 +100,13 @@ var v = snanmskmax( N, x1, 2, mask1, 2 ); Computes the maximum value of a single-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = snanmskmax.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the maximum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = snanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 4.0 ``` @@ -151,19 +151,15 @@ var v = snanmskmax.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var snanmskmax = require( '@stdlib/stats/base/snanmskmax' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const snanmskmax = require( '@stdlib/stats/base/snanmskmax' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -178,7 +174,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = snanmskmax( x.length, x, 1, mask, 1 ); +const v = snanmskmax( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmskmin/README.md b/lib/node_modules/@stdlib/stats/base/snanmskmin/README.md index bcf06184f6ac..ce866204cd4b 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmskmin/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmskmin/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var snanmskmin = require( '@stdlib/stats/base/snanmskmin' ); +const snanmskmin = require( '@stdlib/stats/base/snanmskmin' ); ``` #### snanmskmin( N, x, strideX, mask, strideMask ) @@ -41,13 +41,13 @@ var snanmskmin = require( '@stdlib/stats/base/snanmskmin' ); Computes the minimum value of a single-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskmin( x.length, x, 1, mask, 1 ); +const v = snanmskmin( x.length, x, 1, mask, 1 ); // returns -2.0 ``` @@ -62,15 +62,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 7.0, -2.0, -4.0, 3.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskmin( N, x, 2, mask, 2 ); +const v = snanmskmin( N, x, 2, mask, 2 ); // returns -4.0 ``` @@ -79,19 +79,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmskmin( N, x1, 2, mask1, 2 ); +const v = snanmskmin( N, x1, 2, mask1, 2 ); // returns -2.0 ``` @@ -100,13 +100,13 @@ var v = snanmskmin( N, x1, 2, mask1, 2 ); Computes the minimum value of a single-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, -4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = snanmskmin.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns -2.0 ``` @@ -118,15 +118,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = snanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns -2.0 ``` @@ -151,19 +151,15 @@ var v = snanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var snanmskmin = require( '@stdlib/stats/base/snanmskmin' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const snanmskmin = require( '@stdlib/stats/base/snanmskmin' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -178,7 +174,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = snanmskmin( x.length, x, 1, mask, 1 ); +const v = snanmskmin( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanmskrange/README.md b/lib/node_modules/@stdlib/stats/base/snanmskrange/README.md index 3848856a06b0..9065f7baacea 100644 --- a/lib/node_modules/@stdlib/stats/base/snanmskrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanmskrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var snanmskrange = require( '@stdlib/stats/base/snanmskrange' ); +const snanmskrange = require( '@stdlib/stats/base/snanmskrange' ); ``` #### snanmskrange( N, x, strideX, mask, strideMask ) @@ -43,13 +43,13 @@ var snanmskrange = require( '@stdlib/stats/base/snanmskrange' ); Computes the [range][range] of a single-precision floating-point strided array `x` according to a `mask`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskrange( x.length, x, 1, mask, 1 ); +const v = snanmskrange( x.length, x, 1, mask, 1 ); // returns 4.0 ``` @@ -64,15 +64,15 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskrange( N, x, 2, mask, 2 ); +const v = snanmskrange( N, x, 2, mask, 2 ); // returns 11.0 ``` @@ -81,19 +81,19 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const mask0 = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const mask1 = new Uint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanmskrange( N, x1, 2, mask1, 2 ); +const v = snanmskrange( N, x1, 2, mask1, 2 ); // returns 6.0 ``` @@ -102,13 +102,13 @@ var v = snanmskrange( N, x1, 2, mask1, 2 ); Computes the [range][range] of a single-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); -var x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ 1.0, -2.0, 4.0, 2.0, NaN ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var v = snanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); +const v = snanmskrange.ndarray( x.length, x, 1, 0, mask, 1, 0 ); // returns 4.0 ``` @@ -120,15 +120,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 0, 0, 0, 1, 1 ] ); +const N = floor( x.length / 2 ); -var v = snanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); +const v = snanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); // returns 6.0 ``` @@ -153,19 +153,15 @@ var v = snanmskrange.ndarray( N, x, 2, 1, mask, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var snanmskrange = require( '@stdlib/stats/base/snanmskrange' ); - -var mask; -var x; -var i; - -x = new Float32Array( 10 ); -mask = new Uint8Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const snanmskrange = require( '@stdlib/stats/base/snanmskrange' ); + +const x = new Float32Array( 10 ); +const mask = new Uint8Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { mask[ i ] = 1; } else { @@ -180,7 +176,7 @@ for ( i = 0; i < x.length; i++ ) { console.log( x ); console.log( mask ); -var v = snanmskrange( x.length, x, 1, mask, 1 ); +const v = snanmskrange( x.length, x, 1, mask, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanrange/README.md b/lib/node_modules/@stdlib/stats/base/snanrange/README.md index 49bcea44fa9b..dacf2566376b 100644 --- a/lib/node_modules/@stdlib/stats/base/snanrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var snanrange = require( '@stdlib/stats/base/snanrange' ); +const snanrange = require( '@stdlib/stats/base/snanrange' ); ``` #### snanrange( N, x, stride ) @@ -43,12 +43,12 @@ var snanrange = require( '@stdlib/stats/base/snanrange' ); Computes the [range][range] of a single-precision floating-point strided array `x`, ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanrange( N, x, 1 ); +const v = snanrange( N, x, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanrange( N, x, 2 ); +const v = snanrange( N, x, 2 ); // returns 11.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanrange( N, x1, 2 ); +const v = snanrange( N, x1, 2 ); // returns 6.0 ``` @@ -93,12 +93,12 @@ var v = snanrange( N, x1, 2 ); Computes the [range][range] of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const N = x.length; -var v = snanrange.ndarray( N, x, 1, 0 ); +const v = snanrange.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanrange.ndarray( N, x, 2, 1 ); +const v = snanrange.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -140,16 +140,13 @@ var v = snanrange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanrange = require( '@stdlib/stats/base/snanrange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanrange = require( '@stdlib/stats/base/snanrange' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { if ( randu() < 0.2 ) { x[ i ] = NaN; } else { @@ -158,7 +155,7 @@ for ( i = 0; i < x.length; i++ ) { } console.log( x ); -var v = snanrange( x.length, x, 1 ); +const v = snanrange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdev/README.md b/lib/node_modules/@stdlib/stats/base/snanstdev/README.md index be2fd408d6c0..e8f5506e8369 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdev = require( '@stdlib/stats/base/snanstdev' ); +const snanstdev = require( '@stdlib/stats/base/snanstdev' ); ``` #### snanstdev( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdev = require( '@stdlib/stats/base/snanstdev' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdev( x.length, 1, x, 1 ); +const v = snanstdev( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdev( N, 1, x, 2 ); +const v = snanstdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdev( N, 1, x1, 2 ); +const v = snanstdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdev.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdev.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdev.ndarray( N, 1, x, 2, 1 ); +const v = snanstdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = snanstdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdev = require( '@stdlib/stats/base/snanstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdev = require( '@stdlib/stats/base/snanstdev' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdev( x.length, 1, x, 1 ); +const v = snanstdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdevch/README.md b/lib/node_modules/@stdlib/stats/base/snanstdevch/README.md index cffeee917341..584821f88937 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdevch = require( '@stdlib/stats/base/snanstdevch' ); +const snanstdevch = require( '@stdlib/stats/base/snanstdevch' ); ``` #### snanstdevch( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdevch = require( '@stdlib/stats/base/snanstdevch' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevch( x.length, 1, x, 1 ); +const v = snanstdevch( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdevch( N, 1, x, 2 ); +const v = snanstdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdevch( N, 1, x1, 2 ); +const v = snanstdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevch.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdevch.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdevch.ndarray( N, 1, x, 2, 1 ); +const v = snanstdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -201,21 +201,18 @@ var v = snanstdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdevch = require( '@stdlib/stats/base/snanstdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdevch = require( '@stdlib/stats/base/snanstdevch' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdevch( x.length, 1, x, 1 ); +const v = snanstdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/snanstdevpn/README.md index 490a7b3456df..9f7901eab131 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdevpn = require( '@stdlib/stats/base/snanstdevpn' ); +const snanstdevpn = require( '@stdlib/stats/base/snanstdevpn' ); ``` #### snanstdevpn( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdevpn = require( '@stdlib/stats/base/snanstdevpn' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevpn( x.length, 1, x, 1 ); +const v = snanstdevpn( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdevpn( N, 1, x, 2 ); +const v = snanstdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdevpn( N, 1, x1, 2 ); +const v = snanstdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevpn.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdevpn.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdevpn.ndarray( N, 1, x, 2, 1 ); +const v = snanstdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = snanstdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdevpn = require( '@stdlib/stats/base/snanstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdevpn = require( '@stdlib/stats/base/snanstdevpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdevpn( x.length, 1, x, 1 ); +const v = snanstdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdevtk/README.md b/lib/node_modules/@stdlib/stats/base/snanstdevtk/README.md index 4a8229b743f2..50040ce5211b 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdevtk = require( '@stdlib/stats/base/snanstdevtk' ); +const snanstdevtk = require( '@stdlib/stats/base/snanstdevtk' ); ``` #### snanstdevtk( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdevtk = require( '@stdlib/stats/base/snanstdevtk' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevtk( x.length, 1, x, 1 ); +const v = snanstdevtk( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdevtk( N, 1, x, 2 ); +const v = snanstdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdevtk( N, 1, x1, 2 ); +const v = snanstdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevtk.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdevtk.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdevtk.ndarray( N, 1, x, 2, 1 ); +const v = snanstdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -201,21 +201,18 @@ var v = snanstdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdevtk = require( '@stdlib/stats/base/snanstdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdevtk = require( '@stdlib/stats/base/snanstdevtk' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdevtk( x.length, 1, x, 1 ); +const v = snanstdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/snanstdevwd/README.md index 15b39df6f55b..5e7905a03d8f 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdevwd = require( '@stdlib/stats/base/snanstdevwd' ); +const snanstdevwd = require( '@stdlib/stats/base/snanstdevwd' ); ``` #### snanstdevwd( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdevwd = require( '@stdlib/stats/base/snanstdevwd' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevwd( x.length, 1, x, 1 ); +const v = snanstdevwd( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdevwd( N, 1, x, 2 ); +const v = snanstdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdevwd( N, 1, x1, 2 ); +const v = snanstdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevwd.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdevwd.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdevwd.ndarray( N, 1, x, 2, 1 ); +const v = snanstdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = snanstdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdevwd = require( '@stdlib/stats/base/snanstdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdevwd = require( '@stdlib/stats/base/snanstdevwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdevwd( x.length, 1, x, 1 ); +const v = snanstdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanstdevyc/README.md b/lib/node_modules/@stdlib/stats/base/snanstdevyc/README.md index 358b8299fcff..424da0c56e11 100644 --- a/lib/node_modules/@stdlib/stats/base/snanstdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanstdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanstdevyc = require( '@stdlib/stats/base/snanstdevyc' ); +const snanstdevyc = require( '@stdlib/stats/base/snanstdevyc' ); ``` #### snanstdevyc( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanstdevyc = require( '@stdlib/stats/base/snanstdevyc' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevyc( x.length, 1, x, 1 ); +const v = snanstdevyc( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanstdevyc( N, 1, x, 2 ); +const v = snanstdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanstdevyc( N, 1, x1, 2 ); +const v = snanstdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -153,11 +153,11 @@ var v = snanstdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanstdevyc.ndarray( x.length, 1, x, 1, 0 ); +const v = snanstdevyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanstdevyc.ndarray( N, 1, x, 2, 1 ); +const v = snanstdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -200,21 +200,18 @@ var v = snanstdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanstdevyc = require( '@stdlib/stats/base/snanstdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanstdevyc = require( '@stdlib/stats/base/snanstdevyc' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanstdevyc( x.length, 1, x, 1 ); +const v = snanstdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvariance/README.md b/lib/node_modules/@stdlib/stats/base/snanvariance/README.md index 3e152a17494c..b563d75ba7ad 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvariance = require( '@stdlib/stats/base/snanvariance' ); +const snanvariance = require( '@stdlib/stats/base/snanvariance' ); ``` #### snanvariance( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvariance = require( '@stdlib/stats/base/snanvariance' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariance( x.length, 1, x, 1 ); +const v = snanvariance( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvariance( N, 1, x, 2 ); +const v = snanvariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvariance( N, 1, x1, 2 ); +const v = snanvariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvariance( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariance.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvariance.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvariance.ndarray( N, 1, x, 2, 1 ); +const v = snanvariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = snanvariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvariance = require( '@stdlib/stats/base/snanvariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvariance = require( '@stdlib/stats/base/snanvariance' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvariance( x.length, 1, x, 1 ); +const v = snanvariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvariancech/README.md b/lib/node_modules/@stdlib/stats/base/snanvariancech/README.md index ddfb129489e7..35e6e50ce09f 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvariancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvariancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvariancech = require( '@stdlib/stats/base/snanvariancech' ); +const snanvariancech = require( '@stdlib/stats/base/snanvariancech' ); ``` #### snanvariancech( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvariancech = require( '@stdlib/stats/base/snanvariancech' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass trial mean algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancech( x.length, 1, x, 1 ); +const v = snanvariancech( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvariancech( N, 1, x, 2 ); +const v = snanvariancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvariancech( N, 1, x1, 2 ); +const v = snanvariancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvariancech( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancech.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvariancech.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvariancech.ndarray( N, 1, x, 2, 1 ); +const v = snanvariancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = snanvariancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvariancech = require( '@stdlib/stats/base/snanvariancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvariancech = require( '@stdlib/stats/base/snanvariancech' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvariancech( x.length, 1, x, 1 ); +const v = snanvariancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvariancepn/README.md b/lib/node_modules/@stdlib/stats/base/snanvariancepn/README.md index 5dc2b610a058..91491461c508 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvariancepn = require( '@stdlib/stats/base/snanvariancepn' ); +const snanvariancepn = require( '@stdlib/stats/base/snanvariancepn' ); ``` #### snanvariancepn( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvariancepn = require( '@stdlib/stats/base/snanvariancepn' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a two-pass algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancepn( x.length, 1, x, 1 ); +const v = snanvariancepn( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvariancepn( N, 1, x, 2 ); +const v = snanvariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvariancepn( N, 1, x1, 2 ); +const v = snanvariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancepn.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvariancepn.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvariancepn.ndarray( N, 1, x, 2, 1 ); +const v = snanvariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = snanvariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvariancepn = require( '@stdlib/stats/base/snanvariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvariancepn = require( '@stdlib/stats/base/snanvariancepn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvariancepn( x.length, 1, x, 1 ); +const v = snanvariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvariancetk/README.md b/lib/node_modules/@stdlib/stats/base/snanvariancetk/README.md index 1a6d06d92acb..94f0da36ea8f 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvariancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvariancetk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvariancetk = require( '@stdlib/stats/base/snanvariancetk' ); +const snanvariancetk = require( '@stdlib/stats/base/snanvariancetk' ); ``` #### snanvariancetk( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvariancetk = require( '@stdlib/stats/base/snanvariancetk' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass textbook algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancetk( x.length, 1, x, 1 ); +const v = snanvariancetk( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvariancetk( N, 1, x, 2 ); +const v = snanvariancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvariancetk( N, 1, x1, 2 ); +const v = snanvariancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvariancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancetk.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvariancetk.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvariancetk.ndarray( N, 1, x, 2, 1 ); +const v = snanvariancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -201,21 +201,18 @@ var v = snanvariancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvariancetk = require( '@stdlib/stats/base/snanvariancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvariancetk = require( '@stdlib/stats/base/snanvariancetk' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvariancetk( x.length, 1, x, 1 ); +const v = snanvariancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvariancewd/README.md b/lib/node_modules/@stdlib/stats/base/snanvariancewd/README.md index 3bfb237d57e9..5c34cfe14543 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvariancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvariancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvariancewd = require( '@stdlib/stats/base/snanvariancewd' ); +const snanvariancewd = require( '@stdlib/stats/base/snanvariancewd' ); ``` #### snanvariancewd( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvariancewd = require( '@stdlib/stats/base/snanvariancewd' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values and using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancewd( x.length, 1, x, 1 ); +const v = snanvariancewd( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvariancewd( N, 1, x, 2 ); +const v = snanvariancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvariancewd( N, 1, x1, 2 ); +const v = snanvariancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvariancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvariancewd.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvariancewd.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvariancewd.ndarray( N, 1, x, 2, 1 ); +const v = snanvariancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = snanvariancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvariancewd = require( '@stdlib/stats/base/snanvariancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvariancewd = require( '@stdlib/stats/base/snanvariancewd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvariancewd( x.length, 1, x, 1 ); +const v = snanvariancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/snanvarianceyc/README.md b/lib/node_modules/@stdlib/stats/base/snanvarianceyc/README.md index b7ce9c93311b..ab9d9213343d 100644 --- a/lib/node_modules/@stdlib/stats/base/snanvarianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/snanvarianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var snanvarianceyc = require( '@stdlib/stats/base/snanvarianceyc' ); +const snanvarianceyc = require( '@stdlib/stats/base/snanvarianceyc' ); ``` #### snanvarianceyc( N, correction, x, stride ) @@ -103,11 +103,11 @@ var snanvarianceyc = require( '@stdlib/stats/base/snanvarianceyc' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvarianceyc( x.length, 1, x, 1 ); +const v = snanvarianceyc( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -121,13 +121,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] ); +const N = floor( x.length / 2 ); -var v = snanvarianceyc( N, 1, x, 2 ); +const v = snanvarianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -136,15 +136,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = snanvarianceyc( N, 1, x1, 2 ); +const v = snanvarianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -153,11 +153,11 @@ var v = snanvarianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array ignoring `NaN` values and using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); +const x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = snanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); +const v = snanvarianceyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -168,13 +168,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = snanvarianceyc.ndarray( N, 1, x, 2, 1 ); +const v = snanvarianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -200,21 +200,18 @@ var v = snanvarianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var snanvarianceyc = require( '@stdlib/stats/base/snanvarianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const snanvarianceyc = require( '@stdlib/stats/base/snanvarianceyc' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = snanvarianceyc( x.length, 1, x, 1 ); +const v = snanvarianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/srange/README.md b/lib/node_modules/@stdlib/stats/base/srange/README.md index e1195421ba39..e2ca55105881 100644 --- a/lib/node_modules/@stdlib/stats/base/srange/README.md +++ b/lib/node_modules/@stdlib/stats/base/srange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var srange = require( '@stdlib/stats/base/srange' ); +const srange = require( '@stdlib/stats/base/srange' ); ``` #### srange( N, x, stride ) @@ -43,12 +43,12 @@ var srange = require( '@stdlib/stats/base/srange' ); Computes the [range][range] of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = srange( N, x, 1 ); +const v = srange( N, x, 1 ); // returns 4.0 ``` @@ -61,13 +61,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = srange( N, x, 2 ); +const v = srange( N, x, 2 ); // returns 6.0 ``` @@ -76,15 +76,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = srange( N, x1, 2 ); +const v = srange( N, x1, 2 ); // returns 6.0 ``` @@ -93,12 +93,12 @@ var v = srange( N, x1, 2 ); Computes the [range][range] of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = srange.ndarray( N, x, 1, 0 ); +const v = srange.ndarray( N, x, 1, 0 ); // returns 4.0 ``` @@ -109,13 +109,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = srange.ndarray( N, x, 2, 1 ); +const v = srange.ndarray( N, x, 2, 1 ); // returns 6.0 ``` @@ -140,21 +140,18 @@ var v = srange.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var srange = require( '@stdlib/stats/base/srange' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const srange = require( '@stdlib/stats/base/srange' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = srange( x.length, x, 1 ); +const v = srange( x.length, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdev/README.md b/lib/node_modules/@stdlib/stats/base/sstdev/README.md index 1c296336602c..3bb395b3adf6 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdev = require( '@stdlib/stats/base/sstdev' ); +const sstdev = require( '@stdlib/stats/base/sstdev' ); ``` #### sstdev( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdev = require( '@stdlib/stats/base/sstdev' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdev( N, 1, x, 1 ); +const v = sstdev( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdev( N, 1, x, 2 ); +const v = sstdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdev( N, 1, x1, 2 ); +const v = sstdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdev.ndarray( N, 1, x, 1, 0 ); +const v = sstdev.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdev.ndarray( N, 1, x, 2, 1 ); +const v = sstdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = sstdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdev = require( '@stdlib/stats/base/sstdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdev = require( '@stdlib/stats/base/sstdev' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdev( x.length, 1, x, 1 ); +const v = sstdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdevch/README.md b/lib/node_modules/@stdlib/stats/base/sstdevch/README.md index 24a8bf737b56..9fff09e17c3a 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdevch = require( '@stdlib/stats/base/sstdevch' ); +const sstdevch = require( '@stdlib/stats/base/sstdevch' ); ``` #### sstdevch( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdevch = require( '@stdlib/stats/base/sstdevch' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevch( N, 1, x, 1 ); +const v = sstdevch( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevch( N, 1, x, 2 ); +const v = sstdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdevch( N, 1, x1, 2 ); +const v = sstdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevch.ndarray( N, 1, x, 1, 0 ); +const v = sstdevch.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevch.ndarray( N, 1, x, 2, 1 ); +const v = sstdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -203,21 +203,18 @@ var v = sstdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdevch = require( '@stdlib/stats/base/sstdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdevch = require( '@stdlib/stats/base/sstdevch' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdevch( x.length, 1, x, 1 ); +const v = sstdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdevpn/README.md b/lib/node_modules/@stdlib/stats/base/sstdevpn/README.md index 30b5db737050..e1965f2e31fa 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdevpn = require( '@stdlib/stats/base/sstdevpn' ); +const sstdevpn = require( '@stdlib/stats/base/sstdevpn' ); ``` #### sstdevpn( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdevpn = require( '@stdlib/stats/base/sstdevpn' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevpn( N, 1, x, 1 ); +const v = sstdevpn( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevpn( N, 1, x, 2 ); +const v = sstdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdevpn( N, 1, x1, 2 ); +const v = sstdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevpn.ndarray( N, 1, x, 1, 0 ); +const v = sstdevpn.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevpn.ndarray( N, 1, x, 2, 1 ); +const v = sstdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = sstdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdevpn = require( '@stdlib/stats/base/sstdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdevpn = require( '@stdlib/stats/base/sstdevpn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdevpn( x.length, 1, x, 1 ); +const v = sstdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdevtk/README.md b/lib/node_modules/@stdlib/stats/base/sstdevtk/README.md index 86674e29aff4..b95cb04a2ea5 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdevtk = require( '@stdlib/stats/base/sstdevtk' ); +const sstdevtk = require( '@stdlib/stats/base/sstdevtk' ); ``` #### sstdevtk( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdevtk = require( '@stdlib/stats/base/sstdevtk' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` using a one-pass textbook algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevtk( N, 1, x, 1 ); +const v = sstdevtk( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevtk( N, 1, x, 2 ); +const v = sstdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdevtk( N, 1, x1, 2 ); +const v = sstdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevtk.ndarray( N, 1, x, 1, 0 ); +const v = sstdevtk.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevtk.ndarray( N, 1, x, 2, 1 ); +const v = sstdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -203,21 +203,18 @@ var v = sstdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdevtk = require( '@stdlib/stats/base/sstdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdevtk = require( '@stdlib/stats/base/sstdevtk' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdevtk( x.length, 1, x, 1 ); +const v = sstdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/sstdevwd/README.md index e7fbf8a54a40..918dbeb08894 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdevwd = require( '@stdlib/stats/base/sstdevwd' ); +const sstdevwd = require( '@stdlib/stats/base/sstdevwd' ); ``` #### sstdevwd( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdevwd = require( '@stdlib/stats/base/sstdevwd' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevwd( N, 1, x, 1 ); +const v = sstdevwd( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevwd( N, 1, x, 2 ); +const v = sstdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdevwd( N, 1, x1, 2 ); +const v = sstdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevwd.ndarray( N, 1, x, 1, 0 ); +const v = sstdevwd.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevwd.ndarray( N, 1, x, 2, 1 ); +const v = sstdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = sstdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdevwd = require( '@stdlib/stats/base/sstdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdevwd = require( '@stdlib/stats/base/sstdevwd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdevwd( x.length, 1, x, 1 ); +const v = sstdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/sstdevyc/README.md b/lib/node_modules/@stdlib/stats/base/sstdevyc/README.md index 5907eff1f536..d713ebe1341d 100644 --- a/lib/node_modules/@stdlib/stats/base/sstdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/sstdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var sstdevyc = require( '@stdlib/stats/base/sstdevyc' ); +const sstdevyc = require( '@stdlib/stats/base/sstdevyc' ); ``` #### sstdevyc( N, correction, x, stride ) @@ -103,12 +103,12 @@ var sstdevyc = require( '@stdlib/stats/base/sstdevyc' ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevyc( N, 1, x, 1 ); +const v = sstdevyc( N, 1, x, 1 ); // returns ~2.0817 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevyc( N, 1, x, 2 ); +const v = sstdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = sstdevyc( N, 1, x1, 2 ); +const v = sstdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -154,12 +154,12 @@ var v = sstdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = sstdevyc.ndarray( N, 1, x, 1, 0 ); +const v = sstdevyc.ndarray( N, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = sstdevyc.ndarray( N, 1, x, 2, 1 ); +const v = sstdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -202,21 +202,18 @@ var v = sstdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var sstdevyc = require( '@stdlib/stats/base/sstdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const sstdevyc = require( '@stdlib/stats/base/sstdevyc' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = sstdevyc( x.length, 1, x, 1 ); +const v = sstdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdev/README.md b/lib/node_modules/@stdlib/stats/base/stdev/README.md index 1ddf01b10995..0a6f31fbefd9 100644 --- a/lib/node_modules/@stdlib/stats/base/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdev/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdev = require( '@stdlib/stats/base/stdev' ); +const stdev = require( '@stdlib/stats/base/stdev' ); ``` #### stdev( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdev = require( '@stdlib/stats/base/stdev' ); Computes the [standard deviation][standard-deviation] of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdev( x.length, 1, x, 1 ); +const v = stdev( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdev( N, 1, x, 2 ); +const v = stdev( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdev( N, 1, x1, 2 ); +const v = stdev( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdev( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdev.ndarray( x.length, 1, x, 1, 0 ); +const v = stdev.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdev.ndarray( N, 1, x, 2, 1 ); +const v = stdev.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = stdev.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdev = require( '@stdlib/stats/base/stdev' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdev = require( '@stdlib/stats/base/stdev' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdev( x.length, 1, x, 1 ); +const v = stdev( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdevch/README.md b/lib/node_modules/@stdlib/stats/base/stdevch/README.md index ea75e4bdb1b4..b2a5ef6a9083 100644 --- a/lib/node_modules/@stdlib/stats/base/stdevch/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdevch/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdevch = require( '@stdlib/stats/base/stdevch' ); +const stdevch = require( '@stdlib/stats/base/stdevch' ); ``` #### stdevch( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdevch = require( '@stdlib/stats/base/stdevch' ); Computes the [standard deviation][standard-deviation] of a strided array `x` using a one-pass trial mean algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevch( x.length, 1, x, 1 ); +const v = stdevch( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdevch( N, 1, x, 2 ); +const v = stdevch( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdevch( N, 1, x1, 2 ); +const v = stdevch( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdevch( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevch.ndarray( x.length, 1, x, 1, 0 ); +const v = stdevch.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdevch.ndarray( N, 1, x, 2, 1 ); +const v = stdevch.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -196,21 +196,18 @@ var v = stdevch.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdevch = require( '@stdlib/stats/base/stdevch' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdevch = require( '@stdlib/stats/base/stdevch' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdevch( x.length, 1, x, 1 ); +const v = stdevch( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdevpn/README.md b/lib/node_modules/@stdlib/stats/base/stdevpn/README.md index c92973fb6e8c..2672ba389f6c 100644 --- a/lib/node_modules/@stdlib/stats/base/stdevpn/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdevpn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdevpn = require( '@stdlib/stats/base/stdevpn' ); +const stdevpn = require( '@stdlib/stats/base/stdevpn' ); ``` #### stdevpn( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdevpn = require( '@stdlib/stats/base/stdevpn' ); Computes the [standard deviation][standard-deviation] of a strided array `x` using a two-pass algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevpn( x.length, 1, x, 1 ); +const v = stdevpn( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdevpn( N, 1, x, 2 ); +const v = stdevpn( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdevpn( N, 1, x1, 2 ); +const v = stdevpn( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdevpn( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevpn.ndarray( x.length, 1, x, 1, 0 ); +const v = stdevpn.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdevpn.ndarray( N, 1, x, 2, 1 ); +const v = stdevpn.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = stdevpn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdevpn = require( '@stdlib/stats/base/stdevpn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdevpn = require( '@stdlib/stats/base/stdevpn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdevpn( x.length, 1, x, 1 ); +const v = stdevpn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdevtk/README.md b/lib/node_modules/@stdlib/stats/base/stdevtk/README.md index 927988055cd5..8a25e2bbdbf1 100644 --- a/lib/node_modules/@stdlib/stats/base/stdevtk/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdevtk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdevtk = require( '@stdlib/stats/base/stdevtk' ); +const stdevtk = require( '@stdlib/stats/base/stdevtk' ); ``` #### stdevtk( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdevtk = require( '@stdlib/stats/base/stdevtk' ); Computes the [standard deviation][standard-deviation] of a strided array `x` using a one-pass textbook algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevtk( x.length, 1, x, 1 ); +const v = stdevtk( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdevtk( N, 1, x, 2 ); +const v = stdevtk( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdevtk( N, 1, x1, 2 ); +const v = stdevtk( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdevtk( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevtk.ndarray( x.length, 1, x, 1, 0 ); +const v = stdevtk.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdevtk.ndarray( N, 1, x, 2, 1 ); +const v = stdevtk.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -196,21 +196,18 @@ var v = stdevtk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdevtk = require( '@stdlib/stats/base/stdevtk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdevtk = require( '@stdlib/stats/base/stdevtk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdevtk( x.length, 1, x, 1 ); +const v = stdevtk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdevwd/README.md b/lib/node_modules/@stdlib/stats/base/stdevwd/README.md index cf40262beb09..3f26cb230f8c 100644 --- a/lib/node_modules/@stdlib/stats/base/stdevwd/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdevwd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdevwd = require( '@stdlib/stats/base/stdevwd' ); +const stdevwd = require( '@stdlib/stats/base/stdevwd' ); ``` #### stdevwd( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdevwd = require( '@stdlib/stats/base/stdevwd' ); Computes the [standard deviation][standard-deviation] of a strided array `x` using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevwd( x.length, 1, x, 1 ); +const v = stdevwd( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdevwd( N, 1, x, 2 ); +const v = stdevwd( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdevwd( N, 1, x1, 2 ); +const v = stdevwd( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdevwd( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevwd.ndarray( x.length, 1, x, 1, 0 ); +const v = stdevwd.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdevwd.ndarray( N, 1, x, 2, 1 ); +const v = stdevwd.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = stdevwd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdevwd = require( '@stdlib/stats/base/stdevwd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdevwd = require( '@stdlib/stats/base/stdevwd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdevwd( x.length, 1, x, 1 ); +const v = stdevwd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/stdevyc/README.md b/lib/node_modules/@stdlib/stats/base/stdevyc/README.md index 2ddfad8004fa..5e55d4399434 100644 --- a/lib/node_modules/@stdlib/stats/base/stdevyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/stdevyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var stdevyc = require( '@stdlib/stats/base/stdevyc' ); +const stdevyc = require( '@stdlib/stats/base/stdevyc' ); ``` #### stdevyc( N, correction, x, stride ) @@ -103,9 +103,9 @@ var stdevyc = require( '@stdlib/stats/base/stdevyc' ); Computes the [standard deviation][standard-deviation] of a strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevyc( x.length, 1, x, 1 ); +const v = stdevyc( x.length, 1, x, 1 ); // returns ~2.0817 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = stdevyc( N, 1, x, 2 ); +const v = stdevyc( N, 1, x, 2 ); // returns 2.5 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = stdevyc( N, 1, x1, 2 ); +const v = stdevyc( N, 1, x1, 2 ); // returns 2.5 ``` @@ -150,9 +150,9 @@ var v = stdevyc( N, 1, x1, 2 ); Computes the [standard deviation][standard-deviation] of a strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = stdevyc.ndarray( x.length, 1, x, 1, 0 ); +const v = stdevyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~2.0817 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = stdevyc.ndarray( N, 1, x, 2, 1 ); +const v = stdevyc.ndarray( N, 1, x, 2, 1 ); // returns 2.5 ``` @@ -195,21 +195,18 @@ var v = stdevyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stdevyc = require( '@stdlib/stats/base/stdevyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stdevyc = require( '@stdlib/stats/base/stdevyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = stdevyc( x.length, 1, x, 1 ); +const v = stdevyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svariance/README.md b/lib/node_modules/@stdlib/stats/base/svariance/README.md index fa71a5a99ffc..991727450c1f 100644 --- a/lib/node_modules/@stdlib/stats/base/svariance/README.md +++ b/lib/node_modules/@stdlib/stats/base/svariance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svariance = require( '@stdlib/stats/base/svariance' ); +const svariance = require( '@stdlib/stats/base/svariance' ); ``` #### svariance( N, correction, x, stride ) @@ -103,12 +103,12 @@ var svariance = require( '@stdlib/stats/base/svariance' ); Computes the [variance][variance] of a single-precision floating-point strided array `x`. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariance( N, 1, x, 1 ); +const v = svariance( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svariance( N, 1, x, 2 ); +const v = svariance( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svariance( N, 1, x1, 2 ); +const v = svariance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = svariance( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariance.ndarray( N, 1, x, 1, 0 ); +const v = svariance.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svariance.ndarray( N, 1, x, 2, 1 ); +const v = svariance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = svariance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svariance = require( '@stdlib/stats/base/svariance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svariance = require( '@stdlib/stats/base/svariance' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svariance( x.length, 1, x, 1 ); +const v = svariance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svariancech/README.md b/lib/node_modules/@stdlib/stats/base/svariancech/README.md index 5ce6463a8869..55cd03851dd2 100644 --- a/lib/node_modules/@stdlib/stats/base/svariancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/svariancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svariancech = require( '@stdlib/stats/base/svariancech' ); +const svariancech = require( '@stdlib/stats/base/svariancech' ); ``` #### svariancech( N, correction, x, stride ) @@ -103,12 +103,12 @@ var svariancech = require( '@stdlib/stats/base/svariancech' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using a one-pass trial mean algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancech( N, 1, x, 1 ); +const v = svariancech( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancech( N, 1, x, 2 ); +const v = svariancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svariancech( N, 1, x1, 2 ); +const v = svariancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = svariancech( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancech.ndarray( N, 1, x, 1, 0 ); +const v = svariancech.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancech.ndarray( N, 1, x, 2, 1 ); +const v = svariancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -203,21 +203,18 @@ var v = svariancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svariancech = require( '@stdlib/stats/base/svariancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svariancech = require( '@stdlib/stats/base/svariancech' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svariancech( x.length, 1, x, 1 ); +const v = svariancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svariancepn/README.md b/lib/node_modules/@stdlib/stats/base/svariancepn/README.md index 2e8f965b47d8..1562ea192511 100644 --- a/lib/node_modules/@stdlib/stats/base/svariancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/svariancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svariancepn = require( '@stdlib/stats/base/svariancepn' ); +const svariancepn = require( '@stdlib/stats/base/svariancepn' ); ``` #### svariancepn( N, correction, x, stride ) @@ -103,12 +103,12 @@ var svariancepn = require( '@stdlib/stats/base/svariancepn' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using a two-pass algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancepn( N, 1, x, 1 ); +const v = svariancepn( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancepn( N, 1, x, 2 ); +const v = svariancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svariancepn( N, 1, x1, 2 ); +const v = svariancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = svariancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancepn.ndarray( N, 1, x, 1, 0 ); +const v = svariancepn.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancepn.ndarray( N, 1, x, 2, 1 ); +const v = svariancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = svariancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svariancepn = require( '@stdlib/stats/base/svariancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svariancepn = require( '@stdlib/stats/base/svariancepn' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svariancepn( x.length, 1, x, 1 ); +const v = svariancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svariancetk/README.md b/lib/node_modules/@stdlib/stats/base/svariancetk/README.md index 4b894f4dc155..3010bec5b2a0 100644 --- a/lib/node_modules/@stdlib/stats/base/svariancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/svariancetk/README.md @@ -125,7 +125,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svariancetk = require( '@stdlib/stats/base/svariancetk' ); +const svariancetk = require( '@stdlib/stats/base/svariancetk' ); ``` #### svariancetk( N, correction, x, stride ) @@ -133,12 +133,12 @@ var svariancetk = require( '@stdlib/stats/base/svariancetk' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using a one-pass textbook algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancetk( N, 1, x, 1 ); +const v = svariancetk( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -152,13 +152,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancetk( N, 1, x, 2 ); +const v = svariancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -167,15 +167,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svariancetk( N, 1, x1, 2 ); +const v = svariancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -184,12 +184,12 @@ var v = svariancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancetk.ndarray( N, 1, x, 1, 0 ); +const v = svariancetk.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -200,13 +200,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancetk.ndarray( N, 1, x, 2, 1 ); +const v = svariancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -233,21 +233,18 @@ var v = svariancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svariancetk = require( '@stdlib/stats/base/svariancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svariancetk = require( '@stdlib/stats/base/svariancetk' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svariancetk( x.length, 1, x, 1 ); +const v = svariancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svariancewd/README.md b/lib/node_modules/@stdlib/stats/base/svariancewd/README.md index 3c0591778073..55a069ad2471 100644 --- a/lib/node_modules/@stdlib/stats/base/svariancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/svariancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svariancewd = require( '@stdlib/stats/base/svariancewd' ); +const svariancewd = require( '@stdlib/stats/base/svariancewd' ); ``` #### svariancewd( N, correction, x, stride ) @@ -103,12 +103,12 @@ var svariancewd = require( '@stdlib/stats/base/svariancewd' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using Welford's algorithm. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancewd( N, 1, x, 1 ); +const v = svariancewd( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancewd( N, 1, x, 2 ); +const v = svariancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svariancewd( N, 1, x1, 2 ); +const v = svariancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = svariancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svariancewd.ndarray( N, 1, x, 1, 0 ); +const v = svariancewd.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svariancewd.ndarray( N, 1, x, 2, 1 ); +const v = svariancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = svariancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svariancewd = require( '@stdlib/stats/base/svariancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svariancewd = require( '@stdlib/stats/base/svariancewd' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svariancewd( x.length, 1, x, 1 ); +const v = svariancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/svarianceyc/README.md b/lib/node_modules/@stdlib/stats/base/svarianceyc/README.md index b10f32fc6bbb..e561f022a938 100644 --- a/lib/node_modules/@stdlib/stats/base/svarianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/svarianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var svarianceyc = require( '@stdlib/stats/base/svarianceyc' ); +const svarianceyc = require( '@stdlib/stats/base/svarianceyc' ); ``` #### svarianceyc( N, correction, x, stride ) @@ -103,12 +103,12 @@ var svarianceyc = require( '@stdlib/stats/base/svarianceyc' ); Computes the [variance][variance] of a single-precision floating-point strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svarianceyc( N, 1, x, 1 ); +const v = svarianceyc( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -122,13 +122,13 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +const N = floor( x.length / 2 ); -var v = svarianceyc( N, 1, x, 2 ); +const v = svarianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -137,15 +137,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = svarianceyc( N, 1, x1, 2 ); +const v = svarianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -154,12 +154,12 @@ var v = svarianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); +const Float32Array = require( '@stdlib/array/float32' ); -var x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); -var N = x.length; +const x = new Float32Array( [ 1.0, -2.0, 2.0 ] ); +const N = x.length; -var v = svarianceyc.ndarray( N, 1, x, 1, 0 ); +const v = svarianceyc.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -170,13 +170,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float32Array = require( '@stdlib/array/float32' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); +const x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const N = floor( x.length / 2 ); -var v = svarianceyc.ndarray( N, 1, x, 2, 1 ); +const v = svarianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -202,21 +202,18 @@ var v = svarianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); -var svarianceyc = require( '@stdlib/stats/base/svarianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float32Array = require( '@stdlib/array/float32' ); +const svarianceyc = require( '@stdlib/stats/base/svarianceyc' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float32Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = svarianceyc( x.length, 1, x, 1 ); +const v = svarianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/variance/README.md b/lib/node_modules/@stdlib/stats/base/variance/README.md index 916d85c4a011..6d34aa252e0b 100644 --- a/lib/node_modules/@stdlib/stats/base/variance/README.md +++ b/lib/node_modules/@stdlib/stats/base/variance/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var variance = require( '@stdlib/stats/base/variance' ); +const variance = require( '@stdlib/stats/base/variance' ); ``` #### variance( N, correction, x, stride ) @@ -103,10 +103,10 @@ var variance = require( '@stdlib/stats/base/variance' ); Computes the [variance][variance] of a strided array `x`. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = variance( N, 1, x, 1 ); +const v = variance( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -120,12 +120,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = variance( N, 1, x, 2 ); +const v = variance( N, 1, x, 2 ); // returns 6.25 ``` @@ -134,15 +134,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = variance( N, 1, x1, 2 ); +const v = variance( N, 1, x1, 2 ); // returns 6.25 ``` @@ -151,10 +151,10 @@ var v = variance( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = variance.ndarray( N, 1, x, 1, 0 ); +const v = variance.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -165,12 +165,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = variance.ndarray( N, 1, x, 2, 1 ); +const v = variance.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -197,21 +197,18 @@ var v = variance.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variance = require( '@stdlib/stats/base/variance' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variance = require( '@stdlib/stats/base/variance' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = variance( x.length, 1, x, 1 ); +const v = variance( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/variancech/README.md b/lib/node_modules/@stdlib/stats/base/variancech/README.md index 0ea0e96fc214..acb3821b27eb 100644 --- a/lib/node_modules/@stdlib/stats/base/variancech/README.md +++ b/lib/node_modules/@stdlib/stats/base/variancech/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var variancech = require( '@stdlib/stats/base/variancech' ); +const variancech = require( '@stdlib/stats/base/variancech' ); ``` #### variancech( N, correction, x, stride ) @@ -103,9 +103,9 @@ var variancech = require( '@stdlib/stats/base/variancech' ); Computes the [variance][variance] of a strided array `x` using a one-pass trial mean algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancech( x.length, 1, x, 1 ); +const v = variancech( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = variancech( N, 1, x, 2 ); +const v = variancech( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = variancech( N, 1, x1, 2 ); +const v = variancech( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = variancech( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using a one-pass trial mean algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancech.ndarray( x.length, 1, x, 1, 0 ); +const v = variancech.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = variancech.ndarray( N, 1, x, 2, 1 ); +const v = variancech.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -196,21 +196,18 @@ var v = variancech.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variancech = require( '@stdlib/stats/base/variancech' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variancech = require( '@stdlib/stats/base/variancech' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = variancech( x.length, 1, x, 1 ); +const v = variancech( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/variancepn/README.md b/lib/node_modules/@stdlib/stats/base/variancepn/README.md index 5775585ee772..90eb99ccf77a 100644 --- a/lib/node_modules/@stdlib/stats/base/variancepn/README.md +++ b/lib/node_modules/@stdlib/stats/base/variancepn/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var variancepn = require( '@stdlib/stats/base/variancepn' ); +const variancepn = require( '@stdlib/stats/base/variancepn' ); ``` #### variancepn( N, correction, x, stride ) @@ -103,10 +103,10 @@ var variancepn = require( '@stdlib/stats/base/variancepn' ); Computes the [variance][variance] of a strided array `x` using a two-pass algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = variancepn( N, 1, x, 1 ); +const v = variancepn( N, 1, x, 1 ); // returns ~4.3333 ``` @@ -120,12 +120,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = variancepn( N, 1, x, 2 ); +const v = variancepn( N, 1, x, 2 ); // returns 6.25 ``` @@ -134,15 +134,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = variancepn( N, 1, x1, 2 ); +const v = variancepn( N, 1, x1, 2 ); // returns 6.25 ``` @@ -151,10 +151,10 @@ var v = variancepn( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using a two-pass algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; -var N = x.length; +const x = [ 1.0, -2.0, 2.0 ]; +const N = x.length; -var v = variancepn.ndarray( N, 1, x, 1, 0 ); +const v = variancepn.ndarray( N, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -165,12 +165,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = variancepn.ndarray( N, 1, x, 2, 1 ); +const v = variancepn.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -197,21 +197,18 @@ var v = variancepn.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variancepn = require( '@stdlib/stats/base/variancepn' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variancepn = require( '@stdlib/stats/base/variancepn' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = variancepn( x.length, 1, x, 1 ); +const v = variancepn( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/variancetk/README.md b/lib/node_modules/@stdlib/stats/base/variancetk/README.md index 6d7e2c24e243..8a1da2254a6d 100644 --- a/lib/node_modules/@stdlib/stats/base/variancetk/README.md +++ b/lib/node_modules/@stdlib/stats/base/variancetk/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var variancetk = require( '@stdlib/stats/base/variancetk' ); +const variancetk = require( '@stdlib/stats/base/variancetk' ); ``` #### variancetk( N, correction, x, stride ) @@ -103,9 +103,9 @@ var variancetk = require( '@stdlib/stats/base/variancetk' ); Computes the [variance][variance] of a strided array `x` using a one-pass textbook algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancetk( x.length, 1, x, 1 ); +const v = variancetk( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = variancetk( N, 1, x, 2 ); +const v = variancetk( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = variancetk( N, 1, x1, 2 ); +const v = variancetk( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = variancetk( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using a one-pass textbook algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancetk.ndarray( x.length, 1, x, 1, 0 ); +const v = variancetk.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = variancetk.ndarray( N, 1, x, 2, 1 ); +const v = variancetk.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -196,21 +196,18 @@ var v = variancetk.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variancetk = require( '@stdlib/stats/base/variancetk' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variancetk = require( '@stdlib/stats/base/variancetk' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = variancetk( x.length, 1, x, 1 ); +const v = variancetk( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/variancewd/README.md b/lib/node_modules/@stdlib/stats/base/variancewd/README.md index 636deff359a0..3892d4e80416 100644 --- a/lib/node_modules/@stdlib/stats/base/variancewd/README.md +++ b/lib/node_modules/@stdlib/stats/base/variancewd/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var variancewd = require( '@stdlib/stats/base/variancewd' ); +const variancewd = require( '@stdlib/stats/base/variancewd' ); ``` #### variancewd( N, correction, x, stride ) @@ -103,9 +103,9 @@ var variancewd = require( '@stdlib/stats/base/variancewd' ); Computes the [variance][variance] of a strided array `x` using Welford's algorithm. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancewd( x.length, 1, x, 1 ); +const v = variancewd( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = variancewd( N, 1, x, 2 ); +const v = variancewd( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = variancewd( N, 1, x1, 2 ); +const v = variancewd( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = variancewd( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using Welford's algorithm and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = variancewd.ndarray( x.length, 1, x, 1, 0 ); +const v = variancewd.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = variancewd.ndarray( N, 1, x, 2, 1 ); +const v = variancewd.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = variancewd.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var variancewd = require( '@stdlib/stats/base/variancewd' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const variancewd = require( '@stdlib/stats/base/variancewd' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = variancewd( x.length, 1, x, 1 ); +const v = variancewd( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/varianceyc/README.md b/lib/node_modules/@stdlib/stats/base/varianceyc/README.md index aa2f84f74d2f..95c4c6268ee6 100644 --- a/lib/node_modules/@stdlib/stats/base/varianceyc/README.md +++ b/lib/node_modules/@stdlib/stats/base/varianceyc/README.md @@ -95,7 +95,7 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note, ## Usage ```javascript -var varianceyc = require( '@stdlib/stats/base/varianceyc' ); +const varianceyc = require( '@stdlib/stats/base/varianceyc' ); ``` #### varianceyc( N, correction, x, stride ) @@ -103,9 +103,9 @@ var varianceyc = require( '@stdlib/stats/base/varianceyc' ); Computes the [variance][variance] of a strided array `x` using a one-pass algorithm proposed by Youngs and Cramer. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = varianceyc( x.length, 1, x, 1 ); +const v = varianceyc( x.length, 1, x, 1 ); // returns ~4.3333 ``` @@ -119,12 +119,12 @@ The function has the following parameters: The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`, ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; -var N = floor( x.length / 2 ); +const x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; +const N = floor( x.length / 2 ); -var v = varianceyc( N, 1, x, 2 ); +const v = varianceyc( N, 1, x, 2 ); // returns 6.25 ``` @@ -133,15 +133,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); +const N = floor( x0.length / 2 ); -var v = varianceyc( N, 1, x1, 2 ); +const v = varianceyc( N, 1, x1, 2 ); // returns 6.25 ``` @@ -150,9 +150,9 @@ var v = varianceyc( N, 1, x1, 2 ); Computes the [variance][variance] of a strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics. ```javascript -var x = [ 1.0, -2.0, 2.0 ]; +const x = [ 1.0, -2.0, 2.0 ]; -var v = varianceyc.ndarray( x.length, 1, x, 1, 0 ); +const v = varianceyc.ndarray( x.length, 1, x, 1, 0 ); // returns ~4.33333 ``` @@ -163,12 +163,12 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); +const floor = require( '@stdlib/math/base/special/floor' ); -var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; -var N = floor( x.length / 2 ); +const x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; +const N = floor( x.length / 2 ); -var v = varianceyc.ndarray( N, 1, x, 2, 1 ); +const v = varianceyc.ndarray( N, 1, x, 2, 1 ); // returns 6.25 ``` @@ -195,21 +195,18 @@ var v = varianceyc.ndarray( N, 1, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); -var varianceyc = require( '@stdlib/stats/base/varianceyc' ); +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const Float64Array = require( '@stdlib/array/float64' ); +const varianceyc = require( '@stdlib/stats/base/varianceyc' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 10 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*100.0) - 50.0 ); } console.log( x ); -var v = varianceyc( x.length, 1, x, 1 ); +const v = varianceyc( x.length, 1, x, 1 ); console.log( v ); ``` diff --git a/lib/node_modules/@stdlib/stats/binomial-test/README.md b/lib/node_modules/@stdlib/stats/binomial-test/README.md index 64d1dcee4899..14676a03f994 100644 --- a/lib/node_modules/@stdlib/stats/binomial-test/README.md +++ b/lib/node_modules/@stdlib/stats/binomial-test/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var binomialTest = require( '@stdlib/stats/binomial-test' ); +const binomialTest = require( '@stdlib/stats/binomial-test' ); ``` #### binomialTest( x\[, n]\[, opts] ) @@ -35,7 +35,7 @@ var binomialTest = require( '@stdlib/stats/binomial-test' ); When supplied nonnegative integers `x` (number of successes in a Bernoulli experiment) and `n` (total number of trials), the function computes an exact test for the success probability in a Bernoulli experiment. Alternatively, `x` may be a two-element array containing the number of successes and failures, respectively. ```javascript -var out = binomialTest( 550, 1000 ); +let out = binomialTest( 550, 1000 ); /* returns { 'rejected': true, @@ -86,7 +86,7 @@ The function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var out = binomialTest( 59, 100, { +const out = binomialTest( 59, 100, { 'alpha': 0.1 }); /* returns @@ -139,7 +139,7 @@ table = out.print(); To test whether the success probability in the population is equal to some other value than `0.5`, set the `p` option. ```javascript -var out = binomialTest( 23, 100, { +const out = binomialTest( 23, 100, { 'p': 0.2 }); /* returns @@ -152,7 +152,7 @@ var out = binomialTest( 23, 100, { } */ -var table = out.print(); +const table = out.print(); /* e.g., returns Exact binomial test @@ -177,9 +177,9 @@ var table = out.print(); ```javascript -var binomialTest = require( '@stdlib/stats/binomial-test' ); +const binomialTest = require( '@stdlib/stats/binomial-test' ); -var out = binomialTest( 682, 925 ); +let out = binomialTest( 682, 925 ); /* returns { 'rejected': true, diff --git a/lib/node_modules/@stdlib/stats/chi2gof/README.md b/lib/node_modules/@stdlib/stats/chi2gof/README.md index 986b67c03be6..ba6abf566162 100644 --- a/lib/node_modules/@stdlib/stats/chi2gof/README.md +++ b/lib/node_modules/@stdlib/stats/chi2gof/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi2gof = require( '@stdlib/stats/chi2gof' ); +const chi2gof = require( '@stdlib/stats/chi2gof' ); ``` #### chi2gof( x, y\[, ...args]\[, options] ) @@ -36,13 +36,13 @@ Computes a chi-square goodness-of-fit test for the **null hypothesis** that the ```javascript // Observed counts: -var x = [ 30, 20, 23, 27 ]; +const x = [ 30, 20, 23, 27 ]; // Expected counts: -var y = [ 25, 25, 25, 25 ]; +const y = [ 25, 25, 25, 25 ]; -var res = chi2gof( x, y ); -var o = res.toJSON(); +const res = chi2gof( x, y ); +const o = res.toJSON(); /* returns { 'rejected': false, @@ -59,13 +59,13 @@ The second argument can either be an array-like object (or 1-dimensional [`ndarr ```javascript // Observed counts: -var x = [ 89, 37, 30, 28, 2 ]; +const x = [ 89, 37, 30, 28, 2 ]; // Expected probabilities: -var y = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; +const y = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; -var res = chi2gof( x, y ); -var o = res.toJSON(); +const res = chi2gof( x, y ); +const o = res.toJSON(); /* returns { 'rejected': true, @@ -81,22 +81,17 @@ var o = res.toJSON(); When specifying a discrete probability distribution name, distribution parameters **must** be provided as additional arguments. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); - -var res; -var x; -var v; -var i; +const Int32Array = require( '@stdlib/array/int32' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); // Simulate expected counts... -x = new Int32Array( 100 ); -for ( i = 0; i < x.length; i++ ) { - v = discreteUniform( 0, 99 ); +const x = new Int32Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { + const v = discreteUniform( 0, 99 ); x[ v ] += 1; } -res = chi2gof( x, 'discrete-uniform', 0, 99 ); +const res = chi2gof( x, 'discrete-uniform', 0, 99 ); // returns {...} ``` @@ -110,12 +105,12 @@ The function accepts the following `options`: By default, the test is performed at a significance level of `0.05`. To adjust the significance level, set the `alpha` option. ```javascript -var x = [ 89, 37, 30, 28, 2 ]; -var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; +const x = [ 89, 37, 30, 28, 2 ]; +const p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; -var res = chi2gof( x, p ); +let res = chi2gof( x, p ); -var table = res.toString(); +let table = res.toString(); /* e.g., returns Chi-square goodness-of-fit test @@ -153,24 +148,24 @@ table = res.toString(); By default, the p-value is computed using a chi-square distribution with `k-1` degrees of freedom, where `k` is the length of `x`. If provided distribution arguments are estimated (e.g., via maximum likelihood estimation), the degrees of freedom **should** be corrected. Set the `ddof` option to use `k-1-n` degrees of freedom, where `n` is the degrees of freedom adjustment. ```javascript -var x = [ 89, 37, 30, 28, 2 ]; -var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; +const x = [ 89, 37, 30, 28, 2 ]; +const p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; -var res = chi2gof( x, p, { +const res = chi2gof( x, p, { 'ddof': 1 }); -var o = res.toJSON(); +const o = res.toJSON(); // returns { 'pValue': ~0.0186, 'statistic': ~9.9901, 'df': 3, ... } ``` Instead of relying on chi-square approximation to calculate the p-value, one can use Monte Carlo simulation. When the `simulate` option is `true`, the simulation is performed by re-sampling from the discrete probability distribution specified by `y`. ```javascript -var x = [ 89, 37, 30, 28, 2 ]; -var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; +const x = [ 89, 37, 30, 28, 2 ]; +const p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; -var res = chi2gof( x, p, { +const res = chi2gof( x, p, { 'simulate': true, 'iterations': 1000 // explicitly set the number of Monte Carlo simulations }); @@ -194,12 +189,12 @@ To print formatted test output, invoke the `toString` method. The method accepts - **decision**: `boolean` indicating whether to show the test decision. Default: `true`. ```javascript -var x = [ 89, 37, 30, 28, 2 ]; -var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; +const x = [ 89, 37, 30, 28, 2 ]; +const p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ]; -var res = chi2gof( x, p ); +const res = chi2gof( x, p ); -var table = res.toString({ +const table = res.toString({ 'decision': false }); /* e.g., returns @@ -236,29 +231,28 @@ var table = res.toString({ ```javascript -var poisson = require( '@stdlib/random/base/poisson' ); -var Int32Array = require( '@stdlib/array/int32' ); -var chi2gof = require( '@stdlib/stats/chi2gof' ); +const poisson = require( '@stdlib/random/base/poisson' ); +const Int32Array = require( '@stdlib/array/int32' ); +const chi2gof = require( '@stdlib/stats/chi2gof' ); -var N = 400; -var lambda = 3.0; -var rpois = poisson.factory( lambda ); +const N = 400; +const lambda = 3.0; +const rpois = poisson.factory( lambda ); // Draw samples from a Poisson distribution: -var x = []; -var i; -for ( i = 0; i < N; i++ ) { +const x = []; +for ( let i = 0; i < N; i++ ) { x.push( rpois() ); } // Generate a frequency table: -var freqs = new Int32Array( N ); -for ( i = 0; i < N; i++ ) { +const freqs = new Int32Array( N ); +for ( let i = 0; i < N; i++ ) { freqs[ x[ i ] ] += 1; } // Assess whether the simulated values come from a Poisson distribution: -var out = chi2gof( freqs, 'poisson', lambda ); +const out = chi2gof( freqs, 'poisson', lambda ); // returns {...} console.log( out.toString() ); diff --git a/lib/node_modules/@stdlib/stats/chi2test/README.md b/lib/node_modules/@stdlib/stats/chi2test/README.md index 7a591976747c..e5d8a295a12c 100644 --- a/lib/node_modules/@stdlib/stats/chi2test/README.md +++ b/lib/node_modules/@stdlib/stats/chi2test/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var chi2test = require( '@stdlib/stats/chi2test' ); +const chi2test = require( '@stdlib/stats/chi2test' ); ``` #### chi2test( x\[, options] ) @@ -36,14 +36,14 @@ Computes a chi-square independence test for the **null hypothesis** that the joi ```javascript // 2x2 contigency table: -var x = [ +const x = [ [ 20, 30 ], [ 30, 20 ] ]; -var res = chi2test( x ); +const res = chi2test( x ); -var o = res.toJSON(); +const o = res.toJSON(); /* returns { 'rejected': false, @@ -64,16 +64,16 @@ The function accepts the following `options`: By default, the test is performed at a significance level of `0.05`. To adjust the significance level, set the `alpha` option. ```javascript -var x = [ +const x = [ [ 20, 30 ], [ 30, 20 ] ]; -var opts = { +const opts = { 'alpha': 0.1 }; -var res = chi2test( x, opts ); +const res = chi2test( x, opts ); -var o = res.toJSON(); +const o = res.toJSON(); /* returns { 'rejected': true, @@ -89,16 +89,16 @@ var o = res.toJSON(); By default, the function applies Yates' continuity correction for 2x2 contingency tables. To disable the continuity correction, set `correct` to `false`. ```javascript -var x = [ +const x = [ [ 20, 30 ], [ 30, 20 ] ]; -var opts = { +const opts = { 'correct': false }; -var res = chi2test( x, opts ); +const res = chi2test( x, opts ); -var o = res.toJSON(); +const o = res.toJSON(); /* returns { 'rejected': true, @@ -129,13 +129,13 @@ To print formatted test output, invoke the `toString` method. The method accepts - **decision**: `boolean` indicating whether to show the test decision. Default: `true`. ```javascript -var x = [ +const x = [ [ 20, 30 ], [ 30, 20 ] ]; -var res = chi2test( x ); +const res = chi2test( x ); -var table = res.toString({ +const table = res.toString({ 'decision': false }); /* e.g., returns @@ -174,15 +174,15 @@ var table = res.toString({ ```javascript -var array = require( '@stdlib/ndarray/array' ); -var chi2test = require( '@stdlib/stats/chi2test' ); +const array = require( '@stdlib/ndarray/array' ); +const chi2test = require( '@stdlib/stats/chi2test' ); /* * Data from students in grades 4-6 on whether good grades, athletic ability, or popularity are most important to them: * * Source: Chase, M.A and Dummer, G.M. (1992), "The Role of Sports as a Social Determinant for Children" */ -var table = array([ +const table = array([ /* Grades Popularity Sports */ [ 63, 31, 25 ], // 4th [ 88, 55, 33 ], // 5th @@ -190,7 +190,7 @@ var table = array([ ]); // Assess whether the grade level and the students' goals are independent of each other: -var out = chi2test( table ); +const out = chi2test( table ); // returns {...} console.log( out.toString() ); diff --git a/lib/node_modules/@stdlib/stats/fligner-test/README.md b/lib/node_modules/@stdlib/stats/fligner-test/README.md index d43de564270e..572ca341ddf9 100644 --- a/lib/node_modules/@stdlib/stats/fligner-test/README.md +++ b/lib/node_modules/@stdlib/stats/fligner-test/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var flignerTest = require( '@stdlib/stats/fligner-test' ); +const flignerTest = require( '@stdlib/stats/fligner-test' ); ``` #### flignerTest( a\[,b,...,k]\[, opts] ) @@ -42,11 +42,11 @@ For input arrays `a`, `b`, ... holding numeric observations, this function calcu ```javascript // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = flignerTest( x, y, z ); +const out = flignerTest( x, y, z ); /* returns { 'rejected': false, @@ -67,11 +67,11 @@ The function accepts the following `options`: By default, the test is carried out at a significance level of `0.05`. To choose a custom significance level, set the `alpha` option. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = flignerTest( x, y, z, { +const out = flignerTest( x, y, z, { 'alpha': 0.1 }); /* returns @@ -91,17 +91,17 @@ The function provides an alternate interface by supplying an array of group indi ```javascript -var arr = [ +const arr = [ 2.9, 3.0, 2.5, 2.6, 3.2, 3.8, 2.7, 4.0, 2.4, 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var groups = [ +const groups = [ 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'c' ]; -var out = flignerTest( arr, { +const out = flignerTest( arr, { 'groups': groups }); ``` @@ -109,11 +109,11 @@ var out = flignerTest( arr, { The returned object comes with a `.print()` method which when invoked will print a formatted output of the results of the hypothesis test. `print` accepts a `digits` option that controls the number of decimal digits displayed for the outputs and a `decision` option, which when set to `false` will hide the test decision. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = flignerTest( x, y, z ); +const out = flignerTest( x, y, z ); console.log( out.print() ); /* => Fligner-Killeen test of homogeneity of variances @@ -139,14 +139,14 @@ console.log( out.print() ); ```javascript -var flignerTest = require( '@stdlib/stats/fligner-test' ); +const flignerTest = require( '@stdlib/stats/fligner-test' ); // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = flignerTest( x, y, z ); +const out = flignerTest( x, y, z ); /* returns { 'rejected': false, @@ -158,7 +158,7 @@ var out = flignerTest( x, y, z ); } */ -var table = out.print(); +const table = out.print(); /* returns Fligner-Killeen test of homogeneity of variances diff --git a/lib/node_modules/@stdlib/stats/incr/README.md b/lib/node_modules/@stdlib/stats/incr/README.md index 68a0ca83442e..f32cdede707b 100644 --- a/lib/node_modules/@stdlib/stats/incr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/stats/incr' ); +const ns = require( '@stdlib/stats/incr' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/stats/incr' ); Namespace containing functions for computing statistics incrementally. ```javascript -var incr = ns; +const incr = ns; // returns {...} ``` @@ -155,8 +155,8 @@ var incr = ns; ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/stats/incr' ); +const getKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/stats/incr' ); console.log( getKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/incr/apcorr/README.md b/lib/node_modules/@stdlib/stats/incr/apcorr/README.md index 590e0515eede..791707ef05c8 100644 --- a/lib/node_modules/@stdlib/stats/incr/apcorr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/apcorr/README.md @@ -67,7 +67,7 @@ The sample **absolute** [Pearson product-moment correlation coefficient][pearson ## Usage ```javascript -var incrapcorr = require( '@stdlib/stats/incr/apcorr' ); +const incrapcorr = require( '@stdlib/stats/incr/apcorr' ); ``` #### incrapcorr( \[mx, my] ) @@ -75,13 +75,13 @@ var incrapcorr = require( '@stdlib/stats/incr/apcorr' ); Returns an accumulator `function` which incrementally computes a sample absolute [Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrapcorr(); +const accumulator = incrapcorr(); ``` If the means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrapcorr( 3.0, -5.5 ); +const accumulator = incrapcorr( 3.0, -5.5 ); ``` #### accumulator( \[x, y] ) @@ -89,9 +89,9 @@ var accumulator = incrapcorr( 3.0, -5.5 ); If provided input value `x` and `y`, the accumulator function returns an updated accumulated value. If not provided input values `x` and `y`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrapcorr(); +const accumulator = incrapcorr(); -var v = accumulator( 2.0, 1.0 ); +let v = accumulator( 2.0, 1.0 ); // returns 0.0 v = accumulator( 1.0, -5.0 ); @@ -126,21 +126,16 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrapcorr = require( '@stdlib/stats/incr/apcorr' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrapcorr = require( '@stdlib/stats/incr/apcorr' ); // Initialize an accumulator: -accumulator = incrapcorr(); +const accumulator = incrapcorr(); // For each simulated datum, update the sample absolute correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/count/README.md b/lib/node_modules/@stdlib/stats/incr/count/README.md index 80134c06685c..bb08d079952b 100644 --- a/lib/node_modules/@stdlib/stats/incr/count/README.md +++ b/lib/node_modules/@stdlib/stats/incr/count/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrcount = require( '@stdlib/stats/incr/count' ); +const incrcount = require( '@stdlib/stats/incr/count' ); ``` #### incrcount() @@ -35,7 +35,7 @@ var incrcount = require( '@stdlib/stats/incr/count' ); Returns an accumulator `function` which incrementally computes a count. ```javascript -var accumulator = incrcount(); +const accumulator = incrcount(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrcount(); If provided an input value `x`, the accumulator function returns an updated count. If not provided an input value `x`, the accumulator function returns the current count. ```javascript -var accumulator = incrcount(); +const accumulator = incrcount(); -var count = accumulator( 2.0 ); +let count = accumulator( 2.0 ); // returns 1 count = accumulator( 1.0 ); @@ -69,19 +69,15 @@ count = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrcount = require( '@stdlib/stats/incr/count' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrcount = require( '@stdlib/stats/incr/count' ); // Initialize an accumulator: -accumulator = incrcount(); +const accumulator = incrcount(); // For each simulated datum, update the count... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/covariance/README.md b/lib/node_modules/@stdlib/stats/incr/covariance/README.md index d2f010327f8d..0921d3c93b78 100644 --- a/lib/node_modules/@stdlib/stats/incr/covariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/covariance/README.md @@ -63,7 +63,7 @@ For known population means, the [unbiased sample covariance][covariance] is defi ## Usage ```javascript -var incrcovariance = require( '@stdlib/stats/incr/covariance' ); +const incrcovariance = require( '@stdlib/stats/incr/covariance' ); ``` #### incrcovariance( \[mx, my] ) @@ -71,13 +71,13 @@ var incrcovariance = require( '@stdlib/stats/incr/covariance' ); Returns an accumulator `function` which incrementally computes an [unbiased sample covariance][covariance]. ```javascript -var accumulator = incrcovariance(); +const accumulator = incrcovariance(); ``` If the means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrcovariance( 3.0, -5.5 ); +const accumulator = incrcovariance( 3.0, -5.5 ); ``` #### accumulator( \[x, y] ) @@ -85,9 +85,9 @@ var accumulator = incrcovariance( 3.0, -5.5 ); If provided input values `x` and `y`, the accumulator function returns an updated [unbiased sample covariance][covariance]. If not provided input values `x` and `y`, the accumulator function returns the current [unbiased sample covariance][covariance]. ```javascript -var accumulator = incrcovariance(); +const accumulator = incrcovariance(); -var v = accumulator( 2.0, 1.0 ); +let v = accumulator( 2.0, 1.0 ); // returns 0.0 v = accumulator( 1.0, -5.0 ); @@ -121,21 +121,16 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrcovariance = require( '@stdlib/stats/incr/covariance' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrcovariance = require( '@stdlib/stats/incr/covariance' ); // Initialize an accumulator: -accumulator = incrcovariance(); +const accumulator = incrcovariance(); // For each simulated datum, update the unbiased sample covariance... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/covmat/README.md b/lib/node_modules/@stdlib/stats/incr/covmat/README.md index dbd016a30bdb..a34559d5ef58 100644 --- a/lib/node_modules/@stdlib/stats/incr/covmat/README.md +++ b/lib/node_modules/@stdlib/stats/incr/covmat/README.md @@ -63,7 +63,7 @@ For known population means, the [unbiased sample covariance][covariance-matrix] ## Usage ```javascript -var incrcovmat = require( '@stdlib/stats/incr/covmat' ); +const incrcovmat = require( '@stdlib/stats/incr/covmat' ); ``` #### incrcovmat( out\[, means] ) @@ -72,41 +72,41 @@ Returns an accumulator `function` which incrementally computes an [unbiased samp ```javascript // Create an accumulator for computing a 2-dimensional covariance matrix: -var accumulator = incrcovmat( 2 ); +const accumulator = incrcovmat( 2 ); ``` The `out` argument may be either the order of the [covariance matrix][covariance-matrix] or a square 2-dimensional [`ndarray`][@stdlib/ndarray/ctor] for storing the [unbiased sample covariance matrix][covariance-matrix]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; +const buffer = new Float64Array( 4 ); +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; // Create a 2-dimensional output covariance matrix: -var cov = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const cov = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrcovmat( cov ); +const accumulator = incrcovmat( cov ); ``` When means are known, the function supports providing a 1-dimensional [`ndarray`][@stdlib/ndarray/ctor] containing mean values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); means.set( 0, 3.0 ); means.set( 1, -5.5 ); -var accumulator = incrcovmat( 2, means ); +const accumulator = incrcovmat( 2, means ); ``` #### accumulator( \[vector] ) @@ -114,28 +114,28 @@ var accumulator = incrcovmat( 2, means ); If provided a data vector, the accumulator function returns an updated [unbiased sample covariance matrix][covariance-matrix]. If not provided a data vector, the accumulator function returns the current [unbiased sample covariance matrix][covariance-matrix]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var cov = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +let buffer = new Float64Array( 4 ); +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +const cov = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); buffer = new Float64Array( 2 ); shape = [ 2 ]; strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrcovmat( cov ); +const accumulator = incrcovmat( cov ); vec.set( 0, 2.0 ); vec.set( 1, 1.0 ); -var out = accumulator( vec ); +let out = accumulator( vec ); // returns -var bool = ( out === cov ); +const bool = ( out === cov ); // returns true vec.set( 0, 1.0 ); @@ -171,38 +171,31 @@ out = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var incrcovmat = require( '@stdlib/stats/incr/covmat' ); - -var cov; -var cxy; -var cyx; -var vx; -var vy; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const incrcovmat = require( '@stdlib/stats/incr/covmat' ); // Initialize an accumulator for a 2-dimensional covariance matrix: -var accumulator = incrcovmat( 2 ); +const accumulator = incrcovmat( 2 ); // Create a 1-dimensional data vector: -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // For each simulated data vector, update the unbiased sample covariance matrix... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { vec.set( 0, randu()*100.0 ); vec.set( 1, randu()*100.0 ); - cov = accumulator( vec ); + const cov = accumulator( vec ); - vx = cov.get( 0, 0 ).toFixed( 4 ); - vy = cov.get( 1, 1 ).toFixed( 4 ); - cxy = cov.get( 0, 1 ).toFixed( 4 ); - cyx = cov.get( 1, 0 ).toFixed( 4 ); + const vx = cov.get( 0, 0 ).toFixed( 4 ); + const vy = cov.get( 1, 1 ).toFixed( 4 ); + const cxy = cov.get( 0, 1 ).toFixed( 4 ); + const cyx = cov.get( 1, 0 ).toFixed( 4 ); console.log( '[ %d, %d\n %d, %d ]', vx, cxy, cyx, vy ); } diff --git a/lib/node_modules/@stdlib/stats/incr/cv/README.md b/lib/node_modules/@stdlib/stats/incr/cv/README.md index 7580372fd6d7..26ca55be72b7 100644 --- a/lib/node_modules/@stdlib/stats/incr/cv/README.md +++ b/lib/node_modules/@stdlib/stats/incr/cv/README.md @@ -78,7 +78,7 @@ c_v = \frac{s}{\bar{x}} ## Usage ```javascript -var incrcv = require( '@stdlib/stats/incr/cv' ); +const incrcv = require( '@stdlib/stats/incr/cv' ); ``` #### incrcv( \[mean] ) @@ -86,13 +86,13 @@ var incrcv = require( '@stdlib/stats/incr/cv' ); Returns an accumulator `function` which incrementally computes the [coefficient of variation][coefficient-of-variation]. ```javascript -var accumulator = incrcv(); +const accumulator = incrcv(); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrcv( 3.0 ); +const accumulator = incrcv( 3.0 ); ``` #### accumulator( \[x] ) @@ -100,9 +100,9 @@ var accumulator = incrcv( 3.0 ); If provided an input value `x`, the accumulator function returns an updated accumulated value. If not provided an input value `x`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrcv(); +const accumulator = incrcv(); -var cv = accumulator( 2.0 ); +let cv = accumulator( 2.0 ); // returns 0.0 cv = accumulator( 1.0 ); // => s^2 = ((2-1.5)^2+(1-1.5)^2) / (2-1) @@ -138,19 +138,15 @@ cv = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrcv = require( '@stdlib/stats/incr/cv' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrcv = require( '@stdlib/stats/incr/cv' ); // Initialize an accumulator: -accumulator = incrcv(); +const accumulator = incrcv(); // For each simulated datum, update the coefficient of variation... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/ewmean/README.md b/lib/node_modules/@stdlib/stats/incr/ewmean/README.md index 945c0c06cb96..ab5f8d013ad4 100644 --- a/lib/node_modules/@stdlib/stats/incr/ewmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/ewmean/README.md @@ -48,7 +48,7 @@ An [exponentially weighted mean][moving-average] can be defined recursively as ## Usage ```javascript -var increwmean = require( '@stdlib/stats/incr/ewmean' ); +const increwmean = require( '@stdlib/stats/incr/ewmean' ); ``` #### increwmean( alpha ) @@ -56,7 +56,7 @@ var increwmean = require( '@stdlib/stats/incr/ewmean' ); Returns an accumulator `function` which incrementally computes an [exponentially weighted mean][moving-average], where `alpha` is a smoothing factor between `0` and `1`. ```javascript -var accumulator = increwmean( 0.5 ); +const accumulator = increwmean( 0.5 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = increwmean( 0.5 ); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = increwmean( 0.5 ); +const accumulator = increwmean( 0.5 ); -var v = accumulator(); +let v = accumulator(); // returns null v = accumulator( 2.0 ); @@ -103,19 +103,15 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var increwmean = require( '@stdlib/stats/incr/ewmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const increwmean = require( '@stdlib/stats/incr/ewmean' ); // Initialize an accumulator: -accumulator = increwmean( 0.5 ); +const accumulator = increwmean( 0.5 ); // For each simulated datum, update the exponentially weighted mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/ewstdev/README.md b/lib/node_modules/@stdlib/stats/incr/ewstdev/README.md index e738bc6a5337..d27afef54569 100644 --- a/lib/node_modules/@stdlib/stats/incr/ewstdev/README.md +++ b/lib/node_modules/@stdlib/stats/incr/ewstdev/README.md @@ -50,7 +50,7 @@ where `μ` is the [exponentially weighted mean][@stdlib/stats/incr/ewmean]. The ## Usage ```javascript -var increwstdev = require( '@stdlib/stats/incr/ewstdev' ); +const increwstdev = require( '@stdlib/stats/incr/ewstdev' ); ``` #### increwstdev( alpha ) @@ -58,7 +58,7 @@ var increwstdev = require( '@stdlib/stats/incr/ewstdev' ); Returns an accumulator `function` which incrementally computes an [exponentially weighted standard deviation][moving-average], where `alpha` is a smoothing factor between `0` and `1`. ```javascript -var accumulator = increwstdev( 0.5 ); +const accumulator = increwstdev( 0.5 ); ``` #### accumulator( \[x] ) @@ -66,9 +66,9 @@ var accumulator = increwstdev( 0.5 ); If provided an input value `x`, the accumulator function returns an updated standard deviation. If not provided an input value `x`, the accumulator function returns the current standard deviation. ```javascript -var accumulator = increwstdev( 0.5 ); +const accumulator = increwstdev( 0.5 ); -var s = accumulator(); +let s = accumulator(); // returns null s = accumulator( 2.0 ); @@ -105,19 +105,15 @@ s = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var increwstdev = require( '@stdlib/stats/incr/ewstdev' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const increwstdev = require( '@stdlib/stats/incr/ewstdev' ); // Initialize an accumulator: -accumulator = increwstdev( 0.5 ); +const accumulator = increwstdev( 0.5 ); // For each simulated datum, update the exponentially weighted standard deviation... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/ewvariance/README.md b/lib/node_modules/@stdlib/stats/incr/ewvariance/README.md index 4361fc41a891..e0fdaac49c09 100644 --- a/lib/node_modules/@stdlib/stats/incr/ewvariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/ewvariance/README.md @@ -50,7 +50,7 @@ where `μ` is the [exponentially weighted mean][@stdlib/stats/incr/ewmean]. ## Usage ```javascript -var increwvariance = require( '@stdlib/stats/incr/ewvariance' ); +const increwvariance = require( '@stdlib/stats/incr/ewvariance' ); ``` #### increwvariance( alpha ) @@ -58,7 +58,7 @@ var increwvariance = require( '@stdlib/stats/incr/ewvariance' ); Returns an accumulator `function` which incrementally computes an [exponentially weighted variance][moving-average], where `alpha` is a smoothing factor between `0` and `1`. ```javascript -var accumulator = increwvariance( 0.5 ); +const accumulator = increwvariance( 0.5 ); ``` #### accumulator( \[x] ) @@ -66,9 +66,9 @@ var accumulator = increwvariance( 0.5 ); If provided an input value `x`, the accumulator function returns an updated variance. If not provided an input value `x`, the accumulator function returns the current variance. ```javascript -var accumulator = increwvariance( 0.5 ); +const accumulator = increwvariance( 0.5 ); -var v = accumulator(); +let v = accumulator(); // returns null v = accumulator( 2.0 ); @@ -105,19 +105,15 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var increwvariance = require( '@stdlib/stats/incr/ewvariance' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const increwvariance = require( '@stdlib/stats/incr/ewvariance' ); // Initialize an accumulator: -accumulator = increwvariance( 0.5 ); +const accumulator = increwvariance( 0.5 ); // For each simulated datum, update the exponentially weighted variance... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/gmean/README.md b/lib/node_modules/@stdlib/stats/incr/gmean/README.md index 4865224a1065..1bf546eec889 100644 --- a/lib/node_modules/@stdlib/stats/incr/gmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/gmean/README.md @@ -48,7 +48,7 @@ The [geometric mean][geometric-mean] is defined as the nth root of a product of ## Usage ```javascript -var incrgmean = require( '@stdlib/stats/incr/gmean' ); +const incrgmean = require( '@stdlib/stats/incr/gmean' ); ``` #### incrgmean() @@ -56,7 +56,7 @@ var incrgmean = require( '@stdlib/stats/incr/gmean' ); Returns an accumulator `function` which incrementally computes a [geometric mean][geometric-mean]. ```javascript -var accumulator = incrgmean(); +const accumulator = incrgmean(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrgmean(); If provided an input value `x`, the accumulator function returns an updated [geometric mean][geometric-mean]. If not provided an input value `x`, the accumulator function returns the current [geometric mean][geometric-mean]. ```javascript -var accumulator = incrgmean(); +const accumulator = incrgmean(); -var prod = accumulator( 2.0 ); +let prod = accumulator( 2.0 ); // returns 2.0 prod = accumulator( 1.0 ); @@ -100,19 +100,15 @@ prod = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrgmean = require( '@stdlib/stats/incr/gmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrgmean = require( '@stdlib/stats/incr/gmean' ); // Initialize an accumulator: -accumulator = incrgmean(); +const accumulator = incrgmean(); // For each simulated value, update the geometric mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/grubbs/README.md b/lib/node_modules/@stdlib/stats/incr/grubbs/README.md index 5e7dfcacd798..34863c585260 100644 --- a/lib/node_modules/@stdlib/stats/incr/grubbs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/grubbs/README.md @@ -119,7 +119,7 @@ where `t` denotes the upper critical value of the _t_-distribution with `N-2` de ## Usage ```javascript -var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); +const incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); ``` #### incrgrubbs( \[options] ) @@ -127,7 +127,7 @@ var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); Returns an accumulator `function` which incrementally performs [Grubbs' test][grubbs-test] for outliers. ```javascript -var accumulator = incrgrubbs(); +const accumulator = incrgrubbs(); ``` The function accepts the following `options`: @@ -149,14 +149,14 @@ The function accepts the following `options`: If provided an input value `x`, the accumulator function returns updated test results. If not provided an input value `x`, the accumulator function returns the current test results. ```javascript -var rnorm = require( '@stdlib/random/base/normal' ); +const rnorm = require( '@stdlib/random/base/normal' ); -var opts = { +const opts = { 'init': 0 }; -var accumulator = incrgrubbs( opts ); +const accumulator = incrgrubbs( opts ); -var results = accumulator( rnorm( 10.0, 5.0 ) ); +let results = accumulator( rnorm( 10.0, 5.0 ) ); // returns null results = accumulator( rnorm( 10.0, 5.0 ) ); @@ -212,25 +212,20 @@ The `print` method accepts the following options: ```javascript -var incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); - -var data; -var opts; -var acc; -var i; +const incrgrubbs = require( '@stdlib/stats/incr/grubbs' ); // Define a data set (8 mass spectrometer measurements of a uranium isotope; see Tietjen and Moore. 1972. "Some Grubbs-Type Statistics for the Detection of Several Outliers".) -data = [ 199.31, 199.53, 200.19, 200.82, 201.92, 201.95, 202.18, 245.57 ]; +const data = [ 199.31, 199.53, 200.19, 200.82, 201.92, 201.95, 202.18, 245.57 ]; // Create a new accumulator: -opts = { +const opts = { 'init': data.length, 'alternative': 'two-sided' }; -acc = incrgrubbs( opts ); +const acc = incrgrubbs( opts ); // Update the accumulator: -for ( i = 0; i < data.length; i++ ) { +for ( let i = 0; i < data.length; i++ ) { acc( data[ i ] ); } diff --git a/lib/node_modules/@stdlib/stats/incr/hmean/README.md b/lib/node_modules/@stdlib/stats/incr/hmean/README.md index 4404edb5d96c..e3192a97b1ca 100644 --- a/lib/node_modules/@stdlib/stats/incr/hmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/hmean/README.md @@ -48,7 +48,7 @@ The [harmonic mean][harmonic-mean] of positive real numbers `x_0, x_1, ..., x_{n ## Usage ```javascript -var incrhmean = require( '@stdlib/stats/incr/hmean' ); +const incrhmean = require( '@stdlib/stats/incr/hmean' ); ``` #### incrhmean() @@ -56,7 +56,7 @@ var incrhmean = require( '@stdlib/stats/incr/hmean' ); Returns an accumulator `function` which incrementally computes a [harmonic mean][harmonic-mean]. ```javascript -var accumulator = incrhmean(); +const accumulator = incrhmean(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrhmean(); If provided an input value `x`, the accumulator function returns an updated [harmonic mean][harmonic-mean]. If not provided an input value `x`, the accumulator function returns the current [harmonic mean][harmonic-mean]. ```javascript -var accumulator = incrhmean(); +const accumulator = incrhmean(); -var v = accumulator( 2.0 ); +let v = accumulator( 2.0 ); // returns 2.0 v = accumulator( 1.0 ); @@ -100,19 +100,15 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrhmean = require( '@stdlib/stats/incr/hmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrhmean = require( '@stdlib/stats/incr/hmean' ); // Initialize an accumulator: -accumulator = incrhmean(); +const accumulator = incrhmean(); // For each simulated datum, update the harmonic mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/kurtosis/README.md b/lib/node_modules/@stdlib/stats/incr/kurtosis/README.md index f75f0a698277..5d350c0f69a7 100644 --- a/lib/node_modules/@stdlib/stats/incr/kurtosis/README.md +++ b/lib/node_modules/@stdlib/stats/incr/kurtosis/README.md @@ -82,7 +82,7 @@ G_2 = \frac{(n+1)n}{(n-1)(n-2)(n-3)} \frac{\displaystyle\sum_{i=0}^{n-1} (x_i - ## Usage ```javascript -var incrkurtosis = require( '@stdlib/stats/incr/kurtosis' ); +const incrkurtosis = require( '@stdlib/stats/incr/kurtosis' ); ``` #### incrkurtosis() @@ -90,7 +90,7 @@ var incrkurtosis = require( '@stdlib/stats/incr/kurtosis' ); Returns an accumulator `function` which incrementally computes a [corrected sample excess kurtosis][sample-excess-kurtosis]. ```javascript -var accumulator = incrkurtosis(); +const accumulator = incrkurtosis(); ``` #### accumulator( \[x] ) @@ -98,9 +98,9 @@ var accumulator = incrkurtosis(); If provided an input value `x`, the accumulator function returns an updated [corrected sample excess kurtosis][sample-excess-kurtosis]. If not provided an input value `x`, the accumulator function returns the current [corrected sample excess kurtosis][sample-excess-kurtosis]. ```javascript -var accumulator = incrkurtosis(); +const accumulator = incrkurtosis(); -var kurtosis = accumulator( 2.0 ); +let kurtosis = accumulator( 2.0 ); // returns null kurtosis = accumulator( 2.0 ); @@ -134,19 +134,15 @@ kurtosis = accumulator( -4.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrkurtosis = require( '@stdlib/stats/incr/kurtosis' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrkurtosis = require( '@stdlib/stats/incr/kurtosis' ); // Initialize an accumulator: -accumulator = incrkurtosis(); +const accumulator = incrkurtosis(); // For each simulated datum, update the corrected sample excess kurtosis... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/maape/README.md b/lib/node_modules/@stdlib/stats/incr/maape/README.md index 06e55647f4fa..13dd33093641 100644 --- a/lib/node_modules/@stdlib/stats/incr/maape/README.md +++ b/lib/node_modules/@stdlib/stats/incr/maape/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmaape = require( '@stdlib/stats/incr/maape' ); +const incrmaape = require( '@stdlib/stats/incr/maape' ); ``` #### incrmaape() @@ -58,7 +58,7 @@ var incrmaape = require( '@stdlib/stats/incr/maape' ); Returns an accumulator `function` which incrementally computes the [mean arctangent absolute percentage error][@kim:2016a]. ```javascript -var accumulator = incrmaape(); +const accumulator = incrmaape(); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmaape(); If provided input values `f` and `a`, the accumulator function returns an updated [mean arctangent absolute percentage error][@kim:2016a]. If not provided input values `f` and `a`, the accumulator function returns the current [mean arctangent absolute percentage error][@kim:2016a]. ```javascript -var accumulator = incrmaape(); +const accumulator = incrmaape(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns ~0.3218 m = accumulator( 1.0, 4.0 ); @@ -103,21 +103,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmaape = require( '@stdlib/stats/incr/maape' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmaape = require( '@stdlib/stats/incr/maape' ); // Initialize an accumulator: -accumulator = incrmaape(); +const accumulator = incrmaape(); // For each simulated datum, update the mean arctangent absolute percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mae/README.md b/lib/node_modules/@stdlib/stats/incr/mae/README.md index fad9113a9b8b..09c1e7e814ad 100644 --- a/lib/node_modules/@stdlib/stats/incr/mae/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mae/README.md @@ -48,7 +48,7 @@ The [mean absolute error][mean-absolute-error] is defined as ## Usage ```javascript -var incrmae = require( '@stdlib/stats/incr/mae' ); +const incrmae = require( '@stdlib/stats/incr/mae' ); ``` #### incrmae() @@ -56,7 +56,7 @@ var incrmae = require( '@stdlib/stats/incr/mae' ); Returns an accumulator `function` which incrementally computes the [mean absolute error][mean-absolute-error]. ```javascript -var accumulator = incrmae(); +const accumulator = incrmae(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmae(); If provided input values `x` and `y`, the accumulator function returns an updated [mean absolute error][mean-absolute-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean absolute error][mean-absolute-error]. ```javascript -var accumulator = incrmae(); +const accumulator = incrmae(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns 1.0 m = accumulator( -1.0, -4.0 ); @@ -101,21 +101,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmae = require( '@stdlib/stats/incr/mae' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmae = require( '@stdlib/stats/incr/mae' ); // Initialize an accumulator: -accumulator = incrmae(); +const accumulator = incrmae(); // For each simulated datum, update the mean absolute error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mapcorr/README.md b/lib/node_modules/@stdlib/stats/incr/mapcorr/README.md index f32dd1168f48..6fab3143b25c 100644 --- a/lib/node_modules/@stdlib/stats/incr/mapcorr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mapcorr/README.md @@ -67,7 +67,7 @@ The sample **absolute** [Pearson product-moment correlation coefficient][pearson ## Usage ```javascript -var incrmapcorr = require( '@stdlib/stats/incr/mapcorr' ); +const incrmapcorr = require( '@stdlib/stats/incr/mapcorr' ); ``` #### incrmapcorr( window\[, mx, my] ) @@ -75,13 +75,13 @@ var incrmapcorr = require( '@stdlib/stats/incr/mapcorr' ); Returns an accumulator `function` which incrementally computes a moving sample absolute [Pearson product-moment correlation coefficient][pearson-correlation]. The `window` parameter defines the number of values over which to compute the moving sample absolute [Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrmapcorr( 3 ); +const accumulator = incrmapcorr( 3 ); ``` If means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrmapcorr( 3, 5.0, -3.14 ); +const accumulator = incrmapcorr( 3, 5.0, -3.14 ); ``` #### accumulator( \[x, y] ) @@ -89,9 +89,9 @@ var accumulator = incrmapcorr( 3, 5.0, -3.14 ); If provided input values `x` and `y`, the accumulator function returns an updated accumulated value. If not provided input values `x` and `y`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrmapcorr( 3 ); +const accumulator = incrmapcorr( 3 ); -var ar = accumulator(); +let ar = accumulator(); // returns null // Fill the window... @@ -138,21 +138,16 @@ ar = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmapcorr = require( '@stdlib/stats/incr/mapcorr' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmapcorr = require( '@stdlib/stats/incr/mapcorr' ); // Initialize an accumulator: -accumulator = incrmapcorr( 5 ); +const accumulator = incrmapcorr( 5 ); // For each simulated datum, update the moving sample absolute correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mape/README.md b/lib/node_modules/@stdlib/stats/incr/mape/README.md index f5398c9a6a91..d2ebd99f23af 100644 --- a/lib/node_modules/@stdlib/stats/incr/mape/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mape/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmape = require( '@stdlib/stats/incr/mape' ); +const incrmape = require( '@stdlib/stats/incr/mape' ); ``` #### incrmape() @@ -58,7 +58,7 @@ var incrmape = require( '@stdlib/stats/incr/mape' ); Returns an accumulator `function` which incrementally computes the [mean absolute percentage error][mean-absolute-percentage-error]. ```javascript -var accumulator = incrmape(); +const accumulator = incrmape(); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmape(); If provided input values `f` and `a`, the accumulator function returns an updated [mean absolute percentage error][mean-absolute-percentage-error]. If not provided input values `f` and `a`, the accumulator function returns the current [mean absolute percentage error][mean-absolute-percentage-error]. ```javascript -var accumulator = incrmape(); +const accumulator = incrmape(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns ~33.33 m = accumulator( 1.0, 4.0 ); @@ -108,21 +108,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmape = require( '@stdlib/stats/incr/mape' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmape = require( '@stdlib/stats/incr/mape' ); // Initialize an accumulator: -accumulator = incrmape(); +const accumulator = incrmape(); // For each simulated datum, update the mean absolute percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/max/README.md b/lib/node_modules/@stdlib/stats/incr/max/README.md index 483f4167a81b..342a8aca4683 100644 --- a/lib/node_modules/@stdlib/stats/incr/max/README.md +++ b/lib/node_modules/@stdlib/stats/incr/max/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmax = require( '@stdlib/stats/incr/max' ); +const incrmax = require( '@stdlib/stats/incr/max' ); ``` #### incrmax() @@ -35,7 +35,7 @@ var incrmax = require( '@stdlib/stats/incr/max' ); Returns an accumulator `function` which incrementally computes a maximum value. ```javascript -var accumulator = incrmax(); +const accumulator = incrmax(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmax(); If provided an input value `x`, the accumulator function returns an updated maximum value. If not provided an input value `x`, the accumulator function returns the current maximum value. ```javascript -var accumulator = incrmax(); +const accumulator = incrmax(); -var max = accumulator( 2.0 ); +let max = accumulator( 2.0 ); // returns 2.0 max = accumulator( 1.0 ); @@ -79,19 +79,15 @@ max = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmax = require( '@stdlib/stats/incr/max' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmax = require( '@stdlib/stats/incr/max' ); // Initialize an accumulator: -accumulator = incrmax(); +const accumulator = incrmax(); // For each simulated datum, update the max... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/maxabs/README.md b/lib/node_modules/@stdlib/stats/incr/maxabs/README.md index 1f198470542a..a9b3de2dd8fa 100644 --- a/lib/node_modules/@stdlib/stats/incr/maxabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/maxabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmaxabs = require( '@stdlib/stats/incr/maxabs' ); +const incrmaxabs = require( '@stdlib/stats/incr/maxabs' ); ``` #### incrmaxabs() @@ -35,7 +35,7 @@ var incrmaxabs = require( '@stdlib/stats/incr/maxabs' ); Returns an accumulator `function` which incrementally computes a maximum absolute value. ```javascript -var accumulator = incrmaxabs(); +const accumulator = incrmaxabs(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmaxabs(); If provided an input value `x`, the accumulator function returns an updated maximum absolute value. If not provided an input value `x`, the accumulator function returns the current maximum absolute value. ```javascript -var accumulator = incrmaxabs(); +const accumulator = incrmaxabs(); -var max = accumulator( 2.0 ); +let max = accumulator( 2.0 ); // returns 2.0 max = accumulator( 1.0 ); @@ -79,19 +79,15 @@ max = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmaxabs = require( '@stdlib/stats/incr/maxabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmaxabs = require( '@stdlib/stats/incr/maxabs' ); // Initialize an accumulator: -accumulator = incrmaxabs(); +const accumulator = incrmaxabs(); // For each simulated datum, update the maximum absolute value... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mcovariance/README.md b/lib/node_modules/@stdlib/stats/incr/mcovariance/README.md index 77ecd5e859f0..60a1b973ca97 100644 --- a/lib/node_modules/@stdlib/stats/incr/mcovariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mcovariance/README.md @@ -65,7 +65,7 @@ For known population means, the [unbiased sample covariance][covariance] for a w ## Usage ```javascript -var incrmcovariance = require( '@stdlib/stats/incr/mcovariance' ); +const incrmcovariance = require( '@stdlib/stats/incr/mcovariance' ); ``` #### incrmcovariance( window\[, mx, my] ) @@ -73,13 +73,13 @@ var incrmcovariance = require( '@stdlib/stats/incr/mcovariance' ); Returns an accumulator `function` which incrementally computes a moving [unbiased sample covariance][covariance]. The `window` parameter defines the number of values over which to compute the moving [unbiased sample covariance][covariance]. ```javascript -var accumulator = incrmcovariance( 3 ); +const accumulator = incrmcovariance( 3 ); ``` If means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrmcovariance( 3, 5.0, -3.14 ); +const accumulator = incrmcovariance( 3, 5.0, -3.14 ); ``` #### accumulator( \[x, y] ) @@ -87,9 +87,9 @@ var accumulator = incrmcovariance( 3, 5.0, -3.14 ); If provided input values `x` and `y`, the accumulator function returns an updated [unbiased sample covariance][covariance]. If not provided input values `x` and `y`, the accumulator function returns the current [unbiased sample covariance][covariance]. ```javascript -var accumulator = incrmcovariance( 3 ); +const accumulator = incrmcovariance( 3 ); -var v = accumulator(); +let v = accumulator(); // returns null // Fill the window... @@ -135,21 +135,16 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmcovariance = require( '@stdlib/stats/incr/mcovariance' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmcovariance = require( '@stdlib/stats/incr/mcovariance' ); // Initialize an accumulator: -accumulator = incrmcovariance( 5 ); +const accumulator = incrmcovariance( 5 ); // For each simulated datum, update the moving unbiased sample covariance... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mcv/README.md b/lib/node_modules/@stdlib/stats/incr/mcv/README.md index 154e5de82597..d6a365dbadff 100644 --- a/lib/node_modules/@stdlib/stats/incr/mcv/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mcv/README.md @@ -74,7 +74,7 @@ The [coefficient of variation][coefficient-of-variation] (also known as **relati ## Usage ```javascript -var incrmcv = require( '@stdlib/stats/incr/mcv' ); +const incrmcv = require( '@stdlib/stats/incr/mcv' ); ``` #### incrmcv( window\[, mean] ) @@ -82,13 +82,13 @@ var incrmcv = require( '@stdlib/stats/incr/mcv' ); Returns an accumulator `function` which incrementally computes a moving [coefficient of variation][coefficient-of-variation]. The `window` parameter defines the number of values over which to compute the moving [coefficient of variation][coefficient-of-variation]. ```javascript -var accumulator = incrmcv( 3 ); +const accumulator = incrmcv( 3 ); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrmcv( 3, 5.0 ); +const accumulator = incrmcv( 3, 5.0 ); ``` #### accumulator( \[x] ) @@ -96,9 +96,9 @@ var accumulator = incrmcv( 3, 5.0 ); If provided an input value `x`, the accumulator function returns an updated accumulated value. If not provided an input value `x`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrmcv( 3 ); +const accumulator = incrmcv( 3 ); -var cv = accumulator(); +let cv = accumulator(); // returns null // Fill the window... @@ -146,19 +146,15 @@ cv = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmcv = require( '@stdlib/stats/incr/mcv' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmcv = require( '@stdlib/stats/incr/mcv' ); // Initialize an accumulator: -accumulator = incrmcv( 5 ); +const accumulator = incrmcv( 5 ); // For each simulated datum, update the moving coefficient of variation... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mda/README.md b/lib/node_modules/@stdlib/stats/incr/mda/README.md index 90ae53089f8c..9f98b2fe9520 100644 --- a/lib/node_modules/@stdlib/stats/incr/mda/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mda/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value, `a_i` is the actual value, `sgn(x)` is the [s ## Usage ```javascript -var incrmda = require( '@stdlib/stats/incr/mda' ); +const incrmda = require( '@stdlib/stats/incr/mda' ); ``` #### incrmda() @@ -58,7 +58,7 @@ var incrmda = require( '@stdlib/stats/incr/mda' ); Returns an accumulator `function` which incrementally computes the [mean directional accuracy][mean-directional-accuracy]. ```javascript -var accumulator = incrmda(); +const accumulator = incrmda(); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmda(); If provided input values `f` and `a`, the accumulator function returns an updated [mean directional accuracy][mean-directional-accuracy]. If not provided input values `f` and `a`, the accumulator function returns the current [mean directional accuracy][mean-directional-accuracy]. ```javascript -var accumulator = incrmda(); +const accumulator = incrmda(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns 1.0 m = accumulator( -1.0, 4.0 ); @@ -102,21 +102,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmda = require( '@stdlib/stats/incr/mda' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmda = require( '@stdlib/stats/incr/mda' ); // Initialize an accumulator: -accumulator = incrmda(); +const accumulator = incrmda(); // For each simulated datum, update the mean directional accuracy... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/me/README.md b/lib/node_modules/@stdlib/stats/incr/me/README.md index 715d779a5c91..a73d08a2c066 100644 --- a/lib/node_modules/@stdlib/stats/incr/me/README.md +++ b/lib/node_modules/@stdlib/stats/incr/me/README.md @@ -48,7 +48,7 @@ The [mean error][mean-absolute-error] is defined as ## Usage ```javascript -var incrme = require( '@stdlib/stats/incr/me' ); +const incrme = require( '@stdlib/stats/incr/me' ); ``` #### incrme() @@ -56,7 +56,7 @@ var incrme = require( '@stdlib/stats/incr/me' ); Returns an accumulator `function` which incrementally computes the [mean error][mean-absolute-error]. ```javascript -var accumulator = incrme(); +const accumulator = incrme(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrme(); If provided input values `x` and `y`, the accumulator function returns an updated [mean error][mean-absolute-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean error][mean-absolute-error]. ```javascript -var accumulator = incrme(); +const accumulator = incrme(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns 1.0 m = accumulator( -1.0, -4.0 ); @@ -102,21 +102,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrme = require( '@stdlib/stats/incr/me' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrme = require( '@stdlib/stats/incr/me' ); // Initialize an accumulator: -accumulator = incrme(); +const accumulator = incrme(); // For each simulated datum, update the mean error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mean/README.md b/lib/node_modules/@stdlib/stats/incr/mean/README.md index 1022d5cdfcff..64335b9b745f 100644 --- a/lib/node_modules/@stdlib/stats/incr/mean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mean/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var incrmean = require( '@stdlib/stats/incr/mean' ); +const incrmean = require( '@stdlib/stats/incr/mean' ); ``` #### incrmean() @@ -56,7 +56,7 @@ var incrmean = require( '@stdlib/stats/incr/mean' ); Returns an accumulator `function` which incrementally computes an [arithmetic mean][arithmetic-mean]. ```javascript -var accumulator = incrmean(); +const accumulator = incrmean(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmean(); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmean(); +const accumulator = incrmean(); -var mu = accumulator( 2.0 ); +let mu = accumulator( 2.0 ); // returns 2.0 mu = accumulator( 1.0 ); @@ -100,19 +100,15 @@ mu = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmean = require( '@stdlib/stats/incr/mean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmean = require( '@stdlib/stats/incr/mean' ); // Initialize an accumulator: -accumulator = incrmean(); +const accumulator = incrmean(); // For each simulated datum, update the mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/meanabs/README.md b/lib/node_modules/@stdlib/stats/incr/meanabs/README.md index 96c2ae5dab5f..727d4784198a 100644 --- a/lib/node_modules/@stdlib/stats/incr/meanabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/meanabs/README.md @@ -48,7 +48,7 @@ The [arithmetic mean][arithmetic-mean] of absolute values is defined as ## Usage ```javascript -var incrmeanabs = require( '@stdlib/stats/incr/meanabs' ); +const incrmeanabs = require( '@stdlib/stats/incr/meanabs' ); ``` #### incrmeanabs() @@ -56,7 +56,7 @@ var incrmeanabs = require( '@stdlib/stats/incr/meanabs' ); Returns an accumulator `function` which incrementally computes an [arithmetic mean][arithmetic-mean] of absolute values. ```javascript -var accumulator = incrmeanabs(); +const accumulator = incrmeanabs(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmeanabs(); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmeanabs(); +const accumulator = incrmeanabs(); -var mu = accumulator( 2.0 ); +let mu = accumulator( 2.0 ); // returns 2.0 mu = accumulator( -1.0 ); @@ -100,19 +100,15 @@ mu = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmeanabs = require( '@stdlib/stats/incr/meanabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmeanabs = require( '@stdlib/stats/incr/meanabs' ); // Initialize an accumulator: -accumulator = incrmeanabs(); +const accumulator = incrmeanabs(); // For each simulated datum, update the mean... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/meanabs2/README.md b/lib/node_modules/@stdlib/stats/incr/meanabs2/README.md index c5a93e3c13e4..cf0ebdef9ef4 100644 --- a/lib/node_modules/@stdlib/stats/incr/meanabs2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/meanabs2/README.md @@ -48,7 +48,7 @@ m = \frac{1}{n} \sum_{i=0}^{n-1} x_i^2 ## Usage ```javascript -var incrmeanabs2 = require( '@stdlib/stats/incr/meanabs2' ); +const incrmeanabs2 = require( '@stdlib/stats/incr/meanabs2' ); ``` #### incrmeanabs2() @@ -56,7 +56,7 @@ var incrmeanabs2 = require( '@stdlib/stats/incr/meanabs2' ); Returns an accumulator `function` which incrementally computes an [arithmetic mean][arithmetic-mean] of squared absolute values. ```javascript -var accumulator = incrmeanabs2(); +const accumulator = incrmeanabs2(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmeanabs2(); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmeanabs2(); +const accumulator = incrmeanabs2(); -var m = accumulator( 2.0 ); +let m = accumulator( 2.0 ); // returns 4.0 m = accumulator( -1.0 ); @@ -100,19 +100,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmeanabs2 = require( '@stdlib/stats/incr/meanabs2' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmeanabs2 = require( '@stdlib/stats/incr/meanabs2' ); // Initialize an accumulator: -accumulator = incrmeanabs2(); +const accumulator = incrmeanabs2(); // For each simulated datum, update the mean... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/meanstdev/README.md b/lib/node_modules/@stdlib/stats/incr/meanstdev/README.md index 4bf9c2ee1a67..b4ea3453a698 100644 --- a/lib/node_modules/@stdlib/stats/incr/meanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/incr/meanstdev/README.md @@ -59,7 +59,7 @@ s = \sqrt{\frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2} ## Usage ```javascript -var incrmeanstdev = require( '@stdlib/stats/incr/meanstdev' ); +const incrmeanstdev = require( '@stdlib/stats/incr/meanstdev' ); ``` #### incrmeanstdev( \[out] ) @@ -67,15 +67,15 @@ var incrmeanstdev = require( '@stdlib/stats/incr/meanstdev' ); Returns an accumulator `function` which incrementally computes an [arithmetic mean][arithmetic-mean] and [corrected sample standard deviation][sample-stdev]. ```javascript -var accumulator = incrmeanstdev(); +const accumulator = incrmeanstdev(); ``` By default, the returned accumulator `function` returns the accumulated values as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmeanstdev( new Float64Array( 2 ) ); +const accumulator = incrmeanstdev( new Float64Array( 2 ) ); ``` #### accumulator( \[x] ) @@ -83,9 +83,9 @@ var accumulator = incrmeanstdev( new Float64Array( 2 ) ); If provided an input value `x`, the accumulator function returns updated accumulated values. If not provided an input value `x`, the accumulator function returns the current accumulated values. ```javascript -var accumulator = incrmeanstdev(); +const accumulator = incrmeanstdev(); -var ms = accumulator(); +let ms = accumulator(); // returns null ms = accumulator( 2.0 ); @@ -128,52 +128,42 @@ ms = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var incrmeanstdev = require( '@stdlib/stats/incr/meanstdev' ); - -var offset; -var acc; -var buf; -var out; -var ms; -var N; -var v; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const incrmeanstdev = require( '@stdlib/stats/incr/meanstdev' ); // Define the number of accumulators: -N = 5; +const N = 5; // Create an array buffer for storing accumulator output: -buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element +const buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element // Initialize accumulators: -acc = []; -for ( i = 0; i < N; i++ ) { +const acc = []; +for ( let i = 0; i < N; i++ ) { // Compute the byte offset: - offset = i * 2 * 8; // stride=2, bytes_per_element=8 + const offset = i * 2 * 8; // stride=2, bytes_per_element=8 // Create a new view for storing accumulated values: - out = new Float64Array( buf, offset, 2 ); + const out = new Float64Array( buf, offset, 2 ); // Initialize an accumulator which will write results to the view: acc.push( incrmeanstdev( out ) ); } // Simulate data and update the sample means and standard deviations... -for ( i = 0; i < 100; i++ ) { - for ( j = 0; j < N; j++ ) { - v = randu() * 100.0 * (j+1); +for ( let i = 0; i < 100; i++ ) { + for ( let j = 0; j < N; j++ ) { + const v = randu() * 100.0 * (j+1); acc[ j ]( v ); } } // Print the final results: console.log( 'Mean\tStDev' ); -for ( i = 0; i < N; i++ ) { - ms = acc[ i ](); +for ( let i = 0; i < N; i++ ) { + const ms = acc[ i ](); console.log( '%d\t%d', ms[ 0 ].toFixed( 3 ), ms[ 1 ].toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/incr/meanvar/README.md b/lib/node_modules/@stdlib/stats/incr/meanvar/README.md index ad09f19d50a3..bbcc39c3c166 100644 --- a/lib/node_modules/@stdlib/stats/incr/meanvar/README.md +++ b/lib/node_modules/@stdlib/stats/incr/meanvar/README.md @@ -59,7 +59,7 @@ s^2 = \frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2 ## Usage ```javascript -var incrmeanvar = require( '@stdlib/stats/incr/meanvar' ); +const incrmeanvar = require( '@stdlib/stats/incr/meanvar' ); ``` #### incrmeanvar( \[out] ) @@ -67,15 +67,15 @@ var incrmeanvar = require( '@stdlib/stats/incr/meanvar' ); Returns an accumulator `function` which incrementally computes an [arithmetic mean][arithmetic-mean] and [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrmeanvar(); +const accumulator = incrmeanvar(); ``` By default, the returned accumulator `function` returns the accumulated values as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmeanvar( new Float64Array( 2 ) ); +const accumulator = incrmeanvar( new Float64Array( 2 ) ); ``` #### accumulator( \[x] ) @@ -83,9 +83,9 @@ var accumulator = incrmeanvar( new Float64Array( 2 ) ); If provided an input value `x`, the accumulator function returns updated accumulated values. If not provided an input value `x`, the accumulator function returns the current accumulated values. ```javascript -var accumulator = incrmeanvar(); +const accumulator = incrmeanvar(); -var mv = accumulator(); +let mv = accumulator(); // returns null mv = accumulator( 2.0 ); @@ -128,52 +128,42 @@ mv = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var incrmeanvar = require( '@stdlib/stats/incr/meanvar' ); - -var offset; -var acc; -var buf; -var out; -var mv; -var N; -var v; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const incrmeanvar = require( '@stdlib/stats/incr/meanvar' ); // Define the number of accumulators: -N = 5; +const N = 5; // Create an array buffer for storing accumulator output: -buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element +const buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element // Initialize accumulators: -acc = []; -for ( i = 0; i < N; i++ ) { +const acc = []; +for ( let i = 0; i < N; i++ ) { // Compute the byte offset: - offset = i * 2 * 8; // stride=2, bytes_per_element=8 + const offset = i * 2 * 8; // stride=2, bytes_per_element=8 // Create a new view for storing accumulated values: - out = new Float64Array( buf, offset, 2 ); + const out = new Float64Array( buf, offset, 2 ); // Initialize an accumulator which will write results to the view: acc.push( incrmeanvar( out ) ); } // Simulate data and update the sample means and variances... -for ( i = 0; i < 100; i++ ) { - for ( j = 0; j < N; j++ ) { - v = randu() * 100.0 * (j+1); +for ( let i = 0; i < 100; i++ ) { + for ( let j = 0; j < N; j++ ) { + const v = randu() * 100.0 * (j+1); acc[ j ]( v ); } } // Print the final results: console.log( 'Mean\tVariance' ); -for ( i = 0; i < N; i++ ) { - mv = acc[ i ](); +for ( let i = 0; i < N; i++ ) { + const mv = acc[ i ](); console.log( '%d\t%d', mv[ 0 ].toFixed( 3 ), mv[ 1 ].toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/incr/mgmean/README.md b/lib/node_modules/@stdlib/stats/incr/mgmean/README.md index 531630d29e5a..8fb28d9fa9a4 100644 --- a/lib/node_modules/@stdlib/stats/incr/mgmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mgmean/README.md @@ -48,7 +48,7 @@ The [geometric mean][geometric-mean] is defined as the nth root of a product of ## Usage ```javascript -var incrmgmean = require( '@stdlib/stats/incr/mgmean' ); +const incrmgmean = require( '@stdlib/stats/incr/mgmean' ); ``` #### incrmgmean( window ) @@ -56,7 +56,7 @@ var incrmgmean = require( '@stdlib/stats/incr/mgmean' ); Returns an accumulator `function` which incrementally computes a moving [geometric mean][geometric-mean]. The `window` parameter defines the number of values over which to compute the moving [geometric mean][geometric-mean]. ```javascript -var accumulator = incrmgmean( 3 ); +const accumulator = incrmgmean( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmgmean( 3 ); If provided an input value `x`, the accumulator function returns an updated [geometric mean][geometric-mean]. If not provided an input value `x`, the accumulator function returns the current [geometric-mean][geometric-mean]. ```javascript -var accumulator = incrmgmean( 3 ); +const accumulator = incrmgmean( 3 ); -var v = accumulator(); +let v = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmgmean = require( '@stdlib/stats/incr/mgmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmgmean = require( '@stdlib/stats/incr/mgmean' ); // Initialize an accumulator: -accumulator = incrmgmean( 5 ); +const accumulator = incrmgmean( 5 ); // For each simulated datum, update the moving geometric mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mgrubbs/README.md b/lib/node_modules/@stdlib/stats/incr/mgrubbs/README.md index e6039fe468db..5964caad716a 100644 --- a/lib/node_modules/@stdlib/stats/incr/mgrubbs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mgrubbs/README.md @@ -119,7 +119,7 @@ where `t` denotes the upper critical value of the _t_-distribution with `W-2` de ## Usage ```javascript -var incrmgrubbs = require( '@stdlib/stats/incr/mgrubbs' ); +const incrmgrubbs = require( '@stdlib/stats/incr/mgrubbs' ); ``` #### incrmgrubbs( window\[, options] ) @@ -127,7 +127,7 @@ var incrmgrubbs = require( '@stdlib/stats/incr/mgrubbs' ); Returns an accumulator `function` which incrementally performs [Grubbs' test][grubbs-test] for outliers. The `window` parameter defines the number of values over which to perform [Grubbs' test][grubbs-test]. ```javascript -var accumulator = incrmgrubbs( 20 ); +const accumulator = incrmgrubbs( 20 ); ``` The function accepts the following `options`: @@ -147,11 +147,11 @@ The function accepts the following `options`: If provided an input value `x`, the accumulator function returns updated test results. If not provided an input value `x`, the accumulator function returns the current test results. ```javascript -var rnorm = require( '@stdlib/random/base/normal' ); +const rnorm = require( '@stdlib/random/base/normal' ); -var accumulator = incrmgrubbs( 3 ); +const accumulator = incrmgrubbs( 3 ); -var results = accumulator( rnorm( 10.0, 5.0 ) ); +let results = accumulator( rnorm( 10.0, 5.0 ) ); // returns null results = accumulator( rnorm( 10.0, 5.0 ) ); @@ -208,20 +208,13 @@ The `print` method accepts the following options: ```javascript -var sensorData = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); -var incrmgrubbs = require( '@stdlib/stats/incr/mgrubbs' ); - -var data; -var opts; -var acc; -var N; -var r; -var i; +const sensorData = require( '@stdlib/datasets/suthaharan-single-hop-sensor-network' ); +const incrmgrubbs = require( '@stdlib/stats/incr/mgrubbs' ); // Get a test dataset: -data = sensorData(); -N = 0; -for ( i = 0; i < data.length; i++ ) { +const data = sensorData(); +let N = 0; +for ( let i = 0; i < data.length; i++ ) { if ( data[ i ].mote_id === 1 ) { N += 1; data[ i ] = data[ i ].temperature; @@ -230,14 +223,14 @@ for ( i = 0; i < data.length; i++ ) { data.length = N; // Create a new accumulator which analyzes the last 5 minutes of data: -opts = { +const opts = { 'alternative': 'two-sided' }; -acc = incrmgrubbs( 60, opts ); +const acc = incrmgrubbs( 60, opts ); // Update the accumulator: -for ( i = 0; i < data.length; i++ ) { - r = acc( data[ i ] ); +for ( let i = 0; i < data.length; i++ ) { + const r = acc( data[ i ] ); if ( r && r.rejected ) { console.log( 'Index: %d', i ); console.log( '' ); diff --git a/lib/node_modules/@stdlib/stats/incr/mhmean/README.md b/lib/node_modules/@stdlib/stats/incr/mhmean/README.md index c08c38b60065..a0dc435f803d 100644 --- a/lib/node_modules/@stdlib/stats/incr/mhmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mhmean/README.md @@ -48,7 +48,7 @@ The [harmonic mean][harmonic-mean] of positive real numbers `x_0, x_1, ..., x_{n ## Usage ```javascript -var incrmhmean = require( '@stdlib/stats/incr/mhmean' ); +const incrmhmean = require( '@stdlib/stats/incr/mhmean' ); ``` #### incrmhmean( window ) @@ -56,7 +56,7 @@ var incrmhmean = require( '@stdlib/stats/incr/mhmean' ); Returns an accumulator `function` which incrementally computes a moving [harmonic mean][harmonic-mean]. The `window` parameter defines the number of values over which to compute the moving [harmonic mean][harmonic-mean]. ```javascript -var accumulator = incrmhmean( 3 ); +const accumulator = incrmhmean( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmhmean( 3 ); If provided an input value `x`, the accumulator function returns an updated [harmonic mean][harmonic-mean]. If not provided an input value `x`, the accumulator function returns the current [harmonic-mean][harmonic-mean]. ```javascript -var accumulator = incrmhmean( 3 ); +const accumulator = incrmhmean( 3 ); -var v = accumulator(); +let v = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmhmean = require( '@stdlib/stats/incr/mhmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmhmean = require( '@stdlib/stats/incr/mhmean' ); // Initialize an accumulator: -accumulator = incrmhmean( 5 ); +const accumulator = incrmhmean( 5 ); // For each simulated datum, update the moving harmonic mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/midrange/README.md b/lib/node_modules/@stdlib/stats/incr/midrange/README.md index 30f1b4cf35d6..460305a0569a 100644 --- a/lib/node_modules/@stdlib/stats/incr/midrange/README.md +++ b/lib/node_modules/@stdlib/stats/incr/midrange/README.md @@ -35,7 +35,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of ma ## Usage ```javascript -var incrmidrange = require( '@stdlib/stats/incr/midrange' ); +const incrmidrange = require( '@stdlib/stats/incr/midrange' ); ``` #### incrmidrange() @@ -43,7 +43,7 @@ var incrmidrange = require( '@stdlib/stats/incr/midrange' ); Returns an accumulator `function` which incrementally computes a [mid-range][mid-range]. ```javascript -var accumulator = incrmidrange(); +const accumulator = incrmidrange(); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrmidrange(); If provided an input value `x`, the accumulator function returns an updated [mid-range][mid-range]. If not provided an input value `x`, the accumulator function returns the current [mid-range][mid-range]. ```javascript -var accumulator = incrmidrange(); +const accumulator = incrmidrange(); -var midrange = accumulator(); +let midrange = accumulator(); // returns null midrange = accumulator( -2.0 ); @@ -90,19 +90,15 @@ midrange = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmidrange = require( '@stdlib/stats/incr/midrange' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmidrange = require( '@stdlib/stats/incr/midrange' ); // Initialize an accumulator: -accumulator = incrmidrange(); +const accumulator = incrmidrange(); // For each simulated datum, update the mid-range... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/min/README.md b/lib/node_modules/@stdlib/stats/incr/min/README.md index e59dbcd17409..eea91c208c82 100644 --- a/lib/node_modules/@stdlib/stats/incr/min/README.md +++ b/lib/node_modules/@stdlib/stats/incr/min/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmin = require( '@stdlib/stats/incr/min' ); +const incrmin = require( '@stdlib/stats/incr/min' ); ``` #### incrmin() @@ -35,7 +35,7 @@ var incrmin = require( '@stdlib/stats/incr/min' ); Returns an accumulator `function` which incrementally computes a minimum value. ```javascript -var accumulator = incrmin(); +const accumulator = incrmin(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmin(); If provided an input value `x`, the accumulator function returns an updated minimum value. If not provided an input value `x`, the accumulator function returns the current minimum value. ```javascript -var accumulator = incrmin(); +const accumulator = incrmin(); -var min = accumulator( 2.0 ); +let min = accumulator( 2.0 ); // returns 2.0 min = accumulator( 1.0 ); @@ -79,19 +79,15 @@ min = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmin = require( '@stdlib/stats/incr/min' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmin = require( '@stdlib/stats/incr/min' ); // Initialize an accumulator: -accumulator = incrmin(); +const accumulator = incrmin(); // For each simulated datum, update the min... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/minabs/README.md b/lib/node_modules/@stdlib/stats/incr/minabs/README.md index ec3b76e06c58..8c5de7e2c07e 100644 --- a/lib/node_modules/@stdlib/stats/incr/minabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/minabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrminabs = require( '@stdlib/stats/incr/minabs' ); +const incrminabs = require( '@stdlib/stats/incr/minabs' ); ``` #### incrminabs() @@ -35,7 +35,7 @@ var incrminabs = require( '@stdlib/stats/incr/minabs' ); Returns an accumulator `function` which incrementally computes a minimum absolute value. ```javascript -var accumulator = incrminabs(); +const accumulator = incrminabs(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrminabs(); If provided an input value `x`, the accumulator function returns an updated minimum absolute value. If not provided an input value `x`, the accumulator function returns the current minimum absolute value. ```javascript -var accumulator = incrminabs(); +const accumulator = incrminabs(); -var min = accumulator( 2.0 ); +let min = accumulator( 2.0 ); // returns 2.0 min = accumulator( 1.0 ); @@ -79,19 +79,15 @@ min = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrminabs = require( '@stdlib/stats/incr/minabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrminabs = require( '@stdlib/stats/incr/minabs' ); // Initialize an accumulator: -accumulator = incrminabs(); +const accumulator = incrminabs(); // For each simulated datum, update the minimum absolute value... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/minmax/README.md b/lib/node_modules/@stdlib/stats/incr/minmax/README.md index 5712b66e9269..ae7e6d16985e 100644 --- a/lib/node_modules/@stdlib/stats/incr/minmax/README.md +++ b/lib/node_modules/@stdlib/stats/incr/minmax/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrminmax = require( '@stdlib/stats/incr/minmax' ); +const incrminmax = require( '@stdlib/stats/incr/minmax' ); ``` #### incrminmax( \[out] ) @@ -35,15 +35,15 @@ var incrminmax = require( '@stdlib/stats/incr/minmax' ); Returns an accumulator `function` which incrementally computes a minimum and maximum. ```javascript -var accumulator = incrminmax(); +const accumulator = incrminmax(); ``` By default, the returned accumulator `function` returns the minimum and maximum as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrminmax( new Float64Array( 2 ) ); +const accumulator = incrminmax( new Float64Array( 2 ) ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrminmax( new Float64Array( 2 ) ); If provided an input value `x`, the accumulator function returns updated minimum and maximum values. If not provided an input value `x`, the accumulator function returns the current minimum and maximum values. ```javascript -var accumulator = incrminmax(); +const accumulator = incrminmax(); -var mm = accumulator(); +let mm = accumulator(); // returns null mm = accumulator( 2.0 ); @@ -96,19 +96,15 @@ mm = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrminmax = require( '@stdlib/stats/incr/minmax' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrminmax = require( '@stdlib/stats/incr/minmax' ); // Initialize an accumulator: -accumulator = incrminmax(); +const accumulator = incrminmax(); // For each simulated datum, update the minimum and maximum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/minmaxabs/README.md b/lib/node_modules/@stdlib/stats/incr/minmaxabs/README.md index b934dee08255..acf9d9e62121 100644 --- a/lib/node_modules/@stdlib/stats/incr/minmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/minmaxabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrminmaxabs = require( '@stdlib/stats/incr/minmaxabs' ); +const incrminmaxabs = require( '@stdlib/stats/incr/minmaxabs' ); ``` #### incrminmaxabs( \[out] ) @@ -35,15 +35,15 @@ var incrminmaxabs = require( '@stdlib/stats/incr/minmaxabs' ); Returns an accumulator `function` which incrementally computes minimum and maximum absolute values. ```javascript -var accumulator = incrminmaxabs(); +const accumulator = incrminmaxabs(); ``` By default, the returned accumulator `function` returns the minimum and maximum absolute values as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrminmaxabs( new Float64Array( 2 ) ); +const accumulator = incrminmaxabs( new Float64Array( 2 ) ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrminmaxabs( new Float64Array( 2 ) ); If provided an input value `x`, the accumulator function returns updated minimum and maximum absolute values. If not provided an input value `x`, the accumulator function returns the current minimum and maximum absolute values. ```javascript -var accumulator = incrminmaxabs(); +const accumulator = incrminmaxabs(); -var mm = accumulator(); +let mm = accumulator(); // returns null mm = accumulator( 2.0 ); @@ -96,19 +96,15 @@ mm = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrminmaxabs = require( '@stdlib/stats/incr/minmaxabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrminmaxabs = require( '@stdlib/stats/incr/minmaxabs' ); // Initialize an accumulator: -accumulator = incrminmaxabs(); +const accumulator = incrminmaxabs(); // For each simulated datum, update the minimum and maximum absolute values... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmaape/README.md b/lib/node_modules/@stdlib/stats/incr/mmaape/README.md index f49ad1ae981f..6eb514c01046 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmaape/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmaape/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmmaape = require( '@stdlib/stats/incr/mmaape' ); +const incrmmaape = require( '@stdlib/stats/incr/mmaape' ); ``` #### incrmmaape( window ) @@ -58,7 +58,7 @@ var incrmmaape = require( '@stdlib/stats/incr/mmaape' ); Returns an accumulator `function` which incrementally computes a moving [mean arctangent absolute percentage error][@kim:2016a]. The `window` parameter defines the number of values over which to compute the moving [mean arctangent absolute percentage error][@kim:2016a]. ```javascript -var accumulator = incrmmaape( 3 ); +const accumulator = incrmmaape( 3 ); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmmaape( 3 ); If provided input values `f` and `a`, the accumulator function returns an updated [mean arctangent absolute percentage error][@kim:2016a]. If not provided input values `f` and `a`, the accumulator function returns the current [mean arctangent absolute percentage error][@kim:2016a]. ```javascript -var accumulator = incrmmaape( 3 ); +const accumulator = incrmmaape( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -115,21 +115,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmaape = require( '@stdlib/stats/incr/mmaape' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmaape = require( '@stdlib/stats/incr/mmaape' ); // Initialize an accumulator: -accumulator = incrmmaape( 5 ); +const accumulator = incrmmaape( 5 ); // For each simulated datum, update the moving mean arctangent absolute percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmae/README.md b/lib/node_modules/@stdlib/stats/incr/mmae/README.md index 2ea353d88c80..66215584e1ef 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmae/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmae/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [mean absolute error][mean-absolute-error] is defi ## Usage ```javascript -var incrmmae = require( '@stdlib/stats/incr/mmae' ); +const incrmmae = require( '@stdlib/stats/incr/mmae' ); ``` #### incrmmae( window ) @@ -56,7 +56,7 @@ var incrmmae = require( '@stdlib/stats/incr/mmae' ); Returns an accumulator `function` which incrementally computes a moving [mean absolute error][mean-absolute-error]. The `window` parameter defines the number of values over which to compute the moving [mean absolute error][mean-absolute-error]. ```javascript -var accumulator = incrmmae( 3 ); +const accumulator = incrmmae( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmmae( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated [mean absolute error][mean-absolute-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean absolute error][mean-absolute-error]. ```javascript -var accumulator = incrmmae( 3 ); +const accumulator = incrmmae( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -113,21 +113,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmae = require( '@stdlib/stats/incr/mmae' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmae = require( '@stdlib/stats/incr/mmae' ); // Initialize an accumulator: -accumulator = incrmmae( 5 ); +const accumulator = incrmmae( 5 ); // For each simulated datum, update the moving mean absolute error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmape/README.md b/lib/node_modules/@stdlib/stats/incr/mmape/README.md index 0aace4a7bf3d..61e094f9ff5c 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmape/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmape/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmmape = require( '@stdlib/stats/incr/mmape' ); +const incrmmape = require( '@stdlib/stats/incr/mmape' ); ``` #### incrmmape( window ) @@ -58,7 +58,7 @@ var incrmmape = require( '@stdlib/stats/incr/mmape' ); Returns an accumulator `function` which incrementally computes a moving [mean absolute percentage error][mean-absolute-percentage-error]. The `window` parameter defines the number of values over which to compute the moving [mean absolute percentage error][mean-absolute-percentage-error]. ```javascript -var accumulator = incrmmape( 3 ); +const accumulator = incrmmape( 3 ); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmmape( 3 ); If provided input values `f` and `a`, the accumulator function returns an updated [mean absolute percentage error][mean-absolute-percentage-error]. If not provided input values `f` and `a`, the accumulator function returns the current [mean absolute percentage error][mean-absolute-percentage-error]. ```javascript -var accumulator = incrmmape( 3 ); +const accumulator = incrmmape( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -121,21 +121,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmape = require( '@stdlib/stats/incr/mmape' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmape = require( '@stdlib/stats/incr/mmape' ); // Initialize an accumulator: -accumulator = incrmmape( 5 ); +const accumulator = incrmmape( 5 ); // For each simulated datum, update the moving mean absolute percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmax/README.md b/lib/node_modules/@stdlib/stats/incr/mmax/README.md index f997548ae83c..a3d0d95bb1cf 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmax/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmax/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmmax = require( '@stdlib/stats/incr/mmax' ); +const incrmmax = require( '@stdlib/stats/incr/mmax' ); ``` #### incrmmax( window ) @@ -35,7 +35,7 @@ var incrmmax = require( '@stdlib/stats/incr/mmax' ); Returns an accumulator `function` which incrementally computes a moving maximum value. The `window` parameter defines the number of values over which to compute the moving maximum. ```javascript -var accumulator = incrmmax( 3 ); +const accumulator = incrmmax( 3 ); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmmax( 3 ); If provided an input value `x`, the accumulator function returns an updated maximum value. If not provided an input value `x`, the accumulator function returns the current maximum value. ```javascript -var accumulator = incrmmax( 3 ); +const accumulator = incrmmax( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -91,19 +91,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmax = require( '@stdlib/stats/incr/mmax' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmax = require( '@stdlib/stats/incr/mmax' ); // Initialize an accumulator: -accumulator = incrmmax( 5 ); +const accumulator = incrmmax( 5 ); // For each simulated datum, update the moving maximum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmaxabs/README.md b/lib/node_modules/@stdlib/stats/incr/mmaxabs/README.md index 8970650dfada..f97965af4299 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmaxabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmmaxabs = require( '@stdlib/stats/incr/mmaxabs' ); +const incrmmaxabs = require( '@stdlib/stats/incr/mmaxabs' ); ``` #### incrmmaxabs( window ) @@ -35,7 +35,7 @@ var incrmmaxabs = require( '@stdlib/stats/incr/mmaxabs' ); Returns an accumulator `function` which incrementally computes a moving maximum absolute value. The `window` parameter defines the number of values over which to compute the moving maximum absolute value. ```javascript -var accumulator = incrmmaxabs( 3 ); +const accumulator = incrmmaxabs( 3 ); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmmaxabs( 3 ); If provided an input value `x`, the accumulator function returns an updated maximum absolute value. If not provided an input value `x`, the accumulator function returns the current maximum absolute value. ```javascript -var accumulator = incrmmaxabs( 3 ); +const accumulator = incrmmaxabs( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -91,19 +91,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmaxabs = require( '@stdlib/stats/incr/mmaxabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmaxabs = require( '@stdlib/stats/incr/mmaxabs' ); // Initialize an accumulator: -accumulator = incrmmaxabs( 5 ); +const accumulator = incrmmaxabs( 5 ); // For each simulated datum, update the moving maximum absolute value... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmda/README.md b/lib/node_modules/@stdlib/stats/incr/mmda/README.md index 9eb3c28be33e..a4c3798ee223 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmda/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmda/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value, `a_i` is the actual value, `sgn(x)` is the [s ## Usage ```javascript -var incrmmda = require( '@stdlib/stats/incr/mmda' ); +const incrmmda = require( '@stdlib/stats/incr/mmda' ); ``` #### incrmmda( window ) @@ -58,7 +58,7 @@ var incrmmda = require( '@stdlib/stats/incr/mmda' ); Returns an accumulator `function` which incrementally computes a moving [mean directional accuracy][mean-directional-accuracy]. The `window` parameter defines the number of values over which to compute the moving [mean directional accuracy][mean-directional-accuracy]. ```javascript -var accumulator = incrmmda( 3 ); +const accumulator = incrmmda( 3 ); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmmda( 3 ); If provided input values `f` and `a`, the accumulator function returns an updated [mean directional accuracy][mean-directional-accuracy]. If not provided input values `f` and `a`, the accumulator function returns the current [mean directional accuracy][mean-directional-accuracy]. ```javascript -var accumulator = incrmmda( 3 ); +const accumulator = incrmmda( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -114,21 +114,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmda = require( '@stdlib/stats/incr/mmda' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmda = require( '@stdlib/stats/incr/mmda' ); // Initialize an accumulator: -accumulator = incrmmda( 5 ); +const accumulator = incrmmda( 5 ); // For each simulated datum, update the moving mean directional accuracy... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mme/README.md b/lib/node_modules/@stdlib/stats/incr/mme/README.md index 3871deb296b0..23ea113ac19c 100644 --- a/lib/node_modules/@stdlib/stats/incr/mme/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mme/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [mean error][mean-absolute-error] is defined as ## Usage ```javascript -var incrmme = require( '@stdlib/stats/incr/mme' ); +const incrmme = require( '@stdlib/stats/incr/mme' ); ``` #### incrmme( window ) @@ -56,7 +56,7 @@ var incrmme = require( '@stdlib/stats/incr/mme' ); Returns an accumulator `function` which incrementally computes a moving [mean error][mean-absolute-error]. The `window` parameter defines the number of values over which to compute the moving [mean error][mean-absolute-error]. ```javascript -var accumulator = incrmme( 3 ); +const accumulator = incrmme( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmme( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated [mean error][mean-absolute-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean error][mean-absolute-error]. ```javascript -var accumulator = incrmme( 3 ); +const accumulator = incrmme( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -114,21 +114,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmme = require( '@stdlib/stats/incr/mme' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmme = require( '@stdlib/stats/incr/mme' ); // Initialize an accumulator: -accumulator = incrmme( 5 ); +const accumulator = incrmme( 5 ); // For each simulated datum, update the moving mean error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmean/README.md b/lib/node_modules/@stdlib/stats/incr/mmean/README.md index 96afb5cff895..f8ac07eabb57 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmean/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var incrmmean = require( '@stdlib/stats/incr/mmean' ); +const incrmmean = require( '@stdlib/stats/incr/mmean' ); ``` #### incrmmean( window ) @@ -56,7 +56,7 @@ var incrmmean = require( '@stdlib/stats/incr/mmean' ); Returns an accumulator `function` which incrementally computes a moving [arithmetic mean][arithmetic-mean]. The `window` parameter defines the number of values over which to compute the moving mean. ```javascript -var accumulator = incrmmean( 3 ); +const accumulator = incrmmean( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmmean( 3 ); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmmean( 3 ); +const accumulator = incrmmean( 3 ); -var mu = accumulator(); +let mu = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ mu = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmean = require( '@stdlib/stats/incr/mmean' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmean = require( '@stdlib/stats/incr/mmean' ); // Initialize an accumulator: -accumulator = incrmmean( 5 ); +const accumulator = incrmmean( 5 ); // For each simulated datum, update the moving mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmeanabs/README.md b/lib/node_modules/@stdlib/stats/incr/mmeanabs/README.md index 980173891d9a..e489b675d139 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmeanabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmeanabs/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [arithmetic mean][arithmetic-mean] of absolute val ## Usage ```javascript -var incrmmeanabs = require( '@stdlib/stats/incr/mmeanabs' ); +const incrmmeanabs = require( '@stdlib/stats/incr/mmeanabs' ); ``` #### incrmmeanabs( window ) @@ -56,7 +56,7 @@ var incrmmeanabs = require( '@stdlib/stats/incr/mmeanabs' ); Returns an accumulator `function` which incrementally computes a moving [arithmetic mean][arithmetic-mean] of absolute values. The `window` parameter defines the number of values over which to compute the moving mean. ```javascript -var accumulator = incrmmeanabs( 3 ); +const accumulator = incrmmeanabs( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmmeanabs( 3 ); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmmeanabs( 3 ); +const accumulator = incrmmeanabs( 3 ); -var mu = accumulator(); +let mu = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ mu = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmeanabs = require( '@stdlib/stats/incr/mmeanabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmeanabs = require( '@stdlib/stats/incr/mmeanabs' ); // Initialize an accumulator: -accumulator = incrmmeanabs( 5 ); +const accumulator = incrmmeanabs( 5 ); // For each simulated datum, update the moving mean... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmeanabs2/README.md b/lib/node_modules/@stdlib/stats/incr/mmeanabs2/README.md index ccb238bcc9c4..c854b5349263 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmeanabs2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmeanabs2/README.md @@ -48,7 +48,7 @@ m = \frac{1}{W} \sum_{i=0}^{W-1} x_i^2 ## Usage ```javascript -var incrmmeanabs2 = require( '@stdlib/stats/incr/mmeanabs2' ); +const incrmmeanabs2 = require( '@stdlib/stats/incr/mmeanabs2' ); ``` #### incrmmeanabs2( window ) @@ -56,7 +56,7 @@ var incrmmeanabs2 = require( '@stdlib/stats/incr/mmeanabs2' ); Returns an accumulator `function` which incrementally computes a moving [arithmetic mean][arithmetic-mean] of squared absolute values. The `window` parameter defines the number of values over which to compute the moving mean. ```javascript -var accumulator = incrmmeanabs2( 3 ); +const accumulator = incrmmeanabs2( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmmeanabs2( 3 ); If provided an input value `x`, the accumulator function returns an updated mean. If not provided an input value `x`, the accumulator function returns the current mean. ```javascript -var accumulator = incrmmeanabs2( 3 ); +const accumulator = incrmmeanabs2( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmeanabs2 = require( '@stdlib/stats/incr/mmeanabs2' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmeanabs2 = require( '@stdlib/stats/incr/mmeanabs2' ); // Initialize an accumulator: -accumulator = incrmmeanabs2( 5 ); +const accumulator = incrmmeanabs2( 5 ); // For each simulated datum, update the moving mean... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmeanstdev/README.md b/lib/node_modules/@stdlib/stats/incr/mmeanstdev/README.md index 7c9222bc2f19..ebd0aadf4e55 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmeanstdev/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmeanstdev/README.md @@ -63,7 +63,7 @@ s = \sqrt{\frac{1}{W-1} \sum_{i=0}^{W-1} ( x_i - \bar{x} )^2} ## Usage ```javascript -var incrmmeanstdev = require( '@stdlib/stats/incr/mmeanstdev' ); +const incrmmeanstdev = require( '@stdlib/stats/incr/mmeanstdev' ); ``` #### incrmmeanstdev( \[out,] window ) @@ -71,15 +71,15 @@ var incrmmeanstdev = require( '@stdlib/stats/incr/mmeanstdev' ); Returns an accumulator `function` which incrementally computes a moving [arithmetic mean][arithmetic-mean] and [corrected sample standard deviation][standard-deviation]. The `window` parameter defines the number of values over which to compute the moving [arithmetic mean][arithmetic-mean] and [corrected sample standard deviation][standard-deviation]. ```javascript -var accumulator = incrmmeanstdev( 3 ); +const accumulator = incrmmeanstdev( 3 ); ``` By default, the returned accumulator `function` returns the accumulated values as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmmeanstdev( new Float64Array( 2 ), 3 ); +const accumulator = incrmmeanstdev( new Float64Array( 2 ), 3 ); ``` #### accumulator( \[x] ) @@ -87,9 +87,9 @@ var accumulator = incrmmeanstdev( new Float64Array( 2 ), 3 ); If provided an input value `x`, the accumulator function returns updated accumulated values. If not provided an input value `x`, the accumulator function returns the current accumulated values. ```javascript -var accumulator = incrmmeanstdev( 3 ); +const accumulator = incrmmeanstdev( 3 ); -var out = accumulator(); +let out = accumulator(); // returns null // Fill the window... @@ -135,52 +135,42 @@ out = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var incrmmeanstdev = require( '@stdlib/stats/incr/mmeanstdev' ); - -var offset; -var acc; -var buf; -var out; -var ms; -var N; -var v; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const incrmmeanstdev = require( '@stdlib/stats/incr/mmeanstdev' ); // Define the number of accumulators: -N = 5; +const N = 5; // Create an array buffer for storing accumulator output: -buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element +const buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element // Initialize accumulators: -acc = []; -for ( i = 0; i < N; i++ ) { +const acc = []; +for ( let i = 0; i < N; i++ ) { // Compute the byte offset: - offset = i * 2 * 8; // stride=2, bytes_per_element=8 + const offset = i * 2 * 8; // stride=2, bytes_per_element=8 // Create a new view for storing accumulated values: - out = new Float64Array( buf, offset, 2 ); + const out = new Float64Array( buf, offset, 2 ); // Initialize an accumulator which will write results to the view: acc.push( incrmmeanstdev( out, 5 ) ); } // Simulate data and update the moving sample means and standard deviations... -for ( i = 0; i < 100; i++ ) { - for ( j = 0; j < N; j++ ) { - v = randu() * 100.0 * (j+1); +for ( let i = 0; i < 100; i++ ) { + for ( let j = 0; j < N; j++ ) { + const v = randu() * 100.0 * (j+1); acc[ j ]( v ); } } // Print the final results: console.log( 'Mean\tStDev' ); -for ( i = 0; i < N; i++ ) { - ms = acc[ i ](); +for ( let i = 0; i < N; i++ ) { + const ms = acc[ i ](); console.log( '%d\t%d', ms[ 0 ].toFixed( 3 ), ms[ 1 ].toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/incr/mmeanvar/README.md b/lib/node_modules/@stdlib/stats/incr/mmeanvar/README.md index 6aa1876606d0..2b3a0575defc 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmeanvar/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmeanvar/README.md @@ -63,7 +63,7 @@ s^2 = \frac{1}{W-1} \sum_{i=0}^{W-1} ( x_i - \bar{x} )^2 ## Usage ```javascript -var incrmmeanvar = require( '@stdlib/stats/incr/mmeanvar' ); +const incrmmeanvar = require( '@stdlib/stats/incr/mmeanvar' ); ``` #### incrmmeanvar( \[out,] window ) @@ -71,15 +71,15 @@ var incrmmeanvar = require( '@stdlib/stats/incr/mmeanvar' ); Returns an accumulator `function` which incrementally computes a moving [arithmetic mean][arithmetic-mean] and [unbiased sample variance][sample-variance]. The `window` parameter defines the number of values over which to compute the moving [arithmetic mean][arithmetic-mean] and [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrmmeanvar( 3 ); +const accumulator = incrmmeanvar( 3 ); ``` By default, the returned accumulator `function` returns the accumulated values as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmmeanvar( new Float64Array( 2 ), 3 ); +const accumulator = incrmmeanvar( new Float64Array( 2 ), 3 ); ``` #### accumulator( \[x] ) @@ -87,9 +87,9 @@ var accumulator = incrmmeanvar( new Float64Array( 2 ), 3 ); If provided an input value `x`, the accumulator function returns updated accumulated values. If not provided an input value `x`, the accumulator function returns the current accumulated values. ```javascript -var accumulator = incrmmeanvar( 3 ); +const accumulator = incrmmeanvar( 3 ); -var out = accumulator(); +let out = accumulator(); // returns null // Fill the window... @@ -135,52 +135,42 @@ out = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var incrmmeanvar = require( '@stdlib/stats/incr/mmeanvar' ); - -var offset; -var acc; -var buf; -var out; -var mv; -var N; -var v; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const incrmmeanvar = require( '@stdlib/stats/incr/mmeanvar' ); // Define the number of accumulators: -N = 5; +const N = 5; // Create an array buffer for storing accumulator output: -buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element +const buf = new ArrayBuffer( N*2*8 ); // 8 bytes per element // Initialize accumulators: -acc = []; -for ( i = 0; i < N; i++ ) { +const acc = []; +for ( let i = 0; i < N; i++ ) { // Compute the byte offset: - offset = i * 2 * 8; // stride=2, bytes_per_element=8 + const offset = i * 2 * 8; // stride=2, bytes_per_element=8 // Create a new view for storing accumulated values: - out = new Float64Array( buf, offset, 2 ); + const out = new Float64Array( buf, offset, 2 ); // Initialize an accumulator which will write results to the view: acc.push( incrmmeanvar( out, 5 ) ); } // Simulate data and update the moving sample means and variances... -for ( i = 0; i < 100; i++ ) { - for ( j = 0; j < N; j++ ) { - v = randu() * 100.0 * (j+1); +for ( let i = 0; i < 100; i++ ) { + for ( let j = 0; j < N; j++ ) { + const v = randu() * 100.0 * (j+1); acc[ j ]( v ); } } // Print the final results: console.log( 'Mean\tVariance' ); -for ( i = 0; i < N; i++ ) { - mv = acc[ i ](); +for ( let i = 0; i < N; i++ ) { + const mv = acc[ i ](); console.log( '%d\t%d', mv[ 0 ].toFixed( 3 ), mv[ 1 ].toFixed( 3 ) ); } ``` diff --git a/lib/node_modules/@stdlib/stats/incr/mmidrange/README.md b/lib/node_modules/@stdlib/stats/incr/mmidrange/README.md index 9bae89fe2a1f..6e5498f9d97f 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmidrange/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmidrange/README.md @@ -35,7 +35,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of ma ## Usage ```javascript -var incrmmidrange = require( '@stdlib/stats/incr/mmidrange' ); +const incrmmidrange = require( '@stdlib/stats/incr/mmidrange' ); ``` #### incrmmidrange( window ) @@ -43,7 +43,7 @@ var incrmmidrange = require( '@stdlib/stats/incr/mmidrange' ); Returns an accumulator `function` which incrementally computes a moving [mid-range][mid-range]. The `window` parameter defines the number of values over which to compute the moving [mid-range][mid-range]. ```javascript -var accumulator = incrmmidrange( 3 ); +const accumulator = incrmmidrange( 3 ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrmmidrange( 3 ); If provided an input value `x`, the accumulator function returns an updated [mid-range][mid-range]. If not provided an input value `x`, the accumulator function returns the current [mid-range][mid-range]. ```javascript -var accumulator = incrmmidrange( 3 ); +const accumulator = incrmmidrange( 3 ); -var mr = accumulator(); +let mr = accumulator(); // returns null // Fill the window... @@ -99,19 +99,15 @@ mr = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmidrange = require( '@stdlib/stats/incr/mmidrange' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmidrange = require( '@stdlib/stats/incr/mmidrange' ); // Initialize an accumulator: -accumulator = incrmmidrange( 5 ); +const accumulator = incrmmidrange( 5 ); // For each simulated datum, update the moving mid-range... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmin/README.md b/lib/node_modules/@stdlib/stats/incr/mmin/README.md index b8960e94f361..f5fe77482302 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmin/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmmin = require( '@stdlib/stats/incr/mmin' ); +const incrmmin = require( '@stdlib/stats/incr/mmin' ); ``` #### incrmmin( window ) @@ -35,7 +35,7 @@ var incrmmin = require( '@stdlib/stats/incr/mmin' ); Returns an accumulator `function` which incrementally computes a moving minimum value. The `window` parameter defines the number of values over which to compute the moving minimum. ```javascript -var accumulator = incrmmin( 3 ); +const accumulator = incrmmin( 3 ); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmmin( 3 ); If provided an input value `x`, the accumulator function returns an updated minimum value. If not provided an input value `x`, the accumulator function returns the current minimum value. ```javascript -var accumulator = incrmmin( 3 ); +const accumulator = incrmmin( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -91,19 +91,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmin = require( '@stdlib/stats/incr/mmin' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmin = require( '@stdlib/stats/incr/mmin' ); // Initialize an accumulator: -accumulator = incrmmin( 5 ); +const accumulator = incrmmin( 5 ); // For each simulated datum, update the moving minimum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mminabs/README.md b/lib/node_modules/@stdlib/stats/incr/mminabs/README.md index 508ab14a0e2d..cfbdfd0d5601 100644 --- a/lib/node_modules/@stdlib/stats/incr/mminabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mminabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmminabs = require( '@stdlib/stats/incr/mminabs' ); +const incrmminabs = require( '@stdlib/stats/incr/mminabs' ); ``` #### incrmminabs( window ) @@ -35,7 +35,7 @@ var incrmminabs = require( '@stdlib/stats/incr/mminabs' ); Returns an accumulator `function` which incrementally computes a moving minimum absolute value. The `window` parameter defines the number of values over which to compute the moving minimum absolute value. ```javascript -var accumulator = incrmminabs( 3 ); +const accumulator = incrmminabs( 3 ); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmminabs( 3 ); If provided an input value `x`, the accumulator function returns an updated minimum absolute value. If not provided an input value `x`, the accumulator function returns the current minimum absolute value. ```javascript -var accumulator = incrmminabs( 3 ); +const accumulator = incrmminabs( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -91,19 +91,15 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmminabs = require( '@stdlib/stats/incr/mminabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmminabs = require( '@stdlib/stats/incr/mminabs' ); // Initialize an accumulator: -accumulator = incrmminabs( 5 ); +const accumulator = incrmminabs( 5 ); // For each simulated datum, update the moving minimum absolute value... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mminmax/README.md b/lib/node_modules/@stdlib/stats/incr/mminmax/README.md index 2db8464ea5e9..38e2e07c117f 100644 --- a/lib/node_modules/@stdlib/stats/incr/mminmax/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mminmax/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmminmax = require( '@stdlib/stats/incr/mminmax' ); +const incrmminmax = require( '@stdlib/stats/incr/mminmax' ); ``` #### incrmminmax( \[out,] window ) @@ -35,15 +35,15 @@ var incrmminmax = require( '@stdlib/stats/incr/mminmax' ); Returns an accumulator `function` which incrementally computes a moving minimum and maximum. The `window` parameter defines the number of values over which to compute the moving minimum and maximum. ```javascript -var accumulator = incrmminmax( 3 ); +const accumulator = incrmminmax( 3 ); ``` By default, the returned accumulator `function` returns the minimum and maximum as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmminmax( new Float64Array( 2 ), 3 ); +const accumulator = incrmminmax( new Float64Array( 2 ), 3 ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrmminmax( new Float64Array( 2 ), 3 ); If provided an input value `x`, the accumulator function returns updated minimum and maximum values. If not provided an input value `x`, the accumulator function returns the current minimum and maximum values. ```javascript -var accumulator = incrmminmax( 3 ); +const accumulator = incrmminmax( 3 ); -var mm = accumulator(); +let mm = accumulator(); // returns null // Fill the window... @@ -99,19 +99,15 @@ mm = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmminmax = require( '@stdlib/stats/incr/mminmax' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmminmax = require( '@stdlib/stats/incr/mminmax' ); // Initialize an accumulator: -accumulator = incrmminmax( 5 ); +const accumulator = incrmminmax( 5 ); // For each simulated datum, update the moving minimum and maximum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mminmaxabs/README.md b/lib/node_modules/@stdlib/stats/incr/mminmaxabs/README.md index 702aae753d51..ea329ebef2a4 100644 --- a/lib/node_modules/@stdlib/stats/incr/mminmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mminmaxabs/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmminmaxabs = require( '@stdlib/stats/incr/mminmaxabs' ); +const incrmminmaxabs = require( '@stdlib/stats/incr/mminmaxabs' ); ``` #### incrmminmaxabs( \[out,] window ) @@ -35,15 +35,15 @@ var incrmminmaxabs = require( '@stdlib/stats/incr/mminmaxabs' ); Returns an accumulator `function` which incrementally computes moving minimum and maximum absolute values. The `window` parameter defines the number of values over which to compute moving minimum and maximum absolute values. ```javascript -var accumulator = incrmminmaxabs( 3 ); +const accumulator = incrmminmaxabs( 3 ); ``` By default, the returned accumulator `function` returns the minimum and maximum as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var accumulator = incrmminmaxabs( new Float64Array( 2 ), 3 ); +const accumulator = incrmminmaxabs( new Float64Array( 2 ), 3 ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrmminmaxabs( new Float64Array( 2 ), 3 ); If provided an input value `x`, the accumulator function returns updated minimum and maximum absolute values. If not provided an input value `x`, the accumulator function returns the current minimum and maximum absolute values. ```javascript -var accumulator = incrmminmaxabs( 3 ); +const accumulator = incrmminmaxabs( 3 ); -var mm = accumulator(); +let mm = accumulator(); // returns null // Fill the window... @@ -99,19 +99,15 @@ mm = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmminmaxabs = require( '@stdlib/stats/incr/mminmaxabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmminmaxabs = require( '@stdlib/stats/incr/mminmaxabs' ); // Initialize an accumulator: -accumulator = incrmminmaxabs( 5 ); +const accumulator = incrmminmaxabs( 5 ); // For each simulated datum, update the moving minimum and maximum absolute values... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmpe/README.md b/lib/node_modules/@stdlib/stats/incr/mmpe/README.md index dfd65e4becc6..f9e29eac71e0 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmpe/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmpe/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmmpe = require( '@stdlib/stats/incr/mmpe' ); +const incrmmpe = require( '@stdlib/stats/incr/mmpe' ); ``` #### incrmmpe( window ) @@ -58,7 +58,7 @@ var incrmmpe = require( '@stdlib/stats/incr/mmpe' ); Returns an accumulator `function` which incrementally computes a moving [mean percentage error][mean-percentage-error]. The `window` parameter defines the number of values over which to compute the moving [mean percentage error][mean-percentage-error]. ```javascript -var accumulator = incrmmpe( 3 ); +const accumulator = incrmmpe( 3 ); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmmpe( 3 ); If provided input values `f` and `a`, the accumulator function returns an updated [mean percentage error][mean-percentage-error]. If not provided input values `f` and `a`, the accumulator function returns the current [mean percentage error][mean-percentage-error]. ```javascript -var accumulator = incrmmpe( 3 ); +const accumulator = incrmmpe( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -116,21 +116,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmpe = require( '@stdlib/stats/incr/mmpe' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmpe = require( '@stdlib/stats/incr/mmpe' ); // Initialize an accumulator: -accumulator = incrmmpe( 5 ); +const accumulator = incrmmpe( 5 ); // For each simulated datum, update the moving mean percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mmse/README.md b/lib/node_modules/@stdlib/stats/incr/mmse/README.md index 3a97c4c6fe24..8c452f3ad6a4 100644 --- a/lib/node_modules/@stdlib/stats/incr/mmse/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mmse/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [mean squared error][mean-squared-error] is define ## Usage ```javascript -var incrmmse = require( '@stdlib/stats/incr/mmse' ); +const incrmmse = require( '@stdlib/stats/incr/mmse' ); ``` #### incrmmse( window ) @@ -56,7 +56,7 @@ var incrmmse = require( '@stdlib/stats/incr/mmse' ); Returns an accumulator `function` which incrementally computes a moving [mean squared error][mean-squared-error]. The `window` parameter defines the number of values over which to compute the moving [mean squared error][mean-squared-error]. ```javascript -var accumulator = incrmmse( 3 ); +const accumulator = incrmmse( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmmse( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated [mean squared error][mean-squared-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean squared error][mean-squared-error]. ```javascript -var accumulator = incrmmse( 3 ); +const accumulator = incrmmse( 3 ); -var m = accumulator(); +let m = accumulator(); // returns null // Fill the window... @@ -112,21 +112,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmmse = require( '@stdlib/stats/incr/mmse' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmmse = require( '@stdlib/stats/incr/mmse' ); // Initialize an accumulator: -accumulator = incrmmse( 5 ); +const accumulator = incrmmse( 5 ); // For each simulated datum, update the moving mean squared error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mpcorr/README.md b/lib/node_modules/@stdlib/stats/incr/mpcorr/README.md index e275ab93b4ff..24b141d78ba9 100644 --- a/lib/node_modules/@stdlib/stats/incr/mpcorr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mpcorr/README.md @@ -65,7 +65,7 @@ r = \frac{\displaystyle\sum_{i=0}^{n-1} (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\d ## Usage ```javascript -var incrmpcorr = require( '@stdlib/stats/incr/mpcorr' ); +const incrmpcorr = require( '@stdlib/stats/incr/mpcorr' ); ``` #### incrmpcorr( window\[, mx, my] ) @@ -73,13 +73,13 @@ var incrmpcorr = require( '@stdlib/stats/incr/mpcorr' ); Returns an accumulator `function` which incrementally computes a moving [sample Pearson product-moment correlation coefficient][pearson-correlation]. The `window` parameter defines the number of values over which to compute the moving [sample Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrmpcorr( 3 ); +const accumulator = incrmpcorr( 3 ); ``` If means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrmpcorr( 3, 5.0, -3.14 ); +const accumulator = incrmpcorr( 3, 5.0, -3.14 ); ``` #### accumulator( \[x, y] ) @@ -87,9 +87,9 @@ var accumulator = incrmpcorr( 3, 5.0, -3.14 ); If provided input values `x` and `y`, the accumulator function returns an updated [sample Pearson product-moment correlation coefficient][pearson-correlation]. If not provided input values `x` and `y`, the accumulator function returns the current [sample Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrmpcorr( 3 ); +const accumulator = incrmpcorr( 3 ); -var r = accumulator(); +let r = accumulator(); // returns null // Fill the window... @@ -135,21 +135,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmpcorr = require( '@stdlib/stats/incr/mpcorr' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmpcorr = require( '@stdlib/stats/incr/mpcorr' ); // Initialize an accumulator: -accumulator = incrmpcorr( 5 ); +const accumulator = incrmpcorr( 5 ); // For each simulated datum, update the moving sample correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mpcorr2/README.md b/lib/node_modules/@stdlib/stats/incr/mpcorr2/README.md index e12080b0ccc9..aa9afa735420 100644 --- a/lib/node_modules/@stdlib/stats/incr/mpcorr2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mpcorr2/README.md @@ -67,7 +67,7 @@ The squared sample [Pearson product-moment correlation coefficient][pearson-corr ## Usage ```javascript -var incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); +const incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); ``` #### incrmpcorr2( window\[, mx, my] ) @@ -75,13 +75,13 @@ var incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); Returns an accumulator `function` which incrementally computes a moving squared sample [Pearson product-moment correlation coefficient][pearson-correlation]. The `window` parameter defines the number of values over which to compute the moving squared sample [Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrmpcorr2( 3 ); +const accumulator = incrmpcorr2( 3 ); ``` If means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrmpcorr2( 3, 5.0, -3.14 ); +const accumulator = incrmpcorr2( 3, 5.0, -3.14 ); ``` #### accumulator( \[x, y] ) @@ -89,9 +89,9 @@ var accumulator = incrmpcorr2( 3, 5.0, -3.14 ); If provided input values `x` and `y`, the accumulator function returns an updated accumulated value. If not provided input values `x` and `y`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrmpcorr2( 3 ); +const accumulator = incrmpcorr2( 3 ); -var r2 = accumulator(); +let r2 = accumulator(); // returns null // Fill the window... @@ -138,21 +138,16 @@ r2 = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); // Initialize an accumulator: -accumulator = incrmpcorr2( 5 ); +const accumulator = incrmpcorr2( 5 ); // For each simulated datum, update the moving squared sample correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mpcorrdist/README.md b/lib/node_modules/@stdlib/stats/incr/mpcorrdist/README.md index d0944a920cb7..3d0521b3bbf2 100644 --- a/lib/node_modules/@stdlib/stats/incr/mpcorrdist/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mpcorrdist/README.md @@ -50,7 +50,7 @@ where `r` is the [sample Pearson product-moment correlation coefficient][pearson ## Usage ```javascript -var incrmpcorrdist = require( '@stdlib/stats/incr/mpcorrdist' ); +const incrmpcorrdist = require( '@stdlib/stats/incr/mpcorrdist' ); ``` #### incrmpcorrdist( window\[, mx, my] ) @@ -58,13 +58,13 @@ var incrmpcorrdist = require( '@stdlib/stats/incr/mpcorrdist' ); Returns an accumulator `function` which incrementally computes a moving [sample Pearson product-moment correlation distance][pearson-correlation]. The `window` parameter defines the number of values over which to compute the moving [sample Pearson product-moment correlation distance][pearson-correlation]. ```javascript -var accumulator = incrmpcorrdist( 3 ); +const accumulator = incrmpcorrdist( 3 ); ``` If means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrmpcorrdist( 3, 5.0, -3.14 ); +const accumulator = incrmpcorrdist( 3, 5.0, -3.14 ); ``` #### accumulator( \[x, y] ) @@ -72,9 +72,9 @@ var accumulator = incrmpcorrdist( 3, 5.0, -3.14 ); If provided input values `x` and `y`, the accumulator function returns an updated [sample Pearson product-moment correlation distance][pearson-correlation]. If not provided input values `x` and `y`, the accumulator function returns the current [sample Pearson product-moment correlation distance][pearson-correlation]. ```javascript -var accumulator = incrmpcorrdist( 3 ); +const accumulator = incrmpcorrdist( 3 ); -var r = accumulator(); +let r = accumulator(); // returns null // Fill the window... @@ -121,21 +121,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmpcorrdist = require( '@stdlib/stats/incr/mpcorrdist' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmpcorrdist = require( '@stdlib/stats/incr/mpcorrdist' ); // Initialize an accumulator: -accumulator = incrmpcorrdist( 5 ); +const accumulator = incrmpcorrdist( 5 ); // For each simulated datum, update the moving sample correlation distance... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mpe/README.md b/lib/node_modules/@stdlib/stats/incr/mpe/README.md index 822d89e48420..6b69f4af6644 100644 --- a/lib/node_modules/@stdlib/stats/incr/mpe/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mpe/README.md @@ -50,7 +50,7 @@ where `f_i` is the forecast value and `a_i` is the actual value. ## Usage ```javascript -var incrmpe = require( '@stdlib/stats/incr/mpe' ); +const incrmpe = require( '@stdlib/stats/incr/mpe' ); ``` #### incrmpe() @@ -58,7 +58,7 @@ var incrmpe = require( '@stdlib/stats/incr/mpe' ); Returns an accumulator `function` which incrementally computes the [mean percentage error][mean-percentage-error]. ```javascript -var accumulator = incrmpe(); +const accumulator = incrmpe(); ``` #### accumulator( \[f, a] ) @@ -66,9 +66,9 @@ var accumulator = incrmpe(); If provided input values `f` and `a`, the accumulator function returns an updated [mean percentage error][mean-percentage-error]. If not provided input values `f` and `a`, the accumulator function returns the current [mean percentage error][mean-percentage-error]. ```javascript -var accumulator = incrmpe(); +const accumulator = incrmpe(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns ~33.33 m = accumulator( 1.0, 4.0 ); @@ -104,21 +104,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmpe = require( '@stdlib/stats/incr/mpe' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmpe = require( '@stdlib/stats/incr/mpe' ); // Initialize an accumulator: -accumulator = incrmpe(); +const accumulator = incrmpe(); // For each simulated datum, update the mean percentage error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) + 50.0; - v2 = ( randu()*100.0 ) + 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) + 50.0; + const v2 = ( randu()*100.0 ) + 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mprod/README.md b/lib/node_modules/@stdlib/stats/incr/mprod/README.md index 8f341f1597f4..52abd92d5089 100644 --- a/lib/node_modules/@stdlib/stats/incr/mprod/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mprod/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the moving product is defined as ## Usage ```javascript -var incrmprod = require( '@stdlib/stats/incr/mprod' ); +const incrmprod = require( '@stdlib/stats/incr/mprod' ); ``` #### incrmprod( window ) @@ -56,7 +56,7 @@ var incrmprod = require( '@stdlib/stats/incr/mprod' ); Returns an accumulator `function` which incrementally computes a moving product. The `window` parameter defines the number of values over which to compute the moving product. ```javascript -var accumulator = incrmprod( 3 ); +const accumulator = incrmprod( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmprod( 3 ); If provided an input value `x`, the accumulator function returns an updated product. If not provided an input value `x`, the accumulator function returns the current product. ```javascript -var accumulator = incrmprod( 3 ); +const accumulator = incrmprod( 3 ); -var p = accumulator(); +let p = accumulator(); // returns null // Fill the window... @@ -94,16 +94,16 @@ Under certain conditions, overflow may be transient. ```javascript // Large values: -var x = 5.0e+300; -var y = 1.0e+300; +const x = 5.0e+300; +const y = 1.0e+300; // Tiny value: -var z = 2.0e-302; +const z = 2.0e-302; // Initialize an accumulator: -var accumulator = incrmprod( 3 ); +const accumulator = incrmprod( 3 ); -var p = accumulator( x ); +let p = accumulator( x ); // returns 5.0e+300 // Transient overflow: @@ -119,16 +119,16 @@ Similarly, under certain conditions, underflow may be transient. ```javascript // Tiny values: -var x = 4.0e-302; -var y = 9.0e-303; +const x = 4.0e-302; +const y = 9.0e-303; // Large value: -var z = 2.0e+300; +const z = 2.0e+300; // Initialize an accumulator: -var accumulator = incrmprod( 3 ); +const accumulator = incrmprod( 3 ); -var p = accumulator( x ); +let p = accumulator( x ); // returns 4.0e-302 // Transient underflow: @@ -163,19 +163,15 @@ p = accumulator( z ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmprod = require( '@stdlib/stats/incr/mprod' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmprod = require( '@stdlib/stats/incr/mprod' ); // Initialize an accumulator: -accumulator = incrmprod( 5 ); +const accumulator = incrmprod( 5 ); // For each simulated datum, update the moving product... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*10.0 ) - 5.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*10.0 ) - 5.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mrange/README.md b/lib/node_modules/@stdlib/stats/incr/mrange/README.md index 19124282fee9..3c475fd08a63 100644 --- a/lib/node_modules/@stdlib/stats/incr/mrange/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mrange/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var incrmrange = require( '@stdlib/stats/incr/mrange' ); +const incrmrange = require( '@stdlib/stats/incr/mrange' ); ``` #### incrmrange( window ) @@ -43,7 +43,7 @@ var incrmrange = require( '@stdlib/stats/incr/mrange' ); Returns an accumulator `function` which incrementally computes a moving [range][range]. The `window` parameter defines the number of values over which to compute the moving [range][range]. ```javascript -var accumulator = incrmrange( 3 ); +const accumulator = incrmrange( 3 ); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrmrange( 3 ); If provided an input value `x`, the accumulator function returns an updated [range][range]. If not provided an input value `x`, the accumulator function returns the current [range][range]. ```javascript -var accumulator = incrmrange( 3 ); +const accumulator = incrmrange( 3 ); -var r = accumulator(); +let r = accumulator(); // returns null // Fill the window... @@ -99,19 +99,15 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmrange = require( '@stdlib/stats/incr/mrange' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmrange = require( '@stdlib/stats/incr/mrange' ); // Initialize an accumulator: -accumulator = incrmrange( 5 ); +const accumulator = incrmrange( 5 ); // For each simulated datum, update the moving range... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mrmse/README.md b/lib/node_modules/@stdlib/stats/incr/mrmse/README.md index 41c660595fe4..589beb2a40d2 100644 --- a/lib/node_modules/@stdlib/stats/incr/mrmse/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mrmse/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [**root mean squared error**][root-mean-squared-er ## Usage ```javascript -var incrmrmse = require( '@stdlib/stats/incr/mrmse' ); +const incrmrmse = require( '@stdlib/stats/incr/mrmse' ); ``` #### incrmrmse( window ) @@ -56,7 +56,7 @@ var incrmrmse = require( '@stdlib/stats/incr/mrmse' ); Returns an accumulator `function` which incrementally computes a moving [root mean squared error][root-mean-squared-error]. The `window` parameter defines the number of values over which to compute the moving [root mean squared error][root-mean-squared-error]. ```javascript -var accumulator = incrmrmse( 3 ); +const accumulator = incrmrmse( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmrmse( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated [root mean squared error][root-mean-squared-error]. If not provided input values `x` and `y`, the accumulator function returns the current [root mean squared error][root-mean-squared-error]. ```javascript -var accumulator = incrmrmse( 3 ); +const accumulator = incrmrmse( 3 ); -var r = accumulator(); +let r = accumulator(); // returns null // Fill the window... @@ -112,21 +112,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmrmse = require( '@stdlib/stats/incr/mrmse' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmrmse = require( '@stdlib/stats/incr/mrmse' ); // Initialize an accumulator: -accumulator = incrmrmse( 5 ); +const accumulator = incrmrmse( 5 ); // For each simulated datum, update the moving root mean squared error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mrss/README.md b/lib/node_modules/@stdlib/stats/incr/mrss/README.md index 79465cfd97be..f7cd6c4f5e9a 100644 --- a/lib/node_modules/@stdlib/stats/incr/mrss/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mrss/README.md @@ -48,7 +48,7 @@ For a window of size `W`, the [residual sum of squares][residual-sum-of-squares] ## Usage ```javascript -var incrmrss = require( '@stdlib/stats/incr/mrss' ); +const incrmrss = require( '@stdlib/stats/incr/mrss' ); ``` #### incrmrss( window ) @@ -56,7 +56,7 @@ var incrmrss = require( '@stdlib/stats/incr/mrss' ); Returns an accumulator `function` which incrementally computes a moving [residual sum of squares][residual-sum-of-squares]. The `window` parameter defines the number of values over which to compute the moving [residual sum of squares][residual-sum-of-squares]. ```javascript -var accumulator = incrmrss( 3 ); +const accumulator = incrmrss( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmrss( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated [residual sum of squares][residual-sum-of-squares]. If not provided input values `x` and `y`, the accumulator function returns the current [residual sum of squares][residual-sum-of-squares]. ```javascript -var accumulator = incrmrss( 3 ); +const accumulator = incrmrss( 3 ); -var r = accumulator(); +let r = accumulator(); // returns null // Fill the window... @@ -112,21 +112,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmrss = require( '@stdlib/stats/incr/mrss' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmrss = require( '@stdlib/stats/incr/mrss' ); // Initialize an accumulator: -accumulator = incrmrss( 5 ); +const accumulator = incrmrss( 5 ); // For each simulated datum, update the moving residual sum of squares... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mse/README.md b/lib/node_modules/@stdlib/stats/incr/mse/README.md index 288e9cd89219..c7b127c286ad 100644 --- a/lib/node_modules/@stdlib/stats/incr/mse/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mse/README.md @@ -48,7 +48,7 @@ The [mean squared error][mean-squared-error] is defined as ## Usage ```javascript -var incrmse = require( '@stdlib/stats/incr/mse' ); +const incrmse = require( '@stdlib/stats/incr/mse' ); ``` #### incrmse() @@ -56,7 +56,7 @@ var incrmse = require( '@stdlib/stats/incr/mse' ); Returns an accumulator `function` which incrementally computes the [mean squared error][mean-squared-error]. ```javascript -var accumulator = incrmse(); +const accumulator = incrmse(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmse(); If provided input values `x` and `y`, the accumulator function returns an updated [mean squared error][mean-squared-error]. If not provided input values `x` and `y`, the accumulator function returns the current [mean squared error][mean-squared-error]. ```javascript -var accumulator = incrmse(); +const accumulator = incrmse(); -var m = accumulator( 2.0, 3.0 ); +let m = accumulator( 2.0, 3.0 ); // returns 1.0 m = accumulator( -1.0, -4.0 ); @@ -100,21 +100,16 @@ m = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmse = require( '@stdlib/stats/incr/mse' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmse = require( '@stdlib/stats/incr/mse' ); // Initialize an accumulator: -accumulator = incrmse(); +const accumulator = incrmse(); // For each simulated datum, update the mean squared error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mstdev/README.md b/lib/node_modules/@stdlib/stats/incr/mstdev/README.md index 3644e0403caa..bfd19919faa1 100644 --- a/lib/node_modules/@stdlib/stats/incr/mstdev/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mstdev/README.md @@ -48,7 +48,7 @@ s = \sqrt{\frac{1}{W-1} \sum_{i=0}^{W-1} ( x_i - \bar{x} )^2} ## Usage ```javascript -var incrmstdev = require( '@stdlib/stats/incr/mstdev' ); +const incrmstdev = require( '@stdlib/stats/incr/mstdev' ); ``` #### incrmstdev( window\[, mean] ) @@ -56,13 +56,13 @@ var incrmstdev = require( '@stdlib/stats/incr/mstdev' ); Returns an accumulator `function` which incrementally computes a moving [corrected sample standard deviation][standard-deviation]. The `window` parameter defines the number of values over which to compute the moving [corrected sample standard deviation][standard-deviation]. ```javascript -var accumulator = incrmstdev( 3 ); +const accumulator = incrmstdev( 3 ); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrmstdev( 3, 5.0 ); +const accumulator = incrmstdev( 3, 5.0 ); ``` #### accumulator( \[x] ) @@ -70,9 +70,9 @@ var accumulator = incrmstdev( 3, 5.0 ); If provided an input value `x`, the accumulator function returns an updated [corrected sample standard deviation][standard-deviation]. If not provided an input value `x`, the accumulator function returns the current [corrected sample standard deviation][standard-deviation]. ```javascript -var accumulator = incrmstdev( 3 ); +const accumulator = incrmstdev( 3 ); -var s = accumulator(); +let s = accumulator(); // returns null // Fill the window... @@ -118,19 +118,15 @@ s = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmstdev = require( '@stdlib/stats/incr/mstdev' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmstdev = require( '@stdlib/stats/incr/mstdev' ); // Initialize an accumulator: -accumulator = incrmstdev( 5 ); +const accumulator = incrmstdev( 5 ); // For each simulated datum, update the moving corrected sample standard deviation... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/msum/README.md b/lib/node_modules/@stdlib/stats/incr/msum/README.md index 49b8f6b2c0a4..b6a84007b714 100644 --- a/lib/node_modules/@stdlib/stats/incr/msum/README.md +++ b/lib/node_modules/@stdlib/stats/incr/msum/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{W-1} x_i ## Usage ```javascript -var incrmsum = require( '@stdlib/stats/incr/msum' ); +const incrmsum = require( '@stdlib/stats/incr/msum' ); ``` #### incrmsum( window ) @@ -56,7 +56,7 @@ var incrmsum = require( '@stdlib/stats/incr/msum' ); Returns an accumulator `function` which incrementally computes a moving sum. The `window` parameter defines the number of values over which to compute the moving sum. ```javascript -var accumulator = incrmsum( 3 ); +const accumulator = incrmsum( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmsum( 3 ); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrmsum( 3 ); +const accumulator = incrmsum( 3 ); -var sum = accumulator(); +let sum = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmsum = require( '@stdlib/stats/incr/msum' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmsum = require( '@stdlib/stats/incr/msum' ); // Initialize an accumulator: -accumulator = incrmsum( 5 ); +const accumulator = incrmsum( 5 ); // For each simulated datum, update the moving sum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/msumabs/README.md b/lib/node_modules/@stdlib/stats/incr/msumabs/README.md index b91ad8268b07..94b6eb6b5eeb 100644 --- a/lib/node_modules/@stdlib/stats/incr/msumabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/msumabs/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{W-1} |x_i| ## Usage ```javascript -var incrmsumabs = require( '@stdlib/stats/incr/msumabs' ); +const incrmsumabs = require( '@stdlib/stats/incr/msumabs' ); ``` #### incrmsumabs( window ) @@ -56,7 +56,7 @@ var incrmsumabs = require( '@stdlib/stats/incr/msumabs' ); Returns an accumulator `function` which incrementally computes a moving sum of absolute values. The `window` parameter defines the number of values over which to compute the moving sum. ```javascript -var accumulator = incrmsumabs( 3 ); +const accumulator = incrmsumabs( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmsumabs( 3 ); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrmsumabs( 3 ); +const accumulator = incrmsumabs( 3 ); -var sum = accumulator(); +let sum = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmsumabs = require( '@stdlib/stats/incr/msumabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmsumabs = require( '@stdlib/stats/incr/msumabs' ); // Initialize an accumulator: -accumulator = incrmsumabs( 5 ); +const accumulator = incrmsumabs( 5 ); // For each simulated datum, update the moving sum... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/msumabs2/README.md b/lib/node_modules/@stdlib/stats/incr/msumabs2/README.md index 7a35954aaa40..e4a604fcb464 100644 --- a/lib/node_modules/@stdlib/stats/incr/msumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/msumabs2/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{W-1} x_i^2 ## Usage ```javascript -var incrmsumabs2 = require( '@stdlib/stats/incr/msumabs2' ); +const incrmsumabs2 = require( '@stdlib/stats/incr/msumabs2' ); ``` #### incrmsumabs2( window ) @@ -56,7 +56,7 @@ var incrmsumabs2 = require( '@stdlib/stats/incr/msumabs2' ); Returns an accumulator `function` which incrementally computes a moving sum of squared absolute values. The `window` parameter defines the number of values over which to compute the moving sum. ```javascript -var accumulator = incrmsumabs2( 3 ); +const accumulator = incrmsumabs2( 3 ); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrmsumabs2( 3 ); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrmsumabs2( 3 ); +const accumulator = incrmsumabs2( 3 ); -var sum = accumulator(); +let sum = accumulator(); // returns null // Fill the window... @@ -112,19 +112,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmsumabs2 = require( '@stdlib/stats/incr/msumabs2' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmsumabs2 = require( '@stdlib/stats/incr/msumabs2' ); // Initialize an accumulator: -accumulator = incrmsumabs2( 5 ); +const accumulator = incrmsumabs2( 5 ); // For each simulated datum, update the moving sum... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/msummary/README.md b/lib/node_modules/@stdlib/stats/incr/msummary/README.md index f6b2d2b9d792..1a5f23467900 100644 --- a/lib/node_modules/@stdlib/stats/incr/msummary/README.md +++ b/lib/node_modules/@stdlib/stats/incr/msummary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrmsummary = require( '@stdlib/stats/incr/msummary' ); +const incrmsummary = require( '@stdlib/stats/incr/msummary' ); ``` #### incrmsummary( window ) @@ -35,7 +35,7 @@ var incrmsummary = require( '@stdlib/stats/incr/msummary' ); Returns an accumulator `function` which incrementally computes a moving statistical summary. The `window` parameter defines the number of values over which to compute the moving summary. ```javascript -var accumulator = incrmsummary( 3 ); +const accumulator = incrmsummary( 3 ); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrmsummary( 3 ); If provided an input value `x`, the accumulator function returns an updated summary. If not provided an input value `x`, the accumulator function returns the current summary. ```javascript -var accumulator = incrmsummary( 3 ); +const accumulator = incrmsummary( 3 ); -var summary = accumulator(); +let summary = accumulator(); // returns {} // Fill the window... @@ -127,19 +127,15 @@ summary = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmsummary = require( '@stdlib/stats/incr/msummary' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmsummary = require( '@stdlib/stats/incr/msummary' ); // Initialize an accumulator: -accumulator = incrmsummary( 5 ); +const accumulator = incrmsummary( 5 ); // For each simulated datum, update the moving summary... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/msumprod/README.md b/lib/node_modules/@stdlib/stats/incr/msumprod/README.md index c46b928903b0..2194d167d861 100644 --- a/lib/node_modules/@stdlib/stats/incr/msumprod/README.md +++ b/lib/node_modules/@stdlib/stats/incr/msumprod/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{W-1} x_i y_i ## Usage ```javascript -var incrmsumprod = require( '@stdlib/stats/incr/msumprod' ); +const incrmsumprod = require( '@stdlib/stats/incr/msumprod' ); ``` #### incrmsumprod( window ) @@ -56,7 +56,7 @@ var incrmsumprod = require( '@stdlib/stats/incr/msumprod' ); Returns an accumulator `function` which incrementally computes a moving sum of products. The `window` parameter defines the number of values over which to compute the moving sum of products. ```javascript -var accumulator = incrmsumprod( 3 ); +const accumulator = incrmsumprod( 3 ); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrmsumprod( 3 ); If provided input values `x` and `y`, the accumulator function returns an updated sum. If not provided input values `x` and `y`, the accumulator function returns the current sum. ```javascript -var accumulator = incrmsumprod( 3 ); +const accumulator = incrmsumprod( 3 ); -var sum = accumulator(); +let sum = accumulator(); // returns null // Fill the window... @@ -112,21 +112,16 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmsumprod = require( '@stdlib/stats/incr/msumprod' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmsumprod = require( '@stdlib/stats/incr/msumprod' ); // Initialize an accumulator: -accumulator = incrmsumprod( 5 ); +const accumulator = incrmsumprod( 5 ); // For each simulated datum, update the moving sum-product... -for ( i = 0; i < 100; i++ ) { - v1 = randu() * 100.0; - v2 = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = randu() * 100.0; + const v2 = randu() * 100.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mvariance/README.md b/lib/node_modules/@stdlib/stats/incr/mvariance/README.md index 294749e6f75d..b667eb03a31c 100644 --- a/lib/node_modules/@stdlib/stats/incr/mvariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mvariance/README.md @@ -48,7 +48,7 @@ s^2 = \frac{1}{W-1} \sum_{i=0}^{W-1} ( x_i - \bar{x} )^2 ## Usage ```javascript -var incrmvariance = require( '@stdlib/stats/incr/mvariance' ); +const incrmvariance = require( '@stdlib/stats/incr/mvariance' ); ``` #### incrmvariance( window\[, mean] ) @@ -56,13 +56,13 @@ var incrmvariance = require( '@stdlib/stats/incr/mvariance' ); Returns an accumulator `function` which incrementally computes a moving [unbiased sample variance][sample-variance]. The `window` parameter defines the number of values over which to compute the moving [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrmvariance( 3 ); +const accumulator = incrmvariance( 3 ); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrmvariance( 3, 5.0 ); +const accumulator = incrmvariance( 3, 5.0 ); ``` #### accumulator( \[x] ) @@ -70,9 +70,9 @@ var accumulator = incrmvariance( 3, 5.0 ); If provided an input value `x`, the accumulator function returns an updated [unbiased sample variance][sample-variance]. If not provided an input value `x`, the accumulator function returns the current [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrmvariance( 3 ); +const accumulator = incrmvariance( 3 ); -var s2 = accumulator(); +let s2 = accumulator(); // returns null // Fill the window... @@ -118,19 +118,15 @@ s2 = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmvariance = require( '@stdlib/stats/incr/mvariance' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmvariance = require( '@stdlib/stats/incr/mvariance' ); // Initialize an accumulator: -accumulator = incrmvariance( 5 ); +const accumulator = incrmvariance( 5 ); // For each simulated datum, update the moving unbiased sample variance... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/mvmr/README.md b/lib/node_modules/@stdlib/stats/incr/mvmr/README.md index e136e75bb12b..1d86a4a66936 100644 --- a/lib/node_modules/@stdlib/stats/incr/mvmr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/mvmr/README.md @@ -78,7 +78,7 @@ F = \frac{s^2}{\bar{x}} ## Usage ```javascript -var incrmvmr = require( '@stdlib/stats/incr/mvmr' ); +const incrmvmr = require( '@stdlib/stats/incr/mvmr' ); ``` #### incrmvmr( window\[, mean] ) @@ -86,13 +86,13 @@ var incrmvmr = require( '@stdlib/stats/incr/mvmr' ); Returns an accumulator `function` which incrementally computes a moving [variance-to-mean ratio][variance-to-mean-ratio]. The `window` parameter defines the number of values over which to compute the moving [variance-to-mean ratio][variance-to-mean-ratio]. ```javascript -var accumulator = incrmvmr( 3 ); +const accumulator = incrmvmr( 3 ); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrmvmr( 3, 5.0 ); +const accumulator = incrmvmr( 3, 5.0 ); ``` #### accumulator( \[x] ) @@ -100,9 +100,9 @@ var accumulator = incrmvmr( 3, 5.0 ); If provided an input value `x`, the accumulator function returns an updated accumulated value. If not provided an input value `x`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrmvmr( 3 ); +const accumulator = incrmvmr( 3 ); -var F = accumulator(); +let F = accumulator(); // returns null // Fill the window... @@ -164,19 +164,15 @@ F = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrmvmr = require( '@stdlib/stats/incr/mvmr' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrmvmr = require( '@stdlib/stats/incr/mvmr' ); // Initialize an accumulator: -accumulator = incrmvmr( 5 ); +const accumulator = incrmvmr( 5 ); // For each simulated datum, update the moving variance-to-mean ratio... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/nancount/README.md b/lib/node_modules/@stdlib/stats/incr/nancount/README.md index e865828f2c4d..c3fe333560c5 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancount/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nancount/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrnancount = require( '@stdlib/stats/incr/nancount' ); +const incrnancount = require( '@stdlib/stats/incr/nancount' ); ``` #### incrnancount() @@ -35,7 +35,7 @@ var incrnancount = require( '@stdlib/stats/incr/nancount' ); Returns an accumulator `function` which incrementally computes a count, ignoring `NaN` values. ```javascript -var accumulator = incrnancount(); +const accumulator = incrnancount(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrnancount(); If provided an input value `x`, the accumulator function returns an updated count. If not provided an input value `x`, the accumulator function returns the current count. ```javascript -var accumulator = incrnancount(); +const accumulator = incrnancount(); -var count = accumulator( 2.0 ); +let count = accumulator( 2.0 ); // returns 1 count = accumulator( 1.0 ); @@ -72,18 +72,15 @@ count = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrnancount = require( '@stdlib/stats/incr/nancount' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrnancount = require( '@stdlib/stats/incr/nancount' ); // Initialize an accumulator: -accumulator = incrnancount(); +const accumulator = incrnancount(); // For each simulated datum, update the count... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let v; if ( randu() < 0.2 ) { v = NaN; } else { diff --git a/lib/node_modules/@stdlib/stats/incr/nansum/README.md b/lib/node_modules/@stdlib/stats/incr/nansum/README.md index bce0e49c37d3..9dbd5b695bf3 100644 --- a/lib/node_modules/@stdlib/stats/incr/nansum/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nansum/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} x_i ## Usage ```javascript -var incrnansum = require( '@stdlib/stats/incr/nansum' ); +const incrnansum = require( '@stdlib/stats/incr/nansum' ); ``` #### incrnansum() @@ -56,7 +56,7 @@ var incrnansum = require( '@stdlib/stats/incr/nansum' ); Returns an accumulator `function` which incrementally computes a sum, ignoring `NaN` values. ```javascript -var accumulator = incrnansum(); +const accumulator = incrnansum(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrnansum(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrnansum(); +const accumulator = incrnansum(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 2.0 sum = accumulator( 1.0 ); @@ -104,18 +104,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrnansum = require( '@stdlib/stats/incr/nansum' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrnansum = require( '@stdlib/stats/incr/nansum' ); // Initialize an accumulator: -accumulator = incrnansum(); +const accumulator = incrnansum(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let v; if ( randu() < 0.2 ) { v = NaN; } else { diff --git a/lib/node_modules/@stdlib/stats/incr/nansumabs/README.md b/lib/node_modules/@stdlib/stats/incr/nansumabs/README.md index de1752951b66..4560713b11e6 100644 --- a/lib/node_modules/@stdlib/stats/incr/nansumabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nansumabs/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} |x_i| ## Usage ```javascript -var incrnansumabs = require( '@stdlib/stats/incr/nansumabs' ); +const incrnansumabs = require( '@stdlib/stats/incr/nansumabs' ); ``` #### incrnansumabs() @@ -56,7 +56,7 @@ var incrnansumabs = require( '@stdlib/stats/incr/nansumabs' ); Returns an accumulator `function` which incrementally computes a sum of absolute values, ignoring `NaN` values. ```javascript -var accumulator = incrnansumabs(); +const accumulator = incrnansumabs(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrnansumabs(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrnansumabs(); +const accumulator = incrnansumabs(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 2.0 sum = accumulator( -1.0 ); @@ -104,18 +104,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrnansumabs = require( '@stdlib/stats/incr/nansumabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrnansumabs = require( '@stdlib/stats/incr/nansumabs' ); // Initialize an accumulator: -accumulator = incrnansumabs(); +const accumulator = incrnansumabs(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { + let v; if ( randu() < 0.2 ) { v = NaN; } else { diff --git a/lib/node_modules/@stdlib/stats/incr/nansumabs2/README.md b/lib/node_modules/@stdlib/stats/incr/nansumabs2/README.md index 587697def212..d1f19bdf5776 100644 --- a/lib/node_modules/@stdlib/stats/incr/nansumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nansumabs2/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} x_i^2 ## Usage ```javascript -var incrnansumabs2 = require( '@stdlib/stats/incr/nansumabs2' ); +const incrnansumabs2 = require( '@stdlib/stats/incr/nansumabs2' ); ``` #### incrnansumabs2() @@ -56,7 +56,7 @@ var incrnansumabs2 = require( '@stdlib/stats/incr/nansumabs2' ); Returns an accumulator `function` which incrementally computes a sum of squared absolute values, ignoring `NaN` values. ```javascript -var accumulator = incrnansumabs2(); +const accumulator = incrnansumabs2(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrnansumabs2(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrnansumabs2(); +const accumulator = incrnansumabs2(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 4.0 sum = accumulator( -1.0 ); @@ -104,19 +104,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrnansumabs2 = require( '@stdlib/stats/incr/nansumabs2' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrnansumabs2 = require( '@stdlib/stats/incr/nansumabs2' ); // Initialize an accumulator: -accumulator = incrnansumabs2(); +const accumulator = incrnansumabs2(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/pcorr/README.md b/lib/node_modules/@stdlib/stats/incr/pcorr/README.md index 90551d9f7dff..0f796a5d1655 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/pcorr/README.md @@ -65,7 +65,7 @@ r = \frac{\displaystyle\sum_{i=0}^{n-1} (x_i - \bar{x})(y_i - \bar{y})}{\display ## Usage ```javascript -var incrpcorr = require( '@stdlib/stats/incr/pcorr' ); +const incrpcorr = require( '@stdlib/stats/incr/pcorr' ); ``` #### incrpcorr( \[mx, my] ) @@ -73,13 +73,13 @@ var incrpcorr = require( '@stdlib/stats/incr/pcorr' ); Returns an accumulator `function` which incrementally computes a [sample Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrpcorr(); +const accumulator = incrpcorr(); ``` If the means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrpcorr( 3.0, -5.5 ); +const accumulator = incrpcorr( 3.0, -5.5 ); ``` #### accumulator( \[x, y] ) @@ -87,9 +87,9 @@ var accumulator = incrpcorr( 3.0, -5.5 ); If provided input value `x` and `y`, the accumulator function returns an updated [sample correlation coefficient][pearson-correlation]. If not provided input values `x` and `y`, the accumulator function returns the current [sample correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrpcorr(); +const accumulator = incrpcorr(); -var v = accumulator( 2.0, 1.0 ); +let v = accumulator( 2.0, 1.0 ); // returns 0.0 v = accumulator( 1.0, -5.0 ); @@ -123,21 +123,16 @@ v = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrpcorr = require( '@stdlib/stats/incr/pcorr' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrpcorr = require( '@stdlib/stats/incr/pcorr' ); // Initialize an accumulator: -accumulator = incrpcorr(); +const accumulator = incrpcorr(); // For each simulated datum, update the sample correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/pcorr2/README.md b/lib/node_modules/@stdlib/stats/incr/pcorr2/README.md index 12de200b390d..f9bbc409a5ff 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorr2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/pcorr2/README.md @@ -67,7 +67,7 @@ The squared sample [Pearson product-moment correlation coefficient][pearson-corr ## Usage ```javascript -var incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); +const incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); ``` #### incrpcorr2( \[mx, my] ) @@ -75,13 +75,13 @@ var incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); Returns an accumulator `function` which incrementally computes a squared sample [Pearson product-moment correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrpcorr2(); +const accumulator = incrpcorr2(); ``` If the means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrpcorr2( 3.0, -5.5 ); +const accumulator = incrpcorr2( 3.0, -5.5 ); ``` #### accumulator( \[x, y] ) @@ -89,9 +89,9 @@ var accumulator = incrpcorr2( 3.0, -5.5 ); If provided input value `x` and `y`, the accumulator function returns an updated accumulated value. If not provided input values `x` and `y`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrpcorr2(); +const accumulator = incrpcorr2(); -var r2 = accumulator( 2.0, 1.0 ); +let r2 = accumulator( 2.0, 1.0 ); // returns 0.0 r2 = accumulator( 1.0, -5.0 ); @@ -126,21 +126,16 @@ r2 = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); // Initialize an accumulator: -accumulator = incrpcorr2(); +const accumulator = incrpcorr2(); // For each simulated datum, update the squared sample correlation coefficient... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/pcorrdist/README.md b/lib/node_modules/@stdlib/stats/incr/pcorrdist/README.md index 78434e37aca5..818ba201c214 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorrdist/README.md +++ b/lib/node_modules/@stdlib/stats/incr/pcorrdist/README.md @@ -50,7 +50,7 @@ where `r` is the [sample Pearson product-moment correlation coefficient][pearson ## Usage ```javascript -var incrpcorrdist = require( '@stdlib/stats/incr/pcorrdist' ); +const incrpcorrdist = require( '@stdlib/stats/incr/pcorrdist' ); ``` #### incrpcorrdist( \[mx, my] ) @@ -58,13 +58,13 @@ var incrpcorrdist = require( '@stdlib/stats/incr/pcorrdist' ); Returns an accumulator `function` which incrementally computes a [sample Pearson product-moment correlation distance][pearson-correlation]. ```javascript -var accumulator = incrpcorrdist(); +const accumulator = incrpcorrdist(); ``` If the means are already known, provide `mx` and `my` arguments. ```javascript -var accumulator = incrpcorrdist( 3.0, -5.5 ); +const accumulator = incrpcorrdist( 3.0, -5.5 ); ``` #### accumulator( \[x, y] ) @@ -72,9 +72,9 @@ var accumulator = incrpcorrdist( 3.0, -5.5 ); If provided input value `x` and `y`, the accumulator function returns an updated [sample correlation coefficient][pearson-correlation]. If not provided input values `x` and `y`, the accumulator function returns the current [sample correlation coefficient][pearson-correlation]. ```javascript -var accumulator = incrpcorrdist(); +const accumulator = incrpcorrdist(); -var d = accumulator( 2.0, 1.0 ); +let d = accumulator( 2.0, 1.0 ); // returns 1.0 d = accumulator( 1.0, -5.0 ); @@ -108,21 +108,16 @@ d = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrpcorrdist = require( '@stdlib/stats/incr/pcorrdist' ); - -var accumulator; -var x; -var y; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrpcorrdist = require( '@stdlib/stats/incr/pcorrdist' ); // Initialize an accumulator: -accumulator = incrpcorrdist(); +const accumulator = incrpcorrdist(); // For each simulated datum, update the sample correlation distance... -for ( i = 0; i < 100; i++ ) { - x = randu() * 100.0; - y = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const x = randu() * 100.0; + const y = randu() * 100.0; accumulator( x, y ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/pcorrdistmat/README.md b/lib/node_modules/@stdlib/stats/incr/pcorrdistmat/README.md index 5774f6652bda..a3b7d6fb5c22 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorrdistmat/README.md +++ b/lib/node_modules/@stdlib/stats/incr/pcorrdistmat/README.md @@ -50,7 +50,7 @@ where `r` is the [sample Pearson product-moment correlation coefficient][pearson ## Usage ```javascript -var incrpcorrdistmat = require( '@stdlib/stats/incr/pcorrdistmat' ); +const incrpcorrdistmat = require( '@stdlib/stats/incr/pcorrdistmat' ); ``` #### incrpcorrdistmat( out\[, means] ) @@ -59,41 +59,41 @@ Returns an accumulator `function` which incrementally computes a [sample Pearson ```javascript // Create an accumulator for computing a 2-dimensional correlation distance matrix: -var accumulator = incrpcorrdistmat( 2 ); +const accumulator = incrpcorrdistmat( 2 ); ``` The `out` argument may be either the order of the [correlation distance matrix][pearson-correlation] or a square 2-dimensional [`ndarray`][@stdlib/ndarray/ctor] for storing the [correlation distance matrix][pearson-correlation]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; +const buffer = new Float64Array( 4 ); +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; // Create a 2-dimensional output correlation distance matrix: -var dist = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const dist = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrpcorrdistmat( dist ); +const accumulator = incrpcorrdistmat( dist ); ``` When means are known, the function supports providing a 1-dimensional [`ndarray`][@stdlib/ndarray/ctor] containing mean values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); means.set( 0, 3.0 ); means.set( 1, -5.5 ); -var accumulator = incrpcorrdistmat( 2, means ); +const accumulator = incrpcorrdistmat( 2, means ); ``` #### accumulator( \[vector] ) @@ -101,28 +101,28 @@ var accumulator = incrpcorrdistmat( 2, means ); If provided a data vector, the accumulator function returns an updated [sample Pearson product-moment distance correlation matrix][pearson-correlation]. If not provided a data vector, the accumulator function returns the current [sample Pearson product-moment correlation distance matrix][pearson-correlation]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var dist = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +let buffer = new Float64Array( 4 ); +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +const dist = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); buffer = new Float64Array( 2 ); shape = [ 2 ]; strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrpcorrdistmat( dist ); +const accumulator = incrpcorrdistmat( dist ); vec.set( 0, 2.0 ); vec.set( 1, 1.0 ); -var out = accumulator( vec ); +let out = accumulator( vec ); // returns -var bool = ( out === dist ); +const bool = ( out === dist ); // returns true vec.set( 0, 1.0 ); @@ -162,38 +162,31 @@ out = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var incrpcorrdistmat = require( '@stdlib/stats/incr/pcorrdistmat' ); - -var dist; -var dxy; -var dyx; -var dx; -var dy; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const incrpcorrdistmat = require( '@stdlib/stats/incr/pcorrdistmat' ); // Initialize an accumulator for a 2-dimensional correlation distance matrix: -var accumulator = incrpcorrdistmat( 2 ); +const accumulator = incrpcorrdistmat( 2 ); // Create a 1-dimensional data vector: -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // For each simulated data vector, update the sample correlation distance matrix... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { vec.set( 0, randu()*100.0 ); vec.set( 1, randu()*100.0 ); - dist = accumulator( vec ); + const dist = accumulator( vec ); - dx = dist.get( 0, 0 ).toFixed( 4 ); - dy = dist.get( 1, 1 ).toFixed( 4 ); - dxy = dist.get( 0, 1 ).toFixed( 4 ); - dyx = dist.get( 1, 0 ).toFixed( 4 ); + const dx = dist.get( 0, 0 ).toFixed( 4 ); + const dy = dist.get( 1, 1 ).toFixed( 4 ); + const dxy = dist.get( 0, 1 ).toFixed( 4 ); + const dyx = dist.get( 1, 0 ).toFixed( 4 ); console.log( '[ %d, %d\n %d, %d ]', dx, dxy, dyx, dy ); } diff --git a/lib/node_modules/@stdlib/stats/incr/pcorrmat/README.md b/lib/node_modules/@stdlib/stats/incr/pcorrmat/README.md index 41e9b1c3d455..736458913f9c 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorrmat/README.md +++ b/lib/node_modules/@stdlib/stats/incr/pcorrmat/README.md @@ -65,7 +65,7 @@ r = \frac{\displaystyle\sum_{i=0}^{n-1} (x_i - \bar{x})(y_i - \bar{y})}{\display ## Usage ```javascript -var incrpcorrmat = require( '@stdlib/stats/incr/pcorrmat' ); +const incrpcorrmat = require( '@stdlib/stats/incr/pcorrmat' ); ``` #### incrpcorrmat( out\[, means] ) @@ -74,41 +74,41 @@ Returns an accumulator `function` which incrementally computes a [sample Pearson ```javascript // Create an accumulator for computing a 2-dimensional correlation matrix: -var accumulator = incrpcorrmat( 2 ); +const accumulator = incrpcorrmat( 2 ); ``` The `out` argument may be either the order of the [correlation matrix][pearson-correlation] or a square 2-dimensional [`ndarray`][@stdlib/ndarray/ctor] for storing the [correlation matrix][pearson-correlation]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; +const buffer = new Float64Array( 4 ); +const shape = [ 2, 2 ]; +const strides = [ 2, 1 ]; // Create a 2-dimensional output correlation matrix: -var corr = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const corr = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrpcorrmat( corr ); +const accumulator = incrpcorrmat( corr ); ``` When means are known, the function supports providing a 1-dimensional [`ndarray`][@stdlib/ndarray/ctor] containing mean values. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const means = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); means.set( 0, 3.0 ); means.set( 1, -5.5 ); -var accumulator = incrpcorrmat( 2, means ); +const accumulator = incrpcorrmat( 2, means ); ``` #### accumulator( \[vector] ) @@ -116,28 +116,28 @@ var accumulator = incrpcorrmat( 2, means ); If provided a data vector, the accumulator function returns an updated [sample Pearson product-moment correlation matrix][pearson-correlation]. If not provided a data vector, the accumulator function returns the current [sample Pearson product-moment correlation matrix][pearson-correlation]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var buffer = new Float64Array( 4 ); -var shape = [ 2, 2 ]; -var strides = [ 2, 1 ]; -var corr = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +let buffer = new Float64Array( 4 ); +let shape = [ 2, 2 ]; +let strides = [ 2, 1 ]; +const corr = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); buffer = new Float64Array( 2 ); shape = [ 2 ]; strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); -var accumulator = incrpcorrmat( corr ); +const accumulator = incrpcorrmat( corr ); vec.set( 0, 2.0 ); vec.set( 1, 1.0 ); -var out = accumulator( vec ); +let out = accumulator( vec ); // returns -var bool = ( out === corr ); +const bool = ( out === corr ); // returns true vec.set( 0, 1.0 ); @@ -173,38 +173,31 @@ out = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ndarray = require( '@stdlib/ndarray/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var incrpcorrmat = require( '@stdlib/stats/incr/pcorrmat' ); - -var corr; -var rxy; -var ryx; -var rx; -var ry; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); +const Float64Array = require( '@stdlib/array/float64' ); +const incrpcorrmat = require( '@stdlib/stats/incr/pcorrmat' ); // Initialize an accumulator for a 2-dimensional correlation matrix: -var accumulator = incrpcorrmat( 2 ); +const accumulator = incrpcorrmat( 2 ); // Create a 1-dimensional data vector: -var buffer = new Float64Array( 2 ); -var shape = [ 2 ]; -var strides = [ 1 ]; +const buffer = new Float64Array( 2 ); +const shape = [ 2 ]; +const strides = [ 1 ]; -var vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); +const vec = ndarray( 'float64', buffer, shape, strides, 0, 'row-major' ); // For each simulated data vector, update the sample correlation matrix... -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { vec.set( 0, randu()*100.0 ); vec.set( 1, randu()*100.0 ); - corr = accumulator( vec ); + const corr = accumulator( vec ); - rx = corr.get( 0, 0 ).toFixed( 4 ); - ry = corr.get( 1, 1 ).toFixed( 4 ); - rxy = corr.get( 0, 1 ).toFixed( 4 ); - ryx = corr.get( 1, 0 ).toFixed( 4 ); + const rx = corr.get( 0, 0 ).toFixed( 4 ); + const ry = corr.get( 1, 1 ).toFixed( 4 ); + const rxy = corr.get( 0, 1 ).toFixed( 4 ); + const ryx = corr.get( 1, 0 ).toFixed( 4 ); console.log( '[ %d, %d\n %d, %d ]', rx, rxy, ryx, ry ); } diff --git a/lib/node_modules/@stdlib/stats/incr/prod/README.md b/lib/node_modules/@stdlib/stats/incr/prod/README.md index 9659d8440c51..3ab1f0acf84c 100644 --- a/lib/node_modules/@stdlib/stats/incr/prod/README.md +++ b/lib/node_modules/@stdlib/stats/incr/prod/README.md @@ -48,7 +48,7 @@ p = \prod_{i=0}^{n-1} x_i ## Usage ```javascript -var incrprod = require( '@stdlib/stats/incr/prod' ); +const incrprod = require( '@stdlib/stats/incr/prod' ); ``` #### incrprod() @@ -56,7 +56,7 @@ var incrprod = require( '@stdlib/stats/incr/prod' ); Returns an accumulator `function` which incrementally computes a product. ```javascript -var accumulator = incrprod(); +const accumulator = incrprod(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrprod(); If provided an input value `x`, the accumulator function returns an updated product. If not provided an input value `x`, the accumulator function returns the current product. ```javascript -var accumulator = incrprod(); +const accumulator = incrprod(); -var prod = accumulator( 2.0 ); +let prod = accumulator( 2.0 ); // returns 2.0 prod = accumulator( 1.0 ); @@ -83,16 +83,16 @@ Under certain conditions, overflow may be transient. ```javascript // Large values: -var x = 5.0e+300; -var y = 1.0e+300; +const x = 5.0e+300; +const y = 1.0e+300; // Tiny value: -var z = 2.0e-302; +const z = 2.0e-302; // Initialize an accumulator: -var accumulator = incrprod(); +const accumulator = incrprod(); -var prod = accumulator( x ); +let prod = accumulator( x ); // returns 5.0e+300 // Transient overflow: @@ -108,16 +108,16 @@ Similarly, under certain conditions, underflow may be transient. ```javascript // Tiny values: -var x = 4.0e-302; -var y = 9.0e-303; +const x = 4.0e-302; +const y = 9.0e-303; // Large value: -var z = 2.0e+300; +const z = 2.0e+300; // Initialize an accumulator: -var accumulator = incrprod(); +const accumulator = incrprod(); -var prod = accumulator( x ); +let prod = accumulator( x ); // returns 4.0e-302 // Transient underflow: @@ -151,19 +151,15 @@ prod = accumulator( z ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrprod = require( '@stdlib/stats/incr/prod' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrprod = require( '@stdlib/stats/incr/prod' ); // Initialize an accumulator: -accumulator = incrprod(); +const accumulator = incrprod(); // For each simulated value, update the product... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/range/README.md b/lib/node_modules/@stdlib/stats/incr/range/README.md index d842ef847eb4..1b75523c6c62 100644 --- a/lib/node_modules/@stdlib/stats/incr/range/README.md +++ b/lib/node_modules/@stdlib/stats/incr/range/README.md @@ -35,7 +35,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var incrrange = require( '@stdlib/stats/incr/range' ); +const incrrange = require( '@stdlib/stats/incr/range' ); ``` #### incrrange() @@ -43,7 +43,7 @@ var incrrange = require( '@stdlib/stats/incr/range' ); Returns an accumulator `function` which incrementally computes a [range][range]. ```javascript -var accumulator = incrrange(); +const accumulator = incrrange(); ``` #### accumulator( \[x] ) @@ -51,9 +51,9 @@ var accumulator = incrrange(); If provided an input value `x`, the accumulator function returns an updated [range][range]. If not provided an input value `x`, the accumulator function returns the current [range][range]. ```javascript -var accumulator = incrrange(); +const accumulator = incrrange(); -var range = accumulator( -2.0 ); +let range = accumulator( -2.0 ); // returns 0.0 range = accumulator( 1.0 ); @@ -87,19 +87,15 @@ range = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrrange = require( '@stdlib/stats/incr/range' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrrange = require( '@stdlib/stats/incr/range' ); // Initialize an accumulator: -accumulator = incrrange(); +const accumulator = incrrange(); // For each simulated datum, update the range... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/rmse/README.md b/lib/node_modules/@stdlib/stats/incr/rmse/README.md index 7a2bd9ff5fad..e2aba0383a50 100644 --- a/lib/node_modules/@stdlib/stats/incr/rmse/README.md +++ b/lib/node_modules/@stdlib/stats/incr/rmse/README.md @@ -48,7 +48,7 @@ The [**root mean squared error**][root-mean-squared-error] (also known as the ** ## Usage ```javascript -var incrrmse = require( '@stdlib/stats/incr/rmse' ); +const incrrmse = require( '@stdlib/stats/incr/rmse' ); ``` #### incrrmse() @@ -56,7 +56,7 @@ var incrrmse = require( '@stdlib/stats/incr/rmse' ); Returns an accumulator `function` which incrementally computes the [root mean squared error][root-mean-squared-error]. ```javascript -var accumulator = incrrmse(); +const accumulator = incrrmse(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrrmse(); If provided input values `x` and `y`, the accumulator function returns an updated [root mean squared error][root-mean-squared-error]. If not provided input values `x` and `y`, the accumulator function returns the current [root mean squared error][root-mean-squared-error]. ```javascript -var accumulator = incrrmse(); +const accumulator = incrrmse(); -var r = accumulator( 2.0, 3.0 ); +let r = accumulator( 2.0, 3.0 ); // returns 1.0 r = accumulator( -1.0, -4.0 ); @@ -100,21 +100,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrrmse = require( '@stdlib/stats/incr/rmse' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrrmse = require( '@stdlib/stats/incr/rmse' ); // Initialize an accumulator: -accumulator = incrrmse(); +const accumulator = incrrmse(); // For each simulated datum, update the root mean squared error... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/rss/README.md b/lib/node_modules/@stdlib/stats/incr/rss/README.md index 5497caf7759d..f666f38d4684 100644 --- a/lib/node_modules/@stdlib/stats/incr/rss/README.md +++ b/lib/node_modules/@stdlib/stats/incr/rss/README.md @@ -48,7 +48,7 @@ The [**residual sum of squares**][residual-sum-of-squares] (also referred to as ## Usage ```javascript -var incrrss = require( '@stdlib/stats/incr/rss' ); +const incrrss = require( '@stdlib/stats/incr/rss' ); ``` #### incrrss() @@ -56,7 +56,7 @@ var incrrss = require( '@stdlib/stats/incr/rss' ); Returns an accumulator `function` which incrementally computes the [residual sum of squares][residual-sum-of-squares]. ```javascript -var accumulator = incrrss(); +const accumulator = incrrss(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrrss(); If provided input values `x` and `y`, the accumulator function returns an updated [residual sum of squares][residual-sum-of-squares]. If not provided input values `x` and `y`, the accumulator function returns the current [residual sum of squares][residual-sum-of-squares]. ```javascript -var accumulator = incrrss(); +const accumulator = incrrss(); -var r = accumulator( 2.0, 3.0 ); +let r = accumulator( 2.0, 3.0 ); // returns 1.0 r = accumulator( -1.0, -4.0 ); @@ -100,21 +100,16 @@ r = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrrss = require( '@stdlib/stats/incr/rss' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrrss = require( '@stdlib/stats/incr/rss' ); // Initialize an accumulator: -accumulator = incrrss(); +const accumulator = incrrss(); // For each simulated datum, update the residual sum of squares... -for ( i = 0; i < 100; i++ ) { - v1 = ( randu()*100.0 ) - 50.0; - v2 = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = ( randu()*100.0 ) - 50.0; + const v2 = ( randu()*100.0 ) - 50.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/skewness/README.md b/lib/node_modules/@stdlib/stats/incr/skewness/README.md index 2924422cd295..3200ef09a4ea 100644 --- a/lib/node_modules/@stdlib/stats/incr/skewness/README.md +++ b/lib/node_modules/@stdlib/stats/incr/skewness/README.md @@ -80,7 +80,7 @@ G_1 = \frac{n^2}{(n-1)(n-2)} \frac{m_3}{s^3} = \frac{\sqrt{n(n-1)}}{n-2} \frac{\ ## Usage ```javascript -var incrskewness = require( '@stdlib/stats/incr/skewness' ); +const incrskewness = require( '@stdlib/stats/incr/skewness' ); ``` #### incrskewness() @@ -88,7 +88,7 @@ var incrskewness = require( '@stdlib/stats/incr/skewness' ); Returns an accumulator `function` which incrementally computes a [corrected sample skewness][sample-skewness]. ```javascript -var accumulator = incrskewness(); +const accumulator = incrskewness(); ``` #### accumulator( \[x] ) @@ -96,9 +96,9 @@ var accumulator = incrskewness(); If provided an input value `x`, the accumulator function returns an updated [corrected sample skewness][sample-skewness]. If not provided an input value `x`, the accumulator function returns the current [corrected sample skewness][sample-skewness]. ```javascript -var accumulator = incrskewness(); +const accumulator = incrskewness(); -var skewness = accumulator(); +let skewness = accumulator(); // returns null skewness = accumulator( 2.0 ); @@ -135,19 +135,15 @@ skewness = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrskewness = require( '@stdlib/stats/incr/skewness' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrskewness = require( '@stdlib/stats/incr/skewness' ); // Initialize an accumulator: -accumulator = incrskewness(); +const accumulator = incrskewness(); // For each simulated datum, update the corrected sample skewness... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/stdev/README.md b/lib/node_modules/@stdlib/stats/incr/stdev/README.md index f2e210c05a09..d4d75ebf51e7 100644 --- a/lib/node_modules/@stdlib/stats/incr/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/incr/stdev/README.md @@ -48,7 +48,7 @@ s = \sqrt{\frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2} ## Usage ```javascript -var incrstdev = require( '@stdlib/stats/incr/stdev' ); +const incrstdev = require( '@stdlib/stats/incr/stdev' ); ``` #### incrstdev( \[mean] ) @@ -56,13 +56,13 @@ var incrstdev = require( '@stdlib/stats/incr/stdev' ); Returns an accumulator `function` which incrementally computes a [corrected sample standard deviation][sample-stdev]. ```javascript -var accumulator = incrstdev(); +const accumulator = incrstdev(); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrstdev( 3.0 ); +const accumulator = incrstdev( 3.0 ); ``` #### accumulator( \[x] ) @@ -70,9 +70,9 @@ var accumulator = incrstdev( 3.0 ); If provided an input value `x`, the accumulator function returns an updated [corrected sample standard deviation][sample-stdev]. If not provided an input value `x`, the accumulator function returns the current [corrected sample standard deviation][sample-stdev]. ```javascript -var accumulator = incrstdev(); +const accumulator = incrstdev(); -var s = accumulator( 2.0 ); +let s = accumulator( 2.0 ); // returns 0.0 s = accumulator( 1.0 ); // => sqrt(((2-1.5)^2+(1-1.5)^2) / (2-1)) @@ -106,19 +106,15 @@ s = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrstdev = require( '@stdlib/stats/incr/stdev' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrstdev = require( '@stdlib/stats/incr/stdev' ); // Initialize an accumulator: -accumulator = incrstdev(); +const accumulator = incrstdev(); // For each simulated datum, update the sample standard deviation... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/sum/README.md b/lib/node_modules/@stdlib/stats/incr/sum/README.md index c07252897f16..ee63e7973be5 100644 --- a/lib/node_modules/@stdlib/stats/incr/sum/README.md +++ b/lib/node_modules/@stdlib/stats/incr/sum/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} x_i ## Usage ```javascript -var incrsum = require( '@stdlib/stats/incr/sum' ); +const incrsum = require( '@stdlib/stats/incr/sum' ); ``` #### incrsum() @@ -56,7 +56,7 @@ var incrsum = require( '@stdlib/stats/incr/sum' ); Returns an accumulator `function` which incrementally computes a sum. ```javascript -var accumulator = incrsum(); +const accumulator = incrsum(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrsum(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrsum(); +const accumulator = incrsum(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 2.0 sum = accumulator( 1.0 ); @@ -101,19 +101,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrsum = require( '@stdlib/stats/incr/sum' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrsum = require( '@stdlib/stats/incr/sum' ); // Initialize an accumulator: -accumulator = incrsum(); +const accumulator = incrsum(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/sumabs/README.md b/lib/node_modules/@stdlib/stats/incr/sumabs/README.md index 13c73708df1b..9afd675bb77c 100644 --- a/lib/node_modules/@stdlib/stats/incr/sumabs/README.md +++ b/lib/node_modules/@stdlib/stats/incr/sumabs/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} |x_i| ## Usage ```javascript -var incrsumabs = require( '@stdlib/stats/incr/sumabs' ); +const incrsumabs = require( '@stdlib/stats/incr/sumabs' ); ``` #### incrsumabs() @@ -56,7 +56,7 @@ var incrsumabs = require( '@stdlib/stats/incr/sumabs' ); Returns an accumulator `function` which incrementally computes a sum of absolute values. ```javascript -var accumulator = incrsumabs(); +const accumulator = incrsumabs(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrsumabs(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrsumabs(); +const accumulator = incrsumabs(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 2.0 sum = accumulator( -1.0 ); @@ -101,19 +101,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrsumabs = require( '@stdlib/stats/incr/sumabs' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrsumabs = require( '@stdlib/stats/incr/sumabs' ); // Initialize an accumulator: -accumulator = incrsumabs(); +const accumulator = incrsumabs(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/sumabs2/README.md b/lib/node_modules/@stdlib/stats/incr/sumabs2/README.md index 492407ae1b2c..ff91e3dd5895 100644 --- a/lib/node_modules/@stdlib/stats/incr/sumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/incr/sumabs2/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} x_i^2 ## Usage ```javascript -var incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' ); +const incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' ); ``` #### incrsumabs2() @@ -56,7 +56,7 @@ var incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' ); Returns an accumulator `function` which incrementally computes a sum of squared absolute values. ```javascript -var accumulator = incrsumabs2(); +const accumulator = incrsumabs2(); ``` #### accumulator( \[x] ) @@ -64,9 +64,9 @@ var accumulator = incrsumabs2(); If provided an input value `x`, the accumulator function returns an updated sum. If not provided an input value `x`, the accumulator function returns the current sum. ```javascript -var accumulator = incrsumabs2(); +const accumulator = incrsumabs2(); -var sum = accumulator( 2.0 ); +let sum = accumulator( 2.0 ); // returns 4.0 sum = accumulator( -1.0 ); @@ -101,19 +101,15 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrsumabs2 = require( '@stdlib/stats/incr/sumabs2' ); // Initialize an accumulator: -accumulator = incrsumabs2(); +const accumulator = incrsumabs2(); // For each simulated datum, update the sum... -for ( i = 0; i < 100; i++ ) { - v = ( randu()*100.0 ) - 50.0; +for ( let i = 0; i < 100; i++ ) { + const v = ( randu()*100.0 ) - 50.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/summary/README.md b/lib/node_modules/@stdlib/stats/incr/summary/README.md index 99c52feed633..4ac7537225ca 100644 --- a/lib/node_modules/@stdlib/stats/incr/summary/README.md +++ b/lib/node_modules/@stdlib/stats/incr/summary/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var incrsummary = require( '@stdlib/stats/incr/summary' ); +const incrsummary = require( '@stdlib/stats/incr/summary' ); ``` #### incrsummary() @@ -35,7 +35,7 @@ var incrsummary = require( '@stdlib/stats/incr/summary' ); Returns an accumulator `function` which incrementally computes a statistical summary. ```javascript -var accumulator = incrsummary(); +const accumulator = incrsummary(); ``` #### accumulator( \[x] ) @@ -43,9 +43,9 @@ var accumulator = incrsummary(); If provided an input value `x`, the accumulator function returns an updated summary. If not provided an input value `x`, the accumulator function returns the current summary. ```javascript -var accumulator = incrsummary(); +const accumulator = incrsummary(); -var summary = accumulator(); +let summary = accumulator(); // returns {} summary = accumulator( 2.0 ); @@ -139,19 +139,15 @@ summary = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrsummary = require( '@stdlib/stats/incr/summary' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrsummary = require( '@stdlib/stats/incr/summary' ); // Initialize an accumulator: -accumulator = incrsummary(); +const accumulator = incrsummary(); // For each simulated datum, update the summary... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/sumprod/README.md b/lib/node_modules/@stdlib/stats/incr/sumprod/README.md index 4d79fda884f5..45eaf836a6ec 100644 --- a/lib/node_modules/@stdlib/stats/incr/sumprod/README.md +++ b/lib/node_modules/@stdlib/stats/incr/sumprod/README.md @@ -48,7 +48,7 @@ s = \sum_{i=0}^{n-1} x_i y_i ## Usage ```javascript -var incrsumprod = require( '@stdlib/stats/incr/sumprod' ); +const incrsumprod = require( '@stdlib/stats/incr/sumprod' ); ``` #### incrsumprod() @@ -56,7 +56,7 @@ var incrsumprod = require( '@stdlib/stats/incr/sumprod' ); Returns an accumulator `function` which incrementally computes a sum of products. ```javascript -var accumulator = incrsumprod(); +const accumulator = incrsumprod(); ``` #### accumulator( \[x, y] ) @@ -64,9 +64,9 @@ var accumulator = incrsumprod(); If provided input values `x` and `y`, the accumulator function returns an updated sum. If not provided input value `x` and `y`, the accumulator function returns the current sum. ```javascript -var accumulator = incrsumprod(); +const accumulator = incrsumprod(); -var sum = accumulator( 2.0, 3.0 ); +let sum = accumulator( 2.0, 3.0 ); // returns 6.0 sum = accumulator( 1.0, -1.0 ); @@ -101,21 +101,16 @@ sum = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrsumprod = require( '@stdlib/stats/incr/sumprod' ); - -var accumulator; -var v1; -var v2; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrsumprod = require( '@stdlib/stats/incr/sumprod' ); // Initialize an accumulator: -accumulator = incrsumprod(); +const accumulator = incrsumprod(); // For each simulated datum, update the sum-product... -for ( i = 0; i < 100; i++ ) { - v1 = randu() * 100.0; - v2 = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v1 = randu() * 100.0; + const v2 = randu() * 100.0; accumulator( v1, v2 ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/variance/README.md b/lib/node_modules/@stdlib/stats/incr/variance/README.md index 9a54f6efc6d3..4d8bf3a2d282 100644 --- a/lib/node_modules/@stdlib/stats/incr/variance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/variance/README.md @@ -48,7 +48,7 @@ s^2 = \frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2 ## Usage ```javascript -var incrvariance = require( '@stdlib/stats/incr/variance' ); +const incrvariance = require( '@stdlib/stats/incr/variance' ); ``` #### incrvariance( \[mean] ) @@ -56,13 +56,13 @@ var incrvariance = require( '@stdlib/stats/incr/variance' ); Returns an accumulator `function` which incrementally computes an [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrvariance(); +const accumulator = incrvariance(); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrvariance( 3.0 ); +const accumulator = incrvariance( 3.0 ); ``` #### accumulator( \[x] ) @@ -70,9 +70,9 @@ var accumulator = incrvariance( 3.0 ); If provided an input value `x`, the accumulator function returns an updated [unbiased sample variance][sample-variance]. If not provided an input value `x`, the accumulator function returns the current [unbiased sample variance][sample-variance]. ```javascript -var accumulator = incrvariance(); +const accumulator = incrvariance(); -var s2 = accumulator( 2.0 ); +let s2 = accumulator( 2.0 ); // returns 0.0 s2 = accumulator( 1.0 ); // => ((2-1.5)^2+(1-1.5)^2) / (2-1) @@ -106,19 +106,15 @@ s2 = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrvariance = require( '@stdlib/stats/incr/variance' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrvariance = require( '@stdlib/stats/incr/variance' ); // Initialize an accumulator: -accumulator = incrvariance(); +const accumulator = incrvariance(); // For each simulated datum, update the unbiased sample variance... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/vmr/README.md b/lib/node_modules/@stdlib/stats/incr/vmr/README.md index 5a9c41938761..2a141f74b4c6 100644 --- a/lib/node_modules/@stdlib/stats/incr/vmr/README.md +++ b/lib/node_modules/@stdlib/stats/incr/vmr/README.md @@ -78,7 +78,7 @@ D = \frac{s^2}{\bar{x}} ## Usage ```javascript -var incrvmr = require( '@stdlib/stats/incr/vmr' ); +const incrvmr = require( '@stdlib/stats/incr/vmr' ); ``` #### incrvmr( \[mean] ) @@ -86,13 +86,13 @@ var incrvmr = require( '@stdlib/stats/incr/vmr' ); Returns an accumulator `function` which incrementally computes a [variance-to-mean ratio][variance-to-mean-ratio]. ```javascript -var accumulator = incrvmr(); +const accumulator = incrvmr(); ``` If the mean is already known, provide a `mean` argument. ```javascript -var accumulator = incrvmr( 3.0 ); +const accumulator = incrvmr( 3.0 ); ``` #### accumulator( \[x] ) @@ -100,9 +100,9 @@ var accumulator = incrvmr( 3.0 ); If provided an input value `x`, the accumulator function returns an updated accumulated value. If not provided an input value `x`, the accumulator function returns the current accumulated value. ```javascript -var accumulator = incrvmr(); +const accumulator = incrvmr(); -var D = accumulator( 2.0 ); +let D = accumulator( 2.0 ); // returns 0.0 D = accumulator( 1.0 ); // => s^2 = ((2-1.5)^2+(1-1.5)^2) / (2-1) @@ -151,19 +151,15 @@ D = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrvmr = require( '@stdlib/stats/incr/vmr' ); - -var accumulator; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrvmr = require( '@stdlib/stats/incr/vmr' ); // Initialize an accumulator: -accumulator = incrvmr(); +const accumulator = incrvmr(); // For each simulated datum, update the variance-to-mean ratio... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; accumulator( v ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/incr/wmean/README.md b/lib/node_modules/@stdlib/stats/incr/wmean/README.md index 134b561b7849..492bd74a4900 100644 --- a/lib/node_modules/@stdlib/stats/incr/wmean/README.md +++ b/lib/node_modules/@stdlib/stats/incr/wmean/README.md @@ -48,7 +48,7 @@ The [weighted arithmetic mean][weighted-arithmetic-mean] is defined as ## Usage ```javascript -var incrwmean = require( '@stdlib/stats/incr/wmean' ); +const incrwmean = require( '@stdlib/stats/incr/wmean' ); ``` #### incrwmean() @@ -56,7 +56,7 @@ var incrwmean = require( '@stdlib/stats/incr/wmean' ); Returns an accumulator `function` which incrementally computes a [weighted arithmetic mean][weighted-arithmetic-mean]. ```javascript -var accumulator = incrwmean(); +const accumulator = incrwmean(); ``` #### accumulator( \[x, w] ) @@ -64,9 +64,9 @@ var accumulator = incrwmean(); If provided an input value `x` and a weight `w`, the accumulator function returns an updated weighted mean. If not provided any input values, the accumulator function returns the current mean. ```javascript -var accumulator = incrwmean(); +const accumulator = incrwmean(); -var mu = accumulator( 2.0, 1.0 ); +let mu = accumulator( 2.0, 1.0 ); // returns 2.0 mu = accumulator( 2.0, 0.5 ); @@ -100,21 +100,16 @@ mu = accumulator(); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var incrwmean = require( '@stdlib/stats/incr/wmean' ); - -var accumulator; -var v; -var w; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const incrwmean = require( '@stdlib/stats/incr/wmean' ); // Initialize an accumulator: -accumulator = incrwmean(); +const accumulator = incrwmean(); // For each simulated datum, update the weighted mean... -for ( i = 0; i < 100; i++ ) { - v = randu() * 100.0; - w = randu() * 100.0; +for ( let i = 0; i < 100; i++ ) { + const v = randu() * 100.0; + const w = randu() * 100.0; accumulator( v, w ); } console.log( accumulator() ); diff --git a/lib/node_modules/@stdlib/stats/iter/README.md b/lib/node_modules/@stdlib/stats/iter/README.md index 7938358119f3..bbe2b1fa25a7 100644 --- a/lib/node_modules/@stdlib/stats/iter/README.md +++ b/lib/node_modules/@stdlib/stats/iter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/stats/iter' ); +const ns = require( '@stdlib/stats/iter' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/stats/iter' ); Namespace containing functions for computing statistics over iterators. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -104,8 +104,8 @@ var o = ns; ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/stats/iter' ); +const getKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/stats/iter' ); console.log( getKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/stats/iter/cugmean/README.md b/lib/node_modules/@stdlib/stats/iter/cugmean/README.md index 98b3e806ae69..000e1a4a2d9d 100644 --- a/lib/node_modules/@stdlib/stats/iter/cugmean/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cugmean/README.md @@ -50,7 +50,7 @@ The [geometric mean][geometric-mean] is defined as the nth root of a product of ## Usage ```javascript -var itercugmean = require( '@stdlib/stats/iter/cugmean' ); +const itercugmean = require( '@stdlib/stats/iter/cugmean' ); ``` #### itercugmean( iterator ) @@ -58,12 +58,12 @@ var itercugmean = require( '@stdlib/stats/iter/cugmean' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [geometric mean][geometric-mean]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, 7.0, 5.0 ] ); -var it = itercugmean( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, 7.0, 5.0 ] ); +const it = itercugmean( arr ); -var v = it.next().value; +let v = it.next().value; // returns 2.0 v = it.next().value; @@ -104,20 +104,20 @@ v = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercugmean = require( '@stdlib/stats/iter/cugmean' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercugmean = require( '@stdlib/stats/iter/cugmean' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( 0.0, 10.0, { +const rand = runif( 0.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative geometric mean: -var it = itercugmean( rand ); +const it = itercugmean( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cuhmean/README.md b/lib/node_modules/@stdlib/stats/iter/cuhmean/README.md index 882a9f93b92b..f967641adc9d 100644 --- a/lib/node_modules/@stdlib/stats/iter/cuhmean/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cuhmean/README.md @@ -50,7 +50,7 @@ The [harmonic mean][harmonic-mean] of positive real numbers `x_0, x_1, ..., x_{n ## Usage ```javascript -var itercuhmean = require( '@stdlib/stats/iter/cuhmean' ); +const itercuhmean = require( '@stdlib/stats/iter/cuhmean' ); ``` #### itercuhmean( iterator ) @@ -58,12 +58,12 @@ var itercuhmean = require( '@stdlib/stats/iter/cuhmean' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [harmonic mean][harmonic-mean]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, 7.0, 5.0 ] ); -var it = itercuhmean( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, 7.0, 5.0 ] ); +const it = itercuhmean( arr ); -var v = it.next().value; +let v = it.next().value; // returns 2.0 v = it.next().value; @@ -104,20 +104,20 @@ v = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercuhmean = require( '@stdlib/stats/iter/cuhmean' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercuhmean = require( '@stdlib/stats/iter/cuhmean' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( 0.0, 10.0, { +const rand = runif( 0.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative harmonic mean: -var it = itercuhmean( rand ); +const it = itercuhmean( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumax/README.md b/lib/node_modules/@stdlib/stats/iter/cumax/README.md index b2a6f9d4c3de..16d931a809a5 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumax/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumax/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itercumax = require( '@stdlib/stats/iter/cumax' ); +const itercumax = require( '@stdlib/stats/iter/cumax' ); ``` #### itercumax( iterator ) @@ -43,12 +43,12 @@ var itercumax = require( '@stdlib/stats/iter/cumax' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative maximum value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumax( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumax( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -89,20 +89,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumax = require( '@stdlib/stats/iter/cumax' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumax = require( '@stdlib/stats/iter/cumax' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative maximum value: -var it = itercumax( rand ); +const it = itercumax( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumaxabs/README.md b/lib/node_modules/@stdlib/stats/iter/cumaxabs/README.md index dfccdf921a96..490b0556f2d7 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumaxabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itercumaxabs = require( '@stdlib/stats/iter/cumaxabs' ); +const itercumaxabs = require( '@stdlib/stats/iter/cumaxabs' ); ``` #### itercumaxabs( iterator ) @@ -43,12 +43,12 @@ var itercumaxabs = require( '@stdlib/stats/iter/cumaxabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative maximum absolute value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumaxabs( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumaxabs( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -89,20 +89,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumaxabs = require( '@stdlib/stats/iter/cumaxabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumaxabs = require( '@stdlib/stats/iter/cumaxabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative maximum absolute value: -var it = itercumaxabs( rand ); +const it = itercumaxabs( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumean/README.md b/lib/node_modules/@stdlib/stats/iter/cumean/README.md index c1f5493fd3f3..d7faae5f2a50 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumean/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumean/README.md @@ -50,7 +50,7 @@ The cumulative [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var itercumean = require( '@stdlib/stats/iter/cumean' ); +const itercumean = require( '@stdlib/stats/iter/cumean' ); ``` #### itercumean( iterator ) @@ -58,12 +58,12 @@ var itercumean = require( '@stdlib/stats/iter/cumean' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [arithmetic mean][arithmetic-mean]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumean( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumean( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -104,20 +104,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumean = require( '@stdlib/stats/iter/cumean' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumean = require( '@stdlib/stats/iter/cumean' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative mean: -var it = itercumean( rand ); +const it = itercumean( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumeanabs/README.md b/lib/node_modules/@stdlib/stats/iter/cumeanabs/README.md index fd75799cd19e..3315644fadbc 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumeanabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumeanabs/README.md @@ -50,7 +50,7 @@ The cumulative [arithmetic mean][arithmetic-mean] of absolute values is defined ## Usage ```javascript -var itercumeanabs = require( '@stdlib/stats/iter/cumeanabs' ); +const itercumeanabs = require( '@stdlib/stats/iter/cumeanabs' ); ``` #### itercumeanabs( iterator ) @@ -58,12 +58,12 @@ var itercumeanabs = require( '@stdlib/stats/iter/cumeanabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [arithmetic mean][arithmetic-mean] of absolute values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumeanabs( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumeanabs( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -104,20 +104,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumeanabs = require( '@stdlib/stats/iter/cumeanabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumeanabs = require( '@stdlib/stats/iter/cumeanabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative mean of absolute values: -var it = itercumeanabs( rand ); +const it = itercumeanabs( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumeanabs2/README.md b/lib/node_modules/@stdlib/stats/iter/cumeanabs2/README.md index d332c9e082ca..e0e92c18991e 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumeanabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumeanabs2/README.md @@ -50,7 +50,7 @@ The cumulative [arithmetic mean][arithmetic-mean] of squared absolute values is ## Usage ```javascript -var itercumeanabs2 = require( '@stdlib/stats/iter/cumeanabs2' ); +const itercumeanabs2 = require( '@stdlib/stats/iter/cumeanabs2' ); ``` #### itercumeanabs2( iterator ) @@ -58,12 +58,12 @@ var itercumeanabs2 = require( '@stdlib/stats/iter/cumeanabs2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [arithmetic mean][arithmetic-mean] of squared absolute values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumeanabs2( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumeanabs2( arr ); -var m = it.next().value; +let m = it.next().value; // returns 4.0 m = it.next().value; @@ -104,20 +104,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumeanabs2 = require( '@stdlib/stats/iter/cumeanabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumeanabs2 = require( '@stdlib/stats/iter/cumeanabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative mean of squared absolute values: -var it = itercumeanabs2( rand ); +const it = itercumeanabs2( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumidrange/README.md b/lib/node_modules/@stdlib/stats/iter/cumidrange/README.md index 4bb0b545ce06..5488dfd8c4df 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumidrange/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumidrange/README.md @@ -37,7 +37,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of ma ## Usage ```javascript -var itercumidrange = require( '@stdlib/stats/iter/cumidrange' ); +const itercumidrange = require( '@stdlib/stats/iter/cumidrange' ); ``` #### itercumidrange( iterator ) @@ -45,12 +45,12 @@ var itercumidrange = require( '@stdlib/stats/iter/cumidrange' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative [mid-range][mid-range]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumidrange( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumidrange( arr ); -var v = it.next().value; +let v = it.next().value; // returns 2.0 v = it.next().value; @@ -91,20 +91,20 @@ v = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumidrange = require( '@stdlib/stats/iter/cumidrange' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumidrange = require( '@stdlib/stats/iter/cumidrange' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative mid-range: -var it = itercumidrange( rand ); +const it = itercumidrange( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cumin/README.md b/lib/node_modules/@stdlib/stats/iter/cumin/README.md index 7fab50153737..04bceca21f13 100644 --- a/lib/node_modules/@stdlib/stats/iter/cumin/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cumin/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itercumin = require( '@stdlib/stats/iter/cumin' ); +const itercumin = require( '@stdlib/stats/iter/cumin' ); ``` #### itercumin( iterator ) @@ -43,12 +43,12 @@ var itercumin = require( '@stdlib/stats/iter/cumin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative minimum value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercumin( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercumin( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -89,20 +89,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercumin = require( '@stdlib/stats/iter/cumin' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercumin = require( '@stdlib/stats/iter/cumin' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative minimum value: -var it = itercumin( rand ); +const it = itercumin( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cuminabs/README.md b/lib/node_modules/@stdlib/stats/iter/cuminabs/README.md index 7db618b1d11d..b1a9602a5614 100644 --- a/lib/node_modules/@stdlib/stats/iter/cuminabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cuminabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itercuminabs = require( '@stdlib/stats/iter/cuminabs' ); +const itercuminabs = require( '@stdlib/stats/iter/cuminabs' ); ``` #### itercuminabs( iterator ) @@ -43,12 +43,12 @@ var itercuminabs = require( '@stdlib/stats/iter/cuminabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative minimum absolute value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercuminabs( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercuminabs( arr ); -var m = it.next().value; +let m = it.next().value; // returns 2.0 m = it.next().value; @@ -89,20 +89,20 @@ m = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercuminabs = require( '@stdlib/stats/iter/cuminabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercuminabs = require( '@stdlib/stats/iter/cuminabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative minimum absolute value: -var it = itercuminabs( rand ); +const it = itercuminabs( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cuprod/README.md b/lib/node_modules/@stdlib/stats/iter/cuprod/README.md index 3c96ac67d23d..df445afcbbf6 100644 --- a/lib/node_modules/@stdlib/stats/iter/cuprod/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cuprod/README.md @@ -50,7 +50,7 @@ The cumulative product is defined as ## Usage ```javascript -var itercuprod = require( '@stdlib/stats/iter/cuprod' ); +const itercuprod = require( '@stdlib/stats/iter/cuprod' ); ``` #### itercuprod( iterator ) @@ -58,12 +58,12 @@ var itercuprod = require( '@stdlib/stats/iter/cuprod' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative product. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercuprod( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercuprod( arr ); -var p = it.next().value; +let p = it.next().value; // returns 2.0 p = it.next().value; @@ -105,20 +105,20 @@ p = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercuprod = require( '@stdlib/stats/iter/cuprod' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercuprod = require( '@stdlib/stats/iter/cuprod' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative product: -var it = itercuprod( rand ); +const it = itercuprod( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/curange/README.md b/lib/node_modules/@stdlib/stats/iter/curange/README.md index eaf3d8a64a15..ea5249f2c742 100644 --- a/lib/node_modules/@stdlib/stats/iter/curange/README.md +++ b/lib/node_modules/@stdlib/stats/iter/curange/README.md @@ -37,7 +37,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var itercurange = require( '@stdlib/stats/iter/curange' ); +const itercurange = require( '@stdlib/stats/iter/curange' ); ``` #### itercurange( iterator ) @@ -45,12 +45,12 @@ var itercurange = require( '@stdlib/stats/iter/curange' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative range. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercurange( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercurange( arr ); -var r = it.next().value; +let r = it.next().value; // returns 0.0 r = it.next().value; @@ -91,20 +91,20 @@ r = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercurange = require( '@stdlib/stats/iter/curange' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercurange = require( '@stdlib/stats/iter/curange' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative range: -var it = itercurange( rand ); +const it = itercurange( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cusum/README.md b/lib/node_modules/@stdlib/stats/iter/cusum/README.md index 458c557c4863..433b4dfceb10 100644 --- a/lib/node_modules/@stdlib/stats/iter/cusum/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cusum/README.md @@ -50,7 +50,7 @@ The cumulative sum is defined as ## Usage ```javascript -var itercusum = require( '@stdlib/stats/iter/cusum' ); +const itercusum = require( '@stdlib/stats/iter/cusum' ); ``` #### itercusum( iterator ) @@ -58,12 +58,12 @@ var itercusum = require( '@stdlib/stats/iter/cusum' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative sum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercusum( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercusum( arr ); -var s = it.next().value; +let s = it.next().value; // returns 2.0 s = it.next().value; @@ -104,20 +104,20 @@ s = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercusum = require( '@stdlib/stats/iter/cusum' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercusum = require( '@stdlib/stats/iter/cusum' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative sum: -var it = itercusum( rand ); +const it = itercusum( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cusumabs/README.md b/lib/node_modules/@stdlib/stats/iter/cusumabs/README.md index 2053c847d33a..ade996dc2ce8 100644 --- a/lib/node_modules/@stdlib/stats/iter/cusumabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cusumabs/README.md @@ -50,7 +50,7 @@ The cumulative sum of absolute values is defined as ## Usage ```javascript -var itercusumabs = require( '@stdlib/stats/iter/cusumabs' ); +const itercusumabs = require( '@stdlib/stats/iter/cusumabs' ); ``` #### itercusumabs( iterator ) @@ -58,12 +58,12 @@ var itercusumabs = require( '@stdlib/stats/iter/cusumabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative sum of absolute values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercusumabs( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercusumabs( arr ); -var s = it.next().value; +let s = it.next().value; // returns 2.0 s = it.next().value; @@ -104,20 +104,20 @@ s = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercusumabs = require( '@stdlib/stats/iter/cusumabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercusumabs = require( '@stdlib/stats/iter/cusumabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative sum of absolute values: -var it = itercusumabs( rand ); +const it = itercusumabs( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/cusumabs2/README.md b/lib/node_modules/@stdlib/stats/iter/cusumabs2/README.md index b6dce5e131de..2b6596655d66 100644 --- a/lib/node_modules/@stdlib/stats/iter/cusumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/cusumabs2/README.md @@ -50,7 +50,7 @@ The cumulative sum of squared absolute values is defined as ## Usage ```javascript -var itercusumabs2 = require( '@stdlib/stats/iter/cusumabs2' ); +const itercusumabs2 = require( '@stdlib/stats/iter/cusumabs2' ); ``` #### itercusumabs2( iterator ) @@ -58,12 +58,12 @@ var itercusumabs2 = require( '@stdlib/stats/iter/cusumabs2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a cumulative sum of squared absolute values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itercusumabs2( arr ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itercusumabs2( arr ); -var s = it.next().value; +let s = it.next().value; // returns 4.0 s = it.next().value; @@ -104,20 +104,20 @@ s = it.next().value; ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itercusumabs2 = require( '@stdlib/stats/iter/cusumabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itercusumabs2 = require( '@stdlib/stats/iter/cusumabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a cumulative sum of squared absolute values: -var it = itercusumabs2( rand ); +const it = itercusumabs2( rand ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( typeof v.value === 'number' ) { diff --git a/lib/node_modules/@stdlib/stats/iter/max/README.md b/lib/node_modules/@stdlib/stats/iter/max/README.md index 08ffd40b60d7..2a7217c0a9ea 100644 --- a/lib/node_modules/@stdlib/stats/iter/max/README.md +++ b/lib/node_modules/@stdlib/stats/iter/max/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermax = require( '@stdlib/stats/iter/max' ); +const itermax = require( '@stdlib/stats/iter/max' ); ``` #### itermax( iterator ) @@ -43,11 +43,11 @@ var itermax = require( '@stdlib/stats/iter/max' ); Computes the maximum value of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); -var m = itermax( arr ); +const m = itermax( arr ); // returns 3.0 ``` @@ -76,17 +76,17 @@ var m = itermax( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermax = require( '@stdlib/stats/iter/max' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermax = require( '@stdlib/stats/iter/max' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the maximum value: -var m = itermax( rand ); +const m = itermax( rand ); // returns console.log( 'Max: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/maxabs/README.md b/lib/node_modules/@stdlib/stats/iter/maxabs/README.md index 86138322c225..8c763ea40c75 100644 --- a/lib/node_modules/@stdlib/stats/iter/maxabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/maxabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermaxabs = require( '@stdlib/stats/iter/maxabs' ); +const itermaxabs = require( '@stdlib/stats/iter/maxabs' ); ``` #### itermaxabs( iterator ) @@ -43,11 +43,11 @@ var itermaxabs = require( '@stdlib/stats/iter/maxabs' ); Computes the maximum absolute value of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); -var m = itermaxabs( arr ); +const m = itermaxabs( arr ); // returns 4.0 ``` @@ -76,17 +76,17 @@ var m = itermaxabs( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermaxabs = require( '@stdlib/stats/iter/maxabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermaxabs = require( '@stdlib/stats/iter/maxabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the maximum absolute value: -var m = itermaxabs( rand ); +const m = itermaxabs( rand ); // returns console.log( 'maxabs: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/mean/README.md b/lib/node_modules/@stdlib/stats/iter/mean/README.md index 36a65d830f99..b3d8ab950b15 100644 --- a/lib/node_modules/@stdlib/stats/iter/mean/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mean/README.md @@ -50,7 +50,7 @@ The [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var itermean = require( '@stdlib/stats/iter/mean' ); +const itermean = require( '@stdlib/stats/iter/mean' ); ``` #### itermean( iterator ) @@ -58,11 +58,11 @@ var itermean = require( '@stdlib/stats/iter/mean' ); Computes the [arithmetic mean][arithmetic-mean] over all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0, 3.0, 4.0 ] ); +const arr = array2iterator( [ 1.0, 2.0, 3.0, 4.0 ] ); -var m = itermean( arr ); +const m = itermean( arr ); // returns 2.5 ``` @@ -91,17 +91,17 @@ var m = itermean( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermean = require( '@stdlib/stats/iter/mean' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermean = require( '@stdlib/stats/iter/mean' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the arithmetic mean: -var m = itermean( rand ); +const m = itermean( rand ); // returns console.log( 'Mean: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/meanabs/README.md b/lib/node_modules/@stdlib/stats/iter/meanabs/README.md index 3fd2635cec34..a6c86512ed9d 100644 --- a/lib/node_modules/@stdlib/stats/iter/meanabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/meanabs/README.md @@ -50,7 +50,7 @@ The [arithmetic mean][arithmetic-mean] of absolute values is defined as ## Usage ```javascript -var itermeanabs = require( '@stdlib/stats/iter/meanabs' ); +const itermeanabs = require( '@stdlib/stats/iter/meanabs' ); ``` #### itermeanabs( iterator ) @@ -58,11 +58,11 @@ var itermeanabs = require( '@stdlib/stats/iter/meanabs' ); Computes the [arithmetic mean][arithmetic-mean] of absolute values for all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); -var m = itermeanabs( arr ); +const m = itermeanabs( arr ); // returns 2.5 ``` @@ -91,17 +91,17 @@ var m = itermeanabs( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermeanabs = require( '@stdlib/stats/iter/meanabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermeanabs = require( '@stdlib/stats/iter/meanabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the arithmetic mean of absolute values: -var m = itermeanabs( rand ); +const m = itermeanabs( rand ); // returns console.log( 'meanabs: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/meanabs2/README.md b/lib/node_modules/@stdlib/stats/iter/meanabs2/README.md index 2514b589e4e5..2f9bb00ed30f 100644 --- a/lib/node_modules/@stdlib/stats/iter/meanabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/meanabs2/README.md @@ -50,7 +50,7 @@ m = \frac{1}{n} \sum_{i=0}^{n-1} x_i^2 ## Usage ```javascript -var itermeanabs2 = require( '@stdlib/stats/iter/meanabs2' ); +const itermeanabs2 = require( '@stdlib/stats/iter/meanabs2' ); ``` #### itermeanabs2( iterator ) @@ -58,11 +58,11 @@ var itermeanabs2 = require( '@stdlib/stats/iter/meanabs2' ); Computes the [arithmetic mean][arithmetic-mean] of squared absolute values for all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); -var m = itermeanabs2( arr ); +const m = itermeanabs2( arr ); // returns 7.5 ``` @@ -91,17 +91,17 @@ var m = itermeanabs2( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermeanabs2 = require( '@stdlib/stats/iter/meanabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermeanabs2 = require( '@stdlib/stats/iter/meanabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the arithmetic mean of squared absolute values: -var m = itermeanabs2( rand ); +const m = itermeanabs2( rand ); // returns console.log( 'meanabs2: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/midrange/README.md b/lib/node_modules/@stdlib/stats/iter/midrange/README.md index 85af9a23e1b8..d9cde54abaeb 100644 --- a/lib/node_modules/@stdlib/stats/iter/midrange/README.md +++ b/lib/node_modules/@stdlib/stats/iter/midrange/README.md @@ -37,7 +37,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of ma ## Usage ```javascript -var itermidrange = require( '@stdlib/stats/iter/midrange' ); +const itermidrange = require( '@stdlib/stats/iter/midrange' ); ``` #### itermidrange( iterator ) @@ -45,11 +45,11 @@ var itermidrange = require( '@stdlib/stats/iter/midrange' ); Computes the [mid-range][mid-range] of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); -var v = itermidrange( arr ); +const v = itermidrange( arr ); // returns -0.5 ``` @@ -78,17 +78,17 @@ var v = itermidrange( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermidrange = require( '@stdlib/stats/iter/midrange' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermidrange = require( '@stdlib/stats/iter/midrange' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the mid-range: -var v = itermidrange( rand ); +const v = itermidrange( rand ); // returns console.log( 'mid-range: %d.', v ); diff --git a/lib/node_modules/@stdlib/stats/iter/min/README.md b/lib/node_modules/@stdlib/stats/iter/min/README.md index a7e34ebb7fc2..710c762ccfc3 100644 --- a/lib/node_modules/@stdlib/stats/iter/min/README.md +++ b/lib/node_modules/@stdlib/stats/iter/min/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermin = require( '@stdlib/stats/iter/min' ); +const itermin = require( '@stdlib/stats/iter/min' ); ``` #### itermin( iterator ) @@ -43,11 +43,11 @@ var itermin = require( '@stdlib/stats/iter/min' ); Computes the minimum value of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, -3.0, 4.0 ] ); -var m = itermin( arr ); +const m = itermin( arr ); // returns -3.0 ``` @@ -76,17 +76,17 @@ var m = itermin( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermin = require( '@stdlib/stats/iter/min' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermin = require( '@stdlib/stats/iter/min' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the minimum value: -var m = itermin( rand ); +const m = itermin( rand ); // returns console.log( 'Min: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/minabs/README.md b/lib/node_modules/@stdlib/stats/iter/minabs/README.md index a66eca9623d6..592c4699b7d8 100644 --- a/lib/node_modules/@stdlib/stats/iter/minabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/minabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var iterminabs = require( '@stdlib/stats/iter/minabs' ); +const iterminabs = require( '@stdlib/stats/iter/minabs' ); ``` #### iterminabs( iterator ) @@ -43,11 +43,11 @@ var iterminabs = require( '@stdlib/stats/iter/minabs' ); Computes the minimum absolute value of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); -var m = iterminabs( arr ); +const m = iterminabs( arr ); // returns 1.0 ``` @@ -76,17 +76,17 @@ var m = iterminabs( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var iterminabs = require( '@stdlib/stats/iter/minabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const iterminabs = require( '@stdlib/stats/iter/minabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the minimum absolute value: -var m = iterminabs( rand ); +const m = iterminabs( rand ); // returns console.log( 'minabs: %d.', m ); diff --git a/lib/node_modules/@stdlib/stats/iter/mmax/README.md b/lib/node_modules/@stdlib/stats/iter/mmax/README.md index 6b7342102deb..43623cde0a6f 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmax/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmax/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermmax = require( '@stdlib/stats/iter/mmax' ); +const itermmax = require( '@stdlib/stats/iter/mmax' ); ``` #### itermmax( iterator, W ) @@ -43,13 +43,13 @@ var itermmax = require( '@stdlib/stats/iter/mmax' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving maximum value. The `W` parameter defines the number of iterated values over which to compute the moving maximum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmax( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmax( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -92,20 +92,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmax = require( '@stdlib/stats/iter/mmax' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmax = require( '@stdlib/stats/iter/mmax' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving maximum value: -var it = itermmax( rand, 3 ); +const it = itermmax( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmaxabs/README.md b/lib/node_modules/@stdlib/stats/iter/mmaxabs/README.md index 85a0033b805f..e9318551aa65 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmaxabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmaxabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermmaxabs = require( '@stdlib/stats/iter/mmaxabs' ); +const itermmaxabs = require( '@stdlib/stats/iter/mmaxabs' ); ``` #### itermmaxabs( iterator, W ) @@ -43,13 +43,13 @@ var itermmaxabs = require( '@stdlib/stats/iter/mmaxabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving maximum absolute value. The `W` parameter defines the number of iterated values over which to compute the moving maximum absolute value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmaxabs( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmaxabs( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -92,20 +92,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmaxabs = require( '@stdlib/stats/iter/mmaxabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmaxabs = require( '@stdlib/stats/iter/mmaxabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving maximum absolute value: -var it = itermmaxabs( rand, 3 ); +const it = itermmaxabs( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmean/README.md b/lib/node_modules/@stdlib/stats/iter/mmean/README.md index 5463e04c06f9..08901b8dfc57 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmean/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmean/README.md @@ -50,7 +50,7 @@ For a window of size `W`, the [arithmetic mean][arithmetic-mean] is defined as ## Usage ```javascript -var itermmean = require( '@stdlib/stats/iter/mmean' ); +const itermmean = require( '@stdlib/stats/iter/mmean' ); ``` #### itermmean( iterator, W ) @@ -58,13 +58,13 @@ var itermmean = require( '@stdlib/stats/iter/mmean' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving [arithmetic mean][arithmetic-mean]. The `W` parameter defines the number of iterated values over which to compute the moving mean. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmean( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmean( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmean = require( '@stdlib/stats/iter/mmean' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmean = require( '@stdlib/stats/iter/mmean' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving arithmetic mean: -var it = itermmean( rand, 3 ); +const it = itermmean( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmeanabs/README.md b/lib/node_modules/@stdlib/stats/iter/mmeanabs/README.md index 82fda2e9926b..5b122c377c92 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmeanabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmeanabs/README.md @@ -50,7 +50,7 @@ For a window of size `W`, the [arithmetic mean][arithmetic-mean] of absolute val ## Usage ```javascript -var itermmeanabs = require( '@stdlib/stats/iter/mmeanabs' ); +const itermmeanabs = require( '@stdlib/stats/iter/mmeanabs' ); ``` #### itermmeanabs( iterator, W ) @@ -58,13 +58,13 @@ var itermmeanabs = require( '@stdlib/stats/iter/mmeanabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving [arithmetic mean][arithmetic-mean] of absolute values. The `W` parameter defines the number of iterated values over which to compute the moving mean. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmeanabs( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmeanabs( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmeanabs = require( '@stdlib/stats/iter/mmeanabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmeanabs = require( '@stdlib/stats/iter/mmeanabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving arithmetic mean of absolute values: -var it = itermmeanabs( rand, 3 ); +const it = itermmeanabs( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmeanabs2/README.md b/lib/node_modules/@stdlib/stats/iter/mmeanabs2/README.md index f5f1e546fb6b..7673276016e7 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmeanabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmeanabs2/README.md @@ -50,7 +50,7 @@ m = \frac{1}{W} \sum_{i=0}^{W-1} x_i^2 ## Usage ```javascript -var itermmeanabs2 = require( '@stdlib/stats/iter/mmeanabs2' ); +const itermmeanabs2 = require( '@stdlib/stats/iter/mmeanabs2' ); ``` #### itermmeanabs2( iterator, W ) @@ -58,13 +58,13 @@ var itermmeanabs2 = require( '@stdlib/stats/iter/mmeanabs2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving [arithmetic mean][arithmetic-mean] of squared absolute values. The `W` parameter defines the number of iterated values over which to compute the moving mean. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmeanabs2( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmeanabs2( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 4.0 m = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmeanabs2 = require( '@stdlib/stats/iter/mmeanabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmeanabs2 = require( '@stdlib/stats/iter/mmeanabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving mean of squared absolute values: -var it = itermmeanabs2( rand, 3 ); +const it = itermmeanabs2( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmidrange/README.md b/lib/node_modules/@stdlib/stats/iter/mmidrange/README.md index 144575d214f0..670197bf6dba 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmidrange/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmidrange/README.md @@ -37,7 +37,7 @@ The [**mid-range**][mid-range], or **mid-extreme**, is the arithmetic mean of ma ## Usage ```javascript -var itermmidrange = require( '@stdlib/stats/iter/mmidrange' ); +const itermmidrange = require( '@stdlib/stats/iter/mmidrange' ); ``` #### itermmidrange( iterator, W ) @@ -45,13 +45,13 @@ var itermmidrange = require( '@stdlib/stats/iter/mmidrange' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving [mid-range][mid-range]. The `W` parameter defines the number of iterated values over which to compute the moving [mid-range][mid-range]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmidrange( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmidrange( arr, 3 ); // Fill the window... -var v = it.next().value; // [2.0] +let v = it.next().value; // [2.0] // returns 2.0 v = it.next().value; // [2.0, 1.0] @@ -94,20 +94,20 @@ v = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmidrange = require( '@stdlib/stats/iter/mmidrange' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmidrange = require( '@stdlib/stats/iter/mmidrange' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving mid-range: -var it = itermmidrange( rand, 3 ); +const it = itermmidrange( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mmin/README.md b/lib/node_modules/@stdlib/stats/iter/mmin/README.md index 5925c311e509..9dd7330a7eda 100644 --- a/lib/node_modules/@stdlib/stats/iter/mmin/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mmin/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermmin = require( '@stdlib/stats/iter/mmin' ); +const itermmin = require( '@stdlib/stats/iter/mmin' ); ``` #### itermmin( iterator, W ) @@ -43,13 +43,13 @@ var itermmin = require( '@stdlib/stats/iter/mmin' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving minimum value. The `W` parameter defines the number of iterated values over which to compute the moving minimum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermmin( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermmin( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -92,20 +92,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermmin = require( '@stdlib/stats/iter/mmin' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermmin = require( '@stdlib/stats/iter/mmin' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving minimum value: -var it = itermmin( rand, 3 ); +const it = itermmin( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mminabs/README.md b/lib/node_modules/@stdlib/stats/iter/mminabs/README.md index 204c204e6bac..62788d089e7b 100644 --- a/lib/node_modules/@stdlib/stats/iter/mminabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mminabs/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var itermminabs = require( '@stdlib/stats/iter/mminabs' ); +const itermminabs = require( '@stdlib/stats/iter/mminabs' ); ``` #### itermminabs( iterator, W ) @@ -43,13 +43,13 @@ var itermminabs = require( '@stdlib/stats/iter/mminabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving minimum absolute value. The `W` parameter defines the number of iterated values over which to compute the moving minimum absolute value. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermminabs( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermminabs( arr, 3 ); // Fill the window... -var m = it.next().value; // [2.0] +let m = it.next().value; // [2.0] // returns 2.0 m = it.next().value; // [2.0, 1.0] @@ -92,20 +92,20 @@ m = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermminabs = require( '@stdlib/stats/iter/mminabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermminabs = require( '@stdlib/stats/iter/mminabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving minimum absolute value: -var it = itermminabs( rand, 3 ); +const it = itermminabs( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mprod/README.md b/lib/node_modules/@stdlib/stats/iter/mprod/README.md index c0cfbf5d391d..544ee28615c0 100644 --- a/lib/node_modules/@stdlib/stats/iter/mprod/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mprod/README.md @@ -50,7 +50,7 @@ For a window of size `W`, the moving product is defined as ## Usage ```javascript -var itermprod = require( '@stdlib/stats/iter/mprod' ); +const itermprod = require( '@stdlib/stats/iter/mprod' ); ``` #### itermprod( iterator, W ) @@ -58,13 +58,13 @@ var itermprod = require( '@stdlib/stats/iter/mprod' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving product. The `W` parameter defines the number of iterated values over which to compute the moving product. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermprod( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermprod( arr, 3 ); // Fill the window... -var p = it.next().value; // [2.0] +let p = it.next().value; // [2.0] // returns 2.0 p = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ p = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermprod = require( '@stdlib/stats/iter/mprod' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermprod = require( '@stdlib/stats/iter/mprod' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving product: -var it = itermprod( rand, 3 ); +const it = itermprod( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/mrange/README.md b/lib/node_modules/@stdlib/stats/iter/mrange/README.md index 3edee4e89bca..4ee1915af397 100644 --- a/lib/node_modules/@stdlib/stats/iter/mrange/README.md +++ b/lib/node_modules/@stdlib/stats/iter/mrange/README.md @@ -37,7 +37,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var itermrange = require( '@stdlib/stats/iter/mrange' ); +const itermrange = require( '@stdlib/stats/iter/mrange' ); ``` #### itermrange( iterator, W ) @@ -45,13 +45,13 @@ var itermrange = require( '@stdlib/stats/iter/mrange' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving [range][range]. The `W` parameter defines the number of iterated values over which to compute the moving [range][range]. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermrange( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermrange( arr, 3 ); // Fill the window... -var v = it.next().value; // [2.0] +let v = it.next().value; // [2.0] // returns 0.0 v = it.next().value; // [2.0, 1.0] @@ -94,20 +94,20 @@ v = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermrange = require( '@stdlib/stats/iter/mrange' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermrange = require( '@stdlib/stats/iter/mrange' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving range: -var it = itermrange( rand, 3 ); +const it = itermrange( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/msum/README.md b/lib/node_modules/@stdlib/stats/iter/msum/README.md index 40a4e89683ec..4947594ddb32 100644 --- a/lib/node_modules/@stdlib/stats/iter/msum/README.md +++ b/lib/node_modules/@stdlib/stats/iter/msum/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{W-1} x_i ## Usage ```javascript -var itermsum = require( '@stdlib/stats/iter/msum' ); +const itermsum = require( '@stdlib/stats/iter/msum' ); ``` #### itermsum( iterator, W ) @@ -58,13 +58,13 @@ var itermsum = require( '@stdlib/stats/iter/msum' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving sum. The `W` parameter defines the number of iterated values over which to compute the moving sum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermsum( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermsum( arr, 3 ); // Fill the window... -var s = it.next().value; // [2.0] +let s = it.next().value; // [2.0] // returns 2.0 s = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ s = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermsum = require( '@stdlib/stats/iter/msum' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermsum = require( '@stdlib/stats/iter/msum' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving sum: -var it = itermsum( rand, 3 ); +const it = itermsum( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/msumabs/README.md b/lib/node_modules/@stdlib/stats/iter/msumabs/README.md index 52f8ce68f357..ebcf361e6790 100644 --- a/lib/node_modules/@stdlib/stats/iter/msumabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/msumabs/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{W-1} |x_i| ## Usage ```javascript -var itermsumabs = require( '@stdlib/stats/iter/msumabs' ); +const itermsumabs = require( '@stdlib/stats/iter/msumabs' ); ``` #### itermsumabs( iterator, W ) @@ -58,13 +58,13 @@ var itermsumabs = require( '@stdlib/stats/iter/msumabs' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving sum of absolute values. The `W` parameter defines the number of iterated values over which to compute the moving sum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermsumabs( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermsumabs( arr, 3 ); // Fill the window... -var s = it.next().value; // [2.0] +let s = it.next().value; // [2.0] // returns 2.0 s = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ s = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermsumabs = require( '@stdlib/stats/iter/msumabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermsumabs = require( '@stdlib/stats/iter/msumabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving sum of absolute values: -var it = itermsumabs( rand, 3 ); +const it = itermsumabs( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/msumabs2/README.md b/lib/node_modules/@stdlib/stats/iter/msumabs2/README.md index 5f3d1fcafae2..d36dfa892d92 100644 --- a/lib/node_modules/@stdlib/stats/iter/msumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/msumabs2/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{W-1} x_i^2 ## Usage ```javascript -var itermsumabs2 = require( '@stdlib/stats/iter/msumabs2' ); +const itermsumabs2 = require( '@stdlib/stats/iter/msumabs2' ); ``` #### itermsumabs2( iterator, W ) @@ -58,13 +58,13 @@ var itermsumabs2 = require( '@stdlib/stats/iter/msumabs2' ); Returns an [iterator][mdn-iterator-protocol] which iteratively computes a moving sum of squared absolute values. The `W` parameter defines the number of iterated values over which to compute the moving sum. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); -var it = itermsumabs2( arr, 3 ); +const arr = array2iterator( [ 2.0, 1.0, 3.0, -7.0, -5.0 ] ); +const it = itermsumabs2( arr, 3 ); // Fill the window... -var s = it.next().value; // [2.0] +let s = it.next().value; // [2.0] // returns 4.0 s = it.next().value; // [2.0, 1.0] @@ -107,20 +107,20 @@ s = it.next().value; // [3.0, -7.0, -5.0] ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itermsumabs2 = require( '@stdlib/stats/iter/msumabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itermsumabs2 = require( '@stdlib/stats/iter/msumabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Create an iterator for iteratively computing a moving sum of squared absolute values: -var it = itermsumabs2( rand, 3 ); +const it = itermsumabs2( rand, 3 ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/stats/iter/prod/README.md b/lib/node_modules/@stdlib/stats/iter/prod/README.md index c09d9c3a6980..9713dd3586b5 100644 --- a/lib/node_modules/@stdlib/stats/iter/prod/README.md +++ b/lib/node_modules/@stdlib/stats/iter/prod/README.md @@ -50,7 +50,7 @@ p = \prod_{i=0}^{n-1} x_i ## Usage ```javascript -var iterprod = require( '@stdlib/stats/iter/prod' ); +const iterprod = require( '@stdlib/stats/iter/prod' ); ``` #### iterprod( iterator ) @@ -58,11 +58,11 @@ var iterprod = require( '@stdlib/stats/iter/prod' ); Computes the product of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ -1.0, -2.0, -3.0, 4.0 ] ); +const arr = array2iterator( [ -1.0, -2.0, -3.0, 4.0 ] ); -var p = iterprod( arr ); +const p = iterprod( arr ); // returns -24.0 ``` @@ -92,17 +92,17 @@ var p = iterprod( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var iterprod = require( '@stdlib/stats/iter/prod' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const iterprod = require( '@stdlib/stats/iter/prod' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the product: -var p = iterprod( rand ); +const p = iterprod( rand ); // returns console.log( 'Product: %d.', p ); diff --git a/lib/node_modules/@stdlib/stats/iter/range/README.md b/lib/node_modules/@stdlib/stats/iter/range/README.md index a05f95624a67..dda7dc869ba3 100644 --- a/lib/node_modules/@stdlib/stats/iter/range/README.md +++ b/lib/node_modules/@stdlib/stats/iter/range/README.md @@ -37,7 +37,7 @@ The [**range**][range] is defined as the difference between the maximum and mini ## Usage ```javascript -var iterrange = require( '@stdlib/stats/iter/range' ); +const iterrange = require( '@stdlib/stats/iter/range' ); ``` #### iterrange( iterator ) @@ -45,11 +45,11 @@ var iterrange = require( '@stdlib/stats/iter/range' ); Computes the [range][range] of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); +const arr = array2iterator( [ 1.0, -2.0, 3.0, -4.0 ] ); -var v = iterrange( arr ); +const v = iterrange( arr ); // returns 7.0 ``` @@ -78,17 +78,17 @@ var v = iterrange( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var iterrange = require( '@stdlib/stats/iter/range' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const iterrange = require( '@stdlib/stats/iter/range' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the range: -var v = iterrange( rand ); +const v = iterrange( rand ); // returns console.log( 'Range: %d.', v ); diff --git a/lib/node_modules/@stdlib/stats/iter/stdev/README.md b/lib/node_modules/@stdlib/stats/iter/stdev/README.md index a3922aa8ba19..63006faa7e3f 100644 --- a/lib/node_modules/@stdlib/stats/iter/stdev/README.md +++ b/lib/node_modules/@stdlib/stats/iter/stdev/README.md @@ -50,7 +50,7 @@ s = \sqrt{\frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2} ## Usage ```javascript -var iterstdev = require( '@stdlib/stats/iter/stdev' ); +const iterstdev = require( '@stdlib/stats/iter/stdev' ); ``` #### iterstdev( iterator\[, mean] ) @@ -58,22 +58,22 @@ var iterstdev = require( '@stdlib/stats/iter/stdev' ); Computes the [corrected sample standard deviation][sample-stdev] over all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); +const arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); -var s = iterstdev( arr ); +const s = iterstdev( arr ); // returns 1.0 ``` If the mean is already known, provide a `mean` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); +const arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); -var s = iterstdev( arr, 2.0 ); +const s = iterstdev( arr, 2.0 ); // returns ~0.82 ``` @@ -102,17 +102,17 @@ var s = iterstdev( arr, 2.0 ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var iterstdev = require( '@stdlib/stats/iter/stdev' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const iterstdev = require( '@stdlib/stats/iter/stdev' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the corrected sample standard deviation: -var s = iterstdev( rand ); +const s = iterstdev( rand ); // returns console.log( 'stdev: %d.', s ); diff --git a/lib/node_modules/@stdlib/stats/iter/sum/README.md b/lib/node_modules/@stdlib/stats/iter/sum/README.md index 0d19abc8668f..4eec481566ad 100644 --- a/lib/node_modules/@stdlib/stats/iter/sum/README.md +++ b/lib/node_modules/@stdlib/stats/iter/sum/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{n-1} x_i ## Usage ```javascript -var itersum = require( '@stdlib/stats/iter/sum' ); +const itersum = require( '@stdlib/stats/iter/sum' ); ``` #### itersum( iterator ) @@ -58,11 +58,11 @@ var itersum = require( '@stdlib/stats/iter/sum' ); Computes the sum of all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0, -3.5, 4.0 ] ); +const arr = array2iterator( [ 1.0, 2.0, -3.5, 4.0 ] ); -var s = itersum( arr ); +const s = itersum( arr ); // returns 3.5 ``` @@ -92,17 +92,17 @@ var s = itersum( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itersum = require( '@stdlib/stats/iter/sum' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itersum = require( '@stdlib/stats/iter/sum' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the sum: -var s = itersum( rand ); +const s = itersum( rand ); // returns console.log( 'Sum: %d.', s ); diff --git a/lib/node_modules/@stdlib/stats/iter/sumabs/README.md b/lib/node_modules/@stdlib/stats/iter/sumabs/README.md index bfc2a8d2365b..d1e316aa2f5e 100644 --- a/lib/node_modules/@stdlib/stats/iter/sumabs/README.md +++ b/lib/node_modules/@stdlib/stats/iter/sumabs/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{n-1} |x_i| ## Usage ```javascript -var itersumabs = require( '@stdlib/stats/iter/sumabs' ); +const itersumabs = require( '@stdlib/stats/iter/sumabs' ); ``` #### itersumabs( iterator ) @@ -58,11 +58,11 @@ var itersumabs = require( '@stdlib/stats/iter/sumabs' ); Computes the sum of absolute values for all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 1.0, 2.0, -3.5, 4.0 ] ); +const arr = array2iterator( [ 1.0, 2.0, -3.5, 4.0 ] ); -var s = itersumabs( arr ); +const s = itersumabs( arr ); // returns 10.5 ``` @@ -92,17 +92,17 @@ var s = itersumabs( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itersumabs = require( '@stdlib/stats/iter/sumabs' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itersumabs = require( '@stdlib/stats/iter/sumabs' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the sum of absolute values: -var s = itersumabs( rand ); +const s = itersumabs( rand ); // returns console.log( 'sumabs: %d.', s ); diff --git a/lib/node_modules/@stdlib/stats/iter/sumabs2/README.md b/lib/node_modules/@stdlib/stats/iter/sumabs2/README.md index 5fbaac529e33..8906352bdb40 100644 --- a/lib/node_modules/@stdlib/stats/iter/sumabs2/README.md +++ b/lib/node_modules/@stdlib/stats/iter/sumabs2/README.md @@ -50,7 +50,7 @@ s = \sum_{i=0}^{n-1} x_i^2 ## Usage ```javascript -var itersumabs2 = require( '@stdlib/stats/iter/sumabs2' ); +const itersumabs2 = require( '@stdlib/stats/iter/sumabs2' ); ``` #### itersumabs2( iterator ) @@ -58,11 +58,11 @@ var itersumabs2 = require( '@stdlib/stats/iter/sumabs2' ); Computes the sum of squared absolute values for all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ -1.0, 2.0, -3.0, 4.0 ] ); +const arr = array2iterator( [ -1.0, 2.0, -3.0, 4.0 ] ); -var s = itersumabs2( arr ); +const s = itersumabs2( arr ); // returns 30.0 ``` @@ -92,17 +92,17 @@ var s = itersumabs2( arr ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itersumabs2 = require( '@stdlib/stats/iter/sumabs2' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itersumabs2 = require( '@stdlib/stats/iter/sumabs2' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the sum of squared absolute values: -var s = itersumabs2( rand ); +const s = itersumabs2( rand ); // returns console.log( 'sumabs2: %d.', s ); diff --git a/lib/node_modules/@stdlib/stats/iter/variance/README.md b/lib/node_modules/@stdlib/stats/iter/variance/README.md index bc5911c98fbc..7b8f8cd29b3d 100644 --- a/lib/node_modules/@stdlib/stats/iter/variance/README.md +++ b/lib/node_modules/@stdlib/stats/iter/variance/README.md @@ -50,7 +50,7 @@ s^2 = \frac{1}{n-1} \sum_{i=0}^{n-1} ( x_i - \bar{x} )^2 ## Usage ```javascript -var itervariance = require( '@stdlib/stats/iter/variance' ); +const itervariance = require( '@stdlib/stats/iter/variance' ); ``` #### itervariance( iterator\[, mean] ) @@ -58,22 +58,22 @@ var itervariance = require( '@stdlib/stats/iter/variance' ); Computes the [unbiased sample variance][sample-variance] over all [iterated][mdn-iterator-protocol] values. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); +const arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); -var s2 = itervariance( arr ); +const s2 = itervariance( arr ); // returns 1.0 ``` If the mean is already known, provide a `mean` argument. ```javascript -var array2iterator = require( '@stdlib/array/to-iterator' ); +const array2iterator = require( '@stdlib/array/to-iterator' ); -var arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); +const arr = array2iterator( [ 2.0, 1.0, 3.0 ] ); -var s2 = itervariance( arr, 2.0 ); +const s2 = itervariance( arr, 2.0 ); // returns ~0.67 ``` @@ -102,17 +102,17 @@ var s2 = itervariance( arr, 2.0 ); ```javascript -var runif = require( '@stdlib/random/iter/uniform' ); -var itervariance = require( '@stdlib/stats/iter/variance' ); +const runif = require( '@stdlib/random/iter/uniform' ); +const itervariance = require( '@stdlib/stats/iter/variance' ); // Create an iterator for generating uniformly distributed pseudorandom numbers: -var rand = runif( -10.0, 10.0, { +const rand = runif( -10.0, 10.0, { 'seed': 1234, 'iter': 100 }); // Compute the unbiased sample variance: -var s2 = itervariance( rand ); +const s2 = itervariance( rand ); // returns console.log( 'Variance: %d.', s2 ); diff --git a/lib/node_modules/@stdlib/stats/kde2d/README.md b/lib/node_modules/@stdlib/stats/kde2d/README.md index 7d804fb0828e..1039c3980323 100644 --- a/lib/node_modules/@stdlib/stats/kde2d/README.md +++ b/lib/node_modules/@stdlib/stats/kde2d/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kde2d = require( '@stdlib/stats/kde2d' ); +const kde2d = require( '@stdlib/stats/kde2d' ); ``` #### kde2d( x, y\[, opts] ) @@ -37,12 +37,12 @@ By default, the function computes two-dimensional normal kernel density estimati ```javascript -var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, +const x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ]; -var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, +const y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ]; -var out = kde2d( x, y ); +const out = kde2d( x, y ); /* e.g., returns { 'x': [ ~0.633, ~0.72, ... ], @@ -61,23 +61,23 @@ Note that for the output the `x` and `y` properties refer to the equally spaced ```javascript -var ndarray = require( '@stdlib/ndarray/ctor' ); +const ndarray = require( '@stdlib/ndarray/ctor' ); -var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, +const x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ]; -var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, +const y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ]; -var buffer = x.concat( y ); -var n = x.length; -var shape = [ n, 2 ]; -var strides = [ 1, n ]; -var offset = 0; -var order = 'column-major'; +const buffer = x.concat( y ); +const n = x.length; +const shape = [ n, 2 ]; +const strides = [ 1, n ]; +const offset = 0; +const order = 'column-major'; -var arr = ndarray( 'generic', buffer, shape, strides, offset, order ); +const arr = ndarray( 'generic', buffer, shape, strides, offset, order ); -var out = kde2d( arr ); +const out = kde2d( arr ); /* e.g., returns { 'x': [ ~0.633, ~0.72, ... ], @@ -102,12 +102,12 @@ By default, the bandwidth argument is set by a builtin function. To choose diffe ```javascript -var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, +const x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ]; -var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, +const y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ]; -var out = kde2d( x, y, { +const out = kde2d( x, y, { 'h': [ 0.05, 0.1 ] }); /* e.g., returns @@ -124,12 +124,12 @@ By default, we use `25` partitions. To change the number of partitions, set the ```javascript -var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, +const x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ]; -var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, +const y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ]; -var out = kde2d( x, y, { +const out = kde2d( x, y, { 'n': 15 }); /* e.g., returns @@ -146,12 +146,12 @@ As a default choice, the `kde2d` function sets the `xMin`, `xMax`, `yMin` and `y ```javascript -var x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, +const x = [ 0.6333, 0.8643, 1.0952, 1.3262, 1.5571, 1.7881, 2.019, 2.25, 2.481, 2.7119 ]; -var y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, +const y = [ -0.0468, 0.8012, 1.6492, 2.4973, 3.3454, 4.1934, 5.0415, 5.8896, 6.7376, 7.5857 ]; -var out = kde2d( x, y, { +const out = kde2d( x, y, { 'xMin': 0.0, 'xMax': 2.5, 'yMin': 0.0, @@ -177,31 +177,23 @@ var out = kde2d( x, y, { ```javascript -var normal = require( '@stdlib/random/base/normal' ); -var kde2d = require( '@stdlib/stats/kde2d' ); +const normal = require( '@stdlib/random/base/normal' ); +const kde2d = require( '@stdlib/stats/kde2d' ); -var randX; -var randY; -var out; -var i; -var x; -var y; -var n; +const n = 100; -n = 100; +const x = new Array( n ); +const y = new Array( n ); -x = new Array( n ); -y = new Array( n ); +const randX = normal.factory( 3.0, 1.2 ); +const randY = normal.factory( 10.0, 4.5 ); -randX = normal.factory( 3.0, 1.2 ); -randY = normal.factory( 10.0, 4.5 ); - -for ( i = 0; i < n; i++ ) { +for ( let i = 0; i < n; i++ ) { x[ i ] = randX(); y[ i ] = randY(); } -out = kde2d( x, y ); +const out = kde2d( x, y ); /* e.g., returns { 'x': [0.022, 0.2614, ...], diff --git a/lib/node_modules/@stdlib/stats/kruskal-test/README.md b/lib/node_modules/@stdlib/stats/kruskal-test/README.md index c28e854d5c42..cba6d400e79f 100644 --- a/lib/node_modules/@stdlib/stats/kruskal-test/README.md +++ b/lib/node_modules/@stdlib/stats/kruskal-test/README.md @@ -52,7 +52,7 @@ where `N` denotes the total number of observations and `t_{r(i)}` are the number ## Usage ```javascript -var kruskalTest = require( '@stdlib/stats/kruskal-test' ); +const kruskalTest = require( '@stdlib/stats/kruskal-test' ); ``` #### kruskalTest( a\[,b,...,k]\[, opts] ) @@ -61,11 +61,11 @@ For input arrays `a`, `b`, ... holding numeric observations, this function calcu ```javascript // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = kruskalTest( x, y, z ); +const out = kruskalTest( x, y, z ); /* returns { 'rejected': false, @@ -86,11 +86,11 @@ The function accepts the following `options`: By default, the test is carried out at a significance level of `0.05`. To choose a custom significance level, set the `alpha` option. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = kruskalTest( x, y, z, { +const out = kruskalTest( x, y, z, { 'alpha': 0.01 }); /* returns @@ -110,17 +110,17 @@ The function provides an alternate interface by supplying an array of group indi ```javascript -var arr = [ +const arr = [ 2.9, 3.0, 2.5, 2.6, 3.2, 3.8, 2.7, 4.0, 2.4, 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var groups = [ +const groups = [ 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'c' ]; -var out = kruskalTest( arr, { +const out = kruskalTest( arr, { 'groups': groups }); ``` @@ -128,11 +128,11 @@ var out = kruskalTest( arr, { The returned object comes with a `.print()` method which when invoked will print a formatted output of the results of the hypothesis test. `print` accepts a `digits` option that controls the number of decimal digits displayed for the outputs and a `decision` option, which when set to `false` will hide the test decision. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = kruskalTest( x, y, z ); +const out = kruskalTest( x, y, z ); console.log( out.print() ); /* => Kruskal-Wallis Test @@ -157,14 +157,14 @@ console.log( out.print() ); ```javascript -var kruskalTest = require( '@stdlib/stats/kruskal-test' ); +const kruskalTest = require( '@stdlib/stats/kruskal-test' ); // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = kruskalTest( x, y, z ); +const out = kruskalTest( x, y, z ); /* returns { 'rejected': false, @@ -176,7 +176,7 @@ var out = kruskalTest( x, y, z ); } */ -var table = out.print(); +const table = out.print(); /* returns Kruskal-Wallis Test diff --git a/lib/node_modules/@stdlib/stats/kstest/README.md b/lib/node_modules/@stdlib/stats/kstest/README.md index 49c722e0670c..60e62318ebdb 100644 --- a/lib/node_modules/@stdlib/stats/kstest/README.md +++ b/lib/node_modules/@stdlib/stats/kstest/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var kstest = require( '@stdlib/stats/kstest' ); +const kstest = require( '@stdlib/stats/kstest' ); ``` #### kstest( x, y\[, ...params]\[, opts] ) @@ -36,21 +36,17 @@ For a numeric [array][mdn-array] or [typed array][mdn-typed-array] `x`, a Kolmogorov-Smirnov goodness-of-fit is computed for the null hypothesis that the values of `x` come from the distribution specified by `y`. `y` can be either a [string][mdn-string] with the name of the distribution to test against, or a [function][mdn-function]. In the latter case, `y` is expected to be the cumulative distribution function (CDF) of the distribution to test against, with its first parameter being the value at which to evaluate the CDF and the remaining parameters constituting the parameters of the distribution. The parameters of the distribution are passed as additional arguments after `y` from `kstest` to the chosen CDF. The function returns an object holding the calculated test statistic `statistic` and the `pValue` of the test. ```javascript -var factory = require( '@stdlib/random/base/uniform' ).factory; -var runif; -var out; -var x; -var i; +const factory = require( '@stdlib/random/base/uniform' ).factory; -runif = factory( 0.0, 1.0, { +const runif = factory( 0.0, 1.0, { 'seed': 8798 }); -x = new Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = runif(); } -out = kstest( x, 'uniform', 0.0, 1.0 ); +const out = kstest( x, 'uniform', 0.0, 1.0 ); // returns { 'pValue': ~0.703, 'statistic': ~0.069, ... } ``` @@ -102,22 +98,18 @@ console.log( out.print() ); By default, the function tests the null hypothesis that the true distribution of `x` and the reference distribution `y` are equal to each other against the alternative that they are not equal. To carry out a one-sided hypothesis test, set the `alternative` option to either `less` or `greater`. ```javascript -var factory = require( '@stdlib/random/base/uniform' ).factory; -var runif; -var out; -var x; -var i; +const factory = require( '@stdlib/random/base/uniform' ).factory; -runif = factory( 0.0, 1.0, { +const runif = factory( 0.0, 1.0, { 'seed': 8798 }); -x = new Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = runif(); } -out = kstest( x, 'uniform', 0.0, 1.0, { +let out = kstest( x, 'uniform', 0.0, 1.0, { 'alternative': 'less' }); // returns { 'pValue': ~0.358, 'statistic': ~0.07, ... } @@ -150,28 +142,22 @@ out = kstest( x, 'uniform', 0.0, 1.0, { ```javascript -var kstest = require( '@stdlib/stats/kstest' ); -var factory = require( '@stdlib/random/base/normal' ).factory; - -var rnorm; -var table; -var out; -var i; -var x; +const kstest = require( '@stdlib/stats/kstest' ); +const factory = require( '@stdlib/random/base/normal' ).factory; -rnorm = factory({ +const rnorm = factory({ 'seed': 4839 }); // Values drawn from a Normal(3,1) distribution -x = new Array( 100 ); -for ( i = 0; i < 100; i++ ) { +const x = new Array( 100 ); +for ( let i = 0; i < 100; i++ ) { x[ i ] = rnorm( 3.0, 1.0 ); } // Test against N(0,1) -out = kstest( x, 'normal', 0.0, 1.0 ); -table = out.print(); +let out = kstest( x, 'normal', 0.0, 1.0 ); +let table = out.print(); /* e.g., returns Kolmogorov-Smirnov goodness-of-fit test. diff --git a/lib/node_modules/@stdlib/stats/levene-test/README.md b/lib/node_modules/@stdlib/stats/levene-test/README.md index fba43d1b48f3..61763f8bb8cc 100644 --- a/lib/node_modules/@stdlib/stats/levene-test/README.md +++ b/lib/node_modules/@stdlib/stats/levene-test/README.md @@ -35,7 +35,7 @@ Levene's test is used to test the null hypothesis that the variances of `k` grou ## Usage ```javascript -var leveneTest = require( '@stdlib/stats/levene-test' ); +const leveneTest = require( '@stdlib/stats/levene-test' ); ``` #### leveneTest( x\[, y, ..., z]\[, opts] ) @@ -44,11 +44,11 @@ Calculates Levene's test for input arrays `x`, `y`, ..., `z` holding numeric obs ```javascript // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = leveneTest( x, y, z ); +const out = leveneTest( x, y, z ); /* returns { 'rejected': false, @@ -69,11 +69,11 @@ The function accepts the following `options`: By default, the test is carried out at a significance level of `0.05`. To test at a different significance level, set the `alpha` option. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = leveneTest( x, y, z, { +const out = leveneTest( x, y, z, { 'alpha': 0.01 }); /* returns @@ -93,17 +93,17 @@ In addition to providing multiple arrays, the function supports providing a sing ```javascript -var arr = [ +const arr = [ 2.9, 3.0, 2.5, 2.6, 3.2, 3.8, 2.7, 4.0, 2.4, 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var groups = [ +const groups = [ 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'c' ]; -var out = leveneTest( arr, { +const out = leveneTest( arr, { 'groups': groups }); ``` @@ -114,11 +114,11 @@ The returned object comes with a `.print()` method which, when invoked, prints a - **decision**: `boolean` indicating whether to print the test decision. Default: `true`. ```javascript -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = leveneTest( x, y, z ); +const out = leveneTest( x, y, z ); console.log( out.print() ); /* => Levene's test for Homogeneity of Variance @@ -145,14 +145,14 @@ console.log( out.print() ); ```javascript -var leveneTest = require( '@stdlib/stats/levene-test' ); +const leveneTest = require( '@stdlib/stats/levene-test' ); // Data from Hollander & Wolfe (1973), p. 116: -var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; -var y = [ 3.8, 2.7, 4.0, 2.4 ]; -var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; +const x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ]; +const y = [ 3.8, 2.7, 4.0, 2.4 ]; +const z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ]; -var out = leveneTest( x, y, z ); +const out = leveneTest( x, y, z ); /* returns { 'rejected': false, @@ -164,7 +164,7 @@ var out = leveneTest( x, y, z ); } */ -var table = out.print(); +const table = out.print(); /* returns Levene's test for Homogeneity of Variance diff --git a/lib/node_modules/@stdlib/stats/lowess/README.md b/lib/node_modules/@stdlib/stats/lowess/README.md index 187a7c48b750..4ee524d5f4a9 100644 --- a/lib/node_modules/@stdlib/stats/lowess/README.md +++ b/lib/node_modules/@stdlib/stats/lowess/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lowess = require( '@stdlib/stats/lowess' ); +const lowess = require( '@stdlib/stats/lowess' ); ``` #### lowess( x, y\[, opts] ) @@ -37,18 +37,18 @@ For [input arrays][mdn-array] and/or [typed arrays][mdn-typed-array] `x` and `y` ```javascript -var x = [ +const x = [ 4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25 ]; -var y = [ +const y = [ 2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85 ]; -var out = lowess( x, y ); +const out = lowess( x, y ); /* returns { 'x': [ @@ -89,18 +89,18 @@ By default, smoothing at each value is determined by `2/3` of all other points. ```javascript -var x = [ +const x = [ 4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25 ]; -var y = [ +const y = [ 2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85 ]; -var out = lowess( x, y, { +const out = lowess( x, y, { 'f': 0.2 }); /* returns @@ -132,18 +132,18 @@ By default, three iterations of locally weighted regression fits are calculated ```javascript -var x = [ +const x = [ 4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25 ]; -var y = [ +const y = [ 2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85 ]; -var out = lowess( x, y, { +const out = lowess( x, y, { 'nsteps': 20 }); /* returns @@ -167,18 +167,18 @@ To save computations, set the `delta` option. For cases where one has a large nu ```javascript -var x = [ +const x = [ 4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25 ]; -var y = [ +const y = [ 2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85 ]; -var out = lowess( x, y, { +const out = lowess( x, y, { 'delta': 0.0 }); /* returns @@ -202,18 +202,18 @@ If the elements of `x` are sorted in ascending order, set the `sorted` option to ```javascript -var x = [ +const x = [ 4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 22, 23, 24, 24, 24, 24, 25 ]; -var y = [ +const y = [ 2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, 64, 66, 54, 70, 92, 93, 120, 85 ]; -var out = lowess( x, y, { +const out = lowess( x, y, { 'sorted': true }); /* returns @@ -243,29 +243,25 @@ var out = lowess( x, y, { ```javascript -var randn = require( '@stdlib/random/base/randn' ); -var Float64Array = require( '@stdlib/array/float64' ); -var plot = require( '@stdlib/plot/ctor' ); -var lowess = require( '@stdlib/stats/lowess' ); - -var x; -var y; -var i; +const randn = require( '@stdlib/random/base/randn' ); +const Float64Array = require( '@stdlib/array/float64' ); +const plot = require( '@stdlib/plot/ctor' ); +const lowess = require( '@stdlib/stats/lowess' ); // Create some data... -x = new Float64Array( 100 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { +const x = new Float64Array( 100 ); +const y = new Float64Array( x.length ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = i; y[ i ] = ( 0.5*i ) + ( 10.0*randn() ); } -var opts = { +const opts = { 'delta': 0 }; -var out = lowess( x, y, opts ); -var h = plot( [ x, out.x ], [ y, out.y ] ); +const out = lowess( x, y, opts ); +const h = plot( [ x, out.x ], [ y, out.y ] ); h.lineStyle = [ 'none', '-' ]; h.symbols = [ 'closed-circle', 'none' ]; diff --git a/lib/node_modules/@stdlib/stats/padjust/README.md b/lib/node_modules/@stdlib/stats/padjust/README.md index 456075cfd641..23127a4937c2 100644 --- a/lib/node_modules/@stdlib/stats/padjust/README.md +++ b/lib/node_modules/@stdlib/stats/padjust/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var padjust = require( '@stdlib/stats/padjust' ); +const padjust = require( '@stdlib/stats/padjust' ); ``` #### padjust( pvals, method\[, comparisons] ) @@ -35,7 +35,7 @@ var padjust = require( '@stdlib/stats/padjust' ); Adjusts supplied p-values for multiple comparisons via a specified method. ```javascript -var out = padjust( [ 0.1496, 0.0275, 0.3053, 0.1599, 0.2061 ], 'bonferroni' ); +const out = padjust( [ 0.1496, 0.0275, 0.3053, 0.1599, 0.2061 ], 'bonferroni' ); // returns [ 0.748, ~0.138, ..., ~0.799, 1 ] ``` @@ -48,8 +48,8 @@ The `method` parameter can be one of the following values: - **hommel**: Hommel's method, which is valid when hypothesis tests are independent. It is more expensive to compute than the other methods. ```javascript -var pvalues = [ 0.319, 0.201, 0.4, 0.374, 0.113 ]; -var out = padjust( pvalues, 'holm' ); +const pvalues = [ 0.319, 0.201, 0.4, 0.374, 0.113 ]; +let out = padjust( pvalues, 'holm' ); // returns [ ~0.957, 0.804, ..., ~0.957, ~0.565 ] out = padjust( pvalues, 'bh' ); @@ -64,8 +64,8 @@ unobserved p-values that are greater than all observed p-values (for Holm's method and the Bonferroni correction) or equal to `1` for the remaining methods. ```javascript -var pvalues = [ 0.319, 0.201, 0.4, 0.374, 0.113 ]; -var out = padjust( pvalues, 'bh', 10 ); +const pvalues = [ 0.319, 0.201, 0.4, 0.374, 0.113 ]; +const out = padjust( pvalues, 'bh', 10 ); // returns [ 0.8, 0.8, ..., 0.8, 0.8 ] ``` @@ -80,11 +80,11 @@ var out = padjust( pvalues, 'bh', 10 ); ```javascript -var padjust = require( '@stdlib/stats/padjust' ); +const padjust = require( '@stdlib/stats/padjust' ); -var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ]; +const pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ]; -var out = padjust( pvalues, 'bh' ); +let out = padjust( pvalues, 'bh' ); // returns [ 0.04, 0.075, ~0.205, 0.6, 0.25 ] out = padjust( pvalues, 'bonferroni' ); diff --git a/lib/node_modules/@stdlib/stats/pcorrtest/README.md b/lib/node_modules/@stdlib/stats/pcorrtest/README.md index d544c46068ae..866b299c23d4 100644 --- a/lib/node_modules/@stdlib/stats/pcorrtest/README.md +++ b/lib/node_modules/@stdlib/stats/pcorrtest/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var pcorrtest = require( '@stdlib/stats/pcorrtest' ); +const pcorrtest = require( '@stdlib/stats/pcorrtest' ); ``` #### pcorrtest( x, y\[, opts] ) @@ -35,10 +35,10 @@ var pcorrtest = require( '@stdlib/stats/pcorrtest' ); By default, the function performs a t-test for the null hypothesis that the paired data in [arrays][mdn-array] or [typed arrays][mdn-typed-array] `x` and `y` have a [Pearson correlation coefficient][pearson-correlation] of zero. ```javascript -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = pcorrtest( x, y ); +const out = pcorrtest( x, y ); /* e.g., returns { 'alpha': 0.05, @@ -81,13 +81,13 @@ The function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = pcorrtest( x, y, { +const out = pcorrtest( x, y, { 'alpha': 0.1 }); -var table = out.print(); +const table = out.print(); /* e.g., returns t-test for Pearson correlation coefficient @@ -104,13 +104,13 @@ var table = out.print(); By default, a two-sided test is performed. To perform either of the one-sided tests, set the `alternative` option to `less` or `greater`. ```javascript -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = pcorrtest( x, y, { +let out = pcorrtest( x, y, { 'alternative': 'less' }); -var table = out.print(); +let table = out.print(); /* e.g., returns t-test for Pearson correlation coefficient @@ -143,10 +143,10 @@ table = out.print(); To test whether the correlation coefficient is equal to some other value than `0`, set the `rho` option. Hypotheses tests for correlation coefficients besides zero are carried out using the [Fisher z-transformation][fisher-transform]. ```javascript -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = pcorrtest( x, y, { +const out = pcorrtest( x, y, { 'rho': 0.8 }); /* e.g., returns @@ -162,7 +162,7 @@ var out = pcorrtest( x, y, { } */ -var table = out.print(); +const table = out.print(); /* e.g., returns Fisher's z transform test for Pearson correlation coefficient @@ -187,27 +187,20 @@ var table = out.print(); ```javascript -var rnorm = require( '@stdlib/random/base/normal' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var pcorrtest = require( '@stdlib/stats/pcorrtest' ); - -var table; -var out; -var rho; -var x; -var y; -var i; - -rho = 0.5; -x = new Array( 300 ); -y = new Array( 300 ); -for ( i = 0; i < 300; i++ ) { +const rnorm = require( '@stdlib/random/base/normal' ); +const sqrt = require( '@stdlib/math/base/special/sqrt' ); +const pcorrtest = require( '@stdlib/stats/pcorrtest' ); + +const rho = 0.5; +const x = new Array( 300 ); +const y = new Array( 300 ); +for ( let i = 0; i < 300; i++ ) { x[ i ] = rnorm( 0.0, 1.0 ); y[ i ] = ( rho * x[ i ] ) + rnorm( 0.0, sqrt( 1.0 - (rho*rho) ) ); } -out = pcorrtest( x, y ); -table = out.print(); +let out = pcorrtest( x, y ); +let table = out.print(); console.log( table ); out = pcorrtest( x, y, { diff --git a/lib/node_modules/@stdlib/stats/ranks/README.md b/lib/node_modules/@stdlib/stats/ranks/README.md index ae9cecab16e2..af19c9a0bc06 100644 --- a/lib/node_modules/@stdlib/stats/ranks/README.md +++ b/lib/node_modules/@stdlib/stats/ranks/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ranks = require( '@stdlib/stats/ranks' ); +const ranks = require( '@stdlib/stats/ranks' ); ``` #### ranks( arr\[, opts] ) @@ -35,8 +35,8 @@ var ranks = require( '@stdlib/stats/ranks' ); Returns the sample ranks of the elements in `arr`, which can be either an [`array`][mdn-array] or [`typed array`][mdn-typed-array]. ```javascript -var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ]; -var out = ranks( arr ); +let arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ]; +let out = ranks( arr ); // returns [ 2, 3, 5, 1, 4 ] // Ties are averaged: @@ -59,10 +59,10 @@ The function accepts the following options: When all elements of the `array` are different, the ranks are uniquely determined. When there are equal elements (called _ties_), the `method` option determines how they are handled. The default, `'average'`, replace the ranks of the ties by their mean. Other possible options are `'min'` and `'max'`, which replace the ranks of the ties by their minimum and maximum, respectively. `'dense'` works like `'min'`, with the difference that the next highest element after a tie is assigned the next smallest integer. Finally, `ordinal` gives each element in `arr` a distinct rank, according to the position they appear in. ```javascript -var data = [ 2, 2, 1, 4, 3 ]; +const data = [ 2, 2, 1, 4, 3 ]; // Max method: -var out = ranks( data, { +let out = ranks( data, { 'method': 'max' }); // returns [ 3, 3, 1, 5, 4 ] @@ -90,9 +90,9 @@ out = ranks( data, { The `missing` option is used to specify how to handle missing data. By default, `NaN` or `null` are treated as missing values. `'last'`specifies that missing values are placed last, `'first'` that the are assigned the lowest ranks and `'remove'` means that they are removed from the array before the ranks are calculated. ```javascript -var data = [ NaN, 2, 2, 1, 4, 3, null, null ]; +const data = [ NaN, 2, 2, 1, 4, 3, null, null ]; -var out = ranks( data, { +let out = ranks( data, { 'missing': 'first' }); // returns [ 1, 5.5, 5.5, 4, 8, 7, 2, 3 ] @@ -111,11 +111,11 @@ out = ranks( data, { Custom encoding for missing values is supported via the `encoding` option, which allows to supply the function with an `array` of values which should be treated as missing. ```javascript -var Int32Array = require( '@stdlib/array/int32' ); +const Int32Array = require( '@stdlib/array/int32' ); -var data = new Int32Array( [ 2, 1, -999, 3, 4 ] ); +const data = new Int32Array( [ 2, 1, -999, 3, 4 ] ); -var out = ranks( data, { +const out = ranks( data, { 'encoding': [ -999 ] }); // returns [ 2, 1, 5, 3, 4 ] @@ -132,27 +132,23 @@ var out = ranks( data, { ```javascript -var Int32Array = require( '@stdlib/array/int32' ); -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var ranks = require( '@stdlib/stats/ranks' ); - -var data; -var out; -var i; +const Int32Array = require( '@stdlib/array/int32' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const ranks = require( '@stdlib/stats/ranks' ); // Plain arrays... -data = new Array( 10 ); -for ( i = 0; i < data.length; i++ ) { +let data = new Array( 10 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = round( randu()*10.0 ); } -out = ranks( data ); +let out = ranks( data ); // returns // Typed arrays... data = new Int32Array( 10 ); -for ( i = 0; i < data.length; i++ ) { +for ( let i = 0; i < data.length; i++ ) { data[ i ] = randu() * 10.0; } diff --git a/lib/node_modules/@stdlib/stats/ttest/README.md b/lib/node_modules/@stdlib/stats/ttest/README.md index 5fed0c5ad970..c57d982de7c7 100644 --- a/lib/node_modules/@stdlib/stats/ttest/README.md +++ b/lib/node_modules/@stdlib/stats/ttest/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ttest = require( '@stdlib/stats/ttest' ); +const ttest = require( '@stdlib/stats/ttest' ); ``` #### ttest( x\[, y]\[, opts] ) @@ -35,21 +35,16 @@ var ttest = require( '@stdlib/stats/ttest' ); The function performs a one-sample t-test for the null hypothesis that the data in [array][mdn-array] or [typed array][mdn-typed-array] `x` is drawn from a normal distribution with mean zero and unknown variance. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; +const normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm; -var arr; -var out; -var i; - -rnorm = normal( 0.0, 2.0, { +const rnorm = normal( 0.0, 2.0, { 'seed': 5776 }); -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } -out = ttest( arr ); +const out = ttest( arr ); /* e.g., returns { 'rejected': false, @@ -64,24 +59,18 @@ out = ttest( arr ); When [array][mdn-array] or [typed array][mdn-typed-array] `y` is supplied, the function tests whether the differences `x - y` come from a normal distribution with mean zero and unknown variance via the paired t-test. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; - -var rnorm; -var out; -var i; -var x; -var y; +const normal = require( '@stdlib/random/base/normal' ).factory; -rnorm = normal( 1.0, 2.0, { +const rnorm = normal( 1.0, 2.0, { 'seed': 786 }); -x = new Array( 100 ); -y = new Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Array( 100 ); +const y = new Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = rnorm(); y[ i ] = rnorm(); } -out = ttest( x, y ); +const out = ttest( x, y ); /* e.g., returns { 'rejected': false, @@ -122,16 +111,12 @@ The `ttest` function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var table; -var out; -var arr; - -arr = [ 2, 4, 3, 1, 0 ]; +const arr = [ 2, 4, 3, 1, 0 ]; -out = ttest( arr, { +let out = ttest( arr, { 'alpha': 0.01 }); -table = out.print(); +let table = out.print(); /* e.g., returns One-sample t-test @@ -166,12 +151,9 @@ table = out.print(); To test whether the data comes from a distribution with a mean different than zero, set the `mu` option. ```javascript -var out; -var arr; - -arr = [ 4, 4, 6, 6, 5 ]; +const arr = [ 4, 4, 6, 6, 5 ]; -out = ttest( arr, { +const out = ttest( arr, { 'mu': 5 }); /* e.g., returns @@ -188,16 +170,12 @@ out = ttest( arr, { By default, a two-sided test is performed. To perform either of the one-sided tests, set the `alternative` option to `less` or `greater`. ```javascript -var table; -var out; -var arr; - -arr = [ 4, 4, 6, 6, 5 ]; +const arr = [ 4, 4, 6, 6, 5 ]; -out = ttest( arr, { +let out = ttest( arr, { 'alternative': 'less' }); -table = out.print(); +let table = out.print(); /* e.g., returns One-sample t-test @@ -240,24 +218,19 @@ table = out.print(); ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; -var ttest = require( '@stdlib/stats/ttest' ); - -var rnorm; -var arr; -var out; -var i; +const normal = require( '@stdlib/random/base/normal' ).factory; +const ttest = require( '@stdlib/stats/ttest' ); -rnorm = normal( 5.0, 4.0, { +const rnorm = normal( 5.0, 4.0, { 'seed': 37827 }); -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } // Test whether true mean is equal to zero: -out = ttest( arr ); +let out = ttest( arr ); console.log( out.print() ); /* e.g., => One-sample t-test diff --git a/lib/node_modules/@stdlib/stats/ttest2/README.md b/lib/node_modules/@stdlib/stats/ttest2/README.md index b9a87426a291..919a95296439 100644 --- a/lib/node_modules/@stdlib/stats/ttest2/README.md +++ b/lib/node_modules/@stdlib/stats/ttest2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ttest2 = require( '@stdlib/stats/ttest2' ); +const ttest2 = require( '@stdlib/stats/ttest2' ); ``` #### ttest2( x, y\[, opts] ) @@ -36,10 +36,10 @@ By default, the function performs a two-sample t-test for the null hypothesis th ```javascript // Student's sleep data: -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = ttest2( x, y ); +const out = ttest2( x, y ); /* e.g., returns { 'rejected': false, @@ -80,13 +80,13 @@ The function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = ttest2( x, y, { +const out = ttest2( x, y, { 'alpha': 0.1 }); -var table = out.print(); +const table = out.print(); /* e.g., returns Welch two-sample t-test @@ -104,13 +104,13 @@ By default, a two-sided test is performed. To perform either of the one-sided te ```javascript // Student's sleep data: -var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; -var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; +const x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ]; +const y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ]; -var out = ttest2( x, y, { +let out = ttest2( x, y, { 'alternative': 'less' }); -var table = out.print(); +let table = out.print(); /* e.g., returns Welch two-sample t-test @@ -145,13 +145,13 @@ table = out.print(); As a default choice, the `ttest2` function carries out the Welch test (using the Satterthwaite approximation for the degrees of freedom), which does not have the requirement that the variances of the underlying distributions are equal. If the equal variances assumption seems warranted, set the `variance` option to `equal`. ```javascript -var x = [ 2, 3, 1, 4 ]; -var y = [ 1, 2, 3, 1, 2, 5, 3, 4 ]; +const x = [ 2, 3, 1, 4 ]; +const y = [ 1, 2, 3, 1, 2, 5, 3, 4 ]; -var out = ttest2( x, y, { +const out = ttest2( x, y, { 'variance': 'equal' }); -var table = out.print(); +const table = out.print(); /* e.g., returns Two-sample t-test @@ -169,24 +169,23 @@ var table = out.print(); To test whether the difference in the population means is equal to some other value than `0`, set the `difference` option. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; +const normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm = normal({ +const rnorm = normal({ 'seed': 372 }); -var x = []; -var i; -for ( i = 0; i < x.length; i++ ) { +const x = []; +for ( let i = 0; i < x.length; i++ ) { x.push( rnorm( 2.0, 3.0 ) ); } -var y = []; -for ( i = 0; i < x.length; i++ ) { +const y = []; +for ( let i = 0; i < x.length; i++ ) { y.push( rnorm( 1.0, 3.0 ) ); } -var out = ttest2( x, y, { +const out = ttest2( x, y, { 'difference': 1.0, 'variance': 'equal' }); @@ -200,7 +199,7 @@ var out = ttest2( x, y, { } */ -var table = out.print(); +const table = out.print(); /* e.g., returns Two-sample t-test @@ -226,14 +225,14 @@ var table = out.print(); ```javascript -var incrspace = require( '@stdlib/array/base/incrspace' ); -var ttest2 = require( '@stdlib/stats/ttest2' ); +const incrspace = require( '@stdlib/array/base/incrspace' ); +const ttest2 = require( '@stdlib/stats/ttest2' ); -var a = incrspace( 1, 11, 1 ); -var b = incrspace( 7, 21, 1 ); +const a = incrspace( 1, 11, 1 ); +const b = incrspace( 7, 21, 1 ); -var out = ttest2( a, b ); -var table = out.print(); +const out = ttest2( a, b ); +const table = out.print(); /* e.g., returns Welch two-sample t-test diff --git a/lib/node_modules/@stdlib/stats/vartest/README.md b/lib/node_modules/@stdlib/stats/vartest/README.md index f4ae86f2cc79..351b5f82a898 100644 --- a/lib/node_modules/@stdlib/stats/vartest/README.md +++ b/lib/node_modules/@stdlib/stats/vartest/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var vartest = require( '@stdlib/stats/vartest' ); +const vartest = require( '@stdlib/stats/vartest' ); ``` #### vartest( x, y\[, opts] ) @@ -35,10 +35,10 @@ var vartest = require( '@stdlib/stats/vartest' ); By default, the function performs a two-sample F-test for the null hypothesis that the data in [arrays][mdn-array] or [typed arrays][mdn-typed-array] `x` and `y` is independently drawn from normal distributions with _equal_ variances. ```javascript -var x = [ 610, 610, 550, 590, 565, 570 ]; -var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; +const x = [ 610, 610, 550, 590, 565, 570 ]; +const y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; -var out = vartest( x, y ); +const out = vartest( x, y ); /* returns { 'rejected': false, @@ -80,13 +80,13 @@ The function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; -var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; +const x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; +const y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; -var out = vartest( x, y, { +const out = vartest( x, y, { 'alpha': 0.01 }); -var table = out.print(); +const table = out.print(); /* e.g., returns F test for comparing two variances @@ -107,13 +107,13 @@ var table = out.print(); By default, a two-sided test is performed. To perform either of the one-sided tests, set the `alternative` option to `less` or `greater`. ```javascript -var x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; -var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; +const x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; +const y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; -var out = vartest( x, y, { +let out = vartest( x, y, { 'alternative': 'less' }); -var table = out.print(); +let table = out.print(); /* e.g., returns Alternative hypothesis: True ratio in variances is less than 1 @@ -150,10 +150,10 @@ table = out.print(); To test whether the ratio in the population variances is equal to some other value than `1`, set the `ratio` option. ```javascript -var x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; -var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; +const x = [ 610, 610, 550, 590, 565, 570, 500, 650, 500, 650 ]; +const y = [ 560, 550, 580, 550, 560, 590, 550, 590 ]; -var out = vartest( x, y, { +const out = vartest( x, y, { 'ratio': 10.0 }); /* e.g., returns @@ -166,7 +166,7 @@ var out = vartest( x, y, { } */ -var table = out.print(); +const table = out.print(); /* e.g., returns F test for comparing two variances @@ -193,27 +193,21 @@ var table = out.print(); ```javascript -var rnorm = require( '@stdlib/random/base/normal' ); -var vartest = require( '@stdlib/stats/vartest' ); +const rnorm = require( '@stdlib/random/base/normal' ); +const vartest = require( '@stdlib/stats/vartest' ); -var table; -var out; -var x; -var y; -var i; - -x = new Array( 60 ); -for ( i = 0; i < x.length; i++ ) { +const x = new Array( 60 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = rnorm( 2.0, 1.0 ); } -y = new Array( 40 ); -for ( i = 0; i < y.length; i++ ) { +const y = new Array( 40 ); +for ( let i = 0; i < y.length; i++ ) { y[ i ] = rnorm( 1.0, 2.0 ); } // Test whether the variances of `x` and `y` are the same: -out = vartest( x, y ); -table = out.print(); +let out = vartest( x, y ); +let table = out.print(); /* e.g., returns F test for comparing two variances diff --git a/lib/node_modules/@stdlib/stats/wilcoxon/README.md b/lib/node_modules/@stdlib/stats/wilcoxon/README.md index 6fe2c0f759f8..a1c69c14dfc9 100644 --- a/lib/node_modules/@stdlib/stats/wilcoxon/README.md +++ b/lib/node_modules/@stdlib/stats/wilcoxon/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var wilcoxon = require( '@stdlib/stats/wilcoxon' ); +const wilcoxon = require( '@stdlib/stats/wilcoxon' ); ``` #### wilcoxon( x\[, y]\[, opts] ) @@ -36,8 +36,8 @@ Performs a one-sample t-test for the null hypothesis that the data in [array][md ```javascript // Differences in plant heights, see Cureton (1967) -var x = [ 6, 8, 14, 16, 23, 24, 28, 29, 41, -48, 49, 56, 60, -67, 75 ]; -var out = wilcoxon( x ); +const x = [ 6, 8, 14, 16, 23, 24, 28, 29, 41, -48, 49, 56, 60, -67, 75 ]; +const out = wilcoxon( x ); /* e.g., returns { 'rejected': true, @@ -53,10 +53,10 @@ When [array][mdn-array] or [typed array][mdn-typed-array] `y` is supplied, the f ```javascript // Patient measurements at first (x) and second (y) visit, see Hollander & Wolfe (1973) -var x = [ 1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30 ]; -var y = [ 0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29 ]; +const x = [ 1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30 ]; +const y = [ 0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29 ]; -var out = wilcoxon( x, y ); +const out = wilcoxon( x, y ); /* e.g., returns { 'rejected': true, @@ -98,15 +98,11 @@ The `wilcoxon` function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var table; -var out; -var arr; - -arr = [ 2, 4, 3, 1, 0 ]; -out = wilcoxon( arr, { +const arr = [ 2, 4, 3, 1, 0 ]; +let out = wilcoxon( arr, { 'alpha': 0.01 }); -table = out.print(); +let table = out.print(); /* e.g., returns One-Sample Wilcoxon signed rank test @@ -137,8 +133,8 @@ table = out.print(); To test whether the data comes from a distribution with a median different than zero, set the `mu` option. ```javascript -var arr = [ 4, 4, 6, 6, 5 ]; -var out = wilcoxon( arr, { +const arr = [ 4, 4, 6, 6, 5 ]; +const out = wilcoxon( arr, { 'mu': 5 }); /* e.g., returns @@ -154,11 +150,11 @@ var out = wilcoxon( arr, { By default, a two-sided test is performed. To perform either of the one-sided tests, set the `alternative` option to `less` or `greater`. ```javascript -var arr = [ 4, 4, 6, 6, 5 ]; -var out = wilcoxon( arr, { +const arr = [ 4, 4, 6, 6, 5 ]; +let out = wilcoxon( arr, { 'alternative': 'less' }); -var table = out.print(); +let table = out.print(); /* e.g., returns One-Sample Wilcoxon signed rank test @@ -189,8 +185,8 @@ table = out.print(); By default, all zero-differences are discarded before calculating the ranks. Set `zeroMethod` to `pratt` when you wish differences of zero to be used in the rank calculation but then drop them or to `zsplit` when differences of zero are shall be used in the ranking procedure and the ranks then split between positive and negative ones. ```javascript -var arr = [ 0, 2, 3, -1, -4, 0, 0, 8, 9 ]; -var out = wilcoxon( arr, { +const arr = [ 0, 2, 3, -1, -4, 0, 0, 8, 9 ]; +let out = wilcoxon( arr, { 'zeroMethod': 'pratt' }); /* e.g., returns @@ -220,21 +216,17 @@ out = wilcoxon( arr, { By default, the test uses the exact distribution of the rank statistic to calculate the critical values for the test in case of no ties and no zero-differences. Since it is more computationally efficient, starting with fifty observations a normal approximation is employed. If you would like the test to use the correct distribution even for larger samples, set the `exact` option to `true`. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm; -var arr; -var out; -var i; +const normal = require( '@stdlib/random/base/normal' ).factory; -rnorm = normal( 0.0, 4.0, { +const rnorm = normal( 0.0, 4.0, { 'seed': 100 }); -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } -out = wilcoxon( arr, { +let out = wilcoxon( arr, { 'exact': false }); /* e.g., returns @@ -264,21 +256,17 @@ out = wilcoxon( arr, { By default, when using the normal approximation, the test uses a continuity correction, which adjusts the Wilcoxon rank statistic by `0.5` towards the mean. To disable this correction, set `correction` to `false`. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm; -var arr; -var out; -var i; +const normal = require( '@stdlib/random/base/normal' ).factory; -rnorm = normal( 0.0, 4.0, { +const rnorm = normal( 0.0, 4.0, { 'seed': 100 }); -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } -out = wilcoxon( arr, { +let out = wilcoxon( arr, { 'correction': false }); /* e.g., returns @@ -316,26 +304,20 @@ out = wilcoxon( arr, { ```javascript -var uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var wilcoxon = require( '@stdlib/stats/wilcoxon' ); - -var table; -var runif; -var arr; -var out; -var i; +const uniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const wilcoxon = require( '@stdlib/stats/wilcoxon' ); -runif = uniform( -50.0, 50.0, { +const runif = uniform( -50.0, 50.0, { 'seed': 37827 }); -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = runif(); } // Test whether distribution is symmetric around zero: -out = wilcoxon( arr ); -table = out.print(); +let out = wilcoxon( arr ); +let table = out.print(); /* e.g., returns One-Sample Wilcoxon signed rank test diff --git a/lib/node_modules/@stdlib/stats/ztest/README.md b/lib/node_modules/@stdlib/stats/ztest/README.md index d858564ef02b..8dd95f754b72 100644 --- a/lib/node_modules/@stdlib/stats/ztest/README.md +++ b/lib/node_modules/@stdlib/stats/ztest/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ztest = require( '@stdlib/stats/ztest' ); +const ztest = require( '@stdlib/stats/ztest' ); ``` #### ztest( x, sigma\[, opts] ) @@ -35,19 +35,18 @@ var ztest = require( '@stdlib/stats/ztest' ); The function performs a one-sample z-test for the null hypothesis that the data in [array][mdn-array] or [typed array][mdn-typed-array] `x` is drawn from a normal distribution with mean zero and known standard deviation `sigma`. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; +const normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm = normal( 0.0, 2.0, { +const rnorm = normal( 0.0, 2.0, { 'seed': 5776 }); -var arr = new Array( 300 ); -var i; -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 300 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } -var out = ztest( arr, 2.0 ); +const out = ztest( arr, 2.0 ); /* e.g., returns { 'rejected': false, @@ -64,7 +63,7 @@ The returned object comes with a `.print()` method which when invoked will print ```javascript -var table = out.print({ +const table = out.print({ 'digits': 3 }); console.log( table ); @@ -90,16 +89,12 @@ The `ztest` function accepts the following `options`: By default, the hypothesis test is carried out at a significance level of `0.05`. To choose a different significance level, set the `alpha` option. ```javascript -var table; -var out; -var arr; +const arr = [ 2, 4, 3, 1, 0 ]; -arr = [ 2, 4, 3, 1, 0 ]; - -out = ztest( arr, 2.0, { +let out = ztest( arr, 2.0, { 'alpha': 0.01 }); -table = out.print(); +let table = out.print(); /* e.g., returns One-sample z-test @@ -132,12 +127,9 @@ table = out.print(); To test whether the data comes from a distribution with a mean different than zero, set the `mu` option. ```javascript -var out; -var arr; +const arr = [ 4, 4, 6, 6, 5 ]; -arr = [ 4, 4, 6, 6, 5 ]; - -out = ztest( arr, 1.0, { +const out = ztest( arr, 1.0, { 'mu': 5.0 }); /* e.g., returns @@ -154,16 +146,12 @@ out = ztest( arr, 1.0, { By default, a two-sided test is performed. To perform either of the one-sided tests, set the `alternative` option to `less` or `greater`. ```javascript -var table; -var out; -var arr; +const arr = [ 4, 4, 6, 6, 5 ]; -arr = [ 4, 4, 6, 6, 5 ]; - -out = ztest( arr, 1.0, { +let out = ztest( arr, 1.0, { 'alternative': 'less' }); -table = out.print(); +let table = out.print(); /* e.g., returns One-sample z-test @@ -204,24 +192,19 @@ table = out.print(); ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; -var ztest = require( '@stdlib/stats/ztest' ); - -var rnorm; -var arr; -var out; -var i; +const normal = require( '@stdlib/random/base/normal' ).factory; +const ztest = require( '@stdlib/stats/ztest' ); -rnorm = normal( 5.0, 4.0, { +const rnorm = normal( 5.0, 4.0, { 'seed': 37827 }); -arr = new Array( 500 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 500 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = rnorm(); } // Test whether true mean is equal to zero: -out = ztest( arr, 4.0 ); +let out = ztest( arr, 4.0 ); console.log( out.print() ); /* e.g., => One-sample z-test diff --git a/lib/node_modules/@stdlib/stats/ztest2/README.md b/lib/node_modules/@stdlib/stats/ztest2/README.md index 0d5da68bee4f..f2728945592f 100644 --- a/lib/node_modules/@stdlib/stats/ztest2/README.md +++ b/lib/node_modules/@stdlib/stats/ztest2/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ztest2 = require( '@stdlib/stats/ztest2' ); +const ztest2 = require( '@stdlib/stats/ztest2' ); ``` #### ztest2( x, y, sigmax, sigmay\[, opts] ) @@ -35,10 +35,10 @@ var ztest2 = require( '@stdlib/stats/ztest2' ); By default, the function performs a two-sample z-test for the null hypothesis that the data in [arrays][mdn-array] or [typed arrays][mdn-typed-array] `x` and `y` is independently drawn from normal distributions with _equal_ means and known standard deviations `sigmax` and `sigmay`. ```javascript -var x = [ 2.66, 1.5, 3.25, 0.993, 2.31, 2.41, 1.76, 2.57, 2.62, 1.23 ]; // Drawn from N(2,1) -var y = [ 4.88, 2.93, 2.96, 4.5, -0.0603, 4.62, 3.35, 2.98 ]; // Drawn from N(3,2) +const x = [ 2.66, 1.5, 3.25, 0.993, 2.31, 2.41, 1.76, 2.57, 2.62, 1.23 ]; // Drawn from N(2,1) +const y = [ 4.88, 2.93, 2.96, 4.5, -0.0603, 4.62, 3.35, 2.98 ]; // Drawn from N(3,2) -var out = ztest2( x, y, 1.0, 2.0 ); +const out = ztest2( x, y, 1.0, 2.0 ); /* e.g., returns { 'rejected': false, @@ -80,10 +80,10 @@ By default, the hypothesis test is carried out at a significance level of `0.05` ```javascript -var out = ztest2( x, y, 1.0, 2.0, { +const out = ztest2( x, y, 1.0, 2.0, { 'alpha': 0.2 }); -var table = out.print(); +const table = out.print(); /* e.g., returns Two-sample z-test @@ -102,10 +102,10 @@ By default, a two-sided test is performed. To perform either of the one-sided te ```javascript -var out = ztest2( x, y, { +let out = ztest2( x, y, { 'alternative': 'less' }); -var table = out.print(); +let table = out.print(); /* e.g., returns Two-sample z-test @@ -138,23 +138,22 @@ table = out.print(); To test whether the difference in the population means is equal to some other value than `0`, set the `difference` option. ```javascript -var normal = require( '@stdlib/random/base/normal' ).factory; +const normal = require( '@stdlib/random/base/normal' ).factory; -var rnorm = normal({ +const rnorm = normal({ 'seed': 372 }); -var x = new Array( 100 ); -var i; -for ( i = 0; i < x.length; i++ ) { +const x = new Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { x[ i ] = rnorm( 2.0, 1.0 ); } -var y = new Array( 100 ); -for ( i = 0; i < x.length; i++ ) { +const y = new Array( 100 ); +for ( let i = 0; i < x.length; i++ ) { y[ i ] = rnorm( 1.0, 1.0 ); } -var out = ztest2( x, y, 1.0, 1.0, { +const out = ztest2( x, y, 1.0, 1.0, { 'difference': 1.0 }); /* e.g., returns @@ -167,7 +166,7 @@ var out = ztest2( x, y, 1.0, 1.0, { } */ -var table = out.print(); +const table = out.print(); /* e.g., returns Two-sample z-test @@ -192,28 +191,22 @@ var table = out.print(); ```javascript -var rnorm = require( '@stdlib/random/base/normal' ); -var ztest2 = require( '@stdlib/stats/ztest2' ); - -var table; -var out; -var x; -var y; -var i; +const rnorm = require( '@stdlib/random/base/normal' ); +const ztest2 = require( '@stdlib/stats/ztest2' ); // Values drawn from a Normal(4,2) distribution -x = new Array( 100 ); -for ( i = 0; i < 100; i++ ) { +const x = new Array( 100 ); +for ( let i = 0; i < 100; i++ ) { x[ i ] = rnorm( 4.0, 2.0 ); } // Values drawn from a Normal(3,2) distribution -y = new Array( 80 ); -for ( i = 0; i < 80; i++ ) { +const y = new Array( 80 ); +for ( let i = 0; i < 80; i++ ) { y[ i ] = rnorm( 3.0, 2.0 ); } -out = ztest2( x, y, 2.0, 2.0 ); -table = out.print(); +let out = ztest2( x, y, 2.0, 2.0 ); +let table = out.print(); console.log( table ); out = ztest2( x, y, 2.0, 2.0, { diff --git a/lib/node_modules/@stdlib/streams/README.md b/lib/node_modules/@stdlib/streams/README.md index d7237d11acc8..f3ffd3fd1f5a 100644 --- a/lib/node_modules/@stdlib/streams/README.md +++ b/lib/node_modules/@stdlib/streams/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var streams = require( '@stdlib/streams' ); +const streams = require( '@stdlib/streams' ); ``` #### streams @@ -35,7 +35,7 @@ var streams = require( '@stdlib/streams' ); Namespace containing stream functionality. ```javascript -var s = streams; +const s = streams; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following sub-namespaces: ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var streams = require( '@stdlib/streams' ); +const getKeys = require( '@stdlib/utils/keys' ); +const streams = require( '@stdlib/streams' ); console.log( getKeys( streams ) ); ``` diff --git a/lib/node_modules/@stdlib/streams/node/README.md b/lib/node_modules/@stdlib/streams/node/README.md index 4c6c9bcf9f57..cf1666f1f654 100644 --- a/lib/node_modules/@stdlib/streams/node/README.md +++ b/lib/node_modules/@stdlib/streams/node/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var streams = require( '@stdlib/streams/node' ); +const streams = require( '@stdlib/streams/node' ); ``` #### streams @@ -35,7 +35,7 @@ var streams = require( '@stdlib/streams/node' ); Namespace containing Node.js stream functionality. ```javascript -var s = streams; +const s = streams; // returns {...} ``` @@ -79,8 +79,8 @@ The package contains the following streams: ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var streams = require( '@stdlib/streams/node' ); +const getKeys = require( '@stdlib/utils/keys' ); +const streams = require( '@stdlib/streams/node' ); console.log( getKeys( streams ) ); ``` diff --git a/lib/node_modules/@stdlib/streams/node/debug-sink/README.md b/lib/node_modules/@stdlib/streams/node/debug-sink/README.md index c72153b4a1ed..4d98a48d59be 100644 --- a/lib/node_modules/@stdlib/streams/node/debug-sink/README.md +++ b/lib/node_modules/@stdlib/streams/node/debug-sink/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var debugSinkStream = require( '@stdlib/streams/node/debug-sink' ); +const debugSinkStream = require( '@stdlib/streams/node/debug-sink' ); ``` @@ -37,12 +37,12 @@ var debugSinkStream = require( '@stdlib/streams/node/debug-sink' ); Creates a [writable stream][writable-stream] for [debugging][node-debug] stream pipelines. ```javascript -var ENV = require( '@stdlib/process/env' ); +const ENV = require( '@stdlib/process/env' ); // Set the `DEBUG` environment variable... ENV.DEBUG = '*'; -var stream = debugSinkStream({ +const stream = debugSinkStream({ 'name': 'my-stream' }); @@ -63,7 +63,7 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'name': 'my-app', 'objectMode': true, 'highWaterMark': 64, @@ -71,7 +71,7 @@ var opts = { 'defaultEncoding': 'utf8' }; -var stream = debugSinkStream( opts ); +const stream = debugSinkStream( opts ); ``` By default, each `chunk` is logged as a JSON stringified `string`, along with the `chunk` index. For more control over logging behavior, provide a `callback`. @@ -83,11 +83,11 @@ function logger( debug, chunk, idx ) { debug( 'Boop: %s', chunk.boop ); } -var opts = { +const opts = { 'name': 'my-pipeline' }; -var stream = debugSinkStream( opts, logger ); +const stream = debugSinkStream( opts, logger ); ``` #### debugSinkStream.factory( \[options] ) @@ -95,12 +95,12 @@ var stream = debugSinkStream( opts, logger ); Returns a `function` for creating [streams][writable-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64 }; -var factory = debugSinkStream.factory( opts ); +const factory = debugSinkStream.factory( opts ); ``` This method accepts the same `options` as [`debugSinkStream()`](#debug-sink-stream), **except** for `name`, which must be provided **explicitly**. @@ -110,13 +110,12 @@ This method accepts the same `options` as [`debugSinkStream()`](#debug-sink-stre Creates a [debug][node-debug] stream. ```javascript -var factory = debugSinkStream.factory(); +const factory = debugSinkStream.factory(); -var streams = []; -var i; +const streams = []; // Assign each stream to a separate debug namespace... -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { streams.push( factory( 'stream '+i ) ); } ``` @@ -126,7 +125,7 @@ for ( i = 0; i < 10; i++ ) { This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var stream = debugSinkStream.objectMode({ +const stream = debugSinkStream.objectMode({ 'name': 'beep-boop' }); @@ -166,9 +165,9 @@ This method accepts the same `options` as [`debugSinkStream()`](#debug-sink-stre ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var transformFactory = require( '@stdlib/streams/node/transform' ).factory; -var debug = require( '@stdlib/streams/node/debug-sink' ).objectMode; +const parseJSON = require( '@stdlib/utils/parse-json' ); +const transformFactory = require( '@stdlib/streams/node/transform' ).factory; +const debug = require( '@stdlib/streams/node/debug-sink' ).objectMode; function parse( chunk, enc, clbk ) { clbk( null, parseJSON( chunk ) ); @@ -179,7 +178,7 @@ function pluck( chunk, enc, clbk ) { } function square( chunk, enc, clbk ) { - var v = +chunk; + const v = +chunk; clbk( null, v*v ); } @@ -192,19 +191,19 @@ function join( chunk, enc, clbk ) { } // Create a factory for generating streams running in `objectMode`: -var tStream = transformFactory({ +const tStream = transformFactory({ 'objectMode': true }); // Create streams for each transform: -var s1 = tStream( parse ); -var s2 = tStream( pluck ); -var s3 = tStream( square ); -var s4 = tStream( toStr ); -var s5 = tStream( join ); +const s1 = tStream( parse ); +const s2 = tStream( pluck ); +const s3 = tStream( square ); +const s4 = tStream( toStr ); +const s5 = tStream( join ); // Create a writable stream for debugging the result of the transformations: -var ds = debug({ +const ds = debug({ 'name': 'debugger' }); @@ -216,10 +215,8 @@ s1.pipe( s2 ) .pipe( ds ); // Write data to the pipeline... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = '{"value":'+i+'}'; +for ( let i = 0; i < 100; i++ ) { + const v = '{"value":'+i+'}'; s1.write( v, 'utf8' ); } s1.end(); diff --git a/lib/node_modules/@stdlib/streams/node/debug/README.md b/lib/node_modules/@stdlib/streams/node/debug/README.md index 9396c5fdd1fd..97f2bcf8c28f 100644 --- a/lib/node_modules/@stdlib/streams/node/debug/README.md +++ b/lib/node_modules/@stdlib/streams/node/debug/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var debugStream = require( '@stdlib/streams/node/debug' ); +const debugStream = require( '@stdlib/streams/node/debug' ); ``` @@ -37,12 +37,12 @@ var debugStream = require( '@stdlib/streams/node/debug' ); Creates a [transform stream][transform-stream] for [debugging][node-debug] stream pipelines. ```javascript -var ENV = require( '@stdlib/process/env' ); +const ENV = require( '@stdlib/process/env' ); // Set the `DEBUG` environment variable... ENV.DEBUG = '*'; -var stream = debugStream({ +const stream = debugStream({ 'name': 'my-stream' }); @@ -63,7 +63,7 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'name': 'my-app', 'objectMode': true, 'highWaterMark': 64, @@ -71,7 +71,7 @@ var opts = { 'readableObjectMode': false // overridden by `objectMode` option when `objectMode=true` }; -var stream = debugStream( opts ); +const stream = debugStream( opts ); ``` By default, each `chunk` is logged as a JSON stringified `string`, along with the `chunk` index. For more control over logging behavior, provide a `callback`. @@ -83,11 +83,11 @@ function logger( debug, chunk, idx ) { debug( 'Boop: %s', chunk.boop ); } -var opts = { +const opts = { 'name': 'my-pipeline' }; -var stream = debugStream( opts, logger ); +const stream = debugStream( opts, logger ); ``` #### debugStream.factory( \[options] ) @@ -95,12 +95,12 @@ var stream = debugStream( opts, logger ); Returns a `function` for creating [streams][transform-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64 }; -var factory = debugStream.factory( opts ); +const factory = debugStream.factory( opts ); ``` This method accepts the same `options` as [`debugStream()`](#debug-stream), **except** for `name`, which must be provided **explicitly**. @@ -110,13 +110,12 @@ This method accepts the same `options` as [`debugStream()`](#debug-stream), **ex Creates a [debug][node-debug] stream. ```javascript -var factory = debugStream.factory(); +const factory = debugStream.factory(); -var streams = []; -var i; +const streams = []; // Assign each stream to a separate debug namespace... -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { streams.push( factory( 'stream '+i ) ); } ``` @@ -126,7 +125,7 @@ for ( i = 0; i < 10; i++ ) { This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var stream = debugStream.objectMode({ +const stream = debugStream.objectMode({ 'name': 'beep-boop' }); @@ -166,10 +165,10 @@ This method accepts the same `options` as [`debugStream()`](#debug-stream); howe ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var transformFactory = require( '@stdlib/streams/node/transform' ).factory; -var debug = require( '@stdlib/streams/node/debug' ).objectMode; +const parseJSON = require( '@stdlib/utils/parse-json' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const transformFactory = require( '@stdlib/streams/node/transform' ).factory; +const debug = require( '@stdlib/streams/node/debug' ).objectMode; function parse( chunk, enc, clbk ) { clbk( null, parseJSON( chunk ) ); @@ -180,7 +179,7 @@ function pluck( chunk, enc, clbk ) { } function square( chunk, enc, clbk ) { - var v = +chunk; + const v = +chunk; clbk( null, v*v ); } @@ -193,29 +192,29 @@ function join( chunk, enc, clbk ) { } // Create a factory for generating streams running in `objectMode`: -var tStream = transformFactory({ +const tStream = transformFactory({ 'objectMode': true }); // Create streams for each transform: -var s1 = tStream( parse ); -var d1 = debug({ +const s1 = tStream( parse ); +const d1 = debug({ 'name': 'parse' }); -var s2 = tStream( pluck ); -var d2 = debug({ +const s2 = tStream( pluck ); +const d2 = debug({ 'name': 'pluck' }); -var s3 = tStream( square ); -var d3 = debug({ +const s3 = tStream( square ); +const d3 = debug({ 'name': 'square' }); -var s4 = tStream( toStr ); -var d4 = debug({ +const s4 = tStream( toStr ); +const d4 = debug({ 'name': 'toString' }); -var s5 = tStream( join ); -var d5 = debug({ +const s5 = tStream( join ); +const d5 = debug({ 'name': 'join' }); @@ -232,10 +231,8 @@ s1.pipe( d1 ) .pipe( stdout ); // Write data to the pipeline... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = '{"value":'+i+'}'; +for ( let i = 0; i < 100; i++ ) { + const v = '{"value":'+i+'}'; s1.write( v, 'utf8' ); } s1.end(); diff --git a/lib/node_modules/@stdlib/streams/node/empty/README.md b/lib/node_modules/@stdlib/streams/node/empty/README.md index fb002a911ac7..28baeb5f8b4b 100644 --- a/lib/node_modules/@stdlib/streams/node/empty/README.md +++ b/lib/node_modules/@stdlib/streams/node/empty/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var emptyStream = require( '@stdlib/streams/node/empty' ); +const emptyStream = require( '@stdlib/streams/node/empty' ); ``` @@ -37,15 +37,15 @@ var emptyStream = require( '@stdlib/streams/node/empty' ); Returns an "empty" [readable stream][readable-stream] (i.e., a [stream][stream] which never streams any values). ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { // This function should never be called... console.log( chunk.toString() ); } -var stream = emptyStream(); -var iStream = inspectStream( log ); +const stream = emptyStream(); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -57,11 +57,11 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true }; -var stream = emptyStream( opts ); +const stream = emptyStream( opts ); ``` * * * @@ -71,14 +71,14 @@ var stream = emptyStream( opts ); Returns a `function` for creating "empty" [readable streams][readable-stream]. ```javascript -var opts = { +const opts = { 'objectMode': true }; -var createStream = emptyStream.factory( opts ); +const createStream = emptyStream.factory( opts ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` @@ -91,18 +91,18 @@ The method accepts the same `options` as [`emptyStream()`](#empty-stream). This method is a convenience function to create "empty" [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var stream = emptyStream.objectMode(); +const stream = emptyStream.objectMode(); -var opts = { +const opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -126,22 +126,22 @@ stream.pipe( iStream ); ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var emptyStream = require( '@stdlib/streams/node/empty' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const emptyStream = require( '@stdlib/streams/node/empty' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true }; -var stream = emptyStream( opts ); +const stream = emptyStream( opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/streams/node/from-array/README.md b/lib/node_modules/@stdlib/streams/node/from-array/README.md index cc428a2124a4..ac0f792b3117 100644 --- a/lib/node_modules/@stdlib/streams/node/from-array/README.md +++ b/lib/node_modules/@stdlib/streams/node/from-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var arrayStream = require( '@stdlib/streams/node/from-array' ); +const arrayStream = require( '@stdlib/streams/node/from-array' ); ``` @@ -37,14 +37,14 @@ var arrayStream = require( '@stdlib/streams/node/from-array' ); Returns a [readable stream][readable-stream] from an array-like `object`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var stream = arrayStream( [ 1, 2, 3, 4 ] ); -var iStream = inspectStream( log ); +const stream = arrayStream( [ 1, 2, 3, 4 ] ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -61,29 +61,29 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = arrayStream( [ 1, 2, 3, 4 ], opts ); +const stream = arrayStream( [ 1, 2, 3, 4 ], opts ); ``` By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates individual values using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var stream = arrayStream( [ 1, 2, 3, 4 ], { +const stream = arrayStream( [ 1, 2, 3, 4 ], { 'sep': ',' }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -91,7 +91,7 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] serializes values as JSON strings. To specify custom serialization behavior (either to a `string` or `Buffer`), set the `serialize` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function serialize( v ) { return 'v::' + v.toString(); @@ -101,11 +101,11 @@ function log( chunk ) { console.log( chunk.toString() ); } -var stream = arrayStream( [ 1, 2, 3, 4 ], { +const stream = arrayStream( [ 1, 2, 3, 4 ], { 'serialize': serialize }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -117,16 +117,16 @@ stream.pipe( iStream ); Returns a `function` for creating [readable streams][readable-stream] from array-like objects. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = arrayStream.factory( opts ); +const createStream = arrayStream.factory( opts ); -var stream1 = createStream( [ 1, 2, 3, 4 ] ); -var stream2 = createStream( [ 5, 6, 7, 8 ] ); +const stream1 = createStream( [ 1, 2, 3, 4 ] ); +const stream2 = createStream( [ 5, 6, 7, 8 ] ); // ... ``` @@ -139,18 +139,18 @@ The method accepts the same `options` as [`arrayStream()`](#array-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var stream = arrayStream.objectMode( [ 1, 2, 3, 4 ] ); +const stream = arrayStream.objectMode( [ 1, 2, 3, 4 ] ); -var opts = { +const opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -183,34 +183,33 @@ This method accepts the same `options` as [`arrayStream()`](#array-stream); howe ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var arrayStream = require( '@stdlib/streams/node/from-array' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const arrayStream = require( '@stdlib/streams/node/from-array' ); function log( v ) { console.log( v.toString() ); } // Create an array containing uniformly distributed pseudorandom numbers: -var arr = new Float64Array( 10 ); +const arr = new Float64Array( 10 ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } // Convert the array to a stream: -var opts = { +let opts = { 'objectMode': true }; -var stream = arrayStream( arr, opts ); +const stream = arrayStream( arr, opts ); // Create a writable stream for inspecting stream data: opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); // Begin data flow: stream.pipe( iStream ); diff --git a/lib/node_modules/@stdlib/streams/node/from-circular-array/README.md b/lib/node_modules/@stdlib/streams/node/from-circular-array/README.md index 3dd05051107c..af772e916e27 100644 --- a/lib/node_modules/@stdlib/streams/node/from-circular-array/README.md +++ b/lib/node_modules/@stdlib/streams/node/from-circular-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var circularArrayStream = require( '@stdlib/streams/node/from-circular-array' ); +const circularArrayStream = require( '@stdlib/streams/node/from-circular-array' ); ``` @@ -37,11 +37,9 @@ var circularArrayStream = require( '@stdlib/streams/node/from-circular-array' ); Returns a [readable stream][readable-stream] from an array-like `object` which repeatedly iterates over a provided value's elements. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var iStream; -var stream; -var count; +let count; function log( chunk ) { console.log( chunk.toString() ); @@ -71,29 +69,29 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = circularArrayStream( [ 1, 2, 3, 4 ], opts ); +const stream = circularArrayStream( [ 1, 2, 3, 4 ], opts ); ``` By default, the returned [stream][stream] is an infinite stream (i.e., never ends). To limit the number of streamed values, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = circularArrayStream( [ 1, 2, 3, 4 ], opts ); -var iStream = inspectStream( log ); +const stream = circularArrayStream( [ 1, 2, 3, 4 ], opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -101,18 +99,18 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates individual values using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var stream = circularArrayStream( [ 1, 2, 3, 4 ], { +const stream = circularArrayStream( [ 1, 2, 3, 4 ], { 'sep': ',', 'iter': 10 }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -120,7 +118,7 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] serializes values as JSON strings. To specify custom serialization behavior (either to a `string` or `Buffer`), set the `serialize` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function serialize( v ) { return 'v::' + v.toString(); @@ -130,12 +128,12 @@ function log( chunk ) { console.log( chunk.toString() ); } -var stream = circularArrayStream( [ 1, 2, 3, 4 ], { +const stream = circularArrayStream( [ 1, 2, 3, 4 ], { 'serialize': serialize, 'iter': 10 }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -147,16 +145,16 @@ stream.pipe( iStream ); Returns a `function` for creating [readable streams][readable-stream] from array-like objects. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = circularArrayStream.factory( opts ); +const createStream = circularArrayStream.factory( opts ); -var stream1 = createStream( [ 1, 2, 3, 4 ] ); -var stream2 = createStream( [ 5, 6, 7, 8 ] ); +const stream1 = createStream( [ 1, 2, 3, 4 ] ); +const stream2 = createStream( [ 5, 6, 7, 8 ] ); // ... ``` @@ -169,21 +167,21 @@ The method accepts the same `options` as [`circularArrayStream()`](#circular-arr This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = circularArrayStream.objectMode( [ 1, 2, 3, 4 ], opts ); +const stream = circularArrayStream.objectMode( [ 1, 2, 3, 4 ], opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -216,35 +214,34 @@ This method accepts the same `options` as [`circularArrayStream()`](#circular-ar ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var circularArrayStream = require( '@stdlib/streams/node/from-circular-array' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const circularArrayStream = require( '@stdlib/streams/node/from-circular-array' ); function log( v ) { console.log( v.toString() ); } // Create an array containing uniformly distributed pseudorandom numbers: -var arr = new Float64Array( 10 ); +const arr = new Float64Array( 10 ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } // Convert the array to a stream: -var opts = { +let opts = { 'objectMode': true, 'iter': arr.length * 3 }; -var stream = circularArrayStream( arr, opts ); +const stream = circularArrayStream( arr, opts ); // Create a writable stream for inspecting stream data: opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); // Begin data flow: stream.pipe( iStream ); diff --git a/lib/node_modules/@stdlib/streams/node/from-constant/README.md b/lib/node_modules/@stdlib/streams/node/from-constant/README.md index 02e299e1f465..b34652f620e1 100644 --- a/lib/node_modules/@stdlib/streams/node/from-constant/README.md +++ b/lib/node_modules/@stdlib/streams/node/from-constant/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constantStream = require( '@stdlib/streams/node/from-constant' ); +const constantStream = require( '@stdlib/streams/node/from-constant' ); ``` @@ -37,10 +37,7 @@ var constantStream = require( '@stdlib/streams/node/from-constant' ); Returns a [readable stream][readable-stream] which **always** streams the **same** `value`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk, i ) { console.log( chunk.toString() ); @@ -66,30 +63,30 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = constantStream( 'beep', opts ); +const stream = constantStream( 'beep', opts ); ``` By default, the function returns a [stream][stream] which streams an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of streamed values, set the `iter` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10 }; -var stream = constantStream( 'beep', opts ); -var iStream = inspectStream( log ); +const stream = constantStream( 'beep', opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -97,19 +94,19 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates streamed values using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var opts = { +const opts = { 'iter': 10, 'sep': ',' }; -var stream = constantStream( 'beep', opts ); -var iStream = inspectStream( log ); +const stream = constantStream( 'beep', opts ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -121,32 +118,32 @@ stream.pipe( iStream ); Returns a `function` for creating [readable streams][readable-stream] which **always** stream the **same** provided `value`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = constantStream.factory( opts ); +const createStream = constantStream.factory( opts ); ``` If provided a `value` to stream, the returned function returns [readable streams][readable-stream] which **always** stream the **same** `value`. ```javascript -var createStream = constantStream.factory( 'beep' ); +const createStream = constantStream.factory( 'beep' ); -var stream1 = createStream(); -var stream2 = createStream(); +const stream1 = createStream(); +const stream2 = createStream(); // ... ``` If not provided a `value` to stream, the returned function requires that a `value` be provided at each invocation. ```javascript -var createStream = constantStream.factory(); +const createStream = constantStream.factory(); -var stream1 = createStream( 'beep' ); -var stream2 = createStream( 'boop' ); +const stream1 = createStream( 'beep' ); +const stream2 = createStream( 'boop' ); // ... ``` @@ -159,24 +156,24 @@ The method accepts the same `options` as [`constantStream()`](#constant-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var value = { +const value = { 'beep': 'boop' }; -var opts = { +let opts = { 'iter': 10 }; -var stream = constantStream.objectMode( value, opts ); +const stream = constantStream.objectMode( value, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -212,24 +209,24 @@ This method accepts the same `options` as [`constantStream()`](#constant-stream) ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var constantStream = require( '@stdlib/streams/node/from-constant' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const constantStream = require( '@stdlib/streams/node/from-constant' ); function log( v ) { console.log( v.toString() ); } -var opts = { +let opts = { 'objectMode': true, 'iter': 10 }; -var stream = constantStream( 3.14, opts ); +const stream = constantStream( 3.14, opts ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` diff --git a/lib/node_modules/@stdlib/streams/node/from-iterator/README.md b/lib/node_modules/@stdlib/streams/node/from-iterator/README.md index 1233ddd22e3c..af22821f25a6 100644 --- a/lib/node_modules/@stdlib/streams/node/from-iterator/README.md +++ b/lib/node_modules/@stdlib/streams/node/from-iterator/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var iteratorStream = require( '@stdlib/streams/node/from-iterator' ); +const iteratorStream = require( '@stdlib/streams/node/from-iterator' ); ``` @@ -37,11 +37,8 @@ var iteratorStream = require( '@stdlib/streams/node/from-iterator' ); Returns a [readable stream][readable-stream] from an [iterator][mdn-iterator-protocol]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/iter/randu' ); - -var iStream; -var stream; +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/iter/randu' ); function log( chunk, idx ) { console.log( chunk.toString() ); @@ -67,36 +64,36 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var randu = require( '@stdlib/random/iter/randu' ); +const randu = require( '@stdlib/random/iter/randu' ); -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = iteratorStream( randu(), opts ); +const stream = iteratorStream( randu(), opts ); ``` By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates iterated values using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/iter/randu' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/iter/randu' ); function log( chunk ) { console.log( chunk.toString() ); } -var it = randu({ +const it = randu({ 'iter': 10 }); -var stream = iteratorStream( it, { +const stream = iteratorStream( it, { 'sep': ',' }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -104,8 +101,8 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] serializes iterated values as JSON strings. To specify custom serialization behavior (either to a `string` or `Buffer`), set the `serialize` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/iter/randu' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/iter/randu' ); function serialize( v ) { return 'r::' + v.toString(); @@ -115,15 +112,15 @@ function log( chunk ) { console.log( chunk.toString() ); } -var it = randu({ +const it = randu({ 'iter': 10 }); -var stream = iteratorStream( it, { +const stream = iteratorStream( it, { 'serialize': serialize }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -135,18 +132,18 @@ stream.pipe( iStream ); Returns a `function` for creating [readable streams][readable-stream] from [iterators][mdn-iterator-protocol]. ```javascript -var randu = require( '@stdlib/random/iter/randu' ); +const randu = require( '@stdlib/random/iter/randu' ); -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = iteratorStream.factory( opts ); +const createStream = iteratorStream.factory( opts ); -var stream1 = createStream( randu() ); -var stream2 = createStream( randu() ); +const stream1 = createStream( randu() ); +const stream2 = createStream( randu() ); // ... ``` @@ -159,22 +156,22 @@ The method accepts the same `options` as [`iteratorStream()`](#iterator-stream). This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/iter/randu' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/iter/randu' ); function log( v ) { console.log( v ); } -var opts = { +let opts = { 'iter': 10 }; -var stream = iteratorStream.objectMode( randu( opts ) ); +const stream = iteratorStream.objectMode( randu( opts ) ); opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -207,31 +204,31 @@ This method accepts the same `options` as [`iteratorStream()`](#iterator-stream) ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/iter/randu' ); -var iteratorStream = require( '@stdlib/streams/node/from-iterator' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/iter/randu' ); +const iteratorStream = require( '@stdlib/streams/node/from-iterator' ); function log( v ) { console.log( v.toString() ); } // Create an iterator which generates uniformly distributed pseudorandom numbers: -var opts = { +let opts = { 'iter': 10 }; -var it = randu( opts ); +const it = randu( opts ); // Convert the iterator to a stream: opts = { 'objectMode': true }; -var stream = iteratorStream( it, opts ); +const stream = iteratorStream( it, opts ); // Create a writable stream for inspecting stream data: opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); // Begin data flow: stream.pipe( iStream ); diff --git a/lib/node_modules/@stdlib/streams/node/from-strided-array/README.md b/lib/node_modules/@stdlib/streams/node/from-strided-array/README.md index d2f54c09cbd3..fc65555702e7 100644 --- a/lib/node_modules/@stdlib/streams/node/from-strided-array/README.md +++ b/lib/node_modules/@stdlib/streams/node/from-strided-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stridedArrayStream = require( '@stdlib/streams/node/from-strided-array' ); +const stridedArrayStream = require( '@stdlib/streams/node/from-strided-array' ); ``` @@ -37,14 +37,14 @@ var stridedArrayStream = require( '@stdlib/streams/node/from-strided-array' ); Returns a [readable stream][readable-stream] from a strided array-like `object`. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0 ); -var iStream = inspectStream( log ); +const stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0 ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -60,29 +60,29 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, opts ); +const stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, opts ); ``` By default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates individual values using a newline character. To specify an alternative separator, set the `sep` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( chunk ) { console.log( chunk.toString() ); } -var stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, { +const stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, { 'sep': ',' }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -90,7 +90,7 @@ stream.pipe( iStream ); By default, when not operating in [objectMode][object-mode], a returned [stream][stream] serializes values as JSON strings. To specify custom serialization behavior (either to a `string` or `Buffer`), set the `serialize` option. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function serialize( v ) { return 'v::' + v.toString(); @@ -100,11 +100,11 @@ function log( chunk ) { console.log( chunk.toString() ); } -var stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, { +const stream = stridedArrayStream( 4, [ 1, 2, 3, 4 ], 1, 0, { 'serialize': serialize }); -var iStream = inspectStream( log ); +const iStream = inspectStream( log ); stream.pipe( iStream ); ``` @@ -116,16 +116,16 @@ stream.pipe( iStream ); Returns a `function` for creating [readable streams][readable-stream] from strided array-like objects. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var createStream = stridedArrayStream.factory( opts ); +const createStream = stridedArrayStream.factory( opts ); -var stream1 = createStream( 2, [ 1, 2, 3, 4 ], 2, 1 ); -var stream2 = createStream( 3, [ 5, 6, 7, 8 ], 1, 1 ); +const stream1 = createStream( 2, [ 1, 2, 3, 4 ], 2, 1 ); +const stream2 = createStream( 3, [ 5, 6, 7, 8 ], 1, 1 ); // ... ``` @@ -138,18 +138,18 @@ The method accepts the same `options` as [`stridedArrayStream()`](#strided-array This method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode]. ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); function log( v ) { console.log( v ); } -var stream = stridedArrayStream.objectMode( 4, [ 1, 2, 3, 4 ], 1, 0 ); +const stream = stridedArrayStream.objectMode( 4, [ 1, 2, 3, 4 ], 1, 0 ); -var opts = { +const opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); stream.pipe( iStream ); ``` @@ -182,34 +182,33 @@ This method accepts the same `options` as [`stridedArrayStream()`](#strided-arra ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var stridedArrayStream = require( '@stdlib/streams/node/from-strided-array' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const stridedArrayStream = require( '@stdlib/streams/node/from-strided-array' ); function log( v ) { console.log( v.toString() ); } // Create an array containing uniformly distributed pseudorandom numbers: -var arr = new Float64Array( 20 ); +const arr = new Float64Array( 20 ); -var i; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } // Create a stream which iterates over every other element from right-to-left: -var opts = { +let opts = { 'objectMode': true }; -var stream = stridedArrayStream( 10, arr, -2, arr.length-2, opts ); +const stream = stridedArrayStream( 10, arr, -2, arr.length-2, opts ); // Create a writable stream for inspecting stream data: opts = { 'objectMode': true }; -var iStream = inspectStream( opts, log ); +const iStream = inspectStream( opts, log ); // Begin data flow: stream.pipe( iStream ); diff --git a/lib/node_modules/@stdlib/streams/node/inspect-sink/README.md b/lib/node_modules/@stdlib/streams/node/inspect-sink/README.md index 939b05a671c8..44a795946ed9 100644 --- a/lib/node_modules/@stdlib/streams/node/inspect-sink/README.md +++ b/lib/node_modules/@stdlib/streams/node/inspect-sink/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inspectSinkStream = require( '@stdlib/streams/node/inspect-sink' ); +const inspectSinkStream = require( '@stdlib/streams/node/inspect-sink' ); ``` @@ -42,7 +42,7 @@ function log( chunk, idx ) { console.log( chunk ); } -var stream = inspectSinkStream( log ); +const stream = inspectSinkStream( log ); stream.write( 'a' ); stream.write( 'b' ); @@ -73,14 +73,14 @@ function log( chunk, idx ) { console.log( chunk ); } -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64, 'decodeStrings': false, 'defaultEncoding': 'utf8' }; -var stream = inspectSinkStream( opts, log ); +const stream = inspectSinkStream( opts, log ); ``` #### inspectSinkStream.factory( \[options] ) @@ -88,12 +88,12 @@ var stream = inspectSinkStream( opts, log ); Returns a `function` for creating [streams][writable-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64 }; -var factory = inspectSinkStream.factory( opts ); +const factory = inspectSinkStream.factory( opts ); ``` This method accepts the same `options` as [`inspectSinkStream()`](#inspect-sink-stream). @@ -108,12 +108,11 @@ function log( chunk, idx ) { console.log( chunk ); } -var factory = inspectSinkStream.factory(); +const factory = inspectSinkStream.factory(); // Create 10 identically configured streams... -var streams = []; -var i; -for ( i = 0; i < 10; i++ ) { +const streams = []; +for ( let i = 0; i < 10; i++ ) { streams.push( factory( log ) ); } ``` @@ -130,7 +129,7 @@ function log( chunk, idx ) { console.log( chunk ); } -var stream = inspectSinkStream.objectMode( log ); +const stream = inspectSinkStream.objectMode( log ); stream.write( { 'value': 'a' } ); stream.write( { 'value': 'b' } ); @@ -159,9 +158,9 @@ This method accepts the same `options` as [`inspectSinkStream()`](#inspect-sink- ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var transformFactory = require( '@stdlib/streams/node/transform' ).factory; -var inspect = require( '@stdlib/streams/node/inspect-sink' ).objectMode; +const parseJSON = require( '@stdlib/utils/parse-json' ); +const transformFactory = require( '@stdlib/streams/node/transform' ).factory; +const inspect = require( '@stdlib/streams/node/inspect-sink' ).objectMode; function parse( chunk, enc, clbk ) { clbk( null, parseJSON( chunk ) ); @@ -172,7 +171,7 @@ function pluck( chunk, enc, clbk ) { } function square( chunk, enc, clbk ) { - var v = +chunk; + const v = +chunk; clbk( null, v*v ); } @@ -190,19 +189,19 @@ function logger( chunk, idx ) { } // Create a factory for generating streams running in `objectMode`: -var tStream = transformFactory({ +const tStream = transformFactory({ 'objectMode': true }); // Create streams for each transform: -var s1 = tStream( parse ); -var s2 = tStream( pluck ); -var s3 = tStream( square ); -var s4 = tStream( toStr ); -var s5 = tStream( join ); +const s1 = tStream( parse ); +const s2 = tStream( pluck ); +const s3 = tStream( square ); +const s4 = tStream( toStr ); +const s5 = tStream( join ); // Create a writable stream for inspecting the result of the transformations: -var is = inspect( logger ); +const is = inspect( logger ); // Create the pipeline: s1.pipe( s2 ) @@ -212,10 +211,8 @@ s1.pipe( s2 ) .pipe( is ); // Write data to the pipeline... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = '{"value":'+i+'}'; +for ( let i = 0; i < 100; i++ ) { + const v = '{"value":'+i+'}'; s1.write( v, 'utf8' ); } s1.end(); diff --git a/lib/node_modules/@stdlib/streams/node/inspect/README.md b/lib/node_modules/@stdlib/streams/node/inspect/README.md index b4f541556c78..1f9619a7e1e6 100644 --- a/lib/node_modules/@stdlib/streams/node/inspect/README.md +++ b/lib/node_modules/@stdlib/streams/node/inspect/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inspectStream = require( '@stdlib/streams/node/inspect' ); +const inspectStream = require( '@stdlib/streams/node/inspect' ); ``` @@ -42,7 +42,7 @@ function log( chunk, idx ) { console.log( chunk ); } -var stream = inspectStream( log ); +const stream = inspectStream( log ); stream.write( 'a' ); stream.write( 'b' ); @@ -74,14 +74,14 @@ function log( chunk, idx ) { console.log( chunk ); } -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64, 'allowHalfOpen': true, 'readableObjectMode': false // overridden by `objectMode` option when `objectMode=true` }; -var stream = inspectStream( opts, log ); +const stream = inspectStream( opts, log ); ``` #### inspectStream.factory( \[options] ) @@ -89,12 +89,12 @@ var stream = inspectStream( opts, log ); Returns a `function` for creating [streams][transform-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'highWaterMark': 64 }; -var factory = inspectStream.factory( opts ); +const factory = inspectStream.factory( opts ); ``` This method accepts the same `options` as [`inspectStream()`](#inspect-stream). @@ -109,12 +109,11 @@ function log( chunk, idx ) { console.log( chunk ); } -var factory = inspectStream.factory(); +const factory = inspectStream.factory(); // Create 10 identically configured streams... -var streams = []; -var i; -for ( i = 0; i < 10; i++ ) { +const streams = []; +for ( let i = 0; i < 10; i++ ) { streams.push( factory( log ) ); } ``` @@ -131,7 +130,7 @@ function log( chunk, idx ) { console.log( chunk ); } -var stream = inspectStream.objectMode( log ); +const stream = inspectStream.objectMode( log ); stream.write( { 'value': 'a' } ); stream.write( { 'value': 'b' } ); @@ -161,10 +160,10 @@ This method accepts the same `options` as [`inspectStream()`](#inspect-stream); ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var transformFactory = require( '@stdlib/streams/node/transform' ).factory; -var inspect = require( '@stdlib/streams/node/inspect' ).objectMode; +const parseJSON = require( '@stdlib/utils/parse-json' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const transformFactory = require( '@stdlib/streams/node/transform' ).factory; +const inspect = require( '@stdlib/streams/node/inspect' ).objectMode; function parse( chunk, enc, clbk ) { clbk( null, parseJSON( chunk ) ); @@ -175,7 +174,7 @@ function pluck( chunk, enc, clbk ) { } function square( chunk, enc, clbk ) { - var v = +chunk; + const v = +chunk; clbk( null, v*v ); } @@ -198,21 +197,21 @@ function logger( name ) { } // Create a factory for generating streams running in `objectMode`: -var tStream = transformFactory({ +const tStream = transformFactory({ 'objectMode': true }); // Create streams for each transform: -var s1 = tStream( parse ); -var i1 = inspect( logger( 'parse' ) ); -var s2 = tStream( pluck ); -var i2 = inspect( logger( 'pluck' ) ); -var s3 = tStream( square ); -var i3 = inspect( logger( 'square' ) ); -var s4 = tStream( toStr ); -var i4 = inspect( logger( 'toString' ) ); -var s5 = tStream( join ); -var i5 = inspect( logger( 'join' ) ); +const s1 = tStream( parse ); +const i1 = inspect( logger( 'parse' ) ); +const s2 = tStream( pluck ); +const i2 = inspect( logger( 'pluck' ) ); +const s3 = tStream( square ); +const i3 = inspect( logger( 'square' ) ); +const s4 = tStream( toStr ); +const i4 = inspect( logger( 'toString' ) ); +const s5 = tStream( join ); +const i5 = inspect( logger( 'join' ) ); // Create the pipeline: s1.pipe( i1 ) @@ -227,10 +226,8 @@ s1.pipe( i1 ) .pipe( stdout ); // Write data to the pipeline... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = '{"value":'+i+'}'; +for ( let i = 0; i < 100; i++ ) { + const v = '{"value":'+i+'}'; s1.write( v, 'utf8' ); } s1.end(); diff --git a/lib/node_modules/@stdlib/streams/node/join/README.md b/lib/node_modules/@stdlib/streams/node/join/README.md index b6cbcf033090..e907c9eb7603 100644 --- a/lib/node_modules/@stdlib/streams/node/join/README.md +++ b/lib/node_modules/@stdlib/streams/node/join/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var joinStream = require( '@stdlib/streams/node/join' ); +const joinStream = require( '@stdlib/streams/node/join' ); ``` @@ -37,9 +37,9 @@ var joinStream = require( '@stdlib/streams/node/join' ); Creates a [transform stream][transform-stream] which joins streamed data. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var stream = joinStream(); +const stream = joinStream(); stream.pipe( stdout ); @@ -64,7 +64,7 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'sep': ',', 'objectMode': true, 'encoding': 'utf8', @@ -73,7 +73,7 @@ var opts = { 'readableObjectMode': false // overridden by `objectMode` option when `objectMode=true` }; -var stream = joinStream( opts ); +const stream = joinStream( opts ); ``` #### joinStream.factory( \[options] ) @@ -81,19 +81,18 @@ var stream = joinStream( opts ); Returns a `function` for creating [streams][transform-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'sep': '\t', 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var factory = joinStream.factory( opts ); +const factory = joinStream.factory( opts ); // Create 10 identically configured streams... -var streams = []; -var i; -for ( i = 0; i < 10; i++ ) { +const streams = []; +for ( let i = 0; i < 10; i++ ) { streams.push( factory() ); } ``` @@ -105,9 +104,9 @@ This method accepts the same `options` as [`joinStream()`](#join-stream). This method is a convenience function to create [streams][stream] which **always** operate in `objectMode`. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var stream = joinStream.objectMode({ +const stream = joinStream.objectMode({ 'sep': ',' }); @@ -135,31 +134,26 @@ This method accepts the same `options` as [`joinStream()`](#join-stream); howeve ```javascript -var splitStream = require( '@stdlib/streams/node/split' ); -var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); -var joinStream = require( '@stdlib/streams/node/join' ); - -var inspect; -var split; -var join; -var i; +const splitStream = require( '@stdlib/streams/node/split' ); +const inspectStream = require( '@stdlib/streams/node/inspect-sink' ); +const joinStream = require( '@stdlib/streams/node/join' ); function log( chunk ) { console.log( chunk.toString() ); } // Create a split stream for tab delimited data: -split = splitStream({ +const split = splitStream({ 'sep': /\t/ }); // Create a stream to make newline delimited data: -join = joinStream({ +const join = joinStream({ 'sep': '\n' }); // Create a stream to inspect joined output: -inspect = inspectStream( log ); +const inspect = inspectStream( log ); // Create a stream pipeline: split @@ -167,7 +161,7 @@ split .pipe( inspect ); // Write values to the split stream... -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { split.write( i+'\t', 'utf8' ); } split.end(); diff --git a/lib/node_modules/@stdlib/streams/node/split/README.md b/lib/node_modules/@stdlib/streams/node/split/README.md index 9410ee2962e2..91e7aef6361d 100644 --- a/lib/node_modules/@stdlib/streams/node/split/README.md +++ b/lib/node_modules/@stdlib/streams/node/split/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var splitStream = require( '@stdlib/streams/node/split' ); +const splitStream = require( '@stdlib/streams/node/split' ); ``` @@ -37,9 +37,9 @@ var splitStream = require( '@stdlib/streams/node/split' ); Creates a [transform stream][transform-stream] which splits streamed data. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var stream = splitStream(); +const stream = splitStream(); stream.pipe( stdout ); stream.write( '1\n2\n3' ); @@ -61,7 +61,7 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'sep': ',', 'objectMode': true, 'encoding': 'utf8', @@ -70,7 +70,7 @@ var opts = { 'writableObjectMode': false // overridden by `objectMode` option when `objectMode=true` }; -var stream = splitStream( opts ); +const stream = splitStream( opts ); ``` #### splitStream.factory( \[options] ) @@ -78,19 +78,18 @@ var stream = splitStream( opts ); Returns a `function` for creating [streams][transform-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'sep': '\t', 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var factory = splitStream.factory( opts ); +const factory = splitStream.factory( opts ); // Create 10 identically configured streams... -var streams = []; -var i; -for ( i = 0; i < 10; i++ ) { +const streams = []; +for ( let i = 0; i < 10; i++ ) { streams.push( factory() ); } ``` @@ -102,9 +101,9 @@ This method accepts the same `options` as [`splitStream()`](#split-stream). This method is a convenience function to create [streams][stream] which always operate in [objectMode][object-mode]. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); -var stream = splitStream.objectMode({ +const stream = splitStream.objectMode({ 'sep': ',' }); @@ -129,9 +128,9 @@ This method accepts the same `options` as [`splitStream()`](#split-stream); howe - Similar to [`String#split`][string-split], a separator which is a [regular expression][regexp] containing a matching group will result in the separator being retained in the output stream. ```javascript - var stdout = require( '@stdlib/streams/node/stdout' ); + const stdout = require( '@stdlib/streams/node/stdout' ); - var stream = splitStream({ + const stream = splitStream({ 'sep': /(,)/ }); @@ -154,25 +153,21 @@ This method accepts the same `options` as [`splitStream()`](#split-stream); howe ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); -var stdout = require( '@stdlib/streams/node/stdout' ); -var splitStream = require( '@stdlib/streams/node/split' ); +const transformStream = require( '@stdlib/streams/node/transform' ); +const stdout = require( '@stdlib/streams/node/stdout' ); +const splitStream = require( '@stdlib/streams/node/split' ); function append( chunk, enc, clbk ) { clbk( null, chunk.toString()+'\n' ); } -var newline; -var stream; -var i; - // Create a split stream to split tab delimited data: -stream = splitStream({ +const stream = splitStream({ 'sep': /\t/ }); // Create a transform stream to make newline delimited data... -newline = transformStream({ +const newline = transformStream({ 'transform': append, 'objectMode': true }); @@ -183,7 +178,7 @@ stream .pipe( stdout ); // Write data to the pipeline... -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { stream.write( i+'\t', 'utf8' ); } stream.end(); diff --git a/lib/node_modules/@stdlib/streams/node/stderr/README.md b/lib/node_modules/@stdlib/streams/node/stderr/README.md index 22c0075d4801..891328f9cb27 100644 --- a/lib/node_modules/@stdlib/streams/node/stderr/README.md +++ b/lib/node_modules/@stdlib/streams/node/stderr/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stderr = require( '@stdlib/streams/node/stderr' ); +const stderr = require( '@stdlib/streams/node/stderr' ); ``` #### stderr @@ -64,9 +64,9 @@ stderr.write( 'Oh no!', 'utf8' ); ```javascript -var proc = require( 'process' ); -var stdin = require( '@stdlib/streams/node/stdin' ); -var stderr = require( '@stdlib/streams/node/stderr' ); +const proc = require( 'process' ); +const stdin = require( '@stdlib/streams/node/stdin' ); +const stderr = require( '@stdlib/streams/node/stderr' ); // Set the encoding: stdin.setEncoding( 'utf8' ); diff --git a/lib/node_modules/@stdlib/streams/node/stdin/README.md b/lib/node_modules/@stdlib/streams/node/stdin/README.md index c2e8c430208f..038f8642830e 100644 --- a/lib/node_modules/@stdlib/streams/node/stdin/README.md +++ b/lib/node_modules/@stdlib/streams/node/stdin/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stdin = require( '@stdlib/streams/node/stdin' ); +const stdin = require( '@stdlib/streams/node/stdin' ); ``` #### stdin @@ -37,18 +37,18 @@ var stdin = require( '@stdlib/streams/node/stdin' ); ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); -var Buffer = require( '@stdlib/buffer/ctor' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); +const Buffer = require( '@stdlib/buffer/ctor' ); -var data = []; -var len = 0; +let data = []; +let len = 0; stdin.on( 'readable', onReadable ); stdin.on( 'error', onError ); stdin.on( 'end', onEnd ); function onReadable() { - var chunk; + let chunk; while ( true ) { chunk = stdin.read(); if ( chunk === null ) { @@ -88,9 +88,9 @@ function onEnd() { ```javascript -var proc = require( 'process' ); -var stdin = require( '@stdlib/streams/node/stdin' ); -var stdout = require( '@stdlib/streams/node/stdout' ); +const proc = require( 'process' ); +const stdin = require( '@stdlib/streams/node/stdin' ); +const stdout = require( '@stdlib/streams/node/stdout' ); // Set the encoding: stdin.setEncoding( 'utf8' ); diff --git a/lib/node_modules/@stdlib/streams/node/stdout/README.md b/lib/node_modules/@stdlib/streams/node/stdout/README.md index 4fa6b8fcdc67..c93028f21018 100644 --- a/lib/node_modules/@stdlib/streams/node/stdout/README.md +++ b/lib/node_modules/@stdlib/streams/node/stdout/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); ``` #### stdout @@ -64,9 +64,9 @@ stdout.write( 'beep', 'utf8' ); ```javascript -var proc = require( 'process' ); -var stdin = require( '@stdlib/streams/node/stdin' ); -var stdout = require( '@stdlib/streams/node/stdout' ); +const proc = require( 'process' ); +const stdin = require( '@stdlib/streams/node/stdin' ); +const stdout = require( '@stdlib/streams/node/stdout' ); // Set the encoding: stdin.setEncoding( 'utf8' ); diff --git a/lib/node_modules/@stdlib/streams/node/transform/README.md b/lib/node_modules/@stdlib/streams/node/transform/README.md index 7ab1bf3c7645..af3409dee0c8 100644 --- a/lib/node_modules/@stdlib/streams/node/transform/README.md +++ b/lib/node_modules/@stdlib/streams/node/transform/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var transformStream = require( '@stdlib/streams/node/transform' ); +const transformStream = require( '@stdlib/streams/node/transform' ); ``` @@ -37,13 +37,13 @@ var transformStream = require( '@stdlib/streams/node/transform' ); Creates a [transform stream][transform-stream]. ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); function transform( chunk, enc, clbk ) { clbk( null, chunk.toString()+'\n' ); } -var stream = transformStream({ +const stream = transformStream({ 'transform': transform }); @@ -70,7 +70,7 @@ The function accepts the following `options`: To set [stream][stream] `options`, ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64, @@ -78,15 +78,15 @@ var opts = { 'decodeStrings': false }; -var stream = transformStream( opts ); +const stream = transformStream( opts ); ``` The `transform` option should be a `function` having the following signature: ```javascript function transform( chunk, enc, clbk ) { - var multipleData; - var err; + let multipleData; + let err; if ( multipleData ) { // Push as many chunks as required... @@ -111,7 +111,7 @@ The `flush` option should be a `function` which performs any remaining tasks bef ```javascript function flush( clbk ) { - var err; + let err; // Push any remaining chunks... this.push( '...' ); @@ -133,13 +133,13 @@ If no `transform` is provided, the returned `stream` will be a simple pass throu Returns a `function` for creating [streams][transform-stream] which are identically configured according to provided `options`. ```javascript -var opts = { +const opts = { 'objectMode': true, 'encoding': 'utf8', 'highWaterMark': 64 }; -var factory = transformStream.factory( opts ); +const factory = transformStream.factory( opts ); ``` This method accepts the same `options` as [`transformStream()`](#transform-stream), **except** for the `transform` and `flush` options which must be provided **explicitly**, as shown below. @@ -161,10 +161,10 @@ function flush( clbk ) { clbk(); } -var factory = transformStream.factory(); +const factory = transformStream.factory(); -var s1 = factory( transform1 ); -var s2 = factory( transform2, flush ); +const s1 = factory( transform1 ); +const s2 = factory( transform2, flush ); ``` #### transformStream.objectMode( \[options] ) @@ -174,7 +174,7 @@ This method is a convenience function to create [streams][stream] which always o ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); +const stdout = require( '@stdlib/streams/node/stdout' ); function stringify( chunk, enc, clbk ) { clbk( null, JSON.stringify( chunk ) ); @@ -184,11 +184,11 @@ function newline( chunk, enc, clbk ) { clbk( null, chunk+'\n' ); } -var s1 = transformStream.objectMode({ +const s1 = transformStream.objectMode({ 'transform': stringify }); -var s2 = transformStream.objectMode({ +const s2 = transformStream.objectMode({ 'transform': newline }); @@ -220,14 +220,14 @@ function flush( clbk ) { clbk(); } -var opts = { +const opts = { 'transform': transform, 'flush': flush }; -var MyStream = transformStream.ctor( opts ); +const MyStream = transformStream.ctor( opts ); -var bool = ( MyStream.prototype._transform === transform ); +let bool = ( MyStream.prototype._transform === transform ); // returns true bool = ( MyStream.prototype._flush === flush ); @@ -247,8 +247,8 @@ The returned constructor accepts the same `options` as documented above, **excep ```javascript -var stdout = require( '@stdlib/streams/node/stdout' ); -var factory = require( '@stdlib/streams/node/transform' ).factory; +const stdout = require( '@stdlib/streams/node/stdout' ); +const factory = require( '@stdlib/streams/node/transform' ).factory; function parse( chunk, enc, clbk ) { clbk( null, JSON.parse( chunk ) ); @@ -259,7 +259,7 @@ function pluck( chunk, enc, clbk ) { } function square( chunk, enc, clbk ) { - var v = +chunk; + const v = +chunk; clbk( null, v*v ); } @@ -272,16 +272,16 @@ function join( chunk, enc, clbk ) { } // Create a factory which generates streams running in `objectMode`: -var tStream = factory({ +const tStream = factory({ 'objectMode': true }); // Create streams for each transform: -var s1 = tStream( parse ); -var s2 = tStream( pluck ); -var s3 = tStream( square ); -var s4 = tStream( toStr ); -var s5 = tStream( join ); +const s1 = tStream( parse ); +const s2 = tStream( pluck ); +const s3 = tStream( square ); +const s4 = tStream( toStr ); +const s5 = tStream( join ); // Create the pipeline: s1.pipe( s2 ) @@ -291,10 +291,8 @@ s1.pipe( s2 ) .pipe( stdout ); // Write data to the pipeline... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = '{"value":'+i+'}'; +for ( let i = 0; i < 100; i++ ) { + const v = '{"value":'+i+'}'; s1.write( v, 'utf8' ); } s1.end(); diff --git a/lib/node_modules/@stdlib/strided/README.md b/lib/node_modules/@stdlib/strided/README.md index 96e3d8180788..30273b24616c 100644 --- a/lib/node_modules/@stdlib/strided/README.md +++ b/lib/node_modules/@stdlib/strided/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/strided' ); +const ns = require( '@stdlib/strided' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/strided' ); Namespace containing strided array functionality. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/strided' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/strided' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/README.md b/lib/node_modules/@stdlib/strided/base/README.md index 1144a4b6bcee..afd677738184 100644 --- a/lib/node_modules/@stdlib/strided/base/README.md +++ b/lib/node_modules/@stdlib/strided/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/strided/base' ); +const ns = require( '@stdlib/strided/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/strided/base' ); Base strided. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -109,8 +109,8 @@ The following functions are currently exported: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/strided/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/strided/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/binary-addon-dispatch/README.md b/lib/node_modules/@stdlib/strided/base/binary-addon-dispatch/README.md index 59572f5ce4e8..5848c8ad46f1 100644 --- a/lib/node_modules/@stdlib/strided/base/binary-addon-dispatch/README.md +++ b/lib/node_modules/@stdlib/strided/base/binary-addon-dispatch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/strided/base/binary-addon-dispatch' ); +const dispatch = require( '@stdlib/strided/base/binary-addon-dispatch' ); ``` #### dispatch( addon, fallback ) @@ -56,7 +56,7 @@ function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ } // Create a dispatch function: -var f = dispatch( addon, fallback ); +const f = dispatch( addon, fallback ); // ... @@ -137,7 +137,7 @@ function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // ... @@ -235,8 +235,8 @@ where ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dispatch = require( '@stdlib/strided/base/binary-addon-dispatch' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatch = require( '@stdlib/strided/base/binary-addon-dispatch' ); function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) { console.log( x ); @@ -261,12 +261,12 @@ function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // Create strided arrays: -var x = new Float64Array( [ 1, 2, 3, 4 ] ); -var y = new Float64Array( [ 5, 6, 7, 8 ] ); -var z = new Float64Array( [ 0, 0, 0, 0 ] ); +let x = new Float64Array( [ 1, 2, 3, 4 ] ); +let y = new Float64Array( [ 5, 6, 7, 8 ] ); +let z = new Float64Array( [ 0, 0, 0, 0 ] ); // Dispatch to the add-on function: f( 2, 'float64', x, 1, 2, 'float64', y, 1, 2, 'float64', z, 1, 2 ); diff --git a/lib/node_modules/@stdlib/strided/base/binary-dtype-signatures/README.md b/lib/node_modules/@stdlib/strided/base/binary-dtype-signatures/README.md index d9e5291f3d76..752721986c97 100644 --- a/lib/node_modules/@stdlib/strided/base/binary-dtype-signatures/README.md +++ b/lib/node_modules/@stdlib/strided/base/binary-dtype-signatures/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); +const signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); ``` #### signatures( dtypes1, dtypes2, dtypes3\[, options] ) @@ -45,14 +45,14 @@ var signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); Generates a list of binary interface signatures from strided array [data types][@stdlib/strided/dtypes]. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes, dtypes ); // returns [ 'float32', 'float32', 'float32', ... ] ``` @@ -70,17 +70,17 @@ The function accepts the following options: When the `enums` options is `false`, the function returns an array of [data type][@stdlib/strided/dtypes] strings. To return [data type][@stdlib/strided/dtypes] enumeration constants, set the `enums` option to `true`. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var options = { +const options = { 'enums': true }; -var sigs = signatures( dtypes, dtypes, dtypes, options ); +const sigs = signatures( dtypes, dtypes, dtypes, options ); // returns [...] ``` @@ -111,18 +111,18 @@ var sigs = signatures( dtypes, dtypes, dtypes, options ); ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var replace = require( '@stdlib/string/replace' ); -var signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const replace = require( '@stdlib/string/replace' ); +const signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate binary interface signatures: -var sigs = signatures( dt, dt, dt ); +const sigs = signatures( dt, dt, dt ); // Format the output: -var str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+","[^"]+"),/g, '$1,\n' ); +const str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+","[^"]+"),/g, '$1,\n' ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/binary-signature-callbacks/README.md b/lib/node_modules/@stdlib/strided/base/binary-signature-callbacks/README.md index 7d2c26492dc9..68978138e24b 100644 --- a/lib/node_modules/@stdlib/strided/base/binary-signature-callbacks/README.md +++ b/lib/node_modules/@stdlib/strided/base/binary-signature-callbacks/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var callbacks = require( '@stdlib/strided/base/binary-signature-callbacks' ); +const callbacks = require( '@stdlib/strided/base/binary-signature-callbacks' ); ``` #### callbacks( table, signatures ) @@ -45,28 +45,28 @@ var callbacks = require( '@stdlib/strided/base/binary-signature-callbacks' ); Assigns callbacks to binary interfaces according to type [promotion rules][@stdlib/ndarray/promotion-rules]. ```javascript -var signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); -var add = require( '@stdlib/math/base/ops/add' ); -var cadd = require( '@stdlib/complex/float64/base/add' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); +const signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); +const add = require( '@stdlib/math/base/ops/add' ); +const cadd = require( '@stdlib/complex/float64/base/add' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes, dtypes ); // returns [...] -var table = { +const table = { 'default': add, 'complex64': caddf, 'complex128': cadd }; -var list = callbacks( table, sigs ); +const list = callbacks( table, sigs ); // returns [...] ``` @@ -110,28 +110,28 @@ A callback `table` should have the following properties: ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); -var add = require( '@stdlib/math/base/ops/add' ); -var cadd = require( '@stdlib/complex/float64/base/add' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); -var callbacks = require( '@stdlib/strided/base/binary-signature-callbacks' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const signatures = require( '@stdlib/strided/base/binary-dtype-signatures' ); +const add = require( '@stdlib/math/base/ops/add' ); +const cadd = require( '@stdlib/complex/float64/base/add' ); +const caddf = require( '@stdlib/complex/float32/base/add' ); +const callbacks = require( '@stdlib/strided/base/binary-signature-callbacks' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate binary interface signatures: -var sigs = signatures( dt, dt, dt ); +const sigs = signatures( dt, dt, dt ); // Define a callback table: -var table = { +const table = { 'default': add, 'complex64': caddf, 'complex128': cadd }; // Generate a list of callbacks according to type promotion rules: -var clbks = callbacks( table, sigs ); +const clbks = callbacks( table, sigs ); // returns [...] ``` diff --git a/lib/node_modules/@stdlib/strided/base/binary/README.md b/lib/node_modules/@stdlib/strided/base/binary/README.md index 2d83716c091a..aaa3e54e1d12 100644 --- a/lib/node_modules/@stdlib/strided/base/binary/README.md +++ b/lib/node_modules/@stdlib/strided/base/binary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var binary = require( '@stdlib/strided/base/binary' ); +const binary = require( '@stdlib/strided/base/binary' ); ``` #### binary( arrays, shape, strides, fcn ) @@ -41,15 +41,15 @@ var binary = require( '@stdlib/strided/base/binary' ); Applies a binary callback to strided input array elements and assigns results to elements in a strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function add( x, y ) { return x + y; } -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); binary( [ x, y, z ], [ x.length ], [ 1, 1, 1 ], add ); // z => [ 2.0, 4.0, 6.0, 8.0, 10.0 ] @@ -65,17 +65,17 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input arrays and to index the first `N` elements of the strided output array in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function add( x, y ) { return x + y; } -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = 3; +const N = 3; binary( [ x, y, z ], [ N ], [ 2, 2, -1 ], add ); // z => [ 10.0, 6.0, 2.0, 0.0, 0.0, 0.0 ] @@ -84,23 +84,23 @@ binary( [ x, y, z ], [ N ], [ 2, 2, -1 ], add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function add( x, y ) { return x + y; } // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = 3; +const N = 3; binary( [ x1, y1, z1 ], [ N ], [ -2, -2, 1 ], add ); // z0 => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -111,15 +111,15 @@ binary( [ x1, y1, z1 ], [ N ], [ -2, -2, 1 ], add ); Applies a binary callback to strided input array elements and assigns results to elements in a strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function add( x, y ) { return x + y; } -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); binary.ndarray( [ x, y, z ], [ x.length ], [ 1, 1, 1 ], [ 0, 0, 0 ], add ); // z => [ 2.0, 4.0, 6.0, 8.0, 10.0 ] @@ -132,17 +132,17 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsets` parameter supports indexing semantics based on starting indices. For example, to index every other value in the strided input arrays starting from the second value and to index the last `N` elements in the strided output array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function add( x, y ) { return x + y; } -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = 3; +const N = 3; binary.ndarray( [ x, y, z ], [ N ], [ 2, 2, -1 ], [ 1, 1, z.length-1 ], add ); // z => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -165,29 +165,29 @@ binary.ndarray( [ x, y, z ], [ N ], [ 2, 2, -1 ], [ 1, 1, z.length-1 ], add ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var filledarray = require( '@stdlib/array/filled' ); -var binary = require( '@stdlib/strided/base/binary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const filledarray = require( '@stdlib/array/filled' ); +const binary = require( '@stdlib/strided/base/binary' ); function add( x, y ) { return x + y; } -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( y ); -var z = filledarray( 0.0, N, 'generic' ); +const z = filledarray( 0.0, N, 'generic' ); console.log( z ); -var shape = [ N ]; -var strides = [ 1, 1, -1 ]; -var offsets = [ 0, 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, 1, -1 ]; +const offsets = [ 0, 0, N-1 ]; binary.ndarray( [ x, y, z ], shape, strides, offsets, add ); console.log( z ); diff --git a/lib/node_modules/@stdlib/strided/base/cmap/README.md b/lib/node_modules/@stdlib/strided/base/cmap/README.md index 04be8ad5b380..bfc2520e15b2 100644 --- a/lib/node_modules/@stdlib/strided/base/cmap/README.md +++ b/lib/node_modules/@stdlib/strided/base/cmap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var cmap = require( '@stdlib/strided/base/cmap' ); +const cmap = require( '@stdlib/strided/base/cmap' ); ``` #### cmap( N, x, strideX, y, strideY, fcn ) @@ -41,23 +41,23 @@ var cmap = require( '@stdlib/strided/base/cmap' ); Applies a unary function to a single-precision complex floating-point strided input array and assigns results to a single-precision complex floating-point strided output array. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); -var x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex64Array( x.length ); +const x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex64Array( x.length ); cmap( x.length, x, 1, y, 1, cceilf ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns -2.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -73,51 +73,51 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); -var x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex64Array( x.length ); +const x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex64Array( x.length ); cmap( 2, x, 2, y, -1, cceilf ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns 5.0 -var im = imag( v ); +const im = imag( v ); // returns 0.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/complex64] views. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); // Initial arrays... -var x0 = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element cmap( 2, x1, -2, y1, 1, cceilf ); -var v = y0.get( 2 ); +const v = y0.get( 2 ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 4.0 ``` @@ -126,23 +126,23 @@ var im = imag( v ); Applies a unary function to a single-precision complex floating-point strided input array and assigns results to a single-precision complex floating-point strided output array using alternative indexing semantics. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); -var x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex64Array( x.length ); +const x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex64Array( x.length ); cmap.ndarray( x.length, x, 1, 0, y, 1, 0, cceilf ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns -2.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -154,23 +154,23 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/complex64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceilf = require( '@stdlib/math/base/special/cceilf' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceilf = require( '@stdlib/math/base/special/cceilf' ); -var x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex64Array( x.length ); +const x = new Complex64Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex64Array( x.length ); cmap.ndarray( 2, x, 2, 1, y, -1, y.length-1, cceilf ); -var v = y.get( y.length-1 ); +const v = y.get( y.length-1 ); // returns -var re = real( v ); +const re = real( v ); // returns 4.0 -var im = imag( v ); +const im = imag( v ); // returns -5.0 ``` @@ -191,25 +191,25 @@ var im = imag( v ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var Complex64Array = require( '@stdlib/array/complex64' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cmap = require( '@stdlib/strided/base/cmap' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const Complex64Array = require( '@stdlib/array/complex64' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const Complex64 = require( '@stdlib/complex/float32/ctor' ); +const cmap = require( '@stdlib/strided/base/cmap' ); function scale( x ) { - var re = real( x ); - var im = imag( x ); + const re = real( x ); + const im = imag( x ); return new Complex64( re*10.0, im*10.0 ); } -var xbuf = filledarrayBy( 10*2, 'float32', discreteUniform( -100.0, 100.0 ) ); -var x = new Complex64Array( xbuf.buffer ); +const xbuf = filledarrayBy( 10*2, 'float32', discreteUniform( -100.0, 100.0 ) ); +const x = new Complex64Array( xbuf.buffer ); console.log( x ); -var y = new Complex64Array( x.length ); +const y = new Complex64Array( x.length ); console.log( y ); cmap.ndarray( x.length, x, 1, 0, y, -1, y.length-1, scale ); diff --git a/lib/node_modules/@stdlib/strided/base/dmap/README.md b/lib/node_modules/@stdlib/strided/base/dmap/README.md index d8775482c411..1568b9659cfb 100644 --- a/lib/node_modules/@stdlib/strided/base/dmap/README.md +++ b/lib/node_modules/@stdlib/strided/base/dmap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dmap = require( '@stdlib/strided/base/dmap' ); +const dmap = require( '@stdlib/strided/base/dmap' ); ``` #### dmap( N, x, strideX, y, strideY, fcn ) @@ -41,10 +41,10 @@ var dmap = require( '@stdlib/strided/base/dmap' ); Applies a unary function to a double-precision floating-point strided input array and assigns results to a double-precision floating-point strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: dmap( x.length, x, 1, x, 1, abs ); @@ -63,11 +63,11 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap( 3, x, 2, y, -1, abs ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,16 +76,16 @@ dmap( 3, x, 2, y, -1, abs ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmap( 3, x1, -2, y1, 1, abs ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -96,11 +96,11 @@ dmap( 3, x1, -2, y1, 1, abs ); Applies a unary function to a double-precision floating-point strided input array and assigns results to a double-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap.ndarray( x.length, x, 1, 0, y, 1, 0, abs ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -114,11 +114,11 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap.ndarray( 3, x, 2, 1, y, -1, y.length-1, abs ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -141,20 +141,19 @@ dmap.ndarray( 3, x, 2, 1, y, -1, y.length-1, abs ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dmap = require( '@stdlib/strided/base/dmap' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dmap = require( '@stdlib/strided/base/dmap' ); function scale( x ) { return x * 10.0; } -var x = new Float64Array( 10 ); -var y = new Float64Array( 10 ); +const x = new Float64Array( 10 ); +const y = new Float64Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/strided/base/dmap2/README.md b/lib/node_modules/@stdlib/strided/base/dmap2/README.md index 4740b0a8ee80..4e2d8b0d273f 100644 --- a/lib/node_modules/@stdlib/strided/base/dmap2/README.md +++ b/lib/node_modules/@stdlib/strided/base/dmap2/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var dmap2 = require( '@stdlib/strided/base/dmap2' ); +const dmap2 = require( '@stdlib/strided/base/dmap2' ); ``` #### dmap2( N, x, strideX, y, strideY, z, strideZ, fcn ) @@ -43,12 +43,12 @@ var dmap2 = require( '@stdlib/strided/base/dmap2' ); Applies a binary function to double-precision floating-point strided input arrays and assigns results to a double-precision floating-point strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = new Float64Array( [ 2.0, 1.0, 3.0, -2.0, 4.0, 1.0, -1.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const y = new Float64Array( [ 2.0, 1.0, 3.0, -2.0, 4.0, 1.0, -1.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap2( x.length, x, 1, y, 1, z, 1, add ); // z => [ 0.0, 2.0, 6.0, -7.0, 8.0, 1.0, -2.0, 0.0 ] @@ -68,12 +68,12 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap2( 3, x, 2, y, -1, z, 1, add ); // z => [ 1.0, -2.0, -4.0, 0.0, 0.0, 0.0 ] @@ -82,18 +82,18 @@ dmap2( 3, x, 2, y, -1, z, 1, add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element dmap2( 3, x1, -2, y1, 1, z1, 1, add ); // z0 => [ 0.0, 0.0, -4.0, -1.0, 1.0, 0.0 ] @@ -104,12 +104,12 @@ dmap2( 3, x1, -2, y1, 1, z1, 1, add ); Applies a binary function to double-precision floating-point strided input arrays and assigns results to a double-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap2.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, add ); // z => [ 0.0, -1.0, -1.0, -2.0, -2.0 ] @@ -124,12 +124,12 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, add ); // z => [ 0.0, 0.0, 0.0, 1.0, -1.0, -4.0 ] @@ -152,19 +152,19 @@ dmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, add ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); -var dmap2 = require( '@stdlib/strided/base/dmap2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); +const dmap2 = require( '@stdlib/strided/base/dmap2' ); -var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float64', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( x.length, 'float64', discreteUniform( -100, 100 ) ); console.log( y ); -var z = new Float64Array( x.length ); +const z = new Float64Array( x.length ); console.log( z ); dmap2.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, add ); diff --git a/lib/node_modules/@stdlib/strided/base/dmskmap/README.md b/lib/node_modules/@stdlib/strided/base/dmskmap/README.md index 4bf580a5343f..65670f8a42dc 100644 --- a/lib/node_modules/@stdlib/strided/base/dmskmap/README.md +++ b/lib/node_modules/@stdlib/strided/base/dmskmap/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var dmskmap = require( '@stdlib/strided/base/dmskmap' ); +const dmskmap = require( '@stdlib/strided/base/dmskmap' ); ``` #### dmskmap( N, x, strideX, mask, strideMask, y, strideY, fcn ) @@ -43,12 +43,12 @@ var dmskmap = require( '@stdlib/strided/base/dmskmap' ); Applies a unary function to a double-precision floating-point strided input array according to a strided mask array and assigns results to a double-precision floating-point strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); // Compute the absolute values in-place: dmskmap( x.length, x, 1, m, 1, x, 1, abs ); @@ -69,13 +69,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskmap( 3, x, 2, m, 2, y, -1, abs ); // y => [ 5.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -84,19 +84,19 @@ dmskmap( 3, x, 2, m, 2, y, -1, abs ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskmap( 3, x1, -2, m1, 1, y1, 1, abs ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 0.0 ] @@ -107,13 +107,13 @@ dmskmap( 3, x1, -2, m1, 1, y1, 1, abs ); Applies a unary function to a double-precision floating-point strided input array according to a strided mask array and assigns results to a double-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskmap.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0, abs ); // y => [ 1.0, 2.0, 0.0, 4.0, 5.0 ] @@ -128,13 +128,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); dmskmap.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1, abs ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -157,23 +157,22 @@ dmskmap.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1, abs ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dmskmap = require( '@stdlib/strided/base/dmskmap' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dmskmap = require( '@stdlib/strided/base/dmskmap' ); function scale( x ) { return x * 10.0; } -var x = new Float64Array( 10 ); -var m = new Uint8Array( x.length ); -var y = new Float64Array( x.length ); +const x = new Float64Array( 10 ); +const m = new Uint8Array( x.length ); +const y = new Float64Array( x.length ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); m[ i ] = bernoulli( 0.2 ); } diff --git a/lib/node_modules/@stdlib/strided/base/dmskmap2/README.md b/lib/node_modules/@stdlib/strided/base/dmskmap2/README.md index 56d7b0c0aef7..4ad9f1eda72b 100644 --- a/lib/node_modules/@stdlib/strided/base/dmskmap2/README.md +++ b/lib/node_modules/@stdlib/strided/base/dmskmap2/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var dmskmap2 = require( '@stdlib/strided/base/dmskmap2' ); +const dmskmap2 = require( '@stdlib/strided/base/dmskmap2' ); ``` #### dmskmap2( N, x, strideX, y, strideY, mask, strideMask, z, strideZ, fcn ) @@ -43,14 +43,14 @@ var dmskmap2 = require( '@stdlib/strided/base/dmskmap2' ); Applies a binary function to double-precision floating-point strided input arrays according to a strided mask array and assigns results to a double-precision floating-point strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var z = new Float64Array( x.length ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); +const x = new Float64Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const z = new Float64Array( x.length ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); dmskmap2( x.length, x, 1, y, 1, m, 1, z, 1, add ); // z => [ -1.0, 3.0, 0.0, -1.0, 9.0, 0.0, 0.0, 5.0 ] @@ -72,14 +72,14 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); dmskmap2( 3, x, 2, y, -1, m, 2, z, 1, add ); // z => [ 1.0, 0.0, -4.0, 0.0, 0.0, 0.0 ] @@ -88,21 +88,21 @@ dmskmap2( 3, x, 2, y, -1, m, 2, z, 1, add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float64] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element dmskmap2( 3, x1, -2, y1, 1, m1, 1, z1, 1, add ); // z0 => [ 0.0, 0.0, -4.0, -1.0, 0.0, 0.0 ] @@ -113,14 +113,14 @@ dmskmap2( 3, x1, -2, y1, 1, m1, 1, z1, 1, add ); Applies a binary function to double-precision floating-point strided input arrays according to a strided mask array and assigns results to a double-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); dmskmap2.ndarray( x.length, x, 1, 0, y, 1, 0, m, 1, 0, z, 1, 0, add ); // z => [ 0.0, -1.0, 0.0, -2.0, -2.0 ] @@ -136,14 +136,14 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float64] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); dmskmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, m, 2, 1, z, 1, 0, add ); // z => [ 1.0, -1.0, 0.0, 0.0, 0.0, 0.0 ] @@ -166,23 +166,23 @@ dmskmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, m, 2, 1, z, 1, 0, add ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var Float64Array = require( '@stdlib/array/float64' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var dmskmap2 = require( '@stdlib/strided/base/dmskmap2' ); - -var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const Float64Array = require( '@stdlib/array/float64' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const dmskmap2 = require( '@stdlib/strided/base/dmskmap2' ); + +const x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float64', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( x.length, 'float64', discreteUniform( -100, 100 ) ); console.log( y ); -var m = filledarrayBy( x.length, 'uint8', bernoulli( 0.2 ) ); +const m = filledarrayBy( x.length, 'uint8', bernoulli( 0.2 ) ); console.log( m ); -var z = new Float64Array( x.length ); +const z = new Float64Array( x.length ); console.log( z ); dmskmap2.ndarray( x.length, x, 1, 0, y, -1, y.length-1, m, 1, 0, z, 1, 0, add ); diff --git a/lib/node_modules/@stdlib/strided/base/dtype-enum2str/README.md b/lib/node_modules/@stdlib/strided/base/dtype-enum2str/README.md index 2c9e1c6016b5..a4205e010a23 100644 --- a/lib/node_modules/@stdlib/strided/base/dtype-enum2str/README.md +++ b/lib/node_modules/@stdlib/strided/base/dtype-enum2str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var enum2str = require( '@stdlib/strided/base/dtype-enum2str' ); +const enum2str = require( '@stdlib/strided/base/dtype-enum2str' ); ``` #### enum2str( dtype ) @@ -45,19 +45,19 @@ var enum2str = require( '@stdlib/strided/base/dtype-enum2str' ); Returns the data type `string` associated with a strided array data type enumeration constant. ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var v = str2enum( 'float64' ); +const v = str2enum( 'float64' ); // returns -var dt = enum2str( v ); +const dt = enum2str( v ); // returns 'float64' ``` If unable to resolve a data type `string`, the function returns `null`. ```javascript -var v = enum2str( -999999999 ); +const v = enum2str( -999999999 ); // returns null ``` @@ -82,10 +82,10 @@ var v = enum2str( -999999999 ); ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var enum2str = require( '@stdlib/strided/base/dtype-enum2str' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const enum2str = require( '@stdlib/strided/base/dtype-enum2str' ); -var str = enum2str( str2enum( 'float64' ) ); +let str = enum2str( str2enum( 'float64' ) ); // returns 'float64' str = enum2str( str2enum( 'float32' ) ); diff --git a/lib/node_modules/@stdlib/strided/base/dtype-resolve-enum/README.md b/lib/node_modules/@stdlib/strided/base/dtype-resolve-enum/README.md index 51ddecccbcf4..94b941bbc903 100644 --- a/lib/node_modules/@stdlib/strided/base/dtype-resolve-enum/README.md +++ b/lib/node_modules/@stdlib/strided/base/dtype-resolve-enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/strided/base/dtype-resolve-enum' ); +const resolve = require( '@stdlib/strided/base/dtype-resolve-enum' ); ``` #### resolve( dtype ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/strided/base/dtype-resolve-enum' ); Returns the enumeration constant associated with a strided array data type value. ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns v = resolve( str2enum( 'float64' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'float64' ) ); If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -86,9 +86,9 @@ var v = resolve( 'beep' ); ```javascript -var resolve = require( '@stdlib/strided/base/dtype-resolve-enum' ); +const resolve = require( '@stdlib/strided/base/dtype-resolve-enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns v = resolve( 'float32' ); diff --git a/lib/node_modules/@stdlib/strided/base/dtype-resolve-str/README.md b/lib/node_modules/@stdlib/strided/base/dtype-resolve-str/README.md index c52bdcff9909..8a919e50662a 100644 --- a/lib/node_modules/@stdlib/strided/base/dtype-resolve-str/README.md +++ b/lib/node_modules/@stdlib/strided/base/dtype-resolve-str/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var resolve = require( '@stdlib/strided/base/dtype-resolve-str' ); +const resolve = require( '@stdlib/strided/base/dtype-resolve-str' ); ``` #### resolve( dtype ) @@ -45,9 +45,9 @@ var resolve = require( '@stdlib/strided/base/dtype-resolve-str' ); Returns the data type string associated with a strided array data type value. ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var v = resolve( 'float64' ); +let v = resolve( 'float64' ); // returns 'float64' v = resolve( str2enum( 'float64' ) ); @@ -57,7 +57,7 @@ v = resolve( str2enum( 'float64' ) ); If unable to resolve a data type string, the function returns `null`. ```javascript -var v = resolve( 'beep' ); +const v = resolve( 'beep' ); // returns null ``` @@ -82,10 +82,10 @@ var v = resolve( 'beep' ); ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var resolve = require( '@stdlib/strided/base/dtype-resolve-str' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const resolve = require( '@stdlib/strided/base/dtype-resolve-str' ); -var v = resolve( str2enum( 'float64' ) ); +let v = resolve( str2enum( 'float64' ) ); // returns 'float64' v = resolve( str2enum( 'float32' ) ); diff --git a/lib/node_modules/@stdlib/strided/base/dtype-str2enum/README.md b/lib/node_modules/@stdlib/strided/base/dtype-str2enum/README.md index de6914ad726e..bcaf0cc693a4 100644 --- a/lib/node_modules/@stdlib/strided/base/dtype-str2enum/README.md +++ b/lib/node_modules/@stdlib/strided/base/dtype-str2enum/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); ``` #### str2enum( dtype ) @@ -45,14 +45,14 @@ var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); Returns the enumeration constant associated with a strided array data type `string`. ```javascript -var v = str2enum( 'float64' ); +const v = str2enum( 'float64' ); // returns ``` If unable to resolve an enumeration constant, the function returns `null`. ```javascript -var v = str2enum( 'beep' ); +const v = str2enum( 'beep' ); // returns null ``` @@ -81,9 +81,9 @@ var v = str2enum( 'beep' ); ```javascript -var str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); +const str2enum = require( '@stdlib/strided/base/dtype-str2enum' ); -var v = str2enum( 'float64' ); +let v = str2enum( 'float64' ); // returns v = str2enum( 'float32' ); diff --git a/lib/node_modules/@stdlib/strided/base/function-object/README.md b/lib/node_modules/@stdlib/strided/base/function-object/README.md index f38100d948ce..23fc2ac86d23 100644 --- a/lib/node_modules/@stdlib/strided/base/function-object/README.md +++ b/lib/node_modules/@stdlib/strided/base/function-object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/base/function-object' ); +const headerDir = require( '@stdlib/strided/base/function-object' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/base/function-object' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/base/function-object' ); +const headerDir = require( '@stdlib/strided/base/function-object' ); console.log( headerDir ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/map-by/README.md b/lib/node_modules/@stdlib/strided/base/map-by/README.md index 0a9b85f57a99..200dfe8c4095 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by/README.md +++ b/lib/node_modules/@stdlib/strided/base/map-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var mapBy = require( '@stdlib/strided/base/map-by' ); +const mapBy = require( '@stdlib/strided/base/map-by' ); ``` #### mapBy( N, x, strideX, y, strideY, fcn, clbk\[, thisArg] ) @@ -43,14 +43,14 @@ var mapBy = require( '@stdlib/strided/base/map-by' ); Applies a unary function to each element retrieved from a strided input array according to a callback function and assigns results to a strided output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy( x.length, x, 1, y, 1, abs, accessor ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] @@ -77,38 +77,38 @@ The invoked callback function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { this.count += 1; return v * 2.0; } -var context = { +const context = { 'count': 0 }; -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy( x.length, x, 1, y, 1, abs, accessor, context ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy( 3, x, 2, y, -1, abs, accessor ); // y => [ 10.0, 6.0, 2.0, 0.0, 0.0, 0.0 ] @@ -117,20 +117,20 @@ mapBy( 3, x, 2, y, -1, abs, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element mapBy( 3, x1, -2, y1, 1, abs, accessor ); // y0 => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -141,14 +141,14 @@ mapBy( 3, x1, -2, y1, 1, abs, accessor ); Applies a unary function to each element retrieved from a strided input array according to a callback function and assigns results to a strided output array using alternative indexing semantics. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy.ndarray( x.length, x, 1, 0, y, 1, 0, abs, accessor ); // y => [ 2.0, 4.0, 6.0, 8.0, 10.0 ] @@ -162,14 +162,14 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, abs, accessor ); // y => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -186,14 +186,14 @@ mapBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, abs, accessor ); - If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is **ignored**. ```javascript - var abs = require( '@stdlib/math/base/special/abs' ); + const abs = require( '@stdlib/math/base/special/abs' ); function accessor() { // No-op... } - var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy( x.length, x, 1, y, 1, abs, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -210,11 +210,11 @@ mapBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, abs, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var mapBy = require( '@stdlib/strided/base/map-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const mapBy = require( '@stdlib/strided/base/map-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -224,10 +224,10 @@ function accessor( v, i ) { return v; } -var x = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarray( null, 10, 'generic' ); +const y = filledarray( null, 10, 'generic' ); console.log( y ); mapBy.ndarray( x.length, x, 1, 0, y, -1, y.length-1, abs, accessor ); diff --git a/lib/node_modules/@stdlib/strided/base/map-by2/README.md b/lib/node_modules/@stdlib/strided/base/map-by2/README.md index 02a64d47ae89..9799173d2b6e 100644 --- a/lib/node_modules/@stdlib/strided/base/map-by2/README.md +++ b/lib/node_modules/@stdlib/strided/base/map-by2/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var mapBy2 = require( '@stdlib/strided/base/map-by2' ); +const mapBy2 = require( '@stdlib/strided/base/map-by2' ); ``` #### mapBy2( N, x, strideX, y, strideY, z, strideZ, fcn, clbk\[, thisArg] ) @@ -43,7 +43,7 @@ var mapBy2 = require( '@stdlib/strided/base/map-by2' ); Applies a binary function to each pair of elements retrieved from strided input arrays according to a callback function and assigns results to a strided output array. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { values[ 0 ] *= 2.0; @@ -51,9 +51,9 @@ function accessor( values ) { return values; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2( x.length, x, 1, y, 1, z, 1, add, accessor ); // z => [ -2.0, 4.0, 10.0, -6.0, 14.0, 6.0, 6.0, 2.0 ] @@ -82,7 +82,7 @@ The invoked callback function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { this.count += 1; @@ -91,25 +91,25 @@ function accessor( values ) { return values; } -var context = { +const context = { 'count': 0 }; -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2( x.length, x, 1, y, 1, z, 1, add, accessor, context ); // z => [ -2.0, 4.0, 10.0, -6.0, 14.0, 6.0, 6.0, 2.0 ] -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { values[ 0 ] *= 2.0; @@ -117,9 +117,9 @@ function accessor( values ) { return values; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2( 3, x, 2, y, -1, z, 1, add, accessor ); // z => [ 2.0, -4.0, -8.0, 0.0, 0.0, 0.0 ] @@ -128,8 +128,8 @@ mapBy2( 3, x, 2, y, -1, z, 1, add, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( '@stdlib/math/base/ops/add' ); +const Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { values[ 0 ] *= 2.0; @@ -138,14 +138,14 @@ function accessor( values ) { } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element mapBy2( 3, x1, -2, y1, 1, z1, 1, add, accessor ); // z0 => [ 0.0, 0.0, -8.0, -2.0, 2.0, 0.0 ] @@ -156,7 +156,7 @@ mapBy2( 3, x1, -2, y1, 1, z1, 1, add, accessor ); Applies a binary function to each pair of elements retrieved from strided input arrays according to a callback function and assigns results to a strided output array using alternative indexing semantics. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { values[ 0 ] *= 2.0; @@ -164,9 +164,9 @@ function accessor( values ) { return values; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 1.0, 1.0, 2.0, 2.0, 3.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, add, accessor ); // z => [ 0.0, -2.0, -2.0, -4.0, -4.0 ] @@ -181,7 +181,7 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function accessor( values ) { values[ 0 ] *= 2.0; @@ -189,9 +189,9 @@ function accessor( values ) { return values; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]; -var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]; +const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, add, accessor ); // z => [ 0.0, 0.0, 0.0, 2.0, -2.0, -8.0 ] @@ -208,15 +208,15 @@ mapBy2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, add, accessor ); - If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is **ignored**. ```javascript - var add = require( '@stdlib/math/base/ops/add' ); + const add = require( '@stdlib/math/base/ops/add' ); function accessor() { // No-op... } - var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; - var y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; - var z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; + const y = [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ]; + const z = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; mapBy2( x.length, x, 1, y, 1, z, 1, add, accessor ); // z => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -233,11 +233,11 @@ mapBy2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, add, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var mapBy2 = require( '@stdlib/strided/base/map-by2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const mapBy2 = require( '@stdlib/strided/base/map-by2' ); function accessor( values, i ) { if ( (i%3) === 0 ) { @@ -247,13 +247,13 @@ function accessor( values, i ) { return values; } -var x = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( 10, 'generic', discreteUniform( -100, 100 ) ); console.log( y ); -var z = filledarray( null, 10, 'generic' ); +const z = filledarray( null, 10, 'generic' ); console.log( z ); mapBy2.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, add, accessor ); diff --git a/lib/node_modules/@stdlib/strided/base/max-view-buffer-index/README.md b/lib/node_modules/@stdlib/strided/base/max-view-buffer-index/README.md index 0bdd2f59a9d4..e87d1ba19154 100644 --- a/lib/node_modules/@stdlib/strided/base/max-view-buffer-index/README.md +++ b/lib/node_modules/@stdlib/strided/base/max-view-buffer-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maxViewBufferIndex = require( '@stdlib/strided/base/max-view-buffer-index' ); +const maxViewBufferIndex = require( '@stdlib/strided/base/max-view-buffer-index' ); ``` #### maxViewBufferIndex( N, stride, offset ) @@ -45,7 +45,7 @@ var maxViewBufferIndex = require( '@stdlib/strided/base/max-view-buffer-index' ) Returns the maximum accessible index based on a set of provided strided array parameters. ```javascript -var idx = maxViewBufferIndex( 3, 2, 10 ); +const idx = maxViewBufferIndex( 3, 2, 10 ); // returns 14 ``` @@ -74,20 +74,20 @@ var idx = maxViewBufferIndex( 3, 2, 10 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var maxViewBufferIndex = require( '@stdlib/strided/base/max-view-buffer-index' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const maxViewBufferIndex = require( '@stdlib/strided/base/max-view-buffer-index' ); // Generate a random number of indexed elements: -var N = discreteUniform( 10, 20 ); +const N = discreteUniform( 10, 20 ); // Generate a random stride length: -var stride = discreteUniform( -10, 10 ); +const stride = discreteUniform( -10, 10 ); // Generate a random offset: -var offset = discreteUniform( 0, 100 ) + ( ( stride < 0 ) ? (1-N)*stride : 0 ); +const offset = discreteUniform( 0, 100 ) + ( ( stride < 0 ) ? (1-N)*stride : 0 ); // Compute the maximum accessible index: -var idx = maxViewBufferIndex( N, stride, offset ); +const idx = maxViewBufferIndex( N, stride, offset ); console.log( 'N: %d, stride: %d, offset: %d => %d', N, stride, offset, idx ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/meta-data-props/README.md b/lib/node_modules/@stdlib/strided/base/meta-data-props/README.md index 76526af0e08e..0b15c8f003a8 100644 --- a/lib/node_modules/@stdlib/strided/base/meta-data-props/README.md +++ b/lib/node_modules/@stdlib/strided/base/meta-data-props/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var setProps = require( '@stdlib/strided/base/meta-data-props' ); +const setProps = require( '@stdlib/strided/base/meta-data-props' ); ``` #### setProps( meta, dtypes, obj, bool ) @@ -48,19 +48,19 @@ Defines non-enumerable read-only properties which expose strided array function ```javascript // Define strided array function meta data: -var meta = { +const meta = { 'nargs': 7, 'nin': 1, 'nout': 1 }; // Define the list of strided array data types: -var dtypes = [ +const dtypes = [ 'float64', 'float64' ]; // Define an object/function on which to set the properties: -var obj = {}; +const obj = {}; // Set the properties: setProps( meta, dtypes, obj, false ); @@ -78,25 +78,25 @@ The `bool` argument indicates whether the input object should describe an "ndarr ```javascript // Define strided array function meta data: -var meta = { +const meta = { 'nargs': 7, // excludes offsets 'nin': 1, 'nout': 1 }; // Define the list of strided array data types: -var dtypes = [ +const dtypes = [ 'float64', 'float64' ]; // Define an object/function on which to set the properties: -var obj = {}; +const obj = {}; // Set the properties: setProps( meta, dtypes, obj, true ); // Retrieve the total number of arguments: -var nargs = obj.nargs; +const nargs = obj.nargs; // returns 9 ``` @@ -123,39 +123,39 @@ var nargs = obj.nargs; ```javascript -var setProps = require( '@stdlib/strided/base/meta-data-props' ); +const setProps = require( '@stdlib/strided/base/meta-data-props' ); // Define strided array function meta data: -var meta = { +const meta = { 'nargs': 7, 'nin': 1, 'nout': 1 }; // Define the list of strided array data types: -var types = [ +const types = [ 'float64', 'float64', 'float32', 'float32', 'generic', 'generic' ]; // Define an object/function on which to set the properties: -var obj = {}; +const obj = {}; // Set the properties: setProps( meta, types, obj, false ); // Retrieve strided array function data... -var nargs = obj.nargs; +const nargs = obj.nargs; // returns 7 -var nin = obj.nin; +const nin = obj.nin; // returns 1 -var nout = obj.nout; +const nout = obj.nout; // returns 1 -var sigs = obj.types; +const sigs = obj.types; // returns [...] ``` diff --git a/lib/node_modules/@stdlib/strided/base/min-view-buffer-index/README.md b/lib/node_modules/@stdlib/strided/base/min-view-buffer-index/README.md index ac98205e4353..fb3ee138f581 100644 --- a/lib/node_modules/@stdlib/strided/base/min-view-buffer-index/README.md +++ b/lib/node_modules/@stdlib/strided/base/min-view-buffer-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +const minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); ``` #### minViewBufferIndex( N, stride, offset ) @@ -45,7 +45,7 @@ var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ) Returns the minimum accessible index based on a set of provided strided array parameters. ```javascript -var idx = minViewBufferIndex( 3, -2, 10 ); +const idx = minViewBufferIndex( 3, -2, 10 ); // returns 6 ``` @@ -74,20 +74,20 @@ var idx = minViewBufferIndex( 3, -2, 10 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); // Generate a random number of indexed elements: -var N = discreteUniform( 10, 20 ); +const N = discreteUniform( 10, 20 ); // Generate a random stride length: -var stride = discreteUniform( -10, 10 ); +const stride = discreteUniform( -10, 10 ); // Generate a random offset: -var offset = discreteUniform( 0, 100 ) + ( ( stride < 0 ) ? (1-N)*stride : 0 ); +const offset = discreteUniform( 0, 100 ) + ( ( stride < 0 ) ? (1-N)*stride : 0 ); // Compute the minimum accessible index: -var idx = minViewBufferIndex( N, stride, offset ); +const idx = minViewBufferIndex( N, stride, offset ); console.log( 'N: %d, stride: %d, offset: %d => %d', N, stride, offset, idx ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/mskunary-addon-dispatch/README.md b/lib/node_modules/@stdlib/strided/base/mskunary-addon-dispatch/README.md index 3b24b01ebb69..d97190312d46 100644 --- a/lib/node_modules/@stdlib/strided/base/mskunary-addon-dispatch/README.md +++ b/lib/node_modules/@stdlib/strided/base/mskunary-addon-dispatch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/strided/base/mskunary-addon-dispatch' ); +const dispatch = require( '@stdlib/strided/base/mskunary-addon-dispatch' ); ``` #### dispatch( addon, fallback ) @@ -56,7 +56,7 @@ function fallback( N, dtypeX, x, strideX, dtypeMask, mask, strideMask, dtypeY, y } // Create a dispatch function: -var f = dispatch( addon, fallback ); +const f = dispatch( addon, fallback ); // ... @@ -137,7 +137,7 @@ function fallback( N, dtypeX, x, strideX, offsetX, dtypeMask, mask, strideMask, } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // ... @@ -235,9 +235,9 @@ where ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var dispatch = require( '@stdlib/strided/base/mskunary-addon-dispatch' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const dispatch = require( '@stdlib/strided/base/mskunary-addon-dispatch' ); function addon( N, dx, x, sx, dm, m, sm, dy, y, sy ) { console.log( x ); @@ -256,12 +256,12 @@ function fallback( N, dx, x, sx, ox, dm, m, sm, om, dy, y, sy, oy ) { } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // Create strided arrays: -var x = new Float64Array( [ 1, 2, 3, 4 ] ); -var y = new Float64Array( [ 5, 6, 7, 8 ] ); -var m = new Uint8Array( x.length ); +let x = new Float64Array( [ 1, 2, 3, 4 ] ); +let y = new Float64Array( [ 5, 6, 7, 8 ] ); +let m = new Uint8Array( x.length ); // Dispatch to the add-on function: f( 2, 'float64', x, 1, 2, 'uint8', m, 1, 2, 'float64', y, 1, 2 ); diff --git a/lib/node_modules/@stdlib/strided/base/mskunary-dtype-signatures/README.md b/lib/node_modules/@stdlib/strided/base/mskunary-dtype-signatures/README.md index 3dfe80d67eb5..ab28339e0741 100644 --- a/lib/node_modules/@stdlib/strided/base/mskunary-dtype-signatures/README.md +++ b/lib/node_modules/@stdlib/strided/base/mskunary-dtype-signatures/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); +const signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); ``` #### signatures( dtypes1, dtypes2\[, options] ) @@ -45,14 +45,14 @@ var signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); Generates a list of masked unary interface signatures from strided array [data types][@stdlib/strided/dtypes]. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes ); // e.g., returns [ 'float32', 'uint8', 'float32', ... ] ``` @@ -69,17 +69,17 @@ The function accepts the following options: When the `enums` options is `false`, the function returns an array of [data type][@stdlib/strided/dtypes] strings. To return [data type][@stdlib/strided/dtypes] enumeration constants, set the `enums` option to `true`. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var options = { +const options = { 'enums': true }; -var sigs = signatures( dtypes, dtypes, options ); +const sigs = signatures( dtypes, dtypes, options ); // returns [...] ``` @@ -111,18 +111,18 @@ var sigs = signatures( dtypes, dtypes, options ); ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var replace = require( '@stdlib/string/replace' ); -var signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const replace = require( '@stdlib/string/replace' ); +const signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate unary interface signatures: -var sigs = signatures( dt, dt ); +const sigs = signatures( dt, dt ); // Format the output: -var str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+","[^"]+"),/g, '$1,\n' ); +const str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+","[^"]+"),/g, '$1,\n' ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/mskunary-signature-callbacks/README.md b/lib/node_modules/@stdlib/strided/base/mskunary-signature-callbacks/README.md index d09113dcdb9e..da0b60485493 100644 --- a/lib/node_modules/@stdlib/strided/base/mskunary-signature-callbacks/README.md +++ b/lib/node_modules/@stdlib/strided/base/mskunary-signature-callbacks/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var callbacks = require( '@stdlib/strided/base/mskunary-signature-callbacks' ); +const callbacks = require( '@stdlib/strided/base/mskunary-signature-callbacks' ); ``` #### callbacks( table, signatures ) @@ -45,28 +45,28 @@ var callbacks = require( '@stdlib/strided/base/mskunary-signature-callbacks' ); Assigns callbacks to masked unary interfaces according to type [promotion rules][@stdlib/ndarray/promotion-rules]. ```javascript -var signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); -var identity = require( '@stdlib/math/base/special/identity' ); -var cidentity = require( '@stdlib/math/base/special/cidentity' ); -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); +const signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); +const identity = require( '@stdlib/math/base/special/identity' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes ); // returns [...] -var table = { +const table = { 'default': identity, 'complex64': cidentityf, 'complex128': cidentity }; -var list = callbacks( table, sigs ); +const list = callbacks( table, sigs ); // returns [...] ``` @@ -110,28 +110,28 @@ A callback `table` should have the following properties: ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); -var identity = require( '@stdlib/math/base/special/identity' ); -var cidentity = require( '@stdlib/math/base/special/cidentity' ); -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); -var callbacks = require( '@stdlib/strided/base/mskunary-signature-callbacks' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const signatures = require( '@stdlib/strided/base/mskunary-dtype-signatures' ); +const identity = require( '@stdlib/math/base/special/identity' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); +const callbacks = require( '@stdlib/strided/base/mskunary-signature-callbacks' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate masked unary interface signatures: -var sigs = signatures( dt, dt ); +const sigs = signatures( dt, dt ); // Define a callback table: -var table = { +const table = { 'default': identity, 'complex64': cidentityf, 'complex128': cidentity }; // Generate a list of callbacks according to type promotion rules: -var clbks = callbacks( table, sigs ); +const clbks = callbacks( table, sigs ); // returns [...] ``` diff --git a/lib/node_modules/@stdlib/strided/base/mskunary/README.md b/lib/node_modules/@stdlib/strided/base/mskunary/README.md index 1edd4fa8627d..3e7542f940c9 100644 --- a/lib/node_modules/@stdlib/strided/base/mskunary/README.md +++ b/lib/node_modules/@stdlib/strided/base/mskunary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var mskunary = require( '@stdlib/strided/base/mskunary' ); +const mskunary = require( '@stdlib/strided/base/mskunary' ); ``` #### mskunary( arrays, shape, strides, fcn ) @@ -41,12 +41,12 @@ var mskunary = require( '@stdlib/strided/base/mskunary' ); Applies a unary callback to elements in a strided input array according to elements in a strided mask array and assigns results to elements in a strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var mask = new Uint8Array( [ 0, 0, 0, 1, 0, 0, 0, 1 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const mask = new Uint8Array( [ 0, 0, 0, 1, 0, 0, 0, 1 ] ); // Compute the absolute values in-place: mskunary( [ x, mask, x ], [ x.length ], [ 1, 1, 1 ], abs ); @@ -63,13 +63,13 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in the strided input array and to index the first `N` elements of the strided output array in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 1, 0, 0, 0, 0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 1, 0, 0, 0, 0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); mskunary( [ x, mask, y ], [ 3 ], [ 2, 1, -1 ], abs ); // y => [ 5.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -78,19 +78,19 @@ mskunary( [ x, mask, y ], [ 3 ], [ 2, 1, -1 ], abs ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 0, 0, 0, 1 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 0, 0, 0, 1 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element mskunary( [ x1, m1, y1 ], [ 3 ], [ -2, 1, 1 ], abs ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 0.0 ] @@ -101,13 +101,13 @@ mskunary( [ x1, m1, y1 ], [ 3 ], [ -2, 1, 1 ], abs ); Applies a unary callback to elements in a strided input array according to elements in a strided mask array and assigns results to elements in a strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const mask = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); mskunary.ndarray( [ x, mask, y ], [ x.length ], [ 1, 1, 1 ], [ 0, 0, 0 ], abs ); // y => [ 1.0, 2.0, 0.0, 4.0, 5.0 ] @@ -122,13 +122,13 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var mask = new Uint8Array( [ 0, 1, 0, 0, 0, 0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const mask = new Uint8Array( [ 0, 1, 0, 0, 0, 0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); mskunary.ndarray( [ x, mask, y ], [ 3 ], [ 2, 1, -1 ], [ 1, 0, y.length-1 ], abs ); // y => [ 0.0, 0.0, 0.0, 6.0, 0.0, 2.0 ] @@ -151,30 +151,30 @@ mskunary.ndarray( [ x, mask, y ], [ 3 ], [ 2, 1, -1 ], [ 1, 0, y.length-1 ], abs ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var mskunary = require( '@stdlib/strided/base/mskunary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const mskunary = require( '@stdlib/strided/base/mskunary' ); function add10( x ) { return x + 10; } -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var m = filledarrayBy( N, 'generic', bernoulli( 0.5 ) ); +const m = filledarrayBy( N, 'generic', bernoulli( 0.5 ) ); console.log( m ); -var y = filledarray( 0.0, N, 'generic' ); +const y = filledarray( 0.0, N, 'generic' ); console.log( y ); -var shape = [ N ]; -var strides = [ 1, 1, -1 ]; -var offsets = [ 0, 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, 1, -1 ]; +const offsets = [ 0, 0, N-1 ]; mskunary.ndarray( [ x, m, y ], shape, strides, offsets, add10 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/strided/base/nullary-addon-dispatch/README.md b/lib/node_modules/@stdlib/strided/base/nullary-addon-dispatch/README.md index 86d3d2e7df95..b6bf14790af8 100644 --- a/lib/node_modules/@stdlib/strided/base/nullary-addon-dispatch/README.md +++ b/lib/node_modules/@stdlib/strided/base/nullary-addon-dispatch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/strided/base/nullary-addon-dispatch' ); +const dispatch = require( '@stdlib/strided/base/nullary-addon-dispatch' ); ``` #### dispatch( addon, fallback ) @@ -54,7 +54,7 @@ function fallback( N, dtypeX, x, strideX ) { } // Create a dispatch function: -var f = dispatch( addon, fallback ); +const f = dispatch( addon, fallback ); // ... @@ -117,7 +117,7 @@ function fallback( N, dtypeX, x, strideX, offsetX ) { } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // ... @@ -193,8 +193,8 @@ where ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dispatch = require( '@stdlib/strided/base/nullary-addon-dispatch' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatch = require( '@stdlib/strided/base/nullary-addon-dispatch' ); function addon( N, dtypeX, x, strideX ) { console.log( x ); @@ -207,10 +207,10 @@ function fallback( N, dtypeX, x, strideX, offsetX ) { } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // Create a strided array: -var x = new Float64Array( [ 1, 2, 3, 4 ] ); +let x = new Float64Array( [ 1, 2, 3, 4 ] ); // Dispatch to the add-on function: f( 2, 'float64', x, 1, 2 ); diff --git a/lib/node_modules/@stdlib/strided/base/nullary/README.md b/lib/node_modules/@stdlib/strided/base/nullary/README.md index 943ce91c7ffa..7c9e3fe5f943 100644 --- a/lib/node_modules/@stdlib/strided/base/nullary/README.md +++ b/lib/node_modules/@stdlib/strided/base/nullary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var nullary = require( '@stdlib/strided/base/nullary' ); +const nullary = require( '@stdlib/strided/base/nullary' ); ``` #### nullary( arrays, shape, strides, fcn ) @@ -41,13 +41,13 @@ var nullary = require( '@stdlib/strided/base/nullary' ); Applies a nullary callback and assigns results to elements in a strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fill() { return 3.0; } -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); nullary( [ x ], [ x.length ], [ 1 ], fill ); // x => [ 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0 ] @@ -63,13 +63,13 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided output array are accessed at runtime. For example, to index the first `N` elements of the strided output array in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fill() { return 3.0; } -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); nullary( [ x ], [ 3 ], [ -1 ], fill ); // x => [ 3.0, 3.0, 3.0, -4.0, -5.0, -6.0 ] @@ -78,17 +78,17 @@ nullary( [ x ], [ 3 ], [ -1 ], fill ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fill() { return 3.0; } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element nullary( [ x1 ], [ 3 ], [ 1 ], fill ); // x0 => [ -1.0, 3.0, 3.0, 3.0, -5.0, -6.0 ] @@ -99,13 +99,13 @@ nullary( [ x1 ], [ 3 ], [ 1 ], fill ); Applies a nullary callback and assigns results to elements in a strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fill() { return 3.0; } -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); nullary.ndarray( [ x ], [ x.length ], [ 1 ], [ 0 ], fill ); // x => [ 3.0, 3.0, 3.0, 3.0, 3.0 ] @@ -118,13 +118,13 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsets` parameter supports indexing semantics based on starting indices. For example, to index the last `N` elements in the strided output array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); function fill() { return 3.0; } -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); nullary.ndarray( [ x ], [ 3 ], [ -1 ], [ x.length-1 ], fill ); // x => [ -1.0, -2.0, -3.0, 3.0, 3.0, 3.0 ] @@ -147,16 +147,16 @@ nullary.ndarray( [ x ], [ 3 ], [ -1 ], [ x.length-1 ], fill ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var nullary = require( '@stdlib/strided/base/nullary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const nullary = require( '@stdlib/strided/base/nullary' ); -var x = filledarray( 0.0, 10, 'generic' ); +const x = filledarray( 0.0, 10, 'generic' ); console.log( x ); -var shape = [ x.length ]; -var strides = [ 1 ]; -var offsets = [ 0 ]; +const shape = [ x.length ]; +const strides = [ 1 ]; +const offsets = [ 0 ]; nullary.ndarray( [ x ], shape, strides, offsets, discreteUniform( -100, 100 ) ); console.log( x ); diff --git a/lib/node_modules/@stdlib/strided/base/offset-view/README.md b/lib/node_modules/@stdlib/strided/base/offset-view/README.md index 23cccbb81b29..31f32e60f6c1 100644 --- a/lib/node_modules/@stdlib/strided/base/offset-view/README.md +++ b/lib/node_modules/@stdlib/strided/base/offset-view/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var offsetView = require( '@stdlib/strided/base/offset-view' ); +const offsetView = require( '@stdlib/strided/base/offset-view' ); ``` #### offsetView( x, offset ) @@ -45,37 +45,37 @@ var offsetView = require( '@stdlib/strided/base/offset-view' ); Returns a typed array view having the same data type as a provided input typed array and starting at a specified index offset. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( 10 ); +const x = new Float64Array( 10 ); -var view = offsetView( x, 0 ); +const view = offsetView( x, 0 ); // returns -var bool = ( view.buffer === x.buffer ); +const bool = ( view.buffer === x.buffer ); // returns true -var len = view.length; +const len = view.length; // returns 10 ``` The `offset` argument specifies the starting index of the returned typed array view relative to the input array `x`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var view = offsetView( x, 2 ); +const view = offsetView( x, 2 ); // returns -var len = view.length; +const len = view.length; // returns 6 -var v1 = view[ 0 ]; +const v1 = view[ 0 ]; // returns 3.0 -var v2 = view[ 1 ]; +const v2 = view[ 1 ]; // returns 4.0 ``` @@ -100,15 +100,15 @@ var v2 = view[ 1 ]; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var offsetView = require( '@stdlib/strided/base/offset-view' ); +const Float64Array = require( '@stdlib/array/float64' ); +const offsetView = require( '@stdlib/strided/base/offset-view' ); // Define a typed array: -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // returns // Create a view of the array: -var view = offsetView( x, 0 ); +const view = offsetView( x, 0 ); // returns // Set view elements: @@ -116,10 +116,10 @@ view[ 0 ] = 9.0; view[ 1 ] = 10.0; // Get the first two elements of the original array: -var v0 = x[ 0 ]; +const v0 = x[ 0 ]; // returns 9.0 -var v1 = x[ 1 ]; +const v1 = x[ 1 ]; // returns 10.0 ``` diff --git a/lib/node_modules/@stdlib/strided/base/quaternary/README.md b/lib/node_modules/@stdlib/strided/base/quaternary/README.md index e722430aae3a..94d70d4f7746 100644 --- a/lib/node_modules/@stdlib/strided/base/quaternary/README.md +++ b/lib/node_modules/@stdlib/strided/base/quaternary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quaternary = require( '@stdlib/strided/base/quaternary' ); +const quaternary = require( '@stdlib/strided/base/quaternary' ); ``` #### quaternary( arrays, shape, strides, fcn ) @@ -41,14 +41,14 @@ var quaternary = require( '@stdlib/strided/base/quaternary' ); Applies a quaternary callback to strided input array elements and assigns results to elements in a strided output array. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quaternary( [ x, y, z, w, u ], [ x.length ], [ 1, 1, 1, 1, 1 ], add ); // u => [ 4.0, 8.0, 12.0, 16.0, 20.0 ] @@ -64,14 +64,14 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input arrays and to index the first `N` elements of the strided output array in reverse order, ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quaternary( [ x, y, z, w, u ], [ 3 ], [ 2, 2, 2, 2, -1 ], add ); // u => [ 20.0, 12.0, 4.0, 0.0, 0.0 ] @@ -80,22 +80,22 @@ quaternary( [ x, y, z, w, u ], [ 3 ], [ 2, 2, 2, 2, -1 ], add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var u0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const u0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var u1 = new Float64Array( u0.buffer, u0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const u1 = new Float64Array( u0.buffer, u0.BYTES_PER_ELEMENT*3 ); // start at 4th element quaternary( [ x1, y1, z1, w1, u1 ], [ 3 ], [ -2, -2, -2, -2, 1 ], add ); // u0 => [ 0.0, 0.0, 0.0, 24.0, 16.0, 8.0 ] @@ -108,14 +108,14 @@ Applies a quaternary callback to strided input array elements and assigns result ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quaternary.ndarray( [ x, y, z, w, u ], [ x.length ], [ 1, 1, 1, 1, 1 ], [ 0, 0, 0, 0, 0 ], add ); // u => [ 4.0, 8.0, 12.0, 16.0, 20.0 ] @@ -130,14 +130,14 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var add = require( '@stdlib/math/base/ops/add4' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const u = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quaternary.ndarray( [ x, y, z, w, u ], [ 3 ], [ 2, 2, 2, 2, -1 ], [ 1, 1, 1, 1, u.length-1 ], add ); // u => [ 0.0, 0.0, 0.0, 24.0, 16.0, 8.0 ] @@ -160,32 +160,32 @@ quaternary.ndarray( [ x, y, z, w, u ], [ 3 ], [ 2, 2, 2, 2, -1 ], [ 1, 1, 1, 1, ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add4' ); -var quaternary = require( '@stdlib/strided/base/quaternary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add4' ); +const quaternary = require( '@stdlib/strided/base/quaternary' ); -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( y ); -var z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( z ); -var w = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const w = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( w ); -var u = filledarray( 0.0, N, 'generic' ); +const u = filledarray( 0.0, N, 'generic' ); console.log( u ); -var shape = [ N ]; -var strides = [ 1, 1, 1, 1, -1 ]; -var offsets = [ 0, 0, 0, 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, 1, 1, 1, -1 ]; +const offsets = [ 0, 0, 0, 0, N-1 ]; quaternary.ndarray( [ x, y, z, w, u ], shape, strides, offsets, add ); console.log( u ); diff --git a/lib/node_modules/@stdlib/strided/base/quinary/README.md b/lib/node_modules/@stdlib/strided/base/quinary/README.md index 186b6dfb7645..d2bc824154f8 100644 --- a/lib/node_modules/@stdlib/strided/base/quinary/README.md +++ b/lib/node_modules/@stdlib/strided/base/quinary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var quinary = require( '@stdlib/strided/base/quinary' ); +const quinary = require( '@stdlib/strided/base/quinary' ); ``` #### quinary( arrays, shape, strides, fcn ) @@ -41,15 +41,15 @@ var quinary = require( '@stdlib/strided/base/quinary' ); Applies a quinary callback to strided input array elements and assigns results to elements in a strided output array. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quinary( [ x, y, z, w, u, v ], [ x.length ], [ 1, 1, 1, 1, 1, 1 ], add ); // v => [ 5.0, 10.0, 15.0, 20.0, 25.0 ] @@ -65,15 +65,15 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input arrays and to index the first `N` elements of the strided output array in reverse order, ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quinary( [ x, y, z, w, u, v ], [ 3 ], [ 2, 2, 2, 2, 2, -1 ], add ); // v => [ 25.0, 15.0, 5.0, 0.0, 0.0 ] @@ -82,24 +82,24 @@ quinary( [ x, y, z, w, u, v ], [ 3 ], [ 2, 2, 2, 2, 2, -1 ], add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var u0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var v0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const u0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const v0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var u1 = new Float64Array( u0.buffer, u0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v1 = new Float64Array( v0.buffer, v0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const u1 = new Float64Array( u0.buffer, u0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const v1 = new Float64Array( v0.buffer, v0.BYTES_PER_ELEMENT*3 ); // start at 4th element quinary( [ x1, y1, z1, w1, u1, v1 ], [ 3 ], [ -2, -2, -2, -2, -2, 1 ], add ); // v0 => [ 0.0, 0.0, 0.0, 30.0, 20.0, 10.0 ] @@ -112,15 +112,15 @@ Applies a quinary callback to strided input array elements and assigns results t ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quinary.ndarray( [ x, y, z, w, u, v ], [ x.length ], [ 1, 1, 1, 1, 1, 1 ], [ 0, 0, 0, 0, 0, 0 ], add ); // v => [ 5.0, 10.0, 15.0, 20.0, 25.0 ] @@ -135,15 +135,15 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var add = require( '@stdlib/math/base/ops/add5' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const u = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const v = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); quinary.ndarray( [ x, y, z, w, u, v ], [ 3 ], [ 2, 2, 2, 2, 2, -1 ], [ 1, 1, 1, 1, 1, v.length-1 ], add ); // v => [ 0.0, 0.0, 0.0, 30.0, 20.0, 10.0 ] @@ -166,35 +166,35 @@ quinary.ndarray( [ x, y, z, w, u, v ], [ 3 ], [ 2, 2, 2, 2, 2, -1 ], [ 1, 1, 1, ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add5' ); -var quinary = require( '@stdlib/strided/base/quinary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add5' ); +const quinary = require( '@stdlib/strided/base/quinary' ); -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( y ); -var z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( z ); -var w = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const w = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( w ); -var u = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const u = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( u ); -var v = filledarray( 0.0, N, 'generic' ); +const v = filledarray( 0.0, N, 'generic' ); console.log( v ); -var shape = [ N ]; -var strides = [ 1, 1, 1, 1, 1, -1 ]; -var offsets = [ 0, 0, 0, 0, 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, 1, 1, 1, 1, -1 ]; +const offsets = [ 0, 0, 0, 0, 0, N-1 ]; quinary.ndarray( [ x, y, z, w, u, v ], shape, strides, offsets, add ); console.log( v ); diff --git a/lib/node_modules/@stdlib/strided/base/read-dataview/README.md b/lib/node_modules/@stdlib/strided/base/read-dataview/README.md index f93c3a74c284..f6f52ed3857f 100644 --- a/lib/node_modules/@stdlib/strided/base/read-dataview/README.md +++ b/lib/node_modules/@stdlib/strided/base/read-dataview/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var readDataView = require( '@stdlib/strided/base/read-dataview' ); +const readDataView = require( '@stdlib/strided/base/read-dataview' ); ``` #### readDataView( N, view, strideView, out, strideOut, littleEndian ) @@ -43,17 +43,17 @@ var readDataView = require( '@stdlib/strided/base/read-dataview' ); Copies elements from an input strided [`DataView`][@stdlib/array/dataview] to elements in an output strided array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var view = new DataView( x.buffer ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const view = new DataView( x.buffer ); -var y = new Float64Array( x.length ); -var out = readDataView( x.length, view, 8, y, 1, true ); +const y = new Float64Array( x.length ); +const out = readDataView( x.length, view, 8, y, 1, true ); // e.g., returns [ 1.0, 2.0, 3.0, 4.0 ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -69,39 +69,39 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in `view` and `out` are accessed at runtime. For example, to index the first `N` elements of `view` in reverse order and to index every other value in `out` , ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var view = new DataView( x.buffer ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const view = new DataView( x.buffer ); -var y = new Float64Array( x.length*2 ); -var out = readDataView( x.length, view, -8, y, 2, true ); +const y = new Float64Array( x.length*2 ); +const out = readDataView( x.length, view, -8, y, 2, true ); // e.g., returns [ 4.0, 0.0, 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` Note that indexing is relative to the first index. To introduce an offset, use typed array views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var view = new DataView( x.buffer ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const view = new DataView( x.buffer ); // Initial output array: -var y0 = new Float64Array( x.length+1 ); +const y0 = new Float64Array( x.length+1 ); // Create an offset view: -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var out = readDataView( x.length, view, 8, y1, 1, true ); +const out = readDataView( x.length, view, 8, y1, 1, true ); // e.g., returns [ 1.0, 2.0, 3.0, 4.0 ] -var bool = ( out === y1 ); +const bool = ( out === y1 ); // returns true ``` @@ -110,17 +110,17 @@ var bool = ( out === y1 ); Copies elements from an input strided [`DataView`][@stdlib/array/dataview] to elements in an output strided array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var view = new DataView( x.buffer ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const view = new DataView( x.buffer ); -var y = new Float64Array( x.length ); -var out = readDataView.ndarray( x.length, view, 8, 0, y, 1, 0, true ); +const y = new Float64Array( x.length ); +const out = readDataView.ndarray( x.length, view, 8, 0, y, 1, 0, true ); // e.g., returns [ 1.0, 2.0, 3.0, 4.0 ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -132,17 +132,17 @@ The function accepts the following additional arguments: While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to index the last `N` elements in `view` in reverse order and to index every other value in `out` starting from the second value, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); -var view = new DataView( x.buffer ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +const view = new DataView( x.buffer ); -var y = new Float64Array( x.length*2 ); -var out = readDataView.ndarray( x.length, view, -8, 24, y, 2, 1, true ); +const y = new Float64Array( x.length*2 ); +const out = readDataView.ndarray( x.length, view, -8, 24, y, 2, 1, true ); // e.g., returns [ 0.0, 4.0, 0.0, 3.0, 0.0, 2.0, 0.0, 1.0 ] -var bool = ( out === y ); +const bool = ( out === y ); // returns true ``` @@ -163,30 +163,30 @@ var bool = ( out === y ); ```javascript -var DataView = require( '@stdlib/array/dataview' ); -var typedarray = require( '@stdlib/array/typed' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var logEach = require( '@stdlib/console/log-each' ); -var readDataView = require( '@stdlib/strided/base/read-dataview' ); +const DataView = require( '@stdlib/array/dataview' ); +const typedarray = require( '@stdlib/array/typed' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const logEach = require( '@stdlib/console/log-each' ); +const readDataView = require( '@stdlib/strided/base/read-dataview' ); // Specify the array data type: -var dtype = 'float64'; +const dtype = 'float64'; // Resolve the number of bytes per element: -var nbytes = bytesPerElement( dtype ); +const nbytes = bytesPerElement( dtype ); // Generate an array of random numbers: -var x = discreteUniform( 10, 0, 100, { +const x = discreteUniform( 10, 0, 100, { 'dtype': dtype }); // Create a DataView: -var view = new DataView( x.buffer ); +const view = new DataView( x.buffer ); // Create an output array: -var out = typedarray( x.length, dtype ); +const out = typedarray( x.length, dtype ); // Read elements from the DataView according to host byte order: readDataView( out.length, view, nbytes, out, 1, IS_LITTLE_ENDIAN ); diff --git a/lib/node_modules/@stdlib/strided/base/reinterpret-boolean/README.md b/lib/node_modules/@stdlib/strided/base/reinterpret-boolean/README.md index aa0203747772..93c16b57f4ff 100644 --- a/lib/node_modules/@stdlib/strided/base/reinterpret-boolean/README.md +++ b/lib/node_modules/@stdlib/strided/base/reinterpret-boolean/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' ); ``` #### reinterpret( x, offset ) @@ -45,34 +45,34 @@ var reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' ); Returns a [`Uint8Array`][@stdlib/array/uint8] view of a [`BooleanArray`][@stdlib/array/bool]. ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); -var x = new BooleanArray( 10 ); +const x = new BooleanArray( 10 ); -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns -var bool = ( view.buffer === x.buffer ); +const bool = ( view.buffer === x.buffer ); // returns true -var len = view.length; +const len = view.length; // returns 10 ``` The `offset` argument specifies the starting index of the returned [`Uint8Array`][@stdlib/array/uint8] view relative to the [`BooleanArray`][@stdlib/array/bool]. ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); +const BooleanArray = require( '@stdlib/array/bool' ); -var x = new BooleanArray( [ true, false, false, true, true, false ] ); +const x = new BooleanArray( [ true, false, false, true, true, false ] ); -var view = reinterpret( x, 2 ); +const view = reinterpret( x, 2 ); // returns -var len = view.length; +const len = view.length; // returns 4 -var v = view[ 0 ]; +let v = view[ 0 ]; // returns 0 v = view[ 1 ]; @@ -100,15 +100,15 @@ v = view[ 1 ]; ```javascript -var BooleanArray = require( '@stdlib/array/bool' ); -var reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' ); +const BooleanArray = require( '@stdlib/array/bool' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' ); // Define a boolean array: -var x = new BooleanArray( [ true, false, false, true, true, false ] ); +const x = new BooleanArray( [ true, false, false, true, true, false ] ); // returns // Reinterpret as a `uint8` array: -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns // Set view elements: @@ -116,7 +116,7 @@ view[ 0 ] = 0; view[ 1 ] = 1; // Get the first element of the boolean array: -var v = x.get( 0 ); +let v = x.get( 0 ); // returns false // Get the second element of the boolean array: diff --git a/lib/node_modules/@stdlib/strided/base/reinterpret-complex/README.md b/lib/node_modules/@stdlib/strided/base/reinterpret-complex/README.md index 985f78ff384b..036b03fae5d3 100644 --- a/lib/node_modules/@stdlib/strided/base/reinterpret-complex/README.md +++ b/lib/node_modules/@stdlib/strided/base/reinterpret-complex/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex' ); ``` #### reinterpret( x, offset ) @@ -45,37 +45,37 @@ var reinterpret = require( '@stdlib/strided/base/reinterpret-complex' ); Returns a real-valued floating-point array view of a complex-valued floating-point array. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( 10 ); +const x = new Complex128Array( 10 ); -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns -var bool = ( view.buffer === x.buffer ); +const bool = ( view.buffer === x.buffer ); // returns true -var len = view.length; +const len = view.length; // returns 20 ``` The `offset` argument specifies the starting index of the returned real-valued floating-point array view relative to the input array. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var view = reinterpret( x, 2 ); +const view = reinterpret( x, 2 ); // returns -var len = view.length; +const len = view.length; // returns 4 -var re = view[ 0 ]; +const re = view[ 0 ]; // returns 5.0 -var im = view[ 1 ]; +const im = view[ 1 ]; // returns 6.0 ``` @@ -100,17 +100,17 @@ var im = view[ 1 ]; ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex' ); // Define a complex number array: -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // returns // Reinterpret as a `float64` array: -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns // Set view elements: @@ -118,13 +118,13 @@ view[ 0 ] = 9.0; view[ 1 ] = 10.0; // Get the first element of the complex number array: -var z = x.get( 0 ); +const z = x.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 9.0 -var im = imag( z ); +const im = imag( z ); // returns 10.0 ``` diff --git a/lib/node_modules/@stdlib/strided/base/reinterpret-complex128/README.md b/lib/node_modules/@stdlib/strided/base/reinterpret-complex128/README.md index 60a58b9bc22f..3e3538502115 100644 --- a/lib/node_modules/@stdlib/strided/base/reinterpret-complex128/README.md +++ b/lib/node_modules/@stdlib/strided/base/reinterpret-complex128/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); ``` #### reinterpret( x, offset ) @@ -45,37 +45,37 @@ var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); Returns a [`Float64Array`][@stdlib/array/float64] view of a [`Complex128Array`][@stdlib/array/complex128]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( 10 ); +const x = new Complex128Array( 10 ); -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns -var bool = ( view.buffer === x.buffer ); +const bool = ( view.buffer === x.buffer ); // returns true -var len = view.length; +const len = view.length; // returns 20 ``` The `offset` argument specifies the starting index of the returned [`Float64Array`][@stdlib/array/float64] view relative to the [`Complex128Array`][@stdlib/array/complex128]. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var view = reinterpret( x, 2 ); +const view = reinterpret( x, 2 ); // returns -var len = view.length; +const len = view.length; // returns 4 -var re = view[ 0 ]; +const re = view[ 0 ]; // returns 5.0 -var im = view[ 1 ]; +const im = view[ 1 ]; // returns 6.0 ``` @@ -100,17 +100,17 @@ var im = view[ 1 ]; ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); // Define a complex number array: -var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // returns // Reinterpret as a `float64` array: -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns // Set view elements: @@ -118,13 +118,13 @@ view[ 0 ] = 9.0; view[ 1 ] = 10.0; // Get the first element of the complex number array: -var z = x.get( 0 ); +const z = x.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 9.0 -var im = imag( z ); +const im = imag( z ); // returns 10.0 ``` diff --git a/lib/node_modules/@stdlib/strided/base/reinterpret-complex64/README.md b/lib/node_modules/@stdlib/strided/base/reinterpret-complex64/README.md index 81c9a1356d4a..47abf59931de 100644 --- a/lib/node_modules/@stdlib/strided/base/reinterpret-complex64/README.md +++ b/lib/node_modules/@stdlib/strided/base/reinterpret-complex64/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); ``` #### reinterpret( x, offset ) @@ -45,37 +45,37 @@ var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); Returns a [`Float32Array`][@stdlib/array/float32] view of a [`Complex64Array`][@stdlib/array/complex64]. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var x = new Complex64Array( 10 ); +const x = new Complex64Array( 10 ); -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns -var bool = ( view.buffer === x.buffer ); +const bool = ( view.buffer === x.buffer ); // returns true -var len = view.length; +const len = view.length; // returns 20 ``` The `offset` argument specifies the starting index of the returned [`Float32Array`][@stdlib/array/float32] view relative to the [`Complex64Array`][@stdlib/array/complex64]. ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var view = reinterpret( x, 2 ); +const view = reinterpret( x, 2 ); // returns -var len = view.length; +const len = view.length; // returns 4 -var re = view[ 0 ]; +const re = view[ 0 ]; // returns 5.0 -var im = view[ 1 ]; +const im = view[ 1 ]; // returns 6.0 ``` @@ -100,17 +100,17 @@ var im = view[ 1 ]; ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); // Define a complex number array: -var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // returns // Reinterpret as a `float32` array: -var view = reinterpret( x, 0 ); +const view = reinterpret( x, 0 ); // returns // Set view elements: @@ -118,13 +118,13 @@ view[ 0 ] = 9.0; view[ 1 ] = 10.0; // Get the first element of the complex number array: -var z = x.get( 0 ); +const z = x.get( 0 ); // returns -var re = real( z ); +const re = real( z ); // returns 9.0 -var im = imag( z ); +const im = imag( z ); // returns 10.0 ``` diff --git a/lib/node_modules/@stdlib/strided/base/smap/README.md b/lib/node_modules/@stdlib/strided/base/smap/README.md index 448cbc549d4d..bd0501553149 100644 --- a/lib/node_modules/@stdlib/strided/base/smap/README.md +++ b/lib/node_modules/@stdlib/strided/base/smap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var smap = require( '@stdlib/strided/base/smap' ); +const smap = require( '@stdlib/strided/base/smap' ); ``` #### smap( N, x, strideX, y, strideY, fcn ) @@ -41,10 +41,10 @@ var smap = require( '@stdlib/strided/base/smap' ); Applies a unary function to a single-precision floating-point strided input array and assigns results to a single-precision floating-point strided output array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: smap( x.length, x, 1, x, 1, absf ); @@ -63,11 +63,11 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap( 3, x, 2, y, -1, absf ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,16 +76,16 @@ smap( 3, x, 2, y, -1, absf ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const absf = require( '@stdlib/math/base/special/absf' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smap( 3, x1, -2, y1, 1, absf ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -96,11 +96,11 @@ smap( 3, x1, -2, y1, 1, absf ); Applies a unary function to a single-precision floating-point strided input array and assigns results to a single-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap.ndarray( x.length, x, 1, 0, y, 1, 0, absf ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -114,11 +114,11 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap.ndarray( 3, x, 2, 1, y, -1, y.length-1, absf ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -141,20 +141,19 @@ smap.ndarray( 3, x, 2, 1, y, -1, y.length-1, absf ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); -var smap = require( '@stdlib/strided/base/smap' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const Float32Array = require( '@stdlib/array/float32' ); +const smap = require( '@stdlib/strided/base/smap' ); function scale( x ) { return x * 10.0; } -var x = new Float32Array( 10 ); -var y = new Float32Array( 10 ); +const x = new Float32Array( 10 ); +const y = new Float32Array( 10 ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); } console.log( x ); diff --git a/lib/node_modules/@stdlib/strided/base/smap2/README.md b/lib/node_modules/@stdlib/strided/base/smap2/README.md index 3d3559be605d..1c7eec542f60 100644 --- a/lib/node_modules/@stdlib/strided/base/smap2/README.md +++ b/lib/node_modules/@stdlib/strided/base/smap2/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var smap2 = require( '@stdlib/strided/base/smap2' ); +const smap2 = require( '@stdlib/strided/base/smap2' ); ``` #### smap2( N, x, strideX, y, strideY, z, strideZ, fcn ) @@ -43,12 +43,12 @@ var smap2 = require( '@stdlib/strided/base/smap2' ); Applies a binary function to single-precision floating-point strided input arrays and assigns results to a single-precision floating-point strided output array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = new Float32Array( [ 2.0, 1.0, 3.0, -2.0, 4.0, 1.0, -1.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const y = new Float32Array( [ 2.0, 1.0, 3.0, -2.0, 4.0, 1.0, -1.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap2( x.length, x, 1, y, 1, z, 1, addf ); // z => [ 0.0, 2.0, 6.0, -7.0, 8.0, 1.0, -2.0, 0.0 ] @@ -68,12 +68,12 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which strided array elements are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap2( 3, x, 2, y, -1, z, 1, addf ); // z => [ 1.0, -2.0, -4.0, 0.0, 0.0, 0.0 ] @@ -82,18 +82,18 @@ smap2( 3, x, 2, y, -1, z, 1, addf ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float32Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float32Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element smap2( 3, x1, -2, y1, 1, z1, 1, addf ); // z0 => [ 0.0, 0.0, -4.0, -1.0, 1.0, 0.0 ] @@ -104,12 +104,12 @@ smap2( 3, x1, -2, y1, 1, z1, 1, addf ); Applies a binary function to single-precision floating-point strided input arrays and assigns results to a single-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap2.ndarray( x.length, x, 1, 0, y, 1, 0, z, 1, 0, addf ); // z => [ 0.0, -1.0, -1.0, -2.0, -2.0 ] @@ -124,12 +124,12 @@ The function accepts the following addfitional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, addf ); // z => [ 0.0, 0.0, 0.0, 1.0, -1.0, -4.0 ] @@ -152,19 +152,19 @@ smap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, z, 1, 3, addf ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Float32Array = require( '@stdlib/array/float32' ); -var addf = require( '@stdlib/math/base/ops/addf' ); -var smap2 = require( '@stdlib/strided/base/smap2' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Float32Array = require( '@stdlib/array/float32' ); +const addf = require( '@stdlib/math/base/ops/addf' ); +const smap2 = require( '@stdlib/strided/base/smap2' ); -var x = filledarrayBy( 10, 'float32', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( 10, 'float32', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float32', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( x.length, 'float32', discreteUniform( -100, 100 ) ); console.log( y ); -var z = new Float32Array( x.length ); +const z = new Float32Array( x.length ); console.log( z ); smap2.ndarray( x.length, x, 1, 0, y, -1, y.length-1, z, 1, 0, addf ); diff --git a/lib/node_modules/@stdlib/strided/base/smskmap/README.md b/lib/node_modules/@stdlib/strided/base/smskmap/README.md index 089154b8d3f0..f66ddbd2f42a 100644 --- a/lib/node_modules/@stdlib/strided/base/smskmap/README.md +++ b/lib/node_modules/@stdlib/strided/base/smskmap/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var smskmap = require( '@stdlib/strided/base/smskmap' ); +const smskmap = require( '@stdlib/strided/base/smskmap' ); ``` #### smskmap( N, x, strideX, mask, strideMask, y, strideY, fcn ) @@ -43,12 +43,12 @@ var smskmap = require( '@stdlib/strided/base/smskmap' ); Applies a unary function to a single-precision floating-point strided input array according to a strided mask array and assigns results to a single-precision floating-point strided output array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); // Compute the absolute values in-place: smskmap( x.length, x, 1, m, 1, x, 1, absf ); @@ -69,13 +69,13 @@ The function accepts the following arguments: The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskmap( 3, x, 2, m, 2, y, -1, absf ); // y => [ 5.0, 0.0, 1.0, 0.0, 0.0, 0.0 ] @@ -84,19 +84,19 @@ smskmap( 3, x, 2, m, 2, y, -1, absf ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const absf = require( '@stdlib/math/base/special/absf' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskmap( 3, x1, -2, m1, 1, y1, 1, absf ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 0.0 ] @@ -107,13 +107,13 @@ smskmap( 3, x1, -2, m1, 1, y1, 1, absf ); Applies a unary function to a single-precision floating-point strided input array according to a strided mask array and assigns results to a single-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskmap.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0, absf ); // y => [ 1.0, 2.0, 0.0, 4.0, 5.0 ] @@ -128,13 +128,13 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var absf = require( '@stdlib/math/base/special/absf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const absf = require( '@stdlib/math/base/special/absf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); -var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); smskmap.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1, absf ); // y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0 ] @@ -157,23 +157,22 @@ smskmap.ndarray( 3, x, 2, 1, m, 2, 1, y, -1, y.length-1, absf ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var bernoulli = require( '@stdlib/random/base/bernoulli' ); -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var smskmap = require( '@stdlib/strided/base/smskmap' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const bernoulli = require( '@stdlib/random/base/bernoulli' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const smskmap = require( '@stdlib/strided/base/smskmap' ); function scale( x ) { return x * 10.0; } -var x = new Float32Array( 10 ); -var m = new Uint8Array( x.length ); -var y = new Float32Array( x.length ); +const x = new Float32Array( 10 ); +const m = new Uint8Array( x.length ); +const y = new Float32Array( x.length ); -var i; -for ( i = 0; i < x.length; i++ ) { +for ( let i = 0; i < x.length; i++ ) { x[ i ] = round( (randu()*200.0) - 100.0 ); m[ i ] = bernoulli( 0.2 ); } diff --git a/lib/node_modules/@stdlib/strided/base/smskmap2/README.md b/lib/node_modules/@stdlib/strided/base/smskmap2/README.md index a483e8e54e11..8874387ac625 100644 --- a/lib/node_modules/@stdlib/strided/base/smskmap2/README.md +++ b/lib/node_modules/@stdlib/strided/base/smskmap2/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var smskmap2 = require( '@stdlib/strided/base/smskmap2' ); +const smskmap2 = require( '@stdlib/strided/base/smskmap2' ); ``` #### smskmap2( N, x, strideX, y, strideY, mask, strideMask, z, strideZ, fcn ) @@ -43,14 +43,14 @@ var smskmap2 = require( '@stdlib/strided/base/smskmap2' ); Applies a binary function to single-precision floating-point strided input arrays according to a strided mask array and assigns results to a single-precision floating-point strided output array. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var z = new Float32Array( x.length ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); +const x = new Float32Array( [ -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const y = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +const z = new Float32Array( x.length ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1, 1, 0 ] ); smskmap2( x.length, x, 1, y, 1, m, 1, z, 1, addf ); // z => [ -1.0, 3.0, 0.0, -1.0, 9.0, 0.0, 0.0, 5.0 ] @@ -72,14 +72,14 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); smskmap2( 3, x, 2, y, -1, m, 2, z, 1, addf ); // z => [ 1.0, 0.0, -4.0, 0.0, 0.0, 0.0 ] @@ -88,21 +88,21 @@ smskmap2( 3, x, 2, y, -1, m, 2, z, 1, addf ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/float32] views. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const addf = require( '@stdlib/math/base/ops/addf' ); // Initial arrays... -var x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x0 = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m0 = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); // Create offset views... -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var z1 = new Float32Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -var m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const z1 = new Float32Array( z0.buffer, z0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const m1 = new Uint8Array( m0.buffer, m0.BYTES_PER_ELEMENT*3 ); // start at 4th element smskmap2( 3, x1, -2, y1, 1, m1, 1, z1, 1, addf ); // z0 => [ 0.0, 0.0, -4.0, -1.0, 0.0, 0.0 ] @@ -113,14 +113,14 @@ smskmap2( 3, x1, -2, y1, 1, m1, 1, z1, 1, addf ); Applies a binary function to single-precision floating-point strided input arrays according to a strided mask array and assigns results to a single-precision floating-point strided output array using alternative indexing semantics. ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0 ] ); smskmap2.ndarray( x.length, x, 1, 0, y, 1, 0, m, 1, 0, z, 1, 0, addf ); // z => [ 0.0, -1.0, 0.0, -2.0, -2.0 ] @@ -136,14 +136,14 @@ The function accepts the following addfitional arguments: While [`typed array`][@stdlib/array/float32] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var addf = require( '@stdlib/math/base/ops/addf' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const addf = require( '@stdlib/math/base/ops/addf' ); -var x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); +const x = new Float32Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +const z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const m = new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ); smskmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, m, 2, 1, z, 1, 0, addf ); // z => [ 1.0, -1.0, 0.0, 0.0, 0.0, 0.0 ] @@ -168,23 +168,23 @@ smskmap2.ndarray( 3, x, 2, 1, y, -1, y.length-1, m, 2, 1, z, 1, 0, addf ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; -var Float32Array = require( '@stdlib/array/float32' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var addf = require( '@stdlib/math/base/ops/addf' ); -var smskmap2 = require( '@stdlib/strided/base/smskmap2' ); - -var x = filledarrayBy( 10, 'float32', discreteUniform( -100, 100 ) ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; +const Float32Array = require( '@stdlib/array/float32' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const addf = require( '@stdlib/math/base/ops/addf' ); +const smskmap2 = require( '@stdlib/strided/base/smskmap2' ); + +const x = filledarrayBy( 10, 'float32', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( x.length, 'float32', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( x.length, 'float32', discreteUniform( -100, 100 ) ); console.log( y ); -var m = filledarrayBy( x.length, 'uint8', bernoulli( 0.2 ) ); +const m = filledarrayBy( x.length, 'uint8', bernoulli( 0.2 ) ); console.log( m ); -var z = new Float32Array( x.length ); +const z = new Float32Array( x.length ); console.log( z ); smskmap2.ndarray( x.length, x, 1, 0, y, -1, y.length-1, m, 1, 0, z, 1, 0, addf ); diff --git a/lib/node_modules/@stdlib/strided/base/stride2offset/README.md b/lib/node_modules/@stdlib/strided/base/stride2offset/README.md index 53e18078d071..11b7d2296a2a 100644 --- a/lib/node_modules/@stdlib/strided/base/stride2offset/README.md +++ b/lib/node_modules/@stdlib/strided/base/stride2offset/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +const stride2offset = require( '@stdlib/strided/base/stride2offset' ); ``` #### stride2offset( N, stride ) @@ -45,7 +45,7 @@ var stride2offset = require( '@stdlib/strided/base/stride2offset' ); Returns the index offset which specifies the location of the first indexed value in a strided array. ```javascript -var offset = stride2offset( 10, 10 ); +let offset = stride2offset( 10, 10 ); // returns 0 offset = stride2offset( 10, -10 ); @@ -73,29 +73,28 @@ offset = stride2offset( 10, -10 ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const stride2offset = require( '@stdlib/strided/base/stride2offset' ); -var opts = { +const opts = { 'dtype': 'generic' }; // Define the number of indexed elements: -var N = 100; +const N = 100; // Define a maximum stride length: -var maxStride = 10; +const maxStride = 10; // Create an array of random integers which can accommodate the maximum stride length: -var arr = discreteUniform( N*maxStride, 0, 255, opts ); +const arr = discreteUniform( N*maxStride, 0, 255, opts ); // Generate random stride lengths: -var strides = discreteUniform( 10, -maxStride, maxStride, opts ); +const strides = discreteUniform( 10, -maxStride, maxStride, opts ); // Resolve values in the data array for the first indexed element based on various stride lengths... -var offset; -var i; -for ( i = 0; i < strides.length; i++ ) { +let offset; +for ( let i = 0; i < strides.length; i++ ) { offset = stride2offset( N, strides[ i ] ); console.log( 'stride = %d. arr[%d] = %d.', strides[ i ], offset, arr[ offset ] ); } diff --git a/lib/node_modules/@stdlib/strided/base/strided2object/README.md b/lib/node_modules/@stdlib/strided/base/strided2object/README.md index aac305c99230..b6e1cc11bd42 100644 --- a/lib/node_modules/@stdlib/strided/base/strided2object/README.md +++ b/lib/node_modules/@stdlib/strided/base/strided2object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strided2object = require( '@stdlib/strided/base/strided2object' ); +const strided2object = require( '@stdlib/strided/base/strided2object' ); ``` #### strided2object( N, x, stride, offset ) @@ -45,7 +45,7 @@ var strided2object = require( '@stdlib/strided/base/strided2object' ); Converts a strided array and associated metadata to an object likely to have the same "shape". ```javascript -var obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); +const obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); // returns {...} ``` @@ -95,14 +95,14 @@ var obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var strided2object = require( '@stdlib/strided/base/strided2object' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const strided2object = require( '@stdlib/strided/base/strided2object' ); // Create an array: -var x = new Complex64Array( 10 ); +const x = new Complex64Array( 10 ); // Convert to a standardized object: -var obj = strided2object( x.length, x, 1, 0 ); +const obj = strided2object( x.length, x, 1, 0 ); // returns {...} console.log( obj ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/README.md b/lib/node_modules/@stdlib/strided/base/ternary/README.md index c209031cf9e1..2f7426a7e360 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/README.md +++ b/lib/node_modules/@stdlib/strided/base/ternary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var ternary = require( '@stdlib/strided/base/ternary' ); +const ternary = require( '@stdlib/strided/base/ternary' ); ``` #### ternary( arrays, shape, strides, fcn ) @@ -41,13 +41,13 @@ var ternary = require( '@stdlib/strided/base/ternary' ); Applies a ternary callback to strided input array elements and assigns results to elements in a strided output array. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ternary( [ x, y, z, w ], [ x.length ], [ 1, 1, 1, 1 ], add ); // w => [ 3.0, 6.0, 9.0, 12.0, 15.0 ] @@ -63,13 +63,13 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input arrays and to index the first `N` elements of the strided output array in reverse order, ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ternary( [ x, y, z, w ], [ 3 ], [ 2, 2, 2, -1 ], add ); // w => [ 15.0, 9.0, 3.0, 0.0, 0.0 ] @@ -78,20 +78,20 @@ ternary( [ x, y, z, w ], [ 3 ], [ 2, 2, 2, -1 ], add ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const z1 = new Float64Array( z0.buffer, z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const w1 = new Float64Array( w0.buffer, w0.BYTES_PER_ELEMENT*3 ); // start at 4th element ternary( [ x1, y1, z1, w1 ], [ 3 ], [ -2, -2, -2, 1 ], add ); // w0 => [ 0.0, 0.0, 0.0, 18.0, 12.0, 6.0 ] @@ -104,13 +104,13 @@ Applies a ternary callback to strided input array elements and assigns results t ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); -var w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +const w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ternary.ndarray( [ x, y, z, w ], [ x.length ], [ 1, 1, 1, 1 ], [ 0, 0, 0, 0 ], add ); // w => [ 3.0, 6.0, 9.0, 12.0, 15.0 ] @@ -125,13 +125,13 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript -var add = require( '@stdlib/math/base/ops/add3' ); -var Float64Array = require( '@stdlib/array/float64' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const Float64Array = require( '@stdlib/array/float64' ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const z = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const w = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ternary.ndarray( [ x, y, z, w ], [ 3 ], [ 2, 2, 2, -1 ], [ 1, 1, 1, w.length-1 ], add ); // w => [ 0.0, 0.0, 0.0, 18.0, 12.0, 6.0 ] @@ -154,29 +154,29 @@ ternary.ndarray( [ x, y, z, w ], [ 3 ], [ 2, 2, 2, -1 ], [ 1, 1, 1, w.length-1 ] ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add3' ); -var ternary = require( '@stdlib/strided/base/ternary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add3' ); +const ternary = require( '@stdlib/strided/base/ternary' ); -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const y = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( y ); -var z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const z = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( z ); -var w = filledarray( 0.0, N, 'generic' ); +const w = filledarray( 0.0, N, 'generic' ); console.log( w ); -var shape = [ N ]; -var strides = [ 1, 1, 1, -1 ]; -var offsets = [ 0, 0, 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, 1, 1, -1 ]; +const offsets = [ 0, 0, 0, N-1 ]; ternary.ndarray( [ x, y, z, w ], shape, strides, offsets, add ); console.log( w ); diff --git a/lib/node_modules/@stdlib/strided/base/unary-addon-dispatch/README.md b/lib/node_modules/@stdlib/strided/base/unary-addon-dispatch/README.md index 95820bff8200..779917d2bba2 100644 --- a/lib/node_modules/@stdlib/strided/base/unary-addon-dispatch/README.md +++ b/lib/node_modules/@stdlib/strided/base/unary-addon-dispatch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/strided/base/unary-addon-dispatch' ); +const dispatch = require( '@stdlib/strided/base/unary-addon-dispatch' ); ``` #### dispatch( addon, fallback ) @@ -54,7 +54,7 @@ function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY ) { } // Create a dispatch function: -var f = dispatch( addon, fallback ); +const f = dispatch( addon, fallback ); // ... @@ -126,7 +126,7 @@ function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY ) } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // ... @@ -213,8 +213,8 @@ where ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var dispatch = require( '@stdlib/strided/base/unary-addon-dispatch' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatch = require( '@stdlib/strided/base/unary-addon-dispatch' ); function addon( N, dtypeX, x, strideX, dtypeY, y, strideY ) { console.log( x ); @@ -233,11 +233,11 @@ function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY ) } // Create a dispatch function: -var f = dispatch.ndarray( addon, fallback ); +const f = dispatch.ndarray( addon, fallback ); // Create strided arrays: -var x = new Float64Array( [ 1, 2, 3, 4 ] ); -var y = new Float64Array( [ 5, 6, 7, 8 ] ); +let x = new Float64Array( [ 1, 2, 3, 4 ] ); +let y = new Float64Array( [ 5, 6, 7, 8 ] ); // Dispatch to the add-on function: f( 2, 'float64', x, 1, 2, 'float64', y, 1, 2 ); diff --git a/lib/node_modules/@stdlib/strided/base/unary-by/README.md b/lib/node_modules/@stdlib/strided/base/unary-by/README.md index bc51f15bcf95..ca9ea83d05ee 100644 --- a/lib/node_modules/@stdlib/strided/base/unary-by/README.md +++ b/lib/node_modules/@stdlib/strided/base/unary-by/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var unaryBy = require( '@stdlib/strided/base/unary-by' ); +const unaryBy = require( '@stdlib/strided/base/unary-by' ); ``` #### unaryBy( arrays, shape, strides, fcn, clbk\[, thisArg] ) @@ -43,14 +43,14 @@ var unaryBy = require( '@stdlib/strided/base/unary-by' ); Applies a unary function to each element retrieved from a strided input array according to a callback function and assigns results to a strided output array. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy( [ x, y ], [ x.length ], [ 1, 1 ], abs, accessor ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] @@ -75,38 +75,38 @@ The invoked callback function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { this.count += 1; return v * 2.0; } -var context = { +const context = { 'count': 0 }; -var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy( [ x, y ], [ x.length ], [ 1, 1 ], abs, accessor, context ); // y => [ 4.0, 2.0, 6.0, 10.0, 8.0, 0.0, 2.0, 6.0 ] -var cnt = context.count; +const cnt = context.count; // returns 8 ``` The `shape` and `stride` parameters determine which elements in the input and output strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy( [ x, y ], [ 3 ], [ 2, -1 ], abs, accessor ); // y => [ 10.0, 6.0, 2.0, 0.0, 0.0, 0.0 ] @@ -115,20 +115,20 @@ unaryBy( [ x, y ], [ 3 ], [ 2, -1 ], abs, accessor ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element unaryBy( [ x1, y1 ], [ 3 ], [ -2, 1 ], abs, accessor ); // y0 => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -139,14 +139,14 @@ unaryBy( [ x1, y1 ], [ 3 ], [ -2, 1 ], abs, accessor ); Applies a unary function to each element retrieved from a strided input array according to a callback function and assigns results to a strided output array using alternative indexing semantics. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy.ndarray( [ x, y ], [ x.length ], [ 1, 1 ], [ 0, 0 ], abs, accessor ); // y => [ 2.0, 4.0, 6.0, 8.0, 10.0 ] @@ -159,14 +159,14 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsets` parameter supports indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function accessor( v ) { return v * 2.0; } -var x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; -var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; +const x = [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ]; +const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy.ndarray( [ x, y ], [ 3 ], [ 2, -1 ], [ 1, y.length-1 ], abs, accessor ); // y => [ 0.0, 0.0, 0.0, 12.0, 8.0, 4.0 ] @@ -183,14 +183,14 @@ unaryBy.ndarray( [ x, y ], [ 3 ], [ 2, -1 ], [ 1, y.length-1 ], abs, accessor ); - If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is **ignored**. ```javascript - var abs = require( '@stdlib/math/base/special/abs' ); + const abs = require( '@stdlib/math/base/special/abs' ); function accessor() { // No-op... } - var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; - var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + const x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ]; + const y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; unaryBy( [ x, y ], [ x.length ], [ 1, 1 ], abs, accessor ); // y => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] @@ -207,11 +207,11 @@ unaryBy.ndarray( [ x, y ], [ 3 ], [ 2, -1 ], [ 1, y.length-1 ], abs, accessor ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var unaryBy = require( '@stdlib/strided/base/unary-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const unaryBy = require( '@stdlib/strided/base/unary-by' ); function accessor( v, i ) { if ( (i%3) === 0 ) { @@ -221,17 +221,17 @@ function accessor( v, i ) { return v; } -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarray( null, N, 'generic' ); +const y = filledarray( null, N, 'generic' ); console.log( y ); -var shape = [ N ]; -var strides = [ 1, -1 ]; -var offsets = [ 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, -1 ]; +const offsets = [ 0, N-1 ]; unaryBy.ndarray( [ x, y ], shape, strides, offsets, abs, accessor ); console.log( y ); diff --git a/lib/node_modules/@stdlib/strided/base/unary-dtype-signatures/README.md b/lib/node_modules/@stdlib/strided/base/unary-dtype-signatures/README.md index d719adefb50a..fc7d5b670de2 100644 --- a/lib/node_modules/@stdlib/strided/base/unary-dtype-signatures/README.md +++ b/lib/node_modules/@stdlib/strided/base/unary-dtype-signatures/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); +const signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); ``` #### signatures( dtypes1, dtypes2\[, options] ) @@ -45,14 +45,14 @@ var signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); Generates a list of unary interface signatures from strided array [data types][@stdlib/strided/dtypes]. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes ); // e.g., returns [ 'float32', 'float32', ... ] ``` @@ -69,17 +69,17 @@ The function accepts the following options: When the `enums` options is `false`, the function returns an array of [data type][@stdlib/strided/dtypes] strings. To return [data type][@stdlib/strided/dtypes] enumeration constants, set the `enums` option to `true`. ```javascript -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var options = { +const options = { 'enums': true }; -var sigs = signatures( dtypes, dtypes, options ); +const sigs = signatures( dtypes, dtypes, options ); // returns [...] ``` @@ -110,18 +110,18 @@ var sigs = signatures( dtypes, dtypes, options ); ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var replace = require( '@stdlib/string/replace' ); -var signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const replace = require( '@stdlib/string/replace' ); +const signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate unary interface signatures: -var sigs = signatures( dt, dt ); +const sigs = signatures( dt, dt ); // Format the output: -var str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+"),/g, '$1,\n' ); +const str = replace( JSON.stringify( sigs ), /("[^"]+","[^"]+"),/g, '$1,\n' ); console.log( str ); ``` diff --git a/lib/node_modules/@stdlib/strided/base/unary-signature-callbacks/README.md b/lib/node_modules/@stdlib/strided/base/unary-signature-callbacks/README.md index f9509eaee28d..5d3e70124619 100644 --- a/lib/node_modules/@stdlib/strided/base/unary-signature-callbacks/README.md +++ b/lib/node_modules/@stdlib/strided/base/unary-signature-callbacks/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var callbacks = require( '@stdlib/strided/base/unary-signature-callbacks' ); +const callbacks = require( '@stdlib/strided/base/unary-signature-callbacks' ); ``` #### callbacks( table, signatures ) @@ -45,28 +45,28 @@ var callbacks = require( '@stdlib/strided/base/unary-signature-callbacks' ); Assigns callbacks to unary interfaces according to type [promotion rules][@stdlib/ndarray/promotion-rules]. ```javascript -var signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); -var identity = require( '@stdlib/math/base/special/identity' ); -var cidentity = require( '@stdlib/math/base/special/cidentity' ); -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); +const signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); +const identity = require( '@stdlib/math/base/special/identity' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int32', 'uint8' ]; -var sigs = signatures( dtypes, dtypes ); +const sigs = signatures( dtypes, dtypes ); // returns [...] -var table = { +const table = { 'default': identity, 'complex64': cidentityf, 'complex128': cidentity }; -var list = callbacks( table, sigs ); +const list = callbacks( table, sigs ); // returns [...] ``` @@ -110,28 +110,28 @@ A callback `table` should have the following properties: ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); -var signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); -var identity = require( '@stdlib/math/base/special/identity' ); -var cidentity = require( '@stdlib/math/base/special/cidentity' ); -var cidentityf = require( '@stdlib/math/base/special/cidentityf' ); -var callbacks = require( '@stdlib/strided/base/unary-signature-callbacks' ); +const dtypes = require( '@stdlib/strided/dtypes' ); +const signatures = require( '@stdlib/strided/base/unary-dtype-signatures' ); +const identity = require( '@stdlib/math/base/special/identity' ); +const cidentity = require( '@stdlib/math/base/special/cidentity' ); +const cidentityf = require( '@stdlib/math/base/special/cidentityf' ); +const callbacks = require( '@stdlib/strided/base/unary-signature-callbacks' ); // Get the list of supported strided array data types: -var dt = dtypes(); +const dt = dtypes(); // Generate unary interface signatures: -var sigs = signatures( dt, dt ); +const sigs = signatures( dt, dt ); // Define a callback table: -var table = { +const table = { 'default': identity, 'complex64': cidentityf, 'complex128': cidentity }; // Generate a list of callbacks according to type promotion rules: -var clbks = callbacks( table, sigs ); +const clbks = callbacks( table, sigs ); // returns [...] ``` diff --git a/lib/node_modules/@stdlib/strided/base/unary/README.md b/lib/node_modules/@stdlib/strided/base/unary/README.md index d8a0778cd500..62d0a0ff8d9c 100644 --- a/lib/node_modules/@stdlib/strided/base/unary/README.md +++ b/lib/node_modules/@stdlib/strided/base/unary/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unary = require( '@stdlib/strided/base/unary' ); +const unary = require( '@stdlib/strided/base/unary' ); ``` #### unary( arrays, shape, strides, fcn ) @@ -41,10 +41,10 @@ var unary = require( '@stdlib/strided/base/unary' ); Applies a unary callback to elements in a strided input array and assigns results to elements in a strided output array. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +const x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); // Compute the absolute values in-place: unary( [ x, x ], [ x.length ], [ 1, 1 ], abs ); @@ -61,13 +61,13 @@ The function accepts the following arguments: The `shape` and `strides` parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input array and to index the first `N` elements of the strided output array in reverse order, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = 3; +const N = 3; unary( [ x, y ], [ N ], [ 2, -1 ], abs ); // y => [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] @@ -76,18 +76,18 @@ unary( [ x, y ], [ N ], [ 2, -1 ], abs ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); // Initial arrays... -var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element +const x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = 3; +const N = 3; unary( [ x1, y1 ], [ N ], [ -2, 1 ], abs ); // y0 => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -98,11 +98,11 @@ unary( [ x1, y1 ], [ N ], [ -2, 1 ], abs ); Applies a unary callback to elements in a strided input array and assigns results to elements in a strided output array using alternative indexing semantics. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); unary.ndarray( [ x, y ], [ x.length ], [ 1, 1 ], [ 0, 0 ], abs ); // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -115,13 +115,13 @@ The function accepts the following additional arguments: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsets` parameter supports indexing semantics based on starting indices. For example, to index every other value in the strided input array starting from the second value and to index the last `N` elements in the strided output array, ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); -var N = 3; +const N = 3; unary.ndarray( [ x, y ], [ N ], [ 2, -1 ], [ 1, y.length-1 ], abs ); // y => [ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ] @@ -144,26 +144,26 @@ unary.ndarray( [ x, y ], [ N ], [ 2, -1 ], [ 1, y.length-1 ], abs ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var filledarray = require( '@stdlib/array/filled' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var unary = require( '@stdlib/strided/base/unary' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const filledarray = require( '@stdlib/array/filled' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const unary = require( '@stdlib/strided/base/unary' ); function add10( x ) { return x + 10; } -var N = 10; +const N = 10; -var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); +const x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); console.log( x ); -var y = filledarray( 0.0, N, 'generic' ); +const y = filledarray( 0.0, N, 'generic' ); console.log( y ); -var shape = [ N ]; -var strides = [ 1, -1 ]; -var offsets = [ 0, N-1 ]; +const shape = [ N ]; +const strides = [ 1, -1 ]; +const offsets = [ 0, N-1 ]; unary.ndarray( [ x, y ], shape, strides, offsets, add10 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/strided/base/write-dataview/README.md b/lib/node_modules/@stdlib/strided/base/write-dataview/README.md index 17be5ad6004b..e6d1dafd0661 100644 --- a/lib/node_modules/@stdlib/strided/base/write-dataview/README.md +++ b/lib/node_modules/@stdlib/strided/base/write-dataview/README.md @@ -35,7 +35,7 @@ limitations under the License. ## Usage ```javascript -var writeDataView = require( '@stdlib/strided/base/write-dataview' ); +const writeDataView = require( '@stdlib/strided/base/write-dataview' ); ``` #### writeDataView( N, x, strideX, view, strideView, littleEndian ) @@ -43,21 +43,21 @@ var writeDataView = require( '@stdlib/strided/base/write-dataview' ); Copies elements from an input strided array to elements in a strided [`DataView`][@stdlib/array/dataview]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = [ 1.0, 2.0, 3.0, 4.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0 ]; -var buf = new ArrayBuffer( 32 ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( 32 ); +const view = new DataView( buf ); -var out = writeDataView( 4, x, 1, view, 8, true ); +const out = writeDataView( 4, x, 1, view, 8, true ); // returns -var bool = ( out === view ); +const bool = ( out === view ); // returns true -var v = view.getFloat64( 0, true ); +let v = view.getFloat64( 0, true ); // returns 1.0 v = view.getFloat64( 8, true ); @@ -76,21 +76,21 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in `x` and `view` are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `view` in reverse order, ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]; +const x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]; -var buf = new ArrayBuffer( 64 ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( 64 ); +const view = new DataView( buf ); -var out = writeDataView( 4, x, 2, view, -8, true ); +const out = writeDataView( 4, x, 2, view, -8, true ); // returns -var bool = ( out === view ); +const bool = ( out === view ); // returns true -var v = view.getFloat64( 0, true ); +let v = view.getFloat64( 0, true ); // returns 4.0 v = view.getFloat64( 8, true ); @@ -100,27 +100,27 @@ v = view.getFloat64( 8, true ); Note that indexing is relative to the first index. To introduce an offset, use typed array views. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); -var Float32Array = require( '@stdlib/array/float32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); +const Float32Array = require( '@stdlib/array/float32' ); // Initial array: -var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +const x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); // Create an offset view: -var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Create an output DataView: -var buf = new ArrayBuffer( 64 ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( 64 ); +const view = new DataView( buf ); -var out = writeDataView( 4, x1, 1, view, 8, true ); +const out = writeDataView( 4, x1, 1, view, 8, true ); // returns -var bool = ( out === view ); +const bool = ( out === view ); // returns true -var v = view.getFloat32( 0, true ); +let v = view.getFloat32( 0, true ); // returns 2.0 v = view.getFloat32( 8, true ); @@ -132,21 +132,21 @@ v = view.getFloat32( 8, true ); Copies elements from an input strided array to elements in a strided [`DataView`][@stdlib/array/dataview] using alternative indexing semantics. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = [ 1.0, 2.0, 3.0, 4.0 ]; +const x = [ 1.0, 2.0, 3.0, 4.0 ]; -var buf = new ArrayBuffer( 32 ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( 32 ); +const view = new DataView( buf ); -var out = writeDataView.ndarray( 4, x, 1, 0, view, 8, 0, true ); +const out = writeDataView.ndarray( 4, x, 1, 0, view, 8, 0, true ); // returns -var bool = ( out === view ); +const bool = ( out === view ); // returns true -var v = view.getFloat64( 0, true ); +const v = view.getFloat64( 0, true ); // returns 1.0 ``` @@ -158,21 +158,21 @@ The function accepts the following additional arguments: While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `view` in reverse order, ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var x = [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; +const x = [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; -var buf = new ArrayBuffer( 64 ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( 64 ); +const view = new DataView( buf ); -var out = writeDataView.ndarray( 4, x, 2, 1, view, -8, 56, true ); +const out = writeDataView.ndarray( 4, x, 2, 1, view, -8, 56, true ); // returns -var bool = ( out === view ); +const bool = ( out === view ); // returns true -var v = view.getFloat64( 32, true ); +let v = view.getFloat64( 32, true ); // returns 4.0 v = view.getFloat64( 40, true ); @@ -196,35 +196,35 @@ v = view.getFloat64( 40, true ); ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); -var typedarray = require( '@stdlib/array/typed' ); -var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); -var logEach = require( '@stdlib/console/log-each' ); -var writeDataView = require( '@stdlib/strided/base/write-dataview' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); +const typedarray = require( '@stdlib/array/typed' ); +const bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' ); +const logEach = require( '@stdlib/console/log-each' ); +const writeDataView = require( '@stdlib/strided/base/write-dataview' ); // Specify the array data type: -var dtype = 'float64'; +const dtype = 'float64'; // Resolve the number of bytes per element: -var nbytes = bytesPerElement( dtype ); +const nbytes = bytesPerElement( dtype ); // Generate an array of random numbers: -var x = discreteUniform( 10, 0, 100, { +const x = discreteUniform( 10, 0, 100, { 'dtype': dtype }); // Create a DataView: -var buf = new ArrayBuffer( x.length*nbytes ); -var view = new DataView( buf ); +const buf = new ArrayBuffer( x.length*nbytes ); +const view = new DataView( buf ); // Copy the numbers to the DataView: writeDataView( x.length, x, 1, view, nbytes, IS_LITTLE_ENDIAN ); // Create a view of the DataView: -var y = typedarray( view.buffer, dtype ); +const y = typedarray( view.buffer, dtype ); // Print the results: logEach( '%d -> %d', x, y ); diff --git a/lib/node_modules/@stdlib/strided/base/zmap/README.md b/lib/node_modules/@stdlib/strided/base/zmap/README.md index a52df30fcb11..9361aa71c94c 100644 --- a/lib/node_modules/@stdlib/strided/base/zmap/README.md +++ b/lib/node_modules/@stdlib/strided/base/zmap/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var zmap = require( '@stdlib/strided/base/zmap' ); +const zmap = require( '@stdlib/strided/base/zmap' ); ``` #### zmap( N, x, strideX, y, strideY, fcn ) @@ -41,23 +41,23 @@ var zmap = require( '@stdlib/strided/base/zmap' ); Applies a unary function to a double-precision complex floating-point strided input array and assigns results to a double-precision complex floating-point strided output array. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); -var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex128Array( x.length ); +const x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex128Array( x.length ); zmap( x.length, x, 1, y, 1, cceil ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns -2.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -73,51 +73,51 @@ The function accepts the following arguments: The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to index every other value in `x` and to index the first `N` elements of `y` in reverse order, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); -var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex128Array( x.length ); +const x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex128Array( x.length ); zmap( 2, x, 2, y, -1, cceil ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns 5.0 -var im = imag( v ); +const im = imag( v ); // returns 0.0 ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][@stdlib/array/complex128] views. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); // Initial arrays... -var x0 = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x0 = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y0 = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); // Create offset views... -var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +const x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +const y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element zmap( 2, x1, -2, y1, 1, cceil ); -var v = y0.get( 2 ); +const v = y0.get( 2 ); // returns -var re = real( v ); +const re = real( v ); // returns -1.0 -var im = imag( v ); +const im = imag( v ); // returns 4.0 ``` @@ -126,23 +126,23 @@ var im = imag( v ); Applies a unary function to a double-precision complex floating-point strided input array and assigns results to a double-precision complex floating-point strided output array using alternative indexing semantics. ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); -var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex128Array( x.length ); +const x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex128Array( x.length ); zmap.ndarray( x.length, x, 1, 0, y, 1, 0, cceil ); -var v = y.get( 0 ); +const v = y.get( 0 ); // returns -var re = real( v ); +const re = real( v ); // returns -2.0 -var im = imag( v ); +const im = imag( v ); // returns 2.0 ``` @@ -154,23 +154,23 @@ The function accepts the following additional arguments: While [`typed array`][@stdlib/array/complex128] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to index every other value in `x` starting from the second value and to index the last `N` elements in `y` in reverse order, ```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var cceil = require( '@stdlib/math/base/special/cceil' ); +const Complex128Array = require( '@stdlib/array/complex128' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const cceil = require( '@stdlib/math/base/special/cceil' ); -var x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); -var y = new Complex128Array( x.length ); +const x = new Complex128Array( [ -2.3, 1.5, 3.1, -5.2, 4.8, 0.0, -1.6, 3.4 ] ); +const y = new Complex128Array( x.length ); zmap.ndarray( 2, x, 2, 1, y, -1, y.length-1, cceil ); -var v = y.get( y.length-1 ); +const v = y.get( y.length-1 ); // returns -var re = real( v ); +const re = real( v ); // returns 4.0 -var im = imag( v ); +const im = imag( v ); // returns -5.0 ``` @@ -191,25 +191,25 @@ var im = imag( v ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var Complex128Array = require( '@stdlib/array/complex128' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var zmap = require( '@stdlib/strided/base/zmap' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const Complex128Array = require( '@stdlib/array/complex128' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const real = require( '@stdlib/complex/float64/real' ); +const imag = require( '@stdlib/complex/float64/imag' ); +const Complex128 = require( '@stdlib/complex/float64/ctor' ); +const zmap = require( '@stdlib/strided/base/zmap' ); function scale( x ) { - var re = real( x ); - var im = imag( x ); + const re = real( x ); + const im = imag( x ); return new Complex128( re*10.0, im*10.0 ); } -var xbuf = filledarrayBy( 10*2, 'float64', discreteUniform( -100.0, 100.0 ) ); -var x = new Complex128Array( xbuf.buffer ); +const xbuf = filledarrayBy( 10*2, 'float64', discreteUniform( -100.0, 100.0 ) ); +const x = new Complex128Array( xbuf.buffer ); console.log( x ); -var y = new Complex128Array( x.length ); +const y = new Complex128Array( x.length ); console.log( y ); zmap.ndarray( x.length, x, 1, 0, y, -1, y.length-1, scale ); diff --git a/lib/node_modules/@stdlib/strided/common/README.md b/lib/node_modules/@stdlib/strided/common/README.md index 9130db8b9044..25c334ae817d 100644 --- a/lib/node_modules/@stdlib/strided/common/README.md +++ b/lib/node_modules/@stdlib/strided/common/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var common = require( '@stdlib/strided/common' ); +const common = require( '@stdlib/strided/common' ); ``` #### common @@ -45,7 +45,7 @@ var common = require( '@stdlib/strided/common' ); ```javascript -var common = require( '@stdlib/strided/common' ); +const common = require( '@stdlib/strided/common' ); console.log( common ); ``` diff --git a/lib/node_modules/@stdlib/strided/dispatch-by/README.md b/lib/node_modules/@stdlib/strided/dispatch-by/README.md index 81f9aed40ade..bebd37ffe492 100644 --- a/lib/node_modules/@stdlib/strided/dispatch-by/README.md +++ b/lib/node_modules/@stdlib/strided/dispatch-by/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dispatchBy = require( '@stdlib/strided/dispatch-by' ); +const dispatchBy = require( '@stdlib/strided/dispatch-by' ); ``` #### dispatchBy( fcns, types, data, nargs, nin, nout ) @@ -43,9 +43,9 @@ Returns a strided array function interface which accepts a callback function and ```javascript -var unaryBy = require( '@stdlib/strided/base/unary-by' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); +const unaryBy = require( '@stdlib/strided/base/unary-by' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); function foo( x ) { return x * 10.0; @@ -56,34 +56,34 @@ function bar( x ) { } // Define a list of strided array functions for applying a unary callback: -var fcns = [ +const fcns = [ unaryBy, unaryBy ]; // Define a one-dimensional list of input and output array types: -var types = [ +const types = [ 'float64', 'float64', // input, output 'float32', 'float32' // input, output ]; // Define a list of callbacks which should be applied based on the provided array types: -var data = [ +const data = [ foo, bar ]; // Define the total number of input arguments: -var nargs = 8; // N + input_array_dtype + input_array + input_array_stride + output_array_dtype + output_array + output_array_stride + callback +const nargs = 8; // N + input_array_dtype + input_array + input_array_stride + output_array_dtype + output_array + output_array_stride + callback // Define the number of input strided arrays: -var nin = 1; +const nin = 1; // Define the number of output strided arrays: -var nout = 1; +const nout = 1; // Create a strided array function interface: -var strided = dispatchBy( fcns, types, data, nargs, nin, nout ); +const strided = dispatchBy( fcns, types, data, nargs, nin, nout ); // ... @@ -91,8 +91,8 @@ function accessor( v ) { return v * 2.0; } -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let y = new Float64Array( x.length ); strided( x.length, 'float64', x, 1, 'float64', y, 1, accessor ); // y => [ 20.0, 40.0, 60.0 ] @@ -207,7 +207,7 @@ The function accepts the following arguments: ```javascript - var unaryBy = require( '@stdlib/strided/base/unary-by' ); + const unaryBy = require( '@stdlib/strided/base/unary-by' ); function foo( x ) { return x * 10.0; @@ -221,20 +221,20 @@ The function accepts the following arguments: return v; } - var fcns = [ + const fcns = [ unaryBy, unaryBy ]; - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var strided = dispatchBy( fcns, types, data, 8, 1, 1 ); + const strided = dispatchBy( fcns, types, data, 8, 1, 1 ); ``` is equivalent to @@ -242,7 +242,7 @@ The function accepts the following arguments: ```javascript - var unaryBy = require( '@stdlib/strided/base/unary-by' ); + const unaryBy = require( '@stdlib/strided/base/unary-by' ); function foo( x ) { return x * 10.0; @@ -256,16 +256,16 @@ The function accepts the following arguments: return v; } - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var strided = dispatchBy( unaryBy, types, data, 8, 1, 1 ); + const strided = dispatchBy( unaryBy, types, data, 8, 1, 1 ); ``` @@ -279,22 +279,22 @@ The function accepts the following arguments: ```javascript -var unaryBy = require( '@stdlib/strided/base/unary-by' ).ndarray; -var abs = require( '@stdlib/math/base/special/abs' ); -var identity = require( '@stdlib/math/base/special/identity' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dispatchBy = require( '@stdlib/strided/dispatch-by' ); +const unaryBy = require( '@stdlib/strided/base/unary-by' ).ndarray; +const abs = require( '@stdlib/math/base/special/abs' ); +const identity = require( '@stdlib/math/base/special/identity' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatchBy = require( '@stdlib/strided/dispatch-by' ); -var types = [ 'float64', 'float64' ]; +const types = [ 'float64', 'float64' ]; -var data = [ +const data = [ abs ]; -var strided = dispatchBy( unaryBy, types, data, 10, 1, 1 ); +const strided = dispatchBy( unaryBy, types, data, 10, 1, 1 ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); strided( 3, 'float64', x, 1, 2, 'float64', y, 1, 2, identity ); console.log( y ); diff --git a/lib/node_modules/@stdlib/strided/dispatch/README.md b/lib/node_modules/@stdlib/strided/dispatch/README.md index 670da13ff8cd..1daff690135c 100644 --- a/lib/node_modules/@stdlib/strided/dispatch/README.md +++ b/lib/node_modules/@stdlib/strided/dispatch/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var dispatch = require( '@stdlib/strided/dispatch' ); +const dispatch = require( '@stdlib/strided/dispatch' ); ``` #### dispatch( fcns, types, data, nargs, nin, nout ) @@ -43,9 +43,9 @@ Returns a strided array function interface which performs multiple dispatch. ```javascript -var unary = require( '@stdlib/strided/base/unary' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); +const unary = require( '@stdlib/strided/base/unary' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Float32Array = require( '@stdlib/array/float32' ); function foo( x ) { return x * 10.0; @@ -56,39 +56,39 @@ function bar( x ) { } // Define a list of strided array functions for applying a unary callback: -var fcns = [ +const fcns = [ unary, unary ]; // Define a one-dimensional list of input and output array types: -var types = [ +const types = [ 'float64', 'float64', // input, output 'float32', 'float32' // input, output ]; // Define a list of callbacks which should be applied based on the provided array types: -var data = [ +const data = [ foo, bar ]; // Define the total number of input arguments: -var nargs = 7; // N + input_array_dtype + input_array + input_array_stride + output_array_dtype + output_array + output_array_stride +const nargs = 7; // N + input_array_dtype + input_array + input_array_stride + output_array_dtype + output_array + output_array_stride // Define the number of input strided arrays: -var nin = 1; +const nin = 1; // Define the number of output strided arrays: -var nout = 1; +const nout = 1; // Create a strided array function interface: -var strided = dispatch( fcns, types, data, nargs, nin, nout ); +const strided = dispatch( fcns, types, data, nargs, nin, nout ); // ... -var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float64Array( x.length ); +let x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +let y = new Float64Array( x.length ); strided( x.length, 'float64', x, 1, 'float64', y, 1 ); // y => [ 10.0, 20.0, 30.0 ] @@ -197,7 +197,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/strided/base/unary' ); + const unary = require( '@stdlib/strided/base/unary' ); function foo( x ) { return x * 10.0; @@ -207,20 +207,20 @@ The function accepts the following arguments: return x * 5.0; } - var fcns = [ + const fcns = [ unary, unary ]; - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var strided = dispatch( fcns, types, data, 7, 1, 1 ); + const strided = dispatch( fcns, types, data, 7, 1, 1 ); ``` is equivalent to @@ -228,7 +228,7 @@ The function accepts the following arguments: ```javascript - var unary = require( '@stdlib/strided/base/unary' ); + const unary = require( '@stdlib/strided/base/unary' ); function foo( x ) { return x * 10.0; @@ -238,16 +238,16 @@ The function accepts the following arguments: return x * 5.0; } - var types = [ + const types = [ 'float64', 'float64', 'float32', 'float32' ]; - var data = [ + const data = [ foo, bar ]; - var strided = dispatch( unary, types, data, 7, 1, 1 ); + const strided = dispatch( unary, types, data, 7, 1, 1 ); ``` @@ -261,21 +261,21 @@ The function accepts the following arguments: ```javascript -var unary = require( '@stdlib/strided/base/unary' ).ndarray; -var abs = require( '@stdlib/math/base/special/abs' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dispatch = require( '@stdlib/strided/dispatch' ); +const unary = require( '@stdlib/strided/base/unary' ).ndarray; +const abs = require( '@stdlib/math/base/special/abs' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dispatch = require( '@stdlib/strided/dispatch' ); -var types = [ 'float64', 'float64' ]; +const types = [ 'float64', 'float64' ]; -var data = [ +const data = [ abs ]; -var strided = dispatch( unary, types, data, 9, 1, 1 ); +const strided = dispatch( unary, types, data, 9, 1, 1 ); -var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); -var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +const x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] ); +const y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); strided( 3, 'float64', x, 1, 2, 'float64', y, 1, 2 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/strided/dtypes/README.md b/lib/node_modules/@stdlib/strided/dtypes/README.md index ee9a857d4e2c..eae38907bc91 100644 --- a/lib/node_modules/@stdlib/strided/dtypes/README.md +++ b/lib/node_modules/@stdlib/strided/dtypes/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtypes = require( '@stdlib/strided/dtypes' ); +const dtypes = require( '@stdlib/strided/dtypes' ); ``` #### dtypes() @@ -45,7 +45,7 @@ var dtypes = require( '@stdlib/strided/dtypes' ); Returns a list of strided array data types. ```javascript -var out = dtypes(); +const out = dtypes(); // e.g., returns [ 'binary', 'bool', 'complex64', ... ] ``` @@ -87,12 +87,12 @@ The output array contains the following data types: ```javascript -var contains = require( '@stdlib/array/base/assert/contains' ).factory; -var dtypes = require( '@stdlib/strided/dtypes' ); +const contains = require( '@stdlib/array/base/assert/contains' ).factory; +const dtypes = require( '@stdlib/strided/dtypes' ); -var isdtype = contains( dtypes() ); +const isdtype = contains( dtypes() ); -var bool = isdtype( 'float64' ); +let bool = isdtype( 'float64' ); // returns true bool = isdtype( 'int16' ); diff --git a/lib/node_modules/@stdlib/strided/napi/README.md b/lib/node_modules/@stdlib/strided/napi/README.md index eca063640845..876c5b4d9034 100644 --- a/lib/node_modules/@stdlib/strided/napi/README.md +++ b/lib/node_modules/@stdlib/strided/napi/README.md @@ -39,7 +39,7 @@ This package exposes an absolute file path for the directory containing header f ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi' ); +const headerDir = require( '@stdlib/strided/napi' ); ``` #### headerDir @@ -47,7 +47,7 @@ var headerDir = require( '@stdlib/strided/napi' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -70,7 +70,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi' ); +const headerDir = require( '@stdlib/strided/napi' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/addon-arguments/README.md b/lib/node_modules/@stdlib/strided/napi/addon-arguments/README.md index 4e50c0d1df9f..3f574a22e40f 100644 --- a/lib/node_modules/@stdlib/strided/napi/addon-arguments/README.md +++ b/lib/node_modules/@stdlib/strided/napi/addon-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/addon-arguments' ); +const headerDir = require( '@stdlib/strided/napi/addon-arguments' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/addon-arguments' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/addon-arguments' ); +const headerDir = require( '@stdlib/strided/napi/addon-arguments' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/binary/README.md b/lib/node_modules/@stdlib/strided/napi/binary/README.md index 25dfad3fa669..96c84e6c4832 100644 --- a/lib/node_modules/@stdlib/strided/napi/binary/README.md +++ b/lib/node_modules/@stdlib/strided/napi/binary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/binary' ); +const headerDir = require( '@stdlib/strided/napi/binary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/binary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/binary' ); +const headerDir = require( '@stdlib/strided/napi/binary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/cmap/README.md b/lib/node_modules/@stdlib/strided/napi/cmap/README.md index 8732c63be3d9..4db61ed12f4e 100644 --- a/lib/node_modules/@stdlib/strided/napi/cmap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/cmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/cmap' ); +const headerDir = require( '@stdlib/strided/napi/cmap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/cmap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/cmap' ); +const headerDir = require( '@stdlib/strided/napi/cmap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/dmap/README.md b/lib/node_modules/@stdlib/strided/napi/dmap/README.md index d0c741085d0c..acb7474c84c6 100644 --- a/lib/node_modules/@stdlib/strided/napi/dmap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/dmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/dmap' ); +const headerDir = require( '@stdlib/strided/napi/dmap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/dmap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/dmap' ); +const headerDir = require( '@stdlib/strided/napi/dmap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/dmap2/README.md b/lib/node_modules/@stdlib/strided/napi/dmap2/README.md index 708d91fc85d2..e9dbab3614af 100644 --- a/lib/node_modules/@stdlib/strided/napi/dmap2/README.md +++ b/lib/node_modules/@stdlib/strided/napi/dmap2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/dmap2' ); +const headerDir = require( '@stdlib/strided/napi/dmap2' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/dmap2' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/dmap2' ); +const headerDir = require( '@stdlib/strided/napi/dmap2' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/dmskmap/README.md b/lib/node_modules/@stdlib/strided/napi/dmskmap/README.md index 411d60621b2b..ccf3d5c29c1c 100644 --- a/lib/node_modules/@stdlib/strided/napi/dmskmap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/dmskmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/dmskmap' ); +const headerDir = require( '@stdlib/strided/napi/dmskmap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/dmskmap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/dmskmap' ); +const headerDir = require( '@stdlib/strided/napi/dmskmap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/dmskmap2/README.md b/lib/node_modules/@stdlib/strided/napi/dmskmap2/README.md index dfadc16642ad..3aaaaa27ef5d 100644 --- a/lib/node_modules/@stdlib/strided/napi/dmskmap2/README.md +++ b/lib/node_modules/@stdlib/strided/napi/dmskmap2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/dmskmap2' ); +const headerDir = require( '@stdlib/strided/napi/dmskmap2' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/dmskmap2' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/dmskmap2' ); +const headerDir = require( '@stdlib/strided/napi/dmskmap2' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/mskunary/README.md b/lib/node_modules/@stdlib/strided/napi/mskunary/README.md index d9de55135649..2922c0d9fc0f 100644 --- a/lib/node_modules/@stdlib/strided/napi/mskunary/README.md +++ b/lib/node_modules/@stdlib/strided/napi/mskunary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/mskunary' ); +const headerDir = require( '@stdlib/strided/napi/mskunary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/mskunary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/mskunary' ); +const headerDir = require( '@stdlib/strided/napi/mskunary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/nullary/README.md b/lib/node_modules/@stdlib/strided/napi/nullary/README.md index ca60a25664f0..035e92189b02 100644 --- a/lib/node_modules/@stdlib/strided/napi/nullary/README.md +++ b/lib/node_modules/@stdlib/strided/napi/nullary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/nullary' ); +const headerDir = require( '@stdlib/strided/napi/nullary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/nullary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/nullary' ); +const headerDir = require( '@stdlib/strided/napi/nullary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/smap/README.md b/lib/node_modules/@stdlib/strided/napi/smap/README.md index 47ea9c7d994c..9914428cacaa 100644 --- a/lib/node_modules/@stdlib/strided/napi/smap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/smap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/smap' ); +const headerDir = require( '@stdlib/strided/napi/smap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/smap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/smap' ); +const headerDir = require( '@stdlib/strided/napi/smap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/smap2/README.md b/lib/node_modules/@stdlib/strided/napi/smap2/README.md index 657acd680ec5..637dc6c4d393 100644 --- a/lib/node_modules/@stdlib/strided/napi/smap2/README.md +++ b/lib/node_modules/@stdlib/strided/napi/smap2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/smap2' ); +const headerDir = require( '@stdlib/strided/napi/smap2' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/smap2' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/smap2' ); +const headerDir = require( '@stdlib/strided/napi/smap2' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/smskmap/README.md b/lib/node_modules/@stdlib/strided/napi/smskmap/README.md index eaea3945d200..d0323466c2e3 100644 --- a/lib/node_modules/@stdlib/strided/napi/smskmap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/smskmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/smskmap' ); +const headerDir = require( '@stdlib/strided/napi/smskmap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/smskmap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/smskmap' ); +const headerDir = require( '@stdlib/strided/napi/smskmap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/smskmap2/README.md b/lib/node_modules/@stdlib/strided/napi/smskmap2/README.md index 0c1a2a353b57..de6806a41f45 100644 --- a/lib/node_modules/@stdlib/strided/napi/smskmap2/README.md +++ b/lib/node_modules/@stdlib/strided/napi/smskmap2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/smskmap2' ); +const headerDir = require( '@stdlib/strided/napi/smskmap2' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/smskmap2' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/smskmap2' ); +const headerDir = require( '@stdlib/strided/napi/smskmap2' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/unary/README.md b/lib/node_modules/@stdlib/strided/napi/unary/README.md index cff084f04598..b30d3505ea5d 100644 --- a/lib/node_modules/@stdlib/strided/napi/unary/README.md +++ b/lib/node_modules/@stdlib/strided/napi/unary/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/unary' ); +const headerDir = require( '@stdlib/strided/napi/unary' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/unary' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/unary' ); +const headerDir = require( '@stdlib/strided/napi/unary' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/strided/napi/zmap/README.md b/lib/node_modules/@stdlib/strided/napi/zmap/README.md index 679395967edf..494fa3656c46 100644 --- a/lib/node_modules/@stdlib/strided/napi/zmap/README.md +++ b/lib/node_modules/@stdlib/strided/napi/zmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var headerDir = require( '@stdlib/strided/napi/zmap' ); +const headerDir = require( '@stdlib/strided/napi/zmap' ); ``` #### headerDir @@ -45,7 +45,7 @@ var headerDir = require( '@stdlib/strided/napi/zmap' ); Absolute file path for the directory containing header files for C APIs. ```javascript -var dir = headerDir; +const dir = headerDir; // returns ``` @@ -68,7 +68,7 @@ var dir = headerDir; ## Examples ```javascript -var headerDir = require( '@stdlib/strided/napi/zmap' ); +const headerDir = require( '@stdlib/strided/napi/zmap' ); console.log( headerDir ); // => diff --git a/lib/node_modules/@stdlib/string/README.md b/lib/node_modules/@stdlib/string/README.md index 90352156104f..96493638c782 100644 --- a/lib/node_modules/@stdlib/string/README.md +++ b/lib/node_modules/@stdlib/string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var string = require( '@stdlib/string' ); +const string = require( '@stdlib/string' ); ``` #### string @@ -35,7 +35,7 @@ var string = require( '@stdlib/string' ); Namespace containing string manipulation functions. ```javascript -var str = string; +const str = string; // returns {...} ``` @@ -119,8 +119,8 @@ The namespace exposes the following string manipulation functions: ```javascript -var getKeys = require( '@stdlib/utils/keys' ); -var string = require( '@stdlib/string' ); +const getKeys = require( '@stdlib/utils/keys' ); +const string = require( '@stdlib/string' ); console.log( getKeys( string ) ); ``` diff --git a/lib/node_modules/@stdlib/string/acronym/README.md b/lib/node_modules/@stdlib/string/acronym/README.md index c9c68b8fec44..ef6f59bb074d 100644 --- a/lib/node_modules/@stdlib/string/acronym/README.md +++ b/lib/node_modules/@stdlib/string/acronym/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var acronym = require( '@stdlib/string/acronym' ); +const acronym = require( '@stdlib/string/acronym' ); ``` #### acronym( str\[, options] ) @@ -45,7 +45,7 @@ var acronym = require( '@stdlib/string/acronym' ); Generates an acronym for a given string. ```javascript -var out = acronym( 'the quick brown fox' ); +let out = acronym( 'the quick brown fox' ); // returns 'QBF' out = acronym( 'Hard-boiled eggs' ); @@ -59,7 +59,7 @@ The function accepts the following `options`: By default, the function uses a list of common English stop words. To use a custom list, set the `stopwords` option. ```javascript -var out = acronym( 'the quick brown fox', { +let out = acronym( 'the quick brown fox', { 'stopwords': [] }); // returns 'TQBF' @@ -91,10 +91,10 @@ out = acronym( 'the quick brown fox', { ```javascript -var acronym = require( '@stdlib/string/acronym' ); +const acronym = require( '@stdlib/string/acronym' ); -var str = 'Test-driven development'; -var out = acronym( str ); +let str = 'Test-driven development'; +let out = acronym( str ); // returns 'TDD' str = 'Industrial Business Machines'; diff --git a/lib/node_modules/@stdlib/string/base/README.md b/lib/node_modules/@stdlib/string/base/README.md index e77328c2edca..4a0a414c16c0 100644 --- a/lib/node_modules/@stdlib/string/base/README.md +++ b/lib/node_modules/@stdlib/string/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var string = require( '@stdlib/string/base' ); +const string = require( '@stdlib/string/base' ); ``` #### string @@ -35,7 +35,7 @@ var string = require( '@stdlib/string/base' ); Namespace containing "base" (i.e., lower-level) string functions. ```javascript -var ns = string; +const ns = string; // returns {...} ``` @@ -127,15 +127,15 @@ The namespace contains the following functions: ```javascript -var ns = require( '@stdlib/string/base' ); +const ns = require( '@stdlib/string/base' ); // Generate a Pascal case string... -var str = ns.pascalcase( 'beep boop' ); +let str = ns.pascalcase( 'beep boop' ); // returns 'BeepBoop' // Tokenize a string into an array of string parts and format identifier objects... str = 'The %d %s foxes jumped over the %d %s dogs.'; -var tokens = ns.formatTokenize( str ); +const tokens = ns.formatTokenize( str ); // returns [ 'The ', {...}, ' ', {...}, ' foxes jumped over the ', {...}, ' ', {...}, ' dogs.' ] // Generate a string from a token array by interpolating values... @@ -144,7 +144,7 @@ str = ns.formatInterpolate( tokens, 3, 'quick', 4, 'lazy' ); // Test whether a string starts with the characters of another string... str = 'Lorem ipsum dolor sit amet'; -var bool = ns.startsWith( str, 'Lorem' ); +let bool = ns.startsWith( str, 'Lorem' ); // returns true // Test whether a string ends with the characters of another string... diff --git a/lib/node_modules/@stdlib/string/base/altcase/README.md b/lib/node_modules/@stdlib/string/base/altcase/README.md index 9e8e4cca4b7d..50984ab23edb 100644 --- a/lib/node_modules/@stdlib/string/base/altcase/README.md +++ b/lib/node_modules/@stdlib/string/base/altcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var altcase = require( '@stdlib/string/base/altcase' ); +const altcase = require( '@stdlib/string/base/altcase' ); ``` #### altcase( str ) @@ -37,7 +37,7 @@ var altcase = require( '@stdlib/string/base/altcase' ); Converts a string to alternate case. ```javascript -var str = altcase( 'foo bar' ); +let str = altcase( 'foo bar' ); // returns 'fOo bAr' str = altcase( 'foo bar baz' ); @@ -58,10 +58,10 @@ str = altcase( 'foo_bar' ); ## Examples ```javascript -var altcase = require( '@stdlib/string/base/altcase' ); +const altcase = require( '@stdlib/string/base/altcase' ); -var str = 'Hello World!'; -var out = altcase( str ); +let str = 'Hello World!'; +let out = altcase( str ); // returns 'hElLo wOrLd!' str = 'I am a tiny little teapot'; diff --git a/lib/node_modules/@stdlib/string/base/atob/README.md b/lib/node_modules/@stdlib/string/base/atob/README.md index 316c6df80721..7f23bab4fb6e 100644 --- a/lib/node_modules/@stdlib/string/base/atob/README.md +++ b/lib/node_modules/@stdlib/string/base/atob/README.md @@ -31,7 +31,7 @@ limitations under the License. ```javascript -var atob = require( '@stdlib/string/base/atob' ); +const atob = require( '@stdlib/string/base/atob' ); ``` #### atob( str ) @@ -41,7 +41,7 @@ Decodes a string of data which has been encoded using Base64 encoding. ```javascript -var out = atob( 'SGVsbG8sIHdvcmxk' ); +const out = atob( 'SGVsbG8sIHdvcmxk' ); // returns 'Hello, world' ``` @@ -68,10 +68,10 @@ var out = atob( 'SGVsbG8sIHdvcmxk' ); ```javascript -var atob = require( '@stdlib/string/base/atob' ); +const atob = require( '@stdlib/string/base/atob' ); -var str = 'SGVsbG8gV29ybGQh'; -var out = atob( str ); +let str = 'SGVsbG8gV29ybGQh'; +let out = atob( str ); // returns 'Hello World!' str = 'SEVMTE8gV09STEQh'; diff --git a/lib/node_modules/@stdlib/string/base/base64-to-uint8array/README.md b/lib/node_modules/@stdlib/string/base/base64-to-uint8array/README.md index 5a6d75548764..f85984700747 100644 --- a/lib/node_modules/@stdlib/string/base/base64-to-uint8array/README.md +++ b/lib/node_modules/@stdlib/string/base/base64-to-uint8array/README.md @@ -31,7 +31,7 @@ limitations under the License. ```javascript -var base64ToUint8Array = require( '@stdlib/string/base/base64-to-uint8array' ); +const base64ToUint8Array = require( '@stdlib/string/base/base64-to-uint8array' ); ``` #### base64ToUint8Array( str ) @@ -39,12 +39,12 @@ var base64ToUint8Array = require( '@stdlib/string/base/base64-to-uint8array' ); Converts a base64-encoded string to a [Uint8Array][@stdlib/array/uint8]. ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); -var str = string2buffer( 'Hello World!' ).toString( 'base64' ); +const str = string2buffer( 'Hello World!' ).toString( 'base64' ); // returns 'SGVsbG8gV29ybGQh' -var out = base64ToUint8Array( str ); +const out = base64ToUint8Array( str ); // returns [ 72, 101, ... ] ``` @@ -69,13 +69,13 @@ var out = base64ToUint8Array( str ); ## Examples ```javascript -var string2buffer = require( '@stdlib/buffer/from-string' ); -var base64ToUint8Array = require( '@stdlib/string/base/base64-to-uint8array' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); +const base64ToUint8Array = require( '@stdlib/string/base/base64-to-uint8array' ); -var buf = string2buffer( 'Hello World!' ).toString( 'base64' ); +let buf = string2buffer( 'Hello World!' ).toString( 'base64' ); // returns 'SGVsbG8gV29ybGQh' -var arr = base64ToUint8Array( buf ); +let arr = base64ToUint8Array( buf ); // returns buf = string2buffer( 'HELLO WORLD!' ).toString( 'base64' ); diff --git a/lib/node_modules/@stdlib/string/base/camelcase/README.md b/lib/node_modules/@stdlib/string/base/camelcase/README.md index bdfa986facb5..6968287587ae 100644 --- a/lib/node_modules/@stdlib/string/base/camelcase/README.md +++ b/lib/node_modules/@stdlib/string/base/camelcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var camelcase = require( '@stdlib/string/base/camelcase' ); +const camelcase = require( '@stdlib/string/base/camelcase' ); ``` #### camelcase( str ) @@ -37,7 +37,7 @@ var camelcase = require( '@stdlib/string/base/camelcase' ); Converts a string to camel case. ```javascript -var out = camelcase( 'foo bar' ); +let out = camelcase( 'foo bar' ); // returns 'fooBar' out = camelcase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = camelcase( '--foo-bar--' ); ## Examples ```javascript -var camelcase = require( '@stdlib/string/base/camelcase' ); +const camelcase = require( '@stdlib/string/base/camelcase' ); -var str = 'Hello World!'; -var out = camelcase( str ); +let str = 'Hello World!'; +let out = camelcase( str ); // returns 'helloWorld' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/base/capitalize/README.md b/lib/node_modules/@stdlib/string/base/capitalize/README.md index 4c1621d8296a..0b1bfb55ce74 100644 --- a/lib/node_modules/@stdlib/string/base/capitalize/README.md +++ b/lib/node_modules/@stdlib/string/base/capitalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var capitalize = require( '@stdlib/string/base/capitalize' ); +const capitalize = require( '@stdlib/string/base/capitalize' ); ``` #### capitalize( str ) @@ -35,7 +35,7 @@ var capitalize = require( '@stdlib/string/base/capitalize' ); Capitalizes the first character in a string. ```javascript -var out = capitalize( 'last man standing' ); +let out = capitalize( 'last man standing' ); // returns 'Last man standing' out = capitalize( 'Hidden Treasures' ); @@ -53,9 +53,9 @@ out = capitalize( 'Hidden Treasures' ); ```javascript -var capitalize = require( '@stdlib/string/base/capitalize' ); +const capitalize = require( '@stdlib/string/base/capitalize' ); -var str = capitalize( 'last man standing' ); +let str = capitalize( 'last man standing' ); // returns 'Last man standing' str = capitalize( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/base/code-point-at/README.md b/lib/node_modules/@stdlib/string/base/code-point-at/README.md index 225a09c34888..b2e6c7465f2f 100644 --- a/lib/node_modules/@stdlib/string/base/code-point-at/README.md +++ b/lib/node_modules/@stdlib/string/base/code-point-at/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var codePointAt = require( '@stdlib/string/base/code-point-at' ); +const codePointAt = require( '@stdlib/string/base/code-point-at' ); ``` #### codePointAt( string, position, backward ) @@ -45,21 +45,21 @@ var codePointAt = require( '@stdlib/string/base/code-point-at' ); Returns a Unicode [code point][code-point] from a string at a specified position. ```javascript -var out = codePointAt( 'last man standing', 4, false ); +const out = codePointAt( 'last man standing', 4, false ); // returns 32 ``` The function supports a `backward` argument for performing backward iteration for low surrogates. ```javascript -var out = codePointAt( '🌷', 1, true ); +const out = codePointAt( '🌷', 1, true ); // returns 127799 ``` The function supports providing a negative `position`. ```javascript -var out = codePointAt( 'last man standing', -13, false ); +const out = codePointAt( 'last man standing', -13, false ); // returns 32 ``` @@ -91,9 +91,9 @@ This function differs from [`String.prototype.codePointAt`][mdn-string-codepoint ```javascript -var codePointAt = require( '@stdlib/string/base/code-point-at' ); +const codePointAt = require( '@stdlib/string/base/code-point-at' ); -var v = codePointAt( 'last man standing', 4, false ); +let v = codePointAt( 'last man standing', 4, false ); // returns 32 v = codePointAt( 'presidential election', 8, true ); diff --git a/lib/node_modules/@stdlib/string/base/constantcase/README.md b/lib/node_modules/@stdlib/string/base/constantcase/README.md index f6d62083e4e1..248c7f2c36dd 100644 --- a/lib/node_modules/@stdlib/string/base/constantcase/README.md +++ b/lib/node_modules/@stdlib/string/base/constantcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var constantcase = require( '@stdlib/string/base/constantcase' ); +const constantcase = require( '@stdlib/string/base/constantcase' ); ``` #### constantcase( str ) @@ -37,7 +37,7 @@ var constantcase = require( '@stdlib/string/base/constantcase' ); Converts a string to constant case. ```javascript -var str = constantcase( 'foo bar' ); +let str = constantcase( 'foo bar' ); // returns 'FOO_BAR' str = constantcase( 'foo bar baz' ); @@ -58,10 +58,10 @@ str = constantcase( 'foo_bar' ); ## Examples ```javascript -var constantcase = require( '@stdlib/string/base/constantcase' ); +const constantcase = require( '@stdlib/string/base/constantcase' ); -var str = 'Hello World!'; -var out = constantcase( str ); +let str = 'Hello World!'; +let out = constantcase( str ); // returns 'HELLO_WORLD' str = 'I am a tiny little teapot'; diff --git a/lib/node_modules/@stdlib/string/base/distances/README.md b/lib/node_modules/@stdlib/string/base/distances/README.md index ab64d5237bbe..716c53cee489 100644 --- a/lib/node_modules/@stdlib/string/base/distances/README.md +++ b/lib/node_modules/@stdlib/string/base/distances/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var distances = require( '@stdlib/string/base/distances' ); +const distances = require( '@stdlib/string/base/distances' ); ``` #### distances @@ -35,7 +35,7 @@ var distances = require( '@stdlib/string/base/distances' ); Namespace containing "distances", i.e, implementations of various string similarity metrics. ```javascript -var ns = distances; +const ns = distances; // returns {...} ``` @@ -73,10 +73,10 @@ The namespace contains the following functions: ```javascript -var ns = require( '@stdlib/string/base/distances' ); +const ns = require( '@stdlib/string/base/distances' ); // Calculate the edit distance between two input strings... -var dist = ns.levenshteinDistance( 'algorithm', 'altruistic' ); +const dist = ns.levenshteinDistance( 'algorithm', 'altruistic' ); // returns 6 ``` diff --git a/lib/node_modules/@stdlib/string/base/distances/hamming/README.md b/lib/node_modules/@stdlib/string/base/distances/hamming/README.md index 88be4d48eab9..252f5709d0fe 100644 --- a/lib/node_modules/@stdlib/string/base/distances/hamming/README.md +++ b/lib/node_modules/@stdlib/string/base/distances/hamming/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var hammingDistance = require( '@stdlib/string/base/distances/hamming' ); +const hammingDistance = require( '@stdlib/string/base/distances/hamming' ); ``` #### hammingDistance( s1, s2 ) @@ -37,7 +37,7 @@ var hammingDistance = require( '@stdlib/string/base/distances/hamming' ); Calculates the [Hamming distance][hamming-distance] between two equal-length strings. ```javascript -var dist = hammingDistance( 'frog', 'from' ); +let dist = hammingDistance( 'frog', 'from' ); // returns 1 dist = hammingDistance( 'tooth', 'froth' ); @@ -77,9 +77,9 @@ dist = hammingDistance( '1638452297', '2311638451' ); ## Examples ```javascript -var hammingDistance = require( '@stdlib/string/base/distances/hamming' ); +const hammingDistance = require( '@stdlib/string/base/distances/hamming' ); -var dist = hammingDistance( 'algorithms', 'altruistic' ); +let dist = hammingDistance( 'algorithms', 'altruistic' ); // returns 7 dist = hammingDistance( 'elephant', 'Tashkent' ); diff --git a/lib/node_modules/@stdlib/string/base/distances/levenshtein/README.md b/lib/node_modules/@stdlib/string/base/distances/levenshtein/README.md index 84376b17fdcf..44a45536be27 100644 --- a/lib/node_modules/@stdlib/string/base/distances/levenshtein/README.md +++ b/lib/node_modules/@stdlib/string/base/distances/levenshtein/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var levenshteinDistance = require( '@stdlib/string/base/distances/levenshtein' ); +const levenshteinDistance = require( '@stdlib/string/base/distances/levenshtein' ); ``` #### levenshteinDistance( s1, s2 ) @@ -37,7 +37,7 @@ var levenshteinDistance = require( '@stdlib/string/base/distances/levenshtein' ) Calculates the [Levenshtein][levenshtein] (edit) distance between two strings. ```javascript -var dist = levenshteinDistance( 'frog', 'from' ); +let dist = levenshteinDistance( 'frog', 'from' ); // returns 1 dist = levenshteinDistance( 'frog', 'froth' ); @@ -64,9 +64,9 @@ dist = levenshteinDistance( '1638452297', '2311638451' ); ## Examples ```javascript -var levenshteinDistance = require( '@stdlib/string/base/distances/levenshtein' ); +const levenshteinDistance = require( '@stdlib/string/base/distances/levenshtein' ); -var dist = levenshteinDistance( 'algorithm', 'altruistic' ); +let dist = levenshteinDistance( 'algorithm', 'altruistic' ); // returns 6 dist = levenshteinDistance( 'elephant', 'hippo' ); diff --git a/lib/node_modules/@stdlib/string/base/dotcase/README.md b/lib/node_modules/@stdlib/string/base/dotcase/README.md index 3dcee73044b5..18d8f44574e3 100644 --- a/lib/node_modules/@stdlib/string/base/dotcase/README.md +++ b/lib/node_modules/@stdlib/string/base/dotcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var dotcase = require( '@stdlib/string/base/dotcase' ); +const dotcase = require( '@stdlib/string/base/dotcase' ); ``` #### dotcase( str ) @@ -37,7 +37,7 @@ var dotcase = require( '@stdlib/string/base/dotcase' ); Converts a string to dot case. ```javascript -var str = dotcase( 'foo bar' ); +let str = dotcase( 'foo bar' ); // returns 'foo.bar' str = dotcase( 'foo bar baz' ); @@ -58,10 +58,10 @@ str = dotcase( 'foo_bar' ); ## Examples ```javascript -var dotcase = require( '@stdlib/string/base/dotcase' ); +const dotcase = require( '@stdlib/string/base/dotcase' ); -var str = 'Hello World!'; -var out = dotcase( str ); +let str = 'Hello World!'; +let out = dotcase( str ); // returns 'hello.world' str = 'I am a tiny little teapot'; diff --git a/lib/node_modules/@stdlib/string/base/ends-with/README.md b/lib/node_modules/@stdlib/string/base/ends-with/README.md index 7b3af68d3d1b..dfbd917dafc8 100644 --- a/lib/node_modules/@stdlib/string/base/ends-with/README.md +++ b/lib/node_modules/@stdlib/string/base/ends-with/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var endsWith = require( '@stdlib/string/base/ends-with' ); +const endsWith = require( '@stdlib/string/base/ends-with' ); ``` #### endsWith( str, search, len ) @@ -41,9 +41,9 @@ var endsWith = require( '@stdlib/string/base/ends-with' ); Tests if a string ends with the characters of another string. ```javascript -var str = 'Remember the story I used to tell you when you were a boy?'; +const str = 'Remember the story I used to tell you when you were a boy?'; -var bool = endsWith( str, 'boy?', str.length ); +let bool = endsWith( str, 'boy?', str.length ); // returns true bool = endsWith( str, 'Boy?', str.length ); @@ -53,9 +53,9 @@ bool = endsWith( str, 'Boy?', str.length ); To search from a specific character position, provide a `len` argument. If `len` is positive, the function restricts the search to a substring with length `len`, beginning with the leftmost character. If `len` is negative, `len` indicates to ignore the last `len` characters (equivalent to `str.length + len`). ```javascript -var str = 'To be, or not to be, that is the question.'; +const str = 'To be, or not to be, that is the question.'; -var bool = endsWith( str, 'to be', 19 ); +let bool = endsWith( str, 'to be', 19 ); // returns true bool = endsWith( str, 'to be', -23 ); @@ -65,9 +65,9 @@ bool = endsWith( str, 'to be', -23 ); If provided an empty `search` string, the function **always** returns `true`. ```javascript -var str = 'beep boop'; +const str = 'beep boop'; -var bool = endsWith( str, '' ); +const bool = endsWith( str, '' ); // returns true ``` @@ -82,7 +82,7 @@ var bool = endsWith( str, '' ); - In general, exercise caution when operating on substrings containing Unicode characters, as the visual character length may not equal the number of code points. For example, ```javascript - var len = '🏠'.length; + const len = '🏠'.length; // returns 2 ``` @@ -103,11 +103,11 @@ var bool = endsWith( str, '' ); ```javascript -var endsWith = require( '@stdlib/string/base/ends-with' ); +const endsWith = require( '@stdlib/string/base/ends-with' ); -var str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; +const str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; -var bool = endsWith( str, 'air', str.length ); +let bool = endsWith( str, 'air', str.length ); // returns true bool = endsWith( str, 'fair', str.length ); diff --git a/lib/node_modules/@stdlib/string/base/first-code-point/README.md b/lib/node_modules/@stdlib/string/base/first-code-point/README.md index e535d9f6e57d..78695be9f570 100644 --- a/lib/node_modules/@stdlib/string/base/first-code-point/README.md +++ b/lib/node_modules/@stdlib/string/base/first-code-point/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var firstCodePoint = require( '@stdlib/string/base/first-code-point' ); +const firstCodePoint = require( '@stdlib/string/base/first-code-point' ); ``` #### firstCodePoint( str, n ) @@ -35,7 +35,7 @@ var firstCodePoint = require( '@stdlib/string/base/first-code-point' ); Returns the first `n` Unicode code points of a string. ```javascript -var out = firstCodePoint( 'last man standing', 1 ); +let out = firstCodePoint( 'last man standing', 1 ); // returns 'l' out = firstCodePoint( 'Hidden Treasures', 1 ); @@ -56,12 +56,14 @@ out = firstCodePoint( 'foo bar', 10 ); ## Examples + + ```javascript -var firstCodePoint = require( '@stdlib/string/base/first-code-point' ); +const firstCodePoint = require( '@stdlib/string/base/first-code-point' ); -var str = firstCodePoint( 'presidential election', 1 ); +let str = firstCodePoint( 'presidential election', 1 ); // returns 'p' str = firstCodePoint( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/first-grapheme-cluster/README.md b/lib/node_modules/@stdlib/string/base/first-grapheme-cluster/README.md index 7a59aab2632f..f528a49f8b6b 100644 --- a/lib/node_modules/@stdlib/string/base/first-grapheme-cluster/README.md +++ b/lib/node_modules/@stdlib/string/base/first-grapheme-cluster/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' ); +const firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' ); ``` #### firstGraphemeCluster( str, n ) @@ -35,7 +35,7 @@ var firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' Returns the first `n` grapheme clusters (i.e., user-perceived characters) of a string. ```javascript -var out = firstGraphemeCluster( 'last man standing', 1 ); +let out = firstGraphemeCluster( 'last man standing', 1 ); // returns 'l' out = firstGraphemeCluster( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = firstGraphemeCluster( 'foo bar', 10 ); ```javascript -var firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' ); +const firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' ); -var str = firstGraphemeCluster( 'presidential election', 1 ); +let str = firstGraphemeCluster( 'presidential election', 1 ); // returns 'p' str = firstGraphemeCluster( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/first/README.md b/lib/node_modules/@stdlib/string/base/first/README.md index d3b2ff89ed82..9e6f939daefb 100644 --- a/lib/node_modules/@stdlib/string/base/first/README.md +++ b/lib/node_modules/@stdlib/string/base/first/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var first = require( '@stdlib/string/base/first' ); +const first = require( '@stdlib/string/base/first' ); ``` #### first( str, n ) @@ -35,7 +35,7 @@ var first = require( '@stdlib/string/base/first' ); Returns the first `n` UTF-16 code units of a string. ```javascript -var out = first( 'last man standing', 1 ); +let out = first( 'last man standing', 1 ); // returns 'l' out = first( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = first( 'foo bar', 10 ); ```javascript -var first = require( '@stdlib/string/base/first' ); +const first = require( '@stdlib/string/base/first' ); -var str = first( 'presidential election', 1 ); +let str = first( 'presidential election', 1 ); // returns 'p' str = first( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/for-each-code-point-right/README.md b/lib/node_modules/@stdlib/string/base/for-each-code-point-right/README.md index 9b688ab28d51..8e5dfd329666 100644 --- a/lib/node_modules/@stdlib/string/base/for-each-code-point-right/README.md +++ b/lib/node_modules/@stdlib/string/base/for-each-code-point-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachCodePointRight = require( '@stdlib/string/base/for-each-code-point-right' ); +const forEachCodePointRight = require( '@stdlib/string/base/for-each-code-point-right' ); ``` #### forEachCodePointRight( str, clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = '👉🏿'; +const str = '👉🏿'; -var ctx = { +const ctx = { 'count': 0 }; forEachCodePointRight( str, clbk, ctx ); -var cnt = ctx.count; +const cnt = ctx.count; // returns 2 ``` @@ -105,7 +105,7 @@ var cnt = ctx.count; ```javascript -var forEachCodePointRight = require( '@stdlib/string/base/for-each-code-point-right' ); +const forEachCodePointRight = require( '@stdlib/string/base/for-each-code-point-right' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/base/for-each-code-point/README.md b/lib/node_modules/@stdlib/string/base/for-each-code-point/README.md index 2053a73501a4..8606b25f68e9 100644 --- a/lib/node_modules/@stdlib/string/base/for-each-code-point/README.md +++ b/lib/node_modules/@stdlib/string/base/for-each-code-point/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachCodePoint = require( '@stdlib/string/base/for-each-code-point' ); +const forEachCodePoint = require( '@stdlib/string/base/for-each-code-point' ); ``` #### forEachCodePoint( str, clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = '👉🏿'; +const str = '👉🏿'; -var ctx = { +const ctx = { 'count': 0 }; forEachCodePoint( str, clbk, ctx ); -var cnt = ctx.count; +const cnt = ctx.count; // returns 2 ``` @@ -105,7 +105,7 @@ var cnt = ctx.count; ```javascript -var forEachCodePoint = require( '@stdlib/string/base/for-each-code-point' ); +const forEachCodePoint = require( '@stdlib/string/base/for-each-code-point' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/base/for-each-grapheme-cluster/README.md b/lib/node_modules/@stdlib/string/base/for-each-grapheme-cluster/README.md index 3840e1ed82b2..b164bd61952e 100644 --- a/lib/node_modules/@stdlib/string/base/for-each-grapheme-cluster/README.md +++ b/lib/node_modules/@stdlib/string/base/for-each-grapheme-cluster/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachGraphemeCluster = require( '@stdlib/string/base/for-each-grapheme-cluster' ); +const forEachGraphemeCluster = require( '@stdlib/string/base/for-each-grapheme-cluster' ); ``` #### forEachGraphemeCluster( str, clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = '👉🏿'; +const str = '👉🏿'; -var ctx = { +const ctx = { 'count': 0 }; forEachGraphemeCluster( str, clbk, ctx ); -var cnt = ctx.count; +const cnt = ctx.count; // returns 1 ``` @@ -105,7 +105,7 @@ var cnt = ctx.count; ```javascript -var forEachGraphemeCluster = require( '@stdlib/string/base/for-each-grapheme-cluster' ); +const forEachGraphemeCluster = require( '@stdlib/string/base/for-each-grapheme-cluster' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/base/for-each-right/README.md b/lib/node_modules/@stdlib/string/base/for-each-right/README.md index 5e5db58d75ab..c96d867e6a46 100644 --- a/lib/node_modules/@stdlib/string/base/for-each-right/README.md +++ b/lib/node_modules/@stdlib/string/base/for-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachRight = require( '@stdlib/string/base/for-each-right' ); +const forEachRight = require( '@stdlib/string/base/for-each-right' ); ``` #### forEachRight( str, clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = '👉🏿'; +const str = '👉🏿'; -var ctx = { +const ctx = { 'count': 0 }; forEachRight( str, clbk, ctx ); -var cnt = ctx.count; +const cnt = ctx.count; // returns 4 ``` @@ -105,7 +105,7 @@ var cnt = ctx.count; ```javascript -var forEachRight = require( '@stdlib/string/base/for-each-right' ); +const forEachRight = require( '@stdlib/string/base/for-each-right' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/base/for-each/README.md b/lib/node_modules/@stdlib/string/base/for-each/README.md index 0ce9ee7bd941..ac34ed5e76bd 100644 --- a/lib/node_modules/@stdlib/string/base/for-each/README.md +++ b/lib/node_modules/@stdlib/string/base/for-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEach = require( '@stdlib/string/base/for-each' ); +const forEach = require( '@stdlib/string/base/for-each' ); ``` #### forEach( str, clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = '👉🏿'; +const str = '👉🏿'; -var ctx = { +const ctx = { 'count': 0 }; forEach( str, clbk, ctx ); -var cnt = ctx.count; +const cnt = ctx.count; // returns 4 ``` @@ -105,7 +105,7 @@ var cnt = ctx.count; ```javascript -var forEach = require( '@stdlib/string/base/for-each' ); +const forEach = require( '@stdlib/string/base/for-each' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/base/format-interpolate/README.md b/lib/node_modules/@stdlib/string/base/format-interpolate/README.md index 1c19c2349793..f8e2a146b4d4 100644 --- a/lib/node_modules/@stdlib/string/base/format-interpolate/README.md +++ b/lib/node_modules/@stdlib/string/base/format-interpolate/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var formatInterpolate = require( '@stdlib/string/base/format-interpolate' ); +const formatInterpolate = require( '@stdlib/string/base/format-interpolate' ); ``` #### formatInterpolate( tokens, ...args ) @@ -41,19 +41,19 @@ var formatInterpolate = require( '@stdlib/string/base/format-interpolate' ); Generates string from a token array by interpolating values. ```javascript -var formatTokenize = require( '@stdlib/string/base/format-tokenize' ); +const formatTokenize = require( '@stdlib/string/base/format-tokenize' ); -var str = 'Hello, %s! My name is %s.'; -var tokens = formatTokenize( str ); -var out = formatInterpolate( tokens, 'World', 'Bob' ); +const str = 'Hello, %s! My name is %s.'; +const tokens = formatTokenize( str ); +const out = formatInterpolate( tokens, 'World', 'Bob' ); // returns 'Hello, World! My name is Bob.' ``` The array of `tokens` should contain string parts and format identifier objects. ```javascript -var tokens = [ 'beep ', { 'specifier': 's' } ]; -var out = formatInterpolate( tokens, 'boop' ); +const tokens = [ 'beep ', { 'specifier': 's' } ]; +const out = formatInterpolate( tokens, 'boop' ); // returns 'beep boop' ``` @@ -78,12 +78,12 @@ Format identifier objects can have the following properties: ```javascript -var formatTokenize = require( '@stdlib/string/base/format-tokenize' ); -var PI = require( '@stdlib/constants/float64/pi' ); -var formatInterpolate = require( '@stdlib/string/base/format-interpolate' ); +const formatTokenize = require( '@stdlib/string/base/format-tokenize' ); +const PI = require( '@stdlib/constants/float64/pi' ); +const formatInterpolate = require( '@stdlib/string/base/format-interpolate' ); -var tokens = formatTokenize( 'Hello %s!' ); -var out = formatInterpolate( tokens, 'World' ); +let tokens = formatTokenize( 'Hello %s!' ); +let out = formatInterpolate( tokens, 'World' ); // returns 'Hello World!' tokens = formatTokenize( 'Pi: ~%.2f' ); diff --git a/lib/node_modules/@stdlib/string/base/format-tokenize/README.md b/lib/node_modules/@stdlib/string/base/format-tokenize/README.md index bf0c95e30f39..7220ba3d6bbc 100644 --- a/lib/node_modules/@stdlib/string/base/format-tokenize/README.md +++ b/lib/node_modules/@stdlib/string/base/format-tokenize/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var formatTokenize = require( '@stdlib/string/base/format-tokenize' ); +const formatTokenize = require( '@stdlib/string/base/format-tokenize' ); ``` #### formatTokenize( str ) @@ -41,8 +41,8 @@ var formatTokenize = require( '@stdlib/string/base/format-tokenize' ); Tokenizes a string into an array of string parts and format identifier objects. ```javascript -var str = 'Hello, %s! My name is %s.'; -var out = formatTokenize( str ); +const str = 'Hello, %s! My name is %s.'; +const out = formatTokenize( str ); // returns [ 'Hello, ', {...}, '! My name is ', {...}, '.' ] ``` @@ -67,9 +67,9 @@ The format identifier objects have the following properties: ```javascript -var formatTokenize = require( '@stdlib/string/base/format-tokenize' ); +const formatTokenize = require( '@stdlib/string/base/format-tokenize' ); -var out = formatTokenize( 'Hello %s!' ); +let out = formatTokenize( 'Hello %s!' ); // returns [ 'Hello ', {...}, '!' ] out = formatTokenize( 'Pi: ~%.2f' ); diff --git a/lib/node_modules/@stdlib/string/base/headercase/README.md b/lib/node_modules/@stdlib/string/base/headercase/README.md index 41c97ed63ae2..ec988359a7b0 100644 --- a/lib/node_modules/@stdlib/string/base/headercase/README.md +++ b/lib/node_modules/@stdlib/string/base/headercase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var headercase = require( '@stdlib/string/base/headercase' ); +const headercase = require( '@stdlib/string/base/headercase' ); ``` #### headercase( str ) @@ -37,7 +37,7 @@ var headercase = require( '@stdlib/string/base/headercase' ); Converts a string to HTTP header case. ```javascript -var out = headercase( 'foo bar' ); +let out = headercase( 'foo bar' ); // returns 'Foo-Bar' out = headercase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = headercase( '--foo-bar--' ); ## Examples ```javascript -var headercase = require( '@stdlib/string/base/headercase' ); +const headercase = require( '@stdlib/string/base/headercase' ); -var str = 'Hello World!'; -var out = headercase( str ); +let str = 'Hello World!'; +let out = headercase( str ); // returns 'Hello-World' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/base/invcase/README.md b/lib/node_modules/@stdlib/string/base/invcase/README.md index 91ae54bcf8ae..3f645af583c9 100644 --- a/lib/node_modules/@stdlib/string/base/invcase/README.md +++ b/lib/node_modules/@stdlib/string/base/invcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var invcase = require( '@stdlib/string/base/invcase' ); +const invcase = require( '@stdlib/string/base/invcase' ); ``` #### invcase( str ) @@ -37,7 +37,7 @@ var invcase = require( '@stdlib/string/base/invcase' ); Converts a string to inverse case. ```javascript -var str = invcase( 'foo bar' ); +let str = invcase( 'foo bar' ); // returns 'FOO BAR' str = invcase( 'Foo Bar Baz' ); @@ -58,10 +58,10 @@ str = invcase( 'foo BAR' ); ## Examples ```javascript -var invcase = require( '@stdlib/string/base/invcase' ); +const invcase = require( '@stdlib/string/base/invcase' ); -var str = 'Hello World!'; -var out = invcase( str ); +let str = 'Hello World!'; +let out = invcase( str ); // returns 'hELLO wORLD!' str = 'I am a tiny little teapot'; diff --git a/lib/node_modules/@stdlib/string/base/kebabcase/README.md b/lib/node_modules/@stdlib/string/base/kebabcase/README.md index d5718f03689a..6edf2184d4d4 100644 --- a/lib/node_modules/@stdlib/string/base/kebabcase/README.md +++ b/lib/node_modules/@stdlib/string/base/kebabcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var kebabcase = require( '@stdlib/string/base/kebabcase' ); +const kebabcase = require( '@stdlib/string/base/kebabcase' ); ``` #### kebabcase( str ) @@ -37,7 +37,7 @@ var kebabcase = require( '@stdlib/string/base/kebabcase' ); Converts a string to kebab case. ```javascript -var str = kebabcase( 'Foo Bar' ); +let str = kebabcase( 'Foo Bar' ); // returns 'foo-bar' str = kebabcase( 'I am a tiny little house' ); @@ -58,10 +58,10 @@ str = kebabcase( 'Hello World!' ); ## Examples ```javascript -var kebabcase = require( '@stdlib/string/base/kebabcase' ); +const kebabcase = require( '@stdlib/string/base/kebabcase' ); -var str = 'foo bar baz'; -var out = kebabcase( str ); +let str = 'foo bar baz'; +let out = kebabcase( str ); // returns 'foo-bar-baz' str = 'foo_baz'; diff --git a/lib/node_modules/@stdlib/string/base/last-code-point/README.md b/lib/node_modules/@stdlib/string/base/last-code-point/README.md index 03c2da1ae644..edb970d217e6 100644 --- a/lib/node_modules/@stdlib/string/base/last-code-point/README.md +++ b/lib/node_modules/@stdlib/string/base/last-code-point/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lastCodePoint = require( '@stdlib/string/base/last-code-point' ); +const lastCodePoint = require( '@stdlib/string/base/last-code-point' ); ``` #### lastCodePoint( str, n ) @@ -35,7 +35,7 @@ var lastCodePoint = require( '@stdlib/string/base/last-code-point' ); Returns the last `n` Unicode code points of a string. ```javascript -var s = lastCodePoint( 'JavaScript', 1 ); +let s = lastCodePoint( 'JavaScript', 1 ); // returns 't' s = lastCodePoint( 'Hello World', 5 ); @@ -59,9 +59,9 @@ s = lastCodePoint( 'foo bar', 10 ); ```javascript -var lastCodePoint = require( '@stdlib/string/base/last-code-point' ); +const lastCodePoint = require( '@stdlib/string/base/last-code-point' ); -var str = lastCodePoint( 'Hello World', 1 ); +let str = lastCodePoint( 'Hello World', 1 ); // returns 'd' str = lastCodePoint( 'JavaScript', 6 ); diff --git a/lib/node_modules/@stdlib/string/base/last-grapheme-cluster/README.md b/lib/node_modules/@stdlib/string/base/last-grapheme-cluster/README.md index f1f807a24e58..f734cdc0cf67 100644 --- a/lib/node_modules/@stdlib/string/base/last-grapheme-cluster/README.md +++ b/lib/node_modules/@stdlib/string/base/last-grapheme-cluster/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lastGraphemeCluster = require( '@stdlib/string/base/last-grapheme-cluster' ); +const lastGraphemeCluster = require( '@stdlib/string/base/last-grapheme-cluster' ); ``` #### lastGraphemeCluster( str, n ) @@ -35,7 +35,7 @@ var lastGraphemeCluster = require( '@stdlib/string/base/last-grapheme-cluster' ) Returns the last `n` grapheme clusters (i.e., user-perceived characters) of a string. ```javascript -var out = lastGraphemeCluster( 'Hello World', 1 ); +let out = lastGraphemeCluster( 'Hello World', 1 ); // returns 'd' out = lastGraphemeCluster( 'Evening', 3 ); @@ -56,9 +56,9 @@ out = lastGraphemeCluster( 'foo bar', 10 ); ```javascript -var lastGraphemeCluster = require( '@stdlib/string/base/last-grapheme-cluster' ); +const lastGraphemeCluster = require( '@stdlib/string/base/last-grapheme-cluster' ); -var str = lastGraphemeCluster( 'Hello World!', 1 ); +let str = lastGraphemeCluster( 'Hello World!', 1 ); // returns '!' str = lastGraphemeCluster( 'JavaScript', 6 ); diff --git a/lib/node_modules/@stdlib/string/base/last/README.md b/lib/node_modules/@stdlib/string/base/last/README.md index a8e545f1fffc..7c018dcfda7f 100644 --- a/lib/node_modules/@stdlib/string/base/last/README.md +++ b/lib/node_modules/@stdlib/string/base/last/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var last = require( '@stdlib/string/base/last' ); +const last = require( '@stdlib/string/base/last' ); ``` #### last( str, n ) @@ -35,7 +35,7 @@ var last = require( '@stdlib/string/base/last' ); Returns the last `n` UTF-16 code units of a string. ```javascript -var s = last( 'hello world', 1 ); +let s = last( 'hello world', 1 ); // returns 'd' s = last( 'this is stdlib', 1 ); @@ -59,9 +59,9 @@ s = last( 'foo bar', 10 ); ```javascript -var last = require( '@stdlib/string/base/last' ); +const last = require( '@stdlib/string/base/last' ); -var str = last( 'elections', 1 ); +let str = last( 'elections', 1 ); // returns 's' str = last( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/left-pad/README.md b/lib/node_modules/@stdlib/string/base/left-pad/README.md index 86f48566fe26..bab6b0e66f60 100644 --- a/lib/node_modules/@stdlib/string/base/left-pad/README.md +++ b/lib/node_modules/@stdlib/string/base/left-pad/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lpad = require( '@stdlib/string/base/left-pad' ); +const lpad = require( '@stdlib/string/base/left-pad' ); ``` #### lpad( str, len, pad ) @@ -35,7 +35,7 @@ var lpad = require( '@stdlib/string/base/left-pad' ); Left pads a string such that the padded string has a length of **at least** `len`. ```javascript -var str = lpad( 'a', 5, ' ' ); +let str = lpad( 'a', 5, ' ' ); // returns ' a' str = lpad( 'beep', 10, 'b' ); @@ -56,7 +56,7 @@ str = lpad( 'boop', 12, 'beep' ); - An output string is **not** guaranteed to have a length of **exactly** `len`, but to have a length of **at least** `len`. To generate a padded string having a length equal to `len` ```javascript - var str = lpad( 'boop', 10, 'beep' ); // => length 12 + let str = lpad( 'boop', 10, 'beep' ); // => length 12 // returns 'beepbeepboop' str = str.substring( 0, 10 ); // => length 10 @@ -74,18 +74,17 @@ str = lpad( 'boop', 12, 'beep' ); To replicate [`String.prototype.padStart`][mdn-string-padstart] truncation behavior ```javascript - var floorb = require( '@stdlib/math/base/special/floorb' ); + const floorb = require( '@stdlib/math/base/special/floorb' ); function padStart( str, len, pad ) { - var n; if ( len <= str.length ) { return str; } - n = floorb( len-str.length, 1, pad.length ) + str.length; + const n = floorb( len-str.length, 1, pad.length ) + str.length; return pad.substring( 0, len-n ) + lpad( str, n, pad ); } - var str = padStart( 'boop', 10, 'beep' ); + const str = padStart( 'boop', 10, 'beep' ); // returns 'bebeepboop' ``` @@ -100,25 +99,25 @@ str = lpad( 'boop', 12, 'beep' ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var papply = require( '@stdlib/utils/papply' ); -var papplyRight = require( '@stdlib/utils/papply-right' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var map = require( '@stdlib/utils/map' ); -var logEach = require( '@stdlib/console/log-each' ); -var lpad = require( '@stdlib/string/base/left-pad' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const papply = require( '@stdlib/utils/papply' ); +const papplyRight = require( '@stdlib/utils/papply-right' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const map = require( '@stdlib/utils/map' ); +const logEach = require( '@stdlib/console/log-each' ); +const lpad = require( '@stdlib/string/base/left-pad' ); // Define a string to pad: -var str = 'beep'; +const str = 'beep'; // Generate random lengths: -var lens = discreteUniform( 10, str.length, str.length+10 ); +const lens = discreteUniform( 10, str.length, str.length+10 ); // Create a function for creating padded strings: -var fcn = naryFunction( papply( papplyRight( lpad, 'b' ), str ), 1 ); +const fcn = naryFunction( papply( papplyRight( lpad, 'b' ), str ), 1 ); // Generate padded strings: -var out = map( lens, fcn ); +const out = map( lens, fcn ); // Print results: logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/string/base/left-trim/README.md b/lib/node_modules/@stdlib/string/base/left-trim/README.md index f51c1ad3a5a0..89361f7667e4 100644 --- a/lib/node_modules/@stdlib/string/base/left-trim/README.md +++ b/lib/node_modules/@stdlib/string/base/left-trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ltrim = require( '@stdlib/string/base/left-trim' ); +const ltrim = require( '@stdlib/string/base/left-trim' ); ``` #### ltrim( str ) @@ -35,7 +35,7 @@ var ltrim = require( '@stdlib/string/base/left-trim' ); Trims whitespace from the beginning of a string. ```javascript -var out = ltrim( ' \r\n\t Beep \t\t\n ' ); +const out = ltrim( ' \r\n\t Beep \t\t\n ' ); // returns 'Beep \t\t\n ' ``` @@ -76,9 +76,9 @@ var out = ltrim( ' \r\n\t Beep \t\t\n ' ); ```javascript -var ltrim = require( '@stdlib/string/base/left-trim' ); +const ltrim = require( '@stdlib/string/base/left-trim' ); -var str = ltrim( ' Whitespace ' ); +let str = ltrim( ' Whitespace ' ); // returns 'Whitespace ' str = ltrim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/base/lowercase/README.md b/lib/node_modules/@stdlib/string/base/lowercase/README.md index 6766fc707868..17fda7ce6bc1 100644 --- a/lib/node_modules/@stdlib/string/base/lowercase/README.md +++ b/lib/node_modules/@stdlib/string/base/lowercase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var lowercase = require( '@stdlib/string/base/lowercase' ); +const lowercase = require( '@stdlib/string/base/lowercase' ); ``` #### lowercase( str ) @@ -41,7 +41,7 @@ var lowercase = require( '@stdlib/string/base/lowercase' ); Converts a string to lowercase. ```javascript -var str = lowercase( 'bEEp' ); +const str = lowercase( 'bEEp' ); // returns 'beep' ``` @@ -56,9 +56,9 @@ var str = lowercase( 'bEEp' ); ```javascript -var lowercase = require( '@stdlib/string/base/lowercase' ); +const lowercase = require( '@stdlib/string/base/lowercase' ); -var str = lowercase( 'Beep' ); +let str = lowercase( 'Beep' ); // returns 'beep' str = lowercase( 'BeEp' ); diff --git a/lib/node_modules/@stdlib/string/base/pascalcase/README.md b/lib/node_modules/@stdlib/string/base/pascalcase/README.md index 4094e176644b..36abf7feb065 100644 --- a/lib/node_modules/@stdlib/string/base/pascalcase/README.md +++ b/lib/node_modules/@stdlib/string/base/pascalcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var pascalcase = require( '@stdlib/string/base/pascalcase' ); +const pascalcase = require( '@stdlib/string/base/pascalcase' ); ``` #### pascalcase( str ) @@ -37,7 +37,7 @@ var pascalcase = require( '@stdlib/string/base/pascalcase' ); Converts a string to Pascal case. ```javascript -var out = pascalcase( 'foo bar' ); +let out = pascalcase( 'foo bar' ); // returns 'FooBar' out = pascalcase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = pascalcase( '--foo-bar--' ); ## Examples ```javascript -var pascalcase = require( '@stdlib/string/base/pascalcase' ); +const pascalcase = require( '@stdlib/string/base/pascalcase' ); -var str = 'Hello World!'; -var out = pascalcase( str ); +let str = 'Hello World!'; +let out = pascalcase( str ); // returns 'HelloWorld' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/base/percent-encode/README.md b/lib/node_modules/@stdlib/string/base/percent-encode/README.md index 51fbc4ad663b..0dae7817c260 100644 --- a/lib/node_modules/@stdlib/string/base/percent-encode/README.md +++ b/lib/node_modules/@stdlib/string/base/percent-encode/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var percentEncode = require( '@stdlib/string/base/percent-encode' ); +const percentEncode = require( '@stdlib/string/base/percent-encode' ); ``` #### percentEncode( str ) @@ -45,7 +45,7 @@ var percentEncode = require( '@stdlib/string/base/percent-encode' ); [Percent-encodes][percent-encoding] a [UTF-16][utf-16] encoded string according to [RFC 3986][rfc-3986-percent-encoding]. ```javascript -var out = percentEncode( '☃' ); +const out = percentEncode( '☃' ); // returns '%E2%98%83' ``` @@ -62,7 +62,7 @@ var out = percentEncode( '☃' ); - The function [percent-encodes][percent-encoding] an **entire** string. Hence, if provided a URI, the function [percent-encodes][percent-encoding] the entire URI. ```javascript - var out = percentEncode( 'https://en.wikipedia.org/wiki/Mode_(statistics)' ); + const out = percentEncode( 'https://en.wikipedia.org/wiki/Mode_(statistics)' ); // returns 'https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMode_%28statistics%29' ``` @@ -81,9 +81,9 @@ var out = percentEncode( '☃' ); ```javascript -var percentEncode = require( '@stdlib/string/base/percent-encode' ); +const percentEncode = require( '@stdlib/string/base/percent-encode' ); -var values = [ +const values = [ 'Ladies + Gentlemen', 'An encoded string!', 'Dogs, Cats & Mice', @@ -91,8 +91,7 @@ var values = [ 'æ', '𐐷' ]; -var i; -for ( i = 0; i < values.length; i++ ) { +for ( let i = 0; i < values.length; i++ ) { console.log( '%s: %s', values[ i ], percentEncode( values[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/base/remove-first-code-point/README.md b/lib/node_modules/@stdlib/string/base/remove-first-code-point/README.md index d202c8093810..80ebadb5db5b 100644 --- a/lib/node_modules/@stdlib/string/base/remove-first-code-point/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-first-code-point/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeFirstCodePoint = require( '@stdlib/string/base/remove-first-code-point' ); +const removeFirstCodePoint = require( '@stdlib/string/base/remove-first-code-point' ); ``` #### removeFirstCodePoint( str, n ) @@ -35,7 +35,7 @@ var removeFirstCodePoint = require( '@stdlib/string/base/remove-first-code-point Removes the first `n` Unicode code points of a string. ```javascript -var out = removeFirstCodePoint( 'last man standing', 1 ); +let out = removeFirstCodePoint( 'last man standing', 1 ); // returns 'ast man standing' out = removeFirstCodePoint( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = removeFirstCodePoint( 'foo bar', 10 ); ```javascript -var removeFirstCodePoint = require( '@stdlib/string/base/remove-first-code-point' ); +const removeFirstCodePoint = require( '@stdlib/string/base/remove-first-code-point' ); -var str = removeFirstCodePoint( 'presidential election', 1 ); +let str = removeFirstCodePoint( 'presidential election', 1 ); // returns 'residential election' str = removeFirstCodePoint( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-first-grapheme-cluster/README.md b/lib/node_modules/@stdlib/string/base/remove-first-grapheme-cluster/README.md index d35e9dcc74ad..1be77aa4d8df 100644 --- a/lib/node_modules/@stdlib/string/base/remove-first-grapheme-cluster/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-first-grapheme-cluster/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' ); +const removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' ); ``` #### removeFirstGraphemeCluster( str, n ) @@ -39,7 +39,7 @@ Removes the first `n` grapheme clusters (i.e., user-perceived characters) of a s ```javascript -var out = removeFirstGraphemeCluster( 'last man standing', 1 ); +let out = removeFirstGraphemeCluster( 'last man standing', 1 ); // returns 'ast man standing' out = removeFirstGraphemeCluster( 'Hidden Treasures', 1 ); @@ -65,9 +65,9 @@ out = removeFirstGraphemeCluster( 'foo bar', 10 ); ```javascript -var removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' ); +const removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' ); -var str = removeFirstGraphemeCluster( 'presidential election', 1 ); +let str = removeFirstGraphemeCluster( 'presidential election', 1 ); // returns 'residential election' str = removeFirstGraphemeCluster( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-first/README.md b/lib/node_modules/@stdlib/string/base/remove-first/README.md index 425262d23296..14f9f5571670 100644 --- a/lib/node_modules/@stdlib/string/base/remove-first/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-first/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeFirst = require( '@stdlib/string/base/remove-first' ); +const removeFirst = require( '@stdlib/string/base/remove-first' ); ``` #### removeFirst( str, n ) @@ -35,7 +35,7 @@ var removeFirst = require( '@stdlib/string/base/remove-first' ); Removes the first `n` UTF-16 code units of a string. ```javascript -var out = removeFirst( 'last man standing', 1 ); +let out = removeFirst( 'last man standing', 1 ); // returns 'ast man standing' out = removeFirst( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = removeFirst( 'foo bar', 10 ); ```javascript -var removeFirst = require( '@stdlib/string/base/remove-first' ); +const removeFirst = require( '@stdlib/string/base/remove-first' ); -var str = removeFirst( 'presidential election', 1 ); +let str = removeFirst( 'presidential election', 1 ); // returns 'residential election' str = removeFirst( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-last-code-point/README.md b/lib/node_modules/@stdlib/string/base/remove-last-code-point/README.md index e1afa61780dd..ea9ef385ecaa 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last-code-point/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-last-code-point/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeLastCodePoint = require( '@stdlib/string/base/remove-last-code-point' ); +const removeLastCodePoint = require( '@stdlib/string/base/remove-last-code-point' ); ``` #### removeLastCodePoint( str, n ) @@ -35,7 +35,7 @@ var removeLastCodePoint = require( '@stdlib/string/base/remove-last-code-point' Removes the last `n` Unicode code points of a string. ```javascript -var out = removeLastCodePoint( 'last man standing', 1 ); +let out = removeLastCodePoint( 'last man standing', 1 ); // returns 'last man standin' out = removeLastCodePoint( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = removeLastCodePoint( 'foo bar', 10 ); ```javascript -var removeLastCodePoint = require( '@stdlib/string/base/remove-last-code-point' ); +const removeLastCodePoint = require( '@stdlib/string/base/remove-last-code-point' ); -var str = removeLastCodePoint( 'presidential election', 1 ); +let str = removeLastCodePoint( 'presidential election', 1 ); // returns 'presidential electio' str = removeLastCodePoint( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/README.md b/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/README.md index 18938ce087e2..9c6a54ff2501 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-last-grapheme-cluster/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var removeLastGraphemeCluster = require( '@stdlib/string/base/remove-last-grapheme-cluster' ); +const removeLastGraphemeCluster = require( '@stdlib/string/base/remove-last-grapheme-cluster' ); ``` #### removeLastGraphemeCluster( str, n ) @@ -39,7 +39,7 @@ Removes the last `n` grapheme clusters (i.e., user-perceived characters) of a st ```javascript -var out = removeLastGraphemeCluster( 'last man standing', 1 ); +let out = removeLastGraphemeCluster( 'last man standing', 1 ); // returns 'last man standin' out = removeLastGraphemeCluster( 'Hidden Treasures', 1 ); @@ -65,9 +65,9 @@ out = removeLastGraphemeCluster( 'foo bar', 10 ); ```javascript -var removeLastGraphemeCluster = require( '@stdlib/string/base/remove-last-grapheme-cluster' ); +const removeLastGraphemeCluster = require( '@stdlib/string/base/remove-last-grapheme-cluster' ); -var str = removeLastGraphemeCluster( 'presidential election', 1 ); +let str = removeLastGraphemeCluster( 'presidential election', 1 ); // returns 'presidential electio' str = removeLastGraphemeCluster( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/remove-last/README.md b/lib/node_modules/@stdlib/string/base/remove-last/README.md index 22fef865238c..99bd3ad7f7ec 100644 --- a/lib/node_modules/@stdlib/string/base/remove-last/README.md +++ b/lib/node_modules/@stdlib/string/base/remove-last/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeLast = require( '@stdlib/string/base/remove-last' ); +const removeLast = require( '@stdlib/string/base/remove-last' ); ``` #### removeLast( str, n ) @@ -35,7 +35,7 @@ var removeLast = require( '@stdlib/string/base/remove-last' ); Removes the last `n` UTF-16 code units of a string. ```javascript -var out = removeLast( 'last man standing', 1 ); +let out = removeLast( 'last man standing', 1 ); // returns 'last man standin' out = removeLast( 'Hidden Treasures', 1 ); @@ -59,9 +59,9 @@ out = removeLast( 'foo bar', 10 ); ```javascript -var removeLast = require( '@stdlib/string/base/remove-last' ); +const removeLast = require( '@stdlib/string/base/remove-last' ); -var str = removeLast( 'presidential election', 1 ); +let str = removeLast( 'presidential election', 1 ); // returns 'presidential electio' str = removeLast( 'JavaScript', 1 ); diff --git a/lib/node_modules/@stdlib/string/base/repeat/README.md b/lib/node_modules/@stdlib/string/base/repeat/README.md index af32a4babcf1..9fe9cc480436 100644 --- a/lib/node_modules/@stdlib/string/base/repeat/README.md +++ b/lib/node_modules/@stdlib/string/base/repeat/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var repeat = require( '@stdlib/string/base/repeat' ); +const repeat = require( '@stdlib/string/base/repeat' ); ``` #### repeat( str, n ) @@ -35,7 +35,7 @@ var repeat = require( '@stdlib/string/base/repeat' ); Repeats a string `n` times and returns the concatenated result. ```javascript -var str = repeat( 'a', 5 ); +let str = repeat( 'a', 5 ); // returns 'aaaaa' str = repeat( '', 100 ); @@ -56,11 +56,10 @@ str = repeat( 'beep', 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var repeat = require( '@stdlib/string/base/repeat' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const repeat = require( '@stdlib/string/base/repeat' ); -var i; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( repeat( 'beep', discreteUniform( 0, 3 ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/base/replace-after-last/README.md b/lib/node_modules/@stdlib/string/base/replace-after-last/README.md index 7caa3d5ab602..187b2e9c913e 100644 --- a/lib/node_modules/@stdlib/string/base/replace-after-last/README.md +++ b/lib/node_modules/@stdlib/string/base/replace-after-last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var replaceAfterLast = require( '@stdlib/string/base/replace-after-last' ); +const replaceAfterLast = require( '@stdlib/string/base/replace-after-last' ); ``` #### replaceAfterLast( str, search, replacement, fromIndex ) @@ -45,8 +45,8 @@ var replaceAfterLast = require( '@stdlib/string/base/replace-after-last' ); Replaces the substring after the last occurrence of a specified search string. ```javascript -var str = 'beep boop'; -var out = replaceAfterLast( str, ' ', 'loop', str.length ); +const str = 'beep boop'; +let out = replaceAfterLast( str, ' ', 'loop', str.length ); // returns 'beep loop' out = replaceAfterLast( str, 'o', 'bar', str.length ); @@ -56,14 +56,14 @@ out = replaceAfterLast( str, 'o', 'bar', str.length ); To begin searching from a specific index, provide a corresponding `fromIndex` argument. ```javascript -var out = replaceAfterLast( 'beep boop beep', ' ', 'loop', 6 ); +const out = replaceAfterLast( 'beep boop beep', ' ', 'loop', 6 ); // returns 'beep loop' ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`. ```javascript -var out = replaceAfterLast( 'beep boop beep', ' ', 'loop', -1 ); +const out = replaceAfterLast( 'beep boop beep', ' ', 'loop', -1 ); // returns 'beep boop loop' ``` @@ -94,10 +94,10 @@ var out = replaceAfterLast( 'beep boop beep', ' ', 'loop', -1 ); ```javascript -var replaceAfterLast = require( '@stdlib/string/base/replace-after-last' ); +const replaceAfterLast = require( '@stdlib/string/base/replace-after-last' ); -var str = 'beep boop'; -var out = replaceAfterLast( str, 'p', 'see', str.length ); +let str = 'beep boop'; +let out = replaceAfterLast( str, 'p', 'see', str.length ); // returns 'beep boopsee' str = 'Hello World!'; diff --git a/lib/node_modules/@stdlib/string/base/replace-after/README.md b/lib/node_modules/@stdlib/string/base/replace-after/README.md index 4eca6a86f550..398e6be5717e 100644 --- a/lib/node_modules/@stdlib/string/base/replace-after/README.md +++ b/lib/node_modules/@stdlib/string/base/replace-after/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var replaceAfter = require( '@stdlib/string/base/replace-after' ); +const replaceAfter = require( '@stdlib/string/base/replace-after' ); ``` #### replaceAfter( str, search, replacement, fromIndex ) @@ -45,7 +45,7 @@ var replaceAfter = require( '@stdlib/string/base/replace-after' ); Replaces the substring after the first occurrence of a specified search string. ```javascript -var out = replaceAfter( 'beep boop', ' ', 'loop', 0 ); +let out = replaceAfter( 'beep boop', ' ', 'loop', 0 ); // returns 'beep loop' out = replaceAfter( 'beep boop', 'o', 'bar', 0 ); @@ -55,14 +55,14 @@ out = replaceAfter( 'beep boop', 'o', 'bar', 0 ); To begin searching from a specific index, provide a corresponding `fromIndex` argument. ```javascript -var out = replaceAfter( 'beep boop beep baz', 'beep', 'foo', 5 ); +const out = replaceAfter( 'beep boop beep baz', 'beep', 'foo', 5 ); // return 'beep boop beepfoo' ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`. ```javascript -var out = replaceAfter( 'beep boop beep', ' ', 'loop', -6 ); +const out = replaceAfter( 'beep boop beep', ' ', 'loop', -6 ); // returns 'beep boop loop' ``` @@ -93,9 +93,9 @@ var out = replaceAfter( 'beep boop beep', ' ', 'loop', -6 ); ```javascript -var replaceAfter = require( '@stdlib/string/base/replace-after' ); +const replaceAfter = require( '@stdlib/string/base/replace-after' ); -var out = replaceAfter( 'beep boop', 'p', 'see', 0 ); +let out = replaceAfter( 'beep boop', 'p', 'see', 0 ); // returns 'beepsee' out = replaceAfter( 'Hello World!', 'xyz', 'foo', 0 ); diff --git a/lib/node_modules/@stdlib/string/base/replace-before-last/README.md b/lib/node_modules/@stdlib/string/base/replace-before-last/README.md index 03876383e5a4..862e2f189f27 100644 --- a/lib/node_modules/@stdlib/string/base/replace-before-last/README.md +++ b/lib/node_modules/@stdlib/string/base/replace-before-last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' ); +const replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' ); ``` #### replaceBeforeLast( str, search, replacement, fromIndex ) @@ -45,8 +45,8 @@ var replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' ); Replaces the substring before the last occurrence of a specified search string. ```javascript -var str = 'beep boop'; -var out = replaceBeforeLast( str, ' ', 'loop', str.length ); +const str = 'beep boop'; +let out = replaceBeforeLast( str, ' ', 'loop', str.length ); // returns 'loop boop' out = replaceBeforeLast( str, 'o', 'bar', str.length ); @@ -56,14 +56,14 @@ out = replaceBeforeLast( str, 'o', 'bar', str.length ); To begin searching from a specific index, provide a corresponding `fromIndex` argument. ```javascript -var out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', 5 ); +const out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', 5 ); // returns 'loop boop beep' ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`. ```javascript -var out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', -1 ); +const out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', -1 ); // returns 'loop beep' ``` @@ -94,10 +94,10 @@ var out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', -1 ); ```javascript -var replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' ); +const replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' ); -var str = 'beep boop'; -var out = replaceBeforeLast( str, 'p', 'see', str.length ); +let str = 'beep boop'; +let out = replaceBeforeLast( str, 'p', 'see', str.length ); // returns 'seep' str = 'Hello World!'; diff --git a/lib/node_modules/@stdlib/string/base/replace-before/README.md b/lib/node_modules/@stdlib/string/base/replace-before/README.md index 12a41c3094ab..a6c586d85748 100644 --- a/lib/node_modules/@stdlib/string/base/replace-before/README.md +++ b/lib/node_modules/@stdlib/string/base/replace-before/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var replaceBefore = require( '@stdlib/string/base/replace-before' ); +const replaceBefore = require( '@stdlib/string/base/replace-before' ); ``` #### replaceBefore( str, search, replacement, fromIndex ) @@ -45,7 +45,7 @@ var replaceBefore = require( '@stdlib/string/base/replace-before' ); Replaces the substring before the first occurrence of a specified search string. ```javascript -var out = replaceBefore( 'beep boop', ' ', 'loop', 0 ); +let out = replaceBefore( 'beep boop', ' ', 'loop', 0 ); // returns 'loop boop' out = replaceBefore( 'beep boop', 'o', 'bar', 0 ); @@ -55,14 +55,14 @@ out = replaceBefore( 'beep boop', 'o', 'bar', 0 ); To begin searching from a specific index, provide a corresponding `fromIndex` argument. ```javascript -var out = replaceBefore( 'beep boop', 'p', 'bar', 5 ); +const out = replaceBefore( 'beep boop', 'p', 'bar', 5 ); // returns 'barp' ``` If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`. ```javascript -var out = replaceBefore( 'beep boop beep', ' ', 'loop', -6 ); +const out = replaceBefore( 'beep boop beep', ' ', 'loop', -6 ); // returns 'loop beep' ``` @@ -93,9 +93,9 @@ var out = replaceBefore( 'beep boop beep', ' ', 'loop', -6 ); ```javascript -var replaceBefore = require( '@stdlib/string/base/replace-before' ); +const replaceBefore = require( '@stdlib/string/base/replace-before' ); -var out = replaceBefore( 'beep boop', 'p', 'see', 0 ); +let out = replaceBefore( 'beep boop', 'p', 'see', 0 ); // returns 'seep boop' out = replaceBefore( 'Hello World!', 'xyz', 'foo', 0 ); diff --git a/lib/node_modules/@stdlib/string/base/replace/README.md b/lib/node_modules/@stdlib/string/base/replace/README.md index 06875d8bcb11..6974932c186f 100644 --- a/lib/node_modules/@stdlib/string/base/replace/README.md +++ b/lib/node_modules/@stdlib/string/base/replace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var replace = require( '@stdlib/string/base/replace' ); +const replace = require( '@stdlib/string/base/replace' ); ``` #### replace( str, search, newval ) @@ -35,7 +35,7 @@ var replace = require( '@stdlib/string/base/replace' ); Replaces search occurrences with a replacement string. ```javascript -var out = replace( 'beep', /e/g, 'o' ); +const out = replace( 'beep', /e/g, 'o' ); // returns 'boop' ``` @@ -45,8 +45,8 @@ If provided a function as the third argument, the function is invoked for each m function replacer( match, p1 ) { return '/' + p1 + '/'; } -var str = 'Oranges and lemons'; -var out = replace( str, /([^\s]+)/gi, replacer ); +const str = 'Oranges and lemons'; +const out = replace( str, /([^\s]+)/gi, replacer ); // returns '/Oranges/ /and/ /lemons/' ``` @@ -71,16 +71,16 @@ var out = replace( str, /([^\s]+)/gi, replacer ); ```javascript -var capitalize = require( '@stdlib/string/base/capitalize' ); -var replace = require( '@stdlib/string/base/replace' ); +const capitalize = require( '@stdlib/string/base/capitalize' ); +const replace = require( '@stdlib/string/base/replace' ); -var out = replace( 'Hello World', /world/i, 'Mr. President' ); +let out = replace( 'Hello World', /world/i, 'Mr. President' ); // returns 'Hello Mr. President' function replacer( match, p1 ) { return capitalize( p1 ); } -var str = 'Oranges and lemons say the bells of St. Clement\'s'; +const str = 'Oranges and lemons say the bells of St. Clement\'s'; out = replace( str, /([^\s]*)/gi, replacer ); // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s' ``` diff --git a/lib/node_modules/@stdlib/string/base/reverse-code-points/README.md b/lib/node_modules/@stdlib/string/base/reverse-code-points/README.md index c214dd320694..2c84c09c12e6 100644 --- a/lib/node_modules/@stdlib/string/base/reverse-code-points/README.md +++ b/lib/node_modules/@stdlib/string/base/reverse-code-points/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' ); +const reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' ); ``` #### reverseCodePoints( str ) @@ -35,7 +35,7 @@ var reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' ); Reverses the Unicode code points of a string. ```javascript -var out = reverseCodePoints( 'last man standing' ); +let out = reverseCodePoints( 'last man standing' ); // returns 'gnidnats nam tsal' out = reverseCodePoints( 'Hidden Treasures' ); @@ -53,12 +53,14 @@ out = reverseCodePoints( 'foo bar' ); ## Examples + + ```javascript -var reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' ); +const reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' ); -var str = reverseCodePoints( 'presidential election' ); +let str = reverseCodePoints( 'presidential election' ); // returns 'noitcele laitnediserp' str = reverseCodePoints( 'JavaScript' ); diff --git a/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/README.md b/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/README.md index 3cf6926c1d77..eac4e9d9a973 100644 --- a/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/README.md +++ b/lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clusters' ); +const reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clusters' ); ``` #### reverseGraphemeClusters( str ) @@ -35,7 +35,7 @@ var reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clu Reverses the grapheme clusters (i.e., user-perceived characters) of a string. ```javascript -var out = reverseGraphemeClusters( 'last man standing' ); +let out = reverseGraphemeClusters( 'last man standing' ); // returns 'gnidnats nam tsal' out = reverseGraphemeClusters( 'Hidden Treasures' ); @@ -56,9 +56,9 @@ out = reverseGraphemeClusters( 'foo bar' ); ```javascript -var reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clusters' ); +const reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clusters' ); -var str = reverseGraphemeClusters( 'presidential election' ); +let str = reverseGraphemeClusters( 'presidential election' ); // returns 'noitcele laitnediserp' str = reverseGraphemeClusters( 'JavaScript' ); diff --git a/lib/node_modules/@stdlib/string/base/reverse/README.md b/lib/node_modules/@stdlib/string/base/reverse/README.md index 9000fc0ca4d0..d402adc6c813 100644 --- a/lib/node_modules/@stdlib/string/base/reverse/README.md +++ b/lib/node_modules/@stdlib/string/base/reverse/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reverse = require( '@stdlib/string/base/reverse' ); +const reverse = require( '@stdlib/string/base/reverse' ); ``` #### reverse( str ) @@ -35,7 +35,7 @@ var reverse = require( '@stdlib/string/base/reverse' ); Reverses the UTF-16 code units of a string. ```javascript -var out = reverse( 'last man standing' ); +let out = reverse( 'last man standing' ); // returns 'gnidnats nam tsal' out = reverse( 'Hidden Treasures' ); @@ -56,9 +56,9 @@ out = reverse( 'foo bar' ); ```javascript -var reverse = require( '@stdlib/string/base/reverse' ); +const reverse = require( '@stdlib/string/base/reverse' ); -var str = reverse( 'presidential election' ); +let str = reverse( 'presidential election' ); // returns 'noitcele laitnediserp' str = reverse( 'JavaScript' ); diff --git a/lib/node_modules/@stdlib/string/base/right-pad/README.md b/lib/node_modules/@stdlib/string/base/right-pad/README.md index 380800a7d887..94e4a305a5a3 100644 --- a/lib/node_modules/@stdlib/string/base/right-pad/README.md +++ b/lib/node_modules/@stdlib/string/base/right-pad/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rpad = require( '@stdlib/string/base/right-pad' ); +const rpad = require( '@stdlib/string/base/right-pad' ); ``` #### rpad( str, len, pad ) @@ -35,7 +35,7 @@ var rpad = require( '@stdlib/string/base/right-pad' ); Right pads a string such that the padded string has a length of **at least** `len`. ```javascript -var str = rpad( 'a', 5, ' ' ); +let str = rpad( 'a', 5, ' ' ); // returns 'a ' str = rpad( 'beep', 10, 'b' ); @@ -56,7 +56,7 @@ str = rpad( 'boop', 12, 'beep' ); - An output string is **not** guaranteed to have a length of **exactly** `len`, but to have a length of **at least** `len`. To generate a padded string having a length equal to `len` ```javascript - var str = rpad( 'boop', 10, 'beep' ); // => length 12 + let str = rpad( 'boop', 10, 'beep' ); // => length 12 // returns 'boopbeepbeep' str = str.substring( 0, 10 ); // => length 10 @@ -77,25 +77,25 @@ str = rpad( 'boop', 12, 'beep' ); ```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var papply = require( '@stdlib/utils/papply' ); -var papplyRight = require( '@stdlib/utils/papply-right' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); -var map = require( '@stdlib/utils/map' ); -var logEach = require( '@stdlib/console/log-each' ); -var rpad = require( '@stdlib/string/base/right-pad' ); +const discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +const papply = require( '@stdlib/utils/papply' ); +const papplyRight = require( '@stdlib/utils/papply-right' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const map = require( '@stdlib/utils/map' ); +const logEach = require( '@stdlib/console/log-each' ); +const rpad = require( '@stdlib/string/base/right-pad' ); // Define a string to pad: -var str = 'beep'; +const str = 'beep'; // Generate random lengths: -var lens = discreteUniform( 10, str.length, str.length+10 ); +const lens = discreteUniform( 10, str.length, str.length+10 ); // Create a function for creating padded strings: -var fcn = naryFunction( papply( papplyRight( rpad, 'b' ), str ), 1 ); +const fcn = naryFunction( papply( papplyRight( rpad, 'b' ), str ), 1 ); // Generate padded strings: -var out = map( lens, fcn ); +const out = map( lens, fcn ); // Print results: logEach( '%s', out ); diff --git a/lib/node_modules/@stdlib/string/base/right-trim/README.md b/lib/node_modules/@stdlib/string/base/right-trim/README.md index 5b836ccaa828..c44afc106987 100644 --- a/lib/node_modules/@stdlib/string/base/right-trim/README.md +++ b/lib/node_modules/@stdlib/string/base/right-trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rtrim = require( '@stdlib/string/base/right-trim' ); +const rtrim = require( '@stdlib/string/base/right-trim' ); ``` #### rtrim( str ) @@ -35,7 +35,7 @@ var rtrim = require( '@stdlib/string/base/right-trim' ); Trims whitespace from the end of a string. ```javascript -var out = rtrim( ' \t\t\n Beep \r\n\t ' ); +const out = rtrim( ' \t\t\n Beep \r\n\t ' ); // returns ' \t\t\n Beep' ``` @@ -76,9 +76,9 @@ var out = rtrim( ' \t\t\n Beep \r\n\t ' ); ```javascript -var rtrim = require( '@stdlib/string/base/right-trim' ); +const rtrim = require( '@stdlib/string/base/right-trim' ); -var out = rtrim( ' Whitespace ' ); +let out = rtrim( ' Whitespace ' ); // returns ' Whitespace' out = rtrim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/base/snakecase/README.md b/lib/node_modules/@stdlib/string/base/snakecase/README.md index f4d0bbb2d24c..a999ed3772e7 100644 --- a/lib/node_modules/@stdlib/string/base/snakecase/README.md +++ b/lib/node_modules/@stdlib/string/base/snakecase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var snakecase = require( '@stdlib/string/base/snakecase' ); +const snakecase = require( '@stdlib/string/base/snakecase' ); ``` #### snakecase( str ) @@ -37,7 +37,7 @@ var snakecase = require( '@stdlib/string/base/snakecase' ); Converts a string to snake case. ```javascript -var str = snakecase( 'Foo Bar' ); +let str = snakecase( 'Foo Bar' ); // returns 'foo_bar' str = snakecase( 'I am a tiny little house' ); @@ -58,10 +58,10 @@ str = snakecase( 'Hello World!' ); ## Examples ```javascript -var snakecase = require( '@stdlib/string/base/snakecase' ); +const snakecase = require( '@stdlib/string/base/snakecase' ); -var str = 'foo bar baz'; -var out = snakecase( str ); +let str = 'foo bar baz'; +let out = snakecase( str ); // returns 'foo_bar_baz' str = 'foo_baz'; diff --git a/lib/node_modules/@stdlib/string/base/startcase/README.md b/lib/node_modules/@stdlib/string/base/startcase/README.md index d8a86f44e6aa..7261dd2eb553 100644 --- a/lib/node_modules/@stdlib/string/base/startcase/README.md +++ b/lib/node_modules/@stdlib/string/base/startcase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var startcase = require( '@stdlib/string/base/startcase' ); +const startcase = require( '@stdlib/string/base/startcase' ); ``` #### startcase( str ) @@ -41,7 +41,7 @@ var startcase = require( '@stdlib/string/base/startcase' ); Capitalizes the first letter of each word in a string. ```javascript -var str = startcase( 'beep boop a foo bar' ); +const str = startcase( 'beep boop a foo bar' ); // returns 'Beep Boop A Foo Bar' ``` @@ -56,9 +56,9 @@ var str = startcase( 'beep boop a foo bar' ); ```javascript -var startcase = require( '@stdlib/string/base/startcase' ); +const startcase = require( '@stdlib/string/base/startcase' ); -var str = startcase( 'beep boop foo bar' ); +let str = startcase( 'beep boop foo bar' ); // returns 'Beep Boop Foo Bar' str = startcase( 'Beep' ); diff --git a/lib/node_modules/@stdlib/string/base/starts-with/README.md b/lib/node_modules/@stdlib/string/base/starts-with/README.md index abf2181872c8..248fd714e2cf 100644 --- a/lib/node_modules/@stdlib/string/base/starts-with/README.md +++ b/lib/node_modules/@stdlib/string/base/starts-with/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var startsWith = require( '@stdlib/string/base/starts-with' ); +const startsWith = require( '@stdlib/string/base/starts-with' ); ``` #### startsWith( str, search, position ) @@ -41,9 +41,9 @@ var startsWith = require( '@stdlib/string/base/starts-with' ); Tests if a string starts with the characters of another string. ```javascript -var str = 'To be, or not to be, that is the question.'; +const str = 'To be, or not to be, that is the question.'; -var bool = startsWith( str, 'To be', 0 ); +let bool = startsWith( str, 'To be', 0 ); // returns true bool = startsWith( str, 'to be', 0 ); @@ -53,9 +53,9 @@ bool = startsWith( str, 'to be', 0 ); To search from a specific character index, provide a `position` value (zero-based). If provided a negative `position`, the start index is determined relative to the string end (i.e., `pos = str.length + position`). ```javascript -var str = 'Remember the story I used to tell you when you were a boy?'; +const str = 'Remember the story I used to tell you when you were a boy?'; -var bool = startsWith( str, 'the story', 0 ); +let bool = startsWith( str, 'the story', 0 ); // returns false bool = startsWith( str, 'the story', 9 ); @@ -68,9 +68,9 @@ bool = startsWith( str, 'you', -15 ); If provided an empty `search` string, the function **always** returns `true`. ```javascript -var str = 'beep boop'; +const str = 'beep boop'; -var bool = startsWith( str, '', 0 ); +const bool = startsWith( str, '', 0 ); // returns true ``` @@ -99,11 +99,11 @@ var bool = startsWith( str, '', 0 ); ```javascript -var startsWith = require( '@stdlib/string/base/starts-with' ); +const startsWith = require( '@stdlib/string/base/starts-with' ); -var str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; +const str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; -var bool = startsWith( str, 'Fair', 0 ); +let bool = startsWith( str, 'Fair', 0 ); // returns true bool = startsWith( str, 'fair', 0 ); diff --git a/lib/node_modules/@stdlib/string/base/stickycase/README.md b/lib/node_modules/@stdlib/string/base/stickycase/README.md index 6c4953d90fd9..07b1f08c7f90 100644 --- a/lib/node_modules/@stdlib/string/base/stickycase/README.md +++ b/lib/node_modules/@stdlib/string/base/stickycase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var stickycase = require( '@stdlib/string/base/stickycase' ); +const stickycase = require( '@stdlib/string/base/stickycase' ); ``` #### stickycase( str\[, p] ) @@ -37,16 +37,16 @@ var stickycase = require( '@stdlib/string/base/stickycase' ); Converts a string to sticky case, where each character in the input string is randomly converted to either uppercase or lowercase. ```javascript -var str = 'hello world'; -var out = stickycase( 'hello world' ); +const str = 'hello world'; +const out = stickycase( 'hello world' ); // returns ``` By default, the probability for any character to be capitalized is `0.5`. To set a different probability, provide a `p` argument. ```javascript -var str = 'welcome!'; -var out = stickycase( 'welcome!', 0.2 ); +let str = 'welcome!'; +let out = stickycase( 'welcome!', 0.2 ); // returns str = 'good morning'; @@ -65,10 +65,10 @@ out = stickycase( 'good morning', 0.8 ); ## Examples ```javascript -var stickycase = require( '@stdlib/string/base/stickycase' ); +const stickycase = require( '@stdlib/string/base/stickycase' ); -var str = 'Hello World!'; -var out = stickycase( str ); +let str = 'Hello World!'; +let out = stickycase( str ); // returns // returns diff --git a/lib/node_modules/@stdlib/string/base/trim/README.md b/lib/node_modules/@stdlib/string/base/trim/README.md index a27e2e2d63a1..ab60a94e1592 100644 --- a/lib/node_modules/@stdlib/string/base/trim/README.md +++ b/lib/node_modules/@stdlib/string/base/trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var trim = require( '@stdlib/string/base/trim' ); +const trim = require( '@stdlib/string/base/trim' ); ``` #### trim( str ) @@ -35,7 +35,7 @@ var trim = require( '@stdlib/string/base/trim' ); Trims whitespace characters from the beginning and end of a string. ```javascript -var out = trim( ' \t\t\n Beep \r\n\t ' ); +const out = trim( ' \t\t\n Beep \r\n\t ' ); // returns 'Beep' ``` @@ -76,9 +76,9 @@ var out = trim( ' \t\t\n Beep \r\n\t ' ); ```javascript -var trim = require( '@stdlib/string/base/trim' ); +const trim = require( '@stdlib/string/base/trim' ); -var out = trim( ' Whitespace ' ); +let out = trim( ' Whitespace ' ); // returns 'Whitespace' out = trim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/base/truncate-middle/README.md b/lib/node_modules/@stdlib/string/base/truncate-middle/README.md index 3f50acde8557..0864f1105938 100644 --- a/lib/node_modules/@stdlib/string/base/truncate-middle/README.md +++ b/lib/node_modules/@stdlib/string/base/truncate-middle/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var truncateMiddle = require( '@stdlib/string/base/truncate-middle' ); +const truncateMiddle = require( '@stdlib/string/base/truncate-middle' ); ``` #### truncateMiddle( str, len, seq ) @@ -35,7 +35,7 @@ var truncateMiddle = require( '@stdlib/string/base/truncate-middle' ); Truncates the middle UTF-16 code units of a string to return a string having a specified length. ```javascript -var out = truncateMiddle( 'beep boop', 7, '...' ); +let out = truncateMiddle( 'beep boop', 7, '...' ); // returns 'be...op' out = truncateMiddle( 'beep boop', 7, '!' ); @@ -53,13 +53,15 @@ out = truncateMiddle( 'beep boop', 7, '!!!' ); ## Examples + + ```javascript -var truncateMiddle = require( '@stdlib/string/base/truncate-middle' ); +const truncateMiddle = require( '@stdlib/string/base/truncate-middle' ); -var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; -var out = truncateMiddle( str, 15, '...' ); +let str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; +let out = truncateMiddle( str, 15, '...' ); // returns 'Lorem ... elit.' str = 'To be or not to be, that is the question'; diff --git a/lib/node_modules/@stdlib/string/base/uncapitalize/README.md b/lib/node_modules/@stdlib/string/base/uncapitalize/README.md index 9b1c2e759337..bddfa4d83d52 100644 --- a/lib/node_modules/@stdlib/string/base/uncapitalize/README.md +++ b/lib/node_modules/@stdlib/string/base/uncapitalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uncapitalize = require( '@stdlib/string/base/uncapitalize' ); +const uncapitalize = require( '@stdlib/string/base/uncapitalize' ); ``` #### uncapitalize( str ) @@ -35,7 +35,7 @@ var uncapitalize = require( '@stdlib/string/base/uncapitalize' ); Uncapitalizes the first character of a string. ```javascript -var out = uncapitalize( 'Last man standing' ); +let out = uncapitalize( 'Last man standing' ); // returns 'last man standing' out = uncapitalize( 'Hidden Treasures' ); @@ -53,9 +53,9 @@ out = uncapitalize( 'Hidden Treasures' ); ```javascript -var uncapitalize = require( '@stdlib/string/base/uncapitalize' ); +const uncapitalize = require( '@stdlib/string/base/uncapitalize' ); -var out = uncapitalize( 'Last man standing' ); +let out = uncapitalize( 'Last man standing' ); // returns 'last man standing' out = uncapitalize( 'Presidential election' ); diff --git a/lib/node_modules/@stdlib/string/base/uppercase/README.md b/lib/node_modules/@stdlib/string/base/uppercase/README.md index fb678585e5c1..bf3a01dc9109 100644 --- a/lib/node_modules/@stdlib/string/base/uppercase/README.md +++ b/lib/node_modules/@stdlib/string/base/uppercase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var uppercase = require( '@stdlib/string/base/uppercase' ); +const uppercase = require( '@stdlib/string/base/uppercase' ); ``` #### uppercase( str ) @@ -41,7 +41,7 @@ var uppercase = require( '@stdlib/string/base/uppercase' ); Converts a string to uppercase. ```javascript -var str = uppercase( 'bEEp' ); +const str = uppercase( 'bEEp' ); // returns 'BEEP' ``` @@ -56,9 +56,9 @@ var str = uppercase( 'bEEp' ); ```javascript -var uppercase = require( '@stdlib/string/base/uppercase' ); +const uppercase = require( '@stdlib/string/base/uppercase' ); -var str = uppercase( 'Beep' ); +let str = uppercase( 'Beep' ); // returns 'BEEP' str = uppercase( 'BeEp' ); diff --git a/lib/node_modules/@stdlib/string/camelcase/README.md b/lib/node_modules/@stdlib/string/camelcase/README.md index 85b78de7e0ed..3d3ba1eb1aeb 100644 --- a/lib/node_modules/@stdlib/string/camelcase/README.md +++ b/lib/node_modules/@stdlib/string/camelcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var camelcase = require( '@stdlib/string/camelcase' ); +const camelcase = require( '@stdlib/string/camelcase' ); ``` #### camelcase( str ) @@ -37,7 +37,7 @@ var camelcase = require( '@stdlib/string/camelcase' ); Converts a string to camel case. ```javascript -var out = camelcase( 'foo bar' ); +let out = camelcase( 'foo bar' ); // returns 'fooBar' out = camelcase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = camelcase( '--foo-bar--' ); ## Examples ```javascript -var camelcase = require( '@stdlib/string/camelcase' ); +const camelcase = require( '@stdlib/string/camelcase' ); -var str = 'Hello World!'; -var out = camelcase( str ); +let str = 'Hello World!'; +let out = camelcase( str ); // returns 'helloWorld' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/capitalize/README.md b/lib/node_modules/@stdlib/string/capitalize/README.md index c3113c88cd75..0db0476df97d 100644 --- a/lib/node_modules/@stdlib/string/capitalize/README.md +++ b/lib/node_modules/@stdlib/string/capitalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var capitalize = require( '@stdlib/string/capitalize' ); +const capitalize = require( '@stdlib/string/capitalize' ); ``` #### capitalize( str ) @@ -35,7 +35,7 @@ var capitalize = require( '@stdlib/string/capitalize' ); Capitalizes the first character in a string. ```javascript -var out = capitalize( 'last man standing' ); +let out = capitalize( 'last man standing' ); // returns 'Last man standing' out = capitalize( 'Hidden Treasures' ); @@ -53,9 +53,9 @@ out = capitalize( 'Hidden Treasures' ); ```javascript -var capitalize = require( '@stdlib/string/capitalize' ); +const capitalize = require( '@stdlib/string/capitalize' ); -var str = capitalize( 'last man standing' ); +let str = capitalize( 'last man standing' ); // returns 'Last man standing' str = capitalize( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/code-point-at/README.md b/lib/node_modules/@stdlib/string/code-point-at/README.md index 739546ea9eb1..b40fc989d140 100644 --- a/lib/node_modules/@stdlib/string/code-point-at/README.md +++ b/lib/node_modules/@stdlib/string/code-point-at/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var codePointAt = require( '@stdlib/string/code-point-at' ); +const codePointAt = require( '@stdlib/string/code-point-at' ); ``` #### codePointAt( string, position\[, backward] ) @@ -45,21 +45,21 @@ var codePointAt = require( '@stdlib/string/code-point-at' ); Returns a Unicode [code point][code-point] from a string at a specified position. ```javascript -var out = codePointAt( 'last man standing', 4 ); +const out = codePointAt( 'last man standing', 4 ); // returns 32 ``` The function supports providing a `backward` argument for performing backward iteration for low surrogates. ```javascript -var out = codePointAt( '🌷', 1, true ); +const out = codePointAt( '🌷', 1, true ); // returns 127799 ``` The function supports providing a negative `position`. ```javascript -var out = codePointAt( 'last man standing', -13 ); +const out = codePointAt( 'last man standing', -13 ); // returns 32 ``` @@ -92,9 +92,9 @@ This function differs from [`String.prototype.codePointAt`][mdn-string-codepoint ```javascript -var codePointAt = require( '@stdlib/string/code-point-at' ); +const codePointAt = require( '@stdlib/string/code-point-at' ); -var v = codePointAt( 'last man standing', 4 ); +let v = codePointAt( 'last man standing', 4 ); // returns 32 v = codePointAt( 'presidential election', 8, true ); diff --git a/lib/node_modules/@stdlib/string/constantcase/README.md b/lib/node_modules/@stdlib/string/constantcase/README.md index e4cd274f52a2..4dfd2742f730 100644 --- a/lib/node_modules/@stdlib/string/constantcase/README.md +++ b/lib/node_modules/@stdlib/string/constantcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var constantcase = require( '@stdlib/string/constantcase' ); +const constantcase = require( '@stdlib/string/constantcase' ); ``` #### constantcase( str ) @@ -37,7 +37,7 @@ var constantcase = require( '@stdlib/string/constantcase' ); Converts a string to constant case. ```javascript -var str = constantcase( 'foo bar' ); +let str = constantcase( 'foo bar' ); // returns 'FOO_BAR' str = constantcase( 'foo bar baz' ); @@ -58,10 +58,10 @@ str = constantcase( 'foo_bar' ); ## Examples ```javascript -var constantcase = require( '@stdlib/string/constantcase' ); +const constantcase = require( '@stdlib/string/constantcase' ); -var str = 'Hello World!'; -var out = constantcase( str ); +let str = 'Hello World!'; +let out = constantcase( str ); // returns 'HELLO_WORLD' str = 'I am a tiny little teapot'; diff --git a/lib/node_modules/@stdlib/string/dotcase/README.md b/lib/node_modules/@stdlib/string/dotcase/README.md index eef498a1d5f4..c93789b78a6f 100644 --- a/lib/node_modules/@stdlib/string/dotcase/README.md +++ b/lib/node_modules/@stdlib/string/dotcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var dotcase = require( '@stdlib/string/dotcase' ); +const dotcase = require( '@stdlib/string/dotcase' ); ``` #### dotcase( str ) @@ -37,7 +37,7 @@ var dotcase = require( '@stdlib/string/dotcase' ); Converts a string to dot case. ```javascript -var out = dotcase( 'foo bar' ); +let out = dotcase( 'foo bar' ); // returns 'foo.bar' out = dotcase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = dotcase( '--foo-bar--' ); ## Examples ```javascript -var dotcase = require( '@stdlib/string/dotcase' ); +const dotcase = require( '@stdlib/string/dotcase' ); -var str = 'Hello World!'; -var out = dotcase( str ); +let str = 'Hello World!'; +let out = dotcase( str ); // returns 'hello.world' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/ends-with/README.md b/lib/node_modules/@stdlib/string/ends-with/README.md index e3005b9759b4..1a82d5f85866 100644 --- a/lib/node_modules/@stdlib/string/ends-with/README.md +++ b/lib/node_modules/@stdlib/string/ends-with/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var endsWith = require( '@stdlib/string/ends-with' ); +const endsWith = require( '@stdlib/string/ends-with' ); ``` #### endsWith( str, search\[, len] ) @@ -41,9 +41,9 @@ var endsWith = require( '@stdlib/string/ends-with' ); Tests if a string ends with the characters of another string. ```javascript -var str = 'Remember the story I used to tell you when you were a boy?'; +const str = 'Remember the story I used to tell you when you were a boy?'; -var bool = endsWith( str, 'boy?' ); +let bool = endsWith( str, 'boy?' ); // returns true bool = endsWith( str, 'Boy?' ); @@ -53,9 +53,9 @@ bool = endsWith( str, 'Boy?' ); To search for a match at the end of a substring, provide a `len` argument. If `len` is positive, the function restricts the search to a substring with length `len`, beginning with the leftmost character. If `len` is negative, `len` indicates to ignore the last `len` characters (equivalent of `str.length + len`). ```javascript -var str = 'To be, or not to be, that is the question.'; +const str = 'To be, or not to be, that is the question.'; -var bool = endsWith( str, 'to be', 19 ); +let bool = endsWith( str, 'to be', 19 ); // returns true bool = endsWith( str, 'to be', -23 ); @@ -65,9 +65,9 @@ bool = endsWith( str, 'to be', -23 ); If provided an empty `search` string, the function **always** returns `true`. ```javascript -var str = 'beep boop'; +const str = 'beep boop'; -var bool = endsWith( str, '' ); +const bool = endsWith( str, '' ); // returns true ``` @@ -82,7 +82,7 @@ var bool = endsWith( str, '' ); - In general, exercise caution when operating on substrings containing Unicode characters, as the visual character length may not equal the number of code points. For example, ```javascript - var len = '🏠'.length; + const len = '🏠'.length; // returns 2 ``` @@ -103,11 +103,11 @@ var bool = endsWith( str, '' ); ```javascript -var endsWith = require( '@stdlib/string/ends-with' ); +const endsWith = require( '@stdlib/string/ends-with' ); -var str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; +const str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; -var bool = endsWith( str, 'air' ); +let bool = endsWith( str, 'air' ); // returns true bool = endsWith( str, 'fair' ); diff --git a/lib/node_modules/@stdlib/string/first/README.md b/lib/node_modules/@stdlib/string/first/README.md index c52ae82058f3..c1a284300a07 100644 --- a/lib/node_modules/@stdlib/string/first/README.md +++ b/lib/node_modules/@stdlib/string/first/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var first = require( '@stdlib/string/first' ); +const first = require( '@stdlib/string/first' ); ``` #### first( str\[, n]\[, options] ) @@ -35,7 +35,7 @@ var first = require( '@stdlib/string/first' ); Returns the first character(s) of a string. ```javascript -var out = first( 'last man standing' ); +let out = first( 'last man standing' ); // returns 'l' out = first( 'Hidden Treasures' ); @@ -55,7 +55,7 @@ The function supports the following options: By default, the function returns the first character. To return the first `n` characters, provide a second argument specifying the number of characters to return. ```javascript -var out = first( 'foo bar', 5 ); +let out = first( 'foo bar', 5 ); // returns 'foo b' out = first( 'foo bar', 10 ); @@ -85,9 +85,9 @@ out = first( 'foo bar', 10 ); ```javascript -var first = require( '@stdlib/string/first' ); +const first = require( '@stdlib/string/first' ); -var str = first( 'last man standing' ); +let str = first( 'last man standing' ); // returns 'l' str = first( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/for-each/README.md b/lib/node_modules/@stdlib/string/for-each/README.md index 9258df18ef16..09c8cd34f989 100644 --- a/lib/node_modules/@stdlib/string/for-each/README.md +++ b/lib/node_modules/@stdlib/string/for-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEach = require( '@stdlib/string/for-each' ); +const forEach = require( '@stdlib/string/for-each' ); ``` #### forEach( str, \[options,] clbk\[, thisArg ] ) @@ -72,15 +72,15 @@ function clbk() { this.count += 1; } -var str = 'Hello, world!'; +const str = 'Hello, world!'; -var ctx = { +const ctx = { 'count': 0 }; forEach( str, clbk, ctx ); -var bool = ( str.length === ctx.count ); +const bool = ( str.length === ctx.count ); // returns true ``` @@ -119,7 +119,7 @@ The function supports the following options: ```javascript -var forEach = require( '@stdlib/string/for-each' ); +const forEach = require( '@stdlib/string/for-each' ); function log( value, index ) { console.log( '%d: %s', index, value ); diff --git a/lib/node_modules/@stdlib/string/format/README.md b/lib/node_modules/@stdlib/string/format/README.md index 4d48a6822379..854196b415d5 100644 --- a/lib/node_modules/@stdlib/string/format/README.md +++ b/lib/node_modules/@stdlib/string/format/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var format = require( '@stdlib/string/format' ); +const format = require( '@stdlib/string/format' ); ``` #### format( str, ...args ) @@ -41,8 +41,8 @@ var format = require( '@stdlib/string/format' ); Inserts supplied variable values into a format string. ```javascript -var str = 'Hello, %s! My name is %s.'; -var out = format( str, 'world', 'Bob' ); +const str = 'Hello, %s! My name is %s.'; +const out = format( str, 'world', 'Bob' ); // returns 'Hello, world! My name is Bob.' ``` @@ -55,8 +55,8 @@ The format string is a string literal containing zero or more conversion specifi Arguments following the format string are used to replace the placeholders in the format string. The number of arguments following the format string should be equal to the number of placeholders in the format string. ```javascript -var str = '%s %s'; -var out = format( str, 'Hello', 'World' ); +const str = '%s %s'; +const out = format( str, 'Hello', 'World' ); // returns 'Hello World' ``` @@ -67,8 +67,8 @@ To supply arguments in a different order than they appear in the format string, ``` ```javascript -var str = '%3$s %2$s %1$s'; -var out = format( str, 'foo', 'bar', 'baz' ); +const str = '%3$s %2$s %1$s'; +const out = format( str, 'foo', 'bar', 'baz' ); // returns 'baz bar foo' ``` @@ -91,8 +91,8 @@ The following table summarizes the supported specifiers: | G | shortest representation (`E`/`F`) | 3.9 | ```javascript -var str = '%i written as a binary number is %b.'; -var out = format( str, 9, 9 ); +let str = '%i written as a binary number is %b.'; +let out = format( str, 9, 9 ); // returns '9 written as a binary number is 1001.' str = '%i written as an octal number is %o.'; @@ -135,8 +135,8 @@ A conversion specification may contain zero or more flags, which modify the beha | space | prefix the value with a space character if no sign is written | ```javascript -var str = 'Always prefix with a sign: %+i'; -var out = format( str, 9 ); +let str = 'Always prefix with a sign: %+i'; +let out = format( str, 9 ); // returns 'Always prefix with a sign: +9' out = format( str, -9 ); @@ -160,8 +160,8 @@ out = format( str, -3 ); The `width` may be specified as a decimal integer representing the minimum number of characters to be written to the output. If the value to be written is shorter than this number, the result is padded with spaces on the left. The value is not truncated even if the result is larger. Alternatively, the `width` may be specified as an asterisk character (`*`), in which case the argument preceding the conversion specification is used as the minimum field width. ```javascript -var str = '%5s'; -var out = format( str, 'baz' ); +let str = '%5s'; +let out = format( str, 'baz' ); // returns ' baz' str = '%-5s'; @@ -187,8 +187,8 @@ The `precision` may be specified as a decimal integer or as an asterisk characte Alternatively, the `precision` may be specified as an asterisk character (`*`), in which case the argument preceding the conversion specification is used as the minimum number of digits. ```javascript -var str = '%5.2s'; -var out = format( str, 'baz' ); +let str = '%5.2s'; +let out = format( str, 'baz' ); // returns ' ba' str = 'PI: ~%.2f'; @@ -211,9 +211,9 @@ out = format( str, 7 ); ```javascript -var format = require( '@stdlib/string/format' ); +const format = require( '@stdlib/string/format' ); -var out = format( '%s %s!', 'Hello', 'World' ); +let out = format( '%s %s!', 'Hello', 'World' ); // returns 'Hello World!' out = format( 'Pi: ~%.2f', 3.141592653589793 ); diff --git a/lib/node_modules/@stdlib/string/from-code-point/README.md b/lib/node_modules/@stdlib/string/from-code-point/README.md index 19957b7b69c4..a77d296b6764 100644 --- a/lib/node_modules/@stdlib/string/from-code-point/README.md +++ b/lib/node_modules/@stdlib/string/from-code-point/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fromCodePoint = require( '@stdlib/string/from-code-point' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); ``` #### fromCodePoint( pt1\[, pt2\[, pt3\[, ...]]] ) @@ -45,16 +45,16 @@ var fromCodePoint = require( '@stdlib/string/from-code-point' ); Creates a `string` from a sequence of Unicode [code points][code-point]. ```javascript -var out = fromCodePoint( 9731 ); +const out = fromCodePoint( 9731 ); // returns '☃' ``` In addition to providing [code points][code-point] as separate arguments, the function supports providing an array-like `object` as a single argument containing a sequence of [code points][code-point]. ```javascript -var Uint16Array = require( '@stdlib/array/uint16' ); +const Uint16Array = require( '@stdlib/array/uint16' ); -var out = fromCodePoint( 97, 98, 99 ); +let out = fromCodePoint( 97, 98, 99 ); // returns 'abc' out = fromCodePoint( new Uint16Array( [ 97, 98, 99 ] ) ); @@ -94,16 +94,13 @@ out = fromCodePoint( new Uint16Array( [ 97, 98, 99 ] ) ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); -var x; -var i; - -for ( i = 0; i < 100; i++ ) { - x = floor( randu()*UNICODE_MAX_BMP ); +for ( let i = 0; i < 100; i++ ) { + const x = floor( randu()*UNICODE_MAX_BMP ); console.log( '%d => %s', x, fromCodePoint( x ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/headercase/README.md b/lib/node_modules/@stdlib/string/headercase/README.md index 9813e109a30e..90c04db98441 100644 --- a/lib/node_modules/@stdlib/string/headercase/README.md +++ b/lib/node_modules/@stdlib/string/headercase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var headercase = require( '@stdlib/string/headercase' ); +const headercase = require( '@stdlib/string/headercase' ); ``` #### headercase( str ) @@ -37,7 +37,7 @@ var headercase = require( '@stdlib/string/headercase' ); Converts a string to HTTP header case. ```javascript -var out = headercase( 'foo bar' ); +let out = headercase( 'foo bar' ); // returns 'Foo-Bar' out = headercase( 'IS_MOBILE' ); @@ -61,10 +61,10 @@ out = headercase( '--foo-bar--' ); ## Examples ```javascript -var headercase = require( '@stdlib/string/headercase' ); +const headercase = require( '@stdlib/string/headercase' ); -var str = 'Hello World!'; -var out = headercase( str ); +let str = 'Hello World!'; +let out = headercase( str ); // returns 'Hello-World' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/kebabcase/README.md b/lib/node_modules/@stdlib/string/kebabcase/README.md index 76f9f60561a3..704c1e47ee98 100644 --- a/lib/node_modules/@stdlib/string/kebabcase/README.md +++ b/lib/node_modules/@stdlib/string/kebabcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var kebabcase = require( '@stdlib/string/kebabcase' ); +const kebabcase = require( '@stdlib/string/kebabcase' ); ``` #### kebabcase( str ) @@ -37,7 +37,7 @@ var kebabcase = require( '@stdlib/string/kebabcase' ); Converts a string to kebab case. ```javascript -var str = kebabcase( 'Foo Bar' ); +let str = kebabcase( 'Foo Bar' ); // returns 'foo-bar' str = kebabcase( 'I am a tiny little house' ); @@ -58,10 +58,10 @@ str = kebabcase( 'Hello World!' ); ## Examples ```javascript -var kebabcase = require( '@stdlib/string/kebabcase' ); +const kebabcase = require( '@stdlib/string/kebabcase' ); -var str = 'foo bar baz'; -var out = kebabcase( str ); +let str = 'foo bar baz'; +let out = kebabcase( str ); // returns 'foo-bar-baz' str = 'foo_baz'; diff --git a/lib/node_modules/@stdlib/string/last/README.md b/lib/node_modules/@stdlib/string/last/README.md index d4997f3495f9..a0a968b74ae7 100644 --- a/lib/node_modules/@stdlib/string/last/README.md +++ b/lib/node_modules/@stdlib/string/last/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var last = require( '@stdlib/string/last' ); +const last = require( '@stdlib/string/last' ); ``` #### last( str\[, n]\[, options] ) @@ -35,7 +35,7 @@ var last = require( '@stdlib/string/last' ); Returns the last character(s) of a string. ```javascript -var out = last( 'last man standing' ); +let out = last( 'last man standing' ); // returns 'g' out = last( 'Hidden Treasures' ); @@ -55,7 +55,7 @@ The function supports the following options: By default, the function returns the last character. To return the last `n` characters, provide a second argument specifying the number of characters to return. ```javascript -var out = last( 'foo bar', 3 ); +let out = last( 'foo bar', 3 ); // returns 'bar' out = last( 'foo bar', 10 ); @@ -85,9 +85,9 @@ out = last( 'foo bar', 10 ); ```javascript -var last = require( '@stdlib/string/last' ); +const last = require( '@stdlib/string/last' ); -var str = last( 'last man standing' ); +let str = last( 'last man standing' ); // returns 'g' str = last( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/left-pad/README.md b/lib/node_modules/@stdlib/string/left-pad/README.md index 45066f7970a1..358e996065a6 100644 --- a/lib/node_modules/@stdlib/string/left-pad/README.md +++ b/lib/node_modules/@stdlib/string/left-pad/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var lpad = require( '@stdlib/string/left-pad' ); +const lpad = require( '@stdlib/string/left-pad' ); ``` #### lpad( str, len\[, pad] ) @@ -35,14 +35,14 @@ var lpad = require( '@stdlib/string/left-pad' ); Left pads a string such that the padded string has a length of **at least** `len`. ```javascript -var str = lpad( 'a', 5 ); +const str = lpad( 'a', 5 ); // returns ' a' ``` By default, an input string is padded with a Unicode "space" character (U+0020). To pad with a different character or sequence of characters, provide a `pad` string. ```javascript -var str = lpad( 'beep', 10, 'b' ); +let str = lpad( 'beep', 10, 'b' ); // returns 'bbbbbbbeep' str = lpad( 'boop', 12, 'beep' ); @@ -60,7 +60,7 @@ str = lpad( 'boop', 12, 'beep' ); - An output string is **not** guaranteed to have a length of **exactly** `len`, but to have a length of **at least** `len`. To generate a padded string having a length equal to `len` ```javascript - var str = lpad( 'boop', 10, 'beep' ); // => length 12 + let str = lpad( 'boop', 10, 'beep' ); // => length 12 // returns 'beepbeepboop' str = str.substring( str.length-10 ); // => length 10 @@ -75,18 +75,17 @@ str = lpad( 'boop', 12, 'beep' ); To replicate [`String.prototype.padStart`][mdn-string-padstart] truncation behavior ```javascript - var floorb = require( '@stdlib/math/base/special/floorb' ); + const floorb = require( '@stdlib/math/base/special/floorb' ); function padStart( str, len, pad ) { - var n; if ( len <= str.length ) { return str; } - n = floorb( len-str.length, 1, pad.length ) + str.length; + const n = floorb( len-str.length, 1, pad.length ) + str.length; return pad.substring( 0, len-n ) + lpad( str, n, pad ); } - var str = padStart( 'boop', 10, 'beep' ); + const str = padStart( 'boop', 10, 'beep' ); // returns 'bebeepboop' ``` @@ -101,12 +100,11 @@ str = lpad( 'boop', 12, 'beep' ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var lpad = require( '@stdlib/string/left-pad' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const lpad = require( '@stdlib/string/left-pad' ); -var str = 'beep'; -var i; -for ( i = 0; i < 100; i++ ) { +const str = 'beep'; +for ( let i = 0; i < 100; i++ ) { console.log( lpad( str, discreteUniform( str.length, str.length+10 ), 'b' ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/left-trim-n/README.md b/lib/node_modules/@stdlib/string/left-trim-n/README.md index 28266c566cf8..0b7d5a44fb3c 100644 --- a/lib/node_modules/@stdlib/string/left-trim-n/README.md +++ b/lib/node_modules/@stdlib/string/left-trim-n/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ltrimN = require( '@stdlib/string/left-trim-n' ); +const ltrimN = require( '@stdlib/string/left-trim-n' ); ``` #### ltrimN( str, n\[, chars] ) @@ -45,8 +45,8 @@ var ltrimN = require( '@stdlib/string/left-trim-n' ); Trims `n` characters from the beginning of a string. ```javascript -var str = ' foo '; -var out = ltrimN( str, str.length ); +const str = ' foo '; +let out = ltrimN( str, str.length ); // returns 'foo ' out = ltrimN( str, 1 ); @@ -56,8 +56,8 @@ out = ltrimN( str, 1 ); By default, the function trims whitespace characters. To trim a different set of characters instead, provide a string or an array of characters to trim: ```javascript -var str = '🐶🐶🐶 Animals 🐶🐶🐶'; -var out = ltrimN( str, str.length, [ '🐶', ' ' ] ); +const str = '🐶🐶🐶 Animals 🐶🐶🐶'; +let out = ltrimN( str, str.length, [ '🐶', ' ' ] ); // returns 'Animals 🐶🐶🐶' out = ltrimN( str, str.length, '🐶 ' ); @@ -85,9 +85,9 @@ out = ltrimN( str, str.length, '🐶 ' ); ```javascript -var ltrimN = require( '@stdlib/string/left-trim-n' ); +const ltrimN = require( '@stdlib/string/left-trim-n' ); -var out = ltrimN( ' Whitespace ', 3 ); +let out = ltrimN( ' Whitespace ', 3 ); // returns 'Whitespace ' out = ltrimN( '\t\t\tTabs\t\t\t', 2 ); diff --git a/lib/node_modules/@stdlib/string/left-trim/README.md b/lib/node_modules/@stdlib/string/left-trim/README.md index 14ab36d202d0..c84ba457ada6 100644 --- a/lib/node_modules/@stdlib/string/left-trim/README.md +++ b/lib/node_modules/@stdlib/string/left-trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ltrim = require( '@stdlib/string/left-trim' ); +const ltrim = require( '@stdlib/string/left-trim' ); ``` #### ltrim( str ) @@ -35,7 +35,7 @@ var ltrim = require( '@stdlib/string/left-trim' ); Trims whitespace from the beginning of a string. ```javascript -var out = ltrim( ' \r\n\t Beep \t\t\n ' ); +const out = ltrim( ' \r\n\t Beep \t\t\n ' ); // returns 'Beep \t\t\n ' ``` @@ -76,9 +76,9 @@ var out = ltrim( ' \r\n\t Beep \t\t\n ' ); ```javascript -var ltrim = require( '@stdlib/string/left-trim' ); +const ltrim = require( '@stdlib/string/left-trim' ); -var str = ltrim( ' Whitespace ' ); +let str = ltrim( ' Whitespace ' ); // returns 'Whitespace ' str = ltrim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/lowercase/README.md b/lib/node_modules/@stdlib/string/lowercase/README.md index 37a0b2b5ce61..2f2e80b83934 100644 --- a/lib/node_modules/@stdlib/string/lowercase/README.md +++ b/lib/node_modules/@stdlib/string/lowercase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var lowercase = require( '@stdlib/string/lowercase' ); +const lowercase = require( '@stdlib/string/lowercase' ); ``` #### lowercase( str ) @@ -41,7 +41,7 @@ var lowercase = require( '@stdlib/string/lowercase' ); Converts a string to lowercase. ```javascript -var str = lowercase( 'bEEp' ); +const str = lowercase( 'bEEp' ); // returns 'beep' ``` @@ -56,9 +56,9 @@ var str = lowercase( 'bEEp' ); ```javascript -var lowercase = require( '@stdlib/string/lowercase' ); +const lowercase = require( '@stdlib/string/lowercase' ); -var str = lowercase( 'Beep' ); +let str = lowercase( 'Beep' ); // returns 'beep' str = lowercase( 'BeEp' ); diff --git a/lib/node_modules/@stdlib/string/next-code-point-index/README.md b/lib/node_modules/@stdlib/string/next-code-point-index/README.md index 970341192f4f..71abd2da1200 100644 --- a/lib/node_modules/@stdlib/string/next-code-point-index/README.md +++ b/lib/node_modules/@stdlib/string/next-code-point-index/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nextCodePointIndex = require( '@stdlib/string/next-code-point-index' ); +const nextCodePointIndex = require( '@stdlib/string/next-code-point-index' ); ``` #### nextCodePointIndex( string\[, fromIndex] ) @@ -45,14 +45,14 @@ var nextCodePointIndex = require( '@stdlib/string/next-code-point-index' ); Returns the position of the next Unicode code point in a string after a specified position. ```javascript -var out = nextCodePointIndex( 'last man standing' ); +const out = nextCodePointIndex( 'last man standing' ); // returns 1 ``` By default, the function searches for a Unicode code point starting from the first index. To specify an alternative starting search index, provide a `fromIndex` argument. ```javascript -var out = nextCodePointIndex( 'last man standing', 4 ); +const out = nextCodePointIndex( 'last man standing', 4 ); // returns 5 ``` @@ -83,9 +83,9 @@ var out = nextCodePointIndex( 'last man standing', 4 ); ```javascript -var nextCodePointIndex = require( '@stdlib/string/next-code-point-index' ); +const nextCodePointIndex = require( '@stdlib/string/next-code-point-index' ); -var out = nextCodePointIndex( 'last man standing', 4 ); +let out = nextCodePointIndex( 'last man standing', 4 ); // returns 5 out = nextCodePointIndex( 'presidential election', 8 ); diff --git a/lib/node_modules/@stdlib/string/next-grapheme-cluster-break/README.md b/lib/node_modules/@stdlib/string/next-grapheme-cluster-break/README.md index 0e9357d281f7..01bdc2a8bd21 100644 --- a/lib/node_modules/@stdlib/string/next-grapheme-cluster-break/README.md +++ b/lib/node_modules/@stdlib/string/next-grapheme-cluster-break/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-break' ); +const nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-break' ); ``` #### nextGraphemeClusterBreak( string\[, fromIndex] ) @@ -45,14 +45,14 @@ var nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-br Returns the next extended grapheme cluster break in a string after a specified position. ```javascript -var out = nextGraphemeClusterBreak( 'last man standing' ); +const out = nextGraphemeClusterBreak( 'last man standing' ); // returns 1 ``` By default, the function searches for a grapheme cluster break starting from the first index. To specify an alternative starting search index, provide a `fromIndex` argument. ```javascript -var out = nextGraphemeClusterBreak( 'last man standing', 4 ); +const out = nextGraphemeClusterBreak( 'last man standing', 4 ); // returns 5 ``` @@ -83,9 +83,9 @@ var out = nextGraphemeClusterBreak( 'last man standing', 4 ); ```javascript -var nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-break' ); +const nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-break' ); -var out = nextGraphemeClusterBreak( 'last man standing', 4 ); +let out = nextGraphemeClusterBreak( 'last man standing', 4 ); // returns 5 out = nextGraphemeClusterBreak( 'presidential election', 8 ); diff --git a/lib/node_modules/@stdlib/string/num-grapheme-clusters/README.md b/lib/node_modules/@stdlib/string/num-grapheme-clusters/README.md index 86f324c5d3dd..fd4b1dedbc8c 100644 --- a/lib/node_modules/@stdlib/string/num-grapheme-clusters/README.md +++ b/lib/node_modules/@stdlib/string/num-grapheme-clusters/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' ); +const numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' ); ``` #### numGraphemeClusters( str ) @@ -35,7 +35,7 @@ var numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' ); Returns the number of [grapheme clusters][unicode-text-segmentation] in a `string`. ```javascript -var out = numGraphemeClusters( 'last man standing' ); +let out = numGraphemeClusters( 'last man standing' ); // returns 17 out = numGraphemeClusters( 'Hidden Treasures' ); @@ -53,9 +53,9 @@ out = numGraphemeClusters( 'Hidden Treasures' ); ```javascript -var numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' ); +const numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' ); -var str = numGraphemeClusters( 'last man standing' ); +let str = numGraphemeClusters( 'last man standing' ); // returns 17 str = numGraphemeClusters( '六书/六書' ); diff --git a/lib/node_modules/@stdlib/string/num2words/README.md b/lib/node_modules/@stdlib/string/num2words/README.md index 9d001bacfe0d..4a29374290e4 100644 --- a/lib/node_modules/@stdlib/string/num2words/README.md +++ b/lib/node_modules/@stdlib/string/num2words/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var num2words = require( '@stdlib/string/num2words' ); +const num2words = require( '@stdlib/string/num2words' ); ``` #### num2words( value\[, options] ) @@ -41,7 +41,7 @@ var num2words = require( '@stdlib/string/num2words' ); Converts a number to a word representation. ```javascript -var out = num2words( 87 ); +let out = num2words( 87 ); // returns 'eighty-seven' out = num2words( 23101 ); @@ -58,7 +58,7 @@ The function accepts the following `options`: By default, the function returns a word representation of a number in English. To return a word representation of a number in a different language, set the `lang` option. ```javascript -var out = num2words( 22, { +let out = num2words( 22, { 'lang': 'de' }); // returns 'zweiundzwanzig' @@ -95,9 +95,9 @@ out = num2words( 0.53, { ```javascript -var num2words = require( '@stdlib/string/num2words' ); +const num2words = require( '@stdlib/string/num2words' ); -var out = num2words( 29 ); +let out = num2words( 29 ); // returns 'twenty-nine' out = num2words( 113 ); diff --git a/lib/node_modules/@stdlib/string/pad/README.md b/lib/node_modules/@stdlib/string/pad/README.md index 1210f6ae4f14..6b3a5dcb5b8f 100644 --- a/lib/node_modules/@stdlib/string/pad/README.md +++ b/lib/node_modules/@stdlib/string/pad/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var pad = require( '@stdlib/string/pad' ); +const pad = require( '@stdlib/string/pad' ); ``` #### pad( str, len\[, options] ) @@ -41,7 +41,7 @@ var pad = require( '@stdlib/string/pad' ); Pads a `string` such that the padded `string` has a `length` of `len`. ```javascript -var str = pad( 'a', 5 ); +const str = pad( 'a', 5 ); // returns 'a ' ``` @@ -54,7 +54,7 @@ The function accepts the following `options`: By default, an input `string` is padded with spaces. To pad with a different character or sequence of characters, provide a pad `string`. ```javascript -var str = pad( 'a', 10, { +let str = pad( 'a', 10, { 'lpad': 'b' }); // returns 'bbbbbbbbba' @@ -68,37 +68,37 @@ str = pad( 'a', 12, { To center an input `string`, provide both `lpad` and `rpad` options. ```javascript -var opts = { +const opts = { 'lpad': 'a', 'rpad': 'c' }; -var str = pad( 'b', 11, opts ); +const str = pad( 'b', 11, opts ); // returns 'aaaaabccccc' ``` When both `lpad` and `rpad` are specified and `len-str.length` is **odd**, left and right padding cannot equally split the available padding space. By default, right padding receives the extra character (i.e., the input `string` is left-centered). ```javascript -var opts = { +const opts = { 'lpad': 'a', 'rpad': 'c' }; -var str = pad( 'b', 10, opts ); +const str = pad( 'b', 10, opts ); // returns 'aaaabccccc' ``` To center right, set the `centerRight` option. ```javascript -var opts = { +const opts = { 'lpad': 'a', 'rpad': 'c', 'centerRight': true }; -var str = pad( 'b', 10, opts ); +const str = pad( 'b', 10, opts ); // returns 'aaaaabcccc' ``` @@ -113,11 +113,11 @@ var str = pad( 'b', 10, opts ); - In contrast to [lpad][@stdlib/string/left-pad] and [rpad][@stdlib/string/right-pad], any padding which does not evenly divide available space is trimmed such that the returned `string` length is **always** `len`. ```javascript - var opts = { + const opts = { 'lpad': 'boop', 'rpad': 'woot' }; - var str = pad( 'beep', 10, opts ); + const str = pad( 'beep', 10, opts ); // returns 'boobeepwoo' ``` @@ -125,7 +125,7 @@ var str = pad( 'b', 10, opts ); ```javascript // Pad right, trim right: - var str = pad( 'beep', 2 ); + let str = pad( 'beep', 2 ); // returns 'be' // Pad left, trim left: @@ -168,18 +168,15 @@ var str = pad( 'b', 10, opts ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var pad = require( '@stdlib/string/pad' ); - -var str = 'boop'; -var out; -var len; -var i; - -for ( i = 0; i < 100; i++ ) { - len = round( randu()*10.0 ) + str.length; - out = pad( str, len, { +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const pad = require( '@stdlib/string/pad' ); + +const str = 'boop'; + +for ( let i = 0; i < 100; i++ ) { + const len = round( randu()*10.0 ) + str.length; + const out = pad( str, len, { 'lpad': 'beep', 'rpad': 'p' }); diff --git a/lib/node_modules/@stdlib/string/pascalcase/README.md b/lib/node_modules/@stdlib/string/pascalcase/README.md index 1de6f2e4f9cd..3ba5ff05d7fd 100644 --- a/lib/node_modules/@stdlib/string/pascalcase/README.md +++ b/lib/node_modules/@stdlib/string/pascalcase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var pascalcase = require( '@stdlib/string/pascalcase' ); +const pascalcase = require( '@stdlib/string/pascalcase' ); ``` #### pascalcase( str ) @@ -37,7 +37,7 @@ var pascalcase = require( '@stdlib/string/pascalcase' ); Converts a string to Pascal case. ```javascript -var out = pascalcase( 'foo bar' ); +let out = pascalcase( 'foo bar' ); // returns 'FooBar' out = pascalcase( 'IS_MOBILE' ); @@ -64,10 +64,10 @@ out = pascalcase( 'fooBar' ); ## Examples ```javascript -var pascalcase = require( '@stdlib/string/pascalcase' ); +const pascalcase = require( '@stdlib/string/pascalcase' ); -var str = 'Hello World!'; -var out = pascalcase( str ); +let str = 'Hello World!'; +let out = pascalcase( str ); // returns 'HelloWorld' str = 'HELLO WORLD!'; diff --git a/lib/node_modules/@stdlib/string/percent-encode/README.md b/lib/node_modules/@stdlib/string/percent-encode/README.md index b57486f5430b..8ea33e55461e 100644 --- a/lib/node_modules/@stdlib/string/percent-encode/README.md +++ b/lib/node_modules/@stdlib/string/percent-encode/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var percentEncode = require( '@stdlib/string/percent-encode' ); +const percentEncode = require( '@stdlib/string/percent-encode' ); ``` #### percentEncode( str ) @@ -45,7 +45,7 @@ var percentEncode = require( '@stdlib/string/percent-encode' ); [Percent-encodes][percent-encoding] a [UTF-16][utf-16] encoded string according to [RFC 3986][rfc-3986-percent-encoding]. ```javascript -var out = percentEncode( '☃' ); +const out = percentEncode( '☃' ); // returns '%E2%98%83' ``` @@ -62,7 +62,7 @@ var out = percentEncode( '☃' ); - The function [percent-encodes][percent-encoding] an **entire** string. Hence, if provided a URI, the function [percent-encodes][percent-encoding] the entire URI. ```javascript - var out = percentEncode( 'https://en.wikipedia.org/wiki/Mode_(statistics)' ); + const out = percentEncode( 'https://en.wikipedia.org/wiki/Mode_(statistics)' ); // returns 'https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMode_%28statistics%29' ``` @@ -81,9 +81,9 @@ var out = percentEncode( '☃' ); ```javascript -var percentEncode = require( '@stdlib/string/percent-encode' ); +const percentEncode = require( '@stdlib/string/percent-encode' ); -var values = [ +const values = [ 'Ladies + Gentlemen', 'An encoded string!', 'Dogs, Cats & Mice', @@ -91,8 +91,7 @@ var values = [ 'æ', '𐐷' ]; -var i; -for ( i = 0; i < values.length; i++ ) { +for ( let i = 0; i < values.length; i++ ) { console.log( '%s: %s', values[ i ], percentEncode( values[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/prev-grapheme-cluster-break/README.md b/lib/node_modules/@stdlib/string/prev-grapheme-cluster-break/README.md index bec17bda460a..c53e0f8c43fc 100644 --- a/lib/node_modules/@stdlib/string/prev-grapheme-cluster-break/README.md +++ b/lib/node_modules/@stdlib/string/prev-grapheme-cluster-break/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-break' ); +const prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-break' ); ``` #### prevGraphemeClusterBreak( string\[, fromIndex] ) @@ -45,14 +45,14 @@ var prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-br Returns the previous extended grapheme cluster break in a string before a specified position. ```javascript -var out = prevGraphemeClusterBreak( 'last man standing' ); +const out = prevGraphemeClusterBreak( 'last man standing' ); // returns 15 ``` By default, the last extended grapheme cluster break in the string is returned. For the previous extended grapheme cluster break before a specified position in the string, provide a `fromIndex`. ```javascript -var out = prevGraphemeClusterBreak( 'last man standing', 4 ); +const out = prevGraphemeClusterBreak( 'last man standing', 4 ); // returns 3 ``` @@ -83,7 +83,7 @@ var out = prevGraphemeClusterBreak( 'last man standing', 4 ); ```javascript -var prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-break' ); +const prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-break' ); console.log( prevGraphemeClusterBreak( 'last man standing', 4 ) ); // => 3 diff --git a/lib/node_modules/@stdlib/string/remove-first/README.md b/lib/node_modules/@stdlib/string/remove-first/README.md index a880f1ba1583..e5cd3db9bd36 100644 --- a/lib/node_modules/@stdlib/string/remove-first/README.md +++ b/lib/node_modules/@stdlib/string/remove-first/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeFirst = require( '@stdlib/string/remove-first' ); +const removeFirst = require( '@stdlib/string/remove-first' ); ``` #### removeFirst( str\[, n]\[, options] ) @@ -35,7 +35,7 @@ var removeFirst = require( '@stdlib/string/remove-first' ); Removes the first character(s) of a `string`. ```javascript -var out = removeFirst( 'last man standing' ); +let out = removeFirst( 'last man standing' ); // returns 'ast man standing' out = removeFirst( 'Hidden Treasures' ); @@ -55,7 +55,7 @@ The function supports the following options: By default, the function returns the first character. To return the first `n` characters, provide a second argument specifying the number of characters to return. ```javascript -var out = removeFirst( 'foo bar', 4 ); +let out = removeFirst( 'foo bar', 4 ); // returns 'bar' out = removeFirst( 'foo bar', 10 ); @@ -85,9 +85,9 @@ out = removeFirst( 'foo bar', 10 ); ```javascript -var removeFirst = require( '@stdlib/string/remove-first' ); +const removeFirst = require( '@stdlib/string/remove-first' ); -var str = removeFirst( 'last man standing' ); +let str = removeFirst( 'last man standing' ); // returns 'ast man standing' str = removeFirst( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/remove-last/README.md b/lib/node_modules/@stdlib/string/remove-last/README.md index 921241e166b4..22b5c02ca13b 100644 --- a/lib/node_modules/@stdlib/string/remove-last/README.md +++ b/lib/node_modules/@stdlib/string/remove-last/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var removeLast = require( '@stdlib/string/remove-last' ); +const removeLast = require( '@stdlib/string/remove-last' ); ``` #### removeLast( str\[, n]\[, options] ) @@ -35,7 +35,7 @@ var removeLast = require( '@stdlib/string/remove-last' ); Removes the last character(s) of an input string. ```javascript -var out = removeLast( 'last man standing' ); +let out = removeLast( 'last man standing' ); // returns 'last man standin' out = removeLast( 'Hidden Treasures' ); @@ -55,7 +55,7 @@ The function supports the following options: By default, the function returns the last character. To return the last `n` characters, provide a second argument specifying the number of characters to return. ```javascript -var out = removeLast( 'foo bar', 4 ); +let out = removeLast( 'foo bar', 4 ); // returns 'foo' out = removeLast( 'foo bar', 0 ); @@ -85,9 +85,9 @@ out = removeLast( 'foo bar', 0 ); ```javascript -var removeLast = require( '@stdlib/string/remove-last' ); +const removeLast = require( '@stdlib/string/remove-last' ); -var str = removeLast( 'last man standing' ); +let str = removeLast( 'last man standing' ); // returns 'last man standin' str = removeLast( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/remove-punctuation/README.md b/lib/node_modules/@stdlib/string/remove-punctuation/README.md index 3621e4c22db2..e8875b423da0 100644 --- a/lib/node_modules/@stdlib/string/remove-punctuation/README.md +++ b/lib/node_modules/@stdlib/string/remove-punctuation/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var removePunctuation = require( '@stdlib/string/remove-punctuation' ); +const removePunctuation = require( '@stdlib/string/remove-punctuation' ); ``` #### removePunctuation( str ) @@ -41,7 +41,7 @@ var removePunctuation = require( '@stdlib/string/remove-punctuation' ); Removes punctuation characters from a `string`. ```javascript -var str = removePunctuation( 'Sun Tzu said: "A leader leads by example not by force."' ); +const str = removePunctuation( 'Sun Tzu said: "A leader leads by example not by force."' ); // returns 'Sun Tzu said A leader leads by example not by force' ``` @@ -76,13 +76,10 @@ The function removes the following characters: ```javascript -var removePunctuation = require( '@stdlib/string/remove-punctuation' ); +const removePunctuation = require( '@stdlib/string/remove-punctuation' ); -var str; -var out; - -str = 'Double, double, toil and trouble; Fire burn, and cauldron bubble!'; -out = removePunctuation( str ); +let str = 'Double, double, toil and trouble; Fire burn, and cauldron bubble!'; +let out = removePunctuation( str ); // returns 'Double double toil and trouble Fire burn and cauldron bubble' str = 'This module removes these characters: `{}[]:,!/<>().;~|?\'"'; diff --git a/lib/node_modules/@stdlib/string/remove-utf8-bom/README.md b/lib/node_modules/@stdlib/string/remove-utf8-bom/README.md index 2aceeb776e2c..8385c9037ba8 100644 --- a/lib/node_modules/@stdlib/string/remove-utf8-bom/README.md +++ b/lib/node_modules/@stdlib/string/remove-utf8-bom/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' ); +const removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' ); ``` #### removeUTF8BOM( str ) @@ -41,7 +41,7 @@ var removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' ); Removes a UTF-8 [byte order mark][bom] (BOM) from the beginning of a `string`. ```javascript -var str = removeUTF8BOM( '\ufeffbeep' ); +const str = removeUTF8BOM( '\ufeffbeep' ); // returns 'beep' ``` @@ -56,9 +56,9 @@ var str = removeUTF8BOM( '\ufeffbeep' ); ```javascript -var removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' ); +const removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' ); -var str = removeUTF8BOM( '\ufeffbeep' ); +let str = removeUTF8BOM( '\ufeffbeep' ); // returns 'beep' str = removeUTF8BOM( 'boop\ufeff' ); diff --git a/lib/node_modules/@stdlib/string/remove-words/README.md b/lib/node_modules/@stdlib/string/remove-words/README.md index 452ec52190c3..b592a85813c6 100644 --- a/lib/node_modules/@stdlib/string/remove-words/README.md +++ b/lib/node_modules/@stdlib/string/remove-words/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var removeWords = require( '@stdlib/string/remove-words' ); +const removeWords = require( '@stdlib/string/remove-words' ); ``` #### removeWords( str, words\[, ignoreCase] ) @@ -41,16 +41,16 @@ var removeWords = require( '@stdlib/string/remove-words' ); Removes all occurrences of the given `words` from a `string`. ```javascript -var str = 'beep boop Foo bar'; -var out = removeWords( str, [ 'boop', 'foo' ] ); +const str = 'beep boop Foo bar'; +const out = removeWords( str, [ 'boop', 'foo' ] ); // returns 'beep Foo bar' ``` By default, words are removed from an input `string` in case of an exact match. To perform a case-insensitive replace operation, set `ignoreCase` to `true`. ```javascript -var str = 'beep boop Foo bar'; -var out = removeWords( str, [ 'boop', 'foo' ], true ); +const str = 'beep boop Foo bar'; +const out = removeWords( str, [ 'boop', 'foo' ], true ); // returns 'beep bar' ``` @@ -65,16 +65,16 @@ var out = removeWords( str, [ 'boop', 'foo' ], true ); ```javascript -var removeWords = require( '@stdlib/string/remove-words' ); -var stopwords = require( '@stdlib/datasets/stopwords-en' ); -var inmap = require( '@stdlib/utils/inmap' ); -var spam = require( '@stdlib/datasets/spam-assassin' ); +const removeWords = require( '@stdlib/string/remove-words' ); +const stopwords = require( '@stdlib/datasets/stopwords-en' ); +const inmap = require( '@stdlib/utils/inmap' ); +const spam = require( '@stdlib/datasets/spam-assassin' ); -var corpus = spam(); -var words = stopwords(); +const corpus = spam(); +const words = stopwords(); function remove( mail, idx ) { - var newText = removeWords( mail.text, words ); + const newText = removeWords( mail.text, words ); console.log( 'After removing stop words, email %d contains %d characters. Originally, it contained %d.', idx, newText.length, mail.text.length ); mail.text = newText; } diff --git a/lib/node_modules/@stdlib/string/repeat/README.md b/lib/node_modules/@stdlib/string/repeat/README.md index fa970a0fc462..e7b6859bad46 100644 --- a/lib/node_modules/@stdlib/string/repeat/README.md +++ b/lib/node_modules/@stdlib/string/repeat/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var repeat = require( '@stdlib/string/repeat' ); +const repeat = require( '@stdlib/string/repeat' ); ``` #### repeat( str, n ) @@ -35,7 +35,7 @@ var repeat = require( '@stdlib/string/repeat' ); Repeats a string `n` times and returns the concatenated result. ```javascript -var str = repeat( 'a', 5 ); +let str = repeat( 'a', 5 ); // returns 'aaaaa' str = repeat( '', 100 ); @@ -56,11 +56,10 @@ str = repeat( 'beep', 0 ); ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var repeat = require( '@stdlib/string/repeat' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const repeat = require( '@stdlib/string/repeat' ); -var i; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { console.log( repeat( 'beep', discreteUniform( 0, 3 ) ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/replace-before/README.md b/lib/node_modules/@stdlib/string/replace-before/README.md index ce4f3aadf306..049052ba1682 100644 --- a/lib/node_modules/@stdlib/string/replace-before/README.md +++ b/lib/node_modules/@stdlib/string/replace-before/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var replaceBefore = require( '@stdlib/string/replace-before' ); +const replaceBefore = require( '@stdlib/string/replace-before' ); ``` #### replaceBefore( str, search, replacement ) @@ -45,7 +45,7 @@ var replaceBefore = require( '@stdlib/string/replace-before' ); Replaces the substring before the first occurrence of a specified search string. ```javascript -var out = replaceBefore( 'beep boop', ' ', 'loop' ); +let out = replaceBefore( 'beep boop', ' ', 'loop' ); // returns 'loop boop' out = replaceBefore( 'beep boop', 'o', 'bar' ); @@ -78,9 +78,9 @@ out = replaceBefore( 'beep boop', 'o', 'bar' ); ```javascript -var replaceBefore = require( '@stdlib/string/replace-before' ); +const replaceBefore = require( '@stdlib/string/replace-before' ); -var out = replaceBefore( 'beep boop', 'p', 'see' ); +let out = replaceBefore( 'beep boop', 'p', 'see' ); // returns 'seep boop' out = replaceBefore( 'Hello World!', 'xyz', 'foo' ); diff --git a/lib/node_modules/@stdlib/string/replace/README.md b/lib/node_modules/@stdlib/string/replace/README.md index 19da4909f954..311f3169dc32 100644 --- a/lib/node_modules/@stdlib/string/replace/README.md +++ b/lib/node_modules/@stdlib/string/replace/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var replace = require( '@stdlib/string/replace' ); +const replace = require( '@stdlib/string/replace' ); ``` #### replace( str, search, newval ) @@ -35,7 +35,7 @@ var replace = require( '@stdlib/string/replace' ); Replaces search occurrences with a replacement string. ```javascript -var out = replace( 'beep', 'e', 'o' ); +const out = replace( 'beep', 'e', 'o' ); // returns 'boop' ``` @@ -45,8 +45,8 @@ If provided a function as the [third argument][mdn-string-replace], the function function replacer( match, p1 ) { return '/' + p1 + '/'; } -var str = 'Oranges and lemons'; -var out = replace( str, /([^\s]+)/gi, replacer ); +const str = 'Oranges and lemons'; +const out = replace( str, /([^\s]+)/gi, replacer ); // returns '/Oranges/ /and/ /lemons/' ``` @@ -61,7 +61,7 @@ var out = replace( str, /([^\s]+)/gi, replacer ); - The function has one notable difference from [`String.prototype.replace`][mdn-string-replace]. When provided a string as the `search` value, the function replaces **all** occurrences. To remove only the first match, use a regular expression. ```javascript - var out = replace( 'beep', /e/, 'o' ); + const out = replace( 'beep', /e/, 'o' ); // returns 'boep' ``` @@ -76,10 +76,10 @@ var out = replace( str, /([^\s]+)/gi, replacer ); ```javascript -var capitalize = require( '@stdlib/string/capitalize' ); -var replace = require( '@stdlib/string/replace' ); +const capitalize = require( '@stdlib/string/capitalize' ); +const replace = require( '@stdlib/string/replace' ); -var out = replace( 'beep', 'e', 'o' ); +let out = replace( 'beep', 'e', 'o' ); // returns 'boop' out = replace( 'Hello World', /world/i, 'Mr. President' ); @@ -88,7 +88,7 @@ out = replace( 'Hello World', /world/i, 'Mr. President' ); function replacer( match, p1 ) { return capitalize( p1 ); } -var str = 'Oranges and lemons say the bells of St. Clement\'s'; +const str = 'Oranges and lemons say the bells of St. Clement\'s'; out = replace( str, /([^\s]*)/gi, replacer ); // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s' ``` diff --git a/lib/node_modules/@stdlib/string/reverse/README.md b/lib/node_modules/@stdlib/string/reverse/README.md index a95a9fae4db8..be44f83deea3 100644 --- a/lib/node_modules/@stdlib/string/reverse/README.md +++ b/lib/node_modules/@stdlib/string/reverse/README.md @@ -27,15 +27,17 @@ limitations under the License. ## Usage ```javascript -var reverseString = require( '@stdlib/string/reverse' ); +const reverseString = require( '@stdlib/string/reverse' ); ``` #### reverseString( str\[, options] ) Reverses a `string`. + + ```javascript -var out = reverseString( 'last man standing' ); +let out = reverseString( 'last man standing' ); // returns 'gnidnats nam tsal' out = reverseString( 'Hidden Treasures' ); @@ -78,9 +80,9 @@ The function supports the following options: ```javascript -var reverseString = require( '@stdlib/string/reverse' ); +const reverseString = require( '@stdlib/string/reverse' ); -var str = reverseString( 'last man standing' ); +let str = reverseString( 'last man standing' ); // returns 'gnidnats nam tsal' str = reverseString( 'presidential election' ); diff --git a/lib/node_modules/@stdlib/string/right-pad/README.md b/lib/node_modules/@stdlib/string/right-pad/README.md index 94c821d67a88..414be21d6bdc 100644 --- a/lib/node_modules/@stdlib/string/right-pad/README.md +++ b/lib/node_modules/@stdlib/string/right-pad/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rpad = require( '@stdlib/string/right-pad' ); +const rpad = require( '@stdlib/string/right-pad' ); ``` #### rpad( str, len\[, pad] ) @@ -35,14 +35,14 @@ var rpad = require( '@stdlib/string/right-pad' ); Right pads a `string` such that the padded `string` has a `length` of **at least** `len`. ```javascript -var str = rpad( 'a', 5 ); +const str = rpad( 'a', 5 ); // returns 'a ' ``` By default, an input `string` is padded with `spaces`. To pad with a different character or sequence of characters, provide a `pad` string. ```javascript -var str = rpad( 'beep', 10, 'p' ); +let str = rpad( 'beep', 10, 'p' ); // returns 'beeppppppp' str = rpad( 'beep', 12, 'boop' ); @@ -60,7 +60,7 @@ str = rpad( 'beep', 12, 'boop' ); - An output `string` is **not** guaranteed to have a length of **exactly** `len`, but to have a `length` of **at least** `len`. To generate a padded `string` having a `length` equal to `len` ```javascript - var str = rpad( 'beep', 10, 'boop' ); + let str = rpad( 'beep', 10, 'boop' ); // returns 'beepboopboop' => length 12 str = str.substring( 0, 10 ); @@ -78,16 +78,14 @@ str = rpad( 'beep', 12, 'boop' ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var rpad = require( '@stdlib/string/right-pad' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const rpad = require( '@stdlib/string/right-pad' ); -var str = 'beep'; -var n; -var i; +const str = 'beep'; -for ( i = 0; i < 100; i++ ) { - n = round( randu()*10.0 ) + str.length; +for ( let i = 0; i < 100; i++ ) { + const n = round( randu()*10.0 ) + str.length; console.log( rpad( str, n, 'p' ) ); } ``` diff --git a/lib/node_modules/@stdlib/string/right-trim-n/README.md b/lib/node_modules/@stdlib/string/right-trim-n/README.md index e0bc9bcc9121..ca70d54b6fc5 100644 --- a/lib/node_modules/@stdlib/string/right-trim-n/README.md +++ b/lib/node_modules/@stdlib/string/right-trim-n/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rtrimN = require( '@stdlib/string/right-trim-n' ); +const rtrimN = require( '@stdlib/string/right-trim-n' ); ``` #### rtrimN( str, n\[, chars] ) @@ -45,8 +45,8 @@ var rtrimN = require( '@stdlib/string/right-trim-n' ); Trims `n` characters from the end of a string. ```javascript -var str = ' foo '; -var out = rtrimN( str, str.length ); +const str = ' foo '; +let out = rtrimN( str, str.length ); // returns ' foo' out = rtrimN( str, 1 ); @@ -56,8 +56,8 @@ out = rtrimN( str, 1 ); By default, the function trims whitespace characters. To trim a different set of characters instead, provide a string or an array of characters to trim: ```javascript -var str = '🐶🐶🐶 Animals 🐶🐶🐶'; -var out = rtrimN( str, str.length, [ '🐶', ' ' ] ); +const str = '🐶🐶🐶 Animals 🐶🐶🐶'; +let out = rtrimN( str, str.length, [ '🐶', ' ' ] ); // returns '🐶🐶🐶 Animals' out = rtrimN( str, str.length, '🐶 ' ); @@ -85,9 +85,9 @@ out = rtrimN( str, str.length, '🐶 ' ); ```javascript -var rtrimN = require( '@stdlib/string/right-trim-n' ); +const rtrimN = require( '@stdlib/string/right-trim-n' ); -var out = rtrimN( ' Whitespace ', 3 ); +let out = rtrimN( ' Whitespace ', 3 ); // returns ' Whitespace' out = rtrimN( '\t\t\tTabs\t\t\t', 2 ); diff --git a/lib/node_modules/@stdlib/string/right-trim/README.md b/lib/node_modules/@stdlib/string/right-trim/README.md index fbff9f7f3c7b..55f91445f0d9 100644 --- a/lib/node_modules/@stdlib/string/right-trim/README.md +++ b/lib/node_modules/@stdlib/string/right-trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rtrim = require( '@stdlib/string/right-trim' ); +const rtrim = require( '@stdlib/string/right-trim' ); ``` #### rtrim( str ) @@ -35,7 +35,7 @@ var rtrim = require( '@stdlib/string/right-trim' ); Trims whitespace from the end of a string. ```javascript -var out = rtrim( ' \t\t\n Beep \r\n\t ' ); +const out = rtrim( ' \t\t\n Beep \r\n\t ' ); // returns ' \t\t\n Beep' ``` @@ -76,9 +76,9 @@ var out = rtrim( ' \t\t\n Beep \r\n\t ' ); ```javascript -var rtrim = require( '@stdlib/string/right-trim' ); +const rtrim = require( '@stdlib/string/right-trim' ); -var out = rtrim( ' Whitespace ' ); +let out = rtrim( ' Whitespace ' ); // returns ' Whitespace' out = rtrim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/snakecase/README.md b/lib/node_modules/@stdlib/string/snakecase/README.md index a11ed79514c5..2b4e47a715cd 100644 --- a/lib/node_modules/@stdlib/string/snakecase/README.md +++ b/lib/node_modules/@stdlib/string/snakecase/README.md @@ -29,7 +29,7 @@ limitations under the License. ## Usage ```javascript -var snakecase = require( '@stdlib/string/snakecase' ); +const snakecase = require( '@stdlib/string/snakecase' ); ``` #### snakecase( str ) @@ -37,7 +37,7 @@ var snakecase = require( '@stdlib/string/snakecase' ); Converts a string to snake case. ```javascript -var str = snakecase( 'Foo Bar' ); +let str = snakecase( 'Foo Bar' ); // returns 'foo_bar' str = snakecase( 'I am a tiny little house' ); @@ -58,10 +58,10 @@ str = snakecase( 'Hello World!' ); ## Examples ```javascript -var snakecase = require( '@stdlib/string/snakecase' ); +const snakecase = require( '@stdlib/string/snakecase' ); -var str = 'foo bar baz'; -var out = snakecase( str ); +let str = 'foo bar baz'; +let out = snakecase( str ); // returns 'foo_bar_baz' str = 'foo_baz'; diff --git a/lib/node_modules/@stdlib/string/split-grapheme-clusters/README.md b/lib/node_modules/@stdlib/string/split-grapheme-clusters/README.md index 68fb2cbac32d..7461e03db09c 100644 --- a/lib/node_modules/@stdlib/string/split-grapheme-clusters/README.md +++ b/lib/node_modules/@stdlib/string/split-grapheme-clusters/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' ); +const splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' ); ``` #### splitGraphemeClusters( str ) @@ -45,7 +45,7 @@ var splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' ); Splits a string by its [grapheme cluster][unicode-text-segmentation] breaks. ```javascript -var out = splitGraphemeClusters( 'café' ); +let out = splitGraphemeClusters( 'café' ); // returns [ 'c', 'a', 'f', 'é' ] out = splitGraphemeClusters( '🍕🍕🍕' ); @@ -73,9 +73,9 @@ out = splitGraphemeClusters( '🍕🍕🍕' ); ```javascript -var splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' ); +const splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' ); -var out = splitGraphemeClusters( 'abc' ); +let out = splitGraphemeClusters( 'abc' ); // returns [ 'a', 'b', 'c' ] out = splitGraphemeClusters( 'Iñtërnâtiônàlizætiøn' ); diff --git a/lib/node_modules/@stdlib/string/startcase/README.md b/lib/node_modules/@stdlib/string/startcase/README.md index a33522843218..52a0f2298215 100644 --- a/lib/node_modules/@stdlib/string/startcase/README.md +++ b/lib/node_modules/@stdlib/string/startcase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var startcase = require( '@stdlib/string/startcase' ); +const startcase = require( '@stdlib/string/startcase' ); ``` #### startcase( str ) @@ -41,7 +41,7 @@ var startcase = require( '@stdlib/string/startcase' ); Capitalizes the first letter of each word in a string. ```javascript -var str = startcase( 'beep boop a foo bar' ); +const str = startcase( 'beep boop a foo bar' ); // returns 'Beep Boop A Foo Bar' ``` @@ -56,9 +56,9 @@ var str = startcase( 'beep boop a foo bar' ); ```javascript -var startcase = require( '@stdlib/string/startcase' ); +const startcase = require( '@stdlib/string/startcase' ); -var str = startcase( 'beep boop foo bar' ); +let str = startcase( 'beep boop foo bar' ); // returns 'Beep Boop Foo Bar' str = startcase( 'Beep' ); diff --git a/lib/node_modules/@stdlib/string/starts-with/README.md b/lib/node_modules/@stdlib/string/starts-with/README.md index c6e4cc027a8a..72a09ca40433 100644 --- a/lib/node_modules/@stdlib/string/starts-with/README.md +++ b/lib/node_modules/@stdlib/string/starts-with/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var startsWith = require( '@stdlib/string/starts-with' ); +const startsWith = require( '@stdlib/string/starts-with' ); ``` #### startsWith( str, search\[, position] ) @@ -41,9 +41,9 @@ var startsWith = require( '@stdlib/string/starts-with' ); Tests if a string starts with the characters of another string. ```javascript -var str = 'To be, or not to be, that is the question.'; +const str = 'To be, or not to be, that is the question.'; -var bool = startsWith( str, 'To be' ); +let bool = startsWith( str, 'To be' ); // returns true bool = startsWith( str, 'to be' ); @@ -53,9 +53,9 @@ bool = startsWith( str, 'to be' ); By default, the function searches from the beginning of the input string. To search from a different character index, provide a `position` value (zero-based). If provided a negative `position`, the start index is determined relative to the string end (i.e., `pos = str.length + position`). ```javascript -var str = 'Remember the story I used to tell you when you were a boy?'; +const str = 'Remember the story I used to tell you when you were a boy?'; -var bool = startsWith( str, 'the story' ); +let bool = startsWith( str, 'the story' ); // returns false bool = startsWith( str, 'the story', 9 ); @@ -68,9 +68,9 @@ bool = startsWith( str, 'you', -15 ); If provided an empty `search` string, the function **always** returns `true`. ```javascript -var str = 'beep boop'; +const str = 'beep boop'; -var bool = startsWith( str, '' ); +const bool = startsWith( str, '' ); // returns true ``` @@ -99,11 +99,11 @@ var bool = startsWith( str, '' ); ```javascript -var startsWith = require( '@stdlib/string/starts-with' ); +const startsWith = require( '@stdlib/string/starts-with' ); -var str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; +const str = 'Fair is foul, and foul is fair, hover through fog and filthy air'; -var bool = startsWith( str, 'Fair' ); +let bool = startsWith( str, 'Fair' ); // returns true bool = startsWith( str, 'fair' ); diff --git a/lib/node_modules/@stdlib/string/substring-after-last/README.md b/lib/node_modules/@stdlib/string/substring-after-last/README.md index 27c1832b4982..6bbdadecfa6f 100644 --- a/lib/node_modules/@stdlib/string/substring-after-last/README.md +++ b/lib/node_modules/@stdlib/string/substring-after-last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var substringAfterLast = require( '@stdlib/string/substring-after-last' ); +const substringAfterLast = require( '@stdlib/string/substring-after-last' ); ``` #### substringAfterLast( str, search\[, fromIndex] ) @@ -45,8 +45,8 @@ var substringAfterLast = require( '@stdlib/string/substring-after-last' ); Returns the part of a string after the last occurrence of a specified substring. ```javascript -var str = 'beep boop'; -var out = substringAfterLast( str, 'b' ); +const str = 'beep boop'; +let out = substringAfterLast( str, 'b' ); // returns 'oop' out = substringAfterLast( str, 'o' ); @@ -56,8 +56,8 @@ out = substringAfterLast( str, 'o' ); By default, the search starts at the end of the string and proceeds backwards to the beginning. To start the search at a specified index, specify an integer for the `fromIndex` argument. ```javascript -var str = 'beep boop'; -var out = substringAfterLast( str, 'b', 3 ); +const str = 'beep boop'; +const out = substringAfterLast( str, 'b', 3 ); // returns 'eep boop' ``` @@ -87,10 +87,10 @@ var out = substringAfterLast( str, 'b', 3 ); ```javascript -var substringAfterLast = require( '@stdlib/string/substring-after-last' ); +const substringAfterLast = require( '@stdlib/string/substring-after-last' ); -var str = 'To be, or not to be, that is the question.'; -var out = substringAfterLast( str, ', ' ); +const str = 'To be, or not to be, that is the question.'; +let out = substringAfterLast( str, ', ' ); // returns 'that is the question.' out = substringAfterLast( str, 'to be' ); diff --git a/lib/node_modules/@stdlib/string/substring-after/README.md b/lib/node_modules/@stdlib/string/substring-after/README.md index 162845569a0a..df2f1a1ae0d3 100644 --- a/lib/node_modules/@stdlib/string/substring-after/README.md +++ b/lib/node_modules/@stdlib/string/substring-after/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var substringAfter = require( '@stdlib/string/substring-after' ); +const substringAfter = require( '@stdlib/string/substring-after' ); ``` #### substringAfter( str, search\[, fromIndex] ) @@ -45,8 +45,8 @@ var substringAfter = require( '@stdlib/string/substring-after' ); Returns the part of a string after a specified substring. ```javascript -var str = 'beep boop'; -var out = substringAfter( str, 'o' ); +const str = 'beep boop'; +let out = substringAfter( str, 'o' ); // returns 'op' out = substringAfter( str, ' ' ); @@ -56,8 +56,8 @@ out = substringAfter( str, ' ' ); By default, the search starts at the beginning of the string. To start searching from a different index, provide a `fromIndex` argument: ```javascript -var str = 'boop baz boop'; -var out = substringAfter( str, 'o', 3 ); +const str = 'boop baz boop'; +const out = substringAfter( str, 'o', 3 ); // returns 'op' ``` @@ -88,10 +88,10 @@ var out = substringAfter( str, 'o', 3 ); ```javascript -var substringAfter = require( '@stdlib/string/substring-after' ); +const substringAfter = require( '@stdlib/string/substring-after' ); -var str = 'To be, or not to be, that is the question.'; -var out = substringAfter( str, ', ' ); +const str = 'To be, or not to be, that is the question.'; +let out = substringAfter( str, ', ' ); // returns 'or not to be, that is the question.' out = substringAfter( str, 'to be' ); diff --git a/lib/node_modules/@stdlib/string/substring-before-last/README.md b/lib/node_modules/@stdlib/string/substring-before-last/README.md index c4ed4078c3ff..0b6b96fe87ae 100644 --- a/lib/node_modules/@stdlib/string/substring-before-last/README.md +++ b/lib/node_modules/@stdlib/string/substring-before-last/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var substringBeforeLast = require( '@stdlib/string/substring-before-last' ); +const substringBeforeLast = require( '@stdlib/string/substring-before-last' ); ``` #### substringBeforeLast( str, search ) @@ -45,8 +45,8 @@ var substringBeforeLast = require( '@stdlib/string/substring-before-last' ); Returns the part of a string before the last occurrence of a specified substring. ```javascript -var str = 'Beep Boop Beep'; -var out = substringBeforeLast( str, 'Beep' ); +const str = 'Beep Boop Beep'; +let out = substringBeforeLast( str, 'Beep' ); // returns 'Beep Boop ' out = substringBeforeLast( str, 'Boop' ); @@ -79,10 +79,10 @@ out = substringBeforeLast( str, 'Boop' ); ```javascript -var substringBeforeLast = require( '@stdlib/string/substring-before-last' ); +const substringBeforeLast = require( '@stdlib/string/substring-before-last' ); -var str = 'beep boop'; -var out = substringBeforeLast( str, ' ' ); +const str = 'beep boop'; +let out = substringBeforeLast( str, ' ' ); // returns 'beep' out = substringBeforeLast( str, 'e' ); diff --git a/lib/node_modules/@stdlib/string/substring-before/README.md b/lib/node_modules/@stdlib/string/substring-before/README.md index 9c4f944736d3..8439d4768d55 100644 --- a/lib/node_modules/@stdlib/string/substring-before/README.md +++ b/lib/node_modules/@stdlib/string/substring-before/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var substringBefore = require( '@stdlib/string/substring-before' ); +const substringBefore = require( '@stdlib/string/substring-before' ); ``` #### substringBefore( str, search ) @@ -45,8 +45,8 @@ var substringBefore = require( '@stdlib/string/substring-before' ); Returns the part of a string before a specified substring. ```javascript -var str = 'beep boop'; -var out = substringBefore( str, ' ' ); +const str = 'beep boop'; +let out = substringBefore( str, ' ' ); // returns 'beep' out = substringBefore( str, 'o' ); @@ -79,9 +79,9 @@ out = substringBefore( str, 'o' ); ```javascript -var substringBefore = require( '@stdlib/string/substring-before' ); +const substringBefore = require( '@stdlib/string/substring-before' ); -var out = substringBefore( 'beep boop', 'p' ); +let out = substringBefore( 'beep boop', 'p' ); // returns 'bee' out = substringBefore( 'Hello World!', 'xyz' ); diff --git a/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator-right/README.md b/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator-right/README.md index 7f51dc6005ff..a6982276f27f 100644 --- a/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator-right/README.md +++ b/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator-right/README.md @@ -39,7 +39,7 @@ limitations under the License. ```javascript -var graphemeClusters2iteratorRight = require( '@stdlib/string/to-grapheme-cluster-iterator-right' ); +const graphemeClusters2iteratorRight = require( '@stdlib/string/to-grapheme-cluster-iterator-right' ); ``` #### graphemeClusters2iteratorRight( src\[, mapFcn\[, thisArg]] ) @@ -49,15 +49,15 @@ Returns an iterator which iterates from right to left over each [grapheme cluste ```javascript -var iter = graphemeClusters2iteratorRight( '🌷🍕' ); +const iter = graphemeClusters2iteratorRight( '🌷🍕' ); -var v = iter.next().value; +let v = iter.next().value; // returns '🍕' v = iter.next().value; // returns '🌷' -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -75,10 +75,10 @@ function fcn( v ) { return v + v; } -var it = graphemeClusters2iteratorRight( 'beep', fcn ); +const it = graphemeClusters2iteratorRight( 'beep', fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 'pp' v = it.next().value; @@ -103,10 +103,10 @@ function fcn( v, i ) { return v + i; } -var it = graphemeClusters2iteratorRight( 'bar', fcn ); +const it = graphemeClusters2iteratorRight( 'bar', fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 'r2' v = it.next().value; @@ -128,20 +128,20 @@ function fcn( v ) { return v; } -var ctx = { +const ctx = { 'count': 0 }; -var it = graphemeClusters2iteratorRight( '🌷🍕', fcn, ctx ); +const it = graphemeClusters2iteratorRight( '🌷🍕', fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns '🍕' v = it.next().value; // returns '🌷' -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -173,17 +173,17 @@ var count = ctx.count; ```javascript -var graphemeClusters2iteratorRight = require( '@stdlib/string/to-grapheme-cluster-iterator-right' ); +const graphemeClusters2iteratorRight = require( '@stdlib/string/to-grapheme-cluster-iterator-right' ); function repeat( str ) { return str + str; } // Create an iterator which iterates over grapheme clusters: -var it = graphemeClusters2iteratorRight( 'Iñtërnâtiônàlizætiøn', repeat ); +const it = graphemeClusters2iteratorRight( 'Iñtërnâtiônàlizætiøn', repeat ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator/README.md b/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator/README.md index ce4af440d199..8c076d3219bc 100644 --- a/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator/README.md +++ b/lib/node_modules/@stdlib/string/to-grapheme-cluster-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var graphemeClusters2iterator = require( '@stdlib/string/to-grapheme-cluster-iterator' ); +const graphemeClusters2iterator = require( '@stdlib/string/to-grapheme-cluster-iterator' ); ``` #### graphemeClusters2iterator( src\[, mapFcn\[, thisArg]] ) @@ -45,15 +45,15 @@ var graphemeClusters2iterator = require( '@stdlib/string/to-grapheme-cluster-ite Returns an iterator which iterates over each [grapheme cluster][unicode-text-segmentation] in a `string`. ```javascript -var iter = graphemeClusters2iterator( '🌷🍕' ); +const iter = graphemeClusters2iterator( '🌷🍕' ); -var v = iter.next().value; +let v = iter.next().value; // returns '🌷' v = iter.next().value; // returns '🍕' -var bool = iter.next().done; +const bool = iter.next().done; // returns true ``` @@ -69,10 +69,10 @@ function fcn( v ) { return v + v; } -var it = graphemeClusters2iterator( 'beep', fcn ); +const it = graphemeClusters2iterator( 'beep', fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 'bb' v = it.next().value; @@ -95,10 +95,10 @@ function fcn( v, i ) { return v + i; } -var it = graphemeClusters2iterator( 'bar', fcn ); +const it = graphemeClusters2iterator( 'bar', fcn ); // returns -var v = it.next().value; +let v = it.next().value; // returns 'b0' v = it.next().value; @@ -118,20 +118,20 @@ function fcn( v ) { return v; } -var ctx = { +const ctx = { 'count': 0 }; -var it = graphemeClusters2iterator( '🌷🍕', fcn, ctx ); +const it = graphemeClusters2iterator( '🌷🍕', fcn, ctx ); // returns -var v = it.next().value; +let v = it.next().value; // returns '🌷' v = it.next().value; // returns '🍕' -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -161,17 +161,17 @@ var count = ctx.count; ```javascript -var graphemeClusters2iterator = require( '@stdlib/string/to-grapheme-cluster-iterator' ); +const graphemeClusters2iterator = require( '@stdlib/string/to-grapheme-cluster-iterator' ); function repeat( str ) { return str + str; } // Create an iterator which iterates over grapheme clusters: -var it = graphemeClusters2iterator( 'Iñtërnâtiônàlizætiøn', repeat ); +const it = graphemeClusters2iterator( 'Iñtërnâtiônàlizætiøn', repeat ); // Perform manual iteration... -var v; +let v; while ( true ) { v = it.next(); if ( v.done ) { diff --git a/lib/node_modules/@stdlib/string/to-well-formed/README.md b/lib/node_modules/@stdlib/string/to-well-formed/README.md index 9bbc402ed9c1..d84c234ff28a 100644 --- a/lib/node_modules/@stdlib/string/to-well-formed/README.md +++ b/lib/node_modules/@stdlib/string/to-well-formed/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var str2wellformed = require( '@stdlib/string/to-well-formed' ); +const str2wellformed = require( '@stdlib/string/to-well-formed' ); ``` #### str2wellformed( str ) @@ -37,7 +37,7 @@ Creates a new well-formed string by replacing all lone surrogates with the repla ```javascript -var result = str2wellformed( '' ); +let result = str2wellformed( '' ); // returns '' result = str2wellformed( '\uDBFF' ); @@ -63,9 +63,9 @@ result = str2wellformed( '-5' ); ```javascript -var str2wellformed = require( '@stdlib/string/to-well-formed' ); +const str2wellformed = require( '@stdlib/string/to-well-formed' ); -var result = str2wellformed( '' ); +let result = str2wellformed( '' ); // returns '' result = str2wellformed( '\uDBFF' ); diff --git a/lib/node_modules/@stdlib/string/tools/README.md b/lib/node_modules/@stdlib/string/tools/README.md index 4208d2243505..4db412050c45 100644 --- a/lib/node_modules/@stdlib/string/tools/README.md +++ b/lib/node_modules/@stdlib/string/tools/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tools = require( '@stdlib/string/tools' ); +const tools = require( '@stdlib/string/tools' ); ``` #### tools @@ -35,7 +35,7 @@ var tools = require( '@stdlib/string/tools' ); Namespace containing string tools. ```javascript -var o = tools; +const o = tools; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var tools = require( '@stdlib/string/tools' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const tools = require( '@stdlib/string/tools' ); console.log( objectKeys( tools ) ); ``` diff --git a/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/README.md b/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/README.md index 4176bd2064a1..4f6d268e41f4 100644 --- a/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/README.md +++ b/lib/node_modules/@stdlib/string/tools/grapheme-cluster-break/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var grapheme = require( '@stdlib/string/tools/grapheme-cluster-break' ); +const grapheme = require( '@stdlib/string/tools/grapheme-cluster-break' ); ``` #### grapheme @@ -53,7 +53,7 @@ A collection of functions for performing grapheme cluster break operations. Returns the grapheme break property from the [Unicode Standard][unicode-grapheme-break-property]. ```javascript -var out = grapheme.breakProperty( 0x008f ); +let out = grapheme.breakProperty( 0x008f ); // returns 2 out = grapheme.breakProperty( 0x111C2 ); @@ -68,7 +68,7 @@ out = grapheme.breakProperty( 0x1F3FC ); Returns the emoji property from the [Unicode Standard][unicode-emoji-property]. ```javascript -var out = grapheme.emojiProperty( 0x23EC ); +let out = grapheme.emojiProperty( 0x23EC ); // returns 101 out = grapheme.emojiProperty( 0x1FFFE ); @@ -80,7 +80,7 @@ out = grapheme.emojiProperty( 0x1FFFE ); Returns the break type between grapheme breaking classes according to _UAX #29 3.1.1 Grapheme Cluster Boundary Rules_ on extended grapheme clusters. ```javascript -var out = grapheme.breakType( [ 11, 3, 11 ], [ 11, 11, 11 ] ); +const out = grapheme.breakType( [ 11, 3, 11 ], [ 11, 11, 11 ] ); // returns 1 ``` @@ -93,7 +93,7 @@ var out = grapheme.breakType( [ 11, 3, 11 ], [ 11, 11, 11 ] ); An object mapping break type names to integer values. ```javascript -var out = grapheme.constants; +const out = grapheme.constants; // returns {...} ``` @@ -118,9 +118,9 @@ var out = grapheme.constants; ```javascript -var grapheme = require( '@stdlib/string/tools/grapheme-cluster-break' ); +const grapheme = require( '@stdlib/string/tools/grapheme-cluster-break' ); -var out = grapheme.breakProperty( 0x008f ); +let out = grapheme.breakProperty( 0x008f ); // returns 2 out = grapheme.emojiProperty( 0x23EC ); diff --git a/lib/node_modules/@stdlib/string/trim/README.md b/lib/node_modules/@stdlib/string/trim/README.md index fb584f9e48c3..58fe4e02a97f 100644 --- a/lib/node_modules/@stdlib/string/trim/README.md +++ b/lib/node_modules/@stdlib/string/trim/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var trim = require( '@stdlib/string/trim' ); +const trim = require( '@stdlib/string/trim' ); ``` #### trim( str ) @@ -35,7 +35,7 @@ var trim = require( '@stdlib/string/trim' ); Trims whitespace characters from the beginning and end of a string. ```javascript -var out = trim( ' \t\t\n Beep \r\n\t ' ); +const out = trim( ' \t\t\n Beep \r\n\t ' ); // returns 'Beep' ``` @@ -76,9 +76,9 @@ var out = trim( ' \t\t\n Beep \r\n\t ' ); ```javascript -var trim = require( '@stdlib/string/trim' ); +const trim = require( '@stdlib/string/trim' ); -var out = trim( ' Whitespace ' ); +let out = trim( ' Whitespace ' ); // returns 'Whitespace' out = trim( '\t\t\tTabs\t\t\t' ); diff --git a/lib/node_modules/@stdlib/string/truncate-middle/README.md b/lib/node_modules/@stdlib/string/truncate-middle/README.md index c41420b914c3..f68c2daa09a6 100644 --- a/lib/node_modules/@stdlib/string/truncate-middle/README.md +++ b/lib/node_modules/@stdlib/string/truncate-middle/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var truncateMiddle = require( '@stdlib/string/truncate-middle' ); +const truncateMiddle = require( '@stdlib/string/truncate-middle' ); ``` #### truncate( str, len\[, seq] ) @@ -45,14 +45,14 @@ var truncateMiddle = require( '@stdlib/string/truncate-middle' ); Truncates a string in the middle to a specified length. ```javascript -var out = truncateMiddle( 'beep boop', 7 ); +const out = truncateMiddle( 'beep boop', 7 ); // returns 'be...op' ``` By default, the truncated string uses the replacement sequence `'...'`. To customize the replacement sequence, provide a `seq` argument: ```javascript -var out = truncateMiddle( 'beep boop', 7, '!' ); +let out = truncateMiddle( 'beep boop', 7, '!' ); // returns 'bee!oop' out = truncateMiddle( 'beep boop', 7, '!!!' ); @@ -80,10 +80,10 @@ out = truncateMiddle( 'beep boop', 7, '!!!' ); ```javascript -var truncateMiddle = require( '@stdlib/string/truncate-middle' ); +const truncateMiddle = require( '@stdlib/string/truncate-middle' ); -var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; -var out = truncateMiddle( str, 15 ); +let str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; +let out = truncateMiddle( str, 15 ); // returns 'Lorem ... elit.' str = 'To be or not to be, that is the question'; diff --git a/lib/node_modules/@stdlib/string/truncate/README.md b/lib/node_modules/@stdlib/string/truncate/README.md index bf86b54fe5e1..f9ab324cc3b7 100644 --- a/lib/node_modules/@stdlib/string/truncate/README.md +++ b/lib/node_modules/@stdlib/string/truncate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var truncate = require( '@stdlib/string/truncate' ); +const truncate = require( '@stdlib/string/truncate' ); ``` #### truncate( str, len\[, ending] ) @@ -45,14 +45,14 @@ var truncate = require( '@stdlib/string/truncate' ); Truncates a string to a specified length. ```javascript -var out = truncate( 'beep boop', 7 ); +const out = truncate( 'beep boop', 7 ); // returns 'beep...' ``` By default, the truncated string is appended with `'...'`. To customize the truncated string, provide an `ending` argument: ```javascript -var out = truncate( 'beep boop', 7, '!' ); +let out = truncate( 'beep boop', 7, '!' ); // returns 'beep b!' out = truncate( 'beep boop', 7, '!!!' ); @@ -80,10 +80,10 @@ out = truncate( 'beep boop', 7, '!!!' ); ```javascript -var truncate = require( '@stdlib/string/truncate' ); +const truncate = require( '@stdlib/string/truncate' ); -var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; -var out = truncate( str, 14 ); +let str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; +let out = truncate( str, 14 ); // returns 'Lorem ipsum...' str = 'To be or not to be, that is the question'; diff --git a/lib/node_modules/@stdlib/string/uncapitalize/README.md b/lib/node_modules/@stdlib/string/uncapitalize/README.md index 4275a1a1532c..5b178e58d9e4 100644 --- a/lib/node_modules/@stdlib/string/uncapitalize/README.md +++ b/lib/node_modules/@stdlib/string/uncapitalize/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var uncapitalize = require( '@stdlib/string/uncapitalize' ); +const uncapitalize = require( '@stdlib/string/uncapitalize' ); ``` #### uncapitalize( str ) @@ -35,7 +35,7 @@ var uncapitalize = require( '@stdlib/string/uncapitalize' ); Uncapitalizes the first character of a string. ```javascript -var out = uncapitalize( 'Last man standing' ); +let out = uncapitalize( 'Last man standing' ); // returns 'last man standing' out = uncapitalize( 'Hidden Treasures' ); @@ -53,9 +53,9 @@ out = uncapitalize( 'Hidden Treasures' ); ```javascript -var uncapitalize = require( '@stdlib/string/uncapitalize' ); +const uncapitalize = require( '@stdlib/string/uncapitalize' ); -var out = uncapitalize( 'Last man standing' ); +let out = uncapitalize( 'Last man standing' ); // returns 'last man standing' out = uncapitalize( 'Presidential election' ); diff --git a/lib/node_modules/@stdlib/string/uppercase/README.md b/lib/node_modules/@stdlib/string/uppercase/README.md index 7ffaf8928af0..7771ad325d6f 100644 --- a/lib/node_modules/@stdlib/string/uppercase/README.md +++ b/lib/node_modules/@stdlib/string/uppercase/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var uppercase = require( '@stdlib/string/uppercase' ); +const uppercase = require( '@stdlib/string/uppercase' ); ``` #### uppercase( str ) @@ -41,7 +41,7 @@ var uppercase = require( '@stdlib/string/uppercase' ); Converts a string to uppercase. ```javascript -var str = uppercase( 'bEEp' ); +const str = uppercase( 'bEEp' ); // returns 'BEEP' ``` @@ -56,9 +56,9 @@ var str = uppercase( 'bEEp' ); ```javascript -var uppercase = require( '@stdlib/string/uppercase' ); +const uppercase = require( '@stdlib/string/uppercase' ); -var str = uppercase( 'Beep' ); +let str = uppercase( 'Beep' ); // returns 'BEEP' str = uppercase( 'BeEp' ); diff --git a/lib/node_modules/@stdlib/string/utf16-to-utf8-array/README.md b/lib/node_modules/@stdlib/string/utf16-to-utf8-array/README.md index 4a44d079d6d5..6133c3fa247f 100644 --- a/lib/node_modules/@stdlib/string/utf16-to-utf8-array/README.md +++ b/lib/node_modules/@stdlib/string/utf16-to-utf8-array/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' ); +const utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' ); ``` #### utf16ToUTF8Array( str ) @@ -45,7 +45,7 @@ var utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' ); Converts a [UTF-16][utf-16] encoded string to an `array` of integers using [UTF-8][utf-8] encoding. ```javascript -var out = utf16ToUTF8Array( '☃' ); +const out = utf16ToUTF8Array( '☃' ); // returns [ 226, 152, 131 ] ``` @@ -94,13 +94,9 @@ var out = utf16ToUTF8Array( '☃' ); ```javascript -var utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' ); +const utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' ); -var values; -var out; -var i; - -values = [ +const values = [ 'Ladies + Gentlemen', 'An encoded string!', 'Dogs, Cats & Mice', @@ -108,8 +104,8 @@ values = [ 'æ', '𐐷' ]; -for ( i = 0; i < values.length; i++ ) { - out = utf16ToUTF8Array( values[ i ] ); +for ( let i = 0; i < values.length; i++ ) { + const out = utf16ToUTF8Array( values[ i ] ); console.log( '%s: %s', values[ i ], out.join( ',' ) ); } ``` diff --git a/lib/node_modules/@stdlib/symbol/README.md b/lib/node_modules/@stdlib/symbol/README.md index 25feb74a2319..fd2df44a933e 100644 --- a/lib/node_modules/@stdlib/symbol/README.md +++ b/lib/node_modules/@stdlib/symbol/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/symbol' ); +const ns = require( '@stdlib/symbol' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/symbol' ); Symbol namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/symbol' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/symbol' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/symbol/async-iterator/README.md b/lib/node_modules/@stdlib/symbol/async-iterator/README.md index d424c9482452..99c0d0ca9c7a 100644 --- a/lib/node_modules/@stdlib/symbol/async-iterator/README.md +++ b/lib/node_modules/@stdlib/symbol/async-iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); +const AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); ``` #### AsyncIteratorSymbol @@ -45,7 +45,7 @@ var AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); Async iterator [`symbol`][mdn-symbol] which specifies the default async iterator for an object. ```javascript -var s = typeof AsyncIteratorSymbol; +const s = typeof AsyncIteratorSymbol; // e.g., returns 'symbol' ``` @@ -74,7 +74,7 @@ var s = typeof AsyncIteratorSymbol; ```javascript -var AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); +const AsyncIteratorSymbol = require( '@stdlib/symbol/async-iterator' ); if ( AsyncIteratorSymbol === null ) { console.log( 'Environment does not support Symbol.asyncIterator.' ); diff --git a/lib/node_modules/@stdlib/symbol/ctor/README.md b/lib/node_modules/@stdlib/symbol/ctor/README.md index 729220d03296..2098dcf63700 100644 --- a/lib/node_modules/@stdlib/symbol/ctor/README.md +++ b/lib/node_modules/@stdlib/symbol/ctor/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Symbol = require( '@stdlib/symbol/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); ``` #### Symbol( \[description] ) @@ -49,7 +49,7 @@ Returns a [`Symbol`][mdn-symbol] primitive. ```javascript -var s = Symbol(); +const s = Symbol(); // returns ``` @@ -58,7 +58,7 @@ To aid debugging, provide a [symbol][mdn-symbol] `description`. ```javascript -var s = Symbol( 'beep' ); +const s = Symbol( 'beep' ); // returns ``` @@ -88,13 +88,11 @@ var s = Symbol( 'beep' ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); - -var s; +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); if ( hasSymbolSupport() ) { - s = Symbol( 'beep' ); + const s = Symbol( 'beep' ); // Print the value type: console.log( typeof s ); diff --git a/lib/node_modules/@stdlib/symbol/iterator/README.md b/lib/node_modules/@stdlib/symbol/iterator/README.md index 7730dee918a7..de2498d81300 100644 --- a/lib/node_modules/@stdlib/symbol/iterator/README.md +++ b/lib/node_modules/@stdlib/symbol/iterator/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var IteratorSymbol = require( '@stdlib/symbol/iterator' ); +const IteratorSymbol = require( '@stdlib/symbol/iterator' ); ``` #### IteratorSymbol @@ -45,7 +45,7 @@ var IteratorSymbol = require( '@stdlib/symbol/iterator' ); Iterator [`symbol`][mdn-symbol] which specifies the default iterator for an object. ```javascript -var s = typeof IteratorSymbol; +const s = typeof IteratorSymbol; // e.g., returns 'symbol' ``` @@ -74,18 +74,12 @@ var s = typeof IteratorSymbol; ```javascript -var IteratorSymbol = require( '@stdlib/symbol/iterator' ); - -var obj; -var v; +const IteratorSymbol = require( '@stdlib/symbol/iterator' ); function iterator() { - var iter; - var i; - - i = -1; + let i = -1; - iter = {}; + const iter = {}; iter.next = next; iter.return = done; @@ -116,7 +110,8 @@ function iterator() { } } -obj = iterator(); +const obj = iterator(); +let v; while ( v === void 0 || ( v.value < 10 && v.done === false ) ) { v = obj.next(); console.log( v.value ); diff --git a/lib/node_modules/@stdlib/time/README.md b/lib/node_modules/@stdlib/time/README.md index d7742ae21889..da539327d885 100644 --- a/lib/node_modules/@stdlib/time/README.md +++ b/lib/node_modules/@stdlib/time/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var time = require( '@stdlib/time' ); +const time = require( '@stdlib/time' ); ``` #### time @@ -35,7 +35,7 @@ var time = require( '@stdlib/time' ); Namespace containing time utilities. ```javascript -var ns = time; +const ns = time; // returns {...} ``` @@ -63,7 +63,7 @@ var ns = time; ```javascript -var num = time.daysInYear( 2000 ); +let num = time.daysInYear( 2000 ); // returns 366 num = time.hoursInMonth( 2, 2017 ); @@ -84,14 +84,14 @@ num = time.hoursInMonth( 2, 2017 ); ```javascript -var time = require( '@stdlib/time' ); +const time = require( '@stdlib/time' ); -var start = time.tic(); +const start = time.tic(); setTimeout( onTimeout, 2000 ); function onTimeout() { - var elapsed = time.toc( start ); + const elapsed = time.toc( start ); console.log( 'Elapsed: %d seconds and %d nanoseconds', elapsed[0], elapsed[1] ); } ``` @@ -109,8 +109,8 @@ function onTimeout() { ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var time = require( '@stdlib/time' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const time = require( '@stdlib/time' ); console.log( objectKeys( time ) ); ``` diff --git a/lib/node_modules/@stdlib/time/base/README.md b/lib/node_modules/@stdlib/time/base/README.md index a969a4c51494..8aaeb706cd0e 100644 --- a/lib/node_modules/@stdlib/time/base/README.md +++ b/lib/node_modules/@stdlib/time/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var time = require( '@stdlib/time/base' ); +const time = require( '@stdlib/time/base' ); ``` #### time @@ -35,7 +35,7 @@ var time = require( '@stdlib/time/base' ); Namespace containing "base" (i.e., lower-level) time utilities. ```javascript -var ns = time; +const ns = time; // returns {...} ``` @@ -72,13 +72,13 @@ The namespace has the following utilities: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/time/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/time/base' ); console.log( objectKeys( ns ) ); // Parse a duration string -var obj = ns.parseDuration( '1m3s10ms' ); +let obj = ns.parseDuration( '1m3s10ms' ); // returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 10 } obj = ns.parseDuration( '1m3s' ); diff --git a/lib/node_modules/@stdlib/time/base/parse-duration/README.md b/lib/node_modules/@stdlib/time/base/parse-duration/README.md index ee25a6fa8d5e..f93f3e6a3a20 100644 --- a/lib/node_modules/@stdlib/time/base/parse-duration/README.md +++ b/lib/node_modules/@stdlib/time/base/parse-duration/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var parseDuration = require( '@stdlib/time/base/parse-duration' ); +const parseDuration = require( '@stdlib/time/base/parse-duration' ); ``` #### parseDuration @@ -35,7 +35,7 @@ var parseDuration = require( '@stdlib/time/base/parse-duration' ); Parses a duration string into an object. ```javascript -var obj = parseDuration( '1m3s10ms' ); +let obj = parseDuration( '1m3s10ms' ); // returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 10 } obj = parseDuration( '1m3s' ); @@ -87,9 +87,9 @@ The returned object has the following properties: ```javascript -var parseDuration = require( '@stdlib/time/base/parse-duration' ); +const parseDuration = require( '@stdlib/time/base/parse-duration' ); -var obj = parseDuration( '1m3s10ms' ); +let obj = parseDuration( '1m3s10ms' ); // returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 10 } obj = parseDuration( '60m' ); diff --git a/lib/node_modules/@stdlib/time/current-year/README.md b/lib/node_modules/@stdlib/time/current-year/README.md index 846d03b00306..bb40050852be 100644 --- a/lib/node_modules/@stdlib/time/current-year/README.md +++ b/lib/node_modules/@stdlib/time/current-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var currentYear = require( '@stdlib/time/current-year' ); +const currentYear = require( '@stdlib/time/current-year' ); ``` #### currentYear() @@ -35,7 +35,7 @@ var currentYear = require( '@stdlib/time/current-year' ); Returns the current year. ```javascript -var year = currentYear(); +const year = currentYear(); // returns ``` @@ -61,9 +61,9 @@ var year = currentYear(); ```javascript -var currentYear = require( '@stdlib/time/current-year' ); +const currentYear = require( '@stdlib/time/current-year' ); -var year = currentYear(); +const year = currentYear(); // returns ``` diff --git a/lib/node_modules/@stdlib/time/day-of-quarter/README.md b/lib/node_modules/@stdlib/time/day-of-quarter/README.md index f9aed170a9c1..46ea2b14fea0 100644 --- a/lib/node_modules/@stdlib/time/day-of-quarter/README.md +++ b/lib/node_modules/@stdlib/time/day-of-quarter/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dayOfQuarter = require( '@stdlib/time/day-of-quarter' ); +const dayOfQuarter = require( '@stdlib/time/day-of-quarter' ); ``` #### dayOfQuarter( \[month\[, day, year]] ) @@ -35,21 +35,21 @@ var dayOfQuarter = require( '@stdlib/time/day-of-quarter' ); Returns the day of the quarter. ```javascript -var num = dayOfQuarter(); +const num = dayOfQuarter(); // returns ``` By default, the function returns the day of the quarter for the current date (according to local time). To determine the day of the quarter for a particular day, provide `month`, `day`, and `year` arguments. ```javascript -var num = dayOfQuarter( 12, 31, 2016 ); +const num = dayOfQuarter( 12, 31, 2016 ); // returns 92 ``` A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = dayOfQuarter( 12, 31, 2016 ); +let num = dayOfQuarter( 12, 31, 2016 ); // returns 92 num = dayOfQuarter( 'dec', 31, 2016 ); @@ -62,7 +62,7 @@ num = dayOfQuarter( 'december', 31, 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = dayOfQuarter( new Date() ); +const num = dayOfQuarter( new Date() ); // returns ``` @@ -77,17 +77,10 @@ var num = dayOfQuarter( new Date() ); ```javascript -var quarterOfYear = require( '@stdlib/time/quarter-of-year' ); -var dayOfQuarter = require( '@stdlib/time/day-of-quarter' ); +const quarterOfYear = require( '@stdlib/time/quarter-of-year' ); +const dayOfQuarter = require( '@stdlib/time/day-of-quarter' ); -var months; -var day; -var yr; -var q; -var v; -var i; - -months = [ +const months = [ 'January', 'February', 'March', @@ -102,12 +95,12 @@ months = [ 'December' ]; -yr = 2016; -day = 9; +const yr = 2016; +const day = 9; -for ( i = 0; i < months.length; i++ ) { - q = quarterOfYear( months[ i ] ); - v = dayOfQuarter( months[ i ], day, yr ); +for ( let i = 0; i < months.length; i++ ) { + const q = quarterOfYear( months[ i ] ); + const v = dayOfQuarter( months[ i ], day, yr ); console.log( 'In the year %d, %s %d is day number %d of Q%d.', yr, months[ i ], day, v, q ); } ``` diff --git a/lib/node_modules/@stdlib/time/day-of-year/README.md b/lib/node_modules/@stdlib/time/day-of-year/README.md index 753c56267339..7f574af95383 100644 --- a/lib/node_modules/@stdlib/time/day-of-year/README.md +++ b/lib/node_modules/@stdlib/time/day-of-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dayOfYear = require( '@stdlib/time/day-of-year' ); +const dayOfYear = require( '@stdlib/time/day-of-year' ); ``` #### dayOfYear( \[month\[, day, year]] ) @@ -35,14 +35,14 @@ var dayOfYear = require( '@stdlib/time/day-of-year' ); Returns the day of the year. ```javascript -var num = dayOfYear(); +const num = dayOfYear(); // returns ``` By default, the function returns the day of the year for the current date (according to local time). To determine the day of the year for a particular day, provide `month`, `day`, and `year` arguments. ```javascript -var num = dayOfYear( 12, 31, 2016 ); +let num = dayOfYear( 12, 31, 2016 ); // returns 366 num = dayOfYear( 12, 31, 2017 ); @@ -52,7 +52,7 @@ num = dayOfYear( 12, 31, 2017 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = dayOfYear( 12, 31, 2016 ); +let num = dayOfYear( 12, 31, 2016 ); // returns 366 num = dayOfYear( 'dec', 31, 2016 ); @@ -65,7 +65,7 @@ num = dayOfYear( 'december', 31, 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = dayOfYear( new Date() ); +const num = dayOfYear( new Date() ); // returns ``` @@ -80,13 +80,10 @@ var num = dayOfYear( new Date() ); ```javascript -var dayOfYear = require( '@stdlib/time/day-of-year' ); +const dayOfYear = require( '@stdlib/time/day-of-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = dayOfYear( 'Dec', 31, i ); +for ( let i = 0; i < 2021; i++ ) { + const v = dayOfYear( 'Dec', 31, i ); console.log( 'In the year %d, December 31 is day number %d.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/days-in-month/README.md b/lib/node_modules/@stdlib/time/days-in-month/README.md index 9bc89ed13a68..19a5a0ce980c 100644 --- a/lib/node_modules/@stdlib/time/days-in-month/README.md +++ b/lib/node_modules/@stdlib/time/days-in-month/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var daysInMonth = require( '@stdlib/time/days-in-month' ); +const daysInMonth = require( '@stdlib/time/days-in-month' ); ``` #### daysInMonth( \[month\[, year]] ) @@ -35,14 +35,14 @@ var daysInMonth = require( '@stdlib/time/days-in-month' ); Returns the number of days in a month. ```javascript -var num = daysInMonth(); +let num = daysInMonth(); // returns ``` By default, the function returns the number of days in the current month of the current year (according to local time). To determine the number of days for a particular month and year, provide `month` and `year` arguments. ```javascript -var num = daysInMonth( 2 ); +let num = daysInMonth( 2 ); // returns num = daysInMonth( 2, 2016 ); @@ -55,7 +55,7 @@ num = daysInMonth( 2, 2017 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = daysInMonth( 2, 2016 ); +let num = daysInMonth( 2, 2016 ); // returns 29 num = daysInMonth( 'feb', 2016 ); @@ -68,7 +68,7 @@ num = daysInMonth( 'february', 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = daysInMonth( new Date() ); +let num = daysInMonth( new Date() ); // returns ``` @@ -93,13 +93,10 @@ var num = daysInMonth( new Date() ); ```javascript -var daysInMonth = require( '@stdlib/time/days-in-month' ); +const daysInMonth = require( '@stdlib/time/days-in-month' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = daysInMonth( 'feb', i ); +for ( let i = 0; i < 2021; i++ ) { + const v = daysInMonth( 'feb', i ); console.log( 'In the year %d, February has %d days.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/days-in-year/README.md b/lib/node_modules/@stdlib/time/days-in-year/README.md index 52411baa6316..2a6a36a79459 100644 --- a/lib/node_modules/@stdlib/time/days-in-year/README.md +++ b/lib/node_modules/@stdlib/time/days-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var daysInYear = require( '@stdlib/time/days-in-year' ); +const daysInYear = require( '@stdlib/time/days-in-year' ); ``` #### daysInYear( \[value] ) @@ -35,14 +35,14 @@ var daysInYear = require( '@stdlib/time/days-in-year' ); Returns the number of days in a year according to the [Gregorian calendar][gregorian-calendar]. ```javascript -var num = daysInYear(); +let num = daysInYear(); // returns ``` By default, the function returns the number of days in the current year (according to local time). To determine the number of days for a particular year, provide either a year or a [`Date`][date-object] object. ```javascript -var num = daysInYear( new Date() ); +let num = daysInYear( new Date() ); // returns num = daysInYear( 2000 ); @@ -73,13 +73,10 @@ num = daysInYear( 2017 ); ```javascript -var daysInYear = require( '@stdlib/time/days-in-year' ); +const daysInYear = require( '@stdlib/time/days-in-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = daysInYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const v = daysInYear( i ); console.log( 'The year %d has %d days.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/duration2ms/README.md b/lib/node_modules/@stdlib/time/duration2ms/README.md index 52965f74a081..f44f8c0cf029 100644 --- a/lib/node_modules/@stdlib/time/duration2ms/README.md +++ b/lib/node_modules/@stdlib/time/duration2ms/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var duration2ms = require( '@stdlib/time/duration2ms' ); +const duration2ms = require( '@stdlib/time/duration2ms' ); ``` #### duration2ms( str ) @@ -35,7 +35,7 @@ var duration2ms = require( '@stdlib/time/duration2ms' ); Converts a duration string to milliseconds. ```javascript -var ms = duration2ms( '1d' ); +let ms = duration2ms( '1d' ); // returns 86400000 ms = duration2ms( '1d2h3m4s5ms' ); @@ -73,9 +73,9 @@ ms = duration2ms( '1d2h3m4s5ms' ); ```javascript -var duration2ms = require( '@stdlib/time/duration2ms' ); +const duration2ms = require( '@stdlib/time/duration2ms' ); -var ms = duration2ms( '5s20ms' ); +let ms = duration2ms( '5s20ms' ); // returns 5020 ms = duration2ms( '1h' ); diff --git a/lib/node_modules/@stdlib/time/hours-in-month/README.md b/lib/node_modules/@stdlib/time/hours-in-month/README.md index 2b0348deb86e..4e9c6b0ea485 100644 --- a/lib/node_modules/@stdlib/time/hours-in-month/README.md +++ b/lib/node_modules/@stdlib/time/hours-in-month/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hoursInMonth = require( '@stdlib/time/hours-in-month' ); +const hoursInMonth = require( '@stdlib/time/hours-in-month' ); ``` #### hoursInMonth( \[month\[, year]] ) @@ -35,14 +35,14 @@ var hoursInMonth = require( '@stdlib/time/hours-in-month' ); Returns the number of hours in a month. ```javascript -var num = hoursInMonth(); +let num = hoursInMonth(); // returns ``` By default, the function returns the number of hours in the current month of the current year (according to local time). To determine the number of hours for a particular month and year, provide `month` and `year` arguments. ```javascript -var num = hoursInMonth( 2 ); +let num = hoursInMonth( 2 ); // returns num = hoursInMonth( 2, 2016 ); @@ -55,7 +55,7 @@ num = hoursInMonth( 2, 2017 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = hoursInMonth( 2, 2016 ); +let num = hoursInMonth( 2, 2016 ); // returns 696 num = hoursInMonth( 'feb', 2016 ); @@ -68,7 +68,7 @@ num = hoursInMonth( 'february', 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = hoursInMonth( new Date() ); +let num = hoursInMonth( new Date() ); // returns ``` @@ -93,13 +93,10 @@ var num = hoursInMonth( new Date() ); ```javascript -var hoursInMonth = require( '@stdlib/time/hours-in-month' ); +const hoursInMonth = require( '@stdlib/time/hours-in-month' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = hoursInMonth( 'feb', i ); +for ( let i = 0; i < 2021; i++ ) { + const v = hoursInMonth( 'feb', i ); console.log( 'In the year %d, February has %d hours.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/hours-in-year/README.md b/lib/node_modules/@stdlib/time/hours-in-year/README.md index 0887fb6a4c92..335ee662e2b1 100644 --- a/lib/node_modules/@stdlib/time/hours-in-year/README.md +++ b/lib/node_modules/@stdlib/time/hours-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var hoursInYear = require( '@stdlib/time/hours-in-year' ); +const hoursInYear = require( '@stdlib/time/hours-in-year' ); ``` #### hoursInYear( \[value] ) @@ -35,14 +35,14 @@ var hoursInYear = require( '@stdlib/time/hours-in-year' ); Returns the number of hours in a year according to the [Gregorian calendar][gregorian-calendar]. ```javascript -var num = hoursInYear(); +let num = hoursInYear(); // returns ``` By default, the function returns the number of hours in the current year (according to local time). To determine the number of hours for a particular year, provide either a year or a [`Date`][date-object] object. ```javascript -var num = hoursInYear( new Date() ); +let num = hoursInYear( new Date() ); // returns num = hoursInYear( 2000 ); @@ -73,13 +73,10 @@ num = hoursInYear( 2017 ); ```javascript -var hoursInYear = require( '@stdlib/time/hours-in-year' ); +const hoursInYear = require( '@stdlib/time/hours-in-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = hoursInYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const v = hoursInYear( i ); console.log( 'The year %d has %d hours.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/iso-weeks-in-year/README.md b/lib/node_modules/@stdlib/time/iso-weeks-in-year/README.md index c7ddef9983e6..0281577d76ef 100644 --- a/lib/node_modules/@stdlib/time/iso-weeks-in-year/README.md +++ b/lib/node_modules/@stdlib/time/iso-weeks-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var isoWeeksInYear = require( '@stdlib/time/iso-weeks-in-year' ); +const isoWeeksInYear = require( '@stdlib/time/iso-weeks-in-year' ); ``` #### isoWeeksInYear( \[value] ) @@ -35,14 +35,14 @@ var isoWeeksInYear = require( '@stdlib/time/iso-weeks-in-year' ); Returns the number of [ISO weeks][iso-week-date] in a year according to the [Gregorian calendar][gregorian-calendar]. ```javascript -var num = isoWeeksInYear(); +let num = isoWeeksInYear(); // returns ``` By default, the function returns the number of [ISO weeks][iso-week-date] in the current year (according to local time). To determine the number of [ISO weeks][iso-week-date] for a particular year, provide either a year or a [`Date`][date-object] object. ```javascript -var num = isoWeeksInYear( new Date() ); +let num = isoWeeksInYear( new Date() ); // returns num = isoWeeksInYear( 2015 ); @@ -63,13 +63,10 @@ num = isoWeeksInYear( 2017 ); ```javascript -var isoWeeksInYear = require( '@stdlib/time/iso-weeks-in-year' ); +const isoWeeksInYear = require( '@stdlib/time/iso-weeks-in-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = isoWeeksInYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const v = isoWeeksInYear( i ); console.log( 'The year %d has %d ISO weeks.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/minutes-in-month/README.md b/lib/node_modules/@stdlib/time/minutes-in-month/README.md index bbf0ed273fa5..52a17622e334 100644 --- a/lib/node_modules/@stdlib/time/minutes-in-month/README.md +++ b/lib/node_modules/@stdlib/time/minutes-in-month/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minutesInMonth = require( '@stdlib/time/minutes-in-month' ); +const minutesInMonth = require( '@stdlib/time/minutes-in-month' ); ``` #### minutesInMonth( \[month\[, year]] ) @@ -35,14 +35,14 @@ var minutesInMonth = require( '@stdlib/time/minutes-in-month' ); Returns the number of minutes in a month. ```javascript -var num = minutesInMonth(); +const num = minutesInMonth(); // returns ``` By default, the function returns the number of minutes in the current month of the current year (according to local time). To determine the number of minutes for a particular month and year, provide `month` and `year` arguments. ```javascript -var num = minutesInMonth( 2 ); +let num = minutesInMonth( 2 ); // returns num = minutesInMonth( 2, 2016 ); @@ -55,7 +55,7 @@ num = minutesInMonth( 2, 2017 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = minutesInMonth( 2, 2016 ); +let num = minutesInMonth( 2, 2016 ); // returns 41760 num = minutesInMonth( 'feb', 2016 ); @@ -68,7 +68,7 @@ num = minutesInMonth( 'february', 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = minutesInMonth( new Date() ); +const num = minutesInMonth( new Date() ); // returns ``` @@ -93,13 +93,10 @@ var num = minutesInMonth( new Date() ); ```javascript -var minutesInMonth = require( '@stdlib/time/minutes-in-month' ); +const minutesInMonth = require( '@stdlib/time/minutes-in-month' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = minutesInMonth( 'feb', i ); +for ( let i = 0; i < 2021; i++ ) { + const v = minutesInMonth( 'feb', i ); console.log( 'In the year %d, February has %d minutes.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/minutes-in-year/README.md b/lib/node_modules/@stdlib/time/minutes-in-year/README.md index b3a98e89d9bb..9517af5724c0 100644 --- a/lib/node_modules/@stdlib/time/minutes-in-year/README.md +++ b/lib/node_modules/@stdlib/time/minutes-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var minutesInYear = require( '@stdlib/time/minutes-in-year' ); +const minutesInYear = require( '@stdlib/time/minutes-in-year' ); ``` #### minutesInYear( \[value] ) @@ -35,14 +35,14 @@ var minutesInYear = require( '@stdlib/time/minutes-in-year' ); Returns the number of minutes in a year according to the [Gregorian calendar][gregorian-calendar]. ```javascript -var num = minutesInYear(); +let num = minutesInYear(); // returns ``` By default, the function returns the number of minutes in the current year (according to local time). To determine the number of minutes for a particular year, provide either a year or a [`Date`][date-object] object. ```javascript -var num = minutesInYear( new Date() ); +let num = minutesInYear( new Date() ); // returns num = minutesInYear( 2000 ); @@ -73,13 +73,10 @@ num = minutesInYear( 2017 ); ```javascript -var minutesInYear = require( '@stdlib/time/minutes-in-year' ); +const minutesInYear = require( '@stdlib/time/minutes-in-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = minutesInYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const v = minutesInYear( i ); console.log( 'The year %d has %d minutes.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/ms2duration/README.md b/lib/node_modules/@stdlib/time/ms2duration/README.md index 5418ace75f1e..c31db00c011d 100644 --- a/lib/node_modules/@stdlib/time/ms2duration/README.md +++ b/lib/node_modules/@stdlib/time/ms2duration/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ms2duration = require( '@stdlib/time/ms2duration' ); +const ms2duration = require( '@stdlib/time/ms2duration' ); ``` #### ms2duration( str ) @@ -35,7 +35,7 @@ var ms2duration = require( '@stdlib/time/ms2duration' ); Converts a number of milliseconds to a string duration. ```javascript -var duration = ms2duration( 1030 ); +let duration = ms2duration( 1030 ); // returns '1s30ms' duration = ms2duration( 3600000 ); @@ -71,9 +71,9 @@ duration = ms2duration( 3600000 ); ```javascript -var ms2duration = require( '@stdlib/time/ms2duration' ); +const ms2duration = require( '@stdlib/time/ms2duration' ); -var duration = ms2duration( 1030 ); +let duration = ms2duration( 1030 ); // returns '1s30ms' duration = ms2duration( 3600000 ); diff --git a/lib/node_modules/@stdlib/time/now/README.md b/lib/node_modules/@stdlib/time/now/README.md index 83f5344d6d31..ececd2f5d349 100644 --- a/lib/node_modules/@stdlib/time/now/README.md +++ b/lib/node_modules/@stdlib/time/now/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var now = require( '@stdlib/time/now' ); +const now = require( '@stdlib/time/now' ); ``` #### now() @@ -35,7 +35,7 @@ var now = require( '@stdlib/time/now' ); Returns the time in **seconds** since the epoch. ```javascript -var ts = now(); +const ts = now(); // returns ``` @@ -60,14 +60,14 @@ var ts = now(); ```javascript -var now = require( '@stdlib/time/now' ); +const now = require( '@stdlib/time/now' ); -var t0 = now(); +const t0 = now(); setTimeout( onTimeout, 2000 ); function onTimeout() { - var t1 = now(); + const t1 = now(); console.log( 'Seconds elapsed: %d', t1-t0 ); } ``` diff --git a/lib/node_modules/@stdlib/time/quarter-of-year/README.md b/lib/node_modules/@stdlib/time/quarter-of-year/README.md index 638fd5155019..da5c1d012a74 100644 --- a/lib/node_modules/@stdlib/time/quarter-of-year/README.md +++ b/lib/node_modules/@stdlib/time/quarter-of-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var quarterOfYear = require( '@stdlib/time/quarter-of-year' ); +const quarterOfYear = require( '@stdlib/time/quarter-of-year' ); ``` #### quarterOfYear( \[month] ) @@ -35,14 +35,14 @@ var quarterOfYear = require( '@stdlib/time/quarter-of-year' ); Returns the quarter of the year. ```javascript -var q = quarterOfYear(); +let q = quarterOfYear(); // returns ``` By default, the function returns the quarter of the year for the current month in the current year (according to local time). To determine the quarter for a particular month, provide either a month or a [`Date`][date-object] object. ```javascript -var q = quarterOfYear( new Date() ); +q = quarterOfYear( new Date() ); // returns q = quarterOfYear( 4 ); @@ -52,7 +52,7 @@ q = quarterOfYear( 4 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var q = quarterOfYear( 4 ); +q = quarterOfYear( 4 ); // returns 2 q = quarterOfYear( 'April' ); @@ -73,13 +73,9 @@ q = quarterOfYear( 'apr' ); ```javascript -var quarterOfYear = require( '@stdlib/time/quarter-of-year' ); - -var months; -var q; -var i; +const quarterOfYear = require( '@stdlib/time/quarter-of-year' ); -months = [ +const months = [ 'January', 'February', 'March', @@ -94,8 +90,8 @@ months = [ 'December' ]; -for ( i = 0; i < months.length; i++ ) { - q = quarterOfYear( months[ i ] ); +for ( let i = 0; i < months.length; i++ ) { + const q = quarterOfYear( months[ i ] ); console.log( 'The month of %s is in Q%d.', months[ i ], q ); } ``` diff --git a/lib/node_modules/@stdlib/time/seconds-in-month/README.md b/lib/node_modules/@stdlib/time/seconds-in-month/README.md index 09ac2374dd05..c2dab8f741b1 100644 --- a/lib/node_modules/@stdlib/time/seconds-in-month/README.md +++ b/lib/node_modules/@stdlib/time/seconds-in-month/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var secondsInMonth = require( '@stdlib/time/seconds-in-month' ); +const secondsInMonth = require( '@stdlib/time/seconds-in-month' ); ``` #### secondsInMonth( \[month\[, year]] ) @@ -35,14 +35,14 @@ var secondsInMonth = require( '@stdlib/time/seconds-in-month' ); Returns the number of seconds in a month. ```javascript -var num = secondsInMonth(); +const num = secondsInMonth(); // returns ``` By default, the function returns the number of seconds in the current month of the current year (according to local time). To determine the number of seconds for a particular month and year, provide `month` and `year` arguments. ```javascript -var num = secondsInMonth( 2 ); +let num = secondsInMonth( 2 ); // returns num = secondsInMonth( 2, 2016 ); @@ -55,7 +55,7 @@ num = secondsInMonth( 2, 2017 ); A `month` may be either a month's integer value, three letter abbreviation, or full name (case insensitive). ```javascript -var num = secondsInMonth( 2, 2016 ); +let num = secondsInMonth( 2, 2016 ); // returns 2505600 num = secondsInMonth( 'feb', 2016 ); @@ -68,7 +68,7 @@ num = secondsInMonth( 'february', 2016 ); The function also supports providing a [`Date`][date-object] object. ```javascript -var num = secondsInMonth( new Date() ); +const num = secondsInMonth( new Date() ); // returns ``` @@ -93,13 +93,11 @@ var num = secondsInMonth( new Date() ); ```javascript -var secondsInMonth = require( '@stdlib/time/seconds-in-month' ); +const secondsInMonth = require( '@stdlib/time/seconds-in-month' ); -var v; -var i; -for ( i = 0; i < 2021; i++ ) { - v = secondsInMonth( 'feb', i ); +for ( let i = 0; i < 2021; i++ ) { + const v = secondsInMonth( 'feb', i ); console.log( 'In the year %d, February has %d seconds.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/seconds-in-year/README.md b/lib/node_modules/@stdlib/time/seconds-in-year/README.md index 26e65af024b0..c9ec520ee5cb 100644 --- a/lib/node_modules/@stdlib/time/seconds-in-year/README.md +++ b/lib/node_modules/@stdlib/time/seconds-in-year/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var secondsInYear = require( '@stdlib/time/seconds-in-year' ); +const secondsInYear = require( '@stdlib/time/seconds-in-year' ); ``` #### secondsInYear( \[value] ) @@ -35,14 +35,14 @@ var secondsInYear = require( '@stdlib/time/seconds-in-year' ); Returns the number of seconds in a year according to the [Gregorian calendar][gregorian-calendar]. ```javascript -var num = secondsInYear(); +const num = secondsInYear(); // returns ``` By default, the function returns the number of seconds in the current year (according to local time). To determine the number of seconds for a particular year, provide either a year or a [`Date`][date-object] object. ```javascript -var num = secondsInYear( new Date() ); +let num = secondsInYear( new Date() ); // returns num = secondsInYear( 2000 ); @@ -73,13 +73,10 @@ num = secondsInYear( 2017 ); ```javascript -var secondsInYear = require( '@stdlib/time/seconds-in-year' ); +const secondsInYear = require( '@stdlib/time/seconds-in-year' ); -var v; -var i; - -for ( i = 0; i < 2021; i++ ) { - v = secondsInYear( i ); +for ( let i = 0; i < 2021; i++ ) { + const v = secondsInYear( i ); console.log( 'The year %d has %d seconds.', i, v ); } ``` diff --git a/lib/node_modules/@stdlib/time/tic/README.md b/lib/node_modules/@stdlib/time/tic/README.md index b5a44605a5f2..945ea42eb7c0 100644 --- a/lib/node_modules/@stdlib/time/tic/README.md +++ b/lib/node_modules/@stdlib/time/tic/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var tic = require( '@stdlib/time/tic' ); +const tic = require( '@stdlib/time/tic' ); ``` #### tic() @@ -35,7 +35,7 @@ var tic = require( '@stdlib/time/tic' ); Returns a high-resolution time. ```javascript -var t = tic(); +const t = tic(); // returns [,] ``` @@ -63,15 +63,15 @@ The returned `array` has the following format: `[seconds, nanoseconds]`. ```javascript -var tic = require( '@stdlib/time/tic' ); -var toc = require( '@stdlib/time/toc' ); +const tic = require( '@stdlib/time/tic' ); +const toc = require( '@stdlib/time/toc' ); -var start = tic(); +const start = tic(); setTimeout( onTimeout, 2000 ); function onTimeout() { - var elapsed = toc( start ); + const elapsed = toc( start ); console.log( 'Elapsed: %d seconds and %d nanoseconds', elapsed[0], elapsed[1] ); } ``` diff --git a/lib/node_modules/@stdlib/time/toc/README.md b/lib/node_modules/@stdlib/time/toc/README.md index 5f49abce692a..0605e6c35961 100644 --- a/lib/node_modules/@stdlib/time/toc/README.md +++ b/lib/node_modules/@stdlib/time/toc/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var toc = require( '@stdlib/time/toc' ); +const toc = require( '@stdlib/time/toc' ); ``` #### toc( time ) @@ -35,7 +35,7 @@ var toc = require( '@stdlib/time/toc' ); Returns a high-resolution time difference, where `time` is a two-element `array` with format `[seconds, nanoseconds]`. ```javascript -var delta = toc( [ 100, 123456789 ] ); +const delta = toc( [ 100, 123456789 ] ); // returns [,] ``` @@ -62,15 +62,15 @@ Similar to `time`, the returned `array` has format `[seconds, nanoseconds]`. ```javascript -var tic = require( '@stdlib/time/tic' ); -var toc = require( '@stdlib/time/toc' ); +const tic = require( '@stdlib/time/tic' ); +const toc = require( '@stdlib/time/toc' ); -var start = tic(); +const start = tic(); setTimeout( onTimeout, 2000 ); function onTimeout() { - var elapsed = toc( start ); + const elapsed = toc( start ); console.log( 'Elapsed: %d seconds and %d nanoseconds', elapsed[0], elapsed[1] ); } ``` diff --git a/lib/node_modules/@stdlib/types/README.md b/lib/node_modules/@stdlib/types/README.md index a6180c61cb5d..b2c94412f00d 100644 --- a/lib/node_modules/@stdlib/types/README.md +++ b/lib/node_modules/@stdlib/types/README.md @@ -60,7 +60,7 @@ import { Iterator } from '@stdlib/types/iter'; function sum( iter: Iterator ): number { let s = 0.0; while ( true ) { - let v = iter.next(); + const v = iter.next(); if ( v.done ) { break; } diff --git a/lib/node_modules/@stdlib/utils/README.md b/lib/node_modules/@stdlib/utils/README.md index 0f59ddc58f0b..e0d0b4ffb4a6 100644 --- a/lib/node_modules/@stdlib/utils/README.md +++ b/lib/node_modules/@stdlib/utils/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var utils = require( '@stdlib/utils' ); +const utils = require( '@stdlib/utils' ); ``` #### utils @@ -35,7 +35,7 @@ var utils = require( '@stdlib/utils' ); Namespace containing utilities. ```javascript -var o = utils; +const o = utils; // returns {...} ``` @@ -359,8 +359,8 @@ The namespace has the following sub-namespaces: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var utils = require( '@stdlib/utils' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const utils = require( '@stdlib/utils' ); console.log( objectKeys( utils ) ); ``` diff --git a/lib/node_modules/@stdlib/utils/any-by-right/README.md b/lib/node_modules/@stdlib/utils/any-by-right/README.md index 79438586bf93..d8db5ee3d8e1 100644 --- a/lib/node_modules/@stdlib/utils/any-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/any-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyByRight = require( '@stdlib/utils/any-by-right' ); +const anyByRight = require( '@stdlib/utils/any-by-right' ); ``` #### anyByRight( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ -1, 1, 2, 3, 4 ]; +const arr = [ -1, 1, 2, 3, 4 ]; -var bool = anyByRight( arr, isNegative ); +const bool = anyByRight( arr, isNegative ); // returns true ``` @@ -65,9 +65,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ -1, -2, 3, -4 ]; +const arr = [ -1, -2, 3, -4 ]; -var bool = anyByRight( arr, isNegative ); +const bool = anyByRight( arr, isNegative ); // returns true ``` @@ -86,17 +86,17 @@ function sum( value ) { return ( value < 0 ); } -var arr = [ -5, 1, 2, 3, 4 ]; +const arr = [ -5, 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = anyByRight( arr, sum, context ); +const bool = anyByRight( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 1.0 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = anyByRight( [], alwaysTrue ); + const bool = anyByRight( [], alwaysTrue ); // returns false ``` @@ -134,9 +134,9 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var arr = [ -1, 1, , , 4 ]; + const arr = [ -1, 1, , , 4 ]; - var bool = anyByRight( arr, log ); + const bool = anyByRight( arr, log ); /* => 4: 4 3: undefined @@ -161,23 +161,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var anyByRight = require( '@stdlib/utils/any-by-right' ); +const randu = require( '@stdlib/random/base/randu' ); +const anyByRight = require( '@stdlib/utils/any-by-right' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = anyByRight( arr, threshold ); +const bool = anyByRight( arr, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/any-by/README.md b/lib/node_modules/@stdlib/utils/any-by/README.md index 65a3cd813367..adabf560e199 100644 --- a/lib/node_modules/@stdlib/utils/any-by/README.md +++ b/lib/node_modules/@stdlib/utils/any-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyBy = require( '@stdlib/utils/any-by' ); +const anyBy = require( '@stdlib/utils/any-by' ); ``` #### anyBy( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ 1, 2, 3, 4, -1 ]; +const arr = [ 1, 2, 3, 4, -1 ]; -var bool = anyBy( arr, isNegative ); +const bool = anyBy( arr, isNegative ); // returns true ``` @@ -65,9 +65,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, -2, 3, 4 ]; +const arr = [ 1, -2, 3, 4 ]; -var bool = anyBy( arr, isPositive ); +const bool = anyBy( arr, isPositive ); // returns true ``` @@ -86,17 +86,17 @@ function sum( value ) { return ( value < 0 ); } -var arr = [ 1, 2, 3, 4, -5 ]; +const arr = [ 1, 2, 3, 4, -5 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = anyBy( arr, sum, context ); +const bool = anyBy( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 1.0 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = anyBy( [], alwaysTrue ); + const bool = anyBy( [], alwaysTrue ); // returns false ``` @@ -134,9 +134,9 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var arr = [ 1, , , 4, -1 ]; + const arr = [ 1, , , 4, -1 ]; - var bool = anyBy( arr, log ); + const bool = anyBy( arr, log ); /* => 0: 1 1: undefined @@ -161,23 +161,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var anyBy = require( '@stdlib/utils/any-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const anyBy = require( '@stdlib/utils/any-by' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var arr; -var i; - -arr = []; -for ( i = 0; i < 100; i++ ) { +const arr = []; +for ( let i = 0; i < 100; i++ ) { arr.push( randu() ); } -bool = anyBy( arr, threshold ); +const bool = anyBy( arr, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/any-in-by/README.md b/lib/node_modules/@stdlib/utils/any-in-by/README.md index 7c08decc0326..a7401411db75 100644 --- a/lib/node_modules/@stdlib/utils/any-in-by/README.md +++ b/lib/node_modules/@stdlib/utils/any-in-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyInBy = require( '@stdlib/utils/any-in-by' ); +const anyInBy = require( '@stdlib/utils/any-in-by' ); ``` #### anyInBy( object, predicate\[, thisArg ] ) @@ -49,13 +49,13 @@ function isNegative( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': -1 }; -var bool = anyInBy( obj, isNegative ); +const bool = anyInBy( obj, isNegative ); // returns true ``` @@ -69,13 +69,13 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': -2, 'c': 3 }; -var bool = anyInBy( obj, isPositive ); +const bool = anyInBy( obj, isPositive ); // returns true ``` @@ -94,22 +94,22 @@ function sum( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': -4 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = anyInBy( obj, sum, context ); +const bool = anyInBy( obj, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 0.5 ``` @@ -131,7 +131,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = anyInBy( {}, alwaysTrue ); + const bool = anyInBy( {}, alwaysTrue ); // returns false ``` @@ -148,22 +148,20 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var anyInBy = require( '@stdlib/utils/any-in-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const anyInBy = require( '@stdlib/utils/any-in-by' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var obj = {}; -var i; +const obj = {}; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { obj[i] = randu(); } -bool = anyInBy( obj, threshold ); +const bool = anyInBy( obj, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/any-own-by/README.md b/lib/node_modules/@stdlib/utils/any-own-by/README.md index 32785b274d7a..7a9f567aa719 100644 --- a/lib/node_modules/@stdlib/utils/any-own-by/README.md +++ b/lib/node_modules/@stdlib/utils/any-own-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyOwnBy = require( '@stdlib/utils/any-own-by' ); +const anyOwnBy = require( '@stdlib/utils/any-own-by' ); ``` #### anyBy( collection, predicate\[, thisArg ] ) @@ -49,7 +49,7 @@ function isNegative( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, @@ -57,7 +57,7 @@ var obj = { 'e': 12 }; -var bool = anyOwnBy( obj, isNegative ); +const bool = anyOwnBy( obj, isNegative ); // returns true ``` @@ -71,7 +71,7 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, @@ -79,7 +79,7 @@ var obj = { 'e': 12 }; -var bool = anyOwnBy( obj, isPositive ); +const bool = anyOwnBy( obj, isPositive ); // returns true ``` @@ -98,22 +98,22 @@ function verify( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': -1, 'b': -2, 'c': 3, 'd': -14 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = anyOwnBy( obj, verify, context ); +const bool = anyOwnBy( obj, verify, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 0 ``` @@ -133,7 +133,7 @@ var mean = context.sum / context.count; function verify() { return true; } - var bool = anyOwnBy( {}, verify ); + const bool = anyOwnBy( {}, verify ); // returns false ``` @@ -150,22 +150,20 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var anyOwnBy = require( '@stdlib/utils/any-own-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const anyOwnBy = require( '@stdlib/utils/any-own-by' ); function threshold( value ) { return ( value > 0.94 ); } -var bool; -var obj = {}; -var keys = [ 'a', 'b', 'c', 'd', 'e' ]; -var i; -for ( i = 0; i < keys.length; i++ ) { +const obj = {}; +const keys = [ 'a', 'b', 'c', 'd', 'e' ]; +for ( let i = 0; i < keys.length; i++ ) { obj[ keys[ i ] ] = randu(); } -bool = anyOwnBy( obj, threshold ); +const bool = anyOwnBy( obj, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/any/README.md b/lib/node_modules/@stdlib/utils/any/README.md index ec9a5c28597d..92caa7569815 100644 --- a/lib/node_modules/@stdlib/utils/any/README.md +++ b/lib/node_modules/@stdlib/utils/any/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var any = require( '@stdlib/utils/any' ); +const any = require( '@stdlib/utils/any' ); ``` #### any( collection ) @@ -45,16 +45,16 @@ var any = require( '@stdlib/utils/any' ); Tests whether at least one element in a `collection` is truthy. ```javascript -var arr = [ 0, 0, 0, 0, 1 ]; +const arr = [ 0, 0, 0, 0, 1 ]; -var bool = any( arr ); +const bool = any( arr ); // returns true ``` If provided an empty `collection`, the function returns `false`. ```javascript -var bool = any( [] ); +const bool = any( [] ); // returns false ``` @@ -84,19 +84,15 @@ var bool = any( [] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var any = require( '@stdlib/utils/any' ); +const randu = require( '@stdlib/random/base/randu' ); +const any = require( '@stdlib/utils/any' ); -var bool; -var arr; -var i; - -arr = []; -for ( i = 0; i < 100; i++ ) { +const arr = []; +for ( let i = 0; i < 100; i++ ) { arr.push( ( randu() > 0.95 ) ); } -bool = any( arr ); +const bool = any( arr ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/append/README.md b/lib/node_modules/@stdlib/utils/append/README.md index fa8bcbfedb1e..21bb134a7198 100644 --- a/lib/node_modules/@stdlib/utils/append/README.md +++ b/lib/node_modules/@stdlib/utils/append/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var append = require( '@stdlib/utils/append' ); +const append = require( '@stdlib/utils/append' ); ``` #### append( collection1, collection2 ) @@ -45,31 +45,31 @@ var append = require( '@stdlib/utils/append' ); Adds elements from one `collection` to the end of another `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = append( arr, [ 6.0, 7.0 ] ); +const out = append( arr, [ 6.0, 7.0 ] ); // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` Note that the function returns the extended collection. For [typed arrays][mdn-typed-array], the returned value is a new [typed array][mdn-typed-array] view whose underlying [`ArrayBuffer`][mdn-arraybuffer] may **not** equal the underlying [`ArrayBuffer`][mdn-arraybuffer] for the input `collection`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Float64Array = require( '@stdlib/array/float64' ); -var buf = new ArrayBuffer( 3*8 ); // 8 bytes per double +const buf = new ArrayBuffer( 3*8 ); // 8 bytes per double -var arr = new Float64Array( buf, 0, 2 ); +const arr = new Float64Array( buf, 0, 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = append( arr, [ 3.0 ] ); +let out = append( arr, [ 3.0 ] ); // returns [ 1.0, 2.0, 3.0 ] -var bool = ( out === arr ); +let bool = ( out === arr ); // returns false bool = ( out.buffer === arr.buffer ); @@ -108,14 +108,11 @@ bool = ( out.buffer === arr.buffer ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var append = require( '@stdlib/utils/append' ); +const Float64Array = require( '@stdlib/array/float64' ); +const append = require( '@stdlib/utils/append' ); -var arr; -var i; - -arr = new Float64Array(); -for ( i = 0; i < 100; i++ ) { +let arr = new Float64Array(); +for ( let i = 0; i < 100; i++ ) { arr = append( arr, [ i, i+1, i+2 ] ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/utils/argument-function/README.md b/lib/node_modules/@stdlib/utils/argument-function/README.md index bede01fd1183..e185e8d85128 100644 --- a/lib/node_modules/@stdlib/utils/argument-function/README.md +++ b/lib/node_modules/@stdlib/utils/argument-function/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var argumentFunction = require( '@stdlib/utils/argument-function' ); +const argumentFunction = require( '@stdlib/utils/argument-function' ); ``` #### argumentFunction( idx ) @@ -41,10 +41,10 @@ var argumentFunction = require( '@stdlib/utils/argument-function' ); Returns a `function` which always returns an argument corresponding to a specified argument index. ```javascript -var argn = argumentFunction( 1 ); +const argn = argumentFunction( 1 ); // returns -var v = argn( 1.0, 2.0, 3.0 ); +let v = argn( 1.0, 2.0, 3.0 ); // returns 2.0 v = argn( 'a', 'b', 'c' ); @@ -54,10 +54,10 @@ v = argn( 'a', 'b', 'c' ); If an argument function is provided fewer arguments than the specified argument index, an argument function returns `undefined`. ```javascript -var argn = argumentFunction( 100 ); +const argn = argumentFunction( 100 ); // returns -var v = argn( 1.0 ); +const v = argn( 1.0 ); // returns undefined ``` @@ -82,16 +82,12 @@ var v = argn( 1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var argumentFunction = require( '@stdlib/utils/argument-function' ); +const randu = require( '@stdlib/random/base/randu' ); +const argumentFunction = require( '@stdlib/utils/argument-function' ); -var argn; -var v; -var i; - -argn = argumentFunction( 1 ); -for ( i = 0; i < 10; i++ ) { - v = argn( randu(), randu()*10.0, randu()*100.0 ); +const argn = argumentFunction( 1 ); +for ( let i = 0; i < 10; i++ ) { + const v = argn( randu(), randu()*10.0, randu()*100.0 ); console.log( v ); } ``` diff --git a/lib/node_modules/@stdlib/utils/async/README.md b/lib/node_modules/@stdlib/utils/async/README.md index 61c993b8f2be..51df7bf3eeee 100644 --- a/lib/node_modules/@stdlib/utils/async/README.md +++ b/lib/node_modules/@stdlib/utils/async/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/utils/async' ); +const ns = require( '@stdlib/utils/async' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/utils/async' ); Namespace containing async utilities. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -93,8 +93,8 @@ var o = ns; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/utils/async' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/utils/async' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/utils/async/any-by-right/README.md b/lib/node_modules/@stdlib/utils/async/any-by-right/README.md index 768517465d83..91ac754ab600 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/any-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyByRightAsync = require( '@stdlib/utils/async/any-by-right' ); +const anyByRightAsync = require( '@stdlib/utils/async/any-by-right' ); ``` #### anyByRightAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; anyByRightAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; anyByRightAsync( arr, predicate, done ); ``` @@ -128,9 +128,9 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -162,9 +162,9 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -182,13 +182,13 @@ function predicate( value, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -244,7 +244,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; anyByRightAsync( arr, predicate, done ); ``` @@ -269,9 +269,9 @@ function done( error, bool ) { console.log( bool ); } -var f = anyByRightAsync.factory( predicate ); +const f = anyByRightAsync.factory( predicate ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, done ); /* e.g., => @@ -281,7 +281,7 @@ f( arr1, done ); false */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, done ); /* e.g., => @@ -324,11 +324,11 @@ The function accepts the same `options` as `anyByRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var anyByRightAsync = require( '@stdlib/utils/async/any-by-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const anyByRightAsync = require( '@stdlib/utils/async/any-by-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -345,7 +345,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/any-by/README.md b/lib/node_modules/@stdlib/utils/async/any-by/README.md index 84cb1a0640f0..9d41870cb15e 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/any-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var anyByAsync = require( '@stdlib/utils/async/any-by' ); +const anyByAsync = require( '@stdlib/utils/async/any-by' ); ``` #### anyByAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; anyByAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; anyByAsync( arr, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -245,7 +245,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; anyByAsync( arr, predicate, done ); ``` @@ -270,9 +270,9 @@ function done( error, bool ) { console.log( bool ); } -var f = anyByAsync.factory( predicate ); +const f = anyByAsync.factory( predicate ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* e.g., => @@ -282,7 +282,7 @@ f( arr1, done ); false */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* e.g., => @@ -325,11 +325,11 @@ The function accepts the same `options` as `anyByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var anyByAsync = require( '@stdlib/utils/async/any-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const anyByAsync = require( '@stdlib/utils/async/any-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -346,7 +346,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/bifurcate-by/README.md b/lib/node_modules/@stdlib/utils/async/bifurcate-by/README.md index 1f5409212f2a..deef6489d9fe 100644 --- a/lib/node_modules/@stdlib/utils/async/bifurcate-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/bifurcate-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' ); +const bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' ); ``` #### bifurcateByAsync( collection, \[options,] predicate, done ) @@ -60,7 +60,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; bifurcateByAsync( arr, predicate, done ); /* => @@ -96,9 +96,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'returns': 'indices' }; bifurcateByAsync( arr, opts, predicate, done ); @@ -128,9 +128,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'returns': '*' }; bifurcateByAsync( arr, opts, predicate, done ); @@ -160,9 +160,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -193,9 +193,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -219,13 +219,13 @@ function predicate( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -269,7 +269,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; bifurcateByAsync( arr, predicate, done ); /* => @@ -303,9 +303,9 @@ function done( error, result ) { console.log( result ); } -var f = bifurcateByAsync.factory( predicate ); +const f = bifurcateByAsync.factory( predicate ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* => @@ -315,7 +315,7 @@ f( arr1, done ); [ [ 2500, 3000 ], [ 1000 ] ] */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -358,11 +358,11 @@ The function accepts the same `options` as `bifurcateByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ), resolve( __dirname, 'beep.boop.md' ) @@ -376,7 +376,7 @@ function done( error, result ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/compose/README.md b/lib/node_modules/@stdlib/utils/async/compose/README.md index 63f40dddbd82..af04fce9c470 100644 --- a/lib/node_modules/@stdlib/utils/async/compose/README.md +++ b/lib/node_modules/@stdlib/utils/async/compose/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var composeAsync = require( '@stdlib/utils/async/compose' ); +const composeAsync = require( '@stdlib/utils/async/compose' ); ``` #### composeAsync( ...fcn ) @@ -66,7 +66,7 @@ function c( x, next ) { } } -var f = composeAsync( c, b, a ); +const f = composeAsync( c, b, a ); function done( error, result ) { if ( error ) { @@ -101,7 +101,7 @@ function b( r, next ) { } } -var f = composeAsync( b, a ); +const f = composeAsync( b, a ); function done( error, result ) { if ( error ) { @@ -141,7 +141,7 @@ f( 4, 6, done ); ```javascript -var composeAsync = require( '@stdlib/utils/async/compose' ); +const composeAsync = require( '@stdlib/utils/async/compose' ); function a( x, y, next ) { setTimeout( onTimeout, 0 ); @@ -164,7 +164,7 @@ function c( r, next ) { } } -var f = composeAsync( c, b, a ); +const f = composeAsync( c, b, a ); function done( error, result ) { if ( error ) { diff --git a/lib/node_modules/@stdlib/utils/async/count-by/README.md b/lib/node_modules/@stdlib/utils/async/count-by/README.md index 0d4e4d4099bb..214aa0aef085 100644 --- a/lib/node_modules/@stdlib/utils/async/count-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/count-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countByAsync = require( '@stdlib/utils/async/count-by' ); +const countByAsync = require( '@stdlib/utils/async/count-by' ); ``` #### countByAsync( collection, \[options,] indicator, done ) @@ -60,7 +60,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; countByAsync( arr, indicator, done ); /* => @@ -95,9 +95,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -128,9 +128,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -154,13 +154,13 @@ function indicator( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -204,7 +204,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; countByAsync( arr, indicator, done ); /* => @@ -238,9 +238,9 @@ function done( error, result ) { console.log( result ); } -var f = countByAsync.factory( indicator ); +const f = countByAsync.factory( indicator ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* => @@ -250,7 +250,7 @@ f( arr1, done ); { 'true': 2, 'false': 1 } */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -303,7 +303,7 @@ The function accepts the same `options` as `countByAsync()`. console.log( result ); } - var arr = [ 3000, 2500, 1000 ]; + const arr = [ 3000, 2500, 1000 ]; countByAsync( arr, indicator, done ); /* => @@ -329,11 +329,11 @@ The function accepts the same `options` as `countByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var countByAsync = require( '@stdlib/utils/async/count-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const countByAsync = require( '@stdlib/utils/async/count-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ), resolve( __dirname, 'beep.boop.md' ) @@ -347,7 +347,7 @@ function done( error, result ) { } function indicator( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/do-until/README.md b/lib/node_modules/@stdlib/utils/async/do-until/README.md index f2ed58ba3e2f..d9b15c1b9f85 100644 --- a/lib/node_modules/@stdlib/utils/async/do-until/README.md +++ b/lib/node_modules/@stdlib/utils/async/do-until/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doUntilAsync = require( '@stdlib/utils/async/do-until' ); +const doUntilAsync = require( '@stdlib/utils/async/do-until' ); ``` #### doUntilAsync( fcn, predicate, done\[, thisArg ] ) @@ -154,7 +154,7 @@ function predicate( i, clbk ) { clbk( null, i >= 5 ); } -var context = { +const context = { 'count': 0 }; @@ -194,8 +194,8 @@ function done( error ) { ```javascript -var repeatString = require( '@stdlib/string/repeat' ); -var doUntilAsync = require( '@stdlib/utils/async/do-until' ); +const repeatString = require( '@stdlib/string/repeat' ); +const doUntilAsync = require( '@stdlib/utils/async/do-until' ); function fcn( i, next ) { setTimeout( onTimeout, 0 ); diff --git a/lib/node_modules/@stdlib/utils/async/do-while/README.md b/lib/node_modules/@stdlib/utils/async/do-while/README.md index afe2f42c6264..eb0dc827e378 100644 --- a/lib/node_modules/@stdlib/utils/async/do-while/README.md +++ b/lib/node_modules/@stdlib/utils/async/do-while/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doWhileAsync = require( '@stdlib/utils/async/do-while' ); +const doWhileAsync = require( '@stdlib/utils/async/do-while' ); ``` #### doWhileAsync( fcn, predicate, done\[, thisArg ] ) @@ -154,7 +154,7 @@ function predicate( i, clbk ) { clbk( null, i < 5 ); } -var context = { +const context = { 'count': 0 }; @@ -194,8 +194,8 @@ function done( error ) { ```javascript -var repeatString = require( '@stdlib/string/repeat' ); -var doWhileAsync = require( '@stdlib/utils/async/do-while' ); +const repeatString = require( '@stdlib/string/repeat' ); +const doWhileAsync = require( '@stdlib/utils/async/do-while' ); function fcn( i, next ) { setTimeout( onTimeout, 0 ); diff --git a/lib/node_modules/@stdlib/utils/async/every-by-right/README.md b/lib/node_modules/@stdlib/utils/async/every-by-right/README.md index 04e5ef72d8b9..e597da941b38 100644 --- a/lib/node_modules/@stdlib/utils/async/every-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/every-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyByRightAsync = require( '@stdlib/utils/async/every-by-right' ); +const everyByRightAsync = require( '@stdlib/utils/async/every-by-right' ); ``` #### everyByRightAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; everyByRightAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; everyByRightAsync( arr, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; everyByRightAsync( arr, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = everyByRightAsync.factory( predicate ); +const f = everyByRightAsync.factory( predicate ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, done ); true */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, done ); /* e.g., => @@ -326,11 +326,11 @@ The function accepts the same `options` as `everyByRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var everyByRightAsync = require( '@stdlib/utils/async/every-by-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const everyByRightAsync = require( '@stdlib/utils/async/every-by-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/every-by/README.md b/lib/node_modules/@stdlib/utils/async/every-by/README.md index af572026ba34..97f690426e61 100644 --- a/lib/node_modules/@stdlib/utils/async/every-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/every-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyByAsync = require( '@stdlib/utils/async/every-by' ); +const everyByAsync = require( '@stdlib/utils/async/every-by' ); ``` #### everyByAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; everyByAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; everyByAsync( arr, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; everyByAsync( arr, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = everyByAsync.factory( predicate ); +const f = everyByAsync.factory( predicate ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, done ); true */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* e.g., => @@ -326,11 +326,11 @@ The function accepts the same `options` as `everyByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var everyByAsync = require( '@stdlib/utils/async/every-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const everyByAsync = require( '@stdlib/utils/async/every-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/for-each-right/README.md b/lib/node_modules/@stdlib/utils/async/for-each-right/README.md index dc6bfe93830e..6acbd11945e4 100644 --- a/lib/node_modules/@stdlib/utils/async/for-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/for-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachRightAsync = require( '@stdlib/utils/async/for-each-right' ); +const forEachRightAsync = require( '@stdlib/utils/async/for-each-right' ); ``` #### forEachRightAsync( collection, \[options,] fcn, done ) @@ -59,7 +59,7 @@ function done( error ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; forEachRightAsync( arr, onDuration, done ); /* => @@ -92,9 +92,9 @@ function done( error ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -123,9 +123,9 @@ function done( error ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -148,13 +148,13 @@ function onDuration( value, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -194,7 +194,7 @@ function done( error ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; forEachRightAsync( arr, onDuration, done ); /* => @@ -226,9 +226,9 @@ function done( error ) { } } -var f = forEachRightAsync.factory( onDuration ); +const f = forEachRightAsync.factory( onDuration ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, done ); /* => @@ -237,7 +237,7 @@ f( arr1, done ); 3000 */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, done ); /* => @@ -278,11 +278,11 @@ The function accepts the same `options` as `forEachRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var forEachRightAsync = require( '@stdlib/utils/async/for-each-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const forEachRightAsync = require( '@stdlib/utils/async/for-each-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -295,7 +295,7 @@ function done( error ) { } function read( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/for-each/README.md b/lib/node_modules/@stdlib/utils/async/for-each/README.md index 2b3878ba8139..7733e0860f9c 100644 --- a/lib/node_modules/@stdlib/utils/async/for-each/README.md +++ b/lib/node_modules/@stdlib/utils/async/for-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachAsync = require( '@stdlib/utils/async/for-each' ); +const forEachAsync = require( '@stdlib/utils/async/for-each' ); ``` #### forEachAsync( collection, \[options,] fcn, done ) @@ -59,7 +59,7 @@ function done( error ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; forEachAsync( arr, onDuration, done ); /* => @@ -92,9 +92,9 @@ function done( error ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -123,9 +123,9 @@ function done( error ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -148,13 +148,13 @@ function onDuration( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -194,7 +194,7 @@ function done( error ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; forEachAsync( arr, onDuration, done ); /* => @@ -226,9 +226,9 @@ function done( error ) { } } -var f = forEachAsync.factory( onDuration ); +const f = forEachAsync.factory( onDuration ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* => @@ -237,7 +237,7 @@ f( arr1, done ); 3000 */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -278,11 +278,11 @@ The function accepts the same `options` as `forEachAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var forEachAsync = require( '@stdlib/utils/async/for-each' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const forEachAsync = require( '@stdlib/utils/async/for-each' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -295,7 +295,7 @@ function done( error ) { } function read( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/function-sequence/README.md b/lib/node_modules/@stdlib/utils/async/function-sequence/README.md index 282288139978..58d1d4a86336 100644 --- a/lib/node_modules/@stdlib/utils/async/function-sequence/README.md +++ b/lib/node_modules/@stdlib/utils/async/function-sequence/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var funseqAsync = require( '@stdlib/utils/async/function-sequence' ); +const funseqAsync = require( '@stdlib/utils/async/function-sequence' ); ``` #### funseqAsync( ...fcn ) @@ -66,7 +66,7 @@ function c( x, next ) { } } -var f = funseqAsync( a, b, c ); +const f = funseqAsync( a, b, c ); function done( error, result ) { if ( error ) { @@ -101,7 +101,7 @@ function b( r, next ) { } } -var f = funseqAsync( a, b ); +const f = funseqAsync( a, b ); function done( error, result ) { if ( error ) { @@ -142,7 +142,7 @@ f( 4, 6, done ); ```javascript -var funseqAsync = require( '@stdlib/utils/async/function-sequence' ); +const funseqAsync = require( '@stdlib/utils/async/function-sequence' ); function a( x, y, next ) { setTimeout( onTimeout, 0 ); @@ -165,7 +165,7 @@ function c( r, next ) { } } -var f = funseqAsync( a, b, c ); +const f = funseqAsync( a, b, c ); function done( error, result ) { if ( error ) { diff --git a/lib/node_modules/@stdlib/utils/async/group-by/README.md b/lib/node_modules/@stdlib/utils/async/group-by/README.md index 0fc93d0cfbd3..882fab2ab1ff 100644 --- a/lib/node_modules/@stdlib/utils/async/group-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/group-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupByAsync = require( '@stdlib/utils/async/group-by' ); +const groupByAsync = require( '@stdlib/utils/async/group-by' ); ``` #### groupByAsync( collection, \[options,] indicator, done ) @@ -60,7 +60,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; groupByAsync( arr, indicator, done ); /* => @@ -96,9 +96,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'returns': 'indices' }; groupByAsync( arr, opts, indicator, done ); @@ -128,9 +128,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'returns': '*' }; groupByAsync( arr, opts, indicator, done ); @@ -160,9 +160,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -193,9 +193,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -219,13 +219,13 @@ function indicator( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -269,7 +269,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; groupByAsync( arr, indicator, done ); /* => @@ -303,9 +303,9 @@ function done( error, result ) { console.log( result ); } -var f = groupByAsync.factory( indicator ); +const f = groupByAsync.factory( indicator ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* => @@ -315,7 +315,7 @@ f( arr1, done ); { 'true': [ 2500, 3000 ], 'false': [ 1000 ] } */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -368,7 +368,7 @@ The function accepts the same `options` as `groupByAsync()`. console.log( result ); } - var arr = [ 3000, 2500, 1000 ]; + const arr = [ 3000, 2500, 1000 ]; groupByAsync( arr, indicator, done ); /* => @@ -394,11 +394,11 @@ The function accepts the same `options` as `groupByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var groupByAsync = require( '@stdlib/utils/async/group-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const groupByAsync = require( '@stdlib/utils/async/group-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ), resolve( __dirname, 'beep.boop.md' ) @@ -412,7 +412,7 @@ function done( error, result ) { } function indicator( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/if-else/README.md b/lib/node_modules/@stdlib/utils/async/if-else/README.md index 691883ac23c1..7e655ce7b15d 100644 --- a/lib/node_modules/@stdlib/utils/async/if-else/README.md +++ b/lib/node_modules/@stdlib/utils/async/if-else/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ifelseAsync = require( '@stdlib/utils/async/if-else' ); +const ifelseAsync = require( '@stdlib/utils/async/if-else' ); ``` #### ifelseAsync( predicate, x, y, done ) @@ -45,7 +45,7 @@ var ifelseAsync = require( '@stdlib/utils/async/if-else' ); If a `predicate` function returns a truthy value, returns `x`; otherwise, returns `y`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function predicate( clbk ) { setTimeout( onTimeout, 0 ); @@ -105,10 +105,10 @@ The `done` callback is invoked upon function completion and is provided at most ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ifelseAsync = require( '@stdlib/utils/async/if-else' ); +const randu = require( '@stdlib/random/base/randu' ); +const ifelseAsync = require( '@stdlib/utils/async/if-else' ); -var i; +let i; function next() { ifelseAsync( predicate, 'BOOP', 'beep', done ); diff --git a/lib/node_modules/@stdlib/utils/async/if-then/README.md b/lib/node_modules/@stdlib/utils/async/if-then/README.md index e0a78a700e26..21cc7e4df9ba 100644 --- a/lib/node_modules/@stdlib/utils/async/if-then/README.md +++ b/lib/node_modules/@stdlib/utils/async/if-then/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ifthenAsync = require( '@stdlib/utils/async/if-then' ); +const ifthenAsync = require( '@stdlib/utils/async/if-then' ); ``` #### ifthenAsync( predicate, x, y, done ) @@ -45,7 +45,7 @@ var ifthenAsync = require( '@stdlib/utils/async/if-then' ); If a `predicate` function returns a truthy value, invokes `x`; otherwise, invokes `y`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function predicate( clbk ) { setTimeout( onTimeout, 0 ); @@ -94,7 +94,7 @@ Both `x` and `y` are provided a single argument: The callback function accepts any number of arguments, with the first argument reserved for providing an error. If the error argument is falsy, the `done` callback is invoked with its first argument as `null` and all other provided arguments. If the error argument is truthy, the `done` callback is invoked with only an error argument. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function predicate( clbk ) { setTimeout( onTimeout, 0 ); @@ -155,12 +155,12 @@ ifthenAsync( predicate, x, y, done ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var repeatString = require( '@stdlib/string/repeat' ); -var ifthenAsync = require( '@stdlib/utils/async/if-then' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const repeatString = require( '@stdlib/string/repeat' ); +const ifthenAsync = require( '@stdlib/utils/async/if-then' ); -var i; +let i; function next() { ifthenAsync( predicate, x, y, done ); diff --git a/lib/node_modules/@stdlib/utils/async/inmap-right/README.md b/lib/node_modules/@stdlib/utils/async/inmap-right/README.md index 97eafe939b9f..7f719d00ba66 100644 --- a/lib/node_modules/@stdlib/utils/async/inmap-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/inmap-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var inmapRightAsync = require( '@stdlib/utils/async/inmap-right' ); +const inmapRightAsync = require( '@stdlib/utils/async/inmap-right' ); ``` #### inmapRightAsync( collection, \[options,] fcn, done ) @@ -63,7 +63,7 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; inmapRightAsync( arr, fcn, done ); /* @@ -93,7 +93,7 @@ function done( error, collection ) { // => [ 'beep: 0', 'beep: 1', 'beep: 2' ] } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; inmapRightAsync( arr, fcn, done ); ``` @@ -119,7 +119,7 @@ function done( error, collection ) { // => [ 1000, 2000, 'beep: 2' ] } -var arr = [ 1000, 2000, 3000 ]; +const arr = [ 1000, 2000, 3000 ]; inmapRightAsync( arr, fcn, done ); ``` @@ -151,9 +151,9 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -188,9 +188,9 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -217,13 +217,13 @@ function fcn( value, index, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -273,7 +273,7 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; inmapRightAsync( arr, fcn, done ); /* => @@ -308,9 +308,9 @@ function done( error, collection ) { console.log( collection ); } -var f = inmapRightAsync.factory( fcn ); +const f = inmapRightAsync.factory( fcn ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, done ); /* => @@ -320,7 +320,7 @@ f( arr1, done ); [ 0, 2500, 6000 ] */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, done ); /* => @@ -364,11 +364,11 @@ The function accepts the same `options` as `inmapRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var inmapRightAsync = require( '@stdlib/utils/async/inmap-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const inmapRightAsync = require( '@stdlib/utils/async/inmap-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -381,7 +381,7 @@ function done( error, results ) { } function read( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/inmap/README.md b/lib/node_modules/@stdlib/utils/async/inmap/README.md index 4850f64eb0df..a90ec933aec6 100644 --- a/lib/node_modules/@stdlib/utils/async/inmap/README.md +++ b/lib/node_modules/@stdlib/utils/async/inmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var inmapAsync = require( '@stdlib/utils/async/inmap' ); +const inmapAsync = require( '@stdlib/utils/async/inmap' ); ``` #### inmapAsync( collection, \[options,] fcn, done ) @@ -63,7 +63,7 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; inmapAsync( arr, fcn, done ); /* @@ -93,7 +93,7 @@ function done( error, collection ) { // => [ 'beep: 0', 'beep: 1', 'beep: 2' ] } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; inmapAsync( arr, fcn, done ); ``` @@ -119,7 +119,7 @@ function done( error, collection ) { // => [ 'beep: 0', 2000, 3000 ] } -var arr = [ 1000, 2000, 3000 ]; +const arr = [ 1000, 2000, 3000 ]; inmapAsync( arr, fcn, done ); ``` @@ -151,9 +151,9 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -188,9 +188,9 @@ function done( error, collection ) { console.log( collection ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -217,13 +217,13 @@ function fcn( value, index, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -276,7 +276,7 @@ function done( error, collection ) { // => [ 0, 2500, 2000 ] } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; inmapAsync( arr, fcn, done ); /* => @@ -309,9 +309,9 @@ function done( error, collection ) { console.log( collection ); } -var f = inmapAsync.factory( fcn ); +const f = inmapAsync.factory( fcn ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* => @@ -321,7 +321,7 @@ f( arr1, done ); [ 0, 2500, 2000 ] */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -365,11 +365,11 @@ The function accepts the same `options` as `inmapAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var inmapAsync = require( '@stdlib/utils/async/inmap' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const inmapAsync = require( '@stdlib/utils/async/inmap' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -382,7 +382,7 @@ function done( error, results ) { } function read( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/map-function/README.md b/lib/node_modules/@stdlib/utils/async/map-function/README.md index b5674a6d1129..56ae6ab8be23 100644 --- a/lib/node_modules/@stdlib/utils/async/map-function/README.md +++ b/lib/node_modules/@stdlib/utils/async/map-function/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapFunAsync = require( '@stdlib/utils/async/map-function' ); +const mapFunAsync = require( '@stdlib/utils/async/map-function' ); ``` #### mapFunAsync( fcn, n, \[options,] done ) @@ -46,7 +46,7 @@ Invokes a function `n` times and returns an `array` of accumulated function retu ```javascript function fcn( i, next ) { - var t = 300 - (i*50); + const t = 300 - (i*50); setTimeout( onTimeout, t ); function onTimeout() { console.log( i ); @@ -92,7 +92,7 @@ By default, all invocations are performed concurrently, which means that the fun ```javascript function fcn( i, next ) { - var t = 300 - (i*50); + const t = 300 - (i*50); setTimeout( onTimeout, t ); function onTimeout() { console.log( i ); @@ -107,7 +107,7 @@ function done( error, arr ) { console.log( arr ); } -var opts = { +const opts = { 'series': true }; @@ -125,7 +125,7 @@ mapFunAsync( fcn, 5, opts, done ); To limit the maximum number of pending function invocations, set the `limit` option. ```javascript -var delays = [ 300, 250, 225, 150, 100 ]; +const delays = [ 300, 250, 225, 150, 100 ]; function fcn( i, next ) { setTimeout( onTimeout, delays[ i ] ); @@ -142,7 +142,7 @@ function done( error, arr ) { console.log( arr ); } -var opts = { +const opts = { 'limit': 2 }; @@ -178,10 +178,10 @@ function done( error, arr ) { // => [ 0, 1, 2, 3, 4 ] } -var ctx = { +const ctx = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': ctx }; @@ -194,7 +194,7 @@ Returns a `function` which invokes a function `n` times and returns an `array` o ```javascript function fcn( i, next ) { - var t = 300 - (i*50); + const t = 300 - (i*50); setTimeout( onTimeout, t ); function onTimeout() { console.log( i ); @@ -209,11 +209,11 @@ function done( error, arr ) { console.log( arr ); } -var opts = { +const opts = { 'series': true }; -var f = mapFunAsync.factory( opts, fcn ); +const f = mapFunAsync.factory( opts, fcn ); f( 5, done ); /* => @@ -261,11 +261,11 @@ The function accepts the same `options` as `mapFunAsync()`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mapFunAsync = require( '@stdlib/utils/async/map-function' ); +const randu = require( '@stdlib/random/base/randu' ); +const mapFunAsync = require( '@stdlib/utils/async/map-function' ); function rand( i, next ) { - var t = randu() * i; + const t = randu() * i; setTimeout( onTimeout, t ); function onTimeout() { next( null, t ); diff --git a/lib/node_modules/@stdlib/utils/async/map-keys/README.md b/lib/node_modules/@stdlib/utils/async/map-keys/README.md index 4f5932883506..a0b5c6d4d419 100644 --- a/lib/node_modules/@stdlib/utils/async/map-keys/README.md +++ b/lib/node_modules/@stdlib/utils/async/map-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapKeysAsync = require( '@stdlib/utils/async/map-keys' ); +const mapKeysAsync = require( '@stdlib/utils/async/map-keys' ); ``` #### mapKeysAsync( obj, \[options,] transform, done ) @@ -60,7 +60,7 @@ function done( error, out ) { // => { 'a:beep': 1, 'b:beep': 2 } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -88,7 +88,7 @@ function done( error ) { } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -120,12 +120,12 @@ function done( error, out ) { // => { 'a:beep': 1, 'b:beep': 2 } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var opts = { +const opts = { 'series': true }; @@ -150,13 +150,13 @@ function done( error, out ) { // => { 'a:beep': 1, 'b:beep': 2, 'c:beep': 3 } } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var opts = { +const opts = { 'limit': 2 }; @@ -174,17 +174,17 @@ function transform( key, value, next ) { } } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -227,7 +227,7 @@ function done( error, out ) { console.log( out ); } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -259,9 +259,9 @@ function done( error, out ) { console.log( out ); } -var f = mapKeysAsync.factory( transform ); +const f = mapKeysAsync.factory( transform ); -var obj1 = { +const obj1 = { 'a': 1, 'b': 2 }; @@ -269,7 +269,7 @@ var obj1 = { f( obj1, done ); // => { 'a:beep': 1, 'b:beep': 2 } -var obj2 = { +const obj2 = { 'c': 3, 'd': 4 }; @@ -312,17 +312,17 @@ The function accepts the same `options` as `mapKeysAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var mapKeysAsync = require( '@stdlib/utils/async/map-keys' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const mapKeysAsync = require( '@stdlib/utils/async/map-keys' ); -var files = { +const files = { 'file1': resolve( __dirname, 'package.json' ), 'file2': resolve( __dirname, 'README.md' ) }; function read( key, value, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( value, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/map-values/README.md b/lib/node_modules/@stdlib/utils/async/map-values/README.md index f30fa0edddc5..59d378802450 100644 --- a/lib/node_modules/@stdlib/utils/async/map-values/README.md +++ b/lib/node_modules/@stdlib/utils/async/map-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapValuesAsync = require( '@stdlib/utils/async/map-values' ); +const mapValuesAsync = require( '@stdlib/utils/async/map-values' ); ``` #### mapValuesAsync( obj, \[options,] transform, done ) @@ -60,7 +60,7 @@ function done( error, out ) { // => { 'a': 2, 'b': 4 } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -88,7 +88,7 @@ function done( error ) { } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -120,12 +120,12 @@ function done( error, out ) { // => { 'a': 'beep:1', 'b': 'beep:2' } } -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var opts = { +const opts = { 'series': true }; @@ -150,13 +150,13 @@ function done( error, out ) { // => { 'a': 'beep:1', 'b': 'beep:2', 'c': 'beep:3' } } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var opts = { +const opts = { 'limit': 2 }; @@ -174,17 +174,17 @@ function transform( value, next ) { } } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -227,7 +227,7 @@ function done( error, out ) { console.log( out ); } -var obj = { +const obj = { 'a': 1, 'b': 2 }; @@ -259,9 +259,9 @@ function done( error, out ) { console.log( out ); } -var f = mapValuesAsync.factory( transform ); +const f = mapValuesAsync.factory( transform ); -var obj1 = { +const obj1 = { 'a': 1, 'b': 2 }; @@ -269,7 +269,7 @@ var obj1 = { f( obj1, done ); // => { 'a': 'beep:1', 'b': 'beep:2' } -var obj2 = { +const obj2 = { 'c': 3, 'd': 4 }; @@ -311,11 +311,11 @@ The function accepts the same `options` as `mapValuesAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var stats = require( 'fs' ).stat; -var mapValuesAsync = require( '@stdlib/utils/async/map-values' ); +const resolve = require( 'path' ).resolve; +const stats = require( 'fs' ).stat; +const mapValuesAsync = require( '@stdlib/utils/async/map-values' ); -var files = { +const files = { 'file1': resolve( __dirname, 'package.json' ), 'file2': resolve( __dirname, 'README.md' ) }; diff --git a/lib/node_modules/@stdlib/utils/async/none-by-right/README.md b/lib/node_modules/@stdlib/utils/async/none-by-right/README.md index 106ec00edc31..c47a216542ae 100644 --- a/lib/node_modules/@stdlib/utils/async/none-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/none-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneByRightAsync = require( '@stdlib/utils/async/none-by-right' ); +const noneByRightAsync = require( '@stdlib/utils/async/none-by-right' ); ``` #### noneByRightAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; noneByRightAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; noneByRightAsync( arr, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; noneByRightAsync( arr, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = noneByRightAsync.factory( predicate ); +const f = noneByRightAsync.factory( predicate ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, done ); true */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, done ); /* e.g., => @@ -326,11 +326,11 @@ The function accepts the same `options` as `noneByRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var noneByRightAsync = require( '@stdlib/utils/async/none-by-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const noneByRightAsync = require( '@stdlib/utils/async/none-by-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/none-by/README.md b/lib/node_modules/@stdlib/utils/async/none-by/README.md index c9697247d6ae..0bda80eefdbc 100644 --- a/lib/node_modules/@stdlib/utils/async/none-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/none-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneByAsync = require( '@stdlib/utils/async/none-by' ); +const noneByAsync = require( '@stdlib/utils/async/none-by' ); ``` #### noneByAsync( collection, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; noneByAsync( arr, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; noneByAsync( arr, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; noneByAsync( arr, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = noneByAsync.factory( predicate ); +const f = noneByAsync.factory( predicate ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, done ); true */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* e.g., => @@ -326,11 +326,11 @@ The function accepts the same `options` as `noneByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var noneByAsync = require( '@stdlib/utils/async/none-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const noneByAsync = require( '@stdlib/utils/async/none-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/parallel/README.md b/lib/node_modules/@stdlib/utils/async/parallel/README.md index 96e71317e635..e77647330cfd 100644 --- a/lib/node_modules/@stdlib/utils/async/parallel/README.md +++ b/lib/node_modules/@stdlib/utils/async/parallel/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var parallel = require( '@stdlib/utils/async/parallel' ); +const parallel = require( '@stdlib/utils/async/parallel' ); ``` #### parallel( fcns, \[options,] done ) @@ -67,7 +67,7 @@ function done( error, out ) { // => [ 2, 4 ] } -var fcns = [ a, b ]; +const fcns = [ a, b ]; parallel( fcns, done ); ``` @@ -102,9 +102,9 @@ function done( error, out ) { // => [ 2, 4 ] } -var fcns = [ a, b ]; +const fcns = [ a, b ]; -var opts = { +const opts = { 'limit': 1 }; @@ -124,11 +124,11 @@ function b( clbk ) { clbk( null, 4 ); } -var fcns = [ a, b ]; -var ctx = { +const fcns = [ a, b ]; +const ctx = { 'idx': 0 }; -var opts = { +const opts = { 'thisArg': ctx }; @@ -170,9 +170,9 @@ function done( error, out ) { // => [ 2, 4 ] } -var fcns = [ a, b ]; +const fcns = [ a, b ]; -var run = parallel.factory( fcns ); +const run = parallel.factory( fcns ); run( done ); run( done ); @@ -208,7 +208,7 @@ run( done ); ```javascript -var parallel = require( '@stdlib/utils/async/parallel' ); +const parallel = require( '@stdlib/utils/async/parallel' ); function foo( clbk ) { setTimeout( onTimeout, 300 ); @@ -232,7 +232,7 @@ function done( error, results ) { // => [ 'one', 'two' ] } -var fcns = [ foo, bar ]; +const fcns = [ foo, bar ]; parallel( fcns, done ); ``` diff --git a/lib/node_modules/@stdlib/utils/async/reduce-right/README.md b/lib/node_modules/@stdlib/utils/async/reduce-right/README.md index e3158843f4d2..c351e1d20c6e 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/reduce-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reduceRightAsync = require( '@stdlib/utils/async/reduce-right' ); +const reduceRightAsync = require( '@stdlib/utils/async/reduce-right' ); ``` #### reduceRightAsync( collection, initial, \[options,] reducer, done ) @@ -61,8 +61,8 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 1000, 2500, 3000 ]; -var acc = { +const arr = [ 1000, 2500, 3000 ]; +const acc = { 'sum': 0 }; reduceRightAsync( arr, acc, reducer, done ); @@ -94,8 +94,8 @@ function done( error, out ) { // => true } -var arr = [ 1000, 2500, 3000 ]; -var acc = {}; +const arr = [ 1000, 2500, 3000 ]; +const acc = {}; reduceRightAsync( arr, acc, reducer, done ); ``` @@ -125,13 +125,13 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var acc = { +const acc = { 'sum': 0 }; -var opts = { +const opts = { 'series': false }; @@ -163,13 +163,13 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var acc = { +const acc = { 'sum': 0 }; -var opts = { +const opts = { 'limit': 2 }; @@ -194,17 +194,17 @@ function reducer( acc, value, index, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var acc = { +const acc = { 'sum': 0 }; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -250,9 +250,9 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var acc = { +const acc = { 'sum': 0 }; @@ -289,11 +289,11 @@ function done( error, acc ) { console.log( acc.sum ); } -var f = reduceRightAsync.factory( reducer ); +const f = reduceRightAsync.factory( reducer ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; -var acc1 = { +const acc1 = { 'sum': 0 }; @@ -305,9 +305,9 @@ f( arr1, acc1, done ); 6500 */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; -var acc2 = { +const acc2 = { 'sum': 0 }; @@ -353,11 +353,11 @@ The function accepts the same `options` as `reduceRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var reduceRightAsync = require( '@stdlib/utils/async/reduce-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const reduceRightAsync = require( '@stdlib/utils/async/reduce-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -370,7 +370,7 @@ function done( error, acc ) { } function read( acc, file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); @@ -384,7 +384,7 @@ function read( acc, file, next ) { } } -var acc = { +const acc = { 'count': 0 }; reduceRightAsync( files, acc, read, done ); diff --git a/lib/node_modules/@stdlib/utils/async/reduce/README.md b/lib/node_modules/@stdlib/utils/async/reduce/README.md index 3888ab318663..593da26ecd1a 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce/README.md +++ b/lib/node_modules/@stdlib/utils/async/reduce/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reduceAsync = require( '@stdlib/utils/async/reduce' ); +const reduceAsync = require( '@stdlib/utils/async/reduce' ); ``` #### reduceAsync( collection, initial, \[options,] reducer, done ) @@ -61,8 +61,8 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 3000, 2500, 1000 ]; -var acc = { +const arr = [ 3000, 2500, 1000 ]; +const acc = { 'sum': 0 }; reduceAsync( arr, acc, reducer, done ); @@ -94,8 +94,8 @@ function done( error, out ) { // => true } -var arr = [ 3000, 2500, 1000 ]; -var acc = {}; +const arr = [ 3000, 2500, 1000 ]; +const acc = {}; reduceAsync( arr, acc, reducer, done ); ``` @@ -125,13 +125,13 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var acc = { +const acc = { 'sum': 0 }; -var opts = { +const opts = { 'series': false }; @@ -163,13 +163,13 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var acc = { +const acc = { 'sum': 0 }; -var opts = { +const opts = { 'limit': 2 }; @@ -194,17 +194,17 @@ function reducer( acc, value, index, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var acc = { +const acc = { 'sum': 0 }; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -250,9 +250,9 @@ function done( error, acc ) { console.log( acc.sum ); } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var acc = { +const acc = { 'sum': 0 }; @@ -289,11 +289,11 @@ function done( error, acc ) { console.log( acc.sum ); } -var f = reduceAsync.factory( reducer ); +const f = reduceAsync.factory( reducer ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; -var acc1 = { +const acc1 = { 'sum': 0 }; @@ -305,9 +305,9 @@ f( arr1, acc1, done ); 6500 */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; -var acc2 = { +const acc2 = { 'sum': 0 }; @@ -353,11 +353,11 @@ The function accepts the same `options` as `reduceAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var reduceAsync = require( '@stdlib/utils/async/reduce' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const reduceAsync = require( '@stdlib/utils/async/reduce' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -370,7 +370,7 @@ function done( error, acc ) { } function read( acc, file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); @@ -384,7 +384,7 @@ function read( acc, file, next ) { } } -var acc = { +const acc = { 'count': 0 }; reduceAsync( files, acc, read, done ); diff --git a/lib/node_modules/@stdlib/utils/async/series-waterfall/README.md b/lib/node_modules/@stdlib/utils/async/series-waterfall/README.md index e34988a4dbc6..e8380a02ffb8 100644 --- a/lib/node_modules/@stdlib/utils/async/series-waterfall/README.md +++ b/lib/node_modules/@stdlib/utils/async/series-waterfall/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var waterfall = require( '@stdlib/utils/async/series-waterfall' ); +const waterfall = require( '@stdlib/utils/async/series-waterfall' ); ``` #### waterfall( fcns, clbk\[, thisArg] ) @@ -62,7 +62,7 @@ function done( error ) { } } -var fcns = [ foo, bar ]; +const fcns = [ foo, bar ]; waterfall( fcns, done ); ``` @@ -93,8 +93,8 @@ function done( error ) { // => 1 } -var ctx = {}; -var fcns = [ foo, bar ]; +const ctx = {}; +const fcns = [ foo, bar ]; waterfall( fcns, done, ctx ); ``` @@ -121,9 +121,9 @@ function done( error ) { } } -var fcns = [ foo, bar ]; +const fcns = [ foo, bar ]; -var run = waterfall.factory( fcns, done ); +const run = waterfall.factory( fcns, done ); run(); run(); @@ -157,8 +157,8 @@ run(); ```javascript -var replace = require( '@stdlib/string/replace' ); -var waterfall = require( '@stdlib/utils/async/series-waterfall' ); +const replace = require( '@stdlib/string/replace' ); +const waterfall = require( '@stdlib/utils/async/series-waterfall' ); function foo( next ) { next( null, 'beep' ); @@ -181,7 +181,7 @@ function done( error ) { console.log( 'done' ); } -var fcns = [ foo, bar, fun ]; +const fcns = [ foo, bar, fun ]; waterfall( fcns, done ); ``` diff --git a/lib/node_modules/@stdlib/utils/async/some-by-right/README.md b/lib/node_modules/@stdlib/utils/async/some-by-right/README.md index 16458e741df1..e9a0e45435dc 100644 --- a/lib/node_modules/@stdlib/utils/async/some-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/async/some-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var someByRightAsync = require( '@stdlib/utils/async/some-by-right' ); +const someByRightAsync = require( '@stdlib/utils/async/some-by-right' ); ``` #### someByRightAsync( collection, n, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; someByRightAsync( arr, 2, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => true } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; someByRightAsync( arr, 1, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => false } -var arr = [ 1000, 2500, 3000 ]; +const arr = [ 1000, 2500, 3000 ]; someByRightAsync( arr, 2, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = someByRightAsync.factory( predicate ); +const f = someByRightAsync.factory( predicate ); -var arr1 = [ 1000, 2500, 3000 ]; +const arr1 = [ 1000, 2500, 3000 ]; f( arr1, 2, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, 2, done ); false */ -var arr2 = [ 100, 250, 300 ]; +const arr2 = [ 100, 250, 300 ]; f( arr2, 2, done ); /* e.g., > @@ -326,11 +326,11 @@ The function accepts the same `options` as `someByRightAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var someByRightAsync = require( '@stdlib/utils/async/some-by-right' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const someByRightAsync = require( '@stdlib/utils/async/some-by-right' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/some-by/README.md b/lib/node_modules/@stdlib/utils/async/some-by/README.md index 9bd63f025cf5..bdcb37850dbb 100644 --- a/lib/node_modules/@stdlib/utils/async/some-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/some-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var someByAsync = require( '@stdlib/utils/async/some-by' ); +const someByAsync = require( '@stdlib/utils/async/some-by' ); ``` #### someByAsync( collection, n, \[options,] predicate, done ) @@ -67,7 +67,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; someByAsync( arr, 2, predicate, done ); ``` @@ -93,7 +93,7 @@ function done( error, bool ) { // => true } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; someByAsync( arr, 1, predicate, done ); ``` @@ -129,9 +129,9 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'series': true }; @@ -163,9 +163,9 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -183,13 +183,13 @@ function predicate( value, next ) { } } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -246,7 +246,7 @@ function done( error, bool ) { // => false } -var arr = [ 3000, 2500, 1000 ]; +const arr = [ 3000, 2500, 1000 ]; someByAsync( arr, 2, predicate, done ); ``` @@ -271,9 +271,9 @@ function done( error, bool ) { console.log( bool ); } -var f = someByAsync.factory( predicate ); +const f = someByAsync.factory( predicate ); -var arr1 = [ 3000, 2500, 1000 ]; +const arr1 = [ 3000, 2500, 1000 ]; f( arr1, 2, done ); /* e.g., => @@ -283,7 +283,7 @@ f( arr1, 2, done ); false */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, 2, done ); /* e.g., => @@ -326,11 +326,11 @@ The function accepts the same `options` as `someByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var someByAsync = require( '@stdlib/utils/async/some-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const someByAsync = require( '@stdlib/utils/async/some-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ) ]; @@ -347,7 +347,7 @@ function done( error, bool ) { } function predicate( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/tabulate-by/README.md b/lib/node_modules/@stdlib/utils/async/tabulate-by/README.md index 72b2b51c5701..ec461ab365bd 100644 --- a/lib/node_modules/@stdlib/utils/async/tabulate-by/README.md +++ b/lib/node_modules/@stdlib/utils/async/tabulate-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' ); +const tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' ); ``` #### tabulateByAsync( collection, \[options,] indicator, done ) @@ -60,7 +60,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000, 750 ]; +const arr = [ 3000, 2500, 1000, 750 ]; tabulateByAsync( arr, indicator, done ); /* => @@ -102,9 +102,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000, 750 ]; +const arr = [ 3000, 2500, 1000, 750 ]; -var opts = { +const opts = { 'series': true }; @@ -136,9 +136,9 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000, 750 ]; +const arr = [ 3000, 2500, 1000, 750 ]; -var opts = { +const opts = { 'limit': 2 }; @@ -163,13 +163,13 @@ function indicator( value, next ) { } } -var arr = [ 3000, 2500, 1000, 750 ]; +const arr = [ 3000, 2500, 1000, 750 ]; -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; @@ -213,7 +213,7 @@ function done( error, result ) { console.log( result ); } -var arr = [ 3000, 2500, 1000, 750 ]; +const arr = [ 3000, 2500, 1000, 750 ]; tabulateByAsync( arr, indicator, done ); /* => @@ -249,9 +249,9 @@ function done( error, result ) { console.log( result ); } -var f = tabulateByAsync.factory( indicator ); +const f = tabulateByAsync.factory( indicator ); -var arr1 = [ 3000, 2500, 1000, 750 ]; +const arr1 = [ 3000, 2500, 1000, 750 ]; f( arr1, done ); /* => @@ -262,7 +262,7 @@ f( arr1, done ); [ [ false, 2, 0.5 ], [ true, 2, 0.5 ] ] */ -var arr2 = [ 300, 250, 100 ]; +const arr2 = [ 300, 250, 100 ]; f( arr2, done ); /* => @@ -305,11 +305,11 @@ The function accepts the same `options` as `tabulateByAsync()`. ```javascript -var resolve = require( 'path' ).resolve; -var readFile = require( '@stdlib/fs/read-file' ); -var tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' ); +const resolve = require( 'path' ).resolve; +const readFile = require( '@stdlib/fs/read-file' ); +const tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' ); -var files = [ +const files = [ resolve( __dirname, 'package.json' ), resolve( __dirname, 'README.md' ), resolve( __dirname, 'beep.boop.md' ) @@ -323,7 +323,7 @@ function done( error, result ) { } function indicator( file, next ) { - var opts = { + const opts = { 'encoding': 'utf8' }; readFile( file, opts, onFile ); diff --git a/lib/node_modules/@stdlib/utils/async/try-catch/README.md b/lib/node_modules/@stdlib/utils/async/try-catch/README.md index 33811b69543a..b38a2e1e3019 100644 --- a/lib/node_modules/@stdlib/utils/async/try-catch/README.md +++ b/lib/node_modules/@stdlib/utils/async/try-catch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var trycatchAsync = require( '@stdlib/utils/async/try-catch' ); +const trycatchAsync = require( '@stdlib/utils/async/try-catch' ); ``` #### trycatchAsync( x, y, done ) @@ -45,7 +45,7 @@ var trycatchAsync = require( '@stdlib/utils/async/try-catch' ); If a function `x` does not return an error, invokes a `done` callback with the function result; otherwise, invokes a `done` callback with a value `y`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function x( clbk ) { setTimeout( onTimeout, 0 ); @@ -108,10 +108,10 @@ If the function `x` does not return a truthy `error` argument, the `error` argum ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trycatchAsync = require( '@stdlib/utils/async/try-catch' ); +const randu = require( '@stdlib/random/base/randu' ); +const trycatchAsync = require( '@stdlib/utils/async/try-catch' ); -var i; +let i; function next() { trycatchAsync( x, 'beep', done ); diff --git a/lib/node_modules/@stdlib/utils/async/try-then/README.md b/lib/node_modules/@stdlib/utils/async/try-then/README.md index 5da2886ecc5e..d3b0eb99e56e 100644 --- a/lib/node_modules/@stdlib/utils/async/try-then/README.md +++ b/lib/node_modules/@stdlib/utils/async/try-then/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var trythenAsync = require( '@stdlib/utils/async/try-then' ); +const trythenAsync = require( '@stdlib/utils/async/try-then' ); ``` #### trythenAsync( x, y, done ) @@ -45,7 +45,7 @@ var trythenAsync = require( '@stdlib/utils/async/try-then' ); If a function `x` does not return an error, invokes a `done` callback with the function result; otherwise, invokes a second function `y`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function x( clbk ) { setTimeout( onTimeout, 0 ); @@ -81,7 +81,7 @@ The function `x` is provided a single argument: The callback function accepts any number of arguments, with the first argument reserved for providing an error. If the error argument is falsy, the `done` callback is invoked with its first argument as `null` and all other provided arguments. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function x( clbk ) { setTimeout( onTimeout, 0 ); @@ -119,7 +119,7 @@ Otherwise, `y` is provided two arguments: The callback function accepts any number of arguments, with the first argument reserved for providing an error. If the error argument is falsy, the `done` callback is invoked with its first argument equal to `null` and all other provided arguments. If the error argument is truthy, the `done` callback is invoked with only the error argument provided by `y`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function x( clbk ) { setTimeout( onTimeout, 0 ); @@ -176,12 +176,12 @@ trythenAsync( x, y, done ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var repeatString = require( '@stdlib/string/repeat' ); -var trythenAsync = require( '@stdlib/utils/async/try-then' ); +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const repeatString = require( '@stdlib/string/repeat' ); +const trythenAsync = require( '@stdlib/utils/async/try-then' ); -var i; +let i; function next() { trythenAsync( x, y, done ); diff --git a/lib/node_modules/@stdlib/utils/async/until/README.md b/lib/node_modules/@stdlib/utils/async/until/README.md index 3cbc2b2890fb..4465a2528002 100644 --- a/lib/node_modules/@stdlib/utils/async/until/README.md +++ b/lib/node_modules/@stdlib/utils/async/until/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var untilAsync = require( '@stdlib/utils/async/until' ); +const untilAsync = require( '@stdlib/utils/async/until' ); ``` #### untilAsync( predicate, fcn, done\[, thisArg ] ) @@ -154,7 +154,7 @@ function fcn( i, next ) { } } -var context = { +const context = { 'count': 0 }; @@ -194,8 +194,8 @@ function done( error ) { ```javascript -var repeatString = require( '@stdlib/string/repeat' ); -var untilAsync = require( '@stdlib/utils/async/until' ); +const repeatString = require( '@stdlib/string/repeat' ); +const untilAsync = require( '@stdlib/utils/async/until' ); function predicate( i, clbk ) { setTimeout( onTimeout, 0 ); diff --git a/lib/node_modules/@stdlib/utils/async/while/README.md b/lib/node_modules/@stdlib/utils/async/while/README.md index 1546fa2a4a24..7f006bf5020e 100644 --- a/lib/node_modules/@stdlib/utils/async/while/README.md +++ b/lib/node_modules/@stdlib/utils/async/while/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var whileAsync = require( '@stdlib/utils/async/while' ); +const whileAsync = require( '@stdlib/utils/async/while' ); ``` #### whileAsync( predicate, fcn, done\[, thisArg ] ) @@ -154,7 +154,7 @@ function fcn( i, next ) { } } -var context = { +const context = { 'count': 0 }; @@ -194,8 +194,8 @@ function done( error ) { ```javascript -var repeatString = require( '@stdlib/string/repeat' ); -var whileAsync = require( '@stdlib/utils/async/while' ); +const repeatString = require( '@stdlib/string/repeat' ); +const whileAsync = require( '@stdlib/utils/async/while' ); function predicate( i, clbk ) { setTimeout( onTimeout, 0 ); diff --git a/lib/node_modules/@stdlib/utils/bifurcate-by/README.md b/lib/node_modules/@stdlib/utils/bifurcate-by/README.md index a7260da6347f..ecad72c747dc 100644 --- a/lib/node_modules/@stdlib/utils/bifurcate-by/README.md +++ b/lib/node_modules/@stdlib/utils/bifurcate-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); +const bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); ``` #### bifurcateBy( collection, \[options,] predicate ) @@ -48,9 +48,9 @@ Splits values into two groups according to a `predicate` function, which specifi function predicate( v ) { return v[ 0 ] === 'b'; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateBy( arr, predicate ); +const out = bifurcateBy( arr, predicate ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -64,9 +64,9 @@ function predicate( v, i ) { console.log( '%d: %s', i, v ); return v[ 0 ] === 'b'; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateBy( arr, predicate ); +const out = bifurcateBy( arr, predicate ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -81,12 +81,12 @@ By default, the function returns element values. To return element indices, set function predicate( v ) { return v[ 0 ] === 'b'; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var opts = { +const opts = { 'returns': 'indices' }; -var out = bifurcateBy( arr, opts, predicate ); +const out = bifurcateBy( arr, opts, predicate ); // returns [ [ 0, 1, 3 ], [ 2 ] ] ``` @@ -96,12 +96,12 @@ To return index-element pairs, set the `returns` option to `'*'`. function predicate( v ) { return v[ 0 ] === 'b'; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var opts = { +const opts = { 'returns': '*' }; -var out = bifurcateBy( arr, opts, predicate ); +const out = bifurcateBy( arr, opts, predicate ); // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ] ``` @@ -112,15 +112,15 @@ function predicate( v ) { this.count += 1; return v[ 0 ] === 'b'; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = bifurcateBy( arr, opts, predicate ); +const out = bifurcateBy( arr, opts, predicate ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] console.log( context.count ); @@ -152,22 +152,16 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const bifurcateBy = require( '@stdlib/utils/bifurcate-by' ); -var vals; -var arr; -var out; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } @@ -176,7 +170,7 @@ function predicate( v ) { } // Compute the groups: -out = bifurcateBy( arr, predicate ); +const out = bifurcateBy( arr, predicate ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/bifurcate-in/README.md b/lib/node_modules/@stdlib/utils/bifurcate-in/README.md index 6b8ce9d97eed..20f9f1de36c8 100644 --- a/lib/node_modules/@stdlib/utils/bifurcate-in/README.md +++ b/lib/node_modules/@stdlib/utils/bifurcate-in/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateIn = require( '@stdlib/utils/bifurcate-in' ); +const bifurcateIn = require( '@stdlib/utils/bifurcate-in' ); ``` #### bifurcateIn( obj, \[options,] predicate ) @@ -59,9 +59,9 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var out = bifurcateIn( obj, predicate ); +const out = bifurcateIn( obj, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -85,9 +85,9 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var out = bifurcateIn( obj, predicate ); +const out = bifurcateIn( obj, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -112,12 +112,12 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var opts = { +const opts = { 'returns': 'keys' }; -var out = bifurcateIn( obj, opts, predicate ); +const out = bifurcateIn( obj, opts, predicate ); // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ] ``` @@ -137,12 +137,12 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var opts = { +const opts = { 'returns': '*' }; -var out = bifurcateIn( obj, opts, predicate ); +const out = bifurcateIn( obj, opts, predicate ); // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ] ``` @@ -164,15 +164,15 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var out = bifurcateIn( obj, opts, predicate ); +const out = bifurcateIn( obj, opts, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] console.log( context.count ); @@ -206,43 +206,35 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var bifurcateIn = require( '@stdlib/utils/bifurcate-in' ); - -var opts; -var key; -var obj; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const bifurcateIn = require( '@stdlib/utils/bifurcate-in' ); function Foo() { - var key; - var i; - for ( i = 0; i < 50; i++ ) { - key = fromCodePoint( 147+i ); + for ( let i = 0; i < 50; i++ ) { + const key = fromCodePoint( 147+i ); this[ key ] = randu(); } return this; } Foo.prototype = Object.create( null ); -for ( i = 0; i < 50; i++ ) { - key = fromCodePoint( 97+i ); +for ( let i = 0; i < 50; i++ ) { + const key = fromCodePoint( 97+i ); Foo.prototype[ key ] = randu(); } // Generate a random object: -obj = new Foo(); +const obj = new Foo(); // Compute the groups... function predicate( v ) { return ( v < 0.5 ); } -opts = { +const opts = { 'returns': '*' }; -out = bifurcateIn( obj, opts, predicate ); +const out = bifurcateIn( obj, opts, predicate ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/bifurcate-own/README.md b/lib/node_modules/@stdlib/utils/bifurcate-own/README.md index 3270604a5be2..f0eb908a1274 100644 --- a/lib/node_modules/@stdlib/utils/bifurcate-own/README.md +++ b/lib/node_modules/@stdlib/utils/bifurcate-own/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' ); +const bifurcateOwn = require( '@stdlib/utils/bifurcate-own' ); ``` #### bifurcateOwn( obj, \[options,] predicate ) @@ -48,14 +48,14 @@ Splits an object's **own** property values into two groups according to a `predi function predicate( v ) { return v[ 0 ] === 'b'; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = bifurcateOwn( obj, predicate ); +const out = bifurcateOwn( obj, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -69,14 +69,14 @@ function predicate( v, k ) { console.log( '%s: %s', k, v ); return v[ 0 ] === 'b'; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = bifurcateOwn( obj, predicate ); +const out = bifurcateOwn( obj, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -91,17 +91,17 @@ By default, the function returns object values. To return object keys, set the ` function predicate( v ) { return v[ 0 ] === 'b'; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var opts = { +const opts = { 'returns': 'keys' }; -var out = bifurcateOwn( obj, opts, predicate ); +const out = bifurcateOwn( obj, opts, predicate ); // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ] ``` @@ -111,17 +111,17 @@ To return key-value pairs, set the `returns` option to `'*'`. function predicate( v ) { return v[ 0 ] === 'b'; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var opts = { +const opts = { 'returns': '*' }; -var out = bifurcateOwn( obj, opts, predicate ); +const out = bifurcateOwn( obj, opts, predicate ); // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ] ``` @@ -132,19 +132,19 @@ function predicate( v ) { this.count += 1; return v[ 0 ] === 'b'; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = bifurcateOwn( obj, opts, predicate ); +const out = bifurcateOwn( obj, opts, predicate ); // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] console.log( context.count ); @@ -178,19 +178,14 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' ); - -var key; -var obj; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const bifurcateOwn = require( '@stdlib/utils/bifurcate-own' ); // Generate a random object... -obj = {}; -for ( i = 0; i < 100; i++ ) { - key = fromCodePoint( 97+i ); +const obj = {}; +for ( let i = 0; i < 100; i++ ) { + const key = fromCodePoint( 97+i ); obj[ key ] = randu(); } @@ -199,7 +194,7 @@ function predicate( v ) { } // Compute the groups: -out = bifurcateOwn( obj, predicate ); +const out = bifurcateOwn( obj, predicate ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/bifurcate/README.md b/lib/node_modules/@stdlib/utils/bifurcate/README.md index db3fff87f030..b2fc482fc6bb 100644 --- a/lib/node_modules/@stdlib/utils/bifurcate/README.md +++ b/lib/node_modules/@stdlib/utils/bifurcate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var bifurcate = require( '@stdlib/utils/bifurcate' ); +const bifurcate = require( '@stdlib/utils/bifurcate' ); ``` #### bifurcate( collection, \[options,] filter ) @@ -45,10 +45,10 @@ var bifurcate = require( '@stdlib/utils/bifurcate' ); Splits values into two groups. If an element in `filter` is truthy, the corresponding element in `collection` belongs to the first group; otherwise, the `collection` element belongs to the second group. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var out = bifurcate( arr, filter ); +const out = bifurcate( arr, filter ); // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ] ``` @@ -59,26 +59,26 @@ The function accepts the following `options`: By default, the function returns element values. To return element indices, set the `returns` option to `'indices'`. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var opts = { +const opts = { 'returns': 'indices' }; -var out = bifurcate( arr, opts, filter ); +const out = bifurcate( arr, opts, filter ); // returns [ [ 0, 1, 3 ], [ 2 ] ] ``` To return index-element pairs, set the `returns` option to `'*'`. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var filter = [ true, true, false, true ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const filter = [ true, true, false, true ]; -var opts = { +const opts = { 'returns': '*' }; -var out = bifurcate( arr, opts, filter ); +const out = bifurcate( arr, opts, filter ); // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ] ``` @@ -107,34 +107,27 @@ var out = bifurcate( arr, opts, filter ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var bifurcate = require( '@stdlib/utils/bifurcate' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const bifurcate = require( '@stdlib/utils/bifurcate' ); -var vals; -var arr; -var out; -var f; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } // Randomly assign collection values to a group... -f = new Array( arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const f = new Array( arr.length ); +for ( let i = 0; i < arr.length; i++ ) { f[ i ] = ( randu() < 0.5 ); } // Compute the groups: -out = bifurcate( arr, f ); +const out = bifurcate( arr, f ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/capitalize-keys/README.md b/lib/node_modules/@stdlib/utils/capitalize-keys/README.md index 4c8bbb010105..117de2061c39 100644 --- a/lib/node_modules/@stdlib/utils/capitalize-keys/README.md +++ b/lib/node_modules/@stdlib/utils/capitalize-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var capitalizeKeys = require( '@stdlib/utils/capitalize-keys' ); +const capitalizeKeys = require( '@stdlib/utils/capitalize-keys' ); ``` #### capitalizeKeys( obj ) @@ -45,12 +45,12 @@ var capitalizeKeys = require( '@stdlib/utils/capitalize-keys' ); Converts the first letter of each `object` key to uppercase, mapping the transformed keys to a new `object` having the same values. ```javascript -var obj1 = { +const obj1 = { 'beepBoop': 1, 'fooBar': 2 }; -var obj2 = capitalizeKeys( obj1 ); +const obj2 = capitalizeKeys( obj1 ); // returns { 'BeepBoop': 1, 'FooBar': 2 } ``` @@ -80,16 +80,16 @@ var obj2 = capitalizeKeys( obj1 ); ```javascript -var capitalizeKeys = require( '@stdlib/utils/capitalize-keys' ); +const capitalizeKeys = require( '@stdlib/utils/capitalize-keys' ); -var obj1 = { +const obj1 = { 'aa': 'beep', 'bb': 'boop', 'cc': 'foo', 'dd': 'bar' }; -var obj2 = capitalizeKeys( obj1 ); +const obj2 = capitalizeKeys( obj1 ); console.dir( obj2 ); // => { 'Aa': 'beep', 'Bb': 'boop', 'Cc': 'foo', 'Dd': 'bar' } diff --git a/lib/node_modules/@stdlib/utils/circular-buffer/README.md b/lib/node_modules/@stdlib/utils/circular-buffer/README.md index 9e211c8347e2..0aca022da553 100644 --- a/lib/node_modules/@stdlib/utils/circular-buffer/README.md +++ b/lib/node_modules/@stdlib/utils/circular-buffer/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var circularBuffer = require( '@stdlib/utils/circular-buffer' ); +const circularBuffer = require( '@stdlib/utils/circular-buffer' ); ``` #### circularBuffer( buffer ) @@ -45,17 +45,17 @@ var circularBuffer = require( '@stdlib/utils/circular-buffer' ); Returns a new circular buffer instance. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // returns ``` The `buffer` argument may either be a integer which specifies the buffer size or an array-like object to use as the underlying buffer. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); // Use a typed array as the underlying buffer: -var buf = circularBuffer( new Float64Array( 3 ) ); +const buf = circularBuffer( new Float64Array( 3 ) ); // returns ``` @@ -64,7 +64,7 @@ var buf = circularBuffer( new Float64Array( 3 ) ); Clears a buffer. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // returns // Add values to the buffer: @@ -73,7 +73,7 @@ buf.push( 'bar' ); buf.push( 'beep' ); // Get the number of elements currently in the buffer: -var n = buf.count; +let n = buf.count; // returns 3 // Clear all buffer items: @@ -89,7 +89,7 @@ n = buf.count; Read-only property which returns the number of elements currently in the buffer. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // returns // Add values to the buffer: @@ -97,7 +97,7 @@ buf.push( 'foo' ); buf.push( 'bar' ); // Determine how many elements are in the buffer: -var n = buf.count; +const n = buf.count; // returns 2 ``` @@ -106,7 +106,7 @@ var n = buf.count; Read-only property which returns a `boolean` indicating if a buffer is full. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // returns // Add values to the buffer: @@ -114,7 +114,7 @@ buf.push( 'foo' ); buf.push( 'bar' ); // Determine if the buffer is full: -var bool = buf.full; +let bool = buf.full; // returns false // Add another value to the buffer: @@ -130,7 +130,7 @@ bool = buf.full; Returns an iterator for iterating over a buffer. If an environment supports `Symbol.iterator`, the returned iterator is iterable. ```javascript -var buf = circularBuffer( 2 ); +const buf = circularBuffer( 2 ); // Add values to the buffer: buf.push( 'foo' ); @@ -139,10 +139,10 @@ buf.push( 'beep' ); buf.push( 'boop' ); // Create an iterator: -var it = buf.iterator(); +const it = buf.iterator(); // Iterate over the buffer... -var v = it.next().value; +let v = it.next().value; // returns 'beep' v = it.next().value; @@ -161,7 +161,7 @@ v = it.next().value; By default, provided a buffer is **full**, the method returns an infinite iterator. To limit the number of iterations, provide an `niters` argument. ```javascript -var buf = circularBuffer( 2 ); +const buf = circularBuffer( 2 ); // Add values to the buffer: buf.push( 'foo' ); @@ -170,33 +170,33 @@ buf.push( 'beep' ); buf.push( 'boop' ); // Create an iterator: -var it = buf.iterator( buf.length ); +const it = buf.iterator( buf.length ); // Iterate over the buffer... -var v = it.next().value; +let v = it.next().value; // returns 'beep' v = it.next().value; // returns 'boop' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` A returned iterator does **not** iterate over partially full circular buffers. ```javascript -var buf = circularBuffer( 5 ); +const buf = circularBuffer( 5 ); // Add values to the buffer: buf.push( 'foo' ); buf.push( 'bar' ); // Create an iterator: -var it = buf.iterator(); +const it = buf.iterator(); // Determine if the buffer is full: -var bool = buf.full; +let bool = buf.full; // returns false // Iterate over the buffer... @@ -211,10 +211,10 @@ If iterating over a partially full circular buffer is necessary, use `buf.toArra Read-only property returning the buffer length (i.e., capacity). ```javascript -var buf = circularBuffer( [ 0, 0, 0 ] ); +const buf = circularBuffer( [ 0, 0, 0 ] ); // Get the buffer length: -var len = buf.length; +const len = buf.length; // returns 3 ``` @@ -223,10 +223,10 @@ var len = buf.length; Adds a value to the buffer. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // Fill the buffer... -var v = buf.push( 'foo' ); +let v = buf.push( 'foo' ); // returns undefined v = buf.push( 'bar' ); @@ -247,7 +247,7 @@ When a circular buffer is empty or partially full, this method returns `undefine Returns an array of buffer values. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // Add values to the buffer: buf.push( 'foo' ); @@ -256,7 +256,7 @@ buf.push( 'beep' ); buf.push( 'boop' ); // Get an array of buffer values: -var vals = buf.toArray(); +const vals = buf.toArray(); // returns [ 'bar', 'beep', 'boop' ] ``` @@ -265,7 +265,7 @@ var vals = buf.toArray(); Serializes a circular buffer as JSON. ```javascript -var buf = circularBuffer( 3 ); +const buf = circularBuffer( 3 ); // Add values to the buffer: buf.push( 'foo' ); @@ -274,7 +274,7 @@ buf.push( 'beep' ); buf.push( 'boop' ); // Serialize to JSON: -var o = buf.toJSON(); +const o = buf.toJSON(); // returns { 'type': 'circular-buffer', 'length': 3, 'data': [ 'bar', 'beep', 'boop' ] } ``` @@ -305,17 +305,15 @@ var o = buf.toJSON(); ```javascript -var circularBuffer = require( '@stdlib/utils/circular-buffer' ); +const circularBuffer = require( '@stdlib/utils/circular-buffer' ); // Create a circular buffer capable of holding 5 elements: -var buf = circularBuffer( 5 ); +const buf = circularBuffer( 5 ); console.log( 'Buffer length: %s', buf.length ); // Continuously add values to the buffer... -var v; -var i; -for ( i = 0; i < 100; i++ ) { - v = buf.push( i ); +for ( let i = 0; i < 100; i++ ) { + const v = buf.push( i ); console.log( 'Count: %d. Added value: %s. Removed value: %s.', buf.count, i, ( v === void 0 ) ? '(none)' : v ); } ``` diff --git a/lib/node_modules/@stdlib/utils/common-keys-in/README.md b/lib/node_modules/@stdlib/utils/common-keys-in/README.md index 08e94d47058f..1e00d09f10e6 100644 --- a/lib/node_modules/@stdlib/utils/common-keys-in/README.md +++ b/lib/node_modules/@stdlib/utils/common-keys-in/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var commonKeysIn = require( '@stdlib/utils/common-keys-in' ); +const commonKeysIn = require( '@stdlib/utils/common-keys-in' ); ``` #### commonKeysIn( obj1, obj2\[, obj3\[,...,objN]] ) @@ -45,18 +45,18 @@ var commonKeysIn = require( '@stdlib/utils/common-keys-in' ); Returns the common own and inherited property names of two or more objects. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = { +const obj2 = { 'a': 1, 'b': 2 }; -var keys = commonKeysIn( obj, obj2 ); +const keys = commonKeysIn( obj, obj2 ); // returns [ 'a', 'b' ] ``` @@ -81,7 +81,7 @@ var keys = commonKeysIn( obj, obj2 ); ```javascript -var commonKeysIn = require( '@stdlib/utils/common-keys-in' ); +const commonKeysIn = require( '@stdlib/utils/common-keys-in' ); function Foo() { this.beep = 'boop'; @@ -93,14 +93,14 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj1 = new Foo(); +const obj1 = new Foo(); -var obj2 = { +const obj2 = { 'beep': 'boop', 'foo': 'bar' }; -var keys = commonKeysIn( obj1, obj2 ); +const keys = commonKeysIn( obj1, obj2 ); // returns [ 'beep', 'foo' ] ``` diff --git a/lib/node_modules/@stdlib/utils/common-keys/README.md b/lib/node_modules/@stdlib/utils/common-keys/README.md index 624cfa0358b5..867c6da5ee13 100644 --- a/lib/node_modules/@stdlib/utils/common-keys/README.md +++ b/lib/node_modules/@stdlib/utils/common-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var commonKeys = require( '@stdlib/utils/common-keys' ); +const commonKeys = require( '@stdlib/utils/common-keys' ); ``` #### commonKeys( obj1, obj2\[, obj3\[,...,objN]] ) @@ -45,18 +45,18 @@ var commonKeys = require( '@stdlib/utils/common-keys' ); Returns the common own property names of two or more objects. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = { +const obj2 = { 'a': 1, 'b': 2 }; -var keys = commonKeys( obj, obj2 ); +const keys = commonKeys( obj, obj2 ); // returns [ 'a', 'b' ] ``` @@ -81,7 +81,7 @@ var keys = commonKeys( obj, obj2 ); ```javascript -var commonKeys = require( '@stdlib/utils/common-keys' ); +const commonKeys = require( '@stdlib/utils/common-keys' ); function Foo() { this.beep = 'boop'; @@ -93,14 +93,14 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj1 = new Foo(); +const obj1 = new Foo(); -var obj2 = { +const obj2 = { 'beep': 'boop', 'foo': 'bar' }; -var keys = commonKeys( obj1, obj2 ); +const keys = commonKeys( obj1, obj2 ); // returns [ 'beep' ] ``` diff --git a/lib/node_modules/@stdlib/utils/compact-adjacency-matrix/README.md b/lib/node_modules/@stdlib/utils/compact-adjacency-matrix/README.md index 57ce3f98a2b0..a350e958a5b8 100644 --- a/lib/node_modules/@stdlib/utils/compact-adjacency-matrix/README.md +++ b/lib/node_modules/@stdlib/utils/compact-adjacency-matrix/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' ); +const CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' ); ``` #### CompactAdjacencyMatrix( N ) @@ -35,7 +35,7 @@ var CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' ) Returns a compact adjacency matrix instance. ```javascript -var adj = new CompactAdjacencyMatrix( 4 ); +const adj = new CompactAdjacencyMatrix( 4 ); // returns // ... @@ -57,10 +57,10 @@ adj.addEdge( 2, 3 ); ```javascript -var CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' ); +const CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' ); // Create a new adjacency matrix: -var adj = new CompactAdjacencyMatrix( 4 ); +const adj = new CompactAdjacencyMatrix( 4 ); // Add edges: adj.addEdge( 1, 0 ); @@ -69,12 +69,9 @@ adj.addEdge( 0, 2 ); adj.addEdge( 2, 3 ); // Compute the indegrees and outdegrees for each vertex: -var id; -var od; -var i; -for ( i = 0; i < 4; i++ ) { - id = adj.inDegree( i ); - od = adj.outDegree( i ); +for ( let i = 0; i < 4; i++ ) { + const id = adj.inDegree( i ); + const od = adj.outDegree( i ); console.log( 'vertex: %d. indegree: %d. outdegree: %d.', i, id, od ); } diff --git a/lib/node_modules/@stdlib/utils/compose/README.md b/lib/node_modules/@stdlib/utils/compose/README.md index 8d5a6163a1aa..68d32ff4d88d 100644 --- a/lib/node_modules/@stdlib/utils/compose/README.md +++ b/lib/node_modules/@stdlib/utils/compose/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var compose = require( '@stdlib/utils/compose' ); +const compose = require( '@stdlib/utils/compose' ); ``` #### compose( ...fcn ) @@ -57,9 +57,9 @@ function c( x ) { return x / 5; } -var f = compose( c, b, a ); +const f = compose( c, b, a ); -var z = f( 6 ); // ((2*x)+3)/5 +const z = f( 6 ); // ((2*x)+3)/5 // returns 3 ``` @@ -74,9 +74,9 @@ function b( r ) { return r + 12; } -var f = compose( b, a ); +const f = compose( b, a ); -var z = f( 4, 6 ); +const z = f( 4, 6 ); // returns 50 ``` @@ -105,7 +105,7 @@ var z = f( 4, 6 ); ```javascript -var compose = require( '@stdlib/utils/compose' ); +const compose = require( '@stdlib/utils/compose' ); function a( x, y ) { return x * y; @@ -119,9 +119,9 @@ function c( r ) { return r / 10; } -var f = compose( c, b, a ); +const f = compose( c, b, a ); -var v = f( 5, 3 ); +const v = f( 5, 3 ); // returns 2 ``` diff --git a/lib/node_modules/@stdlib/utils/constant-function/README.md b/lib/node_modules/@stdlib/utils/constant-function/README.md index 005ab903edc0..bfd4f478a1ba 100644 --- a/lib/node_modules/@stdlib/utils/constant-function/README.md +++ b/lib/node_modules/@stdlib/utils/constant-function/README.md @@ -35,7 +35,7 @@ A [constant function][constant-function] is a `function` whose output value is t ## Usage ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); +const constantFunction = require( '@stdlib/utils/constant-function' ); ``` #### constantFunction( x ) @@ -43,10 +43,10 @@ var constantFunction = require( '@stdlib/utils/constant-function' ); Returns a [constant function][constant-function] which always returns `x`. ```javascript -var fcn = constantFunction( 'beep' ); +const fcn = constantFunction( 'beep' ); // returns -var v = fcn(); +let v = fcn(); // returns 'beep' v = fcn(); @@ -64,10 +64,10 @@ v = fcn(); - When provided an object reference, the returned `function` always returns the same reference. ```javascript - var obj = {}; - var fcn = constantFunction( obj ); + const obj = {}; + const fcn = constantFunction( obj ); - var bool = ( fcn() === obj ); + const bool = ( fcn() === obj ); // returns true ``` @@ -82,25 +82,18 @@ v = fcn(); ```javascript -var constantFunction = require( '@stdlib/utils/constant-function' ); - -var bool; -var fcn; -var arr; -var v; -var i; - -fcn = constantFunction( 3.14 ); -for ( i = 0; i < 10; i++ ) { - v = fcn(); +const constantFunction = require( '@stdlib/utils/constant-function' ); +let fcn = constantFunction( 3.14 ); +for ( let i = 0; i < 10; i++ ) { + const v = fcn(); // returns 3.14 } -arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; fcn = constantFunction( arr ); -for ( i = 0; i < 10; i++ ) { - v = fcn(); - bool = ( v === arr ); +for ( let i = 0; i < 10; i++ ) { + const v = fcn(); + const bool = ( v === arr ); // returns true } ``` diff --git a/lib/node_modules/@stdlib/utils/constructor-name/README.md b/lib/node_modules/@stdlib/utils/constructor-name/README.md index 4aaf1f885d24..c14724237909 100644 --- a/lib/node_modules/@stdlib/utils/constructor-name/README.md +++ b/lib/node_modules/@stdlib/utils/constructor-name/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var constructorName = require( '@stdlib/utils/constructor-name' ); +const constructorName = require( '@stdlib/utils/constructor-name' ); ``` #### constructorName( value ) @@ -35,7 +35,7 @@ var constructorName = require( '@stdlib/utils/constructor-name' ); Returns the name of a value's constructor. ```javascript -var v = constructorName( 'a' ); +let v = constructorName( 'a' ); // returns 'String' v = constructorName( 5 ); @@ -111,11 +111,11 @@ v = constructorName( new Beep() ); ```javascript - var Beep = function () { + const Beep = function () { return this; }; - var v = constructorName( new Beep() ); + const v = constructorName( new Beep() ); // returns '' ``` @@ -134,25 +134,25 @@ v = constructorName( new Beep() ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Buffer = require( '@stdlib/buffer/ctor' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var constructorName = require( '@stdlib/utils/constructor-name' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Buffer = require( '@stdlib/buffer/ctor' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const constructorName = require( '@stdlib/utils/constructor-name' ); function noop() { // Do nothing... } -var v = constructorName( 'a' ); +let v = constructorName( 'a' ); // returns 'String' v = constructorName( 5 ); @@ -269,7 +269,7 @@ function Person1() { v = constructorName( new Person1() ); // returns 'Person1' -var Person2 = function () { +const Person2 = function () { return this; }; v = constructorName( new Person2() ); diff --git a/lib/node_modules/@stdlib/utils/convert-path/README.md b/lib/node_modules/@stdlib/utils/convert-path/README.md index a3e7991c9d42..5a1b4e910204 100644 --- a/lib/node_modules/@stdlib/utils/convert-path/README.md +++ b/lib/node_modules/@stdlib/utils/convert-path/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var convertPath = require( '@stdlib/utils/convert-path' ); +const convertPath = require( '@stdlib/utils/convert-path' ); ``` #### convertPath( from, to ) @@ -45,7 +45,7 @@ var convertPath = require( '@stdlib/utils/convert-path' ); Converts between POSIX and Windows paths. ```javascript -var p = convertPath( 'C:\\foo\\bar', 'posix' ); +const p = convertPath( 'C:\\foo\\bar', 'posix' ); // returns '/c/foo/bar' ``` @@ -82,13 +82,10 @@ The following output path conventions are supported: ```javascript -var convertPath = require( '@stdlib/utils/convert-path' ); +const convertPath = require( '@stdlib/utils/convert-path' ); -var p1; -var p2; - -p1 = '/c/foo/bar/beep.c'; -p2 = convertPath( p1, 'win32' ); +let p1 = '/c/foo/bar/beep.c'; +let p2 = convertPath( p1, 'win32' ); // returns 'c:\foo\bar\beep.c' p1 = '/c/foo/bar/beep.c'; diff --git a/lib/node_modules/@stdlib/utils/copy/README.md b/lib/node_modules/@stdlib/utils/copy/README.md index 84ef570e0d40..9bd74cb8b3ca 100644 --- a/lib/node_modules/@stdlib/utils/copy/README.md +++ b/lib/node_modules/@stdlib/utils/copy/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var copy = require( '@stdlib/utils/copy' ); +const copy = require( '@stdlib/utils/copy' ); ``` #### copy( value\[, level] ) @@ -36,11 +36,11 @@ Copies or deep clones an input `value` to an arbitrary depth. The function accep ```javascript // Primitives... -var out = copy( 'beep' ); +let out = copy( 'beep' ); // returns 'beep' // Objects... -var value = [ +const value = [ { 'a': 1, 'b': true, @@ -50,20 +50,20 @@ var value = [ out = copy( value ); // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ] -var bool = ( value[0].c === out[0].c ); +const bool = ( value[0].c === out[0].c ); // returns false // Error object... -var err1 = new TypeError( 'beep' ); +const err1 = new TypeError( 'beep' ); -var err2 = copy( err1 ); +const err2 = copy( err1 ); // returns ``` The default behavior returns a **full** deep copy of any `object`. To limit the copy depth, set the `level` option. ```javascript -var value = [ +const value = [ { 'a': 1, 'b': true, @@ -72,10 +72,10 @@ var value = [ ]; // Trivial case => return the same reference -var out = copy( value, 0 ); +let out = copy( value, 0 ); // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ] -var bool = ( value[0] === out[0] ); +let bool = ( value[0] === out[0] ); // returns true // Shallow copy: @@ -174,10 +174,10 @@ bool = ( value[0].c === out[0].c ); return this; } - var foo1 = new Foo(); - var foo2 = copy( foo1 ); + const foo1 = new Foo(); + const foo2 = copy( foo1 ); - var bool = ( foo1._name === foo2._name ); + let bool = ( foo1._name === foo2._name ); // returns true bool = ( foo1._data === foo2._data ); @@ -198,11 +198,11 @@ bool = ( value[0].c === out[0].c ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var Int32Array = require( '@stdlib/array/int32' ); -var copy = require( '@stdlib/utils/copy' ); +const randu = require( '@stdlib/random/base/randu' ); +const Int32Array = require( '@stdlib/array/int32' ); +const copy = require( '@stdlib/utils/copy' ); -var arr = [ +const arr = [ { 'x': new Date(), 'y': [ randu(), randu() ], @@ -218,9 +218,9 @@ var arr = [ ]; // Perform a full deep copy: -var out = copy( arr ); +let out = copy( arr ); -var bool = ( arr[ 0 ] === out[ 0 ] ); +let bool = ( arr[ 0 ] === out[ 0 ] ); // returns false bool = ( arr[ 1 ].y === out[ 1 ].y ); diff --git a/lib/node_modules/@stdlib/utils/count-by/README.md b/lib/node_modules/@stdlib/utils/count-by/README.md index 48f4347122d0..068c3dc75557 100644 --- a/lib/node_modules/@stdlib/utils/count-by/README.md +++ b/lib/node_modules/@stdlib/utils/count-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var countBy = require( '@stdlib/utils/count-by' ); +const countBy = require( '@stdlib/utils/count-by' ); ``` #### countBy( collection, \[options,] indicator ) @@ -48,9 +48,9 @@ Groups values according to an `indicator` function, i.e., a function which speci function indicator( v ) { return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = countBy( arr, indicator ); +const out = countBy( arr, indicator ); // returns { 'b': 3, 'f': 1 } ``` @@ -64,9 +64,9 @@ function indicator( v, i ) { console.log( '%d: %d', i, v ); return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = countBy( arr, indicator ); +const out = countBy( arr, indicator ); // returns { 'b': 3, 'f': 1 } ``` @@ -81,15 +81,15 @@ function indicator( v ) { this.count += 1; return v[ 0 ]; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = countBy( arr, opts, indicator ); +const out = countBy( arr, opts, indicator ); // returns { 'b': 3, 'f': 1 } console.log( context.count ); @@ -114,9 +114,9 @@ console.log( context.count ); function indicator( v ) { return {}; } - var arr = [ 'beep', 'boop', 'foo', 'bar' ]; + const arr = [ 'beep', 'boop', 'foo', 'bar' ]; - var out = countBy( arr, indicator ); + const out = countBy( arr, indicator ); // returns { '[object Object]': 4 } ``` @@ -135,22 +135,16 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var countBy = require( '@stdlib/utils/count-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const countBy = require( '@stdlib/utils/count-by' ); -var vals; -var arr; -var out; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } @@ -160,7 +154,7 @@ function indicator( v ) { } // Compute the group counts: -out = countBy( arr, indicator ); +const out = countBy( arr, indicator ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/curry-right/README.md b/lib/node_modules/@stdlib/utils/curry-right/README.md index a1bc7c174a40..3c90ec6c4ca3 100644 --- a/lib/node_modules/@stdlib/utils/curry-right/README.md +++ b/lib/node_modules/@stdlib/utils/curry-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var curryRight = require( '@stdlib/utils/curry-right' ); +const curryRight = require( '@stdlib/utils/curry-right' ); ``` #### curryRight( fcn\[, arity]\[, thisArg] ) @@ -49,9 +49,9 @@ function add( x, y ) { return x + y; } -var fcn = curryRight( add ); +const fcn = curryRight( add ); -var sum = fcn( 2 )( 3 ); +const sum = fcn( 2 )( 3 ); // returns 5 ``` @@ -62,9 +62,9 @@ function add() { return arguments[ 0 ] + arguments[ 1 ]; } -var fcn = curryRight( add, 2 ); +const fcn = curryRight( add, 2 ); -var sum = fcn( 2 )( 3 ); +const sum = fcn( 2 )( 3 ); // returns 5 ``` @@ -73,16 +73,16 @@ To specify the curried function execution context, provide a `thisArg` argument. ```javascript -var obj = { +const obj = { 'name': 'Ada', 'greet': function greet( word1, word2 ) { return word1 + ' ' + word2 + ', ' + this.name + '!'; } }; -var fcn = curryRight( obj.greet, obj ); +const fcn = curryRight( obj.greet, obj ); -var str = fcn( 'there' )( 'Hello' ); +const str = fcn( 'there' )( 'Hello' ); // returns 'Hello there, Ada!' ``` @@ -91,16 +91,16 @@ The function supports providing both an `arity` and execution context. ```javascript -var obj = { +const obj = { 'name': 'Ada', 'greet': function greet() { return arguments[ 0 ] + ' ' + arguments[ 1 ] + ', ' + this.name + '!'; } }; -var fcn = curryRight( obj.greet, 2, obj ); +const fcn = curryRight( obj.greet, 2, obj ); -var str = fcn( 'there' )( 'Hello' ); +const str = fcn( 'there' )( 'Hello' ); // returns 'Hello there, Ada!' ``` @@ -121,9 +121,9 @@ var str = fcn( 'there' )( 'Hello' ); return x + y + z; } - var fcn = curryRight( add ); + const fcn = curryRight( add ); - var s0 = fcn( 1 )( 2 )( 3 ); + let s0 = fcn( 1 )( 2 )( 3 ); // returns 6 s0 = fcn( -1 )( -2 )( -3 ); @@ -133,9 +133,9 @@ var str = fcn( 'there' )( 'Hello' ); // returns 60 // Return a partially applied curry function: - var f1 = fcn( 3 ); + const f1 = fcn( 3 ); - var s1 = f1( 4 )( 5 ); + let s1 = f1( 4 )( 5 ); // returns 12 s1 = f1( 6 )( 7 ); @@ -145,9 +145,9 @@ var str = fcn( 'there' )( 'Hello' ); // returns 20 // Return a partially applied curry function: - var f2 = fcn( 4 )( 5 ); + const f2 = fcn( 4 )( 5 ); - var s2 = f2( 6 ); + let s2 = f2( 6 ); // returns 15 s2 = f2( 70 ); @@ -172,19 +172,15 @@ var str = fcn( 'there' )( 'Hello' ); ```javascript -var curryRight = require( '@stdlib/utils/curry-right' ); - -var fcn; -var out; -var i; +const curryRight = require( '@stdlib/utils/curry-right' ); function add( x, y, z, w, t, s ) { return x + y + z + w + t + s; } -fcn = curryRight( add ); -out = fcn; -for ( i = 0; i < add.length; i++ ) { +const fcn = curryRight( add ); +let out = fcn; +for ( let i = 0; i < add.length; i++ ) { out = out( i*10 ); } console.log( out ); diff --git a/lib/node_modules/@stdlib/utils/curry/README.md b/lib/node_modules/@stdlib/utils/curry/README.md index c3e4b1bd95ec..7562b3fa78df 100644 --- a/lib/node_modules/@stdlib/utils/curry/README.md +++ b/lib/node_modules/@stdlib/utils/curry/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var curry = require( '@stdlib/utils/curry' ); +const curry = require( '@stdlib/utils/curry' ); ``` #### curry( fcn\[, arity]\[, thisArg] ) @@ -49,9 +49,9 @@ function add( x, y ) { return x + y; } -var fcn = curry( add ); +const fcn = curry( add ); -var sum = fcn( 2 )( 3 ); +const sum = fcn( 2 )( 3 ); // returns 5 ``` @@ -62,9 +62,9 @@ function add() { return arguments[ 0 ] + arguments[ 1 ]; } -var fcn = curry( add, 2 ); +const fcn = curry( add, 2 ); -var sum = fcn( 2 )( 3 ); +const sum = fcn( 2 )( 3 ); // returns 5 ``` @@ -73,16 +73,16 @@ To specify the curried function execution context, provide a `thisArg` argument. ```javascript -var obj = { +const obj = { 'name': 'Ada', 'greet': function greet( word1, word2 ) { return word1 + ' ' + word2 + ', ' + this.name + '!'; } }; -var fcn = curry( obj.greet, obj ); +const fcn = curry( obj.greet, obj ); -var str = fcn( 'Hello' )( 'there' ); +const str = fcn( 'Hello' )( 'there' ); // returns 'Hello there, Ada!' ``` @@ -91,16 +91,16 @@ The function supports providing both an `arity` and execution context. ```javascript -var obj = { +const obj = { 'name': 'Ada', 'greet': function greet() { return arguments[ 0 ] + ' ' + arguments[ 1 ] + ', ' + this.name + '!'; } }; -var fcn = curry( obj.greet, 2, obj ); +const fcn = curry( obj.greet, 2, obj ); -var str = fcn( 'Hello' )( 'there' ); +const str = fcn( 'Hello' )( 'there' ); // returns 'Hello there, Ada!' ``` @@ -121,9 +121,9 @@ var str = fcn( 'Hello' )( 'there' ); return x + y + z; } - var fcn = curry( add ); + const fcn = curry( add ); - var s0 = fcn( 1 )( 2 )( 3 ); + let s0 = fcn( 1 )( 2 )( 3 ); // returns 6 s0 = fcn( -1 )( -2 )( -3 ); @@ -133,9 +133,9 @@ var str = fcn( 'Hello' )( 'there' ); // returns 60 // Return a partially applied curry function: - var f1 = fcn( 3 ); + const f1 = fcn( 3 ); - var s1 = f1( 4 )( 5 ); + let s1 = f1( 4 )( 5 ); // returns 12 s1 = f1( 6 )( 7 ); @@ -145,9 +145,9 @@ var str = fcn( 'Hello' )( 'there' ); // returns 20 // Return a partially applied curry function: - var f2 = fcn( 4 )( 5 ); + const f2 = fcn( 4 )( 5 ); - var s2 = f2( 6 ); + let s2 = f2( 6 ); // returns 15 s2 = f2( 70 ); @@ -170,19 +170,15 @@ var str = fcn( 'Hello' )( 'there' ); ```javascript -var curry = require( '@stdlib/utils/curry' ); - -var fcn; -var out; -var i; +const curry = require( '@stdlib/utils/curry' ); function add( x, y, z, w, t, s ) { return x + y + z + w + t + s; } -fcn = curry( add ); -out = fcn; -for ( i = 0; i < add.length; i++ ) { +const fcn = curry( add ); +let out = fcn; +for ( let i = 0; i < add.length; i++ ) { out = out( i*10 ); } console.log( out ); diff --git a/lib/node_modules/@stdlib/utils/decorate-after/README.md b/lib/node_modules/@stdlib/utils/decorate-after/README.md index 359308e781f4..fb97540c9a17 100644 --- a/lib/node_modules/@stdlib/utils/decorate-after/README.md +++ b/lib/node_modules/@stdlib/utils/decorate-after/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var decorateAfter = require( '@stdlib/utils/decorate-after' ); +const decorateAfter = require( '@stdlib/utils/decorate-after' ); ``` #### decorateAfter( fcn, arity, after\[, thisArg] ) @@ -45,19 +45,19 @@ var decorateAfter = require( '@stdlib/utils/decorate-after' ); Decorates a provided function such that the function's return value is provided as an argument to another function. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function negate( v ) { return -v; } -var f = decorateAfter( abs, abs.length, negate ); +const f = decorateAfter( abs, abs.length, negate ); // returns -var bool = ( abs.length === f.length ); +const bool = ( abs.length === f.length ); // returns true -var v = f( -5 ); +let v = f( -5 ); // returns -5 v = f( 5 ); @@ -67,19 +67,19 @@ v = f( 5 ); Decorators are intended to be transparent, meaning that, when interfacing with an API, the decorated API should have the same signature (i.e., number of parameters) as the decorated function. Thus, a typical value for `arity` is `fcn.length`. This function does not require equality, however, and the `arity` argument is allowed to diverge from that of the decorated function. Specifying a differing `arity` does **not** affect function evaluation behavior, as the returned function passes all provided arguments to the decorated function. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function negate( v ) { return -v; } -var f = decorateAfter( abs, 0, negate ); +const f = decorateAfter( abs, 0, negate ); // returns -var bool = ( abs.length === f.length ); +const bool = ( abs.length === f.length ); // returns false -var v = f( -5 ); +let v = f( -5 ); // returns -5 v = f( 5 ); @@ -91,26 +91,26 @@ To specify the function execution context for `after`, provide a `thisArg` argum ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function counter() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; -var f = decorateAfter( abs, abs.length, counter, ctx ); +const f = decorateAfter( abs, abs.length, counter, ctx ); // returns -var v = f( -5 ); +let v = f( -5 ); // returns 5 v = f( 5 ); // returns 5 -var count = ctx.count; +const count = ctx.count; // returns 2 ``` @@ -119,19 +119,19 @@ var count = ctx.count; Uses code generation to decorate a provided function such that the function's return value is provided as an argument to another function. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function negate( v ) { return -v; } -var f = decorateAfter.factory( abs, abs.length, negate ); +const f = decorateAfter.factory( abs, abs.length, negate ); // returns -var bool = ( abs.length === f.length ); +const bool = ( abs.length === f.length ); // returns true -var v = f( -5 ); +let v = f( -5 ); // returns -5 v = f( 5 ); @@ -172,9 +172,9 @@ Argument behavior is the same as for `decorateAfter` above. ```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var format = require( '@stdlib/string/format' ); -var decorateAfter = require( '@stdlib/utils/decorate-after' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +const format = require( '@stdlib/string/format' ); +const decorateAfter = require( '@stdlib/utils/decorate-after' ); function count() { this.count += 1; @@ -185,30 +185,27 @@ function greet() { } function randstr( f ) { - var str; - var i; - - str = []; - for ( i = 0; i < discreteUniform( 1, 10 ); i++ ) { + const str = []; + for ( let i = 0; i < discreteUniform( 1, 10 ); i++ ) { str.push( f() ); } return str.join( ' ' ); } // Create an evaluation context to allow tracking how many times a function is invoked: -var ctx = { +const ctx = { 'count': 0 }; // Decorate a function with a counter: -var f = decorateAfter( greet, greet.length, count, ctx ); +const f = decorateAfter( greet, greet.length, count, ctx ); // Generate a random greeting: -var str = randstr( f ); +const str = randstr( f ); // returns // Check how many times the function was invoked: -var c = ctx.count; +const c = ctx.count; // returns ``` diff --git a/lib/node_modules/@stdlib/utils/deep-get/README.md b/lib/node_modules/@stdlib/utils/deep-get/README.md index 5fa92c902795..ab65f951a566 100644 --- a/lib/node_modules/@stdlib/utils/deep-get/README.md +++ b/lib/node_modules/@stdlib/utils/deep-get/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deepGet = require( '@stdlib/utils/deep-get' ); +const deepGet = require( '@stdlib/utils/deep-get' ); ``` #### deepGet( obj, path\[, options] ) @@ -37,9 +37,9 @@ Returns a nested property value. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var val = deepGet( obj, 'a.b.c' ); +const val = deepGet( obj, 'a.b.c' ); // returns 'd' ``` @@ -48,12 +48,12 @@ For `paths` including `arrays`, specify the numeric index. ```javascript -var arr = [ +const arr = [ { 'a': [ {'x': 5} ] }, { 'a': [ {'x': 10} ] } ]; -var val = deepGet( arr, '1.a.0.x' ); +const val = deepGet( arr, '1.a.0.x' ); // returns 10 ``` @@ -62,9 +62,9 @@ The key `path` may be specified as either a delimited `string` or a key `array`. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var val = deepGet( obj, [ 'a', 'b', 'c' ] ); +const val = deepGet( obj, [ 'a', 'b', 'c' ] ); // returns 'd' ``` @@ -77,9 +77,9 @@ By default, the function assumes `dot` separated key values. To specify an alter ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var val = deepGet( obj, 'a/b/c', { +const val = deepGet( obj, 'a/b/c', { 'sep': '/' }); // returns 'd' @@ -90,7 +90,7 @@ var val = deepGet( obj, 'a/b/c', { Creates a reusable deep get function. The factory method ensures a `deepGet` function is configured identically by using the same set of provided `options`. ```javascript -var dget = deepGet.factory( 'a/b/c', { +const dget = deepGet.factory( 'a/b/c', { 'sep': '/' }); ``` @@ -102,11 +102,11 @@ Returns a nested property value. ```javascript -var dget = deepGet.factory( 'a.b.c' ); +const dget = deepGet.factory( 'a.b.c' ); -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var val = dget( obj ); +const val = dget( obj ); // returns 'd' ``` @@ -121,26 +121,21 @@ var val = dget( obj ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var deepGet = require( '@stdlib/utils/deep-get' ); +const randu = require( '@stdlib/random/base/randu' ); +const deepGet = require( '@stdlib/utils/deep-get' ); -var data; -var keys; -var val; -var i; - -data = new Array( 100 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Array( 100 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = { 'x': Date.now(), 'y': [ randu(), randu(), i ] }; } -keys = [ 0, 'y', 2 ]; -for ( i = 0; i < data.length; i++ ) { +const keys = [ 0, 'y', 2 ]; +for ( let i = 0; i < data.length; i++ ) { keys[ 0 ] = i; - val = deepGet( data, keys ); + const val = deepGet( data, keys ); console.log( val ); } ``` diff --git a/lib/node_modules/@stdlib/utils/deep-pluck/README.md b/lib/node_modules/@stdlib/utils/deep-pluck/README.md index cdfe2b00b0ea..4603e2a6cefc 100644 --- a/lib/node_modules/@stdlib/utils/deep-pluck/README.md +++ b/lib/node_modules/@stdlib/utils/deep-pluck/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var deepPluck = require( '@stdlib/utils/deep-pluck' ); +const deepPluck = require( '@stdlib/utils/deep-pluck' ); ``` #### deepPluck( arr, path\[, options] ) @@ -43,12 +43,12 @@ Extracts a nested property value from each element of an object `array` based on ```javascript -var arr = [ +const arr = [ { 'a': { 'b': { 'c': 1 } } }, { 'a': { 'b': { 'c': 2 } } } ]; -var out = deepPluck( arr, 'a.b.c' ); +const out = deepPluck( arr, 'a.b.c' ); // returns [ 1, 2 ] ``` @@ -57,12 +57,12 @@ A key `path` may be specified as either a `string` or as an `array`. ```javascript -var arr = [ +const arr = [ { 'a': [ 0, 1, 2 ] }, { 'a': [ 3, 4, 5 ] } ]; -var out = deepPluck( arr, [ 'a', 1 ] ); +const out = deepPluck( arr, [ 'a', 1 ] ); // returns [ 1, 4 ] ``` @@ -76,15 +76,15 @@ By default, the function returns a new data structure. To mutate the input data ```javascript -var arr = [ +const arr = [ { 'a': { 'b': { 'c': 1 } } }, { 'a': { 'b': { 'c': 2 } } } ]; -var out = deepPluck( arr, 'a.b.c', { 'copy': false } ); +const out = deepPluck( arr, 'a.b.c', { 'copy': false } ); // returns [ 1, 2 ] -var bool = ( arr[ 0 ] === out[ 0 ] ); +const bool = ( arr[ 0 ] === out[ 0 ] ); // returns true ``` @@ -93,12 +93,12 @@ The default key `path` separator is `.`. To specify an alternative separator, se ```javascript -var arr = [ +const arr = [ { 'a': { 'b': { 'c': 1 } } }, { 'a': { 'b': { 'c': 2 } } } ]; -var out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); +const out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); // returns [ 1, 2 ] ``` @@ -113,14 +113,14 @@ var out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); ```javascript - var arr = [ + const arr = [ { 'a': { 'b': { 'c': 1 } } }, null, void 0, { 'a': { 'b': { 'c': 2 } } } ]; - var out = deepPluck( arr, 'a.b.c' ); + const out = deepPluck( arr, 'a.b.c' ); // returns [ 1, undefined, undefined, 2 ] ``` @@ -129,15 +129,15 @@ var out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); ```javascript - var arr = [ + const arr = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 3 } } } ]; - var out = deepPluck( arr, 'a.b' ); + const out = deepPluck( arr, 'a.b' ); // returns [ { 'c': 2 }, { 'c': 3 } ] - var bool = ( arr[ 0 ].a.b === out[ 0 ] ); + const bool = ( arr[ 0 ].a.b === out[ 0 ] ); // returns true ``` @@ -146,20 +146,20 @@ var out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); ```javascript - var copy = require( '@stdlib/utils/copy' ); + const copy = require( '@stdlib/utils/copy' ); - var arr = [ + const arr = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 3 } } } ]; - var out = deepPluck( arr, 'a.b' ); + let out = deepPluck( arr, 'a.b' ); // returns [ { 'c': 2 }, { 'c': 3 } ] // Perform a deep copy: out = copy( out ); - var bool = ( arr[ 0 ].a.b === out[ 0 ] ); + const bool = ( arr[ 0 ].a.b === out[ 0 ] ); // returns false ``` @@ -174,18 +174,13 @@ var out = deepPluck( arr, 'a|b|c', { 'sep': '|' } ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var deepPluck = require( '@stdlib/utils/deep-pluck' ); - -var arr; -var out; -var tmp; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - tmp = { +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const deepPluck = require( '@stdlib/utils/deep-pluck' ); + +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const tmp = { 'a': { 'b': { 'c': { @@ -199,7 +194,7 @@ for ( i = 0; i < arr.length; i++ ) { } // Pluck the deeply nested values: -out = deepPluck( arr, 'a.b.c.d' ); +const out = deepPluck( arr, 'a.b.c.d' ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/deep-set/README.md b/lib/node_modules/@stdlib/utils/deep-set/README.md index e617d617c1de..d8f6d28f95ae 100644 --- a/lib/node_modules/@stdlib/utils/deep-set/README.md +++ b/lib/node_modules/@stdlib/utils/deep-set/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var deepSet = require( '@stdlib/utils/deep-set' ); +const deepSet = require( '@stdlib/utils/deep-set' ); ``` #### deepSet( obj, path, value\[, options] ) @@ -37,9 +37,9 @@ Sets a nested property value. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, 'a.b.c', 'beep' ); +const bool = deepSet( obj, 'a.b.c', 'beep' ); // returns true console.log( obj ); @@ -51,9 +51,9 @@ If the function is able to deep set a nested property, the function returns `tru ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, 'a.b.c', 'woot' ); +let bool = deepSet( obj, 'a.b.c', 'woot' ); // returns true bool = deepSet( obj, 'a.beep.c', 'boop' ); @@ -71,12 +71,12 @@ For `paths` including `arrays`, specify the numeric index. ```javascript -var arr = [ +const arr = [ { 'a': [ { 'x': 5 } ] }, { 'a': [ { 'x': 10 } ] } ]; -var bool = deepSet( arr, '1.a.0.x', 25 ); +const bool = deepSet( arr, '1.a.0.x', 25 ); // returns true console.log( arr ); @@ -93,9 +93,9 @@ The key `path` may be specified as either a delimited `string` or a key `array`. ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, [ 'a', 'b', 'c' ], 'beep' ); // obj => { 'a': { 'b': { 'c': 'beep' } } } +const bool = deepSet( obj, [ 'a', 'b', 'c' ], 'beep' ); // obj => { 'a': { 'b': { 'c': 'beep' } } } // returns true ``` @@ -105,16 +105,15 @@ If `value` is a `function`, the argument is treated as a `callback` and should r ```javascript function set( val ) { - var ch = val; - var i; - for ( i = 0; i < 4; i++ ) { + const ch = val; + for ( let i = 0; i < 4; i++ ) { val += ch; } return val; } -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, 'a.b.c', set ); // obj => { 'a': { 'b': { 'c': 'ddddd' } } } +const bool = deepSet( obj, 'a.b.c', set ); // obj => { 'a': { 'b': { 'c': 'ddddd' } } } // returns true ``` @@ -128,9 +127,9 @@ By default, the function assumes `dot` separated key values. To specify an alter ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, 'a/b/c', 'beep', { +const bool = deepSet( obj, 'a/b/c', 'beep', { 'sep': '/' }); // returns true @@ -144,9 +143,9 @@ To create a key path which does not already exist, set the `create` option to `t ```javascript -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = deepSet( obj, 'a.e.c', 'boop', { +const bool = deepSet( obj, 'a.e.c', 'boop', { 'create': true }); // returns true @@ -171,7 +170,7 @@ console.log( obj ); Creates a reusable deep set function. The factory method ensures a `deepSet` function is configured identically by using the same set of provided `options`. ```javascript -var dset = deepSet.factory( 'a/b/c', { +const dset = deepSet.factory( 'a/b/c', { 'create': true, 'sep': '/' }); @@ -184,11 +183,11 @@ Sets a nested property value. ```javascript -var dset = deepSet.factory( 'a.b.c' ); +const dset = deepSet.factory( 'a.b.c' ); -var obj = { 'a': { 'b': { 'c': 'd' } } }; +const obj = { 'a': { 'b': { 'c': 'd' } } }; -var bool = dset( obj, 'beep' ); +const bool = dset( obj, 'beep' ); // returns true console.log( obj ); @@ -206,30 +205,25 @@ console.log( obj ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var deepSet = require( '@stdlib/utils/deep-set' ); - -var data; -var bool; -var keys; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const deepSet = require( '@stdlib/utils/deep-set' ); function set( val ) { return val * 10.0; } -data = new Array( 100 ); -for ( i = 0; i < data.length; i++ ) { +const data = new Array( 100 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = { 'x': Date.now(), 'y': [ randu(), randu(), i ] }; } -keys = [ 0, 'y', 2 ]; -for ( i = 0; i < data.length; i++ ) { +const keys = [ 0, 'y', 2 ]; +for ( let i = 0; i < data.length; i++ ) { keys[ 0 ] = i; - bool = deepSet( data, keys, set ); + const bool = deepSet( data, keys, set ); if ( !bool ) { console.error( 'Unable to deep set value.' ); } diff --git a/lib/node_modules/@stdlib/utils/define-configurable-read-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-configurable-read-only-accessor/README.md index 05d79a37a9fe..41b3e61b076f 100644 --- a/lib/node_modules/@stdlib/utils/define-configurable-read-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-configurable-read-only-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); +const setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); ``` #### setConfigurableReadOnlyAccessor( obj, prop, getter ) @@ -45,7 +45,7 @@ function getter() { return 'bar'; } -var obj = {}; +const obj = {}; setConfigurableReadOnlyAccessor( obj, 'foo', getter ); @@ -76,7 +76,7 @@ obj.foo = 'boop'; ```javascript -var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); +const setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -90,7 +90,7 @@ function Foo( name ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-configurable-read-only-property/README.md b/lib/node_modules/@stdlib/utils/define-configurable-read-only-property/README.md index ce4b6b8cf299..42cc0363fe81 100644 --- a/lib/node_modules/@stdlib/utils/define-configurable-read-only-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-configurable-read-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); +const setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); ``` #### setConfigurableReadOnly( obj, prop, value ) @@ -37,7 +37,7 @@ var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-o ```javascript -var obj = {}; +const obj = {}; setConfigurableReadOnly( obj, 'foo', 'bar' ); @@ -66,7 +66,7 @@ obj.foo = 'boop'; ```javascript -var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); +const setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -76,7 +76,7 @@ function Foo( name ) { return this; } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-configurable-read-write-accessor/README.md b/lib/node_modules/@stdlib/utils/define-configurable-read-write-accessor/README.md index 04ff5708d7c9..1e453a1dd09e 100644 --- a/lib/node_modules/@stdlib/utils/define-configurable-read-write-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-configurable-read-write-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' ); +const setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' ); ``` #### setConfigurableReadWriteAccessor( obj, prop, getter, setter ) @@ -39,8 +39,8 @@ var setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurab ```javascript -var word = 'bar'; -var obj = {}; +let word = 'bar'; +const obj = {}; function getter() { return word + ' foo'; @@ -52,7 +52,7 @@ function setter( v ) { setConfigurableReadWriteAccessor( obj, 'foo', getter, setter ); -var v = obj.foo; +let v = obj.foo; // returns 'bar foo' obj.foo = 'beep'; @@ -84,7 +84,7 @@ v = obj.foo; ```javascript -var setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' ); +const setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -102,7 +102,7 @@ function Foo( name ) { } } -var foo = new Foo( 'Grace' ); +const foo = new Foo( 'Grace' ); console.log( foo.name ); foo.name = 'Ada'; diff --git a/lib/node_modules/@stdlib/utils/define-configurable-write-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-configurable-write-only-accessor/README.md index d7129f954b82..850ce6cad0f7 100644 --- a/lib/node_modules/@stdlib/utils/define-configurable-write-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-configurable-write-only-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' ); +const setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' ); ``` #### setConfigurableWriteOnlyAccessor( obj, prop, setter ) @@ -39,8 +39,8 @@ var setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurab ```javascript -var obj = {}; -var val = ''; +const obj = {}; +let val = ''; function setter( v ) { val = v; @@ -50,7 +50,7 @@ setConfigurableWriteOnlyAccessor( obj, 'foo', setter ); obj.foo = 'boop'; -var bool = ( val === 'boop' ); +const bool = ( val === 'boop' ); // returns true ``` @@ -77,7 +77,7 @@ var bool = ( val === 'boop' ); ```javascript -var setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' ); +const setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' ); function Foo( secret ) { if ( !(this instanceof Foo) ) { @@ -91,7 +91,7 @@ function Foo( secret ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); foo.secret = 'boop'; ``` diff --git a/lib/node_modules/@stdlib/utils/define-memoized-configurable-read-only-property/README.md b/lib/node_modules/@stdlib/utils/define-memoized-configurable-read-only-property/README.md index 842616ad0e51..be833150bcde 100644 --- a/lib/node_modules/@stdlib/utils/define-memoized-configurable-read-only-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-memoized-configurable-read-only-property/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' ); +const setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' ); ``` #### setMemoizedConfigurableReadOnly( obj, prop, fcn ) @@ -39,7 +39,7 @@ var setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-co ```javascript -var obj = {}; +const obj = {}; function foo() { return 'bar'; @@ -47,7 +47,7 @@ function foo() { setMemoizedConfigurableReadOnly( obj, 'foo', foo ); -var v = obj.foo; +const v = obj.foo; // returns 'bar' ``` @@ -76,15 +76,14 @@ The last argument should be a synchronous function whose return value will be me ```javascript -var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); -var setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' ); +const fibonacci = require( '@stdlib/math/base/special/fibonacci' ); +const setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' ); function Foo() { - var self; if ( !(this instanceof Foo) ) { return new Foo(); } - self = this; + const self = this; this.count = 0; setMemoizedConfigurableReadOnly( this, 'fibo', fibo ); return this; @@ -95,10 +94,9 @@ function Foo() { } } -var foo = new Foo(); +const foo = new Foo(); -var i; -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { console.log( 'F: %d. Count: %d.', foo.fibo, foo.count ); } ``` diff --git a/lib/node_modules/@stdlib/utils/define-memoized-property/README.md b/lib/node_modules/@stdlib/utils/define-memoized-property/README.md index 30a641e99de5..5fc5d3db7380 100644 --- a/lib/node_modules/@stdlib/utils/define-memoized-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-memoized-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' ); +const defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' ); ``` #### defineMemoizedProperty( obj, prop, descriptor ) @@ -35,7 +35,7 @@ var defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' ) [Defines][mdn-define-property] a memoized object property. ```javascript -var obj = {}; +const obj = {}; function foo() { return 'bar'; @@ -48,7 +48,7 @@ defineMemoizedProperty( obj, 'foo', { 'value': foo }); -var v = obj.foo; +const v = obj.foo; // returns 'bar' ``` @@ -83,15 +83,14 @@ A property `descriptor` has the following optional properties: ```javascript -var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); -var defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' ); +const fibonacci = require( '@stdlib/math/base/special/fibonacci' ); +const defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' ); function Foo() { - var self; if ( !(this instanceof Foo) ) { return new Foo(); } - self = this; + const self = this; this.count = 0; defineMemoizedProperty( this, 'fibo', { 'value': fibo @@ -104,10 +103,9 @@ function Foo() { } } -var foo = new Foo(); +const foo = new Foo(); -var i; -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { console.log( 'F: %d. Count: %d.', foo.fibo, foo.count ); } ``` diff --git a/lib/node_modules/@stdlib/utils/define-memoized-read-only-property/README.md b/lib/node_modules/@stdlib/utils/define-memoized-read-only-property/README.md index f0a6ee006db2..c374177ea6a1 100644 --- a/lib/node_modules/@stdlib/utils/define-memoized-read-only-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-memoized-read-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' ); +const setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' ); ``` #### setMemoizedReadOnly( obj, prop, fcn ) @@ -35,7 +35,7 @@ var setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-prop [Defines][mdn-define-property] a memoized **read-only** object property. ```javascript -var obj = {}; +const obj = {}; function foo() { return 'bar'; @@ -43,7 +43,7 @@ function foo() { setMemoizedReadOnly( obj, 'foo', foo ); -var v = obj.foo; +const v = obj.foo; // returns 'bar' ``` @@ -70,15 +70,14 @@ The last argument should be a synchronous function whose return value will be me ```javascript -var fibonacci = require( '@stdlib/math/base/special/fibonacci' ); -var setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' ); +const fibonacci = require( '@stdlib/math/base/special/fibonacci' ); +const setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' ); function Foo() { - var self; if ( !(this instanceof Foo) ) { return new Foo(); } - self = this; + const self = this; this.count = 0; setMemoizedReadOnly( this, 'fibo', fibo ); return this; @@ -89,10 +88,9 @@ function Foo() { } } -var foo = new Foo(); +const foo = new Foo(); -var i; -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { console.log( 'F: %d. Count: %d.', foo.fibo, foo.count ); } ``` diff --git a/lib/node_modules/@stdlib/utils/define-nonenumerable-property/README.md b/lib/node_modules/@stdlib/utils/define-nonenumerable-property/README.md index 3c7285221733..c6676f862e93 100644 --- a/lib/node_modules/@stdlib/utils/define-nonenumerable-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-nonenumerable-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' ); +const setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' ); ``` #### setNonEnumerableProperty( obj, prop, value ) @@ -35,11 +35,11 @@ var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-prop [Defines][@stdlib/utils/define-property] a **non-enumerable** property. ```javascript -var obj = {}; +const obj = {}; setNonEnumerableProperty( obj, 'foo', 'bar' ); -var v = obj.foo; +const v = obj.foo; // returns 'bar' ``` @@ -64,8 +64,8 @@ var v = obj.foo; ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -75,12 +75,12 @@ function Foo( name ) { return this; } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); -var v = foo.name; +const v = foo.name; // returns 'beep' -var keys = objectKeys( foo ); +const keys = objectKeys( foo ); // returns [] ``` diff --git a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/README.md index 6aa7e3c6ba51..f486a59f1fb2 100644 --- a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); +const setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); ``` #### setNonEnumerableReadOnlyAccessor( obj, prop, getter ) @@ -43,7 +43,7 @@ function getter() { return 'bar'; } -var obj = {}; +const obj = {}; setNonEnumerableReadOnlyAccessor( obj, 'foo', getter ); @@ -78,7 +78,7 @@ try { ```javascript -var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); +const setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -92,7 +92,7 @@ function Foo( name ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/README.md b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/README.md index bc88ddb30aa7..79640eca7a7b 100644 --- a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +const setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); ``` #### setNonEnumerableReadOnly( obj, prop, value ) @@ -37,7 +37,7 @@ var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read ```javascript -var obj = {}; +const obj = {}; setNonEnumerableReadOnly( obj, 'foo', 'bar' ); @@ -66,7 +66,7 @@ obj.foo = 'boop'; ```javascript -var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +const setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -76,7 +76,7 @@ function Foo( name ) { return this; } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-write-accessor/README.md b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-write-accessor/README.md index f2fd1d55b66a..fc74fe9c4a53 100644 --- a/lib/node_modules/@stdlib/utils/define-nonenumerable-read-write-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-nonenumerable-read-write-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); +const setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); ``` #### setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) @@ -39,8 +39,8 @@ var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumer ```javascript -var word = 'bar'; -var obj = {}; +let word = 'bar'; +const obj = {}; function getter() { return word + ' foo'; @@ -52,7 +52,7 @@ function setter( v ) { setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter ); -var v = obj.foo; +let v = obj.foo; // returns 'bar foo' obj.foo = 'beep'; @@ -84,7 +84,7 @@ v = obj.foo; ```javascript -var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); +const setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -102,7 +102,7 @@ function Foo( name ) { } } -var foo = new Foo( 'Grace' ); +const foo = new Foo( 'Grace' ); console.log( foo.name ); foo.name = 'Ada'; diff --git a/lib/node_modules/@stdlib/utils/define-nonenumerable-write-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-nonenumerable-write-only-accessor/README.md index 344fb549db8b..e69b590160d5 100644 --- a/lib/node_modules/@stdlib/utils/define-nonenumerable-write-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-nonenumerable-write-only-accessor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' ); +const setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' ); ``` #### setNonEnumerableWriteOnlyAccessor( obj, prop, setter ) @@ -39,8 +39,8 @@ var setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumer ```javascript -var obj = {}; -var val = ''; +const obj = {}; +let val = ''; function setter( v ) { val = v; @@ -50,7 +50,7 @@ setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter ); obj.foo = 'boop'; -var bool = ( val === 'boop' ); +const bool = ( val === 'boop' ); // returns true ``` @@ -77,7 +77,7 @@ var bool = ( val === 'boop' ); ```javascript -var setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' ); +const setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' ); function Foo( secret ) { if ( !(this instanceof Foo) ) { @@ -91,7 +91,7 @@ function Foo( secret ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); foo.secret = 'boop'; ``` diff --git a/lib/node_modules/@stdlib/utils/define-properties/README.md b/lib/node_modules/@stdlib/utils/define-properties/README.md index 70e629be4ab2..ba5a7245bfdf 100644 --- a/lib/node_modules/@stdlib/utils/define-properties/README.md +++ b/lib/node_modules/@stdlib/utils/define-properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var defineProperties = require( '@stdlib/utils/define-properties' ); +const defineProperties = require( '@stdlib/utils/define-properties' ); ``` #### defineProperties( obj, properties ) @@ -35,9 +35,9 @@ var defineProperties = require( '@stdlib/utils/define-properties' ); [Defines][mdn-define-properties] (and/or modifies) object properties. ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); +const objectKeys = require( '@stdlib/utils/keys' ); -var obj = {}; +const obj = {}; defineProperties( obj, { 'foo': { 'value': 'bar', @@ -52,7 +52,7 @@ defineProperties( obj, { }); // Retrieve all enumerable keys: -var keys = objectKeys( obj ); +const keys = objectKeys( obj ); // returns [...] ``` @@ -86,7 +86,7 @@ The `properties` parameter is an `object` whose own enumerable property values a ```javascript -var defineProperties = require( '@stdlib/utils/define-properties' ); +const defineProperties = require( '@stdlib/utils/define-properties' ); function Person( name ) { if ( !(this instanceof Person) ) { @@ -106,7 +106,7 @@ function Person( name ) { return this; } -var person = new Person( 'Simon' ); +const person = new Person( 'Simon' ); try { person.name = 'Peter'; @@ -114,7 +114,7 @@ try { console.log( err.message ); } -var greeting = person.greeting; +const greeting = person.greeting; // returns ``` diff --git a/lib/node_modules/@stdlib/utils/define-property/README.md b/lib/node_modules/@stdlib/utils/define-property/README.md index a11abcc1b1f6..51e49b99a997 100644 --- a/lib/node_modules/@stdlib/utils/define-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); ``` #### defineProperty( obj, prop, descriptor ) @@ -35,7 +35,7 @@ var defineProperty = require( '@stdlib/utils/define-property' ); [Defines][mdn-define-property] (or modifies) an object property. ```javascript -var obj = {}; +const obj = {}; defineProperty( obj, 'foo', { 'value': 'bar', @@ -76,7 +76,7 @@ A property `descriptor` has the following optional properties: ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -89,7 +89,7 @@ function Foo( name ) { return this; } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { delete foo.name; diff --git a/lib/node_modules/@stdlib/utils/define-read-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-read-only-accessor/README.md index 292ff19a583a..ae58e92dde69 100644 --- a/lib/node_modules/@stdlib/utils/define-read-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-read-only-accessor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); +const setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); ``` #### setReadOnlyAccessor( obj, prop, getter ) @@ -41,7 +41,7 @@ function getter() { return 'bar'; } -var obj = {}; +const obj = {}; setReadOnlyAccessor( obj, 'foo', getter ); @@ -70,7 +70,7 @@ obj.foo = 'boop'; ```javascript -var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); +const setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -84,7 +84,7 @@ function Foo( name ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-read-only-property/README.md b/lib/node_modules/@stdlib/utils/define-read-only-property/README.md index e96932ec8e2e..910b432b8c6b 100644 --- a/lib/node_modules/@stdlib/utils/define-read-only-property/README.md +++ b/lib/node_modules/@stdlib/utils/define-read-only-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); ``` #### setReadOnly( obj, prop, value ) @@ -37,7 +37,7 @@ var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); ```javascript -var obj = {}; +const obj = {}; setReadOnly( obj, 'foo', 'bar' ); @@ -66,7 +66,7 @@ obj.foo = 'boop'; ```javascript -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +const setReadOnly = require( '@stdlib/utils/define-read-only-property' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -76,7 +76,7 @@ function Foo( name ) { return this; } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); try { foo.name = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/define-read-write-accessor/README.md b/lib/node_modules/@stdlib/utils/define-read-write-accessor/README.md index 453eedaa7e39..c732d25a548e 100644 --- a/lib/node_modules/@stdlib/utils/define-read-write-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-read-write-accessor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +const setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); ``` #### setReadWriteAccessor( obj, prop, getter, setter ) @@ -35,8 +35,8 @@ var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ) [Defines][@stdlib/utils/define-property] a **read-write** accessor. ```javascript -var word = 'bar'; -var obj = {}; +let word = 'bar'; +const obj = {}; function getter() { return word + ' foo'; @@ -48,7 +48,7 @@ function setter( v ) { setReadWriteAccessor( obj, 'foo', getter, setter ); -var v = obj.foo; +let v = obj.foo; // returns 'bar foo' obj.foo = 'beep'; @@ -78,7 +78,7 @@ v = obj.foo; ```javascript -var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +const setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); function Foo( name ) { if ( !(this instanceof Foo) ) { @@ -96,7 +96,7 @@ function Foo( name ) { } } -var foo = new Foo( 'Grace' ); +const foo = new Foo( 'Grace' ); console.log( foo.name ); foo.name = 'Ada'; diff --git a/lib/node_modules/@stdlib/utils/define-write-only-accessor/README.md b/lib/node_modules/@stdlib/utils/define-write-only-accessor/README.md index 49d31a78849c..ad30b16cb0e0 100644 --- a/lib/node_modules/@stdlib/utils/define-write-only-accessor/README.md +++ b/lib/node_modules/@stdlib/utils/define-write-only-accessor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' ); +const setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' ); ``` #### setWriteOnlyAccessor( obj, prop, setter ) @@ -35,8 +35,8 @@ var setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' ) [Defines][@stdlib/utils/define-property] a **write-only** accessor. ```javascript -var obj = {}; -var val = ''; +const obj = {}; +let val = ''; function setter( v ) { val = v; @@ -46,7 +46,7 @@ setWriteOnlyAccessor( obj, 'foo', setter ); obj.foo = 'boop'; -var bool = ( val === 'boop' ); +const bool = ( val === 'boop' ); // returns true ``` @@ -71,7 +71,7 @@ var bool = ( val === 'boop' ); ```javascript -var setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' ); +const setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' ); function Foo( secret ) { if ( !(this instanceof Foo) ) { @@ -85,7 +85,7 @@ function Foo( secret ) { } } -var foo = new Foo( 'beep' ); +const foo = new Foo( 'beep' ); foo.secret = 'boop'; ``` diff --git a/lib/node_modules/@stdlib/utils/dirname/README.md b/lib/node_modules/@stdlib/utils/dirname/README.md index 10c334d48654..29cf3a791c28 100644 --- a/lib/node_modules/@stdlib/utils/dirname/README.md +++ b/lib/node_modules/@stdlib/utils/dirname/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dirname = require( '@stdlib/utils/dirname' ); +const dirname = require( '@stdlib/utils/dirname' ); ``` #### dirname( path ) @@ -35,7 +35,7 @@ var dirname = require( '@stdlib/utils/dirname' ); Returns a [directory name][dirname]. ```javascript -var dir = dirname( './foo/bar/index.js' ); +const dir = dirname( './foo/bar/index.js' ); // returns './foo/bar' ``` @@ -52,26 +52,19 @@ var dir = dirname( './foo/bar/index.js' ); ```javascript -var statSync = require( 'fs' ).statSync; -var path = require( 'path' ); -var readDir = require( '@stdlib/fs/read-dir' ).sync; -var dirname = require( '@stdlib/utils/dirname' ); - -var files; -var fpath; -var base; -var stat; -var dir; -var i; - -base = path.resolve( __dirname, '..' ); -files = readDir( base ); - -for ( i = 0; i < files.length; i++ ) { - fpath = path.join( base, files[ i ] ); - stat = statSync( fpath ); +const statSync = require( 'fs' ).statSync; +const path = require( 'path' ); +const readDir = require( '@stdlib/fs/read-dir' ).sync; +const dirname = require( '@stdlib/utils/dirname' ); + +const base = path.resolve( __dirname, '..' ); +const files = readDir( base ); + +for ( let i = 0; i < files.length; i++ ) { + const fpath = path.join( base, files[ i ] ); + const stat = statSync( fpath ); if ( !stat.isDirectory() ) { - dir = dirname( fpath ); + const dir = dirname( fpath ); console.log( '%s --> %s', fpath, dir ); } } diff --git a/lib/node_modules/@stdlib/utils/do-until-each-right/README.md b/lib/node_modules/@stdlib/utils/do-until-each-right/README.md index bbfbb8f50171..3604d3e084e9 100644 --- a/lib/node_modules/@stdlib/utils/do-until-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/do-until-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doUntilEachRight = require( '@stdlib/utils/do-until-each-right' ); +const doUntilEachRight = require( '@stdlib/utils/do-until-each-right' ); ``` #### doUntilEachRight( collection, fcn, predicate\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; doUntilEachRight( arr, log, predicate ); /* => @@ -81,7 +81,7 @@ function log( value, index ) { console.log( '%s: %s', index, value ); } -var arr = []; +const arr = []; doUntilEachRight( arr, log, predicate ); /* => @@ -92,8 +92,8 @@ doUntilEachRight( arr, log, predicate ); Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function predicate( value ) { return ( value !== value ); @@ -147,16 +147,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; doUntilEachRight( arr, sum, predicate, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 3.0 ``` @@ -187,7 +187,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; doUntilEachRight( arr, log, predicate ); /* => @@ -213,14 +213,12 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var doUntilEachRight = require( '@stdlib/utils/do-until-each-right' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const doUntilEachRight = require( '@stdlib/utils/do-until-each-right' ); -var arr; -var i; -var j; +let i; function predicate( value ) { return ( value !== value ); @@ -236,8 +234,9 @@ function log( value, index, collection ) { } } -arr = new Array( 100 ); -j = floor( randu()*arr.length ); +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); + for ( i = arr.length-1; i >= 0; i-- ) { if ( i === j ) { arr[ i ] = NaN; diff --git a/lib/node_modules/@stdlib/utils/do-until-each/README.md b/lib/node_modules/@stdlib/utils/do-until-each/README.md index 157c94c5ed43..a3bf3626e0f5 100644 --- a/lib/node_modules/@stdlib/utils/do-until-each/README.md +++ b/lib/node_modules/@stdlib/utils/do-until-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doUntilEach = require( '@stdlib/utils/do-until-each' ); +const doUntilEach = require( '@stdlib/utils/do-until-each' ); ``` #### doUntilEach( collection, fcn, predicate\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; doUntilEach( arr, log, predicate ); /* => @@ -81,7 +81,7 @@ function log( value, index ) { console.log( '%s: %s', index, value ); } -var arr = []; +const arr = []; doUntilEach( arr, log, predicate ); /* => @@ -103,7 +103,7 @@ function log1( value, index, collection ) { } } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; doUntilEach( arr, log1, predicate ); /* => @@ -145,16 +145,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; doUntilEach( arr, sum, predicate, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.0 ``` @@ -185,7 +185,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; doUntilEach( arr, log, predicate ); /* => @@ -211,10 +211,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var doUntilEach = require( '@stdlib/utils/do-until-each' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const doUntilEach = require( '@stdlib/utils/do-until-each' ); function predicate( value ) { return ( value !== value ); @@ -229,13 +229,9 @@ function log( value, index, collection ) { } } -var arr; -var j; -var i; - -arr = new Array( 100 ); -j = floor( randu()*arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); +for ( let i = 0; i < arr.length; i++ ) { if ( i === j ) { arr[ i ] = NaN; } else { diff --git a/lib/node_modules/@stdlib/utils/do-until/README.md b/lib/node_modules/@stdlib/utils/do-until/README.md index 68296d600eb3..a8698cb262f8 100644 --- a/lib/node_modules/@stdlib/utils/do-until/README.md +++ b/lib/node_modules/@stdlib/utils/do-until/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doUntil = require( '@stdlib/utils/do-until' ); +const doUntil = require( '@stdlib/utils/do-until' ); ``` #### doUntil( fcn, predicate\[, thisArg ] ) @@ -78,7 +78,7 @@ function count() { this.count += 1; } -var context = { +const context = { 'count': 0 }; @@ -109,8 +109,8 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var doUntil = require( '@stdlib/utils/do-until' ); +const randu = require( '@stdlib/random/base/randu' ); +const doUntil = require( '@stdlib/utils/do-until' ); function predicate() { return ( randu() <= 0.05 ); diff --git a/lib/node_modules/@stdlib/utils/do-while-each-right/README.md b/lib/node_modules/@stdlib/utils/do-while-each-right/README.md index 885484951783..2d1d8f0e3cb5 100644 --- a/lib/node_modules/@stdlib/utils/do-while-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/do-while-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doWhileEachRight = require( '@stdlib/utils/do-while-each-right' ); +const doWhileEachRight = require( '@stdlib/utils/do-while-each-right' ); ``` #### doWhileEachRight( collection, fcn, predicate\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; doWhileEachRight( arr, log, predicate ); /* => @@ -81,7 +81,7 @@ function log( value, index ) { console.log( '%s: %s', index, value ); } -var arr = []; +const arr = []; doWhileEachRight( arr, log, predicate ); /* => @@ -92,8 +92,8 @@ doWhileEachRight( arr, log, predicate ); Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function predicate( value ) { return ( value === value ); @@ -147,16 +147,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; doWhileEachRight( arr, sum, predicate, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 3.0 ``` @@ -187,7 +187,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; doWhileEachRight( arr, log, predicate ); /* => @@ -213,14 +213,12 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var doWhileEachRight = require( '@stdlib/utils/do-while-each-right' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const doWhileEachRight = require( '@stdlib/utils/do-while-each-right' ); -var arr; -var i; -var j; +let i; function predicate( value ) { return ( value === value ); @@ -236,8 +234,8 @@ function log( value, index, collection ) { } } -arr = new Array( 100 ); -j = floor( randu()*arr.length ); +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); for ( i = arr.length-1; i >= 0; i-- ) { if ( i === j ) { arr[ i ] = NaN; diff --git a/lib/node_modules/@stdlib/utils/do-while-each/README.md b/lib/node_modules/@stdlib/utils/do-while-each/README.md index ec7658863ba5..f4e436256c58 100644 --- a/lib/node_modules/@stdlib/utils/do-while-each/README.md +++ b/lib/node_modules/@stdlib/utils/do-while-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doWhileEach = require( '@stdlib/utils/do-while-each' ); +const doWhileEach = require( '@stdlib/utils/do-while-each' ); ``` #### doWhileEach( collection, fcn, predicate\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; doWhileEach( arr, log, predicate ); /* => @@ -81,7 +81,7 @@ function log( value, index ) { console.log( '%s: %s', index, value ); } -var arr = []; +const arr = []; doWhileEach( arr, log, predicate ); /* => @@ -103,7 +103,7 @@ function log1( value, index, collection ) { } } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; doWhileEach( arr, log1, predicate ); /* => @@ -145,16 +145,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; doWhileEach( arr, sum, predicate, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.0 ``` @@ -185,7 +185,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; doWhileEach( arr, log, predicate ); /* => @@ -211,10 +211,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var doWhileEach = require( '@stdlib/utils/do-while-each' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const doWhileEach = require( '@stdlib/utils/do-while-each' ); function predicate( value ) { return ( value === value ); @@ -229,13 +229,9 @@ function log( value, index, collection ) { } } -var arr; -var j; -var i; - -arr = new Array( 100 ); -j = floor( randu()*arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); +for ( let i = 0; i < arr.length; i++ ) { if ( i === j ) { arr[ i ] = NaN; } else { diff --git a/lib/node_modules/@stdlib/utils/do-while/README.md b/lib/node_modules/@stdlib/utils/do-while/README.md index 4905d5136ebf..0d90da370254 100644 --- a/lib/node_modules/@stdlib/utils/do-while/README.md +++ b/lib/node_modules/@stdlib/utils/do-while/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doWhile = require( '@stdlib/utils/do-while' ); +const doWhile = require( '@stdlib/utils/do-while' ); ``` #### doWhile( fcn, predicate\[, thisArg ] ) @@ -78,7 +78,7 @@ function count() { this.count += 1; } -var context = { +const context = { 'count': 0 }; @@ -109,8 +109,8 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var doWhile = require( '@stdlib/utils/do-while' ); +const randu = require( '@stdlib/random/base/randu' ); +const doWhile = require( '@stdlib/utils/do-while' ); function predicate() { return ( randu() > 0.05 ); diff --git a/lib/node_modules/@stdlib/utils/doubly-linked-list/README.md b/lib/node_modules/@stdlib/utils/doubly-linked-list/README.md index 9803dbf555e2..a569a8836eeb 100644 --- a/lib/node_modules/@stdlib/utils/doubly-linked-list/README.md +++ b/lib/node_modules/@stdlib/utils/doubly-linked-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' ); +const doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' ); ``` #### doublyLinkedList() @@ -45,7 +45,7 @@ var doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' ); Returns a new doubly linked list instance. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns ``` @@ -54,18 +54,18 @@ var list = doublyLinkedList(); Clears a list. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = list.first().value; +let v = list.first().value; // returns 'foo' // Examine the list length: -var len = list.length; +let len = list.length; // returns 2 // Clear all list items: @@ -85,14 +85,14 @@ len = list.length; Returns the first `node`. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = list.first().value; +const v = list.first().value; // returns 'foo' ``` @@ -101,18 +101,18 @@ var v = list.first().value; Inserts a `value` into the list either before or after a provided list `node`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ); // Determine the list length: -var len = list.length; +let len = list.length; // returns 3 // Get the second node: -var node = list.first().next; +const node = list.first().next; // Insert a value after the second node: list.insert( node, 'boop' ); @@ -122,7 +122,7 @@ len = list.length; // returns 4 // Return a list of values: -var values = list.toArray(); +const values = list.toArray(); // returns [ 'foo', 'bar', 'boop', 'beep' ] ``` @@ -134,18 +134,18 @@ The method supports the following insertion locations: By default, the method inserts a `value` into the list **after** a provided list `node`. To insert a value **before** a provided list `node`, invoke the method with the `location` argument equal to `'before'`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ); // Determine the list length: -var len = list.length; +let len = list.length; // returns 3 // Get the second node: -var node = list.first().next; +const node = list.first().next; // Insert a value before the second node: list.insert( node, 'boop', 'before' ); @@ -155,7 +155,7 @@ len = list.length; // returns 4 // Return a list of values: -var values = list.toArray(); +const values = list.toArray(); // returns [ 'foo', 'boop', 'bar', 'beep' ] ``` @@ -164,22 +164,22 @@ var values = list.toArray(); Returns an iterator for iterating over a list. If an environment supports `Symbol.iterator`, the returned iterator is iterable. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Create an iterator: -var it = list.iterator(); +const it = list.iterator(); // Iterate over the list... -var v = it.next().value; +let v = it.next().value; // returns 'foo' v = it.next().value; // returns 'bar' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -191,22 +191,22 @@ The method supports the following iteration directions: By default, the method returns an iterator which iterates over a list from the first value until the last value. To return an iterator which iterates in reverse order, invoke the method with the `direction` argument equal to `'reverse'`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Create an iterator: -var it = list.iterator( 'reverse' ); +const it = list.iterator( 'reverse' ); // Iterate over the list... -var v = it.next().value; +let v = it.next().value; // returns 'bar' v = it.next().value; // returns 'foo' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -217,14 +217,14 @@ var bool = it.next().done; Returns the last `node`. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the last value: -var v = list.last().value; +const v = list.last().value; // returns 'bar' ``` @@ -233,10 +233,10 @@ var v = list.last().value; List length. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Examine the initial list length: -var len = list.length; +let len = list.length; // returns 0 // Add values to the list: @@ -252,13 +252,13 @@ len = list.length; Removes a value from the end of the list. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'bar' // Add a new value to the list: @@ -274,13 +274,13 @@ v = list.pop(); Adds a value to the end of the list. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'bar' // Add a new value to the list: @@ -296,20 +296,20 @@ v = list.pop(); Removes a `node` from the list. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ); // Determine the list length: -var len = list.length; +let len = list.length; // returns 3 // Get the second node: -var node = list.first().next; +const node = list.first().next; // Remove the second node: -var v = list.remove( node ); +const v = list.remove( node ); // returns 'bar' // Determine the list length: @@ -322,13 +322,13 @@ len = list.length; Removes a value from the beginning of the list. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the first value: -var v = list.shift(); +let v = list.shift(); // returns 'foo' // Add a new value to the list: @@ -344,13 +344,13 @@ v = list.shift(); Returns an array of list values. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Get an array of list values: -var vals = list.toArray(); +const vals = list.toArray(); // returns [ 'foo', 'bar' ] ``` @@ -359,13 +359,13 @@ var vals = list.toArray(); Serializes a list as JSON. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Serialize to JSON: -var o = list.toJSON(); +const o = list.toJSON(); // returns { 'type': 'doubly-linked-list', 'data': [ 'foo', 'bar' ] } ``` @@ -376,13 +376,13 @@ var o = list.toJSON(); Adds a value to the beginning of the list. ```javascript -var list = doublyLinkedList(); +const list = doublyLinkedList(); // Add values to the list: list.unshift( 'foo' ).unshift( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'foo' // Add a new value to the list: @@ -406,13 +406,13 @@ v = list.pop(); - To manually traverse a list, use list node `next` and `prev` properties. ```javascript - var list = doublyLinkedList(); + const list = doublyLinkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ).push( 'boop' ); // Get the first list node: - var n = list.first(); + let n = list.first(); // Walk the list forward... while ( n ) { @@ -443,16 +443,10 @@ v = list.pop(); ```javascript -var doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' ); - -var list; -var iter; -var len; -var v; -var i; +const doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' ); // Create a new doubly linked list: -list = doublyLinkedList(); +const list = doublyLinkedList(); // Add some values to the list: list.push( 'foo' ); @@ -461,14 +455,14 @@ list.push( 'beep' ); list.push( 'boop' ); // Peek at the first and last list values: -v = list.first().value; +let v = list.first().value; // returns 'foo' v = list.last().value; // returns 'boop' // Inspect the list length: -len = list.length; +let len = list.length; // returns 4 // Remove the last list value: @@ -480,8 +474,8 @@ len = list.length; // returns 3 // Iterate over the list: -iter = list.iterator(); -for ( i = 0; i < len; i++ ) { +const iter = list.iterator(); +for ( let i = 0; i < len; i++ ) { console.log( 'List value #%d: %s', i+1, iter.next().value ); } diff --git a/lib/node_modules/@stdlib/utils/dsv/README.md b/lib/node_modules/@stdlib/utils/dsv/README.md index c3cc052ef669..ff22b7949c87 100644 --- a/lib/node_modules/@stdlib/utils/dsv/README.md +++ b/lib/node_modules/@stdlib/utils/dsv/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var dsv = require( '@stdlib/utils/dsv' ); +const dsv = require( '@stdlib/utils/dsv' ); ``` #### dsv @@ -35,7 +35,7 @@ var dsv = require( '@stdlib/utils/dsv' ); Namespace of utilities for working with data formatted as delimiter-separated values (DSV). ```javascript -var o = dsv; +const o = dsv; // returns {...} ``` @@ -74,8 +74,8 @@ The namespace contains the following utilities: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var dsv = require( '@stdlib/utils/dsv' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const dsv = require( '@stdlib/utils/dsv' ); console.log( objectKeys( dsv ) ); ``` diff --git a/lib/node_modules/@stdlib/utils/dsv/base/README.md b/lib/node_modules/@stdlib/utils/dsv/base/README.md index fd7e30b53054..699074486fbd 100644 --- a/lib/node_modules/@stdlib/utils/dsv/base/README.md +++ b/lib/node_modules/@stdlib/utils/dsv/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var base = require( '@stdlib/utils/dsv/base' ); +const base = require( '@stdlib/utils/dsv/base' ); ``` #### base @@ -35,7 +35,7 @@ var base = require( '@stdlib/utils/dsv/base' ); Namespace of base utilities for working with data formatted as delimiter-separated values (DSV). ```javascript -var o = base; +const o = base; // returns {...} ``` @@ -64,8 +64,8 @@ The namespace contains the following utilities: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var base = require( '@stdlib/utils/dsv/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const base = require( '@stdlib/utils/dsv/base' ); console.log( objectKeys( base ) ); ``` diff --git a/lib/node_modules/@stdlib/utils/dsv/base/parse/README.md b/lib/node_modules/@stdlib/utils/dsv/base/parse/README.md index 7352c3377fbb..9306f15b4b73 100644 --- a/lib/node_modules/@stdlib/utils/dsv/base/parse/README.md +++ b/lib/node_modules/@stdlib/utils/dsv/base/parse/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Parser = require( '@stdlib/utils/dsv/base/parse' ); +const Parser = require( '@stdlib/utils/dsv/base/parse' ); ``` #### Parser( \[options] ) @@ -45,7 +45,7 @@ var Parser = require( '@stdlib/utils/dsv/base/parse' ); Returns an incremental parser for delimiter-separated values (DSV). ```javascript -var parse = new Parser(); +const parse = new Parser(); // Parse a line of comma-separated values (CSV): parse.next( '1,2,3,4\r\n' ); // => [ '1', '2', '3', '4' ] @@ -153,7 +153,7 @@ The constructor accepts the following `options`: The parser does **not** perform field conversion/transformation and, instead, is solely responsible for incrementally identifying fields and records. Further processing of fields/records is the responsibility of parser consumers who are generally expected to provide either an `onColumn` callback, an `onRow` callback, or both. ```javascript -var format = require( '@stdlib/string/format' ); +const format = require( '@stdlib/string/format' ); function onColumn( field, row, col ) { console.log( format( 'Row: %d. Column: %d. Value: %s', row, col, field ) ); @@ -163,11 +163,11 @@ function onRow( record, row, ncols ) { console.log( format( 'Row: %d. nFields: %d. Value: | %s |', row, ncols, record.join( ' | ' ) ) ); } -var opts = { +const opts = { 'onColumn': onColumn, 'onRow': onRow }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); parse.next( '1,2,3,4\r\n' ); // => [ '1', '2', '3', '4' ] parse.next( '5,6,7,8\r\n' ); // => [ '5', '6', '7', '8' ] @@ -178,16 +178,16 @@ parse.next( '5,6,7,8\r\n' ); // => [ '5', '6', '7', '8' ] Upon closing the parser, the parser invokes an `onClose` callback with any partially processed (i.e., incomplete) **field** data. Note, however, that the field data may **not** equal the original character sequence, as escape sequences may have already been removed. ```javascript -var format = require( '@stdlib/string/format' ); +const format = require( '@stdlib/string/format' ); function onClose( v ) { console.log( format( 'Incomplete: %s', v ) ); } -var opts = { +const opts = { 'onClose': onClose }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); parse.next( '1,2,3,4\r\n' ); // => [ '1', '2', '3', '4' ] @@ -203,11 +203,11 @@ parse.close(); By default, the parser assumes [RFC 4180][rfc-4180]-compliant newline-delimited comma separated values (CSV). To specify alternative separators, specify the relevant options. ```javascript -var opts = { +const opts = { 'delimiter': '--', 'newline': '%%' }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); parse.next( '1--2--3--4%%' ); // => [ '1', '2', '3', '4' ] parse.next( '5--6--7--8%%' ); // => [ '5', '6', '7', '8' ] @@ -221,7 +221,7 @@ By default, the parser escapes double (i.e., two consecutive) quote character se ```javascript // Default parser: -var parse = new Parser(); +let parse = new Parser(); // Parse DSV using double quoting: parse.next( '1,"""2""",3,4\r\n' ); // => [ '1', '"2"', '3', '4' ] @@ -229,7 +229,7 @@ parse.next( '1,"""2""",3,4\r\n' ); // => [ '1', '"2"', '3', '4' ] // ... // Create a parser which uses a custom escape sequence within quoted fields: -var opts = { +const opts = { 'doublequote': false, 'escape': '\\' }; @@ -242,14 +242,14 @@ When `quoting` is `true`, the parser identifies a quote character sequence at th ```javascript // Default parser; -var parse = new Parser(); +let parse = new Parser(); parse.next( '1,"2",3,4\r\n' ); // => [ '1', '2', '3', '4' ] // ... // Create a parser which treats quote sequences as normal field text: -var opts = { +const opts = { 'quoting': false }; parse = new Parser( opts ); @@ -260,10 +260,10 @@ parse.next( '1,"2",3,4\r\n' ); // => [ '1', '"2"', '3', '4' ] To parse DSV containing commented lines, specify a comment character sequence which demarcates the beginning of a commented line. ```javascript -var opts = { +const opts = { 'comment': '#' }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); parse.next( '1,2,3,4\r\n' ); // => [ '1', '2', '3', '4' ] parse.next( '# This is a commented line.\r\n' ); // comment @@ -273,10 +273,10 @@ parse.next( '9,10,11,12\r\n' ); // => [ '9', '10', '11', '12' ] To parse DSV containing skipped lines, specify a skip character sequence which demarcates the beginning of a skipped line. ```javascript -var opts = { +const opts = { 'skip': '//' }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); parse.next( '1,2,3,4\r\n' ); // => [ '1', '2', '3', '4' ] parse.next( '//5,6,7,8\r\n' ); // skipped line @@ -292,13 +292,13 @@ parse.next( '9,10,11,12\r\n' ); // => [ '9', '10', '11', '12' ] **Read-only** property indicating whether a parser is able to process new chunks. ```javascript -var parse = new Parser(); +const parse = new Parser(); parse.next( '1,2,3,4\r\n' ); // ... -var b = parse.done; +let b = parse.done; // returns false // ... @@ -320,7 +320,7 @@ b = parse.done; Incrementally parses the next chunk. ```javascript -var parse = new Parser(); +const parse = new Parser(); parse.next( '1,2,3,4\r\n' ); @@ -336,7 +336,7 @@ parse.next( '5,6,7,8\r\n' ); Closes the parser. ```javascript -var parse = new Parser(); +const parse = new Parser(); parse.next( '1,2,3,4\r\n' ); @@ -384,8 +384,8 @@ After closing a parser, a parser raises an exception upon receiving any addition ```javascript -var format = require( '@stdlib/string/format' ); -var Parser = require( '@stdlib/utils/dsv/base/parse' ); +const format = require( '@stdlib/string/format' ); +const Parser = require( '@stdlib/utils/dsv/base/parse' ); function onColumn( v, row, col ) { console.log( format( 'Row: %d. Column: %d. Value: %s', row, col, v ) ); @@ -415,7 +415,7 @@ function onClose( v ) { console.log( format( 'End: %s', v || '(none)' ) ); } -var opts = { +const opts = { 'strict': false, 'newline': '\r\n', 'delimiter': ',', @@ -432,9 +432,9 @@ var opts = { 'onWarn': onWarn, 'onClose': onClose }; -var parse = new Parser( opts ); +const parse = new Parser( opts ); -var str = [ +let str = [ [ '1', '2', '3', '4' ], [ '5', '6', '7', '8' ], [ 'foo\\,', 'bar\\ ,', 'beep\\,', 'boop\\,' ], @@ -446,8 +446,7 @@ var str = [ [ '"foo"', '"bar\\ "', '"beep"', '"boop"' ], [ ' # 😃', ' # 🥳', ' # 😮', ' # 🤠' ] ]; -var i; -for ( i = 0; i < str.length; i++ ) { +for ( let i = 0; i < str.length; i++ ) { str[ i ] = str[ i ].join( opts.delimiter ); } str = str.join( opts.newline ); diff --git a/lib/node_modules/@stdlib/utils/entries-in/README.md b/lib/node_modules/@stdlib/utils/entries-in/README.md index 0b2f4d32e27f..2b82423a8618 100644 --- a/lib/node_modules/@stdlib/utils/entries-in/README.md +++ b/lib/node_modules/@stdlib/utils/entries-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectEntriesIn = require( '@stdlib/utils/entries-in' ); +const objectEntriesIn = require( '@stdlib/utils/entries-in' ); ``` #### objectEntriesIn( obj ) @@ -42,9 +42,9 @@ function Foo() { Foo.prototype.b = 2; -var obj = new Foo(); +const obj = new Foo(); -var entries = objectEntriesIn( obj ); +const entries = objectEntriesIn( obj ); // e.g., returns [ ['a', 1], ['b', 2] ] ``` @@ -69,7 +69,7 @@ var entries = objectEntriesIn( obj ); ```javascript -var objectEntriesIn = require( '@stdlib/utils/entries-in' ); +const objectEntriesIn = require( '@stdlib/utils/entries-in' ); function Foo() { this.beep = 'boop'; @@ -81,8 +81,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var entries = objectEntriesIn( obj ); +const obj = new Foo(); +const entries = objectEntriesIn( obj ); console.log( entries ); // e.g., => [ ['beep', 'boop'], ['a', {'b':'c'}], ['foo', [ 'bar' ]] ] diff --git a/lib/node_modules/@stdlib/utils/entries/README.md b/lib/node_modules/@stdlib/utils/entries/README.md index a5cce66fe943..0cda5d59ce32 100644 --- a/lib/node_modules/@stdlib/utils/entries/README.md +++ b/lib/node_modules/@stdlib/utils/entries/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectEntries = require( '@stdlib/utils/entries' ); +const objectEntries = require( '@stdlib/utils/entries' ); ``` #### objectEntries( obj ) @@ -35,12 +35,12 @@ var objectEntries = require( '@stdlib/utils/entries' ); Returns an `array` of an object's own enumerable property `[key, value]` pairs. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var entries = objectEntries( obj ); +const entries = objectEntries( obj ); // e.g., returns [ ['a', 1], ['b', 2] ] ``` @@ -65,9 +65,9 @@ var entries = objectEntries( obj ); ```javascript -var objectEntries = require( '@stdlib/utils/entries' ); +const objectEntries = require( '@stdlib/utils/entries' ); -var obj = { +const obj = { 'beep': 'boop', 'a': { 'b': 'c' @@ -75,7 +75,7 @@ var obj = { 'foo': [ 'bar' ] }; -var entries = objectEntries( obj ); +const entries = objectEntries( obj ); // e.g., returns [ ['beep', 'boop'], ['a', {'b':'c'}], ['foo', [ 'bar' ]] ] ``` diff --git a/lib/node_modules/@stdlib/utils/enumerable-properties-in/README.md b/lib/node_modules/@stdlib/utils/enumerable-properties-in/README.md index 2c82daf96cf7..8eaf28166a88 100644 --- a/lib/node_modules/@stdlib/utils/enumerable-properties-in/README.md +++ b/lib/node_modules/@stdlib/utils/enumerable-properties-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' ); +const enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' ); ``` #### enumerablePropertiesIn( obj ) @@ -35,11 +35,11 @@ var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' ) Returns an `array` of an object's own and inherited enumerable property names and [symbols][@stdlib/symbol/ctor]. ```javascript -var obj = { +const obj = { 'a': 'a' }; -var props = enumerablePropertiesIn( obj ); +const props = enumerablePropertiesIn( obj ); // returns [ 'a' ] ``` @@ -60,11 +60,11 @@ var props = enumerablePropertiesIn( obj ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'b'; @@ -79,8 +79,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'foo' ) ] = 'bar'; } -var obj = new Foo(); -var props = enumerablePropertiesIn( obj ); +const obj = new Foo(); +const props = enumerablePropertiesIn( obj ); // e.g., returns [ 'a', 'foo', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/enumerable-properties/README.md b/lib/node_modules/@stdlib/utils/enumerable-properties/README.md index 95b8bdfbe9a2..ca41dfceaf1a 100644 --- a/lib/node_modules/@stdlib/utils/enumerable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/enumerable-properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var enumerableProperties = require( '@stdlib/utils/enumerable-properties' ); +const enumerableProperties = require( '@stdlib/utils/enumerable-properties' ); ``` #### enumerableProperties( obj ) @@ -35,12 +35,12 @@ var enumerableProperties = require( '@stdlib/utils/enumerable-properties' ); Returns an `array` of an object's own enumerable property names and symbols. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var props = enumerableProperties( obj ); +const props = enumerableProperties( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -65,14 +65,12 @@ var props = enumerableProperties( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var enumerableProperties = require( '@stdlib/utils/enumerable-properties' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const enumerableProperties = require( '@stdlib/utils/enumerable-properties' ); -var hasSymbols = hasSymbolSupport(); -var props; -var obj; +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -99,8 +97,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'c' ) ] = 'c'; } -obj = new Foo(); -props = enumerableProperties( obj ); +const obj = new Foo(); +const props = enumerableProperties( obj ); console.log( props ); // e.g., => [ 'a', ... ] diff --git a/lib/node_modules/@stdlib/utils/enumerable-property-symbols-in/README.md b/lib/node_modules/@stdlib/utils/enumerable-property-symbols-in/README.md index 487fb0b48c04..0e1236cc62b9 100644 --- a/lib/node_modules/@stdlib/utils/enumerable-property-symbols-in/README.md +++ b/lib/node_modules/@stdlib/utils/enumerable-property-symbols-in/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' ); +const enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' ); ``` #### enumerablePropertySymbolsIn( obj ) @@ -39,11 +39,11 @@ Returns an `array` of an object's own and inherited enumerable symbol properties ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -54,7 +54,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = enumerablePropertySymbolsIn( obj ); +const symbols = enumerablePropertySymbolsIn( obj ); ``` @@ -80,14 +80,14 @@ var symbols = enumerablePropertySymbolsIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' ); - -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' ); + +const hasSymbols = hasSymbolSupport(); +let symbols; +let obj; function Foo() { if ( hasSymbols ) { diff --git a/lib/node_modules/@stdlib/utils/enumerable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/enumerable-property-symbols/README.md index f787719de17a..5ecdbef71d3e 100644 --- a/lib/node_modules/@stdlib/utils/enumerable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/enumerable-property-symbols/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' ); +const enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' ); ``` #### enumerablePropertySymbols( obj ) @@ -39,11 +39,11 @@ Returns an `array` of an object's own enumerable symbol properties. ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -54,7 +54,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = enumerablePropertySymbols( obj ); +const symbols = enumerablePropertySymbols( obj ); ``` @@ -80,14 +80,14 @@ var symbols = enumerablePropertySymbols( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' ); - -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' ); + +const hasSymbols = hasSymbolSupport(); +let symbols; +let obj; function Foo() { if ( hasSymbols ) { diff --git a/lib/node_modules/@stdlib/utils/escape-regexp-string/README.md b/lib/node_modules/@stdlib/utils/escape-regexp-string/README.md index 0c05e87b4c1b..d5b67bac3054 100644 --- a/lib/node_modules/@stdlib/utils/escape-regexp-string/README.md +++ b/lib/node_modules/@stdlib/utils/escape-regexp-string/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rescape = require( '@stdlib/utils/escape-regexp-string' ); +const rescape = require( '@stdlib/utils/escape-regexp-string' ); ``` #### rescape( str ) @@ -45,7 +45,7 @@ var rescape = require( '@stdlib/utils/escape-regexp-string' ); Escapes a [regular expression][mdn-regexp] `string` or pattern. ```javascript -var str = rescape( '/[A-Z]*/' ); +let str = rescape( '/[A-Z]*/' ); // returns '/\\[A\\-Z\\]\\*/' str = rescape( '[A-Z]*' ); @@ -103,9 +103,9 @@ try { ```javascript -var rescape = require( '@stdlib/utils/escape-regexp-string' ); +const rescape = require( '@stdlib/utils/escape-regexp-string' ); -var out = rescape( '/beep/' ); +let out = rescape( '/beep/' ); // returns '/beep/' out = rescape( 'beep' ); diff --git a/lib/node_modules/@stdlib/utils/eval/README.md b/lib/node_modules/@stdlib/utils/eval/README.md index bad16a452913..9923ca870165 100644 --- a/lib/node_modules/@stdlib/utils/eval/README.md +++ b/lib/node_modules/@stdlib/utils/eval/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var evil = require( '@stdlib/utils/eval' ); +const evil = require( '@stdlib/utils/eval' ); ``` #### evil( str ) @@ -35,7 +35,7 @@ var evil = require( '@stdlib/utils/eval' ); Alias for [`eval`][mdn-eval] global. ```javascript -var v = evil( '5*4*3*2*1' ); +const v = evil( '5*4*3*2*1' ); // returns 120 ``` @@ -60,20 +60,13 @@ var v = evil( '5*4*3*2*1' ); ```javascript -var evil = require( '@stdlib/utils/eval' ); - -var ctors; -var fcn; -var i; +const evil = require( '@stdlib/utils/eval' ); function compile( ctor ) { - var name; - var str; - - name = ctor.match( /^(\w*)Array$/ )[ 1 ]; + let name = ctor.match( /^(\w*)Array$/ )[ 1 ]; name += 'DataArray'; - str = ''; + let str = ''; str += '(function create(){'; str += '"use strict";'; str += 'class '+name+' extends '+ctor+'{'; @@ -86,7 +79,7 @@ function compile( ctor ) { return str; } -ctors = [ +const ctors = [ 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', @@ -99,8 +92,8 @@ ctors = [ 'Array' ]; -for ( i = 0; i < ctors.length; i++ ) { - fcn = evil( compile( ctors[i] ) ); +for ( let i = 0; i < ctors.length; i++ ) { + const fcn = evil( compile( ctors[i] ) ); console.log( fcn.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/utils/every-by-right/README.md b/lib/node_modules/@stdlib/utils/every-by-right/README.md index f6e201fb70ad..3c1da22c3ad7 100644 --- a/lib/node_modules/@stdlib/utils/every-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/every-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyByRight = require( '@stdlib/utils/every-by-right' ); +const everyByRight = require( '@stdlib/utils/every-by-right' ); ``` #### everyByRight( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var bool = everyByRight( arr, isPositive ); +const bool = everyByRight( arr, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, -2, 3, 4 ]; +const arr = [ 1, -2, 3, 4 ]; -var bool = everyByRight( arr, isPositive ); +const bool = everyByRight( arr, isPositive ); // returns false ``` @@ -86,17 +86,17 @@ function sum( value ) { return true; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = everyByRight( arr, sum, context ); +const bool = everyByRight( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function untrue() { return false; } - var bool = everyByRight( [], untrue ); + const bool = everyByRight( [], untrue ); // returns true ``` @@ -134,9 +134,9 @@ var mean = context.sum / context.count; return true; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var bool = everyByRight( arr, log ); + const bool = everyByRight( arr, log ); /* => 3: 4 2: undefined @@ -160,23 +160,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var everyByRight = require( '@stdlib/utils/every-by-right' ); +const randu = require( '@stdlib/random/base/randu' ); +const everyByRight = require( '@stdlib/utils/every-by-right' ); function isPositive( value ) { return ( value > 0 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = everyByRight( arr, isPositive ); +const bool = everyByRight( arr, isPositive ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/every-by/README.md b/lib/node_modules/@stdlib/utils/every-by/README.md index 934c22ca3fc8..dd08f65b4c8b 100644 --- a/lib/node_modules/@stdlib/utils/every-by/README.md +++ b/lib/node_modules/@stdlib/utils/every-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyBy = require( '@stdlib/utils/every-by' ); +const everyBy = require( '@stdlib/utils/every-by' ); ``` #### everyBy( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var bool = everyBy( arr, isPositive ); +const bool = everyBy( arr, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, -2, 3, 4 ]; +const arr = [ 1, -2, 3, 4 ]; -var bool = everyBy( arr, isPositive ); +const bool = everyBy( arr, isPositive ); // returns false ``` @@ -86,17 +86,17 @@ function sum( value ) { return true; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = everyBy( arr, sum, context ); +const bool = everyBy( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function untrue() { return false; } - var bool = everyBy( [], untrue ); + const bool = everyBy( [], untrue ); // returns true ``` @@ -134,9 +134,9 @@ var mean = context.sum / context.count; return true; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var bool = everyBy( arr, log ); + const bool = everyBy( arr, log ); /* => 0: 1 1: undefined @@ -160,23 +160,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var everyBy = require( '@stdlib/utils/every-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const everyBy = require( '@stdlib/utils/every-by' ); function isPositive( value ) { return ( value > 0 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = everyBy( arr, isPositive ); +const bool = everyBy( arr, isPositive ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/every-in-by/README.md b/lib/node_modules/@stdlib/utils/every-in-by/README.md index dc399f0282f8..8f874dc2a0dd 100644 --- a/lib/node_modules/@stdlib/utils/every-in-by/README.md +++ b/lib/node_modules/@stdlib/utils/every-in-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyInBy = require( '@stdlib/utils/every-in-by' ); +const everyInBy = require( '@stdlib/utils/every-in-by' ); ``` #### everyInBy( object, predicate\[, thisArg ] ) @@ -45,20 +45,17 @@ var everyInBy = require( '@stdlib/utils/every-in-by' ); Tests whether all properties (own and inherited) of an `object` pass a test implemented by a `predicate` function. ```javascript -var o; -var bool; - function isPositive( v ) { return ( v > 0 ); } -o = { +const o = { 'a': 1, 'b': 2, 'c': 3 }; -bool = everyInBy( o, isPositive ); +const bool = everyInBy( o, isPositive ); // returns true ``` @@ -69,7 +66,7 @@ function isPositive(v) { return ( v > 0 ); } -var bool = everyInBy( {}, isPositive ); +const bool = everyInBy( {}, isPositive ); // returns true ``` @@ -86,23 +83,19 @@ var bool = everyInBy( {}, isPositive ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var everyInBy = require( '@stdlib/utils/every-in-by' ); - -var bool; -var o; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const everyInBy = require( '@stdlib/utils/every-in-by' ); function isPositive(v) { return ( v > 0 ); } -o = {}; -for ( i = 0; i < 100; i++ ) { +const o = {}; +for ( let i = 0; i < 100; i++ ) { o[ i ] = ( randu() < 0.95 ); } -bool = everyInBy( o, isPositive ); +const bool = everyInBy( o, isPositive ); // returns ``` @@ -124,16 +117,6 @@ bool = everyInBy( o, isPositive ); -[@stdlib/utils/any-in-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/any-in-by - -[@stdlib/utils/none-in-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/none-in-by - -[@stdlib/utils/some-in-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/some-in-by - -[@stdlib/utils/every-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/every-by - -[@stdlib/utils/every-own-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/every-own-by - diff --git a/lib/node_modules/@stdlib/utils/every-own-by/README.md b/lib/node_modules/@stdlib/utils/every-own-by/README.md index a59f6754a060..2abb6b1684d9 100644 --- a/lib/node_modules/@stdlib/utils/every-own-by/README.md +++ b/lib/node_modules/@stdlib/utils/every-own-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var everyOwnBy = require( '@stdlib/utils/every-own-by' ); +const everyOwnBy = require( '@stdlib/utils/every-own-by' ); ``` #### everyOwnBy( object, predicate\[, thisArg ] ) @@ -49,14 +49,14 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; -var bool = everyOwnBy( obj, isPositive ); +const bool = everyOwnBy( obj, isPositive ); // returns true ``` @@ -67,14 +67,14 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': -2, 'c': 3, 'd': 4 }; -var bool = everyOwnBy( obj, isPositive ); +const bool = everyOwnBy( obj, isPositive ); // returns false ``` @@ -96,21 +96,21 @@ function sum( value ) { return true; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = everyOwnBy( obj, sum, context ); +const bool = everyOwnBy( obj, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2 ``` @@ -133,7 +133,7 @@ var mean = context.sum / context.count; function untrue() { return false; } - var bool = everyOwnBy( {}, untrue ); + const bool = everyOwnBy( {}, untrue ); // returns true ``` @@ -150,22 +150,21 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var everyOwnBy = require( '@stdlib/utils/every-own-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const everyOwnBy = require( '@stdlib/utils/every-own-by' ); function isPositive( value ) { return ( value > 0 ); } -var obj = {}; -var i; +const obj = {}; // Populate object with random values -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { obj[ 'prop_' + i ] = randu(); } -var bool = everyOwnBy( obj, isPositive ); +const bool = everyOwnBy( obj, isPositive ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/every/README.md b/lib/node_modules/@stdlib/utils/every/README.md index 363888176aee..ff0e7204175f 100644 --- a/lib/node_modules/@stdlib/utils/every/README.md +++ b/lib/node_modules/@stdlib/utils/every/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var every = require( '@stdlib/utils/every' ); +const every = require( '@stdlib/utils/every' ); ``` #### every( collection ) @@ -45,16 +45,16 @@ var every = require( '@stdlib/utils/every' ); Tests whether all elements in a `collection` are truthy. ```javascript -var arr = [ 1, 1, 1, 1, 1 ]; +const arr = [ 1, 1, 1, 1, 1 ]; -var bool = every( arr ); +const bool = every( arr ); // returns true ``` If provided an empty `collection`, the function returns `true`. ```javascript -var bool = every( [] ); +const bool = every( [] ); // returns true ``` @@ -84,19 +84,15 @@ var bool = every( [] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var every = require( '@stdlib/utils/every' ); +const randu = require( '@stdlib/random/base/randu' ); +const every = require( '@stdlib/utils/every' ); -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = ( randu() < 0.95 ); } -bool = every( arr ); +const bool = every( arr ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/extname/README.md b/lib/node_modules/@stdlib/utils/extname/README.md index 7910d7eb3463..ba709b155889 100644 --- a/lib/node_modules/@stdlib/utils/extname/README.md +++ b/lib/node_modules/@stdlib/utils/extname/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var extname = require( '@stdlib/utils/extname' ); +const extname = require( '@stdlib/utils/extname' ); ``` #### extname( filename ) @@ -35,7 +35,7 @@ var extname = require( '@stdlib/utils/extname' ); Returns a filename extension. ```javascript -var ext = extname( 'index.js' ); +const ext = extname( 'index.js' ); // returns '.js' ``` @@ -52,26 +52,19 @@ var ext = extname( 'index.js' ); ```javascript -var statSync = require( 'fs' ).statSync; -var path = require( 'path' ); -var readDir = require( '@stdlib/fs/read-dir' ).sync; -var extname = require( '@stdlib/utils/extname' ); - -var files; -var fpath; -var base; -var stat; -var ext; -var i; - -base = path.resolve( __dirname, '..' ); -files = readDir( base ); - -for ( i = 0; i < files.length; i++ ) { - fpath = path.join( base, files[ i ] ); - stat = statSync( fpath ); +const statSync = require( 'fs' ).statSync; +const path = require( 'path' ); +const readDir = require( '@stdlib/fs/read-dir' ).sync; +const extname = require( '@stdlib/utils/extname' ); + +const base = path.resolve( __dirname, '..' ); +const files = readDir( base ); + +for ( let i = 0; i < files.length; i++ ) { + const fpath = path.join( base, files[ i ] ); + const stat = statSync( fpath ); if ( !stat.isDirectory() ) { - ext = extname( fpath ); + const ext = extname( fpath ); console.log( '%s --> %s', fpath, ext || '(no ext)' ); } } diff --git a/lib/node_modules/@stdlib/utils/fifo/README.md b/lib/node_modules/@stdlib/utils/fifo/README.md index f522213f074d..5843b39e7866 100644 --- a/lib/node_modules/@stdlib/utils/fifo/README.md +++ b/lib/node_modules/@stdlib/utils/fifo/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var fifo = require( '@stdlib/utils/fifo' ); +const fifo = require( '@stdlib/utils/fifo' ); ``` #### fifo() @@ -45,7 +45,7 @@ var fifo = require( '@stdlib/utils/fifo' ); Returns a new first-in-first-out (FIFO) queue instance. ```javascript -var queue = fifo(); +const queue = fifo(); // returns ``` @@ -54,18 +54,18 @@ var queue = fifo(); Clears a queue. ```javascript -var queue = fifo(); +const queue = fifo(); // returns // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = queue.first(); +let v = queue.first(); // returns 'foo' // Examine the queue length: -var len = queue.length; +let len = queue.length; // returns 2 // Clear all queue items: @@ -85,14 +85,14 @@ len = queue.length; Returns the "oldest" queue value (i.e., the value which is "first-out"). If the queue is currently empty, the returned value is `undefined`. ```javascript -var queue = fifo(); +const queue = fifo(); // returns // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = queue.first(); +const v = queue.first(); // returns 'foo' ``` @@ -101,22 +101,22 @@ var v = queue.first(); Returns an iterator for iterating over a queue. If an environment supports `Symbol.iterator`, the returned iterator is iterable. ```javascript -var queue = fifo(); +const queue = fifo(); // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Create an iterator: -var it = queue.iterator(); +const it = queue.iterator(); // Iterate over the queue... -var v = it.next().value; +let v = it.next().value; // returns 'foo' v = it.next().value; // returns 'bar' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -127,14 +127,14 @@ var bool = it.next().done; Returns the "newest" queue value (i.e., the value which is "last-out"). If the queue is currently empty, the returned value is `undefined`. ```javascript -var queue = fifo(); +const queue = fifo(); // returns // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Peek at the last value: -var v = queue.last(); +const v = queue.last(); // returns 'bar' ``` @@ -143,10 +143,10 @@ var v = queue.last(); Queue length. ```javascript -var queue = fifo(); +const queue = fifo(); // Examine the initial queue length: -var len = queue.length; +let len = queue.length; // returns 0 // Add values to the queue: @@ -162,13 +162,13 @@ len = queue.length; Removes a value from the queue. If the queue is currently empty, the returned value is `undefined`. ```javascript -var queue = fifo(); +const queue = fifo(); // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Remove the first value: -var v = queue.pop(); +let v = queue.pop(); // returns 'foo' // Add a new value to the queue: @@ -184,13 +184,13 @@ v = queue.pop(); Adds a value to the queue. ```javascript -var queue = fifo(); +const queue = fifo(); // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Remove the first value: -var v = queue.pop(); +let v = queue.pop(); // returns 'foo' // Add a new value to the queue: @@ -206,13 +206,13 @@ v = queue.pop(); Returns an array of queue values. ```javascript -var queue = fifo(); +const queue = fifo(); // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Get an array of queue values: -var vals = queue.toArray(); +const vals = queue.toArray(); // returns [ 'foo', 'bar' ] ``` @@ -221,13 +221,13 @@ var vals = queue.toArray(); Serializes a queue as JSON. ```javascript -var queue = fifo(); +const queue = fifo(); // Add values to the queue: queue.push( 'foo' ).push( 'bar' ); // Serialize to JSON: -var o = queue.toJSON(); +const o = queue.toJSON(); // returns { 'type': 'fifo', 'data': [ 'foo', 'bar' ] } ``` @@ -254,16 +254,10 @@ var o = queue.toJSON(); ```javascript -var fifo = require( '@stdlib/utils/fifo' ); - -var queue; -var iter; -var len; -var v; -var i; +const fifo = require( '@stdlib/utils/fifo' ); // Create a new FIFO queue: -queue = fifo(); +const queue = fifo(); // Add some values to the queue: queue.push( 'foo' ); @@ -272,14 +266,14 @@ queue.push( 'beep' ); queue.push( 'boop' ); // Peek at the first and last queue values: -v = queue.first(); +let v = queue.first(); // returns 'foo' v = queue.last(); // returns 'boop' // Inspect the queue length: -len = queue.length; +let len = queue.length; // returns 4 // Remove the "oldest" queue value: @@ -291,8 +285,8 @@ len = queue.length; // returns 3 // Iterate over the queue: -iter = queue.iterator(); -for ( i = 0; i < len; i++ ) { +const iter = queue.iterator(); +for ( let i = 0; i < len; i++ ) { console.log( 'Queue value #%d: %s', i+1, iter.next().value ); } diff --git a/lib/node_modules/@stdlib/utils/filter-arguments/README.md b/lib/node_modules/@stdlib/utils/filter-arguments/README.md index 363e6eb6f208..2e0727b09262 100644 --- a/lib/node_modules/@stdlib/utils/filter-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/filter-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var filterArguments = require( '@stdlib/utils/filter-arguments' ); +const filterArguments = require( '@stdlib/utils/filter-arguments' ); ``` #### filterArguments( fcn, predicate\[, thisArg] ) @@ -53,9 +53,9 @@ function predicate( v ) { return ( v !== 2 ); } -var bar = filterArguments( foo, predicate ); +const bar = filterArguments( foo, predicate ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 1, 3 ] ``` @@ -82,16 +82,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = filterArguments( foo.scale, predicate, ctx ); +const bar = filterArguments( foo.scale, predicate, ctx ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 10, 60 ] ``` @@ -120,9 +120,9 @@ var out = bar( 1, 2, 3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var filterArguments = require( '@stdlib/utils/filter-arguments' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const filterArguments = require( '@stdlib/utils/filter-arguments' ); function fill( i ) { return i; @@ -137,13 +137,10 @@ function factory( i, j ) { } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); -// Compute the sum of consecutive elements... -var f; -var i; -for ( i = 0; i < x.length-1; i++ ) { - f = filterArguments( add, factory( i, i+2 ) ); +for ( let i = 0; i < x.length-1; i++ ) { + const f = filterArguments( add, factory( i, i+2 ) ); console.log( 'sum(x_%d, x_%d) = %d', i, i+1, f.apply( null, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/utils/find/README.md b/lib/node_modules/@stdlib/utils/find/README.md index 6fb2193e8f86..a9e1326baf12 100644 --- a/lib/node_modules/@stdlib/utils/find/README.md +++ b/lib/node_modules/@stdlib/utils/find/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var find = require( '@stdlib/utils/find' ); +const find = require( '@stdlib/utils/find' ); ``` #### find( arr, \[opts,] clbk ) @@ -55,13 +55,13 @@ By default, `k` is the length of `arr` and `returns` is set to `indices`. ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +let data = [ 30, 20, 50, 60, 10 ]; function greaterThan20( val ) { return val > 20; } -var vals = find( data, greaterThan20 ); +let vals = find( data, greaterThan20 ); // returns [ 0, 2, 3 ] data = 'Hello World'; @@ -78,9 +78,9 @@ To limit the number of results and specify that `values` should be returned, ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +const data = [ 30, 20, 50, 60, 10 ]; -var opts = { +const opts = { 'k': 2, 'returns': 'values' }; @@ -89,7 +89,7 @@ function condition( val ) { return val > 20; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); // returns [ 30, 50 ] ``` @@ -98,9 +98,9 @@ If no `array` elements satisfy the test condition, the function returns an empty ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +const data = [ 30, 20, 50, 60, 10 ]; -var opts = { +const opts = { 'k': 2, 'returns': 'values' }; @@ -109,7 +109,7 @@ function condition( val ) { return val > 1000; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); // returns [] ``` @@ -118,9 +118,9 @@ To find the last two values satisfying a search condition, ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +const data = [ 30, 20, 50, 60, 10 ]; -var opts = { +const opts = { 'k': -2, 'returns': 'values' }; @@ -129,7 +129,7 @@ function condition( val ) { return val > 20; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); // returns [ 60, 50 ] ``` @@ -138,9 +138,9 @@ To explicitly specify that only indices are returned, ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +const data = [ 30, 20, 50, 60, 10 ]; -var opts = { +const opts = { 'k': -2, 'returns': 'indices' }; @@ -149,7 +149,7 @@ function condition( val ) { return val > 20; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); // returns [ 3, 2 ] ``` @@ -158,9 +158,9 @@ And to return both indices and values as index-value pairs, ```javascript -var data = [ 30, 20, 50, 60, 10 ]; +const data = [ 30, 20, 50, 60, 10 ]; -var opts = { +const opts = { 'k': -2, 'returns': '*' }; @@ -169,7 +169,7 @@ function condition( val ) { return val > 20; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); // returns [ [3, 60], [2, 50] ] ``` @@ -186,19 +186,18 @@ var vals = find( data, opts, condition ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var find = require( '@stdlib/utils/find' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const find = require( '@stdlib/utils/find' ); // Simulate the data... -var data = new Array( 100 ); -var i; -for ( i = 0; i < data.length; i++ ) { +const data = new Array( 100 ); +for ( let i = 0; i < data.length; i++ ) { data[ i ] = round( randu*100 ); } // Find the first 10 values greater than 25... -var opts = { +const opts = { 'k': 10, 'returns': '*' }; @@ -207,7 +206,7 @@ function condition( val ) { return val > 25; } -var vals = find( data, opts, condition ); +const vals = find( data, opts, condition ); console.log( vals.join( '\n' ) ); ``` diff --git a/lib/node_modules/@stdlib/utils/flatten-array/README.md b/lib/node_modules/@stdlib/utils/flatten-array/README.md index ae87d2644cfd..eda86bc93855 100644 --- a/lib/node_modules/@stdlib/utils/flatten-array/README.md +++ b/lib/node_modules/@stdlib/utils/flatten-array/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flattenArray = require( '@stdlib/utils/flatten-array' ); +const flattenArray = require( '@stdlib/utils/flatten-array' ); ``` #### flattenArray( arr\[, options] ) @@ -35,9 +35,9 @@ var flattenArray = require( '@stdlib/utils/flatten-array' ); Flattens an array. ```javascript -var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; +const arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; -var out = flattenArray( arr ); +const out = flattenArray( arr ); // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ``` @@ -49,29 +49,29 @@ The function accepts the following `options`: To flatten to a specified depth, set the `depth` option. ```javascript -var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; +const arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; -var out = flattenArray( arr, { +const out = flattenArray( arr, { 'depth': 2 }); // returns [ 1, 2, 3, [4, [5], 6], 7, 8, 9 ] -var bool = ( arr[1][1][1] === out[3] ); +const bool = ( arr[1][1][1] === out[3] ); // returns true ``` To deep [copy][@stdlib/utils/copy] array elements, set the `copy` option to `true`. ```javascript -var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; +const arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ]; -var out = flattenArray( arr, { +const out = flattenArray( arr, { 'depth': 2, 'copy': true }); // returns [ 1, 2, 3, [4, [5], 6], 7, 8, 9 ] -var bool = ( arr[1][1][1] === out[3] ); +const bool = ( arr[1][1][1] === out[3] ); // returns false ``` @@ -80,15 +80,15 @@ var bool = ( arr[1][1][1] === out[3] ); Returns a `function` optimized for flattening arrays having specified dimensions. ```javascript -var flatten = flattenArray.factory( [ 3, 3 ] ); +const flatten = flattenArray.factory( [ 3, 3 ] ); -var arr = [ +let arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]; -var out = flatten( arr ); +let out = flatten( arr ); // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] arr = [ @@ -110,20 +110,20 @@ To deep [copy][@stdlib/utils/copy] array elements, set the `copy` option to `tru ```javascript -var flatten = flattenArray.factory( [ 3, 3 ], { +const flatten = flattenArray.factory( [ 3, 3 ], { 'copy': true }); -var arr = [ +const arr = [ [ 1, 2, 3 ], [ 4, { 'x': 5 }, 6 ], [ 7, 8, 9 ] ]; -var out = flatten( arr ); +const out = flatten( arr ); // returns [ 1, 2, 3, 4, {'x':5}, 6, 7, 8, 9 ] -var bool = ( arr[1][1] === out[4] ); +const bool = ( arr[1][1] === out[4] ); // returns false ``` @@ -151,22 +151,15 @@ var bool = ( arr[1][1] === out[4] ); ```javascript -var flattenArray = require( '@stdlib/utils/flatten-array' ); +const flattenArray = require( '@stdlib/utils/flatten-array' ); function tensor( N, M, L ) { - var tmp1; - var tmp2; - var out; - var i; - var j; - var k; - - out = []; - for ( i = 0; i < N; i++ ) { - tmp1 = []; - for ( j = 0; j < M; j++ ) { - tmp2 = []; - for ( k = 0; k < L; k++ ) { + const out = []; + for ( let i = 0; i < N; i++ ) { + const tmp1 = []; + for ( let j = 0; j < M; j++ ) { + const tmp2 = []; + for ( let k = 0; k < L; k++ ) { tmp2.push( (M*L*i) + (j*L) + k + 1 ); } tmp1.push( tmp2 ); @@ -177,24 +170,24 @@ function tensor( N, M, L ) { } // Define array dimensions: -var N = 1000; -var M = 100; -var L = 10; +const N = 1000; +const M = 100; +const L = 10; // Create a 3-dimensional nested array: -var data = tensor( N, M, L ); +const data = tensor( N, M, L ); // Create a flattened (strided) array from a 3-dimensional nested array: -var arr = flattenArray( data ); +const arr = flattenArray( data ); // To access the data[4][20][2] element... -var xStride = M * L; -var yStride = L; -var zStride = 1; -var v = arr[ (4*xStride) + (20*yStride) + (2*zStride) ]; +const xStride = M * L; +const yStride = L; +const zStride = 1; +const v = arr[ (4*xStride) + (20*yStride) + (2*zStride) ]; // returns 4203 -var bool = ( data[4][20][2] === v ); +const bool = ( data[4][20][2] === v ); // returns true ``` diff --git a/lib/node_modules/@stdlib/utils/flatten-object/README.md b/lib/node_modules/@stdlib/utils/flatten-object/README.md index 987aa61fdc45..b6a383ef41e8 100644 --- a/lib/node_modules/@stdlib/utils/flatten-object/README.md +++ b/lib/node_modules/@stdlib/utils/flatten-object/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var flattenObject = require( '@stdlib/utils/flatten-object' ); +const flattenObject = require( '@stdlib/utils/flatten-object' ); ``` @@ -37,7 +37,7 @@ var flattenObject = require( '@stdlib/utils/flatten-object' ); Flattens an `object`. ```javascript -var obj = { +const obj = { 'a': { 'b': { 'c': 'd' @@ -45,7 +45,7 @@ var obj = { } }; -var out = flattenObject( obj ); +const out = flattenObject( obj ); // returns { 'a.b.c': 'd' } ``` @@ -59,7 +59,7 @@ The function accepts the following `options`: To flatten to a specified depth, set the `depth` option. ```javascript -var obj = { +const obj = { 'a': { 'b': { 'c': 'd' @@ -67,19 +67,19 @@ var obj = { } }; -var out = flattenObject( obj, { +const out = flattenObject( obj, { 'depth': 1 }); // returns { 'a.b': {'c': 'd'} } -var bool = ( obj.a.b === out['a.b'] ); +const bool = ( obj.a.b === out['a.b'] ); // returns true ``` To deep [copy][@stdlib/utils/copy] property values, set the `copy` option to `true`. ```javascript -var obj = { +const obj = { 'a': { 'b': { 'c': 'd' @@ -87,20 +87,20 @@ var obj = { } }; -var out = flattenObject( obj, { +const out = flattenObject( obj, { 'depth': 1, 'copy': true }); // returns { 'a.b': { 'c': 'd' } } -var bool = ( obj.a.b === out['a.b'] ); +const bool = ( obj.a.b === out['a.b'] ); // returns false ``` To specify a custom key path delimiter, set the `delimiter` option. ```javascript -var obj = { +const obj = { 'a': { 'b': { 'c': 'd' @@ -108,7 +108,7 @@ var obj = { } }; -var out = flattenObject( obj, { +const out = flattenObject( obj, { 'delimiter': '-|-' }); // returns { 'a-|-b-|-c': 'd' } @@ -117,13 +117,13 @@ var out = flattenObject( obj, { By default, the function does **not** flatten `arrays`. To flatten `arrays`, set the `flattenArrays` option to `true`. ```javascript -var obj = { +const obj = { 'a': { 'b': [ 1, 2, 3 ] } }; -var out = flattenObject( obj, { +const out = flattenObject( obj, { 'flattenArrays': true }); // returns { 'a.b.0': 1, 'a.b.1': 2, 'a.b.2': 3 } @@ -134,12 +134,12 @@ var out = flattenObject( obj, { Returns a `function` to flatten an `object`. ```javascript -var flatten = flattenObject.factory({ +const flatten = flattenObject.factory({ 'delimiter': '|', 'flattenArrays': true }); -var obj = { +let obj = { 'a': { 'b': { 'c': 'd' @@ -147,7 +147,7 @@ var obj = { } }; -var out = flatten( obj ); +let out = flatten( obj ); // returns { 'a|b|c': 'd' } obj = { @@ -176,15 +176,15 @@ The function accepts the same `options` as [`flattenObject()`](#flatten-object). ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var string2buffer = require( '@stdlib/buffer/from-string' ); -var flattenObject = require( '@stdlib/utils/flatten-object' ); +const Float64Array = require( '@stdlib/array/float64' ); +const string2buffer = require( '@stdlib/buffer/from-string' ); +const flattenObject = require( '@stdlib/utils/flatten-object' ); function noop() { // Do nothing... } -var obj = { +const obj = { 'a': { 'b': { 'beep': 'boop', @@ -218,7 +218,7 @@ var obj = { } }; -var out = flattenObject( obj, { +const out = flattenObject( obj, { 'depth': 5, 'copy': true, 'flattenArrays': false, diff --git a/lib/node_modules/@stdlib/utils/for-each-right/README.md b/lib/node_modules/@stdlib/utils/for-each-right/README.md index db8e1eecb85f..c17de8330620 100644 --- a/lib/node_modules/@stdlib/utils/for-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/for-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEachRight = require( '@stdlib/utils/for-each-right' ); +const forEachRight = require( '@stdlib/utils/for-each-right' ); ``` #### forEachRight( collection, fcn\[, thisArg ] ) @@ -49,7 +49,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; forEachRight( arr, log ); /* => @@ -69,8 +69,8 @@ The invoked `function` is provided three arguments: Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function log1( value, index, collection ) { console.log( '%s: %d', index, value ); @@ -116,16 +116,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; forEachRight( arr, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -154,7 +154,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; forEachRight( arr, log ); /* => @@ -180,11 +180,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var forEachRight = require( '@stdlib/utils/for-each-right' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const forEachRight = require( '@stdlib/utils/for-each-right' ); -var arr; -var i; +let i; function log( value, index, collection ) { console.log( '%s: %d', index, value ); @@ -196,7 +195,8 @@ function log( value, index, collection ) { } } -arr = new Array( 100 ); +const arr = new Array( 100 ); + for ( i = arr.length-1; i >= 0; i-- ) { arr[ i ] = i; } diff --git a/lib/node_modules/@stdlib/utils/for-each/README.md b/lib/node_modules/@stdlib/utils/for-each/README.md index 5d53a332eb8d..a523579128ef 100644 --- a/lib/node_modules/@stdlib/utils/for-each/README.md +++ b/lib/node_modules/@stdlib/utils/for-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forEach = require( '@stdlib/utils/for-each' ); +const forEach = require( '@stdlib/utils/for-each' ); ``` #### forEach( collection, fcn\[, thisArg ] ) @@ -49,7 +49,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; forEach( arr, log ); /* => @@ -76,7 +76,7 @@ function log1( value, index, collection ) { } } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; forEach( arr, log1 ); /* => @@ -114,16 +114,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; forEach( arr, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -152,7 +152,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; forEach( arr, log ); /* => @@ -178,8 +178,8 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var forEach = require( '@stdlib/utils/for-each' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const forEach = require( '@stdlib/utils/for-each' ); function log( value, index, collection ) { console.log( '%s: %d', index, value ); @@ -190,11 +190,8 @@ function log( value, index, collection ) { } } -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = i; } diff --git a/lib/node_modules/@stdlib/utils/for-in/README.md b/lib/node_modules/@stdlib/utils/for-in/README.md index a3d4565e6fb8..b2da88d16c18 100644 --- a/lib/node_modules/@stdlib/utils/for-in/README.md +++ b/lib/node_modules/@stdlib/utils/for-in/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forIn = require( '@stdlib/utils/for-in' ); +const forIn = require( '@stdlib/utils/for-in' ); ``` #### forIn( obj, fcn\[, thisArg ] ) @@ -58,7 +58,7 @@ function Foo() { Foo.prototype.c = 3; Foo.prototype.d = 4; -var obj = new Foo(); +const obj = new Foo(); forIn( obj, log ); /* e.g., => @@ -83,7 +83,7 @@ function log( value, key ) { return false; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, @@ -102,21 +102,21 @@ function sum( value ) { this.count += 1; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; forIn( obj, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -146,8 +146,8 @@ var mean = context.sum / context.count; ```javascript -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var forIn = require( '@stdlib/utils/for-in' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const forIn = require( '@stdlib/utils/for-in' ); function update( value, key, obj ) { console.log( '%s: %d', key, value ); @@ -160,13 +160,9 @@ function Foo() { Foo.prototype.beep = 3.14; -var obj; -var key; -var i; - -obj = new Foo(); -for ( i = 0; i < 26; i++ ) { - key = fromCodePoint( 97 + i ); +const obj = new Foo(); +for ( let i = 0; i < 26; i++ ) { + const key = fromCodePoint( 97 + i ); obj[ key ] = i; } diff --git a/lib/node_modules/@stdlib/utils/for-own/README.md b/lib/node_modules/@stdlib/utils/for-own/README.md index 6b1a16a267a3..0e3f5217f9a8 100644 --- a/lib/node_modules/@stdlib/utils/for-own/README.md +++ b/lib/node_modules/@stdlib/utils/for-own/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var forOwn = require( '@stdlib/utils/for-own' ); +const forOwn = require( '@stdlib/utils/for-own' ); ``` #### forOwn( obj, fcn\[, thisArg ] ) @@ -49,7 +49,7 @@ function log( value, key ) { console.log( '%s: %d', key, value ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, @@ -79,7 +79,7 @@ function log( value, key ) { return false; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, @@ -98,21 +98,21 @@ function sum( value ) { this.count += 1; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; forOwn( obj, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -143,21 +143,17 @@ var mean = context.sum / context.count; ```javascript -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var forOwn = require( '@stdlib/utils/for-own' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const forOwn = require( '@stdlib/utils/for-own' ); function update( value, key, obj ) { console.log( '%s: %d', key, value ); obj[ key ] *= value; } -var obj; -var key; -var i; - -obj = {}; -for ( i = 0; i < 26; i++ ) { - key = fromCodePoint( 97 + i ); +const obj = {}; +for ( let i = 0; i < 26; i++ ) { + const key = fromCodePoint( 97 + i ); obj[ key ] = i; } diff --git a/lib/node_modules/@stdlib/utils/from-entries/README.md b/lib/node_modules/@stdlib/utils/from-entries/README.md index 233c1d575a36..5166ed18bc5f 100644 --- a/lib/node_modules/@stdlib/utils/from-entries/README.md +++ b/lib/node_modules/@stdlib/utils/from-entries/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectFromEntries = require( '@stdlib/utils/from-entries' ); +const objectFromEntries = require( '@stdlib/utils/from-entries' ); ``` #### objectFromEntries( entries ) @@ -35,9 +35,9 @@ var objectFromEntries = require( '@stdlib/utils/from-entries' ); Returns an `object` created from `[key, value]` pairs. ```javascript -var entries = [ ['a', 1], ['b', 2] ]; +const entries = [ ['a', 1], ['b', 2] ]; -var obj = objectFromEntries( entries ); +const obj = objectFromEntries( entries ); // returns { 'a': 1, 'b': 2 } ``` @@ -58,10 +58,10 @@ var obj = objectFromEntries( entries ); ```javascript -var objectEntries = require( '@stdlib/utils/entries' ); -var objectFromEntries = require( '@stdlib/utils/from-entries' ); +const objectEntries = require( '@stdlib/utils/entries' ); +const objectFromEntries = require( '@stdlib/utils/from-entries' ); -var obj1 = { +const obj1 = { 'beep': 'boop', 'a': { 'b': 'c' @@ -69,10 +69,10 @@ var obj1 = { 'foo': [ 'bar' ] }; -var entries = objectEntries( obj1 ); +const entries = objectEntries( obj1 ); // e.g., returns [ ['beep', 'boop'], ['a', {'b':'c'}], ['foo', [ 'bar' ]] ] -var obj2 = objectFromEntries( entries ); +const obj2 = objectFromEntries( entries ); /* returns { 'beep': 'boop', diff --git a/lib/node_modules/@stdlib/utils/function-name/README.md b/lib/node_modules/@stdlib/utils/function-name/README.md index dfa50461a285..bd8dac2695cc 100644 --- a/lib/node_modules/@stdlib/utils/function-name/README.md +++ b/lib/node_modules/@stdlib/utils/function-name/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var functionName = require( '@stdlib/utils/function-name' ); +const functionName = require( '@stdlib/utils/function-name' ); ``` #### functionName( fcn ) @@ -37,7 +37,7 @@ Returns the name of a `function`. ```javascript -var v = functionName( Math.sqrt ); +const v = functionName( Math.sqrt ); // returns 'sqrt' ``` @@ -46,7 +46,7 @@ If provided an **anonymous** `function`, the function returns an empty `string` ```javascript -var v = functionName( function () {} ); +const v = functionName( function () {} ); // returns '' || 'anonymous' ``` @@ -88,14 +88,14 @@ try { ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var Buffer = require( '@stdlib/buffer/ctor' ); -var Number = require( '@stdlib/number/ctor' ); -var Boolean = require( '@stdlib/boolean/ctor' ); -var Function = require( '@stdlib/function/ctor' ); -var functionName = require( '@stdlib/utils/function-name' ); - -var v = functionName( Math.sqrt ); +const Float64Array = require( '@stdlib/array/float64' ); +const Buffer = require( '@stdlib/buffer/ctor' ); +const Number = require( '@stdlib/number/ctor' ); +const Boolean = require( '@stdlib/boolean/ctor' ); +const Function = require( '@stdlib/function/ctor' ); +const functionName = require( '@stdlib/utils/function-name' ); + +let v = functionName( Math.sqrt ); // returns 'sqrt' v = functionName( Float64Array ); diff --git a/lib/node_modules/@stdlib/utils/function-sequence/README.md b/lib/node_modules/@stdlib/utils/function-sequence/README.md index 8bebeee4f152..327441ab8bdf 100644 --- a/lib/node_modules/@stdlib/utils/function-sequence/README.md +++ b/lib/node_modules/@stdlib/utils/function-sequence/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var funseq = require( '@stdlib/utils/function-sequence' ); +const funseq = require( '@stdlib/utils/function-sequence' ); ``` #### funseq( ...fcn ) @@ -57,9 +57,9 @@ function c( x ) { return x / 5; } -var f = funseq( a, b, c ); +const f = funseq( a, b, c ); -var z = f( 6 ); // ((2*x)+3)/5 +const z = f( 6 ); // ((2*x)+3)/5 // returns 3 ``` @@ -74,9 +74,9 @@ function b( r ) { return r + 12; } -var f = funseq( a, b ); +const f = funseq( a, b ); -var z = f( 4, 6 ); +const z = f( 4, 6 ); // returns 50 ``` @@ -106,7 +106,7 @@ var z = f( 4, 6 ); ```javascript -var funseq = require( '@stdlib/utils/function-sequence' ); +const funseq = require( '@stdlib/utils/function-sequence' ); function a( x, y ) { return x * y; @@ -120,9 +120,9 @@ function c( r ) { return r / 10; } -var f = funseq( a, b, c ); +const f = funseq( a, b, c ); -var v = f( 5, 3 ); +const v = f( 5, 3 ); // returns 2 ``` diff --git a/lib/node_modules/@stdlib/utils/get-prototype-of/README.md b/lib/node_modules/@stdlib/utils/get-prototype-of/README.md index 3ab6aa84ad05..7555bfadc519 100644 --- a/lib/node_modules/@stdlib/utils/get-prototype-of/README.md +++ b/lib/node_modules/@stdlib/utils/get-prototype-of/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' ); +const getPrototypeOf = require( '@stdlib/utils/get-prototype-of' ); ``` #### getPrototypeOf( value ) @@ -35,7 +35,7 @@ var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' ); Returns the `prototype` of an input `value`. ```javascript -var proto = getPrototypeOf( {} ); +const proto = getPrototypeOf( {} ); // returns {} ``` @@ -50,7 +50,7 @@ var proto = getPrototypeOf( {} ); - In contrast to the native [`Object.getPrototypeOf`][object-get-prototype-of], this function does **not** throw when provided `null` or `undefined`. Instead, similar to when provided any value with **no** inherited properties, the function returns `null`. ```javascript - var proto = getPrototypeOf( Object.create( null ) ); + let proto = getPrototypeOf( Object.create( null ) ); // returns null proto = getPrototypeOf( null ); @@ -63,7 +63,7 @@ var proto = getPrototypeOf( {} ); - Value arguments other than `null` or `undefined` are coerced to `objects`. ```javascript - var proto = getPrototypeOf( 'beep' ); + let proto = getPrototypeOf( 'beep' ); // returns String.prototype proto = getPrototypeOf( 5 ); @@ -85,9 +85,9 @@ var proto = getPrototypeOf( {} ); ```javascript -var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' ); +const getPrototypeOf = require( '@stdlib/utils/get-prototype-of' ); -var proto = getPrototypeOf( 'beep' ); +let proto = getPrototypeOf( 'beep' ); // returns String.prototype proto = getPrototypeOf( 5 ); diff --git a/lib/node_modules/@stdlib/utils/global/README.md b/lib/node_modules/@stdlib/utils/global/README.md index 12a0757c6ef1..2bfd6b00a586 100644 --- a/lib/node_modules/@stdlib/utils/global/README.md +++ b/lib/node_modules/@stdlib/utils/global/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var getGlobal = require( '@stdlib/utils/global' ); +const getGlobal = require( '@stdlib/utils/global' ); ``` #### getGlobal( \[codegen] ) @@ -45,14 +45,14 @@ var getGlobal = require( '@stdlib/utils/global' ); Returns the global object. ```javascript -var g = getGlobal(); +const g = getGlobal(); // returns {...} ``` By default, the function does **not** use code generation when resolving the global object. While code generation is the **most** reliable means for resolving the global object, its use may violate [content security policies][mdn-csp] (CSPs). To use code generation, provide a `codegen` argument equal to `true`. ```javascript -var g = getGlobal( true ); +const g = getGlobal( true ); // returns {...} ``` @@ -77,10 +77,10 @@ var g = getGlobal( true ); ```javascript -var getGlobal = require( '@stdlib/utils/global' ); +const getGlobal = require( '@stdlib/utils/global' ); // Resolve the global object: -var g = getGlobal(); +const g = getGlobal(); // Display the object's contents: console.log( g ); diff --git a/lib/node_modules/@stdlib/utils/group-by/README.md b/lib/node_modules/@stdlib/utils/group-by/README.md index c05d230968f3..08a7dfbfbdc6 100644 --- a/lib/node_modules/@stdlib/utils/group-by/README.md +++ b/lib/node_modules/@stdlib/utils/group-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupBy = require( '@stdlib/utils/group-by' ); +const groupBy = require( '@stdlib/utils/group-by' ); ``` #### groupBy( collection, \[options,] indicator ) @@ -48,9 +48,9 @@ Groups values according to an `indicator` function, which specifies which group function indicator( v ) { return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupBy( arr, indicator ); +const out = groupBy( arr, indicator ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -64,9 +64,9 @@ function indicator( v, i ) { console.log( '%d: %s', i, v ); return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupBy( arr, indicator ); +const out = groupBy( arr, indicator ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -81,12 +81,12 @@ By default, the function returns element values. To return element indices, set function indicator( v ) { return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var opts = { +const opts = { 'returns': 'indices' }; -var out = groupBy( arr, opts, indicator ); +const out = groupBy( arr, opts, indicator ); // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] } ``` @@ -96,12 +96,12 @@ To return index-element pairs, set the `returns` option to `'*'`. function indicator( v ) { return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var opts = { +const opts = { 'returns': '*' }; -var out = groupBy( arr, opts, indicator ); +const out = groupBy( arr, opts, indicator ); // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] } ``` @@ -112,15 +112,15 @@ function indicator( v ) { this.count += 1; return v[ 0 ]; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = groupBy( arr, opts, indicator ); +const out = groupBy( arr, opts, indicator ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } console.log( context.count ); @@ -145,9 +145,9 @@ console.log( context.count ); function indicator( v ) { return {}; } - var arr = [ 'beep', 'boop', 'foo', 'bar' ]; + const arr = [ 'beep', 'boop', 'foo', 'bar' ]; - var out = groupBy( arr, indicator ); + const out = groupBy( arr, indicator ); // returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -166,22 +166,16 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var groupBy = require( '@stdlib/utils/group-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const groupBy = require( '@stdlib/utils/group-by' ); -var vals; -var arr; -var out; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } @@ -191,7 +185,7 @@ function indicator( v ) { } // Compute the groups: -out = groupBy( arr, indicator ); +const out = groupBy( arr, indicator ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/group-in/README.md b/lib/node_modules/@stdlib/utils/group-in/README.md index b6cf5c45db94..109c6d17b579 100644 --- a/lib/node_modules/@stdlib/utils/group-in/README.md +++ b/lib/node_modules/@stdlib/utils/group-in/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupIn = require( '@stdlib/utils/group-in' ); +const groupIn = require( '@stdlib/utils/group-in' ); ``` #### groupIn( obj, \[options,] indicator ) @@ -59,9 +59,9 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var out = groupIn( obj, indicator ); +const out = groupIn( obj, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -86,9 +86,9 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var out = groupIn( obj, indicator ); +const out = groupIn( obj, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -114,12 +114,12 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var opts = { +const opts = { 'returns': 'keys' }; -var out = groupIn( obj, opts, indicator ); +const out = groupIn( obj, opts, indicator ); // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] } ``` @@ -140,12 +140,12 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var opts = { +const opts = { 'returns': '*' }; -var out = groupIn( obj, opts, indicator ); +const out = groupIn( obj, opts, indicator ); // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] } ``` @@ -167,16 +167,16 @@ Foo.prototype = Object.create( null ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; -var obj = new Foo(); +const obj = new Foo(); -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var out = groupIn( obj, opts, indicator ); +const out = groupIn( obj, opts, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } console.log( context.count ); @@ -216,9 +216,9 @@ console.log( context.count ); Foo.prototype.c = 'foo'; Foo.prototype.d = 'bar'; - var obj = new Foo(); + const obj = new Foo(); - var out = groupIn( obj, indicator ); + const out = groupIn( obj, indicator ); // e.g., returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -237,33 +237,26 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var groupIn = require( '@stdlib/utils/group-in' ); - -var key; -var obj; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const groupIn = require( '@stdlib/utils/group-in' ); function Foo() { - var key; - var i; - for ( i = 0; i < 50; i++ ) { - key = fromCodePoint( 147+i ); + for ( let i = 0; i < 50; i++ ) { + const key = fromCodePoint( 147+i ); this[ key ] = randu(); } return this; } Foo.prototype = Object.create( null ); -for ( i = 0; i < 50; i++ ) { - key = fromCodePoint( 97+i ); +for ( let i = 0; i < 50; i++ ) { + const key = fromCodePoint( 97+i ); Foo.prototype[ key ] = randu(); } // Generate a random object: -obj = new Foo(); +const obj = new Foo(); // Compute the groups... function indicator( v ) { @@ -272,7 +265,7 @@ function indicator( v ) { } return 'high'; } -out = groupIn( obj, indicator ); +const out = groupIn( obj, indicator ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/group-own/README.md b/lib/node_modules/@stdlib/utils/group-own/README.md index b899fd162ad8..850990d6bf51 100644 --- a/lib/node_modules/@stdlib/utils/group-own/README.md +++ b/lib/node_modules/@stdlib/utils/group-own/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var groupOwn = require( '@stdlib/utils/group-own' ); +const groupOwn = require( '@stdlib/utils/group-own' ); ``` #### groupOwn( obj, \[options,] indicator ) @@ -48,14 +48,14 @@ Groups an object's **own** property values according to an `indicator` function, function indicator( v ) { return v[ 0 ]; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = groupOwn( obj, indicator ); +const out = groupOwn( obj, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -69,14 +69,14 @@ function indicator( v, k ) { console.log( '%s: %s', k, v ); return v[ 0 ]; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = groupOwn( obj, indicator ); +const out = groupOwn( obj, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -91,17 +91,17 @@ By default, the function returns object values. To return object keys, set the ` function indicator( v ) { return v[ 0 ]; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var opts = { +const opts = { 'returns': 'keys' }; -var out = groupOwn( obj, opts, indicator ); +const out = groupOwn( obj, opts, indicator ); // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] } ``` @@ -111,17 +111,17 @@ To return key-value pairs, set the `returns` option to `'*'`. function indicator( v ) { return v[ 0 ]; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var opts = { +const opts = { 'returns': '*' }; -var out = groupOwn( obj, opts, indicator ); +const out = groupOwn( obj, opts, indicator ); // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] } ``` @@ -132,19 +132,19 @@ function indicator( v ) { this.count += 1; return v[ 0 ]; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var obj = { +const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var out = groupOwn( obj, opts, indicator ); +const out = groupOwn( obj, opts, indicator ); // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } console.log( context.count ); @@ -173,13 +173,13 @@ console.log( context.count ); function indicator( v ) { return {}; } - var obj = { + const obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; - var out = groupOwn( obj, indicator ); + const out = groupOwn( obj, indicator ); // e.g., returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -198,19 +198,14 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var groupOwn = require( '@stdlib/utils/group-own' ); - -var key; -var obj; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const groupOwn = require( '@stdlib/utils/group-own' ); // Generate a random object... -obj = {}; -for ( i = 0; i < 100; i++ ) { - key = fromCodePoint( 97+i ); +const obj = {}; +for ( let i = 0; i < 100; i++ ) { + const key = fromCodePoint( 97+i ); obj[ key ] = randu(); } @@ -222,7 +217,7 @@ function indicator( v ) { } // Compute the groups: -out = groupOwn( obj, indicator ); +const out = groupOwn( obj, indicator ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/group/README.md b/lib/node_modules/@stdlib/utils/group/README.md index e662c68818b1..fdf6b66e276c 100644 --- a/lib/node_modules/@stdlib/utils/group/README.md +++ b/lib/node_modules/@stdlib/utils/group/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var group = require( '@stdlib/utils/group' ); +const group = require( '@stdlib/utils/group' ); ``` #### group( collection, \[options,] groups ) @@ -45,10 +45,10 @@ var group = require( '@stdlib/utils/group' ); Groups values as arrays associated with distinct keys. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var out = group( arr, groups ); +const out = group( arr, groups ); // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] } ``` @@ -59,26 +59,26 @@ The function accepts the following `options`: By default, the function returns element values. To return element indices, set the `returns` option to `'indices'`. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var opts = { +const opts = { 'returns': 'indices' }; -var out = group( arr, opts, groups ); +const out = group( arr, opts, groups ); // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] } ``` To return index-element pairs, set the `returns` option to `'*'`. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var groups = [ 'b', 'b', 'f', 'b' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const groups = [ 'b', 'b', 'f', 'b' ]; -var opts = { +const opts = { 'returns': '*' }; -var out = group( arr, opts, groups ); +const out = group( arr, opts, groups ); // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] } ``` @@ -97,10 +97,10 @@ var out = group( arr, opts, groups ); - Each value in `groups` should resolve to a value which can be serialized as an `object` key. As a counterexample, ```javascript - var arr = [ 'beep', 'boop', 'foo', 'bar' ]; - var groups = [ {}, {}, {}, {} ]; + const arr = [ 'beep', 'boop', 'foo', 'bar' ]; + const groups = [ {}, {}, {}, {} ]; - var out = group( arr, groups ); + const out = group( arr, groups ); // returns { '[object Object]': [ 'beep', 'boop', 'foo', 'bar' ] } ``` @@ -119,34 +119,27 @@ var out = group( arr, opts, groups ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var group = require( '@stdlib/utils/group' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const group = require( '@stdlib/utils/group' ); -var vals; -var arr; -var out; -var g; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } // Randomly assign collection values to groups... -g = new Array( arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const g = new Array( arr.length ); +for ( let i = 0; i < arr.length; i++ ) { g[ i ] = floor( randu()*vals.length ); } // Compute the groups: -out = group( arr, g ); +const out = group( arr, g ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/identity-function/README.md b/lib/node_modules/@stdlib/utils/identity-function/README.md index 10888873da95..571751dd6ab7 100644 --- a/lib/node_modules/@stdlib/utils/identity-function/README.md +++ b/lib/node_modules/@stdlib/utils/identity-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var identity = require( '@stdlib/utils/identity-function' ); +const identity = require( '@stdlib/utils/identity-function' ); ``` #### identity( x ) @@ -35,12 +35,12 @@ var identity = require( '@stdlib/utils/identity-function' ); Returns `x`. ```javascript -var v = identity( 3.14 ); +const v = identity( 3.14 ); // returns 3.14 -var input = []; -var output = identity( input ); -var bool = ( input === output ); +const input = []; +const output = identity( input ); +const bool = ( input === output ); // returns true ``` @@ -55,9 +55,9 @@ var bool = ( input === output ); ```javascript -var identity = require( '@stdlib/utils/identity-function' ); +const identity = require( '@stdlib/utils/identity-function' ); -var v = identity( 3.14 ); +let v = identity( 3.14 ); // returns 3.14 v = identity( true ); diff --git a/lib/node_modules/@stdlib/utils/if-else/README.md b/lib/node_modules/@stdlib/utils/if-else/README.md index 9db97d7666e6..0c5ae47fba50 100644 --- a/lib/node_modules/@stdlib/utils/if-else/README.md +++ b/lib/node_modules/@stdlib/utils/if-else/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ifelse = require( '@stdlib/utils/if-else' ); +const ifelse = require( '@stdlib/utils/if-else' ); ``` #### ifelse( bool, x, y ) @@ -45,7 +45,7 @@ var ifelse = require( '@stdlib/utils/if-else' ); If a condition is truthy, returns `x`; otherwise, returns `y`. ```javascript -var z = ifelse( true, 1.0, -1.0 ); +let z = ifelse( true, 1.0, -1.0 ); // returns 1.0 z = ifelse( false, 1.0, -1.0 ); @@ -73,14 +73,11 @@ z = ifelse( false, 1.0, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ifelse = require( '@stdlib/utils/if-else' ); +const randu = require( '@stdlib/random/base/randu' ); +const ifelse = require( '@stdlib/utils/if-else' ); -var z; -var i; - -for ( i = 0; i < 100; i++ ) { - z = ifelse( randu() > 0.9, 'BOOP', 'beep' ); +for ( let i = 0; i < 100; i++ ) { + const z = ifelse( randu() > 0.9, 'BOOP', 'beep' ); console.log( z ); } ``` diff --git a/lib/node_modules/@stdlib/utils/if-then/README.md b/lib/node_modules/@stdlib/utils/if-then/README.md index 4e1b02feb7a0..2fd5f9d37df0 100644 --- a/lib/node_modules/@stdlib/utils/if-then/README.md +++ b/lib/node_modules/@stdlib/utils/if-then/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var ifthen = require( '@stdlib/utils/if-then' ); +const ifthen = require( '@stdlib/utils/if-then' ); ``` #### ifthen( bool, x, y ) @@ -53,7 +53,7 @@ function y() { return -1.0; } -var z = ifthen( true, x, y ); +let z = ifthen( true, x, y ); // returns 1.0 z = ifthen( false, x, y ); @@ -85,13 +85,10 @@ z = ifthen( false, x, y ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var repeatString = require( '@stdlib/string/repeat' ); -var ifthen = require( '@stdlib/utils/if-then' ); - -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const repeatString = require( '@stdlib/string/repeat' ); +const ifthen = require( '@stdlib/utils/if-then' ); function x() { return repeatString( 'BOOP', ceil( randu()*3.0 ) ); @@ -101,8 +98,8 @@ function y() { return repeatString( 'beep', ceil( randu()*5.0 ) ); } -for ( i = 0; i < 100; i++ ) { - z = ifthen( randu() > 0.9, x, y ); +for ( let i = 0; i < 100; i++ ) { + const z = ifthen( randu() > 0.9, x, y ); console.log( z ); } ``` diff --git a/lib/node_modules/@stdlib/utils/index-of/README.md b/lib/node_modules/@stdlib/utils/index-of/README.md index a7c0ef0cd405..e101304e5f7c 100644 --- a/lib/node_modules/@stdlib/utils/index-of/README.md +++ b/lib/node_modules/@stdlib/utils/index-of/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); +const indexOf = require( '@stdlib/utils/index-of' ); ``` #### indexOf( arr, searchElement\[, fromIndex] ) @@ -35,45 +35,45 @@ var indexOf = require( '@stdlib/utils/index-of' ); Returns the first index at which a given element can be found. ```javascript -var arr = [ 4, 3, 2, 1 ]; +const arr = [ 4, 3, 2, 1 ]; -var idx = indexOf( arr, 3 ); +const idx = indexOf( arr, 3 ); // returns 1 ``` If a `searchElement` is **not** present in an input `array`, the function returns `-1`. ```javascript -var arr = [ 4, 3, 2, 1 ]; +const arr = [ 4, 3, 2, 1 ]; -var idx = indexOf( arr, 5 ); +const idx = indexOf( arr, 5 ); // returns -1 ``` By default, the implementation searches an input `array` starting from the first element. To start searching from a different element, specify a `fromIndex`. ```javascript -var arr = [ 1, 2, 3, 4, 5, 2, 6 ]; +const arr = [ 1, 2, 3, 4, 5, 2, 6 ]; -var idx = indexOf( arr, 2, 3 ); +const idx = indexOf( arr, 2, 3 ); // returns 5 ``` If a `fromIndex` exceeds the input `array` length, the function returns `-1`. ```javascript -var arr = [ 1, 2, 3, 4, 2, 5 ]; +const arr = [ 1, 2, 3, 4, 2, 5 ]; -var idx = indexOf( arr, 2, 10 ); +const idx = indexOf( arr, 2, 10 ); // returns -1 ``` If a `fromIndex` is less than `0`, the starting index is determined relative to the last index (with the last index being equivalent to `fromIndex = -1`). ```javascript -var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ]; +const arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ]; -var idx = indexOf( arr, 2, -4 ); +let idx = indexOf( arr, 2, -4 ); // returns 5 idx = indexOf( arr, 2, -1 ); @@ -83,18 +83,18 @@ idx = indexOf( arr, 2, -1 ); If `fromIndex` is less than `0` **and** its absolute value exceeds the input `array` length, the function searches the entire input `array`. ```javascript -var arr = [ 1, 2, 3, 4, 5, 2, 6 ]; +const arr = [ 1, 2, 3, 4, 5, 2, 6 ]; -var idx = indexOf( arr, 2, -10 ); +const idx = indexOf( arr, 2, -10 ); // returns 1 ``` The first argument is not limited to `arrays`, but may be any [array-like][@stdlib/assert/is-array-like] `object`. ```javascript -var str = 'bebop'; +const str = 'bebop'; -var idx = indexOf( str, 'o' ); +const idx = indexOf( str, 'o' ); // returns 3 ``` @@ -109,9 +109,9 @@ var idx = indexOf( str, 'o' ); - Search is performed using **strict equality** comparison. Thus, ```javascript - var arr = [ 1, [ 1, 2, 3 ], 3 ]; + const arr = [ 1, [ 1, 2, 3 ], 3 ]; - var idx = indexOf( arr, [ 1, 2, 3 ] ); + const idx = indexOf( arr, [ 1, 2, 3 ] ); // returns -1 ``` @@ -119,9 +119,9 @@ var idx = indexOf( str, 'o' ); ```javascript // Locate the first element which is NaN... - var arr = [ 1, NaN, 2, NaN ]; + const arr = [ 1, NaN, 2, NaN ]; - var idx = indexOf( arr, NaN ); + let idx = indexOf( arr, NaN ); // returns 1 // Prototype properties may be searched as well... @@ -135,7 +135,7 @@ var idx = indexOf( str, 'o' ); } Obj.prototype[ 2 ] = 'bop'; - var obj = new Obj(); + const obj = new Obj(); idx = indexOf( obj, 'bop' ); // returns -1 @@ -157,26 +157,20 @@ var idx = indexOf( str, 'o' ); ```javascript -var indexOf = require( '@stdlib/utils/index-of' ); - -var arr; -var obj; -var str; -var idx; -var i; +const indexOf = require( '@stdlib/utils/index-of' ); // Arrays... -arr = new Array( 10 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 10 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = i * 10; } -idx = indexOf( arr, 40 ); +let idx = indexOf( arr, 40 ); console.log( idx ); // => 4 // Array-like objects... -obj = { +const obj = { '0': 'beep', '1': 'boop', '2': 'bap', @@ -190,7 +184,7 @@ console.log( idx ); // => 2 // Strings... -str = 'beepboopbop'; +const str = 'beepboopbop'; idx = indexOf( str, 'o' ); diff --git a/lib/node_modules/@stdlib/utils/inherit/README.md b/lib/node_modules/@stdlib/utils/inherit/README.md index 0445c9adfec4..a263bc588f5b 100644 --- a/lib/node_modules/@stdlib/utils/inherit/README.md +++ b/lib/node_modules/@stdlib/utils/inherit/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); ``` #### inherit( ctor, superCtor ) @@ -82,7 +82,7 @@ inherit( Bar, Foo ); ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Foo() { return this; @@ -101,9 +101,9 @@ function Bar() { // Set up prototypical inheritance: inherit( Bar, Foo ); -var bar = new Bar(); +const bar = new Bar(); -var bool = ( bar instanceof Bar ); +let bool = ( bar instanceof Bar ); // returns true bool = ( bar instanceof Foo ); diff --git a/lib/node_modules/@stdlib/utils/inherited-enumerable-properties/README.md b/lib/node_modules/@stdlib/utils/inherited-enumerable-properties/README.md index 9a3f7b9d6aa5..1a148abcbe83 100644 --- a/lib/node_modules/@stdlib/utils/inherited-enumerable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-enumerable-properties/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' ); +const inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' ); ``` #### inheritedEnumerableProperties( obj\[, level] ) @@ -39,7 +39,7 @@ Returns an `array` of an object's inherited enumerable property names and [symbo ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.a = 'b'; @@ -48,8 +48,8 @@ function Foo() { Foo.prototype.beep = 'boop'; -var f = new Foo(); -var props = inheritedEnumerableProperties( f ); +const f = new Foo(); +const props = inheritedEnumerableProperties( f ); // returns [ 'beep' ] ``` @@ -58,8 +58,8 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inherit = require( '@stdlib/utils/inherit' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -76,8 +76,8 @@ function Foo() { inherit( Foo, Bar ); Foo.prototype.beep = 'boop'; -var f = new Foo(); -var pros = inheritedEnumerableProperties( f, 1 ); +const f = new Foo(); +const pros = inheritedEnumerableProperties( f, 1 ); // returns [ 'beep' ] ``` @@ -104,14 +104,14 @@ var pros = inheritedEnumerableProperties( f, 1 ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' ); - -var hasSymbols = hasSymbolSupport(); -var props; -var obj; +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' ); + +const hasSymbols = hasSymbolSupport(); +let props; +let obj; function Foo() { this.beep = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/inherited-enumerable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/inherited-enumerable-property-symbols/README.md index ab4bd81eed72..78486e592aa0 100644 --- a/lib/node_modules/@stdlib/utils/inherited-enumerable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-enumerable-property-symbols/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' ); +const inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' ); ``` #### inheritedEnumerablePropertySymbols( obj\[, level] ) @@ -39,12 +39,12 @@ Returns an `array` of an object's inherited enumerable [symbol][@stdlib/symbol/c ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var f; +const hasSymbols = hasSymbolSupport(); +let symbols; +let f; function Foo() { if ( hasSymbols ) { @@ -66,7 +66,7 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var symbols = inheritedEnumerablePropertySymbols( [], 1 ); +const symbols = inheritedEnumerablePropertySymbols( [], 1 ); ``` @@ -92,14 +92,14 @@ var symbols = inheritedEnumerablePropertySymbols( [], 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' ); - -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' ); + +const hasSymbols = hasSymbolSupport(); +let symbols; +let obj; function Foo() { this.a = 'a'; diff --git a/lib/node_modules/@stdlib/utils/inherited-keys/README.md b/lib/node_modules/@stdlib/utils/inherited-keys/README.md index 1397b5c78574..5df7120f6226 100644 --- a/lib/node_modules/@stdlib/utils/inherited-keys/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-keys/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inheritedKeys = require( '@stdlib/utils/inherited-keys' ); +const inheritedKeys = require( '@stdlib/utils/inherited-keys' ); ``` #### inheritedKeys( obj\[, level] ) @@ -42,15 +42,15 @@ function Foo() { Foo.prototype.beep = 'boop'; -var f = new Foo(); -var keys = inheritedKeys( f ); +const f = new Foo(); +const keys = inheritedKeys( f ); // returns [ 'beep' ] ``` By default, the function walks an object's entire prototype chain. To limit the inheritance level, provide a `level` argument. ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -67,8 +67,8 @@ function Foo() { inherit( Foo, Bar ); Foo.prototype.beep = 'boop'; -var f = new Foo(); -var keys = inheritedKeys( f, 1 ); +const f = new Foo(); +const keys = inheritedKeys( f, 1 ); // returns [ 'beep' ] ``` @@ -93,8 +93,8 @@ var keys = inheritedKeys( f, 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedKeys = require( '@stdlib/utils/inherited-keys' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedKeys = require( '@stdlib/utils/inherited-keys' ); function Foo() { this.beep = 'boop'; @@ -118,8 +118,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = inheritedKeys( obj ); +const obj = new Foo(); +const keys = inheritedKeys( obj ); console.log( keys ); // => [ 'foo' ] diff --git a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-properties/README.md b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-properties/README.md index 9e5784950f8e..6639390e43e6 100644 --- a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-properties/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' ); +const inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' ); ``` #### inheritedNonEnumerableProperties( obj\[, level] ) @@ -39,7 +39,7 @@ Returns an `array` of an object's inherited non-enumerable property names and [s ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.a = 'b'; @@ -53,8 +53,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var props = inheritedNonEnumerableProperties( f ); +const f = new Foo(); +const props = inheritedNonEnumerableProperties( f ); // e.g., returns [ 'beep', ... ] ``` @@ -63,8 +63,8 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inherit = require( '@stdlib/utils/inherit' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -92,8 +92,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var pros = inheritedNonEnumerableProperties( f, 1 ); +const f = new Foo(); +const pros = inheritedNonEnumerableProperties( f, 1 ); // e.g., returns [ 'beep', ... ] ``` @@ -120,14 +120,14 @@ var pros = inheritedNonEnumerableProperties( f, 1 ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' ); - -var hasSymbols = hasSymbolSupport(); -var props; -var obj; +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' ); + +const hasSymbols = hasSymbolSupport(); +let props; +let obj; function Foo() { this.beep = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-names/README.md b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-names/README.md index b3231b0a98a1..2173b0496c7f 100644 --- a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-names/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-names/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' ); +const inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' ); ``` #### inheritedNonEnumerablePropertyNames( obj\[, level] ) @@ -39,7 +39,7 @@ Returns an `array` of an object's inherited non-enumerable property names. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.a = 'b'; @@ -53,8 +53,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var keys = inheritedNonEnumerablePropertyNames( f ); +const f = new Foo(); +const keys = inheritedNonEnumerablePropertyNames( f ); // e.g., returns [ 'beep', ... ] ``` @@ -63,8 +63,8 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inherit = require( '@stdlib/utils/inherit' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -92,8 +92,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var keys = inheritedNonEnumerablePropertyNames( f, 1 ); +const f = new Foo(); +const keys = inheritedNonEnumerablePropertyNames( f, 1 ); // e.g., returns [ 'beep', ... ] ``` @@ -120,8 +120,8 @@ var keys = inheritedNonEnumerablePropertyNames( f, 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' ); function Foo() { this.beep = 'boop'; @@ -145,8 +145,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = inheritedNonEnumerablePropertyNames( obj ); +const obj = new Foo(); +const keys = inheritedNonEnumerablePropertyNames( obj ); console.log( keys ); // e.g., => [ 'bip', ... ] diff --git a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-symbols/README.md index 490f3773a82f..8e9fac7ce0d9 100644 --- a/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-nonenumerable-property-symbols/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' ); +const inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' ); ``` #### inheritedNonEnumerablePropertySymbols( obj\[, level] ) @@ -39,13 +39,13 @@ Returns an `array` of an object's inherited non-enumerable [symbol][@stdlib/symb ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var f; +const hasSymbols = hasSymbolSupport(); +let symbols; +let f; function Foo() { if ( hasSymbols ) { @@ -77,7 +77,7 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var symbols = inheritedNonEnumerablePropertySymbols( [], 1 ); +const symbols = inheritedNonEnumerablePropertySymbols( [], 1 ); ``` @@ -103,14 +103,14 @@ var symbols = inheritedNonEnumerablePropertySymbols( [], 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' ); - -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' ); + +const hasSymbols = hasSymbolSupport(); +let symbols; +let obj; function Foo() { this.a = 'a'; diff --git a/lib/node_modules/@stdlib/utils/inherited-properties/README.md b/lib/node_modules/@stdlib/utils/inherited-properties/README.md index 0d68325c5bd4..2503afc26f7c 100644 --- a/lib/node_modules/@stdlib/utils/inherited-properties/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inheritedProperties = require( '@stdlib/utils/inherited-properties' ); +const inheritedProperties = require( '@stdlib/utils/inherited-properties' ); ``` #### inheritedProperties( obj\[, level] ) @@ -35,14 +35,14 @@ var inheritedProperties = require( '@stdlib/utils/inherited-properties' ); Returns an `array` of an object's inherited property names and [symbols][@stdlib/symbol/ctor]. ```javascript -var props = inheritedProperties( [ 1, 2, 3 ] ); +const props = inheritedProperties( [ 1, 2, 3 ] ); // returns [...] ``` By default, the function walks an object's entire prototype chain. To limit the inheritance level, provide a `level` argument. ```javascript -var props = inheritedProperties( [ 1, 2, 3 ], 1 ); +const props = inheritedProperties( [ 1, 2, 3 ], 1 ); ``` @@ -62,12 +62,12 @@ var props = inheritedProperties( [ 1, 2, 3 ], 1 ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedProperties = require( '@stdlib/utils/inherited-properties' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedProperties = require( '@stdlib/utils/inherited-properties' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'b'; @@ -106,8 +106,8 @@ if ( hasSymbols ) { }); } -var obj = new Foo(); -var props = inheritedProperties( obj ); +const obj = new Foo(); +const props = inheritedProperties( obj ); // returns [ ..., 'c', 'bip', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/inherited-property-descriptor/README.md b/lib/node_modules/@stdlib/utils/inherited-property-descriptor/README.md index 563c17250289..45ace0c6dabe 100644 --- a/lib/node_modules/@stdlib/utils/inherited-property-descriptor/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-property-descriptor/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' ); +const inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' ); ``` #### inheritedPropertyDescriptor( obj, property\[, level] ) @@ -45,9 +45,9 @@ function Foo() { Foo.prototype.bar = 'foo'; -var obj = new Foo(); +const obj = new Foo(); -var desc = inheritedPropertyDescriptor( obj, 'bar' ); +const desc = inheritedPropertyDescriptor( obj, 'bar' ); // returns {'configurable':true,'enumerable':true,'writable':true,'value':'foo'} ``` @@ -56,7 +56,7 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -71,8 +71,8 @@ function Foo() { inherit( Foo, Bar ); -var f = new Foo(); -var desc = inheritedPropertyDescriptor( f, 'beep', 1 ); +const f = new Foo(); +const desc = inheritedPropertyDescriptor( f, 'beep', 1 ); // returns null ``` @@ -102,8 +102,8 @@ var desc = inheritedPropertyDescriptor( f, 'beep', 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' ); function Foo() { this.beep = 'boop'; @@ -121,8 +121,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = inheritedPropertyDescriptor( obj, 'foo' ); +const obj = new Foo(); +const desc = inheritedPropertyDescriptor( obj, 'foo' ); console.log( desc ); // => {'configurable':true,'enumerable':true,'writable':true,'value':['bar']} diff --git a/lib/node_modules/@stdlib/utils/inherited-property-descriptors/README.md b/lib/node_modules/@stdlib/utils/inherited-property-descriptors/README.md index e9eff47905f7..29afc5a26a1f 100644 --- a/lib/node_modules/@stdlib/utils/inherited-property-descriptors/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-property-descriptors/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' ); +const inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' ); ``` #### inheritedPropertyDescriptors( obj\[, level] ) @@ -46,8 +46,8 @@ function Foo() { Foo.prototype.beep = 'boop'; -var f = new Foo(); -var desc = inheritedPropertyDescriptors( f ); +const f = new Foo(); +const desc = inheritedPropertyDescriptors( f ); // returns { 'beep': {...}, ... } ``` @@ -56,7 +56,7 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -73,8 +73,8 @@ function Foo() { inherit( Foo, Bar ); Foo.prototype.beep = 'boop'; -var f = new Foo(); -var desc = inheritedPropertyDescriptors( f, 1 ); +const f = new Foo(); +const desc = inheritedPropertyDescriptors( f, 1 ); // returns { 'beep': {...}, ... } ``` @@ -101,8 +101,8 @@ var desc = inheritedPropertyDescriptors( f, 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' ); function Foo() { this.beep = 'boop'; @@ -120,8 +120,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = inheritedPropertyDescriptors( obj ); +const obj = new Foo(); +const desc = inheritedPropertyDescriptors( obj ); console.log( desc ); // => { 'foo': {...}, ... } diff --git a/lib/node_modules/@stdlib/utils/inherited-property-names/README.md b/lib/node_modules/@stdlib/utils/inherited-property-names/README.md index 951eea51c546..acc6a21e9d51 100644 --- a/lib/node_modules/@stdlib/utils/inherited-property-names/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-property-names/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' ); +const inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' ); ``` #### inheritedPropertyNames( obj\[, level] ) @@ -42,15 +42,15 @@ function Foo() { Foo.prototype.beep = 'boop'; -var f = new Foo(); -var keys = inheritedPropertyNames( f ); +const f = new Foo(); +const keys = inheritedPropertyNames( f ); // e.g., returns [ 'beep', ... ] ``` By default, the function walks an object's entire prototype chain. To limit the inheritance level, provide a `level` argument. ```javascript -var inherit = require( '@stdlib/utils/inherit' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -67,8 +67,8 @@ function Foo() { inherit( Foo, Bar ); Foo.prototype.beep = 'boop'; -var f = new Foo(); -var keys = inheritedPropertyNames( f, 1 ); +const f = new Foo(); +const keys = inheritedPropertyNames( f, 1 ); // e.g., returns [ 'beep', ... ] ``` @@ -93,8 +93,8 @@ var keys = inheritedPropertyNames( f, 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' ); function Foo() { this.beep = 'boop'; @@ -118,8 +118,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = inheritedPropertyNames( obj ); +const obj = new Foo(); +const keys = inheritedPropertyNames( obj ); console.log( keys ); // e.g., => [ 'foo', 'bip', ... ] diff --git a/lib/node_modules/@stdlib/utils/inherited-property-symbols/README.md b/lib/node_modules/@stdlib/utils/inherited-property-symbols/README.md index a373ad7e96c0..b7f15480e063 100644 --- a/lib/node_modules/@stdlib/utils/inherited-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-property-symbols/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' ); +const inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' ); ``` #### inheritedPropertySymbols( obj\[, level] ) @@ -35,13 +35,13 @@ var inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbol Returns an `array` of an object's inherited [symbol][@stdlib/symbol/ctor] properties. ```javascript -var symbols = inheritedPropertySymbols( [ 1, 2, 3 ] ); +const symbols = inheritedPropertySymbols( [ 1, 2, 3 ] ); ``` By default, the function walks an object's entire prototype chain. To limit the inheritance level, provide a `level` argument. ```javascript -var symbols = inheritedPropertySymbols( [ 1, 2, 3 ], 1 ); +const symbols = inheritedPropertySymbols( [ 1, 2, 3 ], 1 ); ``` @@ -61,11 +61,11 @@ var symbols = inheritedPropertySymbols( [ 1, 2, 3 ], 1 ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -78,8 +78,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'c' ) ] = 'd'; } -var obj = new Foo(); -var symbols = inheritedPropertySymbols( obj ); +const obj = new Foo(); +const symbols = inheritedPropertySymbols( obj ); // e.g., returns [ Symbol(c) ] ``` diff --git a/lib/node_modules/@stdlib/utils/inherited-writable-properties/README.md b/lib/node_modules/@stdlib/utils/inherited-writable-properties/README.md index 5b53f5ee7a22..233f23579ab1 100644 --- a/lib/node_modules/@stdlib/utils/inherited-writable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-writable-properties/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' ); +const inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' ); ``` #### inheritedWritableProperties( obj\[, level] ) @@ -39,7 +39,7 @@ Returns an `array` of an object's inherited writable property names and [symbols ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.a = 'b'; @@ -53,8 +53,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var props = inheritedWritableProperties( f ); +const f = new Foo(); +const props = inheritedWritableProperties( f ); // e.g., returns [ 'beep', ... ] ``` @@ -63,8 +63,8 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inherit = require( '@stdlib/utils/inherit' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -92,8 +92,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var pros = inheritedWritableProperties( f, 1 ); +const f = new Foo(); +const pros = inheritedWritableProperties( f, 1 ); // e.g., returns [ 'beep', ... ] ``` @@ -120,14 +120,14 @@ var pros = inheritedWritableProperties( f, 1 ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' ); - -var hasSymbols = hasSymbolSupport(); -var props; -var obj; +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' ); + +const hasSymbols = hasSymbolSupport(); +let props; +let obj; function Foo() { this.beep = 'boop'; diff --git a/lib/node_modules/@stdlib/utils/inherited-writable-property-names/README.md b/lib/node_modules/@stdlib/utils/inherited-writable-property-names/README.md index 99745372cc2e..6eaffbe559e2 100644 --- a/lib/node_modules/@stdlib/utils/inherited-writable-property-names/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-writable-property-names/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' ); +const inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' ); ``` #### inheritedWritablePropertyNames( obj\[, level] ) @@ -39,7 +39,7 @@ Returns an `array` of an object's inherited writable property names. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); function Foo() { this.a = 'b'; @@ -53,8 +53,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var keys = inheritedWritablePropertyNames( f ); +const f = new Foo(); +const keys = inheritedWritablePropertyNames( f ); // e.g., returns [ 'beep', ... ] ``` @@ -63,8 +63,8 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inherit = require( '@stdlib/utils/inherit' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inherit = require( '@stdlib/utils/inherit' ); function Bar() { return this; @@ -92,8 +92,8 @@ defineProperty( Foo.prototype, 'beep', { 'value': 'boop' }); -var f = new Foo(); -var keys = inheritedWritablePropertyNames( f, 1 ); +const f = new Foo(); +const keys = inheritedWritablePropertyNames( f, 1 ); // e.g., returns [ 'beep', ... ] ``` @@ -120,8 +120,8 @@ var keys = inheritedWritablePropertyNames( f, 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' ); function Foo() { this.a = { @@ -144,8 +144,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = inheritedWritablePropertyNames( obj ); +const obj = new Foo(); +const keys = inheritedWritablePropertyNames( obj ); console.log( keys ); // e.g., => [ 'foo', ... ] diff --git a/lib/node_modules/@stdlib/utils/inherited-writable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/inherited-writable-property-symbols/README.md index 5c1fdfbd40b8..e2f1d4525d84 100644 --- a/lib/node_modules/@stdlib/utils/inherited-writable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/inherited-writable-property-symbols/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' ); +const inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' ); ``` #### inheritedWritablePropertySymbols( obj\[, level] ) @@ -39,13 +39,13 @@ Returns an `array` of an object's inherited writable [symbol][@stdlib/symbol/cto ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var f; +const hasSymbols = hasSymbolSupport(); +let symbols; +let f; function Foo() { if ( hasSymbols ) { @@ -77,7 +77,7 @@ By default, the function walks an object's entire prototype chain. To limit the ```javascript -var symbols = inheritedWritablePropertySymbols( [], 1 ); +const symbols = inheritedWritablePropertySymbols( [], 1 ); ``` @@ -103,14 +103,14 @@ var symbols = inheritedWritablePropertySymbols( [], 1 ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' ); - -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' ); + +const hasSymbols = hasSymbolSupport(); +let symbols; +let obj; function Foo() { this.a = 'a'; diff --git a/lib/node_modules/@stdlib/utils/inmap-right/README.md b/lib/node_modules/@stdlib/utils/inmap-right/README.md index a9dbbe6c7224..af1e26088c40 100644 --- a/lib/node_modules/@stdlib/utils/inmap-right/README.md +++ b/lib/node_modules/@stdlib/utils/inmap-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var inmapRight = require( '@stdlib/utils/inmap-right' ); +const inmapRight = require( '@stdlib/utils/inmap-right' ); ``` #### inmapRight( collection, fcn\[, thisArg ] ) @@ -49,12 +49,12 @@ function scale( value, index ) { return value * index; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = inmapRight( arr, scale ); +const out = inmapRight( arr, scale ); // returns [ 0, 2, 6, 12 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` @@ -67,8 +67,8 @@ The invoked `function` is provided three arguments: Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function scale1( value, index, collection ) { i += 1; @@ -78,7 +78,7 @@ function scale1( value, index, collection ) { return value * index; } -var out = inmapRight( arr, scale1 ); +let out = inmapRight( arr, scale1 ); // returns [ 0, 0, 0, 0, 0, 0, 0, 2, 6, 12 ] function scale2( value, index, collection ) { @@ -101,17 +101,17 @@ function sum( value ) { return value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var out = inmapRight( arr, sum, context ); +const out = inmapRight( arr, sum, context ); // returns [ 1, 2, 3, 4 ] -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -143,9 +143,9 @@ var mean = context.sum / context.count; return value; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var out = inmapRight( arr, log ); + const out = inmapRight( arr, log ); /* => 3: 4 2: undefined @@ -169,14 +169,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var inmapRight = require( '@stdlib/utils/inmap-right' ); - -var bool; -var arr; -var out; -var i; +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const inmapRight = require( '@stdlib/utils/inmap-right' ); +let i; function scale( value, index, collection ) { i += 1; if ( isEven( i ) ) { @@ -187,15 +183,15 @@ function scale( value, index, collection ) { return value * index; } -arr = new Array( 100 ); +const arr = new Array( 100 ); for ( i = 0; i < arr.length; i++ ) { arr[ i ] = i; } i = 0; -out = inmapRight( arr, scale ); +const out = inmapRight( arr, scale ); -bool = ( out === arr ); +const bool = ( out === arr ); console.log( bool ); console.log( out ); diff --git a/lib/node_modules/@stdlib/utils/inmap/README.md b/lib/node_modules/@stdlib/utils/inmap/README.md index ae2c29f73a28..105a5fbc9e85 100644 --- a/lib/node_modules/@stdlib/utils/inmap/README.md +++ b/lib/node_modules/@stdlib/utils/inmap/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var inmap = require( '@stdlib/utils/inmap' ); +const inmap = require( '@stdlib/utils/inmap' ); ``` #### inmap( collection, fcn\[, thisArg ] ) @@ -49,12 +49,12 @@ function scale( value, index ) { return value * index; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = inmap( arr, scale ); +const out = inmap( arr, scale ); // returns [ 0, 2, 6, 12 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` @@ -74,9 +74,9 @@ function scale1( value, index, collection ) { return value * index; } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; -var out = inmap( arr, scale1 ); +let out = inmap( arr, scale1 ); // returns [ 0, 2, 6, 12, 20, 30, 42, 56, 72, 90 ] function scale2( value, index, collection ) { @@ -99,17 +99,17 @@ function sum( value ) { return value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var out = inmap( arr, sum, context ); +const out = inmap( arr, sum, context ); // returns [ 1, 2, 3, 4 ] -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -141,9 +141,9 @@ var mean = context.sum / context.count; return value; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var out = inmap( arr, log ); + const out = inmap( arr, log ); /* => 0: 1 1: undefined @@ -167,13 +167,8 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var inmap = require( '@stdlib/utils/inmap' ); - -var bool; -var arr; -var out; -var i; +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const inmap = require( '@stdlib/utils/inmap' ); function scale( value, index, collection ) { if ( isEven( index ) ) { @@ -184,13 +179,13 @@ function scale( value, index, collection ) { return value * index; } -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = i; } -out = inmap( arr, scale ); +const out = inmap( arr, scale ); -bool = ( out === arr ); +const bool = ( out === arr ); console.log( bool ); console.log( out ); diff --git a/lib/node_modules/@stdlib/utils/key-by-right/README.md b/lib/node_modules/@stdlib/utils/key-by-right/README.md index e10f3a21cfba..be0f47486c73 100644 --- a/lib/node_modules/@stdlib/utils/key-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/key-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var keyByRight = require( '@stdlib/utils/key-by-right' ); +const keyByRight = require( '@stdlib/utils/key-by-right' ); ``` #### keyByRight( collection, fcn\[, thisArg ] ) @@ -51,12 +51,12 @@ function toKey( value ) { return value.a; } -var arr = [ +const arr = [ { 'a': 1 }, { 'a': 2 } ]; -var out = keyByRight( arr, toKey ); +const out = keyByRight( arr, toKey ); // returns { '2': { 'a': 2 }, '1': { 'a': 1 } } ``` @@ -74,17 +74,17 @@ function toKey( value, index ) { return index; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var out = keyByRight( arr, toKey, context ); +const out = keyByRight( arr, toKey, context ); // returns { '3': 4, '2': 3, '1': 2, '0': 1 } -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -115,25 +115,21 @@ var mean = context.sum / context.count; ```javascript -var keyByRight = require( '@stdlib/utils/key-by-right' ); - -var arr; -var obj; -var i; +const keyByRight = require( '@stdlib/utils/key-by-right' ); function toKey( value ) { return value.name; } -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = { 'name': 'v'+i, 'value': i }; } -obj = keyByRight( arr, toKey ); +const obj = keyByRight( arr, toKey ); console.log( obj ); ``` diff --git a/lib/node_modules/@stdlib/utils/key-by/README.md b/lib/node_modules/@stdlib/utils/key-by/README.md index 615592a1ef74..c45a079fdd00 100644 --- a/lib/node_modules/@stdlib/utils/key-by/README.md +++ b/lib/node_modules/@stdlib/utils/key-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var keyBy = require( '@stdlib/utils/key-by' ); +const keyBy = require( '@stdlib/utils/key-by' ); ``` #### keyBy( collection, fcn\[, thisArg ] ) @@ -51,12 +51,12 @@ function toKey( value ) { return value.a; } -var arr = [ +const arr = [ { 'a': 1 }, { 'a': 2 } ]; -var out = keyBy( arr, toKey ); +const out = keyBy( arr, toKey ); // returns { '1': { 'a': 1 }, '2': { 'a': 2 } } ``` @@ -74,17 +74,17 @@ function toKey( value, index ) { return index; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var out = keyBy( arr, toKey, context ); +const out = keyBy( arr, toKey, context ); // returns { '0': 1, '1': 2, '2': 3, '3': 4 } -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -115,18 +115,17 @@ var mean = context.sum / context.count; ```javascript -var keyBy = require( '@stdlib/utils/key-by' ); +const keyBy = require( '@stdlib/utils/key-by' ); -var arr; -var obj; -var i; +let arr; +let obj; function toKey( value ) { return value.name; } arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = { 'name': 'v'+i, 'value': i diff --git a/lib/node_modules/@stdlib/utils/keys-in/README.md b/lib/node_modules/@stdlib/utils/keys-in/README.md index fc1d7c1b3777..b8907ba81653 100644 --- a/lib/node_modules/@stdlib/utils/keys-in/README.md +++ b/lib/node_modules/@stdlib/utils/keys-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var keysIn = require( '@stdlib/utils/keys-in' ); +const keysIn = require( '@stdlib/utils/keys-in' ); ``` #### keysIn( obj ) @@ -42,9 +42,9 @@ function Foo() { Foo.prototype.b = 2; -var obj = new Foo(); +const obj = new Foo(); -var keys = keysIn( obj ); +const keys = keysIn( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -69,7 +69,7 @@ var keys = keysIn( obj ); ```javascript -var keysIn = require( '@stdlib/utils/keys-in' ); +const keysIn = require( '@stdlib/utils/keys-in' ); function Foo() { this.beep = 'boop'; @@ -81,8 +81,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var keys = keysIn( obj ); +const obj = new Foo(); +const keys = keysIn( obj ); console.log( keys ); // e.g., => [ 'beep', 'a', 'foo' ] diff --git a/lib/node_modules/@stdlib/utils/keys/README.md b/lib/node_modules/@stdlib/utils/keys/README.md index 304a78089412..1599a1e7787d 100644 --- a/lib/node_modules/@stdlib/utils/keys/README.md +++ b/lib/node_modules/@stdlib/utils/keys/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); +const objectKeys = require( '@stdlib/utils/keys' ); ``` #### objectKeys( obj ) @@ -35,12 +35,12 @@ var objectKeys = require( '@stdlib/utils/keys' ); Returns an `array` of an object's own enumerable property names. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var keys = objectKeys( obj ); +const keys = objectKeys( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -66,7 +66,7 @@ var keys = objectKeys( obj ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); +const objectKeys = require( '@stdlib/utils/keys' ); function Foo() { this.beep = 'boop'; @@ -78,8 +78,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var keys = objectKeys( obj ); +const obj = new Foo(); +const keys = objectKeys( obj ); console.log( keys ); // e.g., => [ 'beep', 'a' ] diff --git a/lib/node_modules/@stdlib/utils/library-manifest/README.md b/lib/node_modules/@stdlib/utils/library-manifest/README.md index 1d722a205be9..fd97d9223926 100644 --- a/lib/node_modules/@stdlib/utils/library-manifest/README.md +++ b/lib/node_modules/@stdlib/utils/library-manifest/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var manifest = require( '@stdlib/utils/library-manifest' ); +const manifest = require( '@stdlib/utils/library-manifest' ); ``` #### manifest( filepath, conditions\[, options] ) @@ -45,11 +45,11 @@ var manifest = require( '@stdlib/utils/library-manifest' ); Loads a manifest for compiling source files. ```javascript -var conditions = { +const conditions = { 'os': 'linux' }; -var conf = manifest( './examples/manifest.json', conditions ); +const conf = manifest( './examples/manifest.json', conditions ); // returns ``` @@ -61,15 +61,15 @@ The function accepts the following `options`: The default search directory is the current working directory of the calling process. To specify an alternative search directory, set the `basedir` option. ```javascript -var conditions = { +const conditions = { 'os': 'linux' }; -var opts = { +const opts = { 'basedir': __dirname }; -var conf = manifest( './examples/manifest.json', conditions, opts ); +const conf = manifest( './examples/manifest.json', conditions, opts ); // returns ``` @@ -175,24 +175,24 @@ var conf = manifest( './examples/manifest.json', conditions, opts ); ```javascript -var join = require( 'path' ).join; -var manifest = require( '@stdlib/utils/library-manifest' ); +const join = require( 'path' ).join; +const manifest = require( '@stdlib/utils/library-manifest' ); // Resolve the absolute path of the manifest JSON file: -var fpath = join( __dirname, 'examples', 'manifest.json' ); +const fpath = join( __dirname, 'examples', 'manifest.json' ); // Specify conditions for determining which configuration to load: -var conditions = { +const conditions = { 'os': 'mac' }; // Specify options: -var opts = { +const opts = { 'basedir': __dirname }; // Load a manifest configuration: -var conf = manifest( fpath, conditions, opts ); +const conf = manifest( fpath, conditions, opts ); console.dir( conf ); ``` diff --git a/lib/node_modules/@stdlib/utils/linked-list/README.md b/lib/node_modules/@stdlib/utils/linked-list/README.md index 62f10ea6aae4..581a585047c4 100644 --- a/lib/node_modules/@stdlib/utils/linked-list/README.md +++ b/lib/node_modules/@stdlib/utils/linked-list/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var linkedList = require( '@stdlib/utils/linked-list' ); +const linkedList = require( '@stdlib/utils/linked-list' ); ``` #### linkedList() @@ -45,7 +45,7 @@ var linkedList = require( '@stdlib/utils/linked-list' ); Returns a new linked list instance. ```javascript -var list = linkedList(); +const list = linkedList(); // returns ``` @@ -54,18 +54,18 @@ var list = linkedList(); Clears a list. ```javascript -var list = linkedList(); +const list = linkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = list.first().value; +let v = list.first().value; // returns 'foo' // Examine the list length: -var len = list.length; +let len = list.length; // returns 2 // Clear all list items: @@ -85,14 +85,14 @@ len = list.length; Returns the first `node`. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = linkedList(); +const list = linkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the first value: -var v = list.first().value; +const v = list.first().value; // returns 'foo' ``` @@ -101,18 +101,18 @@ var v = list.first().value; Inserts a `value` into the list **after** a provided list `node`. ```javascript -var list = linkedList(); +const list = linkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ); // Determine the list length: -var len = list.length; +let len = list.length; // returns 3 // Get the second node: -var node = list.first().next; +const node = list.first().next; // Insert a value after the second node: list.insert( node, 'boop' ); @@ -127,22 +127,22 @@ len = list.length; Returns an iterator for iterating over a list. If an environment supports `Symbol.iterator`, the returned iterator is iterable. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Create an iterator: -var it = list.iterator(); +const it = list.iterator(); // Iterate over the list... -var v = it.next().value; +let v = it.next().value; // returns 'foo' v = it.next().value; // returns 'bar' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -153,14 +153,14 @@ var bool = it.next().done; Returns the last `node`. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = linkedList(); +const list = linkedList(); // returns // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Peek at the last value: -var v = list.last().value; +const v = list.last().value; // returns 'bar' ``` @@ -169,10 +169,10 @@ var v = list.last().value; List length. ```javascript -var list = linkedList(); +const list = linkedList(); // Examine the initial list length: -var len = list.length; +let len = list.length; // returns 0 // Add values to the list: @@ -188,13 +188,13 @@ len = list.length; Removes a value from the end of the list. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'bar' // Add a new value to the list: @@ -210,13 +210,13 @@ v = list.pop(); Adds a value to the end of the list. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'bar' // Add a new value to the list: @@ -232,20 +232,20 @@ v = list.pop(); Removes a `node` from the list. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ).push( 'beep' ); // Determine the list length: -var len = list.length; +let len = list.length; // returns 3 // Get the second node: -var node = list.first().next; +const node = list.first().next; // Remove the second node: -var v = list.remove( node ); +const v = list.remove( node ); // returns 'bar' // Determine the list length: @@ -258,13 +258,13 @@ len = list.length; Removes a value from the beginning of the list. If the list is currently empty, the returned value is `undefined`. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Remove the first value: -var v = list.shift(); +let v = list.shift(); // returns 'foo' // Add a new value to the list: @@ -280,13 +280,13 @@ v = list.shift(); Returns an array of list values. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Get an array of list values: -var vals = list.toArray(); +const vals = list.toArray(); // returns [ 'foo', 'bar' ] ``` @@ -295,13 +295,13 @@ var vals = list.toArray(); Serializes a list as JSON. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.push( 'foo' ).push( 'bar' ); // Serialize to JSON: -var o = list.toJSON(); +const o = list.toJSON(); // returns { 'type': 'linked-list', 'data': [ 'foo', 'bar' ] } ``` @@ -312,13 +312,13 @@ var o = list.toJSON(); Adds a value to the beginning of the list. ```javascript -var list = linkedList(); +const list = linkedList(); // Add values to the list: list.unshift( 'foo' ).unshift( 'bar' ); // Remove the last value: -var v = list.pop(); +let v = list.pop(); // returns 'foo' // Add a new value to the list: @@ -350,10 +350,10 @@ v = list.pop(); ```javascript -var linkedList = require( '@stdlib/utils/linked-list' ); +const linkedList = require( '@stdlib/utils/linked-list' ); // Create a new linked list: -var list = linkedList(); +const list = linkedList(); // Add some values to the list: list.push( 'foo' ); @@ -362,14 +362,14 @@ list.push( 'beep' ); list.push( 'boop' ); // Peek at the first and last list values: -var v = list.first().value; +let v = list.first().value; // returns 'foo' v = list.last().value; // returns 'boop' // Inspect the list length: -var len = list.length; +let len = list.length; // returns 4 // Remove the last list value: @@ -381,9 +381,8 @@ len = list.length; // returns 3 // Iterate over the list: -var iter = list.iterator(); -var i; -for ( i = 0; i < len; i++ ) { +const iter = list.iterator(); +for ( let i = 0; i < len; i++ ) { console.log( 'List value #%d: %s', i+1, iter.next().value ); } diff --git a/lib/node_modules/@stdlib/utils/lowercase-keys/README.md b/lib/node_modules/@stdlib/utils/lowercase-keys/README.md index 6aac94acd0f4..78c6625dfe96 100644 --- a/lib/node_modules/@stdlib/utils/lowercase-keys/README.md +++ b/lib/node_modules/@stdlib/utils/lowercase-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var lowercaseKeys = require( '@stdlib/utils/lowercase-keys' ); +const lowercaseKeys = require( '@stdlib/utils/lowercase-keys' ); ``` #### lowercaseKeys( obj ) @@ -45,12 +45,12 @@ var lowercaseKeys = require( '@stdlib/utils/lowercase-keys' ); Converts each `object` key to lowercase, mapping the transformed keys to a new `object` having the same values. ```javascript -var obj1 = { +const obj1 = { 'A': 1, 'B': 2 }; -var obj2 = lowercaseKeys( obj1 ); +const obj2 = lowercaseKeys( obj1 ); // returns { 'a': 1, 'b': 2 } ``` @@ -80,16 +80,16 @@ var obj2 = lowercaseKeys( obj1 ); ```javascript -var lowercaseKeys = require( '@stdlib/utils/lowercase-keys' ); +const lowercaseKeys = require( '@stdlib/utils/lowercase-keys' ); -var obj1 = { +const obj1 = { 'A': 'beep', 'B': 'boop', 'C': 'foo', 'D': 'bar' }; -var obj2 = lowercaseKeys( obj1 ); +const obj2 = lowercaseKeys( obj1 ); console.dir( obj2 ); // => { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' } diff --git a/lib/node_modules/@stdlib/utils/map-arguments/README.md b/lib/node_modules/@stdlib/utils/map-arguments/README.md index 65d6735a38a9..f6dbe3d0234e 100644 --- a/lib/node_modules/@stdlib/utils/map-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/map-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapArguments = require( '@stdlib/utils/map-arguments' ); +const mapArguments = require( '@stdlib/utils/map-arguments' ); ``` #### mapArguments( fcn, clbk\[, thisArg] ) @@ -53,9 +53,9 @@ function clbk( v ) { return v * 2; } -var bar = mapArguments( foo, clbk ); +const bar = mapArguments( foo, clbk ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 2, 4, 6 ] ``` @@ -82,16 +82,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = mapArguments( foo.scale, clbk, ctx ); +const bar = mapArguments( foo.scale, clbk, ctx ); -var out = bar( 1, 2 ); +const out = bar( 1, 2 ); // returns [ 20, 80 ] ``` @@ -116,10 +116,10 @@ var out = bar( 1, 2 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var filterArguments = require( '@stdlib/utils/filter-arguments' ); -var mapArguments = require( '@stdlib/utils/map-arguments' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const filterArguments = require( '@stdlib/utils/filter-arguments' ); +const mapArguments = require( '@stdlib/utils/map-arguments' ); function fill( i ) { return i; @@ -138,13 +138,10 @@ function factory( i, j ) { } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); -// Compute the sum of consecutive squared elements... -var f; -var i; -for ( i = 0; i < x.length-1; i++ ) { - f = filterArguments( mapArguments( add, scale ), factory( i, i+2 ) ); +for ( let i = 0; i < x.length-1; i++ ) { + const f = filterArguments( mapArguments( add, scale ), factory( i, i+2 ) ); console.log( 'sum(x_%d^2, x_%d^2) = %d', i, i+1, f.apply( null, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/utils/map-function/README.md b/lib/node_modules/@stdlib/utils/map-function/README.md index 8365f47d5818..44fe827557fd 100644 --- a/lib/node_modules/@stdlib/utils/map-function/README.md +++ b/lib/node_modules/@stdlib/utils/map-function/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapFun = require( '@stdlib/utils/map-function' ); +const mapFun = require( '@stdlib/utils/map-function' ); ``` #### mapFun( fcn, n\[, thisArg ] ) @@ -49,7 +49,7 @@ function fcn( i ) { return i; } -var arr = mapFun( fcn, 5 ); +const arr = mapFun( fcn, 5 ); // returns [ 0, 1, 2, 3, 4 ] ``` @@ -61,11 +61,11 @@ function fcn( i ) { return i; } -var context = { +const context = { 'count': 0 }; -var arr = mapFun( fcn, 5, context ); +const arr = mapFun( fcn, 5, context ); // returns [ 0, 1, 2, 3, 4 ] console.log( context.count ); @@ -97,14 +97,14 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var mapFun = require( '@stdlib/utils/map-function' ); +const randu = require( '@stdlib/random/base/randu' ); +const mapFun = require( '@stdlib/utils/map-function' ); function rand( i ) { return randu() * i * 10.0; } -var arr = mapFun( rand, 100 ); +const arr = mapFun( rand, 100 ); console.log( arr ); ``` diff --git a/lib/node_modules/@stdlib/utils/map-keys/README.md b/lib/node_modules/@stdlib/utils/map-keys/README.md index 14478b6d950b..b31c412bc7bc 100644 --- a/lib/node_modules/@stdlib/utils/map-keys/README.md +++ b/lib/node_modules/@stdlib/utils/map-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapKeys = require( '@stdlib/utils/map-keys' ); +const mapKeys = require( '@stdlib/utils/map-keys' ); ``` #### mapKeys( obj, transform ) @@ -49,12 +49,12 @@ function transform( key, value ) { return key + value; } -var obj1 = { +const obj1 = { 'a': 1, 'b': 2 }; -var obj2 = mapKeys( obj1, transform ); +const obj2 = mapKeys( obj1, transform ); // returns { 'a1': 1, 'b2': 2 } ``` @@ -92,20 +92,20 @@ The `transform` function is provided three arguments: ```javascript -var mapKeys = require( '@stdlib/utils/map-keys' ); +const mapKeys = require( '@stdlib/utils/map-keys' ); function transform( key, value ) { return key + ':' + value; } -var obj1 = { +const obj1 = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var obj2 = mapKeys( obj1, transform ); +const obj2 = mapKeys( obj1, transform ); console.dir( obj2 ); // => { 'a:beep': 'beep', 'b:boop': 'boop', 'c:foo': 'foo', 'd:bar': 'bar' } diff --git a/lib/node_modules/@stdlib/utils/map-reduce-right/README.md b/lib/node_modules/@stdlib/utils/map-reduce-right/README.md index 99c037963307..e6ba1902ab10 100644 --- a/lib/node_modules/@stdlib/utils/map-reduce-right/README.md +++ b/lib/node_modules/@stdlib/utils/map-reduce-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapReduceRight = require( '@stdlib/utils/map-reduce-right' ); +const mapReduceRight = require( '@stdlib/utils/map-reduce-right' ); ``` #### mapReduceRight( arr, initial, mapper, reducer\[, thisArg ] ) @@ -53,16 +53,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = mapReduceRight( arr, 0, square, sum ); +const out = mapReduceRight( arr, 0, square, sum ); // returns 30 ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); function square( value ) { return value * value; @@ -72,12 +72,12 @@ function sum( accumulator, value ) { return accumulator + value; } -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var out = mapReduceRight( arr, 0, square, sum ); +const out = mapReduceRight( arr, 0, square, sum ); // returns 91 ``` @@ -108,16 +108,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = mapReduceRight( arr, 0, square, sum, ctx ); +const out = mapReduceRight( arr, 0, square, sum, ctx ); // returns 30 -var mean = out / ctx.count; +const mean = out / ctx.count; // returns 7.5 ``` @@ -134,29 +134,29 @@ var mean = out / ctx.count; - The function supports array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var cceil = require( '@stdlib/math/base/special/cceil' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const cceil = require( '@stdlib/math/base/special/cceil' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function sum( acc, z ) { - var re1 = realf( acc ); - var im1 = imagf( acc ); - var re2 = realf( z ); - var im2 = imagf( z ); + const re1 = realf( acc ); + const im1 = imagf( acc ); + const re2 = realf( z ); + const im2 = imagf( z ); return new Complex64( re1+re2, im1+im2 ); } - var x = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] ); + const x = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] ); - var v = mapReduceRight( x, new Complex64( 0.0, 0.0 ), cceil, sum ); + const v = mapReduceRight( x, new Complex64( 0.0, 0.0 ), cceil, sum ); // returns - var re = realf( v ); + const re = realf( v ); // returns 20.0 - var im = imagf( v ); + const im = imagf( v ); // returns 24.0 ``` @@ -177,33 +177,33 @@ var mean = out / ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); -var mapReduceRight = require( '@stdlib/utils/map-reduce-right' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); +const mapReduceRight = require( '@stdlib/utils/map-reduce-right' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit unary function: -var f1 = naryFunction( abs, 1 ); +const f1 = naryFunction( abs, 1 ); // Create an explicit binary function: -var f2 = naryFunction( add, 2 ); +const f2 = naryFunction( add, 2 ); // Compute the sum of absolute values: -var out = mapReduceRight( x, 0, f1, f2 ); +const out = mapReduceRight( x, 0, f1, f2 ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map-reduce/README.md b/lib/node_modules/@stdlib/utils/map-reduce/README.md index 4e18890f28e6..ab3eaf1ffbab 100644 --- a/lib/node_modules/@stdlib/utils/map-reduce/README.md +++ b/lib/node_modules/@stdlib/utils/map-reduce/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapReduce = require( '@stdlib/utils/map-reduce' ); +const mapReduce = require( '@stdlib/utils/map-reduce' ); ``` #### mapReduce( arr, initial, mapper, reducer\[, thisArg ] ) @@ -53,16 +53,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = mapReduce( arr, 0, square, sum ); +const out = mapReduce( arr, 0, square, sum ); // returns 30 ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); function square( value ) { return value * value; @@ -72,12 +72,12 @@ function sum( accumulator, value ) { return accumulator + value; } -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var out = mapReduce( arr, 0, square, sum ); +const out = mapReduce( arr, 0, square, sum ); // returns 91 ``` @@ -108,16 +108,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = mapReduce( arr, 0, square, sum, ctx ); +const out = mapReduce( arr, 0, square, sum, ctx ); // returns 30 -var mean = out / ctx.count; +const mean = out / ctx.count; // returns 7.5 ``` @@ -134,29 +134,29 @@ var mean = out / ctx.count; - The function supports array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var cceil = require( '@stdlib/math/base/special/cceil' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const cceil = require( '@stdlib/math/base/special/cceil' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function sum( acc, z ) { - var re1 = realf( acc ); - var im1 = imagf( acc ); - var re2 = realf( z ); - var im2 = imagf( z ); + const re1 = realf( acc ); + const im1 = imagf( acc ); + const re2 = realf( z ); + const im2 = imagf( z ); return new Complex64( re1+re2, im1+im2 ); } - var x = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] ); + const x = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] ); - var v = mapReduce( x, new Complex64( 0.0, 0.0 ), cceil, sum ); + const v = mapReduce( x, new Complex64( 0.0, 0.0 ), cceil, sum ); // returns - var re = realf( v ); + const re = realf( v ); // returns 20.0 - var im = imagf( v ); + const im = imagf( v ); // returns 24.0 ``` @@ -177,33 +177,33 @@ var mean = out / ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); -var mapReduce = require( '@stdlib/utils/map-reduce' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); +const mapReduce = require( '@stdlib/utils/map-reduce' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit unary function: -var f1 = naryFunction( abs, 1 ); +const f1 = naryFunction( abs, 1 ); // Create an explicit binary function: -var f2 = naryFunction( add, 2 ); +const f2 = naryFunction( add, 2 ); // Compute the sum of absolute values: -var out = mapReduce( x, 0, f1, f2 ); +const out = mapReduce( x, 0, f1, f2 ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map-right/README.md b/lib/node_modules/@stdlib/utils/map-right/README.md index e1ac297bdd83..d5bc0457b537 100644 --- a/lib/node_modules/@stdlib/utils/map-right/README.md +++ b/lib/node_modules/@stdlib/utils/map-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapRight = require( '@stdlib/utils/map-right' ); +const mapRight = require( '@stdlib/utils/map-right' ); ``` @@ -47,31 +47,31 @@ var mapRight = require( '@stdlib/utils/map-right' ); Applies a function to each element in an array and assigns the result to an element in a new array, iterating from right to left. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ -1, -2, -3, -4, -5, -6 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; -var out = mapRight( arr, naryFunction( abs, 1 ) ); +const out = mapRight( arr, naryFunction( abs, 1 ) ); // returns [ 1, 2, 3, 4, 5, 6 ] ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); -var out = mapRight( arr, naryFunction( abs, 1 ) ); +const out = mapRight( arr, naryFunction( abs, 1 ) ); // returns -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 5 ``` @@ -86,23 +86,23 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ -1, -2, -3, -4, -5, -6 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = mapRight( arr, fcn, ctx ); +const out = mapRight( arr, fcn, ctx ); // returns [ 1, 2, 3, 4, 5, 6 ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -113,11 +113,11 @@ var cnt = ctx.count; Applies a function to each element in an array and assigns the result to an element in an output array, iterating from right to left. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ -1, -2, -3, -4, -5, -6 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; mapRight.assign( arr, out, naryFunction( abs, 1 ) ); @@ -128,20 +128,20 @@ console.log( out ); The method accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); -var out = array( opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const out = array( opts ); mapRight.assign( arr, out, naryFunction( abs, 1 ) ); -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 5 ``` @@ -150,25 +150,25 @@ Input and output arrays must be either both array-like objects or both [`ndarray If input and output arrays are both [`ndarray`][@stdlib/ndarray/ctor]-like objects, the arrays **must** be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes]. To map from an input [`ndarray`][@stdlib/ndarray/ctor] to an output [`ndarray`][@stdlib/ndarray/ctor] which has the same rank (i.e., dimensionality) and the same number of elements, but which is not [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes], reshape the arrays prior to invocation. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +let opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); opts = { 'dtype': 'generic', 'shape': [ 2, 2, 3 ] // broadcast compatible shape }; -var out = array( opts ); +const out = array( opts ); mapRight.assign( arr, out, naryFunction( abs, 1 ) ); -var v = out.get( 0, 1, 1 ); +let v = out.get( 0, 1, 1 ); // returns 5 v = out.get( 1, 1, 1 ); @@ -196,26 +196,26 @@ The applied function is provided the same arguments as with [`mapRight`](#fcn-ma - Both [`mapRight`](#fcn-map-right) and [`mapRight.assign`](#method-map-right-assign) accept array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function scale( z ) { return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); } - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var y = new Complex64Array( 4 ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const y = new Complex64Array( 4 ); mapRight.assign( x, y, scale ); - var v = y.get( 0 ); + const v = y.get( 0 ); - var re = realf( v ); + const re = realf( v ); // returns 10.0 - var im = imagf( v ); + const im = imagf( v ); // returns 20.0 ``` @@ -236,29 +236,29 @@ The applied function is provided the same arguments as with [`mapRight`](#fcn-ma ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var array = require( '@stdlib/ndarray/array' ); -var mapRight = require( '@stdlib/utils/map-right' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const array = require( '@stdlib/ndarray/array' ); +const mapRight = require( '@stdlib/utils/map-right' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = mapRight( x, f ); +const y = mapRight( x, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map-values/README.md b/lib/node_modules/@stdlib/utils/map-values/README.md index d097d2d30b44..15b010a7d333 100644 --- a/lib/node_modules/@stdlib/utils/map-values/README.md +++ b/lib/node_modules/@stdlib/utils/map-values/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var mapValues = require( '@stdlib/utils/map-values' ); +const mapValues = require( '@stdlib/utils/map-values' ); ``` #### mapValues( obj, transform ) @@ -49,12 +49,12 @@ function transform( value, key ) { return key + value; } -var obj1 = { +const obj1 = { 'a': 1, 'b': 2 }; -var obj2 = mapValues( obj1, transform ); +const obj2 = mapValues( obj1, transform ); // returns { 'a': 'a1', 'b': 'b2' } ``` @@ -91,20 +91,20 @@ The `transform` function is provided three arguments: ```javascript -var mapValues = require( '@stdlib/utils/map-values' ); +const mapValues = require( '@stdlib/utils/map-values' ); function transform( value, key ) { return key + ':' + value; } -var obj1 = { +const obj1 = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var obj2 = mapValues( obj1, transform ); +const obj2 = mapValues( obj1, transform ); console.dir( obj2 ); // => { 'a': 'a:beep', 'b': 'b:boop', 'c': 'c:foo', 'd': 'd:bar' } diff --git a/lib/node_modules/@stdlib/utils/map/README.md b/lib/node_modules/@stdlib/utils/map/README.md index 89c16b7dc316..a21103a26daf 100644 --- a/lib/node_modules/@stdlib/utils/map/README.md +++ b/lib/node_modules/@stdlib/utils/map/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map = require( '@stdlib/utils/map' ); +const map = require( '@stdlib/utils/map' ); ``` @@ -47,31 +47,31 @@ var map = require( '@stdlib/utils/map' ); Applies a function to each element in an array and assigns the result to an element in a new array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ -1, -2, -3, -4, -5, -6 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; -var out = map( arr, naryFunction( abs, 1 ) ); +const out = map( arr, naryFunction( abs, 1 ) ); // returns [ 1, 2, 3, 4, 5, 6 ] ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); -var out = map( arr, naryFunction( abs, 1 ) ); +const out = map( arr, naryFunction( abs, 1 ) ); // returns -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 5 ``` @@ -86,23 +86,23 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ -1, -2, -3, -4, -5, -6 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map( arr, fcn, ctx ); +const out = map( arr, fcn, ctx ); // returns [ 1, 2, 3, 4, 5, 6 ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -113,11 +113,11 @@ var cnt = ctx.count; Applies a function to each element in an array and assigns the result to an element in an output array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ -1, -2, -3, -4, -5, -6 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; +const arr = [ -1, -2, -3, -4, -5, -6 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; map.assign( arr, out, naryFunction( abs, 1 ) ); @@ -128,20 +128,20 @@ console.log( out ); The method accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); -var out = array( opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const out = array( opts ); map.assign( arr, out, naryFunction( abs, 1 ) ); -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 5 ``` @@ -150,25 +150,25 @@ Input and output arrays must be either both array-like objects or both [`ndarray If input and output arrays are both [`ndarray`][@stdlib/ndarray/ctor]-like objects, the arrays **must** be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes]. To map from an input [`ndarray`][@stdlib/ndarray/ctor] to an output [`ndarray`][@stdlib/ndarray/ctor] which has the same rank (i.e., dimensionality) and the same number of elements, but which is not [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes], reshape the arrays prior to invocation. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +let opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); +const arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts ); opts = { 'dtype': 'generic', 'shape': [ 2, 2, 3 ] // broadcast compatible shape }; -var out = array( opts ); +const out = array( opts ); map.assign( arr, out, naryFunction( abs, 1 ) ); -var v = out.get( 0, 1, 1 ); +let v = out.get( 0, 1, 1 ); // returns 5 v = out.get( 1, 1, 1 ); @@ -196,26 +196,26 @@ The applied function is provided the same arguments as with [`map`](#fcn-map). - Both [`map`](#fcn-map) and [`map.assign`](#method-map-assign) accept array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function scale( z ) { return new Complex64( realf(z)*10.0, imagf(z)*10.0 ); } - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var y = new Complex64Array( 4 ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const y = new Complex64Array( 4 ); map.assign( x, y, scale ); - var v = y.get( 0 ); + const v = y.get( 0 ); - var re = realf( v ); + const re = realf( v ); // returns 10.0 - var im = imagf( v ); + const im = imagf( v ); // returns 20.0 ``` @@ -236,29 +236,29 @@ The applied function is provided the same arguments as with [`map`](#fcn-map). ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var array = require( '@stdlib/ndarray/array' ); -var map = require( '@stdlib/utils/map' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const array = require( '@stdlib/ndarray/array' ); +const map = require( '@stdlib/utils/map' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = map( x, f ); +const y = map( x, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map2-right/README.md b/lib/node_modules/@stdlib/utils/map2-right/README.md index 8afb530e7b0e..9a83fc3581b5 100644 --- a/lib/node_modules/@stdlib/utils/map2-right/README.md +++ b/lib/node_modules/@stdlib/utils/map2-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map2Right = require( '@stdlib/utils/map2-right' ); +const map2Right = require( '@stdlib/utils/map2-right' ); ``` @@ -47,33 +47,33 @@ var map2Right = require( '@stdlib/utils/map2-right' ); Applies a function to elements in two input arrays while iterating from right to left and assigns the results to a new array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; -var out = map2Right( x, y, naryFunction( add, 2 ) ); +const out = map2Right( x, y, naryFunction( add, 2 ) ); // returns [ 2, 3, 4, 5, 6, 7 ] ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); -var out = map2Right( x, y, naryFunction( add, 2 ) ); +const out = map2Right( x, y, naryFunction( add, 2 ) ); // returns -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 6 ``` @@ -89,24 +89,24 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function fcn( v1, v2 ) { this.count += 1; return add( v1, v2 ); } -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map2Right( x, y, fcn, ctx ); +const out = map2Right( x, y, fcn, ctx ); // returns [ 2, 3, 4, 5, 6, 7 ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -117,12 +117,12 @@ var cnt = ctx.count; Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array `out`. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; map2Right.assign( x, y, out, naryFunction( add, 2 ) ); @@ -133,21 +133,21 @@ console.log( out ); The method accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); -var out = array( opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const out = array( opts ); map2Right.assign( x, y, out, naryFunction( add, 2 ) ); -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 6 ``` @@ -156,26 +156,26 @@ Input and output arrays must be either all array-like objects or all [`ndarray`] If input and output arrays are [`ndarray`][@stdlib/ndarray/ctor]-like objects, the arrays **must** be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes]. To map from one or more input [`ndarrays`][@stdlib/ndarray/ctor] to an output [`ndarray`][@stdlib/ndarray/ctor] which has the same rank (i.e., dimensionality) and the same number of elements, but which is not [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes], reshape the arrays prior to invocation. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +let opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); opts = { 'dtype': 'generic', 'shape': [ 2, 2, 3 ] // broadcast compatible shape }; -var out = array( opts ); +const out = array( opts ); map2Right.assign( x, y, out, naryFunction( add, 2 ) ); -var v = out.get( 0, 1, 1 ); +let v = out.get( 0, 1, 1 ); // returns 6 v = out.get( 1, 1, 1 ); @@ -203,25 +203,25 @@ The applied function is provided the same arguments as with [`map2Right`](#fcn-m - Both [`map2Right`](#fcn-map2-right) and [`map2Right.assign`](#method-map2-right-assign) accept array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var naryFunction = require( '@stdlib/utils/nary-function' ); - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); - var add = require( '@stdlib/complex/float32/base/add' ); + const naryFunction = require( '@stdlib/utils/nary-function' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); + const add = require( '@stdlib/complex/float32/base/add' ); - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - var z = new Complex64Array( 4 ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + const z = new Complex64Array( 4 ); map2Right.assign( x, y, z, naryFunction( add, 2 ) ); - var v = z.get( 0 ); + const v = z.get( 0 ); - var re = realf( v ); + const re = realf( v ); // returns 2.0 - var im = imagf( v ); + const im = imagf( v ); // returns 3.0 ``` @@ -242,31 +242,31 @@ The applied function is provided the same arguments as with [`map2Right`](#fcn-m ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); -var map2Right = require( '@stdlib/utils/map2-right' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); +const map2Right = require( '@stdlib/utils/map2-right' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create two-dimensional ndarrays (i.e., matrices): -var opts = { +const opts = { 'dtype': 'generic', 'flatten': true }; -var x = array( filledarrayBy( 10, opts.dtype, fill ), opts ); -var y = array( filledarrayBy( 10, opts.dtype, fill ), opts ); +const x = array( filledarrayBy( 10, opts.dtype, fill ), opts ); +const y = array( filledarrayBy( 10, opts.dtype, fill ), opts ); // Create an explicit binary function: -var f = naryFunction( add, 2 ); +const f = naryFunction( add, 2 ); // Compute element-wise sums... -var z = map2Right( x, y, f ); +const z = map2Right( x, y, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map2/README.md b/lib/node_modules/@stdlib/utils/map2/README.md index ee40e96ff068..a4832614e622 100644 --- a/lib/node_modules/@stdlib/utils/map2/README.md +++ b/lib/node_modules/@stdlib/utils/map2/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map2 = require( '@stdlib/utils/map2' ); +const map2 = require( '@stdlib/utils/map2' ); ``` @@ -47,33 +47,33 @@ var map2 = require( '@stdlib/utils/map2' ); Applies a function to elements in two input arrays and assigns the results to a new array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; -var out = map2( x, y, naryFunction( add, 2 ) ); +const out = map2( x, y, naryFunction( add, 2 ) ); // returns [ 2, 3, 4, 5, 6, 7 ] ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic' }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); -var out = map2( x, y, naryFunction( add, 2 ) ); +const out = map2( x, y, naryFunction( add, 2 ) ); // returns -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 6 ``` @@ -89,24 +89,24 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function fcn( v1, v2 ) { this.count += 1; return add( v1, v2 ); } -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map2( x, y, fcn, ctx ); +const out = map2( x, y, fcn, ctx ); // returns [ 2, 3, 4, 5, 6, 7 ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -117,12 +117,12 @@ var cnt = ctx.count; Applies a function to elements in two input arrays and assigns the results to an output array `out`. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); -var x = [ 1, 2, 3, 4, 5, 6 ]; -var y = [ 1, 1, 1, 1, 1, 1 ]; -var out = [ 0, 0, 0, 0, 0, 0 ]; +const x = [ 1, 2, 3, 4, 5, 6 ]; +const y = [ 1, 1, 1, 1, 1, 1 ]; +const out = [ 0, 0, 0, 0, 0, 0 ]; map2.assign( x, y, out, naryFunction( add, 2 ) ); @@ -133,21 +133,21 @@ console.log( out ); The method accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +const opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); -var out = array( opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const out = array( opts ); map2.assign( x, y, out, naryFunction( add, 2 ) ); -var v = out.get( 1, 1 ); +const v = out.get( 1, 1 ); // returns 6 ``` @@ -156,26 +156,26 @@ Input and output arrays must be either all array-like objects or all [`ndarray`] If input and output arrays are [`ndarray`][@stdlib/ndarray/ctor]-like objects, the arrays **must** be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes]. To map from one or more input [`ndarrays`][@stdlib/ndarray/ctor] to an output [`ndarray`][@stdlib/ndarray/ctor] which has the same rank (i.e., dimensionality) and the same number of elements, but which is not [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes], reshape the arrays prior to invocation. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); -var opts = { +let opts = { 'dtype': 'generic', 'shape': [ 2, 3 ] }; -var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); +const x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts ); opts = { 'dtype': 'generic', 'shape': [ 2, 2, 3 ] // broadcast compatible shape }; -var out = array( opts ); +const out = array( opts ); map2.assign( x, y, out, naryFunction( add, 2 ) ); -var v = out.get( 0, 1, 1 ); +let v = out.get( 0, 1, 1 ); // returns 6 v = out.get( 1, 1, 1 ); @@ -203,25 +203,25 @@ The applied function is provided the same arguments as with [`map2`](#fcn-map2). - Both [`map2`](#fcn-map2) and [`map2.assign`](#method-map2-assign) accept array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var naryFunction = require( '@stdlib/utils/nary-function' ); - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); - var add = require( '@stdlib/complex/float32/base/add' ); + const naryFunction = require( '@stdlib/utils/nary-function' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); + const add = require( '@stdlib/complex/float32/base/add' ); - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - var z = new Complex64Array( 4 ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + const z = new Complex64Array( 4 ); map2.assign( x, y, z, naryFunction( add, 2 ) ); - var v = z.get( 0 ); + const v = z.get( 0 ); - var re = realf( v ); + const re = realf( v ); // returns 2.0 - var im = imagf( v ); + const im = imagf( v ); // returns 3.0 ``` @@ -242,31 +242,31 @@ The applied function is provided the same arguments as with [`map2`](#fcn-map2). ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); -var map2 = require( '@stdlib/utils/map2' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); +const map2 = require( '@stdlib/utils/map2' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create two-dimensional ndarrays (i.e., matrices): -var opts = { +const opts = { 'dtype': 'generic', 'flatten': true }; -var x = array( filledarrayBy( 10, opts.dtype, fill ), opts ); -var y = array( filledarrayBy( 10, opts.dtype, fill ), opts ); +const x = array( filledarrayBy( 10, opts.dtype, fill ), opts ); +const y = array( filledarrayBy( 10, opts.dtype, fill ), opts ); // Create an explicit binary function: -var f = naryFunction( add, 2 ); +const f = naryFunction( add, 2 ); // Compute element-wise sums... -var z = map2( x, y, f ); +const z = map2( x, y, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/map2d/README.md b/lib/node_modules/@stdlib/utils/map2d/README.md index 352d75b654d3..cf533e62dce3 100644 --- a/lib/node_modules/@stdlib/utils/map2d/README.md +++ b/lib/node_modules/@stdlib/utils/map2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map2d = require( '@stdlib/utils/map2d' ); +const map2d = require( '@stdlib/utils/map2d' ); ``` #### map2d( arr, fcn\[, thisArg] ) @@ -45,15 +45,15 @@ var map2d = require( '@stdlib/utils/map2d' ); Applies a function to each nested element in an array of arrays and assigns the result to a nested element in a new array of arrays. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ +const arr = [ [ -1, -2, -3 ], [ -4, -5, -6 ] ]; -var out = map2d( arr, naryFunction( abs, 1 ) ); +const out = map2d( arr, naryFunction( abs, 1 ) ); // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] ``` @@ -68,26 +68,26 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ +const arr = [ [ -1, -2, -3 ], [ -4, -5, -6 ] ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map2d( arr, fcn, ctx ); +const out = map2d( arr, fcn, ctx ); // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -112,25 +112,25 @@ var cnt = ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var map2d = require( '@stdlib/utils/map2d' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const map2d = require( '@stdlib/utils/map2d' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'float64', rand ); } // Create a nested array of arrays: -var x = filledarrayBy( 10, 'generic', fill ); +const x = filledarrayBy( 10, 'generic', fill ); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = map2d( x, f ); +const y = map2d( x, f ); console.log( 'x:' ); console.log( x ); diff --git a/lib/node_modules/@stdlib/utils/map3d/README.md b/lib/node_modules/@stdlib/utils/map3d/README.md index cc7a0fcf7df2..0cb1abad40a2 100644 --- a/lib/node_modules/@stdlib/utils/map3d/README.md +++ b/lib/node_modules/@stdlib/utils/map3d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map3d = require( '@stdlib/utils/map3d' ); +const map3d = require( '@stdlib/utils/map3d' ); ``` #### map3d( arr, fcn\[, thisArg] ) @@ -45,15 +45,15 @@ var map3d = require( '@stdlib/utils/map3d' ); Applies a function to each nested element in a three-dimensional nested array and assigns the result to a nested element in a new three-dimensional nested array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ +const arr = [ [ [ -1, -2, -3 ] ], [ [ -4, -5, -6 ] ] ]; -var out = map3d( arr, naryFunction( abs, 1 ) ); +const out = map3d( arr, naryFunction( abs, 1 ) ); // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ] ``` @@ -68,26 +68,26 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ +const arr = [ [ [ -1, -2, -3 ] ], [ [ -4, -5, -6 ] ] ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map3d( arr, fcn, ctx ); +const out = map3d( arr, fcn, ctx ); // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -112,14 +112,14 @@ var cnt = ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var map3d = require( '@stdlib/utils/map3d' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const map3d = require( '@stdlib/utils/map3d' ); function nestedFill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'float64', rand ); } @@ -128,13 +128,13 @@ function fill() { } // Create a three-dimensional nested array: -var x = filledarrayBy( 10, 'generic', fill ); +const x = filledarrayBy( 10, 'generic', fill ); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = map3d( x, f ); +const y = map3d( x, f ); console.log( 'x:' ); console.log( x ); diff --git a/lib/node_modules/@stdlib/utils/map4d/README.md b/lib/node_modules/@stdlib/utils/map4d/README.md index 93ab3edcb829..68264098b567 100644 --- a/lib/node_modules/@stdlib/utils/map4d/README.md +++ b/lib/node_modules/@stdlib/utils/map4d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map4d = require( '@stdlib/utils/map4d' ); +const map4d = require( '@stdlib/utils/map4d' ); ``` #### map4d( arr, fcn\[, thisArg] ) @@ -45,15 +45,15 @@ var map4d = require( '@stdlib/utils/map4d' ); Applies a function to each nested element in a four-dimensional nested array and assigns the result to a nested element in a new four-dimensional nested array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ +const arr = [ [ [ [ -1, -2, -3 ] ] ], [ [ [ -4, -5, -6 ] ] ] ]; -var out = map4d( arr, naryFunction( abs, 1 ) ); +const out = map4d( arr, naryFunction( abs, 1 ) ); // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ] ``` @@ -68,26 +68,26 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ +const arr = [ [ [ [ -1, -2, -3 ] ] ], [ [ [ -4, -5, -6 ] ] ] ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map4d( arr, fcn, ctx ); +const out = map4d( arr, fcn, ctx ); // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -112,11 +112,11 @@ var cnt = ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var map4d = require( '@stdlib/utils/map4d' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const map4d = require( '@stdlib/utils/map4d' ); function fill( n ) { if ( n > 0 ) { @@ -129,19 +129,19 @@ function fill( n ) { } function values( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } } // Create a four-dimensional nested array: -var x = filledarrayBy( 2, 'generic', fill( 2 ) ); +const x = filledarrayBy( 2, 'generic', fill( 2 ) ); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = map4d( x, f ); +const y = map4d( x, f ); console.log( 'x:' ); console.log( JSON.stringify( x, null, ' ' ) ); diff --git a/lib/node_modules/@stdlib/utils/map5d/README.md b/lib/node_modules/@stdlib/utils/map5d/README.md index cecb88fa546e..78c15dbd7417 100644 --- a/lib/node_modules/@stdlib/utils/map5d/README.md +++ b/lib/node_modules/@stdlib/utils/map5d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var map5d = require( '@stdlib/utils/map5d' ); +const map5d = require( '@stdlib/utils/map5d' ); ``` #### map5d( arr, fcn\[, thisArg] ) @@ -45,15 +45,15 @@ var map5d = require( '@stdlib/utils/map5d' ); Applies a function to each nested element in a five-dimensional nested array and assigns the result to a nested element in a new five-dimensional nested array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs = require( '@stdlib/math/base/special/abs' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs = require( '@stdlib/math/base/special/abs' ); -var arr = [ +const arr = [ [ [ [ [ -1, -2, -3 ] ] ] ], [ [ [ [ -4, -5, -6 ] ] ] ] ]; -var out = map5d( arr, naryFunction( abs, 1 ) ); +const out = map5d( arr, naryFunction( abs, 1 ) ); // returns [ [ [ [ [ 1, 2, 3 ] ] ] ], [ [ [ [ 4, 5, 6 ] ] ] ] ] ``` @@ -68,26 +68,26 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var abs = require( '@stdlib/math/base/special/abs' ); +const abs = require( '@stdlib/math/base/special/abs' ); function fcn( v ) { this.count += 1; return abs( v ); } -var arr = [ +const arr = [ [ [ [ [ -1 ], [ -2 ], [ -3 ] ] ] ], [ [ [ [ -4 ], [ -5 ], [ -6 ] ] ] ] ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = map5d( arr, fcn, ctx ); +const out = map5d( arr, fcn, ctx ); // returns [ [ [ [ [ 1 ], [ 2 ], [ 3 ] ] ] ], [ [ [ [ 4 ], [ 5 ], [ 6 ] ] ] ] ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -112,11 +112,11 @@ var cnt = ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var abs2 = require( '@stdlib/math/base/special/abs2' ); -var map5d = require( '@stdlib/utils/map5d' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const abs2 = require( '@stdlib/math/base/special/abs2' ); +const map5d = require( '@stdlib/utils/map5d' ); function fill( n ) { if ( n > 0 ) { @@ -129,19 +129,19 @@ function fill( n ) { } function values( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } } // Create a five-dimensional nested array: -var x = filledarrayBy( 2, 'generic', fill( 3 ) ); +const x = filledarrayBy( 2, 'generic', fill( 3 ) ); // Create an explicit unary function: -var f = naryFunction( abs2, 1 ); +const f = naryFunction( abs2, 1 ); // Compute the element-wise squared absolute value... -var y = map5d( x, f ); +const y = map5d( x, f ); console.log( 'x:' ); console.log( JSON.stringify( x, null, ' ' ) ); diff --git a/lib/node_modules/@stdlib/utils/mask-arguments/README.md b/lib/node_modules/@stdlib/utils/mask-arguments/README.md index 46ef4e24d5b1..016d954b7545 100644 --- a/lib/node_modules/@stdlib/utils/mask-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/mask-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var maskArguments = require( '@stdlib/utils/mask-arguments' ); +const maskArguments = require( '@stdlib/utils/mask-arguments' ); ``` #### maskArguments( fcn, mask\[, thisArg] ) @@ -49,9 +49,9 @@ function foo( a, b ) { return [ a, b ]; } -var bar = maskArguments( foo, [ 1, 0, 1 ] ); +const bar = maskArguments( foo, [ 1, 0, 1 ] ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 1, 3 ] ``` @@ -69,16 +69,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = maskArguments( foo.scale, [ 1, 0, 1 ], ctx ); +const bar = maskArguments( foo.scale, [ 1, 0, 1 ], ctx ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 10, 60 ] ``` @@ -107,33 +107,31 @@ var out = bar( 1, 2, 3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var add = require( '@stdlib/math/base/ops/add' ); -var maskArguments = require( '@stdlib/utils/mask-arguments' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const add = require( '@stdlib/math/base/ops/add' ); +const maskArguments = require( '@stdlib/utils/mask-arguments' ); function fill( i ) { return i; } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); // Create a mask array: -var mask = new Uint8Array( x.length ); +const mask = new Uint8Array( x.length ); // "Unmask" the first element: mask[ 0 ] = 1; // Compute the sum of consecutive elements... -var f; -var i; -for ( i = 1; i < x.length; i++ ) { +for ( let i = 1; i < x.length; i++ ) { // "Unmask" the next element: mask[ i ] = 1; // Compute the sum: - f = maskArguments( add, mask ); + const f = maskArguments( add, mask ); console.log( 'sum(x_%d, x_%d) = %d', i-1, i, f.apply( null, x ) ); // Update the mask: diff --git a/lib/node_modules/@stdlib/utils/memoize/README.md b/lib/node_modules/@stdlib/utils/memoize/README.md index 6cf2726f3838..266d179c8bb5 100644 --- a/lib/node_modules/@stdlib/utils/memoize/README.md +++ b/lib/node_modules/@stdlib/utils/memoize/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var memoize = require( '@stdlib/utils/memoize' ); +const memoize = require( '@stdlib/utils/memoize' ); ``` #### memoize( fcn\[, hashFunction] ) @@ -45,18 +45,18 @@ var memoize = require( '@stdlib/utils/memoize' ); Memoizes a function. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function rand( n ) { return n * randu(); } -var memoized = memoize( rand ); +const memoized = memoize( rand ); -var v1 = memoized( 5 ); -var v2 = memoized( 5 ); +const v1 = memoized( 5 ); +const v2 = memoized( 5 ); -var bool = ( v1 === v2 ); +const bool = ( v1 === v2 ); // returns true ``` @@ -75,20 +75,20 @@ obj = { // Default behavior... -var memoized = memoize( add ); +let memoized = memoize( add ); -var v1 = memoized( obj ); +let v1 = memoized( obj ); // returns 12 -var str = obj.toString(); +let str = obj.toString(); // returns '[object Object]' -var v2 = memoized.cache[ str ]; +let v2 = memoized.cache[ str ]; // returns 12 obj.x = 1000; -var v3 = memoized( obj ); +let v3 = memoized( obj ); // returns 12 // Custom hash function... @@ -123,15 +123,15 @@ function beep( x ) { throw new Error( 'boop' ); } -var memoized = memoize( beep ); +const memoized = memoize( beep ); -var cache = memoized.cache; +const cache = memoized.cache; // returns {} // Modify the cache: cache[ 'bop' ] = 'bip'; -var str = memoized( 'bop' ); +const str = memoized( 'bop' ); // returns 'bip' ``` @@ -161,24 +161,19 @@ var str = memoized( 'bop' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var memoize = require( '@stdlib/utils/memoize' ); - -var fcn; -var n; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const memoize = require( '@stdlib/utils/memoize' ); function rand( n ) { return n * randu(); } -fcn = memoize( rand ); +const fcn = memoize( rand ); -for ( i = 0; i < 100; i++ ) { - n = floor( randu() * 5 ); - v = fcn( n ); +for ( let i = 0; i < 100; i++ ) { + const n = floor( randu() * 5 ); + const v = fcn( n ); console.log( 'rand(%d) = %d', n, v ); } ``` diff --git a/lib/node_modules/@stdlib/utils/merge/README.md b/lib/node_modules/@stdlib/utils/merge/README.md index 33f4908a2dae..70fdb15cbc7b 100644 --- a/lib/node_modules/@stdlib/utils/merge/README.md +++ b/lib/node_modules/@stdlib/utils/merge/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var merge = require( '@stdlib/utils/merge' ); +const merge = require( '@stdlib/utils/merge' ); ``` #### merge( target, source1\[, source2\[,...,sourceN]] ) @@ -35,15 +35,15 @@ var merge = require( '@stdlib/utils/merge' ); Merges and extends a target `object`. ```javascript -var target = { +const target = { 'a': 'beep' }; -var source = { +const source = { 'a': 'boop', 'b': 'bap' }; -var out = merge( target, source ); +const out = merge( target, source ); /* returns { 'a': 'boop', @@ -55,17 +55,17 @@ var out = merge( target, source ); The function supports merging multiple source `objects`. ```javascript -var target = { +const target = { 'a': 'beep' }; -var source1 = { +const source1 = { 'b': 'boop' }; -var source2 = { +const source2 = { 'c': 'cat' }; -var out = merge( target, source1, source2 ); +const out = merge( target, source1, source2 ); /* returns { 'a': 'beep', @@ -80,14 +80,14 @@ var out = merge( target, source1, source2 ); Returns a custom merge `function` for merging and extending `objects`. ```javascript -var opts = { +const opts = { 'level': 100, 'copy': true, 'override': true, 'extend': true }; -var m = merge.factory( opts ); +const m = merge.factory( opts ); ``` The function accepts the following `options`: @@ -100,9 +100,9 @@ The function accepts the following `options`: The default merge is a deep (recursive) merge. ```javascript -var m = merge.factory( {} ); +const m = merge.factory( {} ); -var target = { +const target = { 'a': { 'b': { 'c': 5 @@ -110,7 +110,7 @@ var target = { 'd': 'beep' } }; -var source = { +const source = { 'a': { 'b': { 'c': 10 @@ -118,7 +118,7 @@ var source = { } }; -var out = m( target, source ); +const out = m( target, source ); /* returns { 'a': { @@ -134,11 +134,11 @@ var out = m( target, source ); To limit the merge depth, set the `level` option. ```javascript -var m = merge.factory({ +const m = merge.factory({ 'level': 2 }); -var target = { +const target = { '1': { 'a': 'beep', '2': { @@ -148,7 +148,7 @@ var target = { } }; -var source = { +const source = { '1': { 'b': 'boop', '2': { @@ -157,7 +157,7 @@ var source = { } }; -var out = m( target, source ); +const out = m( target, source ); /* returns { '1': { @@ -174,18 +174,18 @@ var out = m( target, source ); By default, merged values are [deep copied][@stdlib/utils/copy]. ```javascript -var m = merge.factory( {} ); +const m = merge.factory( {} ); -var target = { +const target = { 'a': null }; -var source = { +const source = { 'a': { 'b': [ 1, 2, 3 ] } }; -var out = m( target, source ); +const out = m( target, source ); console.log( out.a.b === source.a.b ); // => false @@ -194,40 +194,40 @@ console.log( out.a.b === source.a.b ); To allow shared references, set the `copy` option to `false`. ```javascript -var m = merge.factory({ +const m = merge.factory({ 'copy': false }); -var target = {}; +const target = {}; -var source = { +const source = { 'a': [ 1, 2, 3 ] }; -var out = m( target, source ); +const out = m( target, source ); -var bool = ( out.a === source.a ); +const bool = ( out.a === source.a ); // returns true ``` To prevent existing properties from being overridden, set the `override` option to `false`. ```javascript -var m = merge.factory({ +const m = merge.factory({ 'override': false }); -var target = { +const target = { 'a': 'beep', 'b': 'boop' }; -var source = { +const source = { 'a': null, 'c': 'bop' }; -var out = m( target, source ); +const out = m( target, source ); /* returns { 'a': 'beep', @@ -255,23 +255,23 @@ function strategy( a, b, key ) { return 'bebop'; } -var m = merge.factory({ +const m = merge.factory({ 'override': strategy }); -var target = { +const target = { 'a': 'beep', 'b': 'boop', 'c': 1234 }; -var source = { +const source = { 'a': null, 'b': {}, 'c': 'bop' }; -var out = m( target, source ); +const out = m( target, source ); /* returns { 'a': null, @@ -284,21 +284,21 @@ var out = m( target, source ); To prevent non-existent properties from being added to the target `object`, set the `extend` option to `false`. ```javascript -var m = merge.factory({ +const m = merge.factory({ 'extend': false }); -var target = { +const target = { 'a': 'beep', 'b': 'boop' }; -var source = { +const source = { 'b': 'hello', 'c': 'world' }; -var out = m( target, source ); +const out = m( target, source ); /* returns { 'a': 'beep', @@ -320,14 +320,14 @@ var out = m( target, source ); - The target `object` is **mutated**. ```javascript - var target = { + const target = { 'a': 'beep' }; - var source = { + const source = { 'b': 'boop' }; - var out = merge( target, source ); + const out = merge( target, source ); console.log( out === target ); // => true @@ -339,14 +339,14 @@ var out = m( target, source ); To return a new `object`, provide an empty `object` as the first argument. ```javascript - var target = { + const target = { 'a': 'beep' }; - var source = { + const source = { 'b': 'boop' }; - var out = merge( {}, target, source ); + const out = merge( {}, target, source ); console.log( out === target ); // => false @@ -397,9 +397,9 @@ var out = m( target, source ); ```javascript -var merge = require( '@stdlib/utils/merge' ); +const merge = require( '@stdlib/utils/merge' ); -var target = { +const target = { 'a': 'beep', 'b': 'boop', 'c': { @@ -413,7 +413,7 @@ var target = { 'd': [ 1, 2, 3 ] }; -var source = { +const source = { 'b': 3.141592653589793, 'c': { 'c1': 'bap', @@ -428,7 +428,7 @@ var source = { 'e': true }; -var out = merge( {}, target, source ); +const out = merge( {}, target, source ); /* returns { 'a': 'beep', diff --git a/lib/node_modules/@stdlib/utils/move-property/README.md b/lib/node_modules/@stdlib/utils/move-property/README.md index b26d5fc2a0f0..eafef58cbfa0 100644 --- a/lib/node_modules/@stdlib/utils/move-property/README.md +++ b/lib/node_modules/@stdlib/utils/move-property/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var moveProperty = require( '@stdlib/utils/move-property' ); +const moveProperty = require( '@stdlib/utils/move-property' ); ``` #### moveProperty( source, prop, target ) @@ -35,24 +35,24 @@ var moveProperty = require( '@stdlib/utils/move-property' ); Moves a property from one `object` to another `object`. ```javascript -var obj1 = { +const obj1 = { 'a': 'b' }; -var obj2 = {}; +const obj2 = {}; -var bool = moveProperty( obj1, 'a', obj2 ); +const bool = moveProperty( obj1, 'a', obj2 ); // returns true ``` If the operation is successful, the function returns `true`; otherwise, `false`. ```javascript -var obj1 = { +const obj1 = { 'a': 'b' }; -var obj2 = {}; +const obj2 = {}; -var bool = moveProperty( obj1, 'c', obj2 ); +const bool = moveProperty( obj1, 'c', obj2 ); // returns false ``` @@ -67,14 +67,14 @@ var bool = moveProperty( obj1, 'c', obj2 ); - A transfer is **shallow**. ```javascript - var arr = [ 1, 2, 3 ]; + const arr = [ 1, 2, 3 ]; - var obj1 = { + const obj1 = { 'a': arr }; - var obj2 = {}; + const obj2 = {}; - var bool = moveProperty( obj1, 'a', obj2 ); + const bool = moveProperty( obj1, 'a', obj2 ); console.log( obj2.a === arr ); // => true ``` @@ -96,17 +96,17 @@ var bool = moveProperty( obj1, 'c', obj2 ); ```javascript -var moveProperty = require( '@stdlib/utils/move-property' ); +const moveProperty = require( '@stdlib/utils/move-property' ); -var obj1 = { +const obj1 = { 'beep': 'boop' }; -var obj2 = { +const obj2 = { 'foo': 'bar' }; -var bool = moveProperty( obj1, 'beep', obj2 ); +const bool = moveProperty( obj1, 'beep', obj2 ); if ( bool === false ) { console.log( 'failed to move property' ); } diff --git a/lib/node_modules/@stdlib/utils/named-typed-tuple/README.md b/lib/node_modules/@stdlib/utils/named-typed-tuple/README.md index a9f5da79213e..7b4dfa0a57bd 100644 --- a/lib/node_modules/@stdlib/utils/named-typed-tuple/README.md +++ b/lib/node_modules/@stdlib/utils/named-typed-tuple/README.md @@ -41,7 +41,7 @@ Named typed tuples can be used wherever [typed arrays][@stdlib/array/typed] are ## Usage ```javascript -var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); +const namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); ``` @@ -51,17 +51,17 @@ var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); Returns a named typed tuple factory. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -97,17 +97,17 @@ The function accepts the following `options`: Returns a named typed tuple of the default data type. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory(); +const tuple = factory(); -var x = tuple.x; +let x = tuple.x; // returns 0.0 x = tuple[ 0 ]; // returns 0.0 -var y = tuple.y; +let y = tuple.y; // returns 0.0 y = tuple[ 1 ]; @@ -119,17 +119,17 @@ y = tuple[ 1 ]; Returns a named typed tuple of the specified data type. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( 'int32' ); +const tuple = factory( 'int32' ); -var x = tuple.x; +let x = tuple.x; // returns 0 x = tuple[ 0 ]; // returns 0 -var y = tuple.y; +let y = tuple.y; // returns 0 y = tuple[ 1 ]; @@ -141,19 +141,19 @@ y = tuple[ 1 ]; Returns a named typed tuple from a [typed array][@stdlib/array/typed]. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( new Float64Array( [ 1.0, -1.0 ] ) ); +const tuple = factory( new Float64Array( [ 1.0, -1.0 ] ) ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -163,20 +163,20 @@ y = tuple[ 1 ]; To override the default tuple data type (and potentially cast [typed array][@stdlib/array/typed] values to another data type), provide a `dtype`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); // Cast double-precision floating-point numbers to signed 32-bit integers: -var tuple = factory( new Float64Array( [ 1.0, -1.0 ] ), 'int32' ); +const tuple = factory( new Float64Array( [ 1.0, -1.0 ] ), 'int32' ); -var x = tuple.x; +let x = tuple.x; // returns 1 x = tuple[ 0 ]; // returns 1 -var y = tuple.y; +let y = tuple.y; // returns -1 y = tuple[ 1 ]; @@ -188,17 +188,17 @@ y = tuple[ 1 ]; Returns a named typed tuple from an array-like object or iterable. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -208,17 +208,17 @@ y = tuple[ 1 ]; To override the default tuple data type, provide a `dtype`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, -1.0 ], 'int32' ); -var x = tuple.x; +let x = tuple.x; // returns 1 x = tuple[ 0 ]; // returns 1 -var y = tuple.y; +let y = tuple.y; // returns -1 y = tuple[ 1 ]; @@ -230,22 +230,22 @@ y = tuple[ 1 ]; Returns a named typed tuple view of an [`ArrayBuffer`][@stdlib/array/buffer] where the view length equals the number of tuple fields. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var buf = new ArrayBuffer( 32 ); +const buf = new ArrayBuffer( 32 ); // Create a tuple view of the first 16 bytes (8 bytes per double): -var tuple = factory( buf ); +let tuple = factory( buf ); -var x = tuple.x; +let x = tuple.x; // returns 0.0 x = tuple[ 0 ]; // returns 0.0 -var y = tuple.y; +let y = tuple.y; // returns 0.0 y = tuple[ 1 ]; @@ -270,22 +270,22 @@ y = tuple[ 1 ]; To override the default tuple data type, provide a `dtype`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var buf = new ArrayBuffer( 16 ); +const buf = new ArrayBuffer( 16 ); // Create a tuple view of the first 8 bytes (4 bytes per float): -var tuple = factory( buf, 'float32' ); +let tuple = factory( buf, 'float32' ); -var x = tuple.x; +let x = tuple.x; // returns 0.0 x = tuple[ 0 ]; // returns 0.0 -var y = tuple.y; +let y = tuple.y; // returns 0.0 y = tuple[ 1 ]; @@ -314,17 +314,17 @@ y = tuple[ 1 ]; Creates a new named typed tuple from an array-like `object` or an iterable. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory.from( [ 1.0, -1.0 ] ); +const tuple = factory.from( [ 1.0, -1.0 ] ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -334,21 +334,21 @@ y = tuple[ 1 ]; To invoke a function for each `src` value, provide a callback function. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); function mapFcn( v ) { return v * 2.0; } -var tuple = factory.from( [ 1.0, -1.0 ], mapFcn ); +const tuple = factory.from( [ 1.0, -1.0 ], mapFcn ); -var x = tuple.x; +let x = tuple.x; // returns 2.0 x = tuple[ 0 ]; // returns 2.0 -var y = tuple.y; +let y = tuple.y; // returns -2.0 y = tuple[ 1 ]; @@ -364,20 +364,20 @@ A callback function is provided three arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); function mapFcn( v ) { this.count += 1; return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var tuple = factory.from( [ 1.0, -1.0 ], mapFcn, ctx ); +const tuple = factory.from( [ 1.0, -1.0 ], mapFcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -388,22 +388,22 @@ var n = ctx.count; Creates a new named typed tuple from an `object` containing tuple fields. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var obj = { +const obj = { 'x': 1.0, 'y': -1.0 }; -var tuple = factory.fromObject( obj ); +const tuple = factory.fromObject( obj ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -413,26 +413,26 @@ y = tuple[ 1 ]; To invoke a function for each `src` object tuple field, provide a callback function. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); function mapFcn( v ) { return v * 2.0; } -var obj = { +const obj = { 'x': 1.0, 'y': -1.0 }; -var tuple = factory.fromObject( obj, mapFcn ); +const tuple = factory.fromObject( obj, mapFcn ); -var x = tuple.x; +let x = tuple.x; // returns 2.0 x = tuple[ 0 ]; // returns 2.0 -var y = tuple.y; +let y = tuple.y; // returns -2.0 y = tuple[ 1 ]; @@ -447,25 +447,25 @@ A callback function is provided two arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); function mapFcn( v ) { this.count += 1; return v * 2.0; } -var obj = { +const obj = { 'x': 1.0, 'y': -1.0 }; -var ctx = { +const ctx = { 'count': 0 }; -var tuple = factory.fromObject( obj, mapFcn, ctx ); +const tuple = factory.fromObject( obj, mapFcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -476,17 +476,17 @@ var n = ctx.count; Creates a new named typed tuple from a variable number of arguments. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory.of( 1.0, -1.0 ); +const tuple = factory.of( 1.0, -1.0 ); -var x = tuple.x; +let x = tuple.x; // returns 1.0 x = tuple[ 0 ]; // returns 1.0 -var y = tuple.y; +let y = tuple.y; // returns -1.0 y = tuple[ 1 ]; @@ -504,11 +504,11 @@ y = tuple[ 1 ]; Size (in bytes) of each tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var nbytes = tuple.BYTES_PER_ELEMENT; +const nbytes = tuple.BYTES_PER_ELEMENT; // returns 8 ``` @@ -519,11 +519,11 @@ var nbytes = tuple.BYTES_PER_ELEMENT; Pointer to the underlying data buffer. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var buf = tuple.buffer; +const buf = tuple.buffer; // returns ``` @@ -534,11 +534,11 @@ var buf = tuple.buffer; Length (in bytes) of the tuple. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var nbytes = tuple.byteLength; +const nbytes = tuple.byteLength; // returns 16 ``` @@ -549,16 +549,16 @@ var nbytes = tuple.byteLength; Offset (in bytes) of a tuple from the start of its underlying [`ArrayBuffer`][@stdlib/array/buffer]. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +let tuple = factory( [ 1.0, -1.0 ] ); -var offset = tuple.byteOffset; +let offset = tuple.byteOffset; // returns 0 -var buf = new ArrayBuffer( 64 ); +const buf = new ArrayBuffer( 64 ); tuple = factory( buf, 32 ); offset = tuple.byteOffset; @@ -572,11 +572,11 @@ offset = tuple.byteOffset; Number of tuple elements. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var len = tuple.length; +const len = tuple.length; // returns 2 ``` @@ -588,15 +588,15 @@ Tuple name. ```javascript // Create a tuple factory which generates tuples having the default tuple name: -var factory = namedtypedtuple( [ 'x', 'y' ] ); +let factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +let tuple = factory( [ 1.0, -1.0 ] ); -var n = tuple.name; +let n = tuple.name; // returns 'tuple' // Create a tuple factory which generates tuples having a custom tuple name: -var opts = { +const opts = { 'name': 'Point' }; factory = namedtypedtuple( [ 'x', 'y' ], opts ); @@ -614,11 +614,11 @@ n = tuple.name; Returns the list of tuple fields. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); -var fields = tuple.fields; +const fields = tuple.fields; // returns [ 'x', 'y' ] ``` @@ -629,15 +629,15 @@ var fields = tuple.fields; Returns the list of tuple fields in index order. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); // Sort tuple elements in ascending order: tuple.sort(); // Get the list of tuple fields: -var fields = tuple.fields; +let fields = tuple.fields; // returns [ 'x', 'y' ] // Get the list of tuple fields in index order: @@ -652,14 +652,14 @@ fields = tuple.orderedFields; Copies a sequence of elements within the tuple starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); +const tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); -var x = tuple.x; +let x = tuple.x; // returns 2.0 -var y = tuple.y; +let y = tuple.y; // returns -2.0 // Copy the last two elements to the first two elements: @@ -675,14 +675,14 @@ y = tuple.y; By default, `end` equals the number of tuple elements (i.e., one more than the last tuple index). To limit the sequence length, provide an `end` argument. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); +const tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); -var w = tuple.w; +let w = tuple.w; // returns -1.0 -var v = tuple.v; +let v = tuple.v; // returns 1.0 // Copy the first two elements to the last two elements: @@ -698,14 +698,14 @@ v = tuple.v; When a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last tuple element. The following example achieves the same behavior as the previous example: ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); +const tuple = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] ); -var w = tuple.w; +let w = tuple.w; // returns -1.0 -var v = tuple.v; +let v = tuple.v; // returns 1.0 // Copy the first two elements to the last two elements: @@ -725,21 +725,21 @@ v = tuple.v; Returns an iterator for iterating over tuple key-value pairs. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); // Create an iterator: -var it = tuple.entries(); +const it = tuple.entries(); // Iterate over key-value pairs... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 'x', 1.0 ] v = it.next().value; // returns [ 1, 'y', -1.0 ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -750,15 +750,15 @@ var bool = it.next().done; Tests whether all tuple elements pass a test implemented by a `predicate` function. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); function predicate( v ) { return ( v >= 0.0 ); } -var bool = tuple.every( predicate ); +const bool = tuple.every( predicate ); // returns false ``` @@ -772,23 +772,23 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, 1.0 ] ); +const tuple = factory( [ 1.0, 1.0 ] ); function predicate( v ) { this.count += 1; return ( v >= 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var bool = tuple.every( predicate, ctx ); +const bool = tuple.every( predicate, ctx ); // returns true -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -799,11 +799,11 @@ var n = ctx.count; Returns the field of the first tuple element strictly equal to a search element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var field = tuple.fieldOf( -1.0 ); +let field = tuple.fieldOf( -1.0 ); // returns 'z' field = tuple.fieldOf( 2.0 ); @@ -813,22 +813,22 @@ field = tuple.fieldOf( 2.0 ); By default, the method searches the entire tuple (`fromIndex = 0`). To begin searching from a specific tuple index, provide a `fromIndex`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var field = tuple.fieldOf( 1.0, 1 ); +const field = tuple.fieldOf( 1.0, 1 ); // returns undefined ``` When a `fromIndex` is negative, the starting index is resolved relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var field = tuple.fieldOf( 1.0, -2 ); +const field = tuple.fieldOf( 1.0, -2 ); // returns undefined ``` @@ -841,17 +841,17 @@ The method does **not** distinguish between signed and unsigned zero. Fills a tuple from a `start` index to an `end` index (non-inclusive) with a provided `value`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory(); +const tuple = factory(); // Set all tuple elements to the same value: tuple.fill( 2.0 ); -var x = tuple.x; +let x = tuple.x; // returns 2.0 -var y = tuple.y; +let y = tuple.y; // returns 2.0 // Set all tuple elements starting from the first index to the same value: @@ -876,17 +876,17 @@ y = tuple.y; When a `start` and/or `end` index is negative, the respective index is determined relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory(); +const tuple = factory(); // Set all tuple elements, except the last element, to the same value: tuple.fill( 2.0, -tuple.length, -1 ); -var x = tuple.x; +const x = tuple.x; // returns 2.0 -var y = tuple.y; +const y = tuple.y; // returns 0.0 ``` @@ -897,32 +897,32 @@ var y = tuple.y; Creates a new tuple (of the same data type as the host tuple) which includes those elements for which a `predicate` function returns a truthy value. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v >= 0.0 ); } -var p2 = p1.filter( predicate ); +const p2 = p1.filter( predicate ); -var f = p2.fields; +const f = p2.fields; // returns [ 'x', 'y' ] ``` If a `predicate` function does not return a truthy value for any tuple element, the method returns `null`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v >= 10.0 ); } -var p2 = p1.filter( predicate ); +const p2 = p1.filter( predicate ); // returns null ``` @@ -936,22 +936,22 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { this.count += 1; return ( v >= 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var p2 = p1.filter( predicate, ctx ); +const p2 = p1.filter( predicate, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -962,30 +962,30 @@ var n = ctx.count; Returns the first tuple element for which a provided `predicate` function returns a truthy value. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < 0.0 ); } -var v = tuple.find( predicate ); +const v = tuple.find( predicate ); // returns -1.0 ``` If a `predicate` function does not return a truthy value for any tuple element, the method returns `undefined`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < -10.0 ); } -var v = tuple.find( predicate ); +const v = tuple.find( predicate ); // returns undefined ``` @@ -999,23 +999,23 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { this.count += 1; return ( v < 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var v = tuple.find( predicate, ctx ); +const v = tuple.find( predicate, ctx ); // returns -1.0 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -1026,30 +1026,30 @@ var n = ctx.count; Returns the field of the first tuple element for which a provided `predicate` function returns a truthy value. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < 0.0 ); } -var field = tuple.findField( predicate ); +const field = tuple.findField( predicate ); // returns 'z' ``` If a `predicate` function does not return a truthy value for any tuple element, the method returns `undefined`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < -10.0 ); } -var field = tuple.findField( predicate ); +const field = tuple.findField( predicate ); // returns undefined ``` @@ -1063,23 +1063,23 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { this.count += 1; return ( v < 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var field = tuple.findField( predicate, ctx ); +const field = tuple.findField( predicate, ctx ); // returns 'z' -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -1090,30 +1090,30 @@ var n = ctx.count; Returns the index of the first tuple element for which a provided `predicate` function returns a truthy value. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < 0.0 ); } -var idx = tuple.findIndex( predicate ); +const idx = tuple.findIndex( predicate ); // returns 2 ``` If a `predicate` function does not return a truthy value for any tuple element, the method returns `-1`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { return ( v < -10.0 ); } -var idx = tuple.findIndex( predicate ); +const idx = tuple.findIndex( predicate ); // returns -1 ``` @@ -1127,23 +1127,23 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); function predicate( v ) { this.count += 1; return ( v < 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var idx = tuple.findIndex( predicate, ctx ); +const idx = tuple.findIndex( predicate, ctx ); // returns 2 -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -1154,11 +1154,11 @@ var n = ctx.count; Invokes a callback for each tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = ''; +let str = ''; function fcn( v, i, f ) { str += f + '=' + v; @@ -1183,21 +1183,21 @@ The callback is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); function fcn() { this.count += 1; } -var ctx = { +const ctx = { 'count': 0 }; tuple.forEach( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -1208,11 +1208,11 @@ var n = ctx.count; Returns a `boolean` indicating whether a tuple includes a search element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var bool = tuple.includes( -1.0 ); +let bool = tuple.includes( -1.0 ); // returns true bool = tuple.includes( 2.0 ); @@ -1222,22 +1222,22 @@ bool = tuple.includes( 2.0 ); By default, the method searches the entire tuple (`fromIndex = 0`). To begin searching from a specific tuple index, provide a `fromIndex`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var bool = tuple.includes( 1.0, 1 ); +const bool = tuple.includes( 1.0, 1 ); // returns false ``` When a `fromIndex` is negative, the starting index is resolved relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var bool = tuple.includes( 1.0, -2 ); +const bool = tuple.includes( 1.0, -2 ); // returns false ``` @@ -1250,11 +1250,11 @@ The method does **not** distinguish between signed and unsigned zero. Returns the index of the first tuple element strictly equal to a search element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var idx = tuple.indexOf( -1.0 ); +let idx = tuple.indexOf( -1.0 ); // returns 2 idx = tuple.indexOf( 2.0 ); @@ -1264,22 +1264,22 @@ idx = tuple.indexOf( 2.0 ); By default, the method searches the entire tuple (`fromIndex = 0`). To begin searching from a specific tuple index, provide a `fromIndex`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var idx = tuple.indexOf( 1.0, 1 ); +const idx = tuple.indexOf( 1.0, 1 ); // returns -1 ``` When a `fromIndex` is negative, the starting index is resolved relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var idx = tuple.indexOf( 1.0, -2 ); +const idx = tuple.indexOf( 1.0, -2 ); // returns -1 ``` @@ -1292,11 +1292,11 @@ The method does **not** distinguish between signed and unsigned zero. Converts a tuple index to a field name. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var field = tuple.ind2key( 1 ); +let field = tuple.ind2key( 1 ); // returns 'y' field = tuple.ind2key( 100 ); @@ -1306,11 +1306,11 @@ field = tuple.ind2key( 100 ); If provided a negative index, the method resolves the index relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var field = tuple.ind2key( -2 ); +const field = tuple.ind2key( -2 ); // returns 'y' ``` @@ -1321,22 +1321,22 @@ var field = tuple.ind2key( -2 ); Serializes a tuple by joining all tuple elements as a string. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = tuple.join(); +const str = tuple.join(); // returns '1,0,-1' ``` By default, the method delineates tuple elements using a comma `,`. To specify a custom separator, provide a `separator` string. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = tuple.join( '|' ); +const str = tuple.join( '|' ); // returns '1|0|-1' ``` @@ -1347,21 +1347,21 @@ var str = tuple.join( '|' ); Returns an iterator for iterating over tuple keys. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); // Create an iterator: -var it = tuple.keys(); +const it = tuple.keys(); // Iterate over keys... -var v = it.next().value; +let v = it.next().value; // returns [ 0, 'x' ] v = it.next().value; // returns [ 1, 'y' ] -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -1372,11 +1372,11 @@ var bool = it.next().done; Converts a field name to a tuple index. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var idx = tuple.key2ind( 'y' ); +let idx = tuple.key2ind( 'y' ); // returns 1 idx = tuple.key2ind( 'foo' ); @@ -1390,11 +1390,11 @@ idx = tuple.key2ind( 'foo' ); Returns the field of the last tuple element strictly equal to a search element, iterating from right to left. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var field = tuple.lastFieldOf( 0.0 ); +let field = tuple.lastFieldOf( 0.0 ); // returns 'w' field = tuple.lastFieldOf( 2.0 ); @@ -1404,22 +1404,22 @@ field = tuple.lastFieldOf( 2.0 ); By default, the method searches the entire tuple (`fromIndex = -1`). To begin searching from a specific tuple index, provide a `fromIndex`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var field = tuple.lastFieldOf( 0.0, 2 ); +const field = tuple.lastFieldOf( 0.0, 2 ); // returns 'y' ``` When a `fromIndex` is negative, the starting index is resolved relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var field = tuple.lastFieldOf( 0.0, -3 ); +const field = tuple.lastFieldOf( 0.0, -3 ); // returns 'y' ``` @@ -1432,11 +1432,11 @@ The method does **not** distinguish between signed and unsigned zero. Returns the index of the last tuple element strictly equal to a search element, iterating from right to left. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var idx = tuple.lastIndexOf( 0.0 ); +let idx = tuple.lastIndexOf( 0.0 ); // returns 3 idx = tuple.lastIndexOf( 2.0 ); @@ -1446,22 +1446,22 @@ idx = tuple.lastIndexOf( 2.0 ); By default, the method searches the entire tuple (`fromIndex = -1`). To begin searching from a specific tuple index, provide a `fromIndex`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var idx = tuple.lastIndexOf( 0.0, 2 ); +const idx = tuple.lastIndexOf( 0.0, 2 ); // returns 1 ``` When a `fromIndex` is negative, the starting index is resolved relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] ); -var idx = tuple.lastIndexOf( 0.0, -3 ); +const idx = tuple.lastIndexOf( 0.0, -3 ); // returns 1 ``` @@ -1474,23 +1474,23 @@ The method does **not** distinguish between signed and unsigned zero. Maps each tuple element to an element in a new tuple having the same data type as the host tuple. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); function fcn( v ) { return v * 2.0; } -var p2 = p1.map( fcn ); +const p2 = p1.map( fcn ); -var x = p2.x; +const x = p2.x; // returns 2.0 -var y = p2.y; +const y = p2.y; // returns 0.0 -var z = p2.z; +const z = p2.z; // returns -2.0 ``` @@ -1504,22 +1504,22 @@ A callback is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); function fcn( v ) { this.count += 1; return v * 2.0; } -var ctx = { +const ctx = { 'count': 0 }; -var p2 = p1.map( fcn, ctx ); +const p2 = p1.map( fcn, ctx ); -var n = ctx.count; +const n = ctx.count; // returns 3 ``` @@ -1530,15 +1530,15 @@ var n = ctx.count; Applies a function against an accumulator and each element in a tuple and returns the accumulated result. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, 0.0, -3.0 ] ); +const tuple = factory( [ 2.0, 0.0, -3.0 ] ); function fcn( acc, v ) { return acc + ( v*v ); } -var v = tuple.reduce( fcn ); +const v = tuple.reduce( fcn ); // returns 11.0 ``` @@ -1547,15 +1547,15 @@ If not provided an initial value, the method invokes a provided function with th If provided an initial value, the method invokes a provided function with the initial value as the first argument and the first tuple element as the second argument. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, 0.0, -3.0 ] ); +const tuple = factory( [ 2.0, 0.0, -3.0 ] ); function fcn( acc, v ) { return acc + ( v*v ); } -var v = tuple.reduce( fcn, 0.0 ); +const v = tuple.reduce( fcn, 0.0 ); // returns 13.0 ``` @@ -1574,15 +1574,15 @@ A callback is provided five arguments: Applies a function against an accumulator and each element in a tuple and returns the accumulated result, iterating from right to left. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, 0.0, -3.0 ] ); +const tuple = factory( [ 2.0, 0.0, -3.0 ] ); function fcn( acc, v ) { return acc + ( v*v ); } -var v = tuple.reduceRight( fcn ); +const v = tuple.reduceRight( fcn ); // returns 1.0 ``` @@ -1591,15 +1591,15 @@ If not provided an initial value, the method invokes a provided function with th If provided an initial value, the method invokes a provided function with the initial value as the first argument and the last tuple element as the second argument. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, 0.0, -3.0 ] ); +const tuple = factory( [ 2.0, 0.0, -3.0 ] ); function fcn( acc, v ) { return acc + ( v*v ); } -var v = tuple.reduceRight( fcn, 0.0 ); +const v = tuple.reduceRight( fcn, 0.0 ); // returns 13.0 ``` @@ -1618,11 +1618,11 @@ A callback is provided five arguments: Reverses a tuple **in-place** (thus mutating the tuple on which the method is invoked). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, 0.0, -3.0 ] ); +const tuple = factory( [ 2.0, 0.0, -3.0 ] ); -var x = tuple[ 0 ]; +let x = tuple[ 0 ]; // returns 2.0 x = tuple.x; @@ -1631,10 +1631,10 @@ x = tuple.x; // Reverse the tuple: tuple.reverse(); -var fields = tuple.orderedFields; +const fields = tuple.orderedFields; // returns [ 'z', 'y', 'x' ] -var z = tuple[ 0 ]; +const z = tuple[ 0 ]; // returns -3.0 // Tuple field assignments do NOT change: @@ -1651,11 +1651,11 @@ Invoking this method does **not** affect tuple field assignments. Sets tuple elements. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var y = tuple[ 1 ]; +let y = tuple[ 1 ]; // returns 0.0 y = tuple.y; @@ -1664,7 +1664,7 @@ y = tuple.y; // Set the first two tuple elements: tuple.set( [ -2.0, 2.0 ] ); -var x = tuple[ 0 ]; +let x = tuple[ 0 ]; // returns -2.0 x = tuple.x; @@ -1680,11 +1680,11 @@ y = tuple.y; By default, the method starts writing values at the first tuple index. To specify an alternative index, provide an index `offset`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var y = tuple[ 1 ]; +let y = tuple[ 1 ]; // returns 0.0 y = tuple.y; @@ -1693,7 +1693,7 @@ y = tuple.y; // Set the last two tuple elements: tuple.set( [ -2.0, 2.0 ], 1 ); -var x = tuple[ 0 ]; +let x = tuple[ 0 ]; // returns 1.0 x = tuple.x; @@ -1705,7 +1705,7 @@ y = tuple[ 1 ]; y = tuple.y; // returns -2.0 -var z = tuple[ 2 ]; +let z = tuple[ 2 ]; // returns 2.0 z = tuple.z; @@ -1719,82 +1719,82 @@ z = tuple.z; Copies tuple elements to a new tuple with the same underlying data type as the host tuple. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.slice(); +const p2 = p1.slice(); -var bool = ( p1 === p2 ); +let bool = ( p1 === p2 ); // returns false bool = ( p1.buffer === p2.buffer ); // returns false -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 -var z = p2.z; +const z = p2.z; // returns -1.0 ``` By default, the method copies elements beginning with the first tuple element. To specify an alternative tuple index at which to begin copying, provide a `begin` index (inclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.slice( 1 ); +const p2 = p1.slice( 1 ); -var fields = p2.fields; +const fields = p2.fields; // returns [ 'y', 'z' ] -var y = p2.y; +const y = p2.y; // returns 0.0 -var z = p2.z; +const z = p2.z; // returns -1.0 ``` By default, the method copies all tuple elements after `begin`. To specify an alternative tuple index at which to end copying, provide an `end` index (exclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.slice( 0, 2 ); +const p2 = p1.slice( 0, 2 ); -var fields = p2.fields; +const fields = p2.fields; // returns [ 'x', 'y' ] -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 ``` When a `begin` and/or `end` index is negative, the respective index is determined relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.slice( -p1.length, -1 ); +const p2 = p1.slice( -p1.length, -1 ); -var fields = p2.fields; +const fields = p2.fields; // returns [ 'x', 'y' ] -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 ``` @@ -1805,15 +1805,15 @@ var y = p2.y; Tests whether at least one tuple element passes a test implemented by a `predicate` function. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); function predicate( v ) { return ( v < 0.0 ); } -var bool = tuple.some( predicate ); +const bool = tuple.some( predicate ); // returns true ``` @@ -1827,23 +1827,23 @@ A `predicate` function is provided four arguments: To set the callback execution context, provide a `thisArg`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, 1.0 ] ); +const tuple = factory( [ 1.0, 1.0 ] ); function predicate( v ) { this.count += 1; return ( v < 0.0 ); } -var ctx = { +const ctx = { 'count': 0 }; -var bool = tuple.some( predicate, ctx ); +const bool = tuple.some( predicate, ctx ); // returns false -var n = ctx.count; +const n = ctx.count; // returns 2 ``` @@ -1854,11 +1854,11 @@ var n = ctx.count; Sorts a tuple **in-place** (thus mutating the tuple on which the method is invoked). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, -3.0, 0.0 ] ); +const tuple = factory( [ 2.0, -3.0, 0.0 ] ); -var x = tuple[ 0 ]; +let x = tuple[ 0 ]; // returns 2.0 x = tuple.x; @@ -1867,10 +1867,10 @@ x = tuple.x; // Sort the tuple (in ascending order): tuple.sort(); -var fields = tuple.orderedFields; +const fields = tuple.orderedFields; // returns [ 'y', 'z', 'x' ] -var y = tuple[ 0 ]; +const y = tuple[ 0 ]; // returns -3.0 // Tuple field assignments do NOT change: @@ -1881,11 +1881,11 @@ x = tuple.x; By default, the method sorts tuple elements in ascending order. To impose a custom order, provide a `compareFunction`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 2.0, -3.0, 0.0 ] ); +const tuple = factory( [ 2.0, -3.0, 0.0 ] ); -var x = tuple[ 0 ]; +let x = tuple[ 0 ]; // returns 2.0 x = tuple.x; @@ -1898,14 +1898,14 @@ function descending( a, b ) { // Sort the tuple (in descending order): tuple.sort( descending ); -var fields = tuple.orderedFields; +const fields = tuple.orderedFields; // returns [ 'x', 'z', 'y' ] -var z = tuple[ 1 ]; +const z = tuple[ 1 ]; // returns 0.0 // Tuple field assignments do NOT change: -var y = tuple.y; +const y = tuple.y; // returns -3.0 ``` @@ -1924,55 +1924,55 @@ Invoking this method does **not** affect tuple field assignments. Creates a new [typed array][@stdlib/array/typed] over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host tuple. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var arr = tuple.subarray(); +const arr = tuple.subarray(); // returns [ 1.0, 0.0, -1.0 ] ``` By default, the method creates a [typed array][@stdlib/array/typed] view beginning with the first tuple element. To specify an alternative tuple index at which to begin, provide a `begin` index (inclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var arr = tuple.subarray( 1 ); +const arr = tuple.subarray( 1 ); // returns [ 0.0, -1.0 ] ``` By default, the method creates a [typed array][@stdlib/array/typed] view which includes all tuple elements after `begin`. To limit the number of tuple elements after `begin`, provide an `end` index (exclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var arr = tuple.subarray( 0, 2 ); +const arr = tuple.subarray( 0, 2 ); // returns [ 1.0, 0.0 ] ``` When a `begin` and/or `end` index is negative, the respective index is determined relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var arr = tuple.subarray( -tuple.length, -1 ); +const arr = tuple.subarray( -tuple.length, -1 ); // returns [ 1.0, 0.0 ] ``` If the method is unable to resolve indices to a non-empty tuple subsequence, the method returns an empty [typed array][@stdlib/array/typed]. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var arr = tuple.subarray( 10, -1 ); +const arr = tuple.subarray( 10, -1 ); // returns [] ``` @@ -1983,105 +1983,105 @@ var arr = tuple.subarray( 10, -1 ); Creates a new named typed tuple over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host tuple. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.subtuple(); +const p2 = p1.subtuple(); -var bool = ( p1 === p2 ); +let bool = ( p1 === p2 ); // returns false bool = ( p1.buffer === p2.buffer ); // returns true -var len = p2.length; +const len = p2.length; // returns 3 -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 -var z = p2.z; +const z = p2.z; // returns -1.0 ``` By default, the method creates a new tuple beginning with the first tuple element. To specify an alternative tuple index at which to begin, provide a `begin` index (inclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.subtuple( 1 ); +const p2 = p1.subtuple( 1 ); -var len = p2.length; +const len = p2.length; // returns 2 -var fields = p2.fields; +const fields = p2.fields; // returns [ 'y', 'z' ] -var y = p2.y; +const y = p2.y; // returns 0.0 -var z = p2.z; +const z = p2.z; // returns -1.0 ``` By default, the method creates a new tuple which includes all tuple elements after `begin`. To limit the number of tuple elements after `begin`, provide an `end` index (exclusive). ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.subtuple( 0, 2 ); +const p2 = p1.subtuple( 0, 2 ); -var len = p2.length; +const len = p2.length; // returns 2 -var fields = p2.fields; +const fields = p2.fields; // returns [ 'x', 'y' ] -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 ``` When a `begin` and/or `end` index is negative, the respective index is determined relative to the last tuple element. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.subtuple( -p1.length, -1 ); +const p2 = p1.subtuple( -p1.length, -1 ); -var len = p2.length; +const len = p2.length; // returns 2 -var fields = p2.fields; +const fields = p2.fields; // returns [ 'x', 'y' ] -var x = p2.x; +const x = p2.x; // returns 1.0 -var y = p2.y; +const y = p2.y; // returns 0.0 ``` If the method is unable to resolve indices to a non-empty tuple subsequence, the method returns `null`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var p1 = factory( [ 1.0, 0.0, -1.0 ] ); +const p1 = factory( [ 1.0, 0.0, -1.0 ] ); -var p2 = p1.subtuple( 10, -1 ); +const p2 = p1.subtuple( 10, -1 ); // returns null ``` @@ -2092,11 +2092,11 @@ var p2 = p1.subtuple( 10, -1 ); Serializes a tuple as [JSON][json]. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ] ); +const tuple = factory( [ 1.0, 0.0, -1.0 ] ); -var obj = tuple.toJSON(); +const obj = tuple.toJSON(); // returns { 'x': 1.0, 'y': 0.0, 'z': -1.0 } ``` @@ -2107,11 +2107,11 @@ var obj = tuple.toJSON(); Serializes a tuple as a locale-specific `string`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = tuple.toLocaleString(); +const str = tuple.toLocaleString(); // returns '1,0,-1' ``` @@ -2122,26 +2122,26 @@ var str = tuple.toLocaleString(); Serializes a tuple as a `string`. ```javascript -var factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ] ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = tuple.toString(); +const str = tuple.toString(); // returns 'tuple(x=1, y=0, z=-1)' ``` The returned `string` uses the tuple `name` as specified when creating a tuple factory. ```javascript -var opts = { +const opts = { 'name': 'Point' }; -var factory = namedtypedtuple( [ 'x', 'y', 'z' ], opts ); +const factory = namedtypedtuple( [ 'x', 'y', 'z' ], opts ); -var tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); +const tuple = factory( [ 1.0, 0.0, -1.0 ], 'int32' ); -var str = tuple.toString(); +const str = tuple.toString(); // returns 'Point(x=1, y=0, z=-1)' ``` @@ -2152,21 +2152,21 @@ var str = tuple.toString(); Returns an iterator for iterating over tuple elements. ```javascript -var factory = namedtypedtuple( [ 'x', 'y' ] ); +const factory = namedtypedtuple( [ 'x', 'y' ] ); -var tuple = factory( [ 1.0, -1.0 ] ); +const tuple = factory( [ 1.0, -1.0 ] ); // Create an iterator: -var it = tuple.values(); +const it = tuple.values(); // Iterate over tuple elements... -var v = it.next().value; +let v = it.next().value; // returns 1.0 v = it.next().value; // returns -1.0 -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -2187,9 +2187,9 @@ var bool = it.next().done; ```javascript - var factory = namedtypedtuple( [ 'x', 'y' ] ); + const factory = namedtypedtuple( [ 'x', 'y' ] ); - var tuple = factory( [ 1.0, -1.0 ] ); + let tuple = factory( [ 1.0, -1.0 ] ); // Make the tuple immutable: tuple = Object.freeze( tuple ); @@ -2212,25 +2212,25 @@ var bool = it.next().done; ```javascript -var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); +const namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' ); -var fields = [ 'x', 'y' ]; -var opts = { +const fields = [ 'x', 'y' ]; +const opts = { 'name': 'Point' }; -var Point = namedtypedtuple( fields, opts ); +const Point = namedtypedtuple( fields, opts ); -var p = new Point( [ 1.0, -1.0 ] ); +const p = new Point( [ 1.0, -1.0 ] ); // Tuple elements can be accessed by index or name: -var x = p[ 0 ]; +let x = p[ 0 ]; // returns 1.0 x = p.x; // returns 1.0 -var y = p[ 1 ]; +let y = p[ 1 ]; // returns -1.0 y = p.y; diff --git a/lib/node_modules/@stdlib/utils/nary-function/README.md b/lib/node_modules/@stdlib/utils/nary-function/README.md index 59b819d62b53..5abb02f58dc6 100644 --- a/lib/node_modules/@stdlib/utils/nary-function/README.md +++ b/lib/node_modules/@stdlib/utils/nary-function/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); ``` #### naryFunction( fcn, arity\[, thisArg] ) @@ -46,19 +46,16 @@ Returns a `function` that invokes a provided function with a specified number of ```javascript function sum() { - var s; - var i; - - s = 0; - for ( i = 0; i < arguments.length; i++ ) { + let s = 0; + for ( let i = 0; i < arguments.length; i++ ) { s += arguments[ i ]; } return s; } -var fcn = naryFunction( sum, 2 ); +const fcn = naryFunction( sum, 2 ); -var out = fcn( -1, -2, 3 ); +const out = fcn( -1, -2, 3 ); // returns -3 ``` @@ -72,25 +69,24 @@ function Foo() { } Foo.prototype.sum = function sum() { - var s; - var i; + let s; s = 0; - for ( i = 0; i < arguments.length; i++ ) { + for ( let i = 0; i < arguments.length; i++ ) { s += arguments[ i ] * this.scalar; } return s; }; -var ctx = { +const ctx = { 'scalar': 3 }; -var foo = new Foo(); +const foo = new Foo(); -var fcn = naryFunction( foo.sum, 2, ctx ); +const fcn = naryFunction( foo.sum, 2, ctx ); -var out = fcn( 1, 2, 3 ); +const out = fcn( 1, 2, 3 ); // returns 9 ``` @@ -119,32 +115,26 @@ var out = fcn( 1, 2, 3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var naryFunction = require( '@stdlib/utils/nary-function' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); function fill( i ) { return i; } function sum() { - var s; - var i; - - s = 0; - for ( i = 0; i < arguments.length; i++ ) { + let s = 0; + for ( let i = 0; i < arguments.length; i++ ) { s += arguments[ i ]; } return s; } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); -// Compute cumulative sums... -var f; -var i; -for ( i = 0; i <= x.length; i++ ) { - f = naryFunction( sum, i ); +for ( let i = 0; i <= x.length; i++ ) { + const f = naryFunction( sum, i ); console.log( 'sum_%d = %d', i, f.apply( null, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/utils/native-class/README.md b/lib/node_modules/@stdlib/utils/native-class/README.md index 8058d1374628..325b21d3c7af 100644 --- a/lib/node_modules/@stdlib/utils/native-class/README.md +++ b/lib/node_modules/@stdlib/utils/native-class/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nativeClass = require( '@stdlib/utils/native-class' ); +const nativeClass = require( '@stdlib/utils/native-class' ); ``` #### nativeClass( value ) @@ -35,7 +35,7 @@ var nativeClass = require( '@stdlib/utils/native-class' ); Returns a `string` value indicating a [specification defined][object-to-string] classification of an `object`. ```javascript -var str = nativeClass( 'a' ); +let str = nativeClass( 'a' ); // returns '[object String]' str = nativeClass( 5 ); @@ -59,12 +59,12 @@ str = nativeClass( new Beep() ); - The function is **not** robust for ES2015+ environments. In ES2015+, [`Symbol.toStringTag`][mdn-symbol-tostringtag] allows overriding the default description of an object. ```javascript - var toStr = Object.prototype.toString; + const toStr = Object.prototype.toString; - var str = toStr.call( false ); + let str = toStr.call( false ); // returns '[object Boolean]' - var o = {}; + const o = {}; str = toStr.call( o ); // returns '[object Object]' @@ -90,20 +90,20 @@ str = nativeClass( new Beep() ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var nativeClass = require( '@stdlib/utils/native-class' ); - -var str = nativeClass( 'a' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const nativeClass = require( '@stdlib/utils/native-class' ); + +let str = nativeClass( 'a' ); // returns '[object String]' str = nativeClass( 5 ); diff --git a/lib/node_modules/@stdlib/utils/next-tick/README.md b/lib/node_modules/@stdlib/utils/next-tick/README.md index a581bd32d67d..11d8061ad5e1 100644 --- a/lib/node_modules/@stdlib/utils/next-tick/README.md +++ b/lib/node_modules/@stdlib/utils/next-tick/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nextTick = require( '@stdlib/utils/next-tick' ); +const nextTick = require( '@stdlib/utils/next-tick' ); ``` #### nextTick( clbk\[, ...args] ) @@ -62,7 +62,7 @@ nextTick( beep ); ```javascript -var nextTick = require( '@stdlib/utils/next-tick' ); +const nextTick = require( '@stdlib/utils/next-tick' ); function beep( x, y, z ) { console.log( 'boop: %d %d %d', x, y, z ); diff --git a/lib/node_modules/@stdlib/utils/none-by-right/README.md b/lib/node_modules/@stdlib/utils/none-by-right/README.md index d2079f681fb4..88d6a62a3cb4 100644 --- a/lib/node_modules/@stdlib/utils/none-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/none-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneByRight = require( '@stdlib/utils/none-by-right' ); +const noneByRight = require( '@stdlib/utils/none-by-right' ); ``` #### noneByRight( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ -1, -2, -3, -4 ]; +const arr = [ -1, -2, -3, -4 ]; -var bool = noneByRight( arr, isPositive ); +const bool = noneByRight( arr, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ -1, 2, -3, -4 ]; +const arr = [ -1, 2, -3, -4 ]; -var bool = noneByRight( arr, isPositive ); +const bool = noneByRight( arr, isPositive ); // returns false ``` @@ -86,17 +86,17 @@ function sum( value ) { return false; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = noneByRight( arr, sum, context ); +const bool = noneByRight( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function truthy() { return true; } - var bool = noneByRight( [], truthy ); + const bool = noneByRight( [], truthy ); // returns true ``` @@ -132,9 +132,9 @@ var mean = context.sum / context.count; return false; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var bool = noneByRight( arr, log ); + const bool = noneByRight( arr, log ); /* => 3: 4 2: undefined @@ -158,23 +158,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var noneByRight = require( '@stdlib/utils/none-by-right' ); +const randu = require( '@stdlib/random/base/randu' ); +const noneByRight = require( '@stdlib/utils/none-by-right' ); function isPositive( value ) { return ( value > 0 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = -randu(); } -bool = noneByRight( arr, isPositive ); +const bool = noneByRight( arr, isPositive ); // returns true ``` diff --git a/lib/node_modules/@stdlib/utils/none-by/README.md b/lib/node_modules/@stdlib/utils/none-by/README.md index ffbc6f63a06f..1d0ba2e167bf 100644 --- a/lib/node_modules/@stdlib/utils/none-by/README.md +++ b/lib/node_modules/@stdlib/utils/none-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneBy = require( '@stdlib/utils/none-by' ); +const noneBy = require( '@stdlib/utils/none-by' ); ``` #### noneBy( collection, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ -1, -2, -3, -4 ]; +const arr = [ -1, -2, -3, -4 ]; -var bool = noneBy( arr, isPositive ); +const bool = noneBy( arr, isPositive ); // returns true ``` @@ -62,9 +62,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ -1, 2, -3, -4 ]; +const arr = [ -1, 2, -3, -4 ]; -var bool = noneBy( arr, isPositive ); +const bool = noneBy( arr, isPositive ); // returns false ``` @@ -86,17 +86,17 @@ function sum( value ) { return false; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = noneBy( arr, sum, context ); +const bool = noneBy( arr, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function truthy() { return true; } - var bool = noneBy( [], truthy ); + const bool = noneBy( [], truthy ); // returns true ``` @@ -132,9 +132,9 @@ var mean = context.sum / context.count; return false; } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; - var bool = noneBy( arr, log ); + const bool = noneBy( arr, log ); /* => 0: 1 1: undefined @@ -158,23 +158,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var noneBy = require( '@stdlib/utils/none-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const noneBy = require( '@stdlib/utils/none-by' ); function isNegative( value ) { return ( value < 0 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = noneBy( arr, isNegative ); +const bool = noneBy( arr, isNegative ); // returns true ``` diff --git a/lib/node_modules/@stdlib/utils/none-in-by/README.md b/lib/node_modules/@stdlib/utils/none-in-by/README.md index 4cfb9140bedb..36546bce746e 100644 --- a/lib/node_modules/@stdlib/utils/none-in-by/README.md +++ b/lib/node_modules/@stdlib/utils/none-in-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneInBy = require( '@stdlib/utils/none-in-by' ); +const noneInBy = require( '@stdlib/utils/none-in-by' ); ``` #### noneInBy( object, predicate\[, thisArg ] ) @@ -49,13 +49,13 @@ function isUnderage( age ) { return ( age < 18 ); } -var obj = { +const obj = { 'a': 28, 'b': 22, 'c': 25 }; -var bool = noneInBy( obj, isUnderage ); +const bool = noneInBy( obj, isUnderage ); // returns true ``` @@ -66,13 +66,13 @@ function isUnderage( age ) { return ( age < 18 ); } -var obj = { +const obj = { 'a': 12, 'b': 22, 'c': 25 }; -var bool = noneInBy( obj, isUnderage ); +const bool = noneInBy( obj, isUnderage ); // returns false ``` @@ -94,22 +94,22 @@ function sum( value ) { return false; } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = noneInBy( obj, sum, context ); +const bool = noneInBy( obj, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.5 ``` @@ -132,7 +132,7 @@ var mean = context.sum / context.count; function truthy() { return true; } - var bool = noneInBy( {}, truthy ); + const bool = noneInBy( {}, truthy ); // returns true ``` @@ -146,14 +146,14 @@ var mean = context.sum / context.count; return false; } - var obj = { + const obj = { 'a': 1, 'b': NaN, 'c': NaN, 'd': 4 }; - var bool = noneInBy( arr, log ); + const bool = noneInBy( arr, log ); /* => 0: 1 1: undefined @@ -175,19 +175,19 @@ var mean = context.sum / context.count; ```javascript -var noneInBy = require( '@stdlib/utils/none-in-by' ); +const noneInBy = require( '@stdlib/utils/none-in-by' ); function isUnderage( age ) { return age < 18; } -var obj = { +const obj = { 'a': 26, 'b': 20, 'c': 25 }; -var bool = noneInBy( obj, isUnderage ); +const bool = noneInBy( obj, isUnderage ); // returns true ``` diff --git a/lib/node_modules/@stdlib/utils/none-own-by/README.md b/lib/node_modules/@stdlib/utils/none-own-by/README.md index 7c77c686a178..6a520995f682 100644 --- a/lib/node_modules/@stdlib/utils/none-own-by/README.md +++ b/lib/node_modules/@stdlib/utils/none-own-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var noneOwnBy = require( '@stdlib/utils/none-own-by' ); +const noneOwnBy = require( '@stdlib/utils/none-own-by' ); ``` #### noneOwnBy( object, predicate\[, thisArg ] ) @@ -49,13 +49,13 @@ function isUnderage( age ) { return ( age < 18 ); } -var obj = { +const obj = { 'a': 28, 'b': 22, 'c': 25 }; -var bool = noneOwnBy( obj, isUnderage ); +const bool = noneOwnBy( obj, isUnderage ); // returns true ``` @@ -66,13 +66,13 @@ function isUnderage( age ) { return ( age < 18 ); } -var obj = { +const obj = { 'a': 12, 'b': 22, 'c': 25 }; -var bool = noneOwnBy( obj, isUnderage ); +const bool = noneOwnBy( obj, isUnderage ); // returns false ``` @@ -94,7 +94,7 @@ var bool = noneOwnBy( obj, isUnderage ); function truthy() { return true; } - var bool = noneOwnBy( {}, truthy ); + const bool = noneOwnBy( {}, truthy ); // returns true ``` @@ -111,19 +111,19 @@ var bool = noneOwnBy( obj, isUnderage ); ```javascript -var noneOwnBy = require( '@stdlib/utils/none-own-by' ); +const noneOwnBy = require( '@stdlib/utils/none-own-by' ); function isUnderage( age ) { return age < 18; } -var obj = { +const obj = { 'a': 26, 'b': 20, 'c': 25 }; -var bool = noneOwnBy( obj, isUnderage ); +const bool = noneOwnBy( obj, isUnderage ); // returns true ``` diff --git a/lib/node_modules/@stdlib/utils/none/README.md b/lib/node_modules/@stdlib/utils/none/README.md index b70fb08c101f..472c5482d1b5 100644 --- a/lib/node_modules/@stdlib/utils/none/README.md +++ b/lib/node_modules/@stdlib/utils/none/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var none = require( '@stdlib/utils/none' ); +const none = require( '@stdlib/utils/none' ); ``` #### none( collection ) @@ -45,16 +45,16 @@ var none = require( '@stdlib/utils/none' ); Tests whether all elements in a `collection` are falsy. ```javascript -var arr = [ 0, 0, 0, 0, 0 ]; +const arr = [ 0, 0, 0, 0, 0 ]; -var bool = none( arr ); +const bool = none( arr ); // returns true ``` If provided an empty `collection`, the function returns `true`. ```javascript -var bool = none( [] ); +const bool = none( [] ); // returns true ``` @@ -84,19 +84,15 @@ var bool = none( [] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var none = require( '@stdlib/utils/none' ); +const randu = require( '@stdlib/random/base/randu' ); +const none = require( '@stdlib/utils/none' ); -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = ( randu() > 0.95 ); } -bool = none( arr ); +const bool = none( arr ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-properties-in/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-properties-in/README.md index ca2d2d1e8d54..80d0f92e452b 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-properties-in/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-properties-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' ); +const nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' ); ``` #### nonEnumerablePropertiesIn( obj ) @@ -35,9 +35,9 @@ var nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties Returns an `array` of an object's own and inherited non-enumerable property names and [symbols][@stdlib/symbol/ctor]. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; defineProperty( obj, 'a', { 'configurable': false, @@ -46,7 +46,7 @@ defineProperty( obj, 'a', { 'value': 'a' }); -var props = nonEnumerablePropertiesIn( obj ); +const props = nonEnumerablePropertiesIn( obj ); // returns [ 'a', ... ] ``` @@ -67,12 +67,12 @@ var props = nonEnumerablePropertiesIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -111,8 +111,8 @@ if ( hasSymbols ) { }); } -var obj = new Foo(); -var props = nonEnumerablePropertiesIn( obj ); +const obj = new Foo(); +const props = nonEnumerablePropertiesIn( obj ); // returns [ 'b', 'beep', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-properties/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-properties/README.md index 7e13853b70c0..e818e00721e5 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' ); +const nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' ); ``` #### nonEnumerableProperties( obj ) @@ -35,9 +35,9 @@ var nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' Returns an `array` of an object's own non-enumerable property names and symbols. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; obj.a = 'a'; defineProperty( obj, 'b', { @@ -47,7 +47,7 @@ defineProperty( obj, 'b', { 'value': 'b' }); -var props = nonEnumerableProperties( obj ); +const props = nonEnumerableProperties( obj ); // returns [ 'b' ] ``` @@ -72,14 +72,14 @@ var props = nonEnumerableProperties( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' ); - -var hasSymbols = hasSymbolSupport(); -var props; -var obj; +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' ); + +const hasSymbols = hasSymbolSupport(); +let props; +let obj; function Foo() { this.a = 'a'; diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-property-names-in/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-property-names-in/README.md index 279a41613993..54d50d1d5721 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-property-names-in/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-property-names-in/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' ); +const nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' ); ``` #### nonEnumerablePropertyNamesIn( obj ) @@ -39,9 +39,9 @@ Returns an `array` of an object's own and inherited non-enumerable property name ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'a': 'b' }; @@ -52,7 +52,7 @@ defineProperty( obj, 'c', { 'value': 'd' }); -var keys = nonEnumerablePropertyNamesIn( obj ); +const keys = nonEnumerablePropertyNamesIn( obj ); // e.g., returns [ 'c', ... ] ``` @@ -79,8 +79,8 @@ var keys = nonEnumerablePropertyNamesIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' ); function Foo() { this.beep = 'boop'; @@ -104,8 +104,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = nonEnumerablePropertyNamesIn( obj ); +const obj = new Foo(); +const keys = nonEnumerablePropertyNamesIn( obj ); console.log( keys ); // e.g., => [ 'baz', 'bip', ... ] diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-property-names/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-property-names/README.md index 774eebcdd5e1..57cd3ac006f5 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-property-names/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-property-names/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' ); +const nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' ); ``` #### nonEnumerablePropertyNames( obj ) @@ -39,9 +39,9 @@ Returns an `array` of an object's own non-enumerable property names. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'a': 'b' }; @@ -52,7 +52,7 @@ defineProperty( obj, 'c', { 'value': 'd' }); -var keys = nonEnumerablePropertyNames( obj ); +const keys = nonEnumerablePropertyNames( obj ); // returns [ 'c' ] ``` @@ -79,8 +79,8 @@ var keys = nonEnumerablePropertyNames( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' ); function Foo() { this.beep = 'boop'; @@ -104,8 +104,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = nonEnumerablePropertyNames( obj ); +const obj = new Foo(); +const keys = nonEnumerablePropertyNames( obj ); console.log( keys ); // => [ 'baz' ] diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols-in/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols-in/README.md index d697502b3d5f..181a41374a61 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols-in/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols-in/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' ); +const nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' ); ``` #### nonEnumerablePropertySymbolsIn( obj ) @@ -39,11 +39,11 @@ Returns an `array` of an object's own and inherited non-enumerable symbol proper ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -54,7 +54,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = nonEnumerablePropertySymbolsIn( obj ); +const symbols = nonEnumerablePropertySymbolsIn( obj ); ``` @@ -80,14 +80,12 @@ var symbols = nonEnumerablePropertySymbolsIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -110,8 +108,8 @@ if ( hasSymbols ) { }); } -obj = new Foo(); -symbols = nonEnumerablePropertySymbolsIn( obj ); +const obj = new Foo(); +const symbols = nonEnumerablePropertySymbolsIn( obj ); console.log( symbols ); ``` diff --git a/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols/README.md index 3df6cbefdad7..6655d469a326 100644 --- a/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/nonenumerable-property-symbols/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' ); +const nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' ); ``` #### nonEnumerablePropertySymbols( obj ) @@ -39,11 +39,11 @@ Returns an `array` of an object's own non-enumerable symbol properties. ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -54,7 +54,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = nonEnumerablePropertySymbols( obj ); +const symbols = nonEnumerablePropertySymbols( obj ); ``` @@ -80,14 +80,12 @@ var symbols = nonEnumerablePropertySymbols( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -110,8 +108,8 @@ if ( hasSymbols ) { }); } -obj = new Foo(); -symbols = nonEnumerablePropertySymbols( obj ); +const obj = new Foo(); +const symbols = nonEnumerablePropertySymbols( obj ); console.log( symbols ); ``` diff --git a/lib/node_modules/@stdlib/utils/nonindex-keys/README.md b/lib/node_modules/@stdlib/utils/nonindex-keys/README.md index 42b0aa928ff5..8bd4d2dd9c7e 100644 --- a/lib/node_modules/@stdlib/utils/nonindex-keys/README.md +++ b/lib/node_modules/@stdlib/utils/nonindex-keys/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var nonIndexKeys = require( '@stdlib/utils/nonindex-keys' ); +const nonIndexKeys = require( '@stdlib/utils/nonindex-keys' ); ``` #### nonIndexKeys( obj ) @@ -35,11 +35,11 @@ var nonIndexKeys = require( '@stdlib/utils/nonindex-keys' ); Returns an `array` of an object's own enumerable property names which are not integer indices. ```javascript -var arr = [ 1, 2, 3 ]; +const arr = [ 1, 2, 3 ]; arr.a = 'foo'; arr.b = 'bar'; -var keys = nonIndexKeys( arr ); +const keys = nonIndexKeys( arr ); // e.g., returns [ 'a', 'b' ] ``` @@ -65,7 +65,7 @@ var keys = nonIndexKeys( arr ); ```javascript -var nonIndexKeys = require( '@stdlib/utils/nonindex-keys' ); +const nonIndexKeys = require( '@stdlib/utils/nonindex-keys' ); function Foo() { this[ 0 ] = 3.14; @@ -78,8 +78,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var keys = nonIndexKeys( obj ); +const obj = new Foo(); +const keys = nonIndexKeys( obj ); console.log( keys ); // e.g., => [ 'beep', 'a' ] diff --git a/lib/node_modules/@stdlib/utils/noop/README.md b/lib/node_modules/@stdlib/utils/noop/README.md index f2aac118b0dc..0a3143322705 100644 --- a/lib/node_modules/@stdlib/utils/noop/README.md +++ b/lib/node_modules/@stdlib/utils/noop/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var noop = require( '@stdlib/utils/noop' ); +const noop = require( '@stdlib/utils/noop' ); ``` #### noop() @@ -50,7 +50,7 @@ noop(); ```javascript -var noop = require( '@stdlib/utils/noop' ); +const noop = require( '@stdlib/utils/noop' ); function foo( next ) { // Do something... diff --git a/lib/node_modules/@stdlib/utils/object-inverse-by/README.md b/lib/node_modules/@stdlib/utils/object-inverse-by/README.md index 3fd534f6fb2a..24319ae2b8b7 100644 --- a/lib/node_modules/@stdlib/utils/object-inverse-by/README.md +++ b/lib/node_modules/@stdlib/utils/object-inverse-by/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invertBy = require( '@stdlib/utils/object-inverse-by' ); +const invertBy = require( '@stdlib/utils/object-inverse-by' ); ``` #### invertBy( obj, \[options,] transform ) @@ -38,11 +38,11 @@ Inverts an `object`, such that keys become values and values become keys, accord function transform( key, value ) { return value; } -var obj = { +const obj = { 'a': 'beep', 'b': 'boop' }; -var out = invertBy( obj, transform ); +const out = invertBy( obj, transform ); // returns { 'beep': 'a', 'boop': 'b' } ``` @@ -56,11 +56,11 @@ By default, keys mapped to duplicate values are stored in `arrays`. function transform( key, value ) { return value; } -var obj = { +const obj = { 'a': 'beep', 'b': 'beep' }; -var out = invertBy( obj, transform ); +const out = invertBy( obj, transform ); // returns { 'beep': [ 'a', 'b' ] } ``` @@ -70,15 +70,15 @@ To **not** allow duplicates, set the `duplicates` option to `false`. The output function transform( key, value ) { return value; } -var obj = {}; +const obj = {}; obj.a = 'beep'; obj.b = 'boop'; obj.c = 'beep'; // inserted after `a` -var opts = { +const opts = { 'duplicates': false }; -var out = invertBy( obj, opts, transform ); +const out = invertBy( obj, opts, transform ); // returns { 'beep': 'c', 'boop': 'b' } ``` @@ -95,12 +95,12 @@ function transform( key, value, o ) { } return o.name + ':' + value; } -var obj = { +const obj = { 'name': 'foo', 'a': 'beep', 'b': 'boop' }; -var out = invertBy( obj, transform ); +const out = invertBy( obj, transform ); // returns { 'foo': 'name', 'foo:beep': 'a', 'foo:boop': 'b' } ``` @@ -118,14 +118,14 @@ var out = invertBy( obj, transform ); function transform( key, value ) { return value; } - var obj = { + const obj = { 'a': [ 1, 2, 3 ], 'b': { 'c': 'd' } }; - var out = invertBy( obj, transform ); + const out = invertBy( obj, transform ); // returns { '1,2,3': 'a', '[object Object]': 'b' } ``` @@ -142,28 +142,23 @@ var out = invertBy( obj, transform ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var invertBy = require( '@stdlib/utils/object-inverse-by' ); - -var keys; -var arr; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const invertBy = require( '@stdlib/utils/object-inverse-by' ); function transform( key, value ) { return value; } // Create an array of random integers... -arr = new Array( 1000 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 1000 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } // Invert the array to determine value frequency... -out = invertBy( arr, transform ); -keys = Object.keys( out ); -for ( i = 0; i < keys.length; i++ ) { +const out = invertBy( arr, transform ); +const keys = Object.keys( out ); +for ( let i = 0; i < keys.length; i++ ) { if ( out[ i ] ) { out[ i ] = out[ i ].length; } else { diff --git a/lib/node_modules/@stdlib/utils/object-inverse/README.md b/lib/node_modules/@stdlib/utils/object-inverse/README.md index a33fe8d63fd8..24d34e198fe7 100644 --- a/lib/node_modules/@stdlib/utils/object-inverse/README.md +++ b/lib/node_modules/@stdlib/utils/object-inverse/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var invert = require( '@stdlib/utils/object-inverse' ); +const invert = require( '@stdlib/utils/object-inverse' ); ``` #### invert( obj\[, options] ) @@ -35,7 +35,7 @@ var invert = require( '@stdlib/utils/object-inverse' ); Inverts an `object`, such that keys become values and values become keys. ```javascript -var out = invert({ +const out = invert({ 'a': 'beep', 'b': 'boop' }); @@ -49,7 +49,7 @@ The function accepts the following `options`: By default, keys mapped to duplicate values are stored in `arrays`. ```javascript -var out = invert({ +const out = invert({ 'a': 'beep', 'b': 'beep' }); @@ -59,12 +59,12 @@ var out = invert({ To **not** allow duplicates, set the `duplicates` option to `false`. The output `key-value` pair will be the `key` most recently inserted into the input `object`. ```javascript -var obj = {}; +const obj = {}; obj.a = 'beep'; obj.b = 'boop'; obj.c = 'beep'; // inserted after `a` -var out = invert( obj, { +const out = invert( obj, { 'duplicates': false }); // returns { 'beep': 'c', 'boop': 'b' } @@ -81,14 +81,14 @@ var out = invert( obj, { - Beware when providing `objects` having values which are themselves `objects`. This implementation relies on native `object` serialization (`#toString`) when converting values to keys. ```javascript - var obj = { + const obj = { 'a': [ 1, 2, 3 ], 'b': { 'c': 'd' } }; - var out = invert( obj ); + const out = invert( obj ); // returns { '1,2,3': 'a', '[object Object]': 'b' } ``` @@ -105,24 +105,19 @@ var out = invert( obj, { ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var invert = require( '@stdlib/utils/object-inverse' ); - -var keys; -var arr; -var out; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const invert = require( '@stdlib/utils/object-inverse' ); // Create an array of random integers... -arr = new Array( 1000 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 1000 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = round( randu()*100.0 ); } // Invert the array to determine value frequency... -out = invert( arr ); -keys = Object.keys( out ); -for ( i = 0; i < keys.length; i++ ) { +const out = invert( arr ); +const keys = Object.keys( out ); +for ( let i = 0; i < keys.length; i++ ) { if ( out[ i ] ) { out[ i ] = out[ i ].length; } else { diff --git a/lib/node_modules/@stdlib/utils/omit-by/README.md b/lib/node_modules/@stdlib/utils/omit-by/README.md index bf6a713c7e4d..11bc18f8cde1 100644 --- a/lib/node_modules/@stdlib/utils/omit-by/README.md +++ b/lib/node_modules/@stdlib/utils/omit-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var omitBy = require( '@stdlib/utils/omit-by' ); +const omitBy = require( '@stdlib/utils/omit-by' ); ``` #### omitBy( obj, predicate ) @@ -49,13 +49,13 @@ function predicate( key, value ) { return ( value > 1 ); } -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = omitBy( obj1, predicate ); +const obj2 = omitBy( obj1, predicate ); // returns { 'a': 1 } ``` @@ -85,20 +85,20 @@ var obj2 = omitBy( obj1, predicate ); ```javascript -var omitBy = require( '@stdlib/utils/omit-by' ); +const omitBy = require( '@stdlib/utils/omit-by' ); function predicate( key, value ) { return ( typeof value === 'number' ); } -var obj1 = { +const obj1 = { 'a': '1', 'b': 2, 'c': NaN, 'd': null }; -var obj2 = omitBy( obj1, predicate ); +const obj2 = omitBy( obj1, predicate ); // returns { 'a': '1', 'd': null } ``` diff --git a/lib/node_modules/@stdlib/utils/omit/README.md b/lib/node_modules/@stdlib/utils/omit/README.md index 85c98e4686eb..5ee19040c3b4 100644 --- a/lib/node_modules/@stdlib/utils/omit/README.md +++ b/lib/node_modules/@stdlib/utils/omit/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var omit = require( '@stdlib/utils/omit' ); +const omit = require( '@stdlib/utils/omit' ); ``` #### omit( obj, keys ) @@ -45,29 +45,29 @@ var omit = require( '@stdlib/utils/omit' ); Returns a partial copy of an `object`, which excludes specified `keys`. ```javascript -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = omit( obj1, 'b' ); +const obj2 = omit( obj1, 'b' ); // returns { 'a': 1, 'c': 3 } -var obj3 = omit( obj1, [ 'b', 'c' ] ); +const obj3 = omit( obj1, [ 'b', 'c' ] ); // returns { 'a': 1 } ``` The function **ignores** non-existent and inherited keys. ```javascript -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = omit( obj1, 'd' ); +const obj2 = omit( obj1, 'd' ); // returns { 'a': 1, 'b': 2, 'c': 3 } ``` @@ -97,9 +97,9 @@ var obj2 = omit( obj1, 'd' ); ```javascript -var omit = require( '@stdlib/utils/omit' ); +const omit = require( '@stdlib/utils/omit' ); -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3, @@ -107,7 +107,7 @@ var obj1 = { 'e': 5 }; -var obj2 = omit( obj1, [ 'b', 'c', 'e' ] ); +const obj2 = omit( obj1, [ 'b', 'c', 'e' ] ); // returns { 'a': 1, 'd': 4 } ``` diff --git a/lib/node_modules/@stdlib/utils/open-url/README.md b/lib/node_modules/@stdlib/utils/open-url/README.md index 27919048316b..b7dcdc9cf2b2 100644 --- a/lib/node_modules/@stdlib/utils/open-url/README.md +++ b/lib/node_modules/@stdlib/utils/open-url/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var openURL = require( '@stdlib/utils/open-url' ); +const openURL = require( '@stdlib/utils/open-url' ); ``` #### openURL( url ) @@ -37,7 +37,7 @@ Opens a URL in a user's default browser. ```javascript -var proc = openURL( 'https://google.com' ); +const proc = openURL( 'https://google.com' ); ``` The returned child process is unreferenced, and, thus, the calling process will not wait for the child process to end before exiting. To try and end the child process, send an appropriate `kill` signal. @@ -47,7 +47,7 @@ The returned child process is unreferenced, and, thus, the calling process will ```javascript -var proc = openURL( 'https://google.com' ); +const proc = openURL( 'https://google.com' ); function close() { proc.kill( 'SIGINT' ); @@ -67,7 +67,7 @@ Opens a URL either in a new tab or window (based on the web browser and/or user ```javascript -var win = openURL( 'https://google.com' ); +const win = openURL( 'https://google.com' ); ``` @@ -85,10 +85,10 @@ var win = openURL( 'https://google.com' ); ```javascript -var openURL = require( '@stdlib/utils/open-url' ); +const openURL = require( '@stdlib/utils/open-url' ); // Open a URL: -var proc = openURL( 'https://github.com' ); +const proc = openURL( 'https://github.com' ); // After some time, kill the spawned process... function close() { diff --git a/lib/node_modules/@stdlib/utils/papply-right/README.md b/lib/node_modules/@stdlib/utils/papply-right/README.md index 3e6d19f27fae..1bc4ee98b8e9 100644 --- a/lib/node_modules/@stdlib/utils/papply-right/README.md +++ b/lib/node_modules/@stdlib/utils/papply-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var papplyRight = require( '@stdlib/utils/papply-right' ); +const papplyRight = require( '@stdlib/utils/papply-right' ); ``` #### papplyRight( fcn\[, ...args] ) @@ -49,9 +49,9 @@ function say( text, name ) { return text + ', ' + name + '.'; } -var toSusan = papplyRight( say, 'Susan B. Anthony' ); +const toSusan = papplyRight( say, 'Susan B. Anthony' ); -var str = toSusan( 'Thank you' ); +let str = toSusan( 'Thank you' ); // returns 'Thank you, Susan B. Anthony.' str = toSusan( 'Never forget' ); @@ -85,28 +85,21 @@ str = toSusan( 'Never forget' ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var papplyRight = require( '@stdlib/utils/papply-right' ); - -var fcn; -var x; -var y; -var z; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const papplyRight = require( '@stdlib/utils/papply-right' ); function add( x, y, z, w, t, s ) { return x + y + z + w + t + s; } -fcn = papplyRight( add, 5, 4, 3 ); +const fcn = papplyRight( add, 5, 4, 3 ); -for ( i = 0; i < 100; i++ ) { - x = floor( randu() * 5 ); - y = floor( randu() * 10 ); - z = floor( randu() * 15 ); - v = fcn( x, y, z ); +for ( let i = 0; i < 100; i++ ) { + const x = floor( randu() * 5 ); + const y = floor( randu() * 10 ); + const z = floor( randu() * 15 ); + const v = fcn( x, y, z ); console.log( '%d+%d+%d+5+4+3 = %d', x, y, z, v ); } ``` diff --git a/lib/node_modules/@stdlib/utils/papply/README.md b/lib/node_modules/@stdlib/utils/papply/README.md index d98207855c1a..db4d2ff2b7ff 100644 --- a/lib/node_modules/@stdlib/utils/papply/README.md +++ b/lib/node_modules/@stdlib/utils/papply/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var papply = require( '@stdlib/utils/papply' ); +const papply = require( '@stdlib/utils/papply' ); ``` #### papply( fcn\[, ...args] ) @@ -49,9 +49,9 @@ function add( x, y ) { return x + y; } -var add2 = papply( add, 2 ); +const add2 = papply( add, 2 ); -var sum = add2( 3 ); +let sum = add2( 3 ); // returns 5 sum = add2( 7 ); @@ -84,28 +84,21 @@ sum = add2( 7 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var papply = require( '@stdlib/utils/papply' ); - -var fcn; -var w; -var t; -var s; -var v; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const papply = require( '@stdlib/utils/papply' ); function add( x, y, z, w, t, s ) { return x + y + z + w + t + s; } -fcn = papply( add, 5, 4, 3 ); +const fcn = papply( add, 5, 4, 3 ); -for ( i = 0; i < 100; i++ ) { - w = floor( randu() * 5 ); - t = floor( randu() * 10 ); - s = floor( randu() * 15 ); - v = fcn( w, t, s ); +for ( let i = 0; i < 100; i++ ) { + const w = floor( randu() * 5 ); + const t = floor( randu() * 10 ); + const s = floor( randu() * 15 ); + const v = fcn( w, t, s ); console.log( '5+4+3+%d+%d+%d = %d', w, t, s, v ); } ``` diff --git a/lib/node_modules/@stdlib/utils/parallel/README.md b/lib/node_modules/@stdlib/utils/parallel/README.md index 8a069dc88b36..32a019818766 100644 --- a/lib/node_modules/@stdlib/utils/parallel/README.md +++ b/lib/node_modules/@stdlib/utils/parallel/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var parallel = require( '@stdlib/utils/parallel' ); +const parallel = require( '@stdlib/utils/parallel' ); ``` #### parallel( files, \[options,] clbk ) @@ -216,19 +216,16 @@ parallel( files, opts, done ); ```javascript -var fs = require( 'fs' ); -var path = require( 'path' ); -var writeFileSync = require( '@stdlib/fs/write-file' ).sync; -var unlinkSync = require( '@stdlib/fs/unlink' ).sync; -var parallel = require( '@stdlib/utils/parallel' ); +const fs = require( 'fs' ); +const path = require( 'path' ); +const writeFileSync = require( '@stdlib/fs/write-file' ).sync; +const unlinkSync = require( '@stdlib/fs/unlink' ).sync; +const parallel = require( '@stdlib/utils/parallel' ); -var nFiles = 100; -var files; -var opts; -var dir; +const nFiles = 100; function template( id ) { - var file = ''; + let file = ''; file += '\'use strict\';'; @@ -248,21 +245,16 @@ function template( id ) { } function createDir() { - var dir = path.join( __dirname, 'examples', 'tmp' ); + const dir = path.join( __dirname, 'examples', 'tmp' ); fs.mkdirSync( dir ); return dir; } function createScripts( dir, nFiles ) { - var content; - var fpath; - var files; - var i; - - files = new Array( nFiles ); - for ( i = 0; i < nFiles; i++ ) { - content = template( i.toString() ); - fpath = path.join( dir, i+'.js' ); + const files = new Array( nFiles ); + for ( let i = 0; i < nFiles; i++ ) { + const content = template( i.toString() ); + const fpath = path.join( dir, i+'.js' ); writeFileSync( fpath, content, { 'encoding': 'utf8' }); @@ -271,11 +263,15 @@ function createScripts( dir, nFiles ) { return files; } -function cleanup() { - var i; +// Make a temporary directory to store files... +const dir = createDir(); +// Create temporary files... +const files = createScripts( dir, nFiles ); + +function cleanup() { // Delete the temporary files... - for ( i = 0; i < files.length; i++ ) { + for ( let i = 0; i < files.length; i++ ) { unlinkSync( files[ i ] ); } // Remove temporary directory: @@ -290,14 +286,8 @@ function done( error ) { console.log( 'Done!' ); } -// Make a temporary directory to store files... -dir = createDir(); - -// Create temporary files... -files = createScripts( dir, nFiles ); - // Set the runner options: -opts = { +const opts = { 'concurrency': 3, 'workers': 3, 'ordered': false diff --git a/lib/node_modules/@stdlib/utils/parse-json/README.md b/lib/node_modules/@stdlib/utils/parse-json/README.md index 771503160b64..262af9d2e84f 100644 --- a/lib/node_modules/@stdlib/utils/parse-json/README.md +++ b/lib/node_modules/@stdlib/utils/parse-json/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); ``` #### parseJSON( str\[, reviver] ) @@ -35,14 +35,14 @@ var parseJSON = require( '@stdlib/utils/parse-json' ); Parses a `string` as [JSON][json]. ```javascript -var out = parseJSON( '{"beep":"boop"}' ); +const out = parseJSON( '{"beep":"boop"}' ); // returns {'beep':'boop'} ``` If unable to parse a `string` as [JSON][json], the function returns an error. ```javascript -var out = parseJSON( 'beep' ); +const out = parseJSON( 'beep' ); // returns ``` @@ -58,8 +58,8 @@ function reviver( key, value ) { } } -var str = '{"beep":"boop","a":"b"}'; -var out = parseJSON( str, reviver ); +const str = '{"beep":"boop","a":"b"}'; +const out = parseJSON( str, reviver ); // returns {'beep':'boop'} ``` @@ -74,7 +74,7 @@ var out = parseJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation throws a `TypeError` if provided **any** value which is not a `string`. ```javascript - var out = JSON.parse( null ); + let out = JSON.parse( null ); // returns null out = parseJSON( null ); @@ -84,7 +84,7 @@ var out = parseJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation does **not** throw a `SyntaxError` if unable to parse a `string` as [JSON][json]. ```javascript - var out = parseJSON( '{"beep":"boop}' ); + let out = parseJSON( '{"beep":"boop}' ); // returns out = JSON.parse( '{"beep":"boop}' ); @@ -94,7 +94,7 @@ var out = parseJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation throws a `TypeError` if provided a `reviver` argument which is **not** a `function`. ```javascript - var out = JSON.parse( '{"a":"b"}', [] ); + let out = JSON.parse( '{"a":"b"}', [] ); // returns {'a':'b'} out = parseJSON( '{"a":"b"}', [] ); @@ -112,11 +112,9 @@ var out = parseJSON( str, reviver ); ```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); +const parseJSON = require( '@stdlib/utils/parse-json' ); -var out; - -out = parseJSON( '{"beep":"boop"}' ); +let out = parseJSON( '{"beep":"boop"}' ); // returns {'beep':'boop'} out = parseJSON( '3.14' ); diff --git a/lib/node_modules/@stdlib/utils/parse-ndjson/README.md b/lib/node_modules/@stdlib/utils/parse-ndjson/README.md index d93c24e8f56b..aa97c8da26cf 100644 --- a/lib/node_modules/@stdlib/utils/parse-ndjson/README.md +++ b/lib/node_modules/@stdlib/utils/parse-ndjson/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var parseNDJSON = require( '@stdlib/utils/parse-ndjson' ); +const parseNDJSON = require( '@stdlib/utils/parse-ndjson' ); ``` #### parseNDJSON( str\[, reviver] ) @@ -35,7 +35,7 @@ var parseNDJSON = require( '@stdlib/utils/parse-ndjson' ); Parses a `string` as `newline-delimited JSON`. ```javascript -var out = parseNDJSON( '{"beep":"boop"}\n{"example":42}' ); +const out = parseNDJSON( '{"beep":"boop"}\n{"example":42}' ); // returns [ { 'beep': 'boop' }, { 'example': 42 } ] ``` @@ -49,8 +49,8 @@ function reviver( key, value ) { return ( typeof value === 'number' ) ? value * 2 : value; } -var str = '{"beep":"boop"}\n{"value": 20}\n{"numbers": [1,2,3]}'; -var out = parseNDJSON( str, reviver ); +const str = '{"beep":"boop"}\n{"value": 20}\n{"numbers": [1,2,3]}'; +const out = parseNDJSON( str, reviver ); // returns [ { 'beep' : 'BOOP' }, { 'value': 40 }, { 'numbers': [ 2, 4, 6 ] } ] ``` @@ -65,7 +65,7 @@ var out = parseNDJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation parses `string` as `newline-delimited JSON` and returns an array of parsed JSONs. ```javascript - var out = JSON.parse( '{"beep":"boop"}\n{"foo":"baz"}' ); + let out = JSON.parse( '{"beep":"boop"}\n{"foo":"baz"}' ); // throws out = parseNDJSON( '{"beep":"boop"}\n{"foo":"baz"}' ); @@ -76,7 +76,7 @@ var out = parseNDJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation throws a TypeError if provided any value which is not a `string`. ```javascript - var out = JSON.parse( null ); + let out = JSON.parse( null ); // returns null out = parseNDJSON( null ); @@ -87,7 +87,7 @@ var out = parseNDJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation does **not** throw a SyntaxError if unable to parse a string as newline-delimited JSON. ```javascript - var out = parseNDJSON( '{"beep":boop}' ); + let out = parseNDJSON( '{"beep":boop}' ); // returns out = JSON.parse( '{"beep":boop}' ); @@ -98,7 +98,7 @@ var out = parseNDJSON( str, reviver ); - In contrast to the native [`JSON.parse()`][json-parse], this implementation throws a TypeError if provided a reviver argument which is not a function. ```javascript - var out = JSON.parse( '{"a":"b"}', [] ); + let out = JSON.parse( '{"a":"b"}', [] ); // returns { 'a': 'b' } out = parseNDJSON( '{"a":"b"}', [] ); @@ -116,9 +116,9 @@ var out = parseNDJSON( str, reviver ); ```javascript -var parseNDJSON = require( '@stdlib/utils/parse-ndjson' ); +const parseNDJSON = require( '@stdlib/utils/parse-ndjson' ); -var out = parseNDJSON( '{"name":"John"}\n{"name":"Doe"}' ); +let out = parseNDJSON( '{"name":"John"}\n{"name":"Doe"}' ); // returns [ { 'name': 'John' }, { 'name': 'Doe' } ] function reviver( key, value ) { diff --git a/lib/node_modules/@stdlib/utils/pick-arguments/README.md b/lib/node_modules/@stdlib/utils/pick-arguments/README.md index d6dd1ad04703..7f151763edf1 100644 --- a/lib/node_modules/@stdlib/utils/pick-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/pick-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pickArguments = require( '@stdlib/utils/pick-arguments' ); +const pickArguments = require( '@stdlib/utils/pick-arguments' ); ``` #### pickArguments( fcn, indices\[, thisArg] ) @@ -49,9 +49,9 @@ function foo( a, b ) { return [ a, b ]; } -var bar = pickArguments( foo, [ 0, 2 ] ); +const bar = pickArguments( foo, [ 0, 2 ] ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 1, 3 ] ``` @@ -69,16 +69,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = pickArguments( foo.scale, [ 0, 2 ], ctx ); +const bar = pickArguments( foo.scale, [ 0, 2 ], ctx ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 10, 60 ] ``` @@ -103,22 +103,19 @@ var out = bar( 1, 2, 3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var pickArguments = require( '@stdlib/utils/pick-arguments' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const pickArguments = require( '@stdlib/utils/pick-arguments' ); function fill( i ) { return i; } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); -// Compute the sum of consecutive elements... -var f; -var i; -for ( i = 1; i < x.length; i++ ) { - f = pickArguments( add, [ i-1, i ] ); +for ( let i = 1; i < x.length; i++ ) { + const f = pickArguments( add, [ i-1, i ] ); console.log( 'sum(x_%d, x_%d) = %d', i-1, i, f.apply( null, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/utils/pick-by/README.md b/lib/node_modules/@stdlib/utils/pick-by/README.md index 4972db31ab0d..c50cc6834d93 100644 --- a/lib/node_modules/@stdlib/utils/pick-by/README.md +++ b/lib/node_modules/@stdlib/utils/pick-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pickBy = require( '@stdlib/utils/pick-by' ); +const pickBy = require( '@stdlib/utils/pick-by' ); ``` #### pickBy( obj, predicate ) @@ -49,13 +49,13 @@ function predicate( key, value ) { return ( value > 1 ); } -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = pickBy( obj1, predicate ); +const obj2 = pickBy( obj1, predicate ); // returns { 'b': 2, 'c': 3 } ``` @@ -85,20 +85,20 @@ var obj2 = pickBy( obj1, predicate ); ```javascript -var pickBy = require( '@stdlib/utils/pick-by' ); +const pickBy = require( '@stdlib/utils/pick-by' ); function predicate( key, value ) { return ( typeof value === 'number' ); } -var obj1 = { +const obj1 = { 'a': '1', 'b': 2, 'c': NaN, 'd': null }; -var obj2 = pickBy( obj1, predicate ); +const obj2 = pickBy( obj1, predicate ); // returns { 'b': 2, 'c': NaN } ``` diff --git a/lib/node_modules/@stdlib/utils/pick/README.md b/lib/node_modules/@stdlib/utils/pick/README.md index f346c31ca4e8..bda0ffc4752f 100644 --- a/lib/node_modules/@stdlib/utils/pick/README.md +++ b/lib/node_modules/@stdlib/utils/pick/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pick = require( '@stdlib/utils/pick' ); +const pick = require( '@stdlib/utils/pick' ); ``` #### pick( obj, keys ) @@ -45,29 +45,29 @@ var pick = require( '@stdlib/utils/pick' ); Returns a partial copy of an `object`. The returned `object` contains only specified `keys`. ```javascript -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = pick( obj1, 'b' ); +const obj2 = pick( obj1, 'b' ); // returns { 'b': 2 } -var obj3 = pick( obj1, [ 'b', 'c' ] ); +const obj3 = pick( obj1, [ 'b', 'c' ] ); // returns { 'b': 2, 'c': 3 } ``` If a key does not exist as an **own** property in a source `object`, the key is ignored. ```javascript -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3 }; -var obj2 = pick( obj1, 'd' ); +const obj2 = pick( obj1, 'd' ); // returns {} ``` @@ -97,9 +97,9 @@ var obj2 = pick( obj1, 'd' ); ```javascript -var pick = require( '@stdlib/utils/pick' ); +const pick = require( '@stdlib/utils/pick' ); -var obj1 = { +const obj1 = { 'a': 1, 'b': 2, 'c': 3, @@ -107,7 +107,7 @@ var obj1 = { 'e': 5 }; -var obj2 = pick( obj1, [ 'b', 'c', 'e' ] ); +const obj2 = pick( obj1, [ 'b', 'c', 'e' ] ); // returns { 'b': 2, 'c': 3, 'e': 5 } ``` diff --git a/lib/node_modules/@stdlib/utils/pluck/README.md b/lib/node_modules/@stdlib/utils/pluck/README.md index 8a4a3ab836c1..e8ef15deafdb 100644 --- a/lib/node_modules/@stdlib/utils/pluck/README.md +++ b/lib/node_modules/@stdlib/utils/pluck/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var pluck = require( '@stdlib/utils/pluck' ); +const pluck = require( '@stdlib/utils/pluck' ); ``` #### pluck( arr, prop\[, options] ) @@ -43,12 +43,12 @@ Extracts a property value from each element of an object `array`. ```javascript -var arr = [ +const arr = [ { 'a': 1, 'b': 2 }, { 'a': 0.5, 'b': 3 } ]; -var out = pluck( arr, 'a' ); +const out = pluck( arr, 'a' ); // returns [ 1, 0.5 ] ``` @@ -61,15 +61,15 @@ By default, the function returns a new data structure. To mutate the input data ```javascript -var arr = [ +const arr = [ { 'a': 1, 'b': 2 }, { 'a': 0.5, 'b': 3 } ]; -var out = pluck( arr, 'a', { 'copy': false } ); +const out = pluck( arr, 'a', { 'copy': false } ); // returns [ 1, 0.5 ] -var bool = ( arr[ 0 ] === out[ 0 ] ); +const bool = ( arr[ 0 ] === out[ 0 ] ); // returns true ``` @@ -86,14 +86,14 @@ var bool = ( arr[ 0 ] === out[ 0 ] ); ```javascript - var arr = [ + const arr = [ { 'a': 1, 'b': 2 }, null, void 0, { 'a': 0.5, 'b': 3 } ]; - var out = pluck( arr, 'a' ); + const out = pluck( arr, 'a' ); // returns [ 1, , , 0.5 ] ``` @@ -102,15 +102,15 @@ var bool = ( arr[ 0 ] === out[ 0 ] ); ```javascript - var arr = [ + const arr = [ { 'a': { 'b': 2 } }, { 'a': { 'b': 3 } } ]; - var out = pluck( arr, 'a' ); + const out = pluck( arr, 'a' ); // returns [ { 'b': 2 }, { 'b': 3 } ] - var bool = ( arr[ 0 ].a === out[ 0 ] ); + const bool = ( arr[ 0 ].a === out[ 0 ] ); // returns true ``` @@ -119,20 +119,20 @@ var bool = ( arr[ 0 ] === out[ 0 ] ); ```javascript - var copy = require( '@stdlib/utils/copy' ); + const copy = require( '@stdlib/utils/copy' ); - var arr = [ + const arr = [ { 'a': { 'b': 2 } }, { 'a': { 'b': 3 } } ]; - var out = pluck( arr, 'a' ); + let out = pluck( arr, 'a' ); // returns [ { 'b': 2 }, { 'b': 3 } ] // Perform a deep copy: out = copy( out ); - var bool = ( arr[ 0 ].a === out[ 0 ] ); + const bool = ( arr[ 0 ].a === out[ 0 ] ); // returns false ``` @@ -147,27 +147,21 @@ var bool = ( arr[ 0 ] === out[ 0 ] ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var pluck = require( '@stdlib/utils/pluck' ); - -var arr; -var tmp; -var out; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const round = require( '@stdlib/math/base/special/round' ); +const pluck = require( '@stdlib/utils/pluck' ); // Generate a 100x5 2d-array... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - tmp = new Array( 5 ); - for ( j = 0; j < tmp.length; j++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const tmp = new Array( 5 ); + for ( let j = 0; j < tmp.length; j++ ) { tmp[ j ] = round( randu()*100.0*(j+1.0) ); } arr[ i ] = tmp; } // Pluck the 3rd column: -out = pluck( arr, 2 ); +const out = pluck( arr, 2 ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/pop/README.md b/lib/node_modules/@stdlib/utils/pop/README.md index 968e36c87c45..c46e897bb33c 100644 --- a/lib/node_modules/@stdlib/utils/pop/README.md +++ b/lib/node_modules/@stdlib/utils/pop/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var pop = require( '@stdlib/utils/pop' ); +const pop = require( '@stdlib/utils/pop' ); ``` #### pop( collection ) @@ -45,37 +45,37 @@ var pop = require( '@stdlib/utils/pop' ); Removes and returns the last element of a `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = pop( arr ); +const out = pop( arr ); // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ] -var bool = ( out[ 0 ] === arr ); +const bool = ( out[ 0 ] === arr ); // returns true -var lastValue = out[ 1 ]; +const lastValue = out[ 1 ]; // returns 5.0 ``` In contrast to [`Array.prototype.pop`][mdn-array-pop] which returns only the removed element, the function also returns the shortened collection. For [typed arrays][mdn-typed-array] having a length greater than `0`, the returned collection is a new [typed array][mdn-typed-array] view. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var arr = new Float64Array( 2 ); +const arr = new Float64Array( 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = pop( arr ); +const out = pop( arr ); // returns [ [ 1.0 ], 2.0 ] -var bool = ( out[ 0 ] === arr ); +let bool = ( out[ 0 ] === arr ); // returns false bool = ( out[ 0 ].buffer === arr.buffer ); // returns true -var lastValue = out[ 1 ]; +const lastValue = out[ 1 ]; // returns 2.0 ``` @@ -104,16 +104,12 @@ var lastValue = out[ 1 ]; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var pop = require( '@stdlib/utils/pop' ); +const Float64Array = require( '@stdlib/array/float64' ); +const pop = require( '@stdlib/utils/pop' ); -var arr; -var out; -var i; - -arr = new Float64Array( 100 ); -for ( i = 0; i < 100; i++ ) { - out = pop( arr ); +let arr = new Float64Array( 100 ); +for ( let i = 0; i < 100; i++ ) { + const out = pop( arr ); arr = out[ 0 ]; console.log( 'Length: %d', arr.length ); } diff --git a/lib/node_modules/@stdlib/utils/prepend/README.md b/lib/node_modules/@stdlib/utils/prepend/README.md index b0af4be57af7..4a5b979ff24c 100644 --- a/lib/node_modules/@stdlib/utils/prepend/README.md +++ b/lib/node_modules/@stdlib/utils/prepend/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var prepend = require( '@stdlib/utils/prepend' ); +const prepend = require( '@stdlib/utils/prepend' ); ``` #### prepend( collection1, collection2 ) @@ -45,31 +45,31 @@ var prepend = require( '@stdlib/utils/prepend' ); Adds elements from one `collection` to the beginning of another `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = prepend( arr, [ 6.0, 7.0 ] ); +const out = prepend( arr, [ 6.0, 7.0 ] ); // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` Note that the function returns the extended collection. For [typed arrays][mdn-typed-array], the returned value is a new [typed array][mdn-typed-array] view whose underlying [`ArrayBuffer`][mdn-arraybuffer] may **not** equal the underlying [`ArrayBuffer`][mdn-arraybuffer] for the input `collection`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Float64Array = require( '@stdlib/array/float64' ); -var buf = new ArrayBuffer( 3*8 ); // 8 bytes per double +const buf = new ArrayBuffer( 3*8 ); // 8 bytes per double -var arr = new Float64Array( buf, 8, 2 ); +const arr = new Float64Array( buf, 8, 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = prepend( arr, [ 3.0 ] ); +let out = prepend( arr, [ 3.0 ] ); // returns [ 3.0, 1.0, 2.0 ] -var bool = ( out === arr ); +let bool = ( out === arr ); // returns false bool = ( out.buffer === arr.buffer ); @@ -108,16 +108,12 @@ bool = ( out.buffer === arr.buffer ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var prepend = require( '@stdlib/utils/prepend' ); +const Float64Array = require( '@stdlib/array/float64' ); +const prepend = require( '@stdlib/utils/prepend' ); -var arr; -var i; -var j; - -arr = new Float64Array(); -for ( i = 0; i < 100; i++ ) { - j = i * 3; +let arr = new Float64Array(); +for ( let i = 0; i < 100; i++ ) { + const j = i * 3; arr = prepend( arr, [ j+2, j+1, j ] ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/utils/properties-in/README.md b/lib/node_modules/@stdlib/utils/properties-in/README.md index cd7c5b2254c2..8a6f82cffcae 100644 --- a/lib/node_modules/@stdlib/utils/properties-in/README.md +++ b/lib/node_modules/@stdlib/utils/properties-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertiesIn = require( '@stdlib/utils/properties-in' ); +const propertiesIn = require( '@stdlib/utils/properties-in' ); ``` #### propertiesIn( obj ) @@ -35,7 +35,7 @@ var propertiesIn = require( '@stdlib/utils/properties-in' ); Returns an `array` of an object's own and inherited property names and [symbols][@stdlib/symbol/ctor]. ```javascript -var props = propertiesIn( [] ); +const props = propertiesIn( [] ); // returns [...] ``` @@ -56,11 +56,11 @@ var props = propertiesIn( [] ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var propertiesIn = require( '@stdlib/utils/properties-in' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const propertiesIn = require( '@stdlib/utils/properties-in' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'b'; @@ -75,8 +75,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'foo' ) ] = 'bar'; } -var obj = new Foo(); -var props = propertiesIn( obj ); +const obj = new Foo(); +const props = propertiesIn( obj ); // returns [ 'a', 'foo', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/properties/README.md b/lib/node_modules/@stdlib/utils/properties/README.md index 4278a1c1de34..4b0f8270a2ee 100644 --- a/lib/node_modules/@stdlib/utils/properties/README.md +++ b/lib/node_modules/@stdlib/utils/properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var properties = require( '@stdlib/utils/properties' ); +const properties = require( '@stdlib/utils/properties' ); ``` #### properties( obj ) @@ -35,12 +35,12 @@ var properties = require( '@stdlib/utils/properties' ); Returns an `array` of an object's own enumerable and non-enumerable property names and symbols. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var props = properties( obj ); +const props = properties( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -65,8 +65,8 @@ var props = properties( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var properties = require( '@stdlib/utils/properties' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const properties = require( '@stdlib/utils/properties' ); function Foo() { this.beep = 'boop'; @@ -84,8 +84,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var props = properties( obj ); +const obj = new Foo(); +const props = properties( obj ); console.log( props ); // e.g., => [ 'beep', 'a', 'baz' ] diff --git a/lib/node_modules/@stdlib/utils/property-descriptor-in/README.md b/lib/node_modules/@stdlib/utils/property-descriptor-in/README.md index bb224b66ec53..bae9f1c39a68 100644 --- a/lib/node_modules/@stdlib/utils/property-descriptor-in/README.md +++ b/lib/node_modules/@stdlib/utils/property-descriptor-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' ); +const propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' ); ``` #### propertyDescriptorIn( obj, property ) @@ -35,12 +35,12 @@ var propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' ); Returns a property descriptor for an object's own or inherited property. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var desc = propertyDescriptorIn( obj, 'a' ); +const desc = propertyDescriptorIn( obj, 'a' ); // returns {'configurable':true,'enumerable':true,'writable':true,'value':1} ``` @@ -68,8 +68,8 @@ var desc = propertyDescriptorIn( obj, 'a' ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' ); function Foo() { this.beep = 'boop'; @@ -87,8 +87,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = propertyDescriptorIn( obj, 'foo' ); +const obj = new Foo(); +const desc = propertyDescriptorIn( obj, 'foo' ); console.log( desc ); // => {'configurable':true,'enumerable':true,'writable':true,'value':['bar']} diff --git a/lib/node_modules/@stdlib/utils/property-descriptor/README.md b/lib/node_modules/@stdlib/utils/property-descriptor/README.md index 46db8d719595..981eb3e9ffb1 100644 --- a/lib/node_modules/@stdlib/utils/property-descriptor/README.md +++ b/lib/node_modules/@stdlib/utils/property-descriptor/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); +const propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); ``` #### propertyDescriptor( obj, property ) @@ -35,12 +35,12 @@ var propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); Returns a property descriptor for an object's own property. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var desc = propertyDescriptor( obj, 'a' ); +const desc = propertyDescriptor( obj, 'a' ); // returns {'configurable':true,'enumerable':true,'writable':true,'value':1} ``` @@ -68,8 +68,8 @@ var desc = propertyDescriptor( obj, 'a' ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); function Foo() { this.beep = 'boop'; @@ -87,8 +87,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = propertyDescriptor( obj, 'baz' ); +const obj = new Foo(); +const desc = propertyDescriptor( obj, 'baz' ); console.log( desc ); // => {'configurable':true,'enumerable':false,'writable':true,'value':'qux'} diff --git a/lib/node_modules/@stdlib/utils/property-descriptors-in/README.md b/lib/node_modules/@stdlib/utils/property-descriptors-in/README.md index 7a16fd5a36ee..0cac3f90ee78 100644 --- a/lib/node_modules/@stdlib/utils/property-descriptors-in/README.md +++ b/lib/node_modules/@stdlib/utils/property-descriptors-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' ); +const propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' ); ``` #### propertyDescriptorsIn( obj ) @@ -35,12 +35,12 @@ var propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' ); Returns an object's own and inherited [property descriptors][@stdlib/utils/property-descriptors]. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var desc = propertyDescriptorsIn( obj ); +const desc = propertyDescriptorsIn( obj ); // returns { 'a': {...}, 'b': {...}, ... } ``` @@ -65,8 +65,8 @@ var desc = propertyDescriptorsIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' ); function Foo() { this.beep = 'boop'; @@ -84,8 +84,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = propertyDescriptorsIn( obj ); +const obj = new Foo(); +const desc = propertyDescriptorsIn( obj ); console.log( desc ); // => { 'beep': {...}, 'a': {...}, 'baz': {...}, 'foo': {...}, ... } diff --git a/lib/node_modules/@stdlib/utils/property-descriptors/README.md b/lib/node_modules/@stdlib/utils/property-descriptors/README.md index 0b8db28ae6ba..fddc583a90df 100644 --- a/lib/node_modules/@stdlib/utils/property-descriptors/README.md +++ b/lib/node_modules/@stdlib/utils/property-descriptors/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyDescriptors = require( '@stdlib/utils/property-descriptors' ); +const propertyDescriptors = require( '@stdlib/utils/property-descriptors' ); ``` #### propertyDescriptors( obj ) @@ -35,12 +35,12 @@ var propertyDescriptors = require( '@stdlib/utils/property-descriptors' ); Returns an object's own [property descriptors][@stdlib/utils/property-descriptor]. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var desc = propertyDescriptors( obj ); +const desc = propertyDescriptors( obj ); // returns { 'a': {...}, 'b': {...} } ``` @@ -67,8 +67,8 @@ var desc = propertyDescriptors( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyDescriptors = require( '@stdlib/utils/property-descriptors' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyDescriptors = require( '@stdlib/utils/property-descriptors' ); function Foo() { this.beep = 'boop'; @@ -86,8 +86,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var desc = propertyDescriptors( obj ); +const obj = new Foo(); +const desc = propertyDescriptors( obj ); console.log( desc ); // => { 'beep': {...}, 'a': {...}, 'baz': {...} } diff --git a/lib/node_modules/@stdlib/utils/property-names-in/README.md b/lib/node_modules/@stdlib/utils/property-names-in/README.md index 8ac9a8ea99b3..a746ff4f224c 100644 --- a/lib/node_modules/@stdlib/utils/property-names-in/README.md +++ b/lib/node_modules/@stdlib/utils/property-names-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyNamesIn = require( '@stdlib/utils/property-names-in' ); +const propertyNamesIn = require( '@stdlib/utils/property-names-in' ); ``` #### propertyNamesIn( obj ) @@ -35,12 +35,12 @@ var propertyNamesIn = require( '@stdlib/utils/property-names-in' ); Returns an `array` of an object's own and inherited enumerable and non-enumerable property names. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var keys = propertyNamesIn( obj ); +const keys = propertyNamesIn( obj ); // e.g., returns [ 'a', 'b', ... ] ``` @@ -66,8 +66,8 @@ var keys = propertyNamesIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyNamesIn = require( '@stdlib/utils/property-names-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyNamesIn = require( '@stdlib/utils/property-names-in' ); function Foo() { this.beep = 'boop'; @@ -85,8 +85,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var keys = propertyNamesIn( obj ); +const obj = new Foo(); +const keys = propertyNamesIn( obj ); console.log( keys ); // e.g., => [ 'beep', 'a', 'baz', 'foo', ... ] diff --git a/lib/node_modules/@stdlib/utils/property-names/README.md b/lib/node_modules/@stdlib/utils/property-names/README.md index 2aba23cfa3e3..cc36ad374f1e 100644 --- a/lib/node_modules/@stdlib/utils/property-names/README.md +++ b/lib/node_modules/@stdlib/utils/property-names/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertyNames = require( '@stdlib/utils/property-names' ); +const propertyNames = require( '@stdlib/utils/property-names' ); ``` #### propertyNames( obj ) @@ -35,12 +35,12 @@ var propertyNames = require( '@stdlib/utils/property-names' ); Returns an `array` of an object's own enumerable and non-enumerable property names. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var keys = propertyNames( obj ); +const keys = propertyNames( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -66,8 +66,8 @@ var keys = propertyNames( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var propertyNames = require( '@stdlib/utils/property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const propertyNames = require( '@stdlib/utils/property-names' ); function Foo() { this.beep = 'boop'; @@ -85,8 +85,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var keys = propertyNames( obj ); +const obj = new Foo(); +const keys = propertyNames( obj ); console.log( keys ); // e.g., => [ 'beep', 'a', 'baz' ] diff --git a/lib/node_modules/@stdlib/utils/property-symbols-in/README.md b/lib/node_modules/@stdlib/utils/property-symbols-in/README.md index 5399320166e6..1f63fa27dfb1 100644 --- a/lib/node_modules/@stdlib/utils/property-symbols-in/README.md +++ b/lib/node_modules/@stdlib/utils/property-symbols-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); +const propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); ``` #### propertySymbolsIn( obj ) @@ -35,7 +35,7 @@ var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); Returns an `array` of an object's own and inherited [symbol][@stdlib/symbol/ctor] properties. ```javascript -var symbols = propertySymbolsIn( [] ); +const symbols = propertySymbolsIn( [] ); ``` @@ -59,11 +59,11 @@ var symbols = propertySymbolsIn( [] ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -76,8 +76,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'foo' ) ] = 'bar'; } -var obj = new Foo(); -var symbols = propertySymbolsIn( obj ); +const obj = new Foo(); +const symbols = propertySymbolsIn( obj ); console.log( symbols ); ``` diff --git a/lib/node_modules/@stdlib/utils/property-symbols/README.md b/lib/node_modules/@stdlib/utils/property-symbols/README.md index 765b842e38f8..37c1497b749f 100644 --- a/lib/node_modules/@stdlib/utils/property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/property-symbols/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var propertySymbols = require( '@stdlib/utils/property-symbols' ); +const propertySymbols = require( '@stdlib/utils/property-symbols' ); ``` #### propertySymbols( obj ) @@ -35,7 +35,7 @@ var propertySymbols = require( '@stdlib/utils/property-symbols' ); Returns an `array` of an object's own [symbol][@stdlib/symbol/ctor]. ```javascript -var symbols = propertySymbols( {} ); +const symbols = propertySymbols( {} ); ``` @@ -59,9 +59,9 @@ var symbols = propertySymbols( {} ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var propertySymbols = require( '@stdlib/utils/property-symbols' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const propertySymbols = require( '@stdlib/utils/property-symbols' ); function Foo() { if ( hasSymbolSupport() ) { @@ -72,8 +72,8 @@ function Foo() { Foo.prototype.foo = 'bar'; -var obj = new Foo(); -var symbols = propertySymbols( obj ); +const obj = new Foo(); +const symbols = propertySymbols( obj ); console.log( symbols ); ``` diff --git a/lib/node_modules/@stdlib/utils/push/README.md b/lib/node_modules/@stdlib/utils/push/README.md index d044eded8d1f..41c41d87daab 100644 --- a/lib/node_modules/@stdlib/utils/push/README.md +++ b/lib/node_modules/@stdlib/utils/push/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var push = require( '@stdlib/utils/push' ); +const push = require( '@stdlib/utils/push' ); ``` #### push( collection, ...items ) @@ -45,31 +45,31 @@ var push = require( '@stdlib/utils/push' ); Adds one or more elements to the end of a `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = push( arr, 6.0, 7.0 ); +const out = push( arr, 6.0, 7.0 ); // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` In contrast to [`Array.prototype.push`][mdn-array-push], the function returns the extended collection, rather than the collection length. For [typed arrays][mdn-typed-array], the returned value is a new [typed array][mdn-typed-array] view whose underlying [`ArrayBuffer`][mdn-arraybuffer] may **not** equal the underlying [`ArrayBuffer`][mdn-arraybuffer] for the input `collection`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Float64Array = require( '@stdlib/array/float64' ); -var buf = new ArrayBuffer( 3*8 ); // 8 bytes per double +const buf = new ArrayBuffer( 3*8 ); // 8 bytes per double -var arr = new Float64Array( buf, 0, 2 ); +const arr = new Float64Array( buf, 0, 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = push( arr, 3.0 ); +let out = push( arr, 3.0 ); // returns [ 1.0, 2.0, 3.0 ] -var bool = ( out === arr ); +let bool = ( out === arr ); // returns false bool = ( out.buffer === arr.buffer ); @@ -108,14 +108,11 @@ bool = ( out.buffer === arr.buffer ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var push = require( '@stdlib/utils/push' ); +const Float64Array = require( '@stdlib/array/float64' ); +const push = require( '@stdlib/utils/push' ); -var arr; -var i; - -arr = new Float64Array(); -for ( i = 0; i < 100; i++ ) { +let arr = new Float64Array(); +for ( let i = 0; i < 100; i++ ) { arr = push( arr, i ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/utils/real-max/README.md b/lib/node_modules/@stdlib/utils/real-max/README.md index 1bb58b4f09bb..e0383f47859f 100644 --- a/lib/node_modules/@stdlib/utils/real-max/README.md +++ b/lib/node_modules/@stdlib/utils/real-max/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var realmax = require( '@stdlib/utils/real-max' ); +const realmax = require( '@stdlib/utils/real-max' ); ``` #### realmax( dtype ) @@ -45,7 +45,7 @@ var realmax = require( '@stdlib/utils/real-max' ); Returns the maximum **finite** value capable of being represented by a numeric **real** type. ```javascript -var m = realmax( 'float64' ); +const m = realmax( 'float64' ); // returns 1.7976931348623157e+308 ``` @@ -76,9 +76,9 @@ The following numeric **real** types are supported: ```javascript -var realmax = require( '@stdlib/utils/real-max' ); +const realmax = require( '@stdlib/utils/real-max' ); -var m = realmax( 'float64' ); +let m = realmax( 'float64' ); // returns 1.7976931348623157e+308 m = realmax( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/real-min/README.md b/lib/node_modules/@stdlib/utils/real-min/README.md index 6d7b5773070e..502877ea45dc 100644 --- a/lib/node_modules/@stdlib/utils/real-min/README.md +++ b/lib/node_modules/@stdlib/utils/real-min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var realmin = require( '@stdlib/utils/real-min' ); +const realmin = require( '@stdlib/utils/real-min' ); ``` #### realmin( dtype ) @@ -45,7 +45,7 @@ var realmin = require( '@stdlib/utils/real-min' ); Returns the smallest positive **normal** value capable of being represented by a numeric **real** type. ```javascript -var m = realmin( 'float64' ); +const m = realmin( 'float64' ); // returns 2.2250738585072014e-308 ``` @@ -76,9 +76,9 @@ The following numeric **real** types are supported: ```javascript -var realmin = require( '@stdlib/utils/real-min' ); +const realmin = require( '@stdlib/utils/real-min' ); -var m = realmin( 'float64' ); +let m = realmin( 'float64' ); // returns 2.2250738585072014e-308 m = realmin( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/reduce-right/README.md b/lib/node_modules/@stdlib/utils/reduce-right/README.md index 2e778aa0fe9b..ded7434d5f3d 100644 --- a/lib/node_modules/@stdlib/utils/reduce-right/README.md +++ b/lib/node_modules/@stdlib/utils/reduce-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reduceRight = require( '@stdlib/utils/reduce-right' ); +const reduceRight = require( '@stdlib/utils/reduce-right' ); ``` #### reduceRight( arr, initial, reducer\[, thisArg ] ) @@ -49,27 +49,27 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = reduceRight( arr, 0, sum ); +const out = reduceRight( arr, 0, sum ); // returns 10 ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); function sum( accumulator, value ) { return accumulator + value; } -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var out = reduceRight( arr, 0, sum ); +const out = reduceRight( arr, 0, sum ); // returns 21 ``` @@ -90,16 +90,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = reduceRight( arr, 0, sum, ctx ); +const out = reduceRight( arr, 0, sum, ctx ); // returns 10 -var mean = out / ctx.count; +const mean = out / ctx.count; // returns 2.5 ``` @@ -123,28 +123,28 @@ var mean = out / ctx.count; - The function supports array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function sum( acc, z ) { - var re1 = realf( acc ); - var im1 = imagf( acc ); - var re2 = realf( z ); - var im2 = imagf( z ); + const re1 = realf( acc ); + const im1 = imagf( acc ); + const re2 = realf( z ); + const im2 = imagf( z ); return new Complex64( re1+re2, im1+im2 ); } - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var v = reduceRight( x, new Complex64( 0.0, 0.0 ), sum ); + const v = reduceRight( x, new Complex64( 0.0, 0.0 ), sum ); // returns - var re = realf( v ); + const re = realf( v ); // returns 16.0 - var im = imagf( v ); + const im = imagf( v ); // returns 20.0 ``` @@ -165,29 +165,29 @@ var mean = out / ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); -var reduceRight = require( '@stdlib/utils/reduce-right' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); +const reduceRight = require( '@stdlib/utils/reduce-right' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit binary function: -var f = naryFunction( add, 2 ); +const f = naryFunction( add, 2 ); // Compute the sum: -var out = reduceRight( x, 0, f ); +const out = reduceRight( x, 0, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/reduce/README.md b/lib/node_modules/@stdlib/utils/reduce/README.md index 6aa90ddc18c6..832712af5b49 100644 --- a/lib/node_modules/@stdlib/utils/reduce/README.md +++ b/lib/node_modules/@stdlib/utils/reduce/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reduce = require( '@stdlib/utils/reduce' ); +const reduce = require( '@stdlib/utils/reduce' ); ``` #### reduce( arr, initial, reducer\[, thisArg ] ) @@ -49,27 +49,27 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var out = reduce( arr, 0, sum ); +const out = reduce( arr, 0, sum ); // returns 10 ``` The function accepts both array-like objects and [`ndarray`][@stdlib/ndarray/ctor]-like objects. ```javascript -var array = require( '@stdlib/ndarray/array' ); +const array = require( '@stdlib/ndarray/array' ); function sum( accumulator, value ) { return accumulator + value; } -var opts = { +const opts = { 'dtype': 'generic' }; -var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); +const arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts ); -var out = reduce( arr, 0, sum ); +const out = reduce( arr, 0, sum ); // returns 21 ``` @@ -90,16 +90,16 @@ function sum( accumulator, value ) { return accumulator + value; } -var arr = [ 1, 2, 3, 4 ]; +const arr = [ 1, 2, 3, 4 ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = reduce( arr, 0, sum, ctx ); +const out = reduce( arr, 0, sum, ctx ); // returns 10 -var mean = out / ctx.count; +const mean = out / ctx.count; // returns 2.5 ``` @@ -123,28 +123,28 @@ var mean = out / ctx.count; - The function supports array-like objects exposing getters and setters for array element access (e.g., [`Complex64Array`][@stdlib/array/complex64], [`Complex128Array`][@stdlib/array/complex128], etc). ```javascript - var Complex64Array = require( '@stdlib/array/complex64' ); - var Complex64 = require( '@stdlib/complex/float32/ctor' ); - var realf = require( '@stdlib/complex/float32/real' ); - var imagf = require( '@stdlib/complex/float32/imag' ); + const Complex64Array = require( '@stdlib/array/complex64' ); + const Complex64 = require( '@stdlib/complex/float32/ctor' ); + const realf = require( '@stdlib/complex/float32/real' ); + const imagf = require( '@stdlib/complex/float32/imag' ); function sum( acc, z ) { - var re1 = realf( acc ); - var im1 = imagf( acc ); - var re2 = realf( z ); - var im2 = imagf( z ); + const re1 = realf( acc ); + const im1 = imagf( acc ); + const re2 = realf( z ); + const im2 = imagf( z ); return new Complex64( re1+re2, im1+im2 ); } - var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + const x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - var v = reduce( x, new Complex64( 0.0, 0.0 ), sum ); + const v = reduce( x, new Complex64( 0.0, 0.0 ), sum ); // returns - var re = realf( v ); + const re = realf( v ); // returns 16.0 - var im = imagf( v ); + const im = imagf( v ); // returns 20.0 ``` @@ -165,29 +165,29 @@ var mean = out / ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var array = require( '@stdlib/ndarray/array' ); -var reduce = require( '@stdlib/utils/reduce' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const array = require( '@stdlib/ndarray/array' ); +const reduce = require( '@stdlib/utils/reduce' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'generic', rand ); } // Create a two-dimensional ndarray (i.e., a matrix): -var x = array( filledarrayBy( 10, 'generic', fill ), { +const x = array( filledarrayBy( 10, 'generic', fill ), { 'dtype': 'generic', 'flatten': true }); // Create an explicit binary function: -var f = naryFunction( add, 2 ); +const f = naryFunction( add, 2 ); // Compute the sum: -var out = reduce( x, 0, f ); +const out = reduce( x, 0, f ); console.log( 'x:' ); console.log( x.data ); diff --git a/lib/node_modules/@stdlib/utils/reduce2d/README.md b/lib/node_modules/@stdlib/utils/reduce2d/README.md index 442e663e7774..07c691b6ce9f 100644 --- a/lib/node_modules/@stdlib/utils/reduce2d/README.md +++ b/lib/node_modules/@stdlib/utils/reduce2d/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reduce2d = require( '@stdlib/utils/reduce2d' ); +const reduce2d = require( '@stdlib/utils/reduce2d' ); ``` #### reduce2d( arr, initial, fcn\[, thisArg] ) @@ -45,15 +45,15 @@ var reduce2d = require( '@stdlib/utils/reduce2d' ); Reduces the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and returning the accumulation results as a one-dimensional array. ```javascript -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); -var arr = [ +const arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]; -var out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) ); +const out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) ); // returns [ 6, 15 ] ``` @@ -69,26 +69,26 @@ To set the `this` context when invoking the input function, provide a `thisArg`. ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); function fcn( acc, v ) { this.count += 1; return add( acc, v ); } -var arr = [ +const arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]; -var ctx = { +const ctx = { 'count': 0 }; -var out = reduce2d( arr, [ 0, 0 ], fcn, ctx ); +const out = reduce2d( arr, [ 0, 0 ], fcn, ctx ); // returns [ 6, 15 ] -var cnt = ctx.count; +const cnt = ctx.count; // returns 6 ``` @@ -117,26 +117,26 @@ var cnt = ctx.count; ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var naryFunction = require( '@stdlib/utils/nary-function' ); -var add = require( '@stdlib/math/base/ops/add' ); -var zeros = require( '@stdlib/array/base/zeros' ); -var reduce2d = require( '@stdlib/utils/reduce2d' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const naryFunction = require( '@stdlib/utils/nary-function' ); +const add = require( '@stdlib/math/base/ops/add' ); +const zeros = require( '@stdlib/array/base/zeros' ); +const reduce2d = require( '@stdlib/utils/reduce2d' ); function fill( i ) { - var rand = discreteUniform( -10*(i+1), 10*(i+1) ); + const rand = discreteUniform( -10*(i+1), 10*(i+1) ); return filledarrayBy( 10, 'float64', rand ); } // Create a nested array of arrays: -var x = filledarrayBy( 10, 'generic', fill ); +const x = filledarrayBy( 10, 'generic', fill ); // Create an explicit binary function: -var f = naryFunction( add, 2 ); +const f = naryFunction( add, 2 ); // Compute the sums along the innermost dimension... -var y = reduce2d( x, zeros( x.length ), f ); +const y = reduce2d( x, zeros( x.length ), f ); console.log( 'x:' ); console.log( x ); diff --git a/lib/node_modules/@stdlib/utils/regexp-from-string/README.md b/lib/node_modules/@stdlib/utils/regexp-from-string/README.md index 4b9591d2d299..8785b62034d7 100644 --- a/lib/node_modules/@stdlib/utils/regexp-from-string/README.md +++ b/lib/node_modules/@stdlib/utils/regexp-from-string/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var reFromString = require( '@stdlib/utils/regexp-from-string' ); +const reFromString = require( '@stdlib/utils/regexp-from-string' ); ``` #### reFromString( str ) @@ -35,7 +35,7 @@ var reFromString = require( '@stdlib/utils/regexp-from-string' ); Parses a [regular expression][regexp] `string` and returns a new [regular expression][regexp]. ```javascript -var re = reFromString( '/beep/' ); +const re = reFromString( '/beep/' ); // returns /beep/ ``` @@ -53,7 +53,7 @@ var re = reFromString( '/beep/' ); ```javascript // Unescaped: - var re = reFromString( '/\w+/' ); + let re = reFromString( '/\w+/' ); // returns /w+/ // Escaped: @@ -74,9 +74,9 @@ var re = reFromString( '/beep/' ); ```javascript -var reFromString = require( '@stdlib/utils/regexp-from-string' ); +const reFromString = require( '@stdlib/utils/regexp-from-string' ); -var re = reFromString( '/beep/' ); +let re = reFromString( '/beep/' ); // returns /beep/ re = reFromString( '/[A-Z]*/' ); diff --git a/lib/node_modules/@stdlib/utils/reject-arguments/README.md b/lib/node_modules/@stdlib/utils/reject-arguments/README.md index 8757cb040e72..8cc1d6b80985 100644 --- a/lib/node_modules/@stdlib/utils/reject-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/reject-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var rejectArguments = require( '@stdlib/utils/reject-arguments' ); +const rejectArguments = require( '@stdlib/utils/reject-arguments' ); ``` #### rejectArguments( fcn, predicate\[, thisArg] ) @@ -53,9 +53,9 @@ function predicate( v ) { return ( v === 2 ); } -var bar = rejectArguments( foo, predicate ); +const bar = rejectArguments( foo, predicate ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 1, 3 ] ``` @@ -82,16 +82,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = rejectArguments( foo.scale, predicate, ctx ); +const bar = rejectArguments( foo.scale, predicate, ctx ); -var out = bar( 1, 2, 3 ); +const out = bar( 1, 2, 3 ); // returns [ 10, 60 ] ``` @@ -120,9 +120,9 @@ var out = bar( 1, 2, 3 ); ```javascript -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var add = require( '@stdlib/math/base/ops/add' ); -var rejectArguments = require( '@stdlib/utils/reject-arguments' ); +const filledarrayBy = require( '@stdlib/array/filled-by' ); +const add = require( '@stdlib/math/base/ops/add' ); +const rejectArguments = require( '@stdlib/utils/reject-arguments' ); function fill( i ) { return i; @@ -137,13 +137,10 @@ function factory( i, j ) { } // Create a data array: -var x = filledarrayBy( 10, 'float64', fill ); +const x = filledarrayBy( 10, 'float64', fill ); -// Compute the sum of consecutive elements... -var f; -var i; -for ( i = 0; i < x.length-1; i++ ) { - f = rejectArguments( add, factory( i, i+2 ) ); +for ( let i = 0; i < x.length-1; i++ ) { + const f = rejectArguments( add, factory( i, i+2 ) ); console.log( 'sum(x_%d, x_%d) = %d', i, i+1, f.apply( null, x ) ); } ``` diff --git a/lib/node_modules/@stdlib/utils/reorder-arguments/README.md b/lib/node_modules/@stdlib/utils/reorder-arguments/README.md index f930a1829389..2f78dbd7f35e 100644 --- a/lib/node_modules/@stdlib/utils/reorder-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/reorder-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reorderArguments = require( '@stdlib/utils/reorder-arguments' ); +const reorderArguments = require( '@stdlib/utils/reorder-arguments' ); ``` #### reorderArguments( fcn, indices\[, thisArg] ) @@ -49,9 +49,9 @@ function foo( a, b ) { return [ a, b ]; } -var bar = reorderArguments( foo, [ 1, 0 ] ); +const bar = reorderArguments( foo, [ 1, 0 ] ); -var out = bar( 1, 2 ); +const out = bar( 1, 2 ); // returns [ 2, 1 ] ``` @@ -69,16 +69,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = reorderArguments( foo.scale, [ 1, 0 ], ctx ); +const bar = reorderArguments( foo.scale, [ 1, 0 ], ctx ); -var out = bar( 1, 2 ); +const out = bar( 1, 2 ); // returns [ 20, 20 ] ``` @@ -103,15 +103,15 @@ var out = bar( 1, 2 ); ```javascript -var reorderArguments = require( '@stdlib/utils/reorder-arguments' ); +const reorderArguments = require( '@stdlib/utils/reorder-arguments' ); function foo( a, b, c ) { return [ a, b, c ]; } -var bar = reorderArguments( foo, [ 2, 0, 1 ] ); +const bar = reorderArguments( foo, [ 2, 0, 1 ] ); -var out = foo( 1, 2, 3 ); +let out = foo( 1, 2, 3 ); // returns [ 1, 2, 3 ] out = bar( 1, 2, 3 ); diff --git a/lib/node_modules/@stdlib/utils/reverse-arguments/README.md b/lib/node_modules/@stdlib/utils/reverse-arguments/README.md index 6380c94fd038..7802020b2a0c 100644 --- a/lib/node_modules/@stdlib/utils/reverse-arguments/README.md +++ b/lib/node_modules/@stdlib/utils/reverse-arguments/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var reverseArguments = require( '@stdlib/utils/reverse-arguments' ); +const reverseArguments = require( '@stdlib/utils/reverse-arguments' ); ``` #### reverseArguments( fcn\[, thisArg] ) @@ -49,9 +49,9 @@ function foo( a, b ) { return [ a, b ]; } -var bar = reverseArguments( foo ); +const bar = reverseArguments( foo ); -var out = bar( 1, 2 ); +const out = bar( 1, 2 ); // returns [ 2, 1 ] ``` @@ -69,16 +69,16 @@ Foo.prototype.scale = function scale( a, b ) { return [ this.x*a, this.y*b ]; }; -var ctx = { +const ctx = { 'x': 10, 'y': 20 }; -var foo = new Foo(); +const foo = new Foo(); -var bar = reverseArguments( foo.scale, ctx ); +const bar = reverseArguments( foo.scale, ctx ); -var out = bar( 1, 2 ); +const out = bar( 1, 2 ); // returns [ 20, 20 ] ``` @@ -103,15 +103,15 @@ var out = bar( 1, 2 ); ```javascript -var reverseArguments = require( '@stdlib/utils/reverse-arguments' ); +const reverseArguments = require( '@stdlib/utils/reverse-arguments' ); function foo( a, b, c ) { return [ a, b, c ]; } -var bar = reverseArguments( foo ); +const bar = reverseArguments( foo ); -var out = foo( 1, 2, 3 ); +let out = foo( 1, 2, 3 ); // returns [ 1, 2, 3 ] out = bar( 1, 2, 3 ); diff --git a/lib/node_modules/@stdlib/utils/safe-int-max/README.md b/lib/node_modules/@stdlib/utils/safe-int-max/README.md index b96a4d194c43..5ed8baf74127 100644 --- a/lib/node_modules/@stdlib/utils/safe-int-max/README.md +++ b/lib/node_modules/@stdlib/utils/safe-int-max/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var safeintmax = require( '@stdlib/utils/safe-int-max' ); +const safeintmax = require( '@stdlib/utils/safe-int-max' ); ``` #### safeintmax( dtype ) @@ -45,7 +45,7 @@ var safeintmax = require( '@stdlib/utils/safe-int-max' ); Returns the maximum **safe** integer capable of being represented by a numeric **real** type. ```javascript -var m = safeintmax( 'float64' ); +const m = safeintmax( 'float64' ); // returns 9007199254740991 ``` @@ -76,9 +76,9 @@ The following numeric **real** types are supported: ```javascript -var safeintmax = require( '@stdlib/utils/safe-int-max' ); +const safeintmax = require( '@stdlib/utils/safe-int-max' ); -var m = safeintmax( 'float64' ); +let m = safeintmax( 'float64' ); // returns 9007199254740991 m = safeintmax( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/safe-int-min/README.md b/lib/node_modules/@stdlib/utils/safe-int-min/README.md index 950a794dd0c2..c26bb907616c 100644 --- a/lib/node_modules/@stdlib/utils/safe-int-min/README.md +++ b/lib/node_modules/@stdlib/utils/safe-int-min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var safeintmin = require( '@stdlib/utils/safe-int-min' ); +const safeintmin = require( '@stdlib/utils/safe-int-min' ); ``` #### safeintmin( dtype ) @@ -45,7 +45,7 @@ var safeintmin = require( '@stdlib/utils/safe-int-min' ); Returns the minimum **safe** integer capable of being represented by a numeric **real** type. ```javascript -var m = safeintmin( 'float64' ); +const m = safeintmin( 'float64' ); // returns -9007199254740991 ``` @@ -76,9 +76,9 @@ The following numeric **real** types are supported: ```javascript -var safeintmin = require( '@stdlib/utils/safe-int-min' ); +const safeintmin = require( '@stdlib/utils/safe-int-min' ); -var m = safeintmin( 'float64' ); +let m = safeintmin( 'float64' ); // returns -9007199254740991 m = safeintmin( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/shift/README.md b/lib/node_modules/@stdlib/utils/shift/README.md index 3f73fd644ff9..589cdbf1d0ca 100644 --- a/lib/node_modules/@stdlib/utils/shift/README.md +++ b/lib/node_modules/@stdlib/utils/shift/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var shift = require( '@stdlib/utils/shift' ); +const shift = require( '@stdlib/utils/shift' ); ``` #### shift( collection ) @@ -45,37 +45,37 @@ var shift = require( '@stdlib/utils/shift' ); Removes and returns the first element of a `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = shift( arr ); +const out = shift( arr ); // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ] -var bool = ( out[ 0 ] === arr ); +const bool = ( out[ 0 ] === arr ); // returns true -var lastValue = out[ 1 ]; +const lastValue = out[ 1 ]; // returns 1.0 ``` In contrast to [`Array.prototype.shift`][mdn-array-shift] which returns only the removed element, the function also returns the shortened collection. For [typed arrays][mdn-typed-array] having a length greater than `0`, the returned collection is a new [typed array][mdn-typed-array] view. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); +const Float64Array = require( '@stdlib/array/float64' ); -var arr = new Float64Array( 2 ); +const arr = new Float64Array( 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = shift( arr ); +const out = shift( arr ); // returns [ [ 2.0 ], 1.0 ] -var bool = ( out[ 0 ] === arr ); +let bool = ( out[ 0 ] === arr ); // returns false bool = ( out[ 0 ].buffer === arr.buffer ); // returns true -var lastValue = out[ 1 ]; +const lastValue = out[ 1 ]; // returns 1.0 ``` @@ -104,16 +104,12 @@ var lastValue = out[ 1 ]; ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var shift = require( '@stdlib/utils/shift' ); +const Float64Array = require( '@stdlib/array/float64' ); +const shift = require( '@stdlib/utils/shift' ); -var arr; -var out; -var i; - -arr = new Float64Array( 100 ); -for ( i = 0; i < 100; i++ ) { - out = shift( arr ); +let arr = new Float64Array( 100 ); +for ( let i = 0; i < 100; i++ ) { + const out = shift( arr ); arr = out[ 0 ]; console.log( 'Length: %d', arr.length ); } diff --git a/lib/node_modules/@stdlib/utils/size-of/README.md b/lib/node_modules/@stdlib/utils/size-of/README.md index a1a55e9f736b..c8919c56be72 100644 --- a/lib/node_modules/@stdlib/utils/size-of/README.md +++ b/lib/node_modules/@stdlib/utils/size-of/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var sizeOf = require( '@stdlib/utils/size-of' ); +const sizeOf = require( '@stdlib/utils/size-of' ); ``` #### sizeOf( dtype ) @@ -45,7 +45,7 @@ var sizeOf = require( '@stdlib/utils/size-of' ); Returns the size (in bytes) of the canonical binary representation of a specified numeric type. ```javascript -var s = sizeOf( 'int8' ); +const s = sizeOf( 'int8' ); // returns 1 ``` @@ -85,9 +85,9 @@ The following numeric types are supported: ```javascript -var sizeOf = require( '@stdlib/utils/size-of' ); +const sizeOf = require( '@stdlib/utils/size-of' ); -var s = sizeOf( 'float64' ); +let s = sizeOf( 'float64' ); // returns 8 s = sizeOf( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/some-by-right/README.md b/lib/node_modules/@stdlib/utils/some-by-right/README.md index 6feba827de21..e834ce61afb5 100644 --- a/lib/node_modules/@stdlib/utils/some-by-right/README.md +++ b/lib/node_modules/@stdlib/utils/some-by-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var someByRight = require( '@stdlib/utils/some-by-right' ); +const someByRight = require( '@stdlib/utils/some-by-right' ); ``` #### someByRight( collection, n, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ -1, 1, -2, 3, 4 ]; +const arr = [ -1, 1, -2, 3, 4 ]; -var bool = someByRight( arr, 2, isNegative ); +const bool = someByRight( arr, 2, isNegative ); // returns true ``` @@ -65,9 +65,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ -1, 2, -3, -4 ]; +const arr = [ -1, 2, -3, -4 ]; -var bool = someByRight( arr, 2, isNegative ); +const bool = someByRight( arr, 2, isNegative ); // returns true ``` @@ -86,17 +86,17 @@ function sum( value ) { return ( value < 0 ); } -var arr = [ -5, 1, 2, 3, 4 ]; +const arr = [ -5, 1, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = someByRight( arr, 1, sum, context ); +const bool = someByRight( arr, 1, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 1.0 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = someByRight( [], 1, alwaysTrue ); + const bool = someByRight( [], 1, alwaysTrue ); // returns false ``` @@ -132,9 +132,9 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var arr = [ -1, 1, , , 4 ]; + const arr = [ -1, 1, , , 4 ]; - var bool = someByRight( arr, 1, log ); + const bool = someByRight( arr, 1, log ); /* => 4: 4 3: undefined @@ -159,23 +159,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var someByRight = require( '@stdlib/utils/some-by-right' ); +const randu = require( '@stdlib/random/base/randu' ); +const someByRight = require( '@stdlib/utils/some-by-right' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = someByRight( arr, 5, threshold ); +const bool = someByRight( arr, 5, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/some-by/README.md b/lib/node_modules/@stdlib/utils/some-by/README.md index 6f6e061bf1db..db78d31875d3 100644 --- a/lib/node_modules/@stdlib/utils/some-by/README.md +++ b/lib/node_modules/@stdlib/utils/some-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var someBy = require( '@stdlib/utils/some-by' ); +const someBy = require( '@stdlib/utils/some-by' ); ``` #### someBy( collection, n, predicate\[, thisArg ] ) @@ -49,9 +49,9 @@ function isNegative( value ) { return ( value < 0 ); } -var arr = [ 1, -2, 3, 4, -1 ]; +const arr = [ 1, -2, 3, 4, -1 ]; -var bool = someBy( arr, 2, isNegative ); +const bool = someBy( arr, 2, isNegative ); // returns true ``` @@ -65,9 +65,9 @@ function isPositive( value ) { return ( value > 0 ); } -var arr = [ 1, 2, -3, 4 ]; +const arr = [ 1, 2, -3, 4 ]; -var bool = someBy( arr, 2, isPositive ); +const bool = someBy( arr, 2, isPositive ); // returns true ``` @@ -86,17 +86,17 @@ function sum( value ) { return ( value < 0 ); } -var arr = [ 1, 2, 3, 4, -5 ]; +const arr = [ 1, 2, 3, 4, -5 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = someBy( arr, 1, sum, context ); +const bool = someBy( arr, 1, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 1.0 ``` @@ -118,7 +118,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = someBy( [], 1, alwaysTrue ); + const bool = someBy( [], 1, alwaysTrue ); // returns false ``` @@ -132,9 +132,9 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var arr = [ 1, , , 4, -1 ]; + const arr = [ 1, , , 4, -1 ]; - var bool = someBy( arr, 1, log ); + const bool = someBy( arr, 1, log ); /* => 0: 1 1: undefined @@ -159,23 +159,19 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var someBy = require( '@stdlib/utils/some-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const someBy = require( '@stdlib/utils/some-by' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = randu(); } -bool = someBy( arr, 5, threshold ); +const bool = someBy( arr, 5, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/some-in-by/README.md b/lib/node_modules/@stdlib/utils/some-in-by/README.md index 0f55b92d793d..2d7289580e02 100644 --- a/lib/node_modules/@stdlib/utils/some-in-by/README.md +++ b/lib/node_modules/@stdlib/utils/some-in-by/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var someInBy = require( '@stdlib/utils/some-in-by' ); +const someInBy = require( '@stdlib/utils/some-in-by' ); ``` #### someInBy( obj, n, predicate\[, thisArg ] ) @@ -45,14 +45,14 @@ function isNegative( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': -2, 'c': 3, 'd': -1 }; -var bool = someInBy( obj, 2, isNegative ); +const bool = someInBy( obj, 2, isNegative ); // returns true ``` @@ -66,14 +66,14 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': -3, 'd': 4 }; -var bool = someInBy( obj, 2, isPositive ); +const bool = someInBy( obj, 2, isPositive ); // returns true ``` @@ -92,22 +92,22 @@ function sum( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': -5 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = someInBy( obj, 1, sum, context ); +const bool = someInBy( obj, 1, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 0.25 ``` @@ -125,7 +125,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = someInBy( {}, 1, alwaysTrue ); + const bool = someInBy( {}, 1, alwaysTrue ); // returns false ``` @@ -137,7 +137,7 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var obj = { + const obj = { 'a': 1, 'b': void 0, 'c': void 0, @@ -145,7 +145,7 @@ var mean = context.sum / context.count; 'e': -1 }; - var bool = someInBy( obj, 1, log ); + const bool = someInBy( obj, 1, log ); // logs // a: 1 // b: void 0 @@ -165,22 +165,20 @@ var mean = context.sum / context.count; ## Examples ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var someInBy = require( '@stdlib/utils/some-in-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const someInBy = require( '@stdlib/utils/some-in-by' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var obj = {}; -var i; +const obj = {}; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { obj[ 'key' + i ] = randu(); } -bool = someInBy( obj, 5, threshold ); +const bool = someInBy( obj, 5, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/some-own-by/README.md b/lib/node_modules/@stdlib/utils/some-own-by/README.md index 69db603abc67..251a4fd2ce41 100644 --- a/lib/node_modules/@stdlib/utils/some-own-by/README.md +++ b/lib/node_modules/@stdlib/utils/some-own-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var someOwnBy = require( '@stdlib/utils/some-own-by' ); +const someOwnBy = require( '@stdlib/utils/some-own-by' ); ``` #### someOwnBy( obj, n, predicate\[, thisArg ] ) @@ -49,14 +49,14 @@ function isNegative( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': -2, 'c': 3, 'd': -1 }; -var bool = someOwnBy( obj, 2, isNegative ); +const bool = someOwnBy( obj, 2, isNegative ); // returns true ``` @@ -70,14 +70,14 @@ function isPositive( value ) { return ( value > 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': -3, 'd': 4 }; -var bool = someOwnBy( obj, 2, isPositive ); +const bool = someOwnBy( obj, 2, isPositive ); // returns true ``` @@ -96,22 +96,22 @@ function sum( value ) { return ( value < 0 ); } -var obj = { +const obj = { 'a': 1, 'b': 2, 'c': 3, 'd': -5 }; -var context = { +const context = { 'sum': 0, 'count': 0 }; -var bool = someOwnBy( obj, 1, sum, context ); +const bool = someOwnBy( obj, 1, sum, context ); // returns true -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 0.25 ``` @@ -133,7 +133,7 @@ var mean = context.sum / context.count; function alwaysTrue() { return true; } - var bool = someOwnBy( {}, 1, alwaysTrue ); + const bool = someOwnBy( {}, 1, alwaysTrue ); // returns false ``` @@ -147,7 +147,7 @@ var mean = context.sum / context.count; return ( value < 0 ); } - var obj = { + const obj = { 'a': 1, 'b': void 0, 'c': void 0, @@ -155,7 +155,7 @@ var mean = context.sum / context.count; 'e': -1 }; - var bool = someOwnBy( obj, 1, log ); + const bool = someOwnBy( obj, 1, log ); /* => a: 1 b: void 0 @@ -180,22 +180,20 @@ var mean = context.sum / context.count; ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var someOwnBy = require( '@stdlib/utils/some-own-by' ); +const randu = require( '@stdlib/random/base/randu' ); +const someOwnBy = require( '@stdlib/utils/some-own-by' ); function threshold( value ) { return ( value > 0.95 ); } -var bool; -var obj = {}; -var i; +const obj = {}; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { obj[ 'key'+i ] = randu(); } -bool = someOwnBy( obj, 5, threshold ); +const bool = someOwnBy( obj, 5, threshold ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/some/README.md b/lib/node_modules/@stdlib/utils/some/README.md index 9ba073219d8c..e9a750cc4d03 100644 --- a/lib/node_modules/@stdlib/utils/some/README.md +++ b/lib/node_modules/@stdlib/utils/some/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var some = require( '@stdlib/utils/some' ); +const some = require( '@stdlib/utils/some' ); ``` #### some( collection, n ) @@ -45,16 +45,16 @@ var some = require( '@stdlib/utils/some' ); Tests whether a `collection` contains at least `n` elements which are truthy. ```javascript -var arr = [ 0, 0, 1, 2, 3 ]; +const arr = [ 0, 0, 1, 2, 3 ]; -var bool = some( arr, 3 ); +const bool = some( arr, 3 ); // returns true ``` If provided an empty `collection`, the function returns `false`. ```javascript -var bool = some( [], 1 ); +const bool = some( [], 1 ); // returns false ``` @@ -84,19 +84,15 @@ var bool = some( [], 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var some = require( '@stdlib/utils/some' ); +const randu = require( '@stdlib/random/base/randu' ); +const some = require( '@stdlib/utils/some' ); -var bool; -var arr; -var i; - -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = ( randu() > 0.95 ); } -bool = some( arr, 5 ); +const bool = some( arr, 5 ); // returns ``` diff --git a/lib/node_modules/@stdlib/utils/stack/README.md b/lib/node_modules/@stdlib/utils/stack/README.md index 12aa21fe5175..e0f790daaead 100644 --- a/lib/node_modules/@stdlib/utils/stack/README.md +++ b/lib/node_modules/@stdlib/utils/stack/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var stack = require( '@stdlib/utils/stack' ); +const stack = require( '@stdlib/utils/stack' ); ``` #### stack() @@ -45,7 +45,7 @@ var stack = require( '@stdlib/utils/stack' ); Returns a `Stack` instance. ```javascript -var s = stack(); +const s = stack(); // returns ``` @@ -54,18 +54,18 @@ var s = stack(); Clears a stack. ```javascript -var s = stack(); +const s = stack(); // returns // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Peek at the top value: -var v = s.first(); +let v = s.first(); // returns 'bar' // Examine the stack length: -var len = s.length; +let len = s.length; // returns 2 // Clear all stack items: @@ -85,14 +85,14 @@ len = s.length; Returns the top stack value (i.e., the value which is "first-out"). If the stack is currently empty, the returned value is `undefined`. ```javascript -var s = stack(); +const s = stack(); // returns // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Peek at the top value: -var v = s.first(); +const v = s.first(); // returns 'bar' ``` @@ -101,22 +101,22 @@ var v = s.first(); Returns an iterator for iterating over a stack. If an environment supports `Symbol.iterator`, the returned iterator is iterable. ```javascript -var s = stack(); +const s = stack(); // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Create an iterator: -var it = s.iterator(); +const it = s.iterator(); // Iterate over the stack... -var v = it.next().value; +let v = it.next().value; // returns 'bar' v = it.next().value; // returns 'foo' -var bool = it.next().done; +const bool = it.next().done; // returns true ``` @@ -127,14 +127,14 @@ var bool = it.next().done; Returns the bottom stack value (i.e., the value which is "last-out"). If the stack is currently empty, the returned value is `undefined`. ```javascript -var s = stack(); +const s = stack(); // returns // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Peek at the bottom value: -var v = s.last(); +const v = s.last(); // returns 'foo' ``` @@ -143,10 +143,10 @@ var v = s.last(); Stack length. ```javascript -var s = stack(); +const s = stack(); // Examine the initial stack length: -var len = s.length; +let len = s.length; // returns 0 // Add values to the stack: @@ -162,13 +162,13 @@ len = s.length; Removes a value from the stack. If the stack is currently empty, the returned value is `undefined`. ```javascript -var s = stack(); +const s = stack(); // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Remove the top value: -var v = s.pop(); +let v = s.pop(); // returns 'bar' // Add a new value to the stack: @@ -184,13 +184,13 @@ v = s.pop(); Adds a value to the stack. ```javascript -var s = stack(); +const s = stack(); // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Remove the top value: -var v = s.pop(); +let v = s.pop(); // returns 'bar' // Add a new value to the stack: @@ -206,13 +206,13 @@ v = s.pop(); Returns an array of stack values. ```javascript -var s = stack(); +const s = stack(); // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Get an array of stack values: -var vals = s.toArray(); +const vals = s.toArray(); // returns [ 'bar', 'foo' ] ``` @@ -223,13 +223,13 @@ var vals = s.toArray(); Serializes a stack as JSON. ```javascript -var s = stack(); +const s = stack(); // Add values to the stack: s.push( 'foo' ).push( 'bar' ); // Serialize to JSON: -var o = s.toJSON(); +const o = s.toJSON(); // returns { 'type': 'stack', 'data': [ 'bar', 'foo' ] } ``` @@ -262,16 +262,10 @@ var o = s.toJSON(); ```javascript -var Stack = require( '@stdlib/utils/stack' ); - -var stack; -var iter; -var len; -var v; -var i; +const Stack = require( '@stdlib/utils/stack' ); // Create a new stack: -stack = new Stack(); +const stack = new Stack(); // Add some values to the stack: stack.push( 'foo' ); @@ -280,14 +274,14 @@ stack.push( 'beep' ); stack.push( 'boop' ); // Peek at the top and bottom stack values: -v = stack.first(); +let v = stack.first(); // returns 'boop' v = stack.last(); // returns 'foo' // Inspect the stack length: -len = stack.length; +let len = stack.length; // returns 4 // Remove the top value: @@ -299,8 +293,8 @@ len = stack.length; // returns 3 // Iterate over the stack: -iter = stack.iterator(); -for ( i = 0; i < len; i++ ) { +const iter = stack.iterator(); +for ( let i = 0; i < len; i++ ) { console.log( 'Stack value #%d: %s', i+1, iter.next().value ); } diff --git a/lib/node_modules/@stdlib/utils/tabulate-by/README.md b/lib/node_modules/@stdlib/utils/tabulate-by/README.md index d1a323f586df..0089f44f7e6c 100644 --- a/lib/node_modules/@stdlib/utils/tabulate-by/README.md +++ b/lib/node_modules/@stdlib/utils/tabulate-by/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var tabulateBy = require( '@stdlib/utils/tabulate-by' ); +const tabulateBy = require( '@stdlib/utils/tabulate-by' ); ``` #### tabulateBy( collection\[, options,] indicator ) @@ -48,9 +48,9 @@ Generates a frequency table according to an `indicator` function, i.e., a functi function indicator( v ) { return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'beep' ]; +const arr = [ 'beep', 'boop', 'foo', 'beep' ]; -var out = tabulateBy( arr, indicator ); +const out = tabulateBy( arr, indicator ); // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ] ``` @@ -64,9 +64,9 @@ function indicator( v, i ) { console.log( '%d: %s', i, v ); return v[ 0 ]; } -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = tabulateBy( arr, indicator ); +const out = tabulateBy( arr, indicator ); // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ] ``` @@ -81,15 +81,15 @@ function indicator( v ) { this.count += 1; return v[ 0 ]; } -var context = { +const context = { 'count': 0 }; -var opts = { +const opts = { 'thisArg': context }; -var arr = [ 'beep', 'boop', 'foo', 'bar' ]; +const arr = [ 'beep', 'boop', 'foo', 'bar' ]; -var out = tabulateBy( arr, opts, indicator ); +const out = tabulateBy( arr, opts, indicator ); // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ] console.log( context.count ); @@ -127,31 +127,25 @@ The returned frequency table is an `array` of `arrays`. Each sub-array correspon ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var tabulateBy = require( '@stdlib/utils/tabulate-by' ); - -var vals; -var arr; -var out; -var i; -var j; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const tabulateBy = require( '@stdlib/utils/tabulate-by' ); function indicator( value ) { return value[ 0 ]; } -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } // Generate a frequency table: -out = tabulateBy( arr, indicator ); +const out = tabulateBy( arr, indicator ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/tabulate/README.md b/lib/node_modules/@stdlib/utils/tabulate/README.md index a0575dbbe87a..c41c02940224 100644 --- a/lib/node_modules/@stdlib/utils/tabulate/README.md +++ b/lib/node_modules/@stdlib/utils/tabulate/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var tabulate = require( '@stdlib/utils/tabulate' ); +const tabulate = require( '@stdlib/utils/tabulate' ); ``` #### tabulate( collection ) @@ -45,9 +45,9 @@ var tabulate = require( '@stdlib/utils/tabulate' ); Generates a frequency table. ```javascript -var arr = [ 'beep', 'boop', 'foo', 'beep' ]; +const arr = [ 'beep', 'boop', 'foo', 'beep' ]; -var out = tabulate( arr ); +const out = tabulate( arr ); // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ] ``` @@ -82,27 +82,21 @@ The returned frequency table is an `array` of `arrays`. Each sub-array correspon ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var tabulate = require( '@stdlib/utils/tabulate' ); +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const tabulate = require( '@stdlib/utils/tabulate' ); -var vals; -var arr; -var out; -var i; -var j; - -vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; +const vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { - j = floor( randu()*vals.length ); +const arr = new Array( 100 ); +for ( let i = 0; i < arr.length; i++ ) { + const j = floor( randu()*vals.length ); arr[ i ] = vals[ j ]; } // Generate a frequency table: -out = tabulate( arr ); +const out = tabulate( arr ); console.log( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/thunk/README.md b/lib/node_modules/@stdlib/utils/thunk/README.md index 6e886620753b..8cd1b424308d 100644 --- a/lib/node_modules/@stdlib/utils/thunk/README.md +++ b/lib/node_modules/@stdlib/utils/thunk/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var thunk = require( '@stdlib/utils/thunk' ); +const thunk = require( '@stdlib/utils/thunk' ); ``` #### thunk( fcn\[, ...args] ) @@ -45,12 +45,12 @@ var thunk = require( '@stdlib/utils/thunk' ); Returns a [thunk][thunk] (i.e., an anonymous function having arity `0` and which invokes a provided function with specified arguments). ```javascript -var add = require( '@stdlib/math/base/ops/add' ); +const add = require( '@stdlib/math/base/ops/add' ); -var f = thunk( add, 2.0, 3.0 ); +const f = thunk( add, 2.0, 3.0 ); // returns -var v = f(); +let v = f(); // returns 5 // ... @@ -80,21 +80,20 @@ v = f(); ```javascript -var add = require( '@stdlib/math/base/ops/add' ); -var decorateAfter = require( '@stdlib/utils/decorate-after' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var thunk = require( '@stdlib/utils/thunk' ); +const add = require( '@stdlib/math/base/ops/add' ); +const decorateAfter = require( '@stdlib/utils/decorate-after' ); +const discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +const thunk = require( '@stdlib/utils/thunk' ); function log( v ) { console.log( v ); } // Create a PRNG for generating uniformly distributed pseudorandom integers: -var randi = discreteUniform( 100, 1000 ); +const randi = discreteUniform( 100, 1000 ); // Randomly delay evaluation of various thunks... -var i; -for ( i = 0; i < 10; i++ ) { +for ( let i = 0; i < 10; i++ ) { setTimeout( decorateAfter( thunk( add, i, i+1 ), 0, log ), randi() ); } ``` diff --git a/lib/node_modules/@stdlib/utils/timeit/README.md b/lib/node_modules/@stdlib/utils/timeit/README.md index 8f461cebe8de..0c0431a4f3b6 100644 --- a/lib/node_modules/@stdlib/utils/timeit/README.md +++ b/lib/node_modules/@stdlib/utils/timeit/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var timeit = require( '@stdlib/utils/timeit' ); +const timeit = require( '@stdlib/utils/timeit' ); ``` #### timeit( code, \[options,] clbk ) @@ -45,7 +45,7 @@ var timeit = require( '@stdlib/utils/timeit' ); Times a snippet. ```javascript -var code = 'var x = Math.pow( Math.random(), 3 );'; +let code = 'var x = Math.pow( Math.random(), 3 );'; code += 'if ( x !== x ) {'; code += 'throw new Error( \'Something went wrong.\' );'; code += '}'; @@ -85,15 +85,15 @@ The function supports the following `options`: To perform any setup or initialization, provide setup code. ```javascript -var setup = 'var randu = require( \'@stdlib/random/base/randu\' );'; +let setup = 'var randu = require( \'@stdlib/random/base/randu\' );'; setup += 'var pow = require( \'@stdlib/math/base/special/pow\' );'; -var code = 'var x = pow( randu(), 3 );'; +let code = 'var x = pow( randu(), 3 );'; code += 'if ( x !== x ) {'; code += 'throw new Error( \'Something went wrong.\' );'; code += '}'; -var opts = { +const opts = { 'before': setup }; @@ -110,19 +110,19 @@ function done( error, results ) { To perform any cleanup, provide cleanup code. ```javascript -var setup = 'var randu = require( \'@stdlib/random/base/randu\' );'; +let setup = 'var randu = require( \'@stdlib/random/base/randu\' );'; setup += 'var hypot = require( \'@stdlib/math/base/special/hypot\' );'; -var code = 'var h = hypot( randu()*10, randu()*10 );'; +let code = 'var h = hypot( randu()*10, randu()*10 );'; code += 'if ( h < 0 || h > 200 ) {'; code += 'throw new Error( \'Something went wrong.\' );'; code += '}'; -var cleanup = 'if ( h !== h ) {'; +let cleanup = 'if ( h !== h ) {'; cleanup += 'throw new Error( \'Something went wrong.\' );'; cleanup += '}'; -var opts = { +const opts = { 'before': setup, 'after': cleanup }; @@ -139,15 +139,19 @@ function done( error, results ) { To time an asynchronous snippet, set the `asynchronous` option to `true`. + + + + ```javascript -var code = 'var x = Math.pow( Math.random(), 3 );'; +let code = 'var x = Math.pow( Math.random(), 3 );'; code += 'if ( x !== x ) {'; code += 'var err = new Error( \'Something went wrong.\' );'; code += 'next( err );'; code += '}'; code += 'process.nextTick( next );'; -var opts = { +const opts = { 'iterations': 1e2, 'asynchronous': true }; @@ -181,6 +185,10 @@ function done( error ) { the implementation wraps the snippet within a function having the following signature + + + + ```javascript function wrapped( state, next ) { setTimeout( done, 0 ); @@ -196,6 +204,10 @@ function wrapped( state, next ) { The `state` parameter is simply an empty `{}` which allows the `before`, `after`, and `code` snippets to share state. + + + + ```javascript function before( state, next ) { state.counter = 0; @@ -214,9 +226,8 @@ function code( state, next ) { } function after( state, next ) { - var err; if ( state.counter !== state.counter ) { - err = new Error( 'Something went wrong!' ); + const err = new Error( 'Something went wrong!' ); return next( err ); } next(); @@ -253,14 +264,14 @@ function after( state, next ) { ```javascript -var join = require( 'path' ).join; -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var timeit = require( '@stdlib/utils/timeit' ); +const join = require( 'path' ).join; +const readFileSync = require( '@stdlib/fs/read-file' ).sync; +const timeit = require( '@stdlib/utils/timeit' ); -var before = readFileSync( join( __dirname, 'examples', 'before.txt' ), 'utf8' ); -var code = readFileSync( join( __dirname, 'examples', 'code.txt' ), 'utf8' ); +const before = readFileSync( join( __dirname, 'examples', 'before.txt' ), 'utf8' ); +const code = readFileSync( join( __dirname, 'examples', 'code.txt' ), 'utf8' ); -var opts = { +const opts = { 'iterations': 1e6, 'repeats': 5, 'before': before diff --git a/lib/node_modules/@stdlib/utils/try-catch/README.md b/lib/node_modules/@stdlib/utils/try-catch/README.md index b6055938e272..3493c98b1274 100644 --- a/lib/node_modules/@stdlib/utils/try-catch/README.md +++ b/lib/node_modules/@stdlib/utils/try-catch/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var trycatch = require( '@stdlib/utils/try-catch' ); +const trycatch = require( '@stdlib/utils/try-catch' ); ``` #### trycatch( x, y ) @@ -49,7 +49,7 @@ function x1() { return 1.0; } -var z = trycatch( x1, -1.0 ); +let z = trycatch( x1, -1.0 ); // returns 1.0 function x2() { @@ -81,11 +81,8 @@ z = trycatch( x2, -1.0 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var trycatch = require( '@stdlib/utils/try-catch' ); - -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const trycatch = require( '@stdlib/utils/try-catch' ); function x() { if ( randu() < 0.9 ) { @@ -94,8 +91,8 @@ function x() { return 'BOOP'; } -for ( i = 0; i < 100; i++ ) { - z = trycatch( x, 'beep' ); +for ( let i = 0; i < 100; i++ ) { + const z = trycatch( x, 'beep' ); console.log( z ); } ``` diff --git a/lib/node_modules/@stdlib/utils/try-function/README.md b/lib/node_modules/@stdlib/utils/try-function/README.md index ede41b4d8506..2ef579562a3d 100644 --- a/lib/node_modules/@stdlib/utils/try-function/README.md +++ b/lib/node_modules/@stdlib/utils/try-function/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var wrap = require( '@stdlib/utils/try-function' ); +const wrap = require( '@stdlib/utils/try-function' ); ``` #### wrap( fcn ) @@ -39,9 +39,9 @@ function fcn() { throw new Error( 'beep boop' ); } -var f = wrap( fcn ); +const f = wrap( fcn ); -var out = f(); +const out = f(); if ( out instanceof Error ) { console.error( out.message ); // => 'beep boop' @@ -52,16 +52,16 @@ The returned `function` has the same signature as the wrapped `function`. ```javascript function fcn( a, b, c, d ) { - var sum = a + b + c + d; + const sum = a + b + c + d; if ( sum < 10 ) { throw new Error( 'invalid arguments. Arguments must sum to a number greater than or equal to 10.' ); } return sum; } -var f = wrap( fcn ); +const f = wrap( fcn ); -var out = f( 5, 6, 7, 8 ); +let out = f( 5, 6, 7, 8 ); // returns 26 out = f( 1, 2, 3, 1 ); @@ -90,9 +90,9 @@ function done() { console.log( 'beep' ); } -var f = wrap( fcn ); +const f = wrap( fcn ); -var out = f( null, 5, done ); +let out = f( null, 5, done ); // returns out = f( true, null, done ); @@ -123,7 +123,7 @@ out = f( true, null, done ); ```javascript -var wrap = require( '@stdlib/utils/try-function' ); +const wrap = require( '@stdlib/utils/try-function' ); function beep( str ) { if ( typeof str !== 'string' ) { @@ -153,9 +153,9 @@ function done( str ) { } // Synchronous... -var f = wrap( beep ); +let f = wrap( beep ); -var out = f( 'boop' ); +let out = f( 'boop' ); console.log( out ); // => 'beep boop' diff --git a/lib/node_modules/@stdlib/utils/try-require/README.md b/lib/node_modules/@stdlib/utils/try-require/README.md index bf07b676a87a..e34214f24902 100644 --- a/lib/node_modules/@stdlib/utils/try-require/README.md +++ b/lib/node_modules/@stdlib/utils/try-require/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var tryRequire = require( '@stdlib/utils/try-require' ); +const tryRequire = require( '@stdlib/utils/try-require' ); ``` #### tryRequire( id ) @@ -45,7 +45,7 @@ var tryRequire = require( '@stdlib/utils/try-require' ); Wraps `require` in a `try/catch` block. If able to resolve a module `id`, the function returns the value bound to `module.exports` in the resolved module. Otherwise, the function returns an `Error`. ```javascript -var x = tryRequire( 'beep' ); +const x = tryRequire( 'beep' ); if ( x instanceof Error ) { console.log( x.message ); @@ -65,9 +65,9 @@ if ( x instanceof Error ) { - Use caution when attempting to resolve a relative path or a local module. This function attempts to resolve a module from its current path. Thus, the function is **unable** to resolve anything which is not along its search path. For local requires, use an absolute file path. ```javascript - var resolve = require( 'path' ).resolve; + const resolve = require( 'path' ).resolve; - var out = tryRequire( resolve( '/foo/bar/baz', '..', 'lib', 'beep.js' ) ); + const out = tryRequire( resolve( '/foo/bar/baz', '..', 'lib', 'beep.js' ) ); if ( out instanceof Error ) { console.error( out.message ); @@ -87,9 +87,9 @@ if ( x instanceof Error ) { ```javascript -var tryRequire = require( '@stdlib/utils/try-require' ); +const tryRequire = require( '@stdlib/utils/try-require' ); -var out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); +let out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); if ( out instanceof Error ) { console.error( out.message ); } else { diff --git a/lib/node_modules/@stdlib/utils/try-then/README.md b/lib/node_modules/@stdlib/utils/try-then/README.md index 4bb46f266a29..21ae09cf3b25 100644 --- a/lib/node_modules/@stdlib/utils/try-then/README.md +++ b/lib/node_modules/@stdlib/utils/try-then/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var trythen = require( '@stdlib/utils/try-then' ); +const trythen = require( '@stdlib/utils/try-then' ); ``` #### trythen( x, y ) @@ -57,7 +57,7 @@ function y() { return -1.0; } -var z = trythen( x1, y ); +let z = trythen( x1, y ); // returns 1.0 z = trythen( x2, y ); @@ -69,7 +69,7 @@ The function `y` is provided a single argument: - **error**: the error thrown by `x`. ```javascript -var randu = require( '@stdlib/random/base/randu' ); +const randu = require( '@stdlib/random/base/randu' ); function x() { if ( randu() < 0.5 ) { @@ -85,7 +85,7 @@ function y( err ) { return 'beeps'; } -var z = trythen( x, y ); +const z = trythen( x, y ); // returns ``` @@ -110,13 +110,10 @@ var z = trythen( x, y ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var ceil = require( '@stdlib/math/base/special/ceil' ); -var repeatString = require( '@stdlib/string/repeat' ); -var trythen = require( '@stdlib/utils/try-then' ); - -var z; -var i; +const randu = require( '@stdlib/random/base/randu' ); +const ceil = require( '@stdlib/math/base/special/ceil' ); +const repeatString = require( '@stdlib/string/repeat' ); +const trythen = require( '@stdlib/utils/try-then' ); function x() { if ( randu() < 0.9 ) { @@ -129,8 +126,8 @@ function y() { return repeatString( 'beep', ceil( randu()*5.0 ) ); } -for ( i = 0; i < 100; i++ ) { - z = trythen( x, y ); +for ( let i = 0; i < 100; i++ ) { + const z = trythen( x, y ); console.log( z ); } ``` diff --git a/lib/node_modules/@stdlib/utils/type-max/README.md b/lib/node_modules/@stdlib/utils/type-max/README.md index 0f19094fd6fe..eb9da69d3f65 100644 --- a/lib/node_modules/@stdlib/utils/type-max/README.md +++ b/lib/node_modules/@stdlib/utils/type-max/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typemax = require( '@stdlib/utils/type-max' ); +const typemax = require( '@stdlib/utils/type-max' ); ``` #### typemax( dtype ) @@ -45,7 +45,7 @@ var typemax = require( '@stdlib/utils/type-max' ); Returns the maximum value of a specified numeric type. ```javascript -var m = typemax( 'int8' ); +const m = typemax( 'int8' ); // returns 127 ``` @@ -83,9 +83,9 @@ The following numeric types are supported: ```javascript -var typemax = require( '@stdlib/utils/type-max' ); +const typemax = require( '@stdlib/utils/type-max' ); -var m = typemax( 'float64' ); +let m = typemax( 'float64' ); // returns Infinity m = typemax( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/type-min/README.md b/lib/node_modules/@stdlib/utils/type-min/README.md index 055548bf43b9..b8d41323dabf 100644 --- a/lib/node_modules/@stdlib/utils/type-min/README.md +++ b/lib/node_modules/@stdlib/utils/type-min/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var typemin = require( '@stdlib/utils/type-min' ); +const typemin = require( '@stdlib/utils/type-min' ); ``` #### typemin( dtype ) @@ -45,7 +45,7 @@ var typemin = require( '@stdlib/utils/type-min' ); Returns the minimum value of a specified numeric type. ```javascript -var m = typemin( 'int8' ); +const m = typemin( 'int8' ); // returns -128 ``` @@ -83,9 +83,9 @@ The following numeric types are supported: ```javascript -var typemin = require( '@stdlib/utils/type-min' ); +const typemin = require( '@stdlib/utils/type-min' ); -var m = typemin( 'float64' ); +let m = typemin( 'float64' ); // returns -Infinity m = typemin( 'float32' ); diff --git a/lib/node_modules/@stdlib/utils/type-of/README.md b/lib/node_modules/@stdlib/utils/type-of/README.md index ba3e6d17f7d5..a762eba0331d 100644 --- a/lib/node_modules/@stdlib/utils/type-of/README.md +++ b/lib/node_modules/@stdlib/utils/type-of/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var typeOf = require( '@stdlib/utils/type-of' ); +const typeOf = require( '@stdlib/utils/type-of' ); ``` #### typeOf( value ) @@ -35,7 +35,7 @@ var typeOf = require( '@stdlib/utils/type-of' ); Returns a value's type. ```javascript -var str = typeOf( 'a' ); +let str = typeOf( 'a' ); // returns 'string' str = typeOf( 5 ); @@ -105,20 +105,20 @@ str = typeOf( 5 ); ```javascript -var Float32Array = require( '@stdlib/array/float32' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Int8Array = require( '@stdlib/array/int8' ); -var Int16Array = require( '@stdlib/array/int16' ); -var Int32Array = require( '@stdlib/array/int32' ); -var Uint8Array = require( '@stdlib/array/uint8' ); -var Uint8ClampedArray = require( '@stdlib/array/uint8c' ); -var Uint16Array = require( '@stdlib/array/uint16' ); -var Uint32Array = require( '@stdlib/array/uint32' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var typeOf = require( '@stdlib/utils/type-of' ); - -var str = typeOf( 'a' ); +const Float32Array = require( '@stdlib/array/float32' ); +const Float64Array = require( '@stdlib/array/float64' ); +const Int8Array = require( '@stdlib/array/int8' ); +const Int16Array = require( '@stdlib/array/int16' ); +const Int32Array = require( '@stdlib/array/int32' ); +const Uint8Array = require( '@stdlib/array/uint8' ); +const Uint8ClampedArray = require( '@stdlib/array/uint8c' ); +const Uint16Array = require( '@stdlib/array/uint16' ); +const Uint32Array = require( '@stdlib/array/uint32' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const typeOf = require( '@stdlib/utils/type-of' ); + +let str = typeOf( 'a' ); // returns 'string' str = typeOf( 5 ); @@ -232,11 +232,11 @@ function Person1() { str = typeOf( new Person1() ); // returns 'person1' -var Person2 = function () { +const Person2 = function () { return this; }; str = typeOf( new Person2() ); -// returns '' +// returns ``` diff --git a/lib/node_modules/@stdlib/utils/uncapitalize-keys/README.md b/lib/node_modules/@stdlib/utils/uncapitalize-keys/README.md index 16416233c2d3..f7f66e5288c8 100644 --- a/lib/node_modules/@stdlib/utils/uncapitalize-keys/README.md +++ b/lib/node_modules/@stdlib/utils/uncapitalize-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' ); +const uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' ); ``` #### uncapitalizeKeys( obj ) @@ -45,12 +45,12 @@ var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' ); Converts the first letter of each `object` key to lowercase, mapping the transformed keys to a new `object` having the same values. ```javascript -var obj1 = { +const obj1 = { 'BeepBoop': 1, 'FooBar': 2 }; -var obj2 = uncapitalizeKeys( obj1 ); +const obj2 = uncapitalizeKeys( obj1 ); // returns { 'beepBoop': 1, 'fooBar': 2 } ``` @@ -80,16 +80,16 @@ var obj2 = uncapitalizeKeys( obj1 ); ```javascript -var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' ); +const uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' ); -var obj1 = { +const obj1 = { 'AA': 'beep', 'BB': 'boop', 'CC': 'foo', 'DD': 'bar' }; -var obj2 = uncapitalizeKeys( obj1 ); +const obj2 = uncapitalizeKeys( obj1 ); console.dir( obj2 ); // => { 'aA': 'beep', 'bB': 'boop', 'cC': 'foo', 'dD': 'bar' } diff --git a/lib/node_modules/@stdlib/utils/uncurry-right/README.md b/lib/node_modules/@stdlib/utils/uncurry-right/README.md index e9b4560dc915..07f57fef483f 100644 --- a/lib/node_modules/@stdlib/utils/uncurry-right/README.md +++ b/lib/node_modules/@stdlib/utils/uncurry-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var uncurryRight = require( '@stdlib/utils/uncurry-right' ); +const uncurryRight = require( '@stdlib/utils/uncurry-right' ); ``` #### uncurryRight( fcn\[, arity]\[, thisArg] ) @@ -53,9 +53,9 @@ function add( y ) { }; } -var fcn = uncurryRight( add ); +const fcn = uncurryRight( add ); -var sum = fcn( 3, 2 ); +const sum = fcn( 3, 2 ); // returns 5 ``` @@ -72,9 +72,9 @@ function add( y ) { }; } -var fcn = uncurryRight( add, 2 ); +const fcn = uncurryRight( add, 2 ); -var sum = fcn( 9 ); +const sum = fcn( 9 ); // throws ``` @@ -92,9 +92,9 @@ function addX( x ) { return x + this.y; } -var fcn = uncurryRight( addY, {} ); +const fcn = uncurryRight( addY, {} ); -var sum = fcn( 3, 2 ); +const sum = fcn( 3, 2 ); // returns 5 ``` @@ -114,9 +114,9 @@ function addX( x ) { return x + this.y; } -var fcn = uncurryRight( addY, 2, {} ); +const fcn = uncurryRight( addY, 2, {} ); -var sum = fcn( 3, 2 ); +let sum = fcn( 3, 2 ); // returns 5 sum = fcn( 4 ); @@ -148,25 +148,14 @@ sum = fcn( 4 ); ```javascript -var fromCodePoint = require( '@stdlib/string/from-code-point' ); -var curryRight = require( '@stdlib/utils/curry-right' ); -var uncurryRight = require( '@stdlib/utils/uncurry-right' ); - -var uncurried; -var curried; -var abcs; -var out; -var a; -var i; +const fromCodePoint = require( '@stdlib/string/from-code-point' ); +const curryRight = require( '@stdlib/utils/curry-right' ); +const uncurryRight = require( '@stdlib/utils/uncurry-right' ); function concat() { - var len; - var out; - var i; - - len = arguments.length; - out = ''; - for ( i = 0; i < len; i++ ) { + const len = arguments.length; + let out = ''; + for ( let i = 0; i < len; i++ ) { out += arguments[ i ]; if ( i < len-1 ) { out += ','; @@ -176,27 +165,27 @@ function concat() { } // Character codes: -a = 97; +const a = 97; -abcs = new Array( 26 ); -for ( i = 0; i < abcs.length; i++ ) { +const abcs = new Array( 26 ); +for ( let i = 0; i < abcs.length; i++ ) { abcs[ i ] = fromCodePoint( a + i ); } -out = concat.apply( null, abcs ); +let out = concat.apply( null, abcs ); // returns 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z' // Transform `concat` into a right curried function: -curried = curryRight( concat, 26 ); +const curried = curryRight( concat, 26 ); out = curried; -for ( i = abcs.length-1; i >= 0; i-- ) { +for ( let i = abcs.length-1; i >= 0; i-- ) { out = out( abcs[ i ] ); } console.log( out ); // => 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z' // Uncurry a right curried function: -uncurried = uncurryRight( curried ); +const uncurried = uncurryRight( curried ); out = uncurried.apply( null, abcs ); // returns 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z' diff --git a/lib/node_modules/@stdlib/utils/uncurry/README.md b/lib/node_modules/@stdlib/utils/uncurry/README.md index f11a2a88b319..80e01ba7b3b5 100644 --- a/lib/node_modules/@stdlib/utils/uncurry/README.md +++ b/lib/node_modules/@stdlib/utils/uncurry/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var uncurry = require( '@stdlib/utils/uncurry' ); +const uncurry = require( '@stdlib/utils/uncurry' ); ``` #### uncurry( fcn\[, arity]\[, thisArg] ) @@ -53,9 +53,9 @@ function add( x ) { }; } -var fcn = uncurry( add ); +const fcn = uncurry( add ); -var sum = fcn( 2, 3 ); +const sum = fcn( 2, 3 ); // returns 5 ``` @@ -72,9 +72,9 @@ function add( x ) { }; } -var fcn = uncurry( add, 2 ); +const fcn = uncurry( add, 2 ); -var sum = fcn( 9 ); +const sum = fcn( 9 ); // throws ``` @@ -92,9 +92,9 @@ function addY( y ) { return this.x + y; } -var fcn = uncurry( addX, {} ); +const fcn = uncurry( addX, {} ); -var sum = fcn( 2, 3 ); +const sum = fcn( 2, 3 ); // returns 5 ``` @@ -114,9 +114,9 @@ function addY( y ) { return this.x + y; } -var fcn = uncurry( addX, 2, {} ); +const fcn = uncurry( addX, 2, {} ); -var sum = fcn( 2, 3 ); +let sum = fcn( 2, 3 ); // returns 5 sum = fcn( 4 ); @@ -144,33 +144,27 @@ sum = fcn( 4 ); ```javascript -var curry = require( '@stdlib/utils/curry' ); -var uncurry = require( '@stdlib/utils/uncurry' ); - -var uncurried; -var curried; -var bool; -var out; -var i; +const curry = require( '@stdlib/utils/curry' ); +const uncurry = require( '@stdlib/utils/uncurry' ); function add( x, y, z, w, t, s ) { return x + y + z + w + t + s; } -out = add( 0, 10, 20, 30, 40, 50 ); +let out = add( 0, 10, 20, 30, 40, 50 ); // returns 150 // Transform `add` into a curried function: -curried = curry( add ); +const curried = curry( add ); out = curried; -for ( i = 0; i < add.length; i++ ) { +for ( let i = 0; i < add.length; i++ ) { out = out( i*10 ); } -bool = ( out === 150 ); +const bool = ( out === 150 ); // returns true // Uncurry a curried function: -uncurried = uncurry( curried ); +const uncurried = uncurry( curried ); out = uncurried( 0, 10, 20, 30, 40, 50 ); // returns 150 diff --git a/lib/node_modules/@stdlib/utils/unshift/README.md b/lib/node_modules/@stdlib/utils/unshift/README.md index d9be93c0bfaf..590a41d87a5b 100644 --- a/lib/node_modules/@stdlib/utils/unshift/README.md +++ b/lib/node_modules/@stdlib/utils/unshift/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var unshift = require( '@stdlib/utils/unshift' ); +const unshift = require( '@stdlib/utils/unshift' ); ``` #### unshift( collection, ...items ) @@ -45,31 +45,31 @@ var unshift = require( '@stdlib/utils/unshift' ); Adds one or more elements to the beginning of a `collection`. A `collection` may be either an [`Array`][mdn-array], [`Typed Array`][mdn-typed-array], or an array-like [`Object`][mdn-object] (i.e., an [`Object`][mdn-object] having a valid writable `length` property). ```javascript -var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +const arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; -var out = unshift( arr, 6.0, 7.0 ); +const out = unshift( arr, 6.0, 7.0 ); // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] -var bool = ( out === arr ); +const bool = ( out === arr ); // returns true ``` In contrast to [`Array.prototype.unshift`][mdn-array-unshift], the function returns the extended collection, rather than the collection length. For [typed arrays][mdn-typed-array], the returned value is a new [typed array][mdn-typed-array] view whose underlying [`ArrayBuffer`][mdn-arraybuffer] may **not** equal the underlying [`ArrayBuffer`][mdn-arraybuffer] for the input `collection`. ```javascript -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var Float64Array = require( '@stdlib/array/float64' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const Float64Array = require( '@stdlib/array/float64' ); -var buf = new ArrayBuffer( 3*8 ); // 8 bytes per double +const buf = new ArrayBuffer( 3*8 ); // 8 bytes per double -var arr = new Float64Array( buf, 8, 2 ); +const arr = new Float64Array( buf, 8, 2 ); arr[ 0 ] = 1.0; arr[ 1 ] = 2.0; -var out = unshift( arr, 3.0 ); +let out = unshift( arr, 3.0 ); // returns [ 3.0, 1.0, 2.0 ] -var bool = ( out === arr ); +let bool = ( out === arr ); // returns false bool = ( out.buffer === arr.buffer ); @@ -108,14 +108,11 @@ bool = ( out.buffer === arr.buffer ); ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var unshift = require( '@stdlib/utils/unshift' ); +const Float64Array = require( '@stdlib/array/float64' ); +const unshift = require( '@stdlib/utils/unshift' ); -var arr; -var i; - -arr = new Float64Array(); -for ( i = 0; i < 100; i++ ) { +let arr = new Float64Array(); +for ( let i = 0; i < 100; i++ ) { arr = unshift( arr, i ); } console.log( arr ); diff --git a/lib/node_modules/@stdlib/utils/until-each-right/README.md b/lib/node_modules/@stdlib/utils/until-each-right/README.md index 1e476a11e229..ec8968d5335b 100644 --- a/lib/node_modules/@stdlib/utils/until-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/until-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var untilEachRight = require( '@stdlib/utils/until-each-right' ); +const untilEachRight = require( '@stdlib/utils/until-each-right' ); ``` #### untilEachRight( collection, predicate, fcn\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; untilEachRight( arr, predicate, log ); /* => @@ -72,8 +72,8 @@ Both the `predicate` function and the `function` to apply are provided three arg Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function predicate( value ) { return ( value !== value ); @@ -127,16 +127,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; untilEachRight( arr, predicate, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 3.0 ``` @@ -167,7 +167,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; untilEachRight( arr, predicate, log ); /* => @@ -193,14 +193,12 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var untilEachRight = require( '@stdlib/utils/until-each-right' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const untilEachRight = require( '@stdlib/utils/until-each-right' ); -var arr; -var i; -var j; +let i; function predicate( value ) { return ( value !== value ); @@ -216,8 +214,8 @@ function log( value, index, collection ) { } } -arr = new Array( 100 ); -j = floor( randu()*arr.length ); +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); for ( i = arr.length-1; i >= 0; i-- ) { if ( i === j ) { arr[ i ] = NaN; diff --git a/lib/node_modules/@stdlib/utils/until-each/README.md b/lib/node_modules/@stdlib/utils/until-each/README.md index cf65ee6c34e0..55372c60c3d5 100644 --- a/lib/node_modules/@stdlib/utils/until-each/README.md +++ b/lib/node_modules/@stdlib/utils/until-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var untilEach = require( '@stdlib/utils/until-each' ); +const untilEach = require( '@stdlib/utils/until-each' ); ``` #### untilEach( collection, predicate, fcn\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; untilEach( arr, predicate, log ); /* => @@ -83,7 +83,7 @@ function log1( value, index, collection ) { } } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; untilEach( arr, predicate, log1 ); /* => @@ -125,16 +125,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; untilEach( arr, predicate, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.0 ``` @@ -165,7 +165,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; untilEach( arr, predicate, log ); /* => @@ -191,10 +191,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var untilEach = require( '@stdlib/utils/until-each' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const untilEach = require( '@stdlib/utils/until-each' ); function predicate( value ) { return ( value !== value ); @@ -209,13 +209,9 @@ function log( value, index, collection ) { } } -var arr; -var j; -var i; - -arr = new Array( 100 ); -j = floor( randu()*arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); +for ( let i = 0; i < arr.length; i++ ) { if ( i === j ) { arr[ i ] = NaN; } else { diff --git a/lib/node_modules/@stdlib/utils/until/README.md b/lib/node_modules/@stdlib/utils/until/README.md index a68964ebd430..efafddf6ef4c 100644 --- a/lib/node_modules/@stdlib/utils/until/README.md +++ b/lib/node_modules/@stdlib/utils/until/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var until = require( '@stdlib/utils/until' ); +const until = require( '@stdlib/utils/until' ); ``` #### until( predicate, fcn\[, thisArg ] ) @@ -78,7 +78,7 @@ function count() { this.count += 1; } -var context = { +const context = { 'count': 0 }; @@ -109,8 +109,8 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var until = require( '@stdlib/utils/until' ); +const randu = require( '@stdlib/random/base/randu' ); +const until = require( '@stdlib/utils/until' ); function predicate() { return ( randu() <= 0.05 ); diff --git a/lib/node_modules/@stdlib/utils/unzip/README.md b/lib/node_modules/@stdlib/utils/unzip/README.md index 5612d1994908..782b51898ad5 100644 --- a/lib/node_modules/@stdlib/utils/unzip/README.md +++ b/lib/node_modules/@stdlib/utils/unzip/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var unzip = require( '@stdlib/utils/unzip' ); +const unzip = require( '@stdlib/utils/unzip' ); ``` #### unzip( arr\[, idx] ) @@ -41,18 +41,18 @@ var unzip = require( '@stdlib/utils/unzip' ); Unzips a [zipped array][@stdlib/utils/zip] (i.e., a nested `array` of tuples). ```javascript -var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ]; +const arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ]; -var out = unzip( arr ); +const out = unzip( arr ); // returns [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]; ``` To unzip specific tuple elements, you can provide an `array` of indices as an optional second argument. ```javascript -var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ]; +const arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ]; -var out = unzip( arr, [ 0, 2 ] ); +const out = unzip( arr, [ 0, 2 ] ); // returns [ [ 1, 2 ], [ 3, 4 ] ]; ``` @@ -67,23 +67,21 @@ var out = unzip( arr, [ 0, 2 ] ); ```javascript -var unzip = require( '@stdlib/utils/unzip' ); -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var pow = require( '@stdlib/math/base/special/pow' ); +const unzip = require( '@stdlib/utils/unzip' ); +const round = require( '@stdlib/math/base/special/round' ); +const randu = require( '@stdlib/random/base/randu' ); +const pow = require( '@stdlib/math/base/special/pow' ); -var arr = new Array( 100 ); -var len = 5; +const arr = new Array( 100 ); +const len = 5; -var i; -var j; -for ( i = 0; i < arr.length; i++ ) { +for ( let i = 0; i < arr.length; i++ ) { arr[ i ] = new Array( len ); - for ( j = 0; j < len; j++ ) { + for ( let j = 0; j < len; j++ ) { arr[ i ][ j ] = round( randu() * pow(10, j) ); } } -var out = unzip( arr ); +const out = unzip( arr ); console.dir( out ); ``` diff --git a/lib/node_modules/@stdlib/utils/uppercase-keys/README.md b/lib/node_modules/@stdlib/utils/uppercase-keys/README.md index 1643a39e6830..037c5117c7d8 100644 --- a/lib/node_modules/@stdlib/utils/uppercase-keys/README.md +++ b/lib/node_modules/@stdlib/utils/uppercase-keys/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var uppercaseKeys = require( '@stdlib/utils/uppercase-keys' ); +const uppercaseKeys = require( '@stdlib/utils/uppercase-keys' ); ``` #### uppercaseKeys( obj ) @@ -45,12 +45,12 @@ var uppercaseKeys = require( '@stdlib/utils/uppercase-keys' ); Converts each `object` key to uppercase, mapping the transformed keys to a new `object` having the same values. ```javascript -var obj1 = { +const obj1 = { 'a': 1, 'b': 2 }; -var obj2 = uppercaseKeys( obj1 ); +const obj2 = uppercaseKeys( obj1 ); // returns { 'A': 1, 'B': 2 } ``` @@ -80,16 +80,16 @@ var obj2 = uppercaseKeys( obj1 ); ```javascript -var uppercaseKeys = require( '@stdlib/utils/uppercase-keys' ); +const uppercaseKeys = require( '@stdlib/utils/uppercase-keys' ); -var obj1 = { +const obj1 = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' }; -var obj2 = uppercaseKeys( obj1 ); +const obj2 = uppercaseKeys( obj1 ); console.dir( obj2 ); // => { 'A': 'beep', 'B': 'boop', 'C': 'foo', 'D': 'bar' } diff --git a/lib/node_modules/@stdlib/utils/values-in/README.md b/lib/node_modules/@stdlib/utils/values-in/README.md index 75dc8bc3b446..e4fb91b59c9c 100644 --- a/lib/node_modules/@stdlib/utils/values-in/README.md +++ b/lib/node_modules/@stdlib/utils/values-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectValuesIn = require( '@stdlib/utils/values-in' ); +const objectValuesIn = require( '@stdlib/utils/values-in' ); ``` #### objectValuesIn( obj ) @@ -42,9 +42,9 @@ function Foo() { Foo.prototype.b = 2; -var obj = new Foo(); +const obj = new Foo(); -var values = objectValuesIn( obj ); +const values = objectValuesIn( obj ); // e.g., returns [ 1, 2 ] ``` @@ -69,7 +69,7 @@ var values = objectValuesIn( obj ); ```javascript -var objectValuesIn = require( '@stdlib/utils/values-in' ); +const objectValuesIn = require( '@stdlib/utils/values-in' ); function Foo() { this.beep = 'boop'; @@ -81,8 +81,8 @@ function Foo() { Foo.prototype.foo = [ 'bar' ]; -var obj = new Foo(); -var values = objectValuesIn( obj ); +const obj = new Foo(); +const values = objectValuesIn( obj ); console.log( values ); // e.g., => [ 'boop', {'b':'c'}, [ 'bar' ] ] diff --git a/lib/node_modules/@stdlib/utils/values/README.md b/lib/node_modules/@stdlib/utils/values/README.md index acbe4927b5c6..4a1cc5f7ba6d 100644 --- a/lib/node_modules/@stdlib/utils/values/README.md +++ b/lib/node_modules/@stdlib/utils/values/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var objectValues = require( '@stdlib/utils/values' ); +const objectValues = require( '@stdlib/utils/values' ); ``` #### objectValues( obj ) @@ -35,12 +35,12 @@ var objectValues = require( '@stdlib/utils/values' ); Returns an `array` of an object's own enumerable property values. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var vals = objectValues( obj ); +const vals = objectValues( obj ); // e.g., returns [ 1, 2 ] ``` @@ -65,9 +65,9 @@ var vals = objectValues( obj ); ```javascript -var objectValues = require( '@stdlib/utils/values' ); +const objectValues = require( '@stdlib/utils/values' ); -var obj = { +const obj = { 'beep': 'boop', 'a': { 'b': 'c' @@ -75,7 +75,7 @@ var obj = { 'foo': [ 'bar' ] }; -var vals = objectValues( obj ); +const vals = objectValues( obj ); // e.g., returns [ 'boop', {'b':'c'}, [ 'bar' ] ] ``` diff --git a/lib/node_modules/@stdlib/utils/while-each-right/README.md b/lib/node_modules/@stdlib/utils/while-each-right/README.md index a76f920b4be3..e7dfac3eb544 100644 --- a/lib/node_modules/@stdlib/utils/while-each-right/README.md +++ b/lib/node_modules/@stdlib/utils/while-each-right/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var whileEachRight = require( '@stdlib/utils/while-each-right' ); +const whileEachRight = require( '@stdlib/utils/while-each-right' ); ``` #### whileEachRight( collection, predicate, fcn\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; whileEachRight( arr, predicate, log ); /* => @@ -72,8 +72,8 @@ Both the `predicate` function and the `function` to apply are provided three arg Basic support for dynamic collections is provided. Note, however, that index incrementation is **not** guaranteed to be monotonically **decreasing**. ```javascript -var arr = [ 1, 2, 3, 4 ]; -var i = 0; +let arr = [ 1, 2, 3, 4 ]; +let i = 0; function predicate( value ) { return ( value === value ); @@ -127,16 +127,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, NaN, 2, 3, 4 ]; +const arr = [ 1, NaN, 2, 3, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; whileEachRight( arr, predicate, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 3.0 ``` @@ -167,7 +167,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; whileEachRight( arr, predicate, log ); /* => @@ -193,14 +193,12 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var whileEachRight = require( '@stdlib/utils/while-each-right' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const whileEachRight = require( '@stdlib/utils/while-each-right' ); -var arr; -var i; -var j; +let i; function predicate( value ) { return ( value === value ); @@ -216,8 +214,8 @@ function log( value, index, collection ) { } } -arr = new Array( 100 ); -j = floor( randu()*arr.length ); +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); for ( i = arr.length-1; i >= 0; i-- ) { if ( i === j ) { arr[ i ] = NaN; diff --git a/lib/node_modules/@stdlib/utils/while-each/README.md b/lib/node_modules/@stdlib/utils/while-each/README.md index f2f3dcf3fd73..ed77d252e005 100644 --- a/lib/node_modules/@stdlib/utils/while-each/README.md +++ b/lib/node_modules/@stdlib/utils/while-each/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var whileEach = require( '@stdlib/utils/while-each' ); +const whileEach = require( '@stdlib/utils/while-each' ); ``` #### whileEach( collection, predicate, fcn\[, thisArg ] ) @@ -53,7 +53,7 @@ function log( value, index ) { console.log( '%s: %d', index, value ); } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; whileEach( arr, predicate, log ); /* => @@ -83,7 +83,7 @@ function log1( value, index, collection ) { } } -var arr = [ 1, 2, 3, 4 ]; +let arr = [ 1, 2, 3, 4 ]; whileEach( arr, predicate, log1 ); /* => @@ -125,16 +125,16 @@ function sum( value ) { this.count += 1; } -var arr = [ 1, 2, 3, NaN, 4 ]; +const arr = [ 1, 2, 3, NaN, 4 ]; -var context = { +const context = { 'sum': 0, 'count': 0 }; whileEach( arr, predicate, sum, context ); -var mean = context.sum / context.count; +const mean = context.sum / context.count; // returns 2.0 ``` @@ -165,7 +165,7 @@ var mean = context.sum / context.count; console.log( '%s: %s', index, value ); } - var arr = [ 1, , , 4 ]; + const arr = [ 1, , , 4 ]; whileEach( arr, predicate, log ); /* => @@ -191,10 +191,10 @@ var mean = context.sum / context.count; ```javascript -var isEven = require( '@stdlib/assert/is-even' ).isPrimitive; -var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); -var whileEach = require( '@stdlib/utils/while-each' ); +const isEven = require( '@stdlib/assert/is-even' ).isPrimitive; +const randu = require( '@stdlib/random/base/randu' ); +const floor = require( '@stdlib/math/base/special/floor' ); +const whileEach = require( '@stdlib/utils/while-each' ); function predicate( value ) { return ( value === value ); @@ -209,13 +209,9 @@ function log( value, index, collection ) { } } -var arr; -var j; -var i; - -arr = new Array( 100 ); -j = floor( randu()*arr.length ); -for ( i = 0; i < arr.length; i++ ) { +const arr = new Array( 100 ); +const j = floor( randu()*arr.length ); +for ( let i = 0; i < arr.length; i++ ) { if ( i === j ) { arr[ i ] = NaN; } else { diff --git a/lib/node_modules/@stdlib/utils/while/README.md b/lib/node_modules/@stdlib/utils/while/README.md index f6b0a535b38c..9025eb7b8c0f 100644 --- a/lib/node_modules/@stdlib/utils/while/README.md +++ b/lib/node_modules/@stdlib/utils/while/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var whilst = require( '@stdlib/utils/while' ); +const whilst = require( '@stdlib/utils/while' ); ``` #### whilst( predicate, fcn\[, thisArg ] ) @@ -78,7 +78,7 @@ function count() { this.count += 1; } -var context = { +const context = { 'count': 0 }; @@ -109,8 +109,8 @@ console.log( context.count ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var whilst = require( '@stdlib/utils/while' ); +const randu = require( '@stdlib/random/base/randu' ); +const whilst = require( '@stdlib/utils/while' ); function predicate() { return ( randu() > 0.05 ); diff --git a/lib/node_modules/@stdlib/utils/writable-properties-in/README.md b/lib/node_modules/@stdlib/utils/writable-properties-in/README.md index dff382a8254a..4e8697e14400 100644 --- a/lib/node_modules/@stdlib/utils/writable-properties-in/README.md +++ b/lib/node_modules/@stdlib/utils/writable-properties-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); +const writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); ``` #### writablePropertiesIn( obj ) @@ -35,9 +35,9 @@ var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); Returns an `array` of an object's own and inherited writable property names and [symbols][@stdlib/symbol/ctor]. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; defineProperty( obj, 'a', { 'configurable': false, @@ -46,7 +46,7 @@ defineProperty( obj, 'a', { 'value': 'a' }); -var props = writablePropertiesIn( obj ); +const props = writablePropertiesIn( obj ); // returns [ 'a', ... ] ``` @@ -67,12 +67,12 @@ var props = writablePropertiesIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -111,8 +111,8 @@ if ( hasSymbols ) { }); } -var obj = new Foo(); -var props = writablePropertiesIn( obj ); +const obj = new Foo(); +const props = writablePropertiesIn( obj ); // e.g., returns [ 'a', 'foo', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/writable-properties/README.md b/lib/node_modules/@stdlib/utils/writable-properties/README.md index 992733b90115..da7f9a568520 100644 --- a/lib/node_modules/@stdlib/utils/writable-properties/README.md +++ b/lib/node_modules/@stdlib/utils/writable-properties/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writableProperties = require( '@stdlib/utils/writable-properties' ); +const writableProperties = require( '@stdlib/utils/writable-properties' ); ``` #### writableProperties( obj ) @@ -35,12 +35,12 @@ var writableProperties = require( '@stdlib/utils/writable-properties' ); Returns an `array` of an object's own writable property names and symbols. ```javascript -var obj = { +const obj = { 'a': 1, 'b': 2 }; -var props = writableProperties( obj ); +const props = writableProperties( obj ); // e.g., returns [ 'a', 'b' ] ``` @@ -65,12 +65,12 @@ var props = writableProperties( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var writableProperties = require( '@stdlib/utils/writable-properties' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const writableProperties = require( '@stdlib/utils/writable-properties' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -97,8 +97,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'c' ) ] = 'c'; } -var obj = new Foo(); -var props = writableProperties( obj ); +const obj = new Foo(); +const props = writableProperties( obj ); // e.g., returns [ 'a', ... ] ``` diff --git a/lib/node_modules/@stdlib/utils/writable-property-names-in/README.md b/lib/node_modules/@stdlib/utils/writable-property-names-in/README.md index e0ad75f26fa9..eea4a6b394d2 100644 --- a/lib/node_modules/@stdlib/utils/writable-property-names-in/README.md +++ b/lib/node_modules/@stdlib/utils/writable-property-names-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' ); +const writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' ); ``` #### writablePropertyNamesIn( obj ) @@ -35,9 +35,9 @@ var writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in Returns an `array` of an object's own and inherited writable property names. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'a': 'b' }; @@ -48,7 +48,7 @@ defineProperty( obj, 'c', { 'value': 'd' }); -var keys = writablePropertyNamesIn( obj ); +const keys = writablePropertyNamesIn( obj ); // e.g., returns [ 'a', ... ] ``` @@ -73,8 +73,8 @@ var keys = writablePropertyNamesIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' ); function Foo() { this.a = { @@ -97,8 +97,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = writablePropertyNamesIn( obj ); +const obj = new Foo(); +const keys = writablePropertyNamesIn( obj ); console.log( keys ); // e.g., => [ 'a', 'foo', ... ] diff --git a/lib/node_modules/@stdlib/utils/writable-property-names/README.md b/lib/node_modules/@stdlib/utils/writable-property-names/README.md index 27f2d364358d..f1b28ac4a071 100644 --- a/lib/node_modules/@stdlib/utils/writable-property-names/README.md +++ b/lib/node_modules/@stdlib/utils/writable-property-names/README.md @@ -29,7 +29,7 @@ limitations under the License. ```javascript -var writablePropertyNames = require( '@stdlib/utils/writable-property-names' ); +const writablePropertyNames = require( '@stdlib/utils/writable-property-names' ); ``` #### writablePropertyNames( obj ) @@ -37,9 +37,9 @@ var writablePropertyNames = require( '@stdlib/utils/writable-property-names' ); Returns an `array` of an object's own writable property names. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = { +const obj = { 'a': 'b' }; @@ -50,7 +50,7 @@ defineProperty( obj, 'c', { 'value': 'd' }); -var keys = writablePropertyNames( obj ); +const keys = writablePropertyNames( obj ); // returns [ 'a' ] ``` @@ -77,8 +77,8 @@ var keys = writablePropertyNames( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var writablePropertyNames = require( '@stdlib/utils/writable-property-names' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const writablePropertyNames = require( '@stdlib/utils/writable-property-names' ); function Foo() { this.a = { @@ -101,8 +101,8 @@ defineProperty( Foo.prototype, 'bip', { 'value': 'bop' }); -var obj = new Foo(); -var keys = writablePropertyNames( obj ); +const obj = new Foo(); +const keys = writablePropertyNames( obj ); console.log( keys ); // => [ 'a' ] diff --git a/lib/node_modules/@stdlib/utils/writable-property-symbols-in/README.md b/lib/node_modules/@stdlib/utils/writable-property-symbols-in/README.md index 8783778b0a6b..d89f1984d569 100644 --- a/lib/node_modules/@stdlib/utils/writable-property-symbols-in/README.md +++ b/lib/node_modules/@stdlib/utils/writable-property-symbols-in/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' ); +const writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' ); ``` #### writablePropertySymbolsIn( obj ) @@ -35,11 +35,11 @@ var writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbol Returns an `array` of an object's own and inherited writable symbol properties. ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -50,7 +50,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = writablePropertySymbolsIn( obj ); +const symbols = writablePropertySymbolsIn( obj ); ``` @@ -74,14 +74,12 @@ var symbols = writablePropertySymbolsIn( obj ); ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' ); -var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -104,8 +102,8 @@ if ( hasSymbols ) { }); } -obj = new Foo(); -symbols = writablePropertySymbolsIn( obj ); +const obj = new Foo(); +const symbols = writablePropertySymbolsIn( obj ); console.log( symbols ); ``` diff --git a/lib/node_modules/@stdlib/utils/writable-property-symbols/README.md b/lib/node_modules/@stdlib/utils/writable-property-symbols/README.md index f694bf9e4c15..99109306c350 100644 --- a/lib/node_modules/@stdlib/utils/writable-property-symbols/README.md +++ b/lib/node_modules/@stdlib/utils/writable-property-symbols/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' ); +const writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' ); ``` #### writablePropertySymbols( obj ) @@ -35,11 +35,11 @@ var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' Returns an `array` of an object's own writable symbol properties. ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var defineProperty = require( '@stdlib/utils/define-property' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const defineProperty = require( '@stdlib/utils/define-property' ); -var obj = {}; +const obj = {}; if ( hasSymbolSupport() ) { defineProperty( obj, Symbol( 'a' ), { @@ -50,7 +50,7 @@ if ( hasSymbolSupport() ) { }); } -var symbols = writablePropertySymbols( obj ); +const symbols = writablePropertySymbols( obj ); ``` @@ -74,11 +74,11 @@ var symbols = writablePropertySymbols( obj ); ```javascript -var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); -var Symbol = require( '@stdlib/symbol/ctor' ); -var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' ); +const hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); +const Symbol = require( '@stdlib/symbol/ctor' ); +const writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' ); -var hasSymbols = hasSymbolSupport(); +const hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -91,8 +91,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'bip' ) ] = 'bop'; } -var obj = new Foo(); -var symbols = writablePropertySymbols( obj ); +const obj = new Foo(); +const symbols = writablePropertySymbols( obj ); // e.g., returns [ Symbol( 'baz' ) ] ``` diff --git a/lib/node_modules/@stdlib/utils/zip/README.md b/lib/node_modules/@stdlib/utils/zip/README.md index 2d61ece61729..a5cc9d8197ee 100644 --- a/lib/node_modules/@stdlib/utils/zip/README.md +++ b/lib/node_modules/@stdlib/utils/zip/README.md @@ -33,7 +33,7 @@ limitations under the License. ## Usage ```javascript -var zip = require( '@stdlib/utils/zip' ); +const zip = require( '@stdlib/utils/zip' ); ``` #### zip( arr1, arr2,...\[, opts] ) @@ -41,14 +41,14 @@ var zip = require( '@stdlib/utils/zip' ); Returns an `array` of `arrays`, where the ith element (tuple) in the returned `array` contains the ith elements of the input `arrays`. ```javascript -var zipped = zip( [ 1, 2 ], [ 'a', 'b' ] ); +const zipped = zip( [ 1, 2 ], [ 'a', 'b' ] ); // returns [ [ 1, 'a' ], [ 2, 'b' ] ] ``` By default, the returned `array` length is the length of the shortest input `array`. ```javascript -var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ] ); +const zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ] ); // returns [ [ 1, 'a' ], [ 2, 'b' ] ] ``` @@ -61,23 +61,23 @@ The function accepts an `options` object with optional properties: To turn off truncation, ```javascript -var opts = { +const opts = { 'trunc': false }; -var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts ); +const zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts ); // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ] ``` A fill value is included in each tuple for each `array` which does not have an element at the ith index. By default, the fill value is `null`. To specify a different fill value, set the `fill` option. ```javascript -var opts = { +const opts = { 'trunc': false, 'fill': '' }; -var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts ); +const zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts ); // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, '' ] ] ``` @@ -86,10 +86,10 @@ If the function should interpret a single input `array` as an `array` of `arrays ```javascript -var arr = [ [ 1, 2 ], [ 'a', 'b' ] ]; +const arr = [ [ 1, 2 ], [ 'a', 'b' ] ]; // Default behavior: -var zipped = zip( arr ); +let zipped = zip( arr ); // returns [ [ [ 1, 2 ] ], [ [ 'a', 'b' ] ] ] // Array of arrays: @@ -108,24 +108,23 @@ zipped = zip( arr, { 'arrays': true } ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var zip = require( '@stdlib/utils/zip' ); +const randu = require( '@stdlib/random/base/randu' ); +const zip = require( '@stdlib/utils/zip' ); -var x = []; -var y1 = []; -var y2 = []; -var y3 = []; +const x = []; +const y1 = []; +const y2 = []; +const y3 = []; // Simulate some data... -var i; -for ( i = 0; i < 100; i++ ) { +for ( let i = 0; i < 100; i++ ) { x.push( Date.now() ); y1.push( randu() * 100 ); y2.push( randu() * 100 ); y3.push( randu() ); } -var zipped = zip( x, y1, y2, y3 ); +const zipped = zip( x, y1, y2, y3 ); console.log( zipped.join( '\n' ) ); ``` diff --git a/lib/node_modules/@stdlib/wasm/README.md b/lib/node_modules/@stdlib/wasm/README.md index cbeed1247abe..bb57185e39b4 100644 --- a/lib/node_modules/@stdlib/wasm/README.md +++ b/lib/node_modules/@stdlib/wasm/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/wasm' ); +const ns = require( '@stdlib/wasm' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/wasm' ); WebAssembly namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -66,8 +66,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/wasm' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/wasm' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/wasm/base/README.md b/lib/node_modules/@stdlib/wasm/base/README.md index 46a3e511e7c9..ed6a54764526 100644 --- a/lib/node_modules/@stdlib/wasm/base/README.md +++ b/lib/node_modules/@stdlib/wasm/base/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var ns = require( '@stdlib/wasm/base' ); +const ns = require( '@stdlib/wasm/base' ); ``` #### ns @@ -35,7 +35,7 @@ var ns = require( '@stdlib/wasm/base' ); Base WebAssembly namespace. ```javascript -var o = ns; +const o = ns; // returns {...} ``` @@ -67,8 +67,8 @@ The namespace contains the following: ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/wasm/base' ); +const objectKeys = require( '@stdlib/utils/keys' ); +const ns = require( '@stdlib/wasm/base' ); console.log( objectKeys( ns ) ); ``` diff --git a/lib/node_modules/@stdlib/wasm/base/array2dtype/README.md b/lib/node_modules/@stdlib/wasm/base/array2dtype/README.md index 86c75810282b..b95e13f9c6b9 100644 --- a/lib/node_modules/@stdlib/wasm/base/array2dtype/README.md +++ b/lib/node_modules/@stdlib/wasm/base/array2dtype/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var array2dtype = require( '@stdlib/wasm/base/array2dtype' ); +const array2dtype = require( '@stdlib/wasm/base/array2dtype' ); ``` #### array2dtype( array ) @@ -45,17 +45,17 @@ var array2dtype = require( '@stdlib/wasm/base/array2dtype' ); Returns the WebAssembly data type for a provided `array`. ```javascript -var Float64Array = require( '@stdlib/array/float64' ); -var arr = new Float64Array( 10 ); +const Float64Array = require( '@stdlib/array/float64' ); +const arr = new Float64Array( 10 ); -var dt = array2dtype( arr ); +const dt = array2dtype( arr ); // returns 'float64' ``` If provided an argument having "generic" or an unknown/unsupported [data type][@stdlib/array/dtypes], the function assumes that array values can be stored as double-precision floating-point numbers and returns `'float64'`. ```javascript -var dt = array2dtype( [] ); +const dt = array2dtype( [] ); // returns 'float64' ``` @@ -80,18 +80,16 @@ var dt = array2dtype( [] ); ```javascript -var dtypes = require( '@stdlib/array/dtypes' ); -var empty = require( '@stdlib/array/empty' ); -var array2dtype = require( '@stdlib/wasm/base/array2dtype' ); +const dtypes = require( '@stdlib/array/dtypes' ); +const empty = require( '@stdlib/array/empty' ); +const array2dtype = require( '@stdlib/wasm/base/array2dtype' ); // Get a list of supported array data types: -var dt = dtypes(); +const dt = dtypes(); // For each supported data type, create an array and return its WebAssembly data type... -var v; -var i; -for ( i = 0; i < dt.length; i++ ) { - v = array2dtype( empty( 10, dt[ i ] ) ); +for ( let i = 0; i < dt.length; i++ ) { + const v = array2dtype( empty( 10, dt[ i ] ) ); console.log( '%s => %s', dt[ i ], v ); } ``` diff --git a/lib/node_modules/@stdlib/wasm/base/arrays2ptrs/README.md b/lib/node_modules/@stdlib/wasm/base/arrays2ptrs/README.md index a6b8db7dd33d..e85cc26344a5 100644 --- a/lib/node_modules/@stdlib/wasm/base/arrays2ptrs/README.md +++ b/lib/node_modules/@stdlib/wasm/base/arrays2ptrs/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var arrays2ptrs = require( '@stdlib/wasm/base/arrays2ptrs' ); +const arrays2ptrs = require( '@stdlib/wasm/base/arrays2ptrs' ); ``` #### arrays2ptrs( ctx, arrays ) @@ -45,11 +45,11 @@ var arrays2ptrs = require( '@stdlib/wasm/base/arrays2ptrs' ); Converts a list of arrays to "pointers" (i.e., byte offsets) in WebAssembly [module memory][@stdlib/wasm/memory]. ```javascript -var defineProperty = require( '@stdlib/utils/define-property' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); +const defineProperty = require( '@stdlib/utils/define-property' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); -var buf = new ArrayBuffer( 64*1024 ); // 64KiB +let buf = new ArrayBuffer( 64*1024 ); // 64KiB function isView( arr ) { return ( arr.buffer === buf ); @@ -63,7 +63,7 @@ function view() { return new DataView( buf ); } -var ctx = { +const ctx = { 'isView': isView, 'realloc': realloc }; @@ -76,7 +76,7 @@ defineProperty( ctx, 'view', { // ... -var xobj = { +const xobj = { 'dtype': 'generic', 'wdtype': 'float64', 'length': 2, @@ -84,7 +84,7 @@ var xobj = { 'stride': 1, 'offset': 0 }; -var yobj = { +const yobj = { 'dtype': 'generic', 'wdtype': 'float64', 'length': 2, @@ -95,7 +95,7 @@ var yobj = { // ... -var ptrs = arrays2ptrs( ctx, [ xobj, yobj ] ); +const ptrs = arrays2ptrs( ctx, [ xobj, yobj ] ); // returns [...] ``` @@ -143,13 +143,13 @@ In addition to each element's existing properties, each element of the returned ```javascript -var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var ArrayBuffer = require( '@stdlib/array/buffer' ); -var DataView = require( '@stdlib/array/dataview' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); -var arrays2ptrs = require( '@stdlib/wasm/base/arrays2ptrs' ); +const setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); +const setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +const ArrayBuffer = require( '@stdlib/array/buffer' ); +const DataView = require( '@stdlib/array/dataview' ); +const Float64Array = require( '@stdlib/array/float64' ); +const dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); +const arrays2ptrs = require( '@stdlib/wasm/base/arrays2ptrs' ); function Context() { this._buffer = new ArrayBuffer( 100 ); @@ -170,16 +170,16 @@ setReadOnlyAccessor( Context.prototype, 'view', function getter() { // ... -var ctx = new Context(); +const ctx = new Context(); // ... -var x = new Float64Array( 4 ); -var y = new Float64Array( 4 ); +const x = new Float64Array( 4 ); +const y = new Float64Array( 4 ); // ... -var xobj = { +const xobj = { 'dtype': 'float64', 'wdtype': dtype2wasm( 'float64' ), 'length': x.length, @@ -188,7 +188,7 @@ var xobj = { 'offset': 0 }; -var yobj = { +const yobj = { 'dtype': 'float64', 'wdtype': dtype2wasm( 'float64' ), 'length': y.length, @@ -197,7 +197,7 @@ var yobj = { 'offset': 0 }; -var out = arrays2ptrs( ctx, [ xobj, yobj ] ); +const out = arrays2ptrs( ctx, [ xobj, yobj ] ); // returns [...] console.log( out ); diff --git a/lib/node_modules/@stdlib/wasm/base/dtype2wasm/README.md b/lib/node_modules/@stdlib/wasm/base/dtype2wasm/README.md index 0a37564d5119..6ded1598208c 100644 --- a/lib/node_modules/@stdlib/wasm/base/dtype2wasm/README.md +++ b/lib/node_modules/@stdlib/wasm/base/dtype2wasm/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); +const dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); ``` #### dtype2wasm( dtype ) @@ -45,7 +45,7 @@ var dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); Returns the WebAssembly data type associated with a provided array [data type][@stdlib/array/dtypes] value. ```javascript -var out = dtype2wasm( 'float64' ); +let out = dtype2wasm( 'float64' ); // returns 'float64' out = dtype2wasm( 'int8' ); @@ -55,7 +55,7 @@ out = dtype2wasm( 'int8' ); If provided an unknown or unsupported array data type, the function **assumes** that associated values can be stored as double-precision floating-point numbers and returns `'float64'`. ```javascript -var out = dtype2wasm( 'foobar' ); +const out = dtype2wasm( 'foobar' ); // returns 'float64' ``` @@ -80,9 +80,9 @@ var out = dtype2wasm( 'foobar' ); ```javascript -var dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); +const dtype2wasm = require( '@stdlib/wasm/base/dtype2wasm' ); -var dtypes = [ +const dtypes = [ 'float64', 'float32', 'int8', @@ -95,8 +95,7 @@ var dtypes = [ 'generic' ]; -var i; -for ( i = 0; i < dtypes.length; i++ ) { +for ( let i = 0; i < dtypes.length; i++ ) { console.log( '%s => %s', dtypes[ i ], dtype2wasm( dtypes[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/wasm/base/strided2object/README.md b/lib/node_modules/@stdlib/wasm/base/strided2object/README.md index 81d0f4d984f1..dfd79adf151d 100644 --- a/lib/node_modules/@stdlib/wasm/base/strided2object/README.md +++ b/lib/node_modules/@stdlib/wasm/base/strided2object/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var strided2object = require( '@stdlib/wasm/base/strided2object' ); +const strided2object = require( '@stdlib/wasm/base/strided2object' ); ``` #### strided2object( N, x, stride, offset ) @@ -45,7 +45,7 @@ var strided2object = require( '@stdlib/wasm/base/strided2object' ); Converts a strided array and associated metadata to an object likely to have the same "shape". ```javascript -var obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); +const obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); // returns {...} ``` @@ -96,14 +96,14 @@ var obj = strided2object( 4, [ 1, 2, 3, 4 ], 1, 0 ); ```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var strided2object = require( '@stdlib/wasm/base/strided2object' ); +const Complex64Array = require( '@stdlib/array/complex64' ); +const strided2object = require( '@stdlib/wasm/base/strided2object' ); // Create an array: -var x = new Complex64Array( 10 ); +const x = new Complex64Array( 10 ); // Convert to a standardized object: -var obj = strided2object( x.length, x, 1, 0 ); +const obj = strided2object( x.length, x, 1, 0 ); // returns {...} console.log( obj ); diff --git a/lib/node_modules/@stdlib/wasm/memory/README.md b/lib/node_modules/@stdlib/wasm/memory/README.md index 474982617ba7..ce874bf91ba7 100644 --- a/lib/node_modules/@stdlib/wasm/memory/README.md +++ b/lib/node_modules/@stdlib/wasm/memory/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Memory = require( '@stdlib/wasm/memory' ); +const Memory = require( '@stdlib/wasm/memory' ); ``` #### Memory( descriptor ) @@ -45,7 +45,7 @@ var Memory = require( '@stdlib/wasm/memory' ); Returns a new WebAssembly [memory][mdn-webassembly-memory] instance. ```javascript -var mem = new Memory({ +const mem = new Memory({ 'initial': 0 }); // returns @@ -66,11 +66,11 @@ The `descriptor` argument is an object which supports the following properties: **Read-only** property which returns the [`ArrayBuffer`][@stdlib/array/buffer] (or [`SharedArrayBuffer`][@stdlib/array/shared-buffer]) referenced by memory instance. ```javascript -var mem = new Memory({ +const mem = new Memory({ 'initial': 0 }); -var buf = mem.buffer; +const buf = mem.buffer; // returns ``` @@ -85,13 +85,13 @@ var buf = mem.buffer; Increases the size of the memory instance by a specified number of WebAssembly pages (i.e., 64KiB). ```javascript -var mem = new Memory({ +const mem = new Memory({ 'initial': 0 }); // ... -var prevSize = mem.grow( 1 ); +const prevSize = mem.grow( 1 ); ``` The method returns the size of the previous [`ArrayBuffer`][@stdlib/array/buffer] (or [`SharedArrayBuffer`][@stdlib/array/shared-buffer]). @@ -128,28 +128,25 @@ The method returns the size of the previous [`ArrayBuffer`][@stdlib/array/buffer ```javascript -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); -var DataView = require( '@stdlib/array/dataview' ); -var Memory = require( '@stdlib/wasm/memory' ); +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const DataView = require( '@stdlib/array/dataview' ); +const Memory = require( '@stdlib/wasm/memory' ); function main() { - var view; - var mem; - var v; if ( !hasWebAssemblySupport() ) { console.error( 'Environment does not support WebAssembly.' ); return; } - mem = new Memory({ + const mem = new Memory({ 'initial': 1 }); - view = new DataView( mem.buffer ); + const view = new DataView( mem.buffer ); view.setFloat64( 0, 3.14 ); // ... - v = view.getFloat64( 0 ); + const v = view.getFloat64( 0 ); console.log( v ); // => 3.14 } diff --git a/lib/node_modules/@stdlib/wasm/module-wrapper/README.md b/lib/node_modules/@stdlib/wasm/module-wrapper/README.md index 68aad0412482..de9c508f2c60 100644 --- a/lib/node_modules/@stdlib/wasm/module-wrapper/README.md +++ b/lib/node_modules/@stdlib/wasm/module-wrapper/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var Module = require( '@stdlib/wasm/module-wrapper' ); +const Module = require( '@stdlib/wasm/module-wrapper' ); ``` #### Module( binary, memory\[, imports] ) @@ -103,8 +103,8 @@ Returns a boolean indicating whether a provided list of values is a view of the ```javascript -var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); -var Module = require( '@stdlib/wasm/module-wrapper' ); +const hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); +const Module = require( '@stdlib/wasm/module-wrapper' ); function main() { if ( !hasWebAssemblySupport() ) {